﻿

var isIE7OrLower = false;

var browserIE6 = false;

      if ($.browser.msie && jQuery.browser.version.substr(0, 1) == "6") {
          
          browserIE6 = true;
          isIE7OrLower = true;
          
      }
      
    var browserIE7 = false;

      if ($.browser.msie && jQuery.browser.version.substr(0, 1) == "7") {
          
          browserIE7 = true;
          isIE7OrLower = true;
          
      }
      
      
     

        function checkFileExtensionImage(elem) {
            var filePath = elem.value;

            if(filePath.indexOf('.') == -1)
                return false;
            
            var validExtensions = new Array();
            var ext = filePath.substring(filePath.lastIndexOf('.') + 1).toLowerCase();
        
            validExtensions[0] = 'jpg';
            validExtensions[1] = 'jpeg';
            validExtensions[2] = 'bmp';        
            validExtensions[3] = 'gif';  
            validExtensions[4] = 'tiff';  
        
        
            for(var i = 0; i < validExtensions.length; i++) {
                if(ext == validExtensions[i])
                    return true;
            }

            alert('Allowed file types are .jpg, .jpeg, .gif, .bmp, or .tiff. Upload non-image files in the upload files section below.');
            elem.value = '';
            return false;
        }
        
        function checkFileExtensionFile(elem) {
            var filePath = elem.value;

            if(filePath.indexOf('.') == -1)
                return false;
            
            var validExtensions = new Array();
            var ext = filePath.substring(filePath.lastIndexOf('.') + 1).toLowerCase();
        

            
            validExtensions[0] = 'txt';
            validExtensions[1] = 'doc';
            validExtensions[2] = 'xls';
            validExtensions[3] = 'pdf';
            validExtensions[4] = 'docx';
            validExtensions[5] = 'xlsx';
        
            for(var i = 0; i < validExtensions.length; i++) {
                if(ext == validExtensions[i])
                    return true;
            }

            alert('Allowed file types are .xls, .txt, .doc, .pdf, .docx, .xlsx. Upload image files in the upload images section above.');
            elem.value = '';
            return false;
        }


      
      
        // javascript to add to your aspx page
        function ValidateModuleList()
        {
            try
            {
              var chkListModules= document.getElementById ('ctl00_cphMain_phTrades');
              //alert('<%= phTrades.ClientID %>');
              var chkListinputs = chkListModules.getElementsByTagName("input");
              //var spanAreaOfExpertiseSelected = $get("spanAreaOfExpertiseSelected");
              for (var i=0;i<chkListinputs .length;i++)
              {
                if (chkListinputs [i].checked)
                {
                  $('#spanAreaOfExpertiseSelected').hide();
                  
                  //At least one checkbox has been checked
                  return true;
                }
              }
              $('#spanAreaOfExpertiseSelected').show();
              return false;
            }
            catch(exception)
            {
                return true;
            }
        }
      
      
      function setFooter()
            {
               
                var height = $(main_container).height();
			    $('.footer').css("top", height + "px");
			    $('.footer').css("display", "block");
			    
			    var windowHeight = $(window).height();
			    var footerHeight = $('.footer').height();
			    if (height < (windowHeight - footerHeight))
			    {
			        $('.footer').css("top", windowHeight - footerHeight - 3 + "px");
			        $('.footer').css("display", "block");
			    }
            }
      
      
      

 // Make sure the "FM" namespace object exists
if (typeof FM != 'object') {
    FM = new Object();
}

 
 FM.checkForClass = function(element, nameOfClass) {
    if (typeof element == 'string') { element = document.getElementById(element); }

    if (element.className == '') {
        return false;
    } else {
        return new RegExp('\\b' + nameOfClass + '\\b').test(element.className);
    }
}
 
 
 FM.addClass = function(element, nameOfClass) {
    if (typeof element == 'string') { element = document.getElementById(element); }

    if (!FM.checkForClass(element, nameOfClass)) {
        element.className += (element.className ? ' ' : '') + nameOfClass;
        return true;
    } else {
        return false;
    }
}

FM.removeClass = function(element, nameOfClass) {
    if (typeof element == 'string') { element = document.getElementById(element); }

    if (FM.checkForClass(element, nameOfClass)) {
        element.className = element.className.replace(
            (element.className.indexOf(' ' + nameOfClass) >= 0 ? ' ' + nameOfClass : nameOfClass),
            '');
        return true;
    } else {
        return false;
    }
}




FM.replaceClass = function(element, class1, class2) {
    if (typeof element == 'string') { element = document.getElementById(element); }

    if (FM.checkForClass(element, class1)) {
        FM.removeClass(element, class1);
        FM.addClass(element, class2);
        return true;
    } else {
        return false;
    }
}


FM.toggleClass = function(element, nameOfClass) {
    if (typeof element == 'string') { element = document.getElementById(element); }

    if (FM.checkForClass(element, nameOfClass)) {
        FM.removeClass(element, nameOfClass);
    } else {
        FM.addClass(element, nameOfClass);
    }

    return true;
}


FM.removeTBClass = function(element, nameOfClass, text) {
    if (document.getElementById(element).value == '') 
    {
        document.getElementById(element).value = text;
        if (typeof element == 'string') { element = document.getElementById(element); }

        if (FM.checkForClass(element, nameOfClass)) {
            element.className = element.className.replace(
                (element.className.indexOf(' ' + nameOfClass) >= 0 ? ' ' + nameOfClass : nameOfClass),
                '');
            return true;
        } else {
            return false;
        }
    }
}



 
 
function SelectAll(id, text)
{
    
    
    if (document.getElementById(id).value == text) 
    {
        FM.addClass(document.getElementById(id), 'focused');
        FM.removeClass(document.getElementById(id), 'blurred');
    
        document.getElementById(id).focus();
        document.getElementById(id).select();
        
        document.getElementById(id).value = '';
    }
}

function ShowPasswordBox(textbox, passwordbox)
{
    
    
   document.getElementById(textbox).style.display = 'none';
   document.getElementById(passwordbox).style.display = 'inline';
   document.getElementById(passwordbox).focus();
   
}

function ShowTextBox(textbox, passwordbox)
{
    
   if (document.getElementById(passwordbox).value == '') 
   {
      
       document.getElementById(passwordbox).style.display = 'none'
       document.getElementById(textbox).style.display = 'inline';
       
       
   } 
   
   
}


function RestoreText(id, text)
{
    
    
    if (document.getElementById(id).value == '') 
    {
        document.getElementById(id).value = text;
        
        FM.addClass(document.getElementById(id), 'blurred');
        
        FM.removeClass(document.getElementById(id), 'focused');
        
        
        
    }
}



function isAlphanumeric(evt)
      {
        try
        {
             var charCode = (evt.which) ? evt.which : event.keyCode
             
             if (charCode > 32 && (charCode < 48 || charCode > 57) && (charCode < 65 || charCode > 90) && (charCode < 97 || charCode > 122))
             
                return false;

             return true;
         }
         catch(err)
         {
            return true;
         }
      }

function isNumberKey(evt)
      {
        try
        {
             var charCode = (evt.which) ? evt.which : event.keyCode
             if (charCode > 31 && (charCode < 48 || charCode > 57))
                return false;

             return true;
         }
         catch(err)
         {
            return true;
         }
      }

      function hide(element) {

          document.getElementById(element).style.visibility = 'hidden';
      }



      function isMoney(evt) {
          var charCode = (evt.which) ? evt.which : event.keyCode
        
          if (charCode != 44 && charCode > 31 && (charCode < 48 || charCode > 57))
              return false;

          return true;
      }

      function hide(element) {

          document.getElementById(element).style.visibility = 'hidden';
      }

      $(document).ready(function() {
        
        $(".tipArea").hide();
        $(".tipShadow").hide();

        $(".tip").mouseenter(function(e) {              
          $(this).children(".tipArea").show('1000', function(e) {
          /*$(".tipShadow").show();
          $(".tipShadow").attr("height", $(this).height() + 10 + "px");*/
          
          
//            $(this).parent().children(".tipShadow").attr("height", $(this).height() + 10 + "px", function(e) { 
//                 $(".tipShadow").attr("height", "300");
//                 $(".tipShadow").show();
//            } );
        } );
          
          
          
          //$(this).attr("width", $(this).children('tipArea').Width);             
        });
        
         $(".tip").mouseleave(function(e) {  
          /*$(".tipShadow").hide();           */
          /*$(".tipShadow").hide('0', function(e) {*/
            $(".tipArea").hide('2000');
                
            /*} );*/
             
             
        });
        
       


          $(".searchButton").mouseenter(function(e) {

              $(this).attr("src", "/images/searchbuttongreyhover.gif");



          }).mouseleave(function(e) {

              $(this).attr("src", "/images/searchbuttongrey.gif");

          });

          $(".renovatorLoginButton").mouseenter(function(e) {

              $(this).attr("src", "/images/loginbuttonbluehover.gif");



          }).mouseleave(function(e) {

              $(this).attr("src", "/images/loginbuttonblue.gif");

          });


          $(".tradieLoginButton").mouseenter(function(e) {

              $(this).attr("src", "/images/loginbuttongreyhover.gif");



          }).mouseleave(function(e) {

              $(this).attr("src", "/images/loginbuttongrey.gif");

          });



          $(".blueLink").mouseenter(function(e) {

              $(this).children('img').attr("src", "images/bluearrowhover.png");


          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "images/bluearrow.jpg");

          });

          $(".gridArrow").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/arrowhover.png");



          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/arrow.png");

          });

          $(".gridCross").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/crosshover.png");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/cross.png");

          });

          $(".gridCrossBlue").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/crossbluehover.gif");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/crossblue.gif");

          });

          $(".gridCrossGrey").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/crossgreyhover.gif");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/crossgrey.gif");

          });

          $(".createnewjob").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/createnewjobhover.gif");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/createnewjob.gif");

          });

          $(".listedDateBlue input").mouseenter(function(e) {

              $(this).attr("src", "../images/listDateBlueHover.gif");
              $(this).attr("title", "List Date");

          }).mouseleave(function(e) {

              $(this).attr("src", "../images/listDateBlue.gif");

          });

          $(".jobNoBlue input").mouseenter(function(e) {

              $(this).attr("src", "../images/jobNoBlueHover.gif");
              $(this).attr("title", "Job Number");

          }).mouseleave(function(e) {

              $(this).attr("src", "../images/jobNoBlue.gif");

          });

          $(".jobTitleBlue input").mouseenter(function(e) {

              $(this).attr("src", "../images/jobTitleBlueHover.gif");
              $(this).attr("title", "Job Title");

          }).mouseleave(function(e) {

              $(this).attr("src", "../images/jobTitleBlue.gif");

          });

          $(".jobTypeBlue input").mouseenter(function(e) {

              $(this).attr("src", "../images/jobTypeBlueHover.gif");
              $(this).attr("title", "Job Type");

          }).mouseleave(function(e) {

              $(this).attr("src", "../images/jobTypeBlue.gif");

          });

          $(".statusBlue input").mouseenter(function(e) {

              $(this).attr("src", "../images/statusBlueHover.gif");
              $(this).attr("title", "Status");

          }).mouseleave(function(e) {

              $(this).attr("src", "../images/statusBlue.gif");

          });

          $(".appsBlue input").mouseenter(function(e) {

              $(this).attr("src", "../images/appsBlueHover.gif");
              $(this).attr("title", "Applications");

          }).mouseleave(function(e) {

              $(this).attr("src", "../images/appsBlue.gif");

          });

          $(".commsBlue input").mouseenter(function(e) {

              $(this).attr("src", "../images/commsBlueHover.gif");
              $(this).attr("title", "Communications");

          }).mouseleave(function(e) {

              $(this).attr("src", "../images/commsBlue.gif");

          });



          $(".whiteLink").mouseenter(function(e) {

              $(this).children('.iconArrow').attr("src", "../images/searcharrowhover.jpg");

          }).mouseleave(function(e) {

              $(this).children('.iconArrow').attr("src", "../images/searcharrow.jpg");

          });
          
          
          $(".click2register").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/btns/click2register_over.jpg"); 

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/btns/click2register.jpg");

          });
           
          $(".click2register_grey").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/btns/click2register_grey_over.jpg");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/btns/click2register_grey.jpg");

          });


          $(".registerStartPostingJobs").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/btns/registerStartPostingJobs_over.jpg");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/btns/registerStartPostingJobs.jpg");

          });
          
          $(".starRegister_grey").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/tradie/btns/starRegister_grey_over.jpg");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/tradie/btns/starRegister_grey.jpg");

          }); 
          
          $(".starUpdate_grey").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/tradie/btns/starUpdate_grey_over.jpg");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/tradie/btns/starUpdate_grey.jpg");

          });
          
          $(".starPayMembership_grey").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/tradie/btns/membership_over.jpg");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/tradie/btns/membership.jpg");

          });
          
          $(".tradieHome").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/tradie/btns/tradieHome_over.gif");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/tradie/btns/tradieHome.gif");

          });
          $(".tradieUpdateProfile").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/tradie/btns/updateProfile_over.gif");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/tradie/btns/updateProfile.gif");

          });
          
          
          $(".tradieYourAccount").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/tradie/btns/yourAccount_over.gif");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/tradie/btns/yourAccount.gif");

          });
          
          
          
          
          
          $(".tradieLogout").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/tradie/btns/logout_over.gif");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/tradie/btns/logout.gif");

          });
          
          
          
          $(".renovatorHome").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/renovator/btns/renovatorHome_over.gif");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/renovator/btns/renovatorHome.gif");

          });
          $(".renovatorUpdateProfile").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/renovator/btns/updateProfile_over.gif");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/renovator/btns/updateProfile.gif");

          });
          $(".renovatorLogout").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/renovator/btns/logout_over.gif");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/renovator/btns/logout.gif");

          });
          
          
           $(".cancelThisJob").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/renovator/btns/cancelThisJob_over.jpg");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/renovator/btns/cancelThisJob.jpg");

          });
          $(".editThisJob").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/renovator/btns/editThisJob_over.jpg");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/renovator/btns/editThisJob.jpg");

          });
          $(".closeApplications").mouseenter(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/closeApplications_over.jpg");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/closeApplications.jpg");
          });
          
          
          $(".renoUpdateBtn").mouseenter(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/update_over.jpg");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/update.jpg");
          });
          
          
          $(".renoPreviewBtn").mouseenter(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/previewThisJob_over.jpg");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/previewThisJob.jpg");
          });
          
          
          $(".renoPostBtn").mouseenter(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/postThisJob_over.jpg");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/postThisJob.jpg");
          });
          
          
          $(".renoUpdateJobBtn").mouseenter(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/updateThisJob_over.jpg");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/updateThisJob.jpg");
          });
          
          
          $(".renoCancelJob").mouseenter(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/cancelThisJob_over.jpg");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/cancelThisJob.jpg");
          });
          
          $(".renoCompleteJob").mouseenter(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/completeThisJob_over.jpg");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/completeThisJob.jpg");
          });
          
          $(".completeThisJob").mouseenter(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/complete_over.gif");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/complete.gif");
          });
          
          
          $(".renoSidebarLoginBtn").mouseenter(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/sidebarLogin_over.gif");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/sidebarLogin.gif");
          });
          
          
          $(".sidebarRenoRegisterBtn").mouseenter(function(e) {
              $(this).children('img').attr("src", "../images/sidebarRenoRegister_over.gif");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/sidebarRenoRegister.gif");
          });
          
          
          $(".sidebarTradieRegisterBtn").mouseenter(function(e) {
              $(this).children('img').attr("src", "../images/sidebarTradieRegister_over.gif");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/sidebarTradieRegister.gif");
          });
          
          $(".sendLoginDetails").mouseenter(function(e) {
              $(this).children('img').attr("src", "../images/sendLoginDetails_over.jpg");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/sendLoginDetails.jpg");
          });
          
          
          
          $(".awardThisJob").mouseenter(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/award_over.jpg");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/award.jpg");
          });
          
          $(".shortListThisJob").mouseenter(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/shortlist_over.jpg");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/renovator/btns/shortlist.jpg");
          });
          
          
          
          
          
          
          $(".siteSearchBoxBtn").mouseenter(function(e) {
              $(this).children('input').attr("src", "/images/searcharrowhover.jpg");
          }).mouseleave(function(e) {
              $(this).children('input').attr("src", "/images/searcharrowie6.gif");
          });
          
          $(".renoLoginBtn").mouseenter(function(e) {
              $(this).children('img').attr("src", "/images/btns/renoLogin_over.gif");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "/images/btns/renoLogin.gif");
          });
          
          
          $(".completeThisJobButton").mouseenter(function(e) {
              $(this).children('img').attr("src", "/images/tradie/btns/completeThisJob_over.jpg");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "/images/tradie/btns/completeThisJob.jpg");
          });
          
          $(".withdrawThisApplicationButton").mouseenter(function(e) {
              $(this).children('img').attr("src", "/images/tradie/btns/withdrawApplication_over.jpg");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "/images/tradie/btns/withdrawApplication.jpg");
          });
          $(".advancedSearchBtn").mouseenter(function(e) {
              $(this).children('img').attr("src", "/images/tradie/btns/search_over.jpg");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "/images/tradie/btns/search.jpg");
          });
          
          
          
          $(".searchButton").mouseenter(function(e) {
              $(this).children('img').attr("src", "/images/btns/search_over.jpg");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "/images/btns/search.jpg");
          });
          
          
          
          
          $(".submitButton").mouseenter(function(e) {
              $(this).children('img').attr("src", "/images/btns/submit_over.jpg");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "/images/btns/submit.jpg");
          });
          $(".completeButton").mouseenter(function(e) {
              $(this).children('img').attr("src", "../images/tradie/btns/complete_over.gif");
          }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/tradie/btns/complete.gif");
          });
          
     
          
          $(".quickSearch").mouseenter(function(e) {
              if ($(".circleBtnQS").children('img').attr("src") == "../images/btns/circlePlus_grey.gif") {
                $(".circleBtnQS").children('img').attr("src", "../images/btns/circlePlus_grey_over.gif");
              }else{
                $(".circleBtnQS").children('img').attr("src", "../images/btns/circleMinus_grey_over.gif");
              }              
              $(this).children('img').attr("src", "../images/tradie/btns/quickSearchResults_over.gif");

          }).mouseleave(function(e) {             
              if ($(".circleBtnQS").children('img').attr("src") == "../images/btns/circlePlus_grey_over.gif") {
                $(".circleBtnQS").children('img').attr("src", "../images/btns/circlePlus_grey.gif");
              }else{
                $(".circleBtnQS").children('img').attr("src", "../images/btns/circleMinus_grey.gif");
              }              
              $(this).children('img').attr("src", "../images/tradie/btns/quickSearchResults.gif");

          });
          
          $(".circleBtnQS").mouseenter(function(e) {              
              $(".quickSearch").children('img').attr("src", "../images/tradie/btns/quickSearchResults_over.gif");              
              if ( $(this).children('img').attr("src") == "../images/btns/circlePlus_grey.gif") {                  
                  $(".circleBtnQS").children('img').attr("src", "../images/btns/circlePlus_grey_over.gif");
              } else {                              
                  $(".circleBtnQS").children('img').attr("src", "../images/btns/circleMinus_grey_over.gif");                  
              }
          }).mouseleave(function(e) {              
              $(".quickSearch").children('img').attr("src", "../images/tradie/btns/quickSearchResults.gif");
              if ( $(this).children('img').attr("src") == "../images/btns/circlePlus_grey_over.gif") {                  
                  $(".circleBtnQS").children('img').attr("src", "../images/btns/circlePlus_grey.gif");               
              } else {                              
                  $(".circleBtnQS").children('img').attr("src", "../images/btns/circleMinus_grey.gif");                  
              }
          });
          
          
          $('.quickSearch').click(function(e) {
             if ($(".circleBtnQS").children('img').attr("src") == "../images/btns/circlePlus_grey_over.gif") {
                 
                  $('.quickSearchResults').css("display", "block");
                  $(".circleBtnQS").children('img').attr("src", "../images/btns/circleMinus_grey_over.gif");               

              } else {
                  $('.quickSearchResults').css("display", "none");                 
                  $(".circleBtnQS").children('img').attr("src", "../images/btns/circlePlus_grey_over.gif");                  
              }
              if (isIE7OrLower)
              {
                    setFooter();
              }
          });          
          $('.circleBtnQS').click(function(e) {
             if ($(".circleBtnQS").children('img').attr("src") == "../images/btns/circlePlus_grey_over.gif") {
                  $('.quickSearchResults').css("display", "block");
                  $(".circleBtnQS").children('img').attr("src", "../images/btns/circleMinus_grey_over.gif");               

              } else {
                  $('.quickSearchResults').css("display", "none");                 
                  $(".circleBtnQS").children('img').attr("src", "../images/btns/circlePlus_grey_over.gif");                  
              }
              if (isIE7OrLower)
              {
                    setFooter();
              }
          });
          
          
          
          
          
          
          $(".advancedSearch").mouseenter(function(e) {

              $(this).children('img').attr("src", "../images/tradie/btns/advancedSearch_over.gif");

          }).mouseleave(function(e) {

              $(this).children('img').attr("src", "../images/tradie/btns/advancedSearch.gif");

          });
          
          
          
          $('#lbLogout').click('ctl00_cphMenu_RenovatorLogin1_pnlLoggedIn').animate({ width: '1px', height: '1px', opacity: 0.0 }, 1250);

          //        $('#lbLogout').click(function() {
          //            $('ctl00_cphMenu_RenovatorLogin1_pnlLoggedIn').animate({ width: '1px', height: '1px', opacity: 0.0 }, 1250); 
          //        
          //        });


          $('.expander').click(function(e) {
                
              if ($(this).attr("src") == "/images/minusgreyhover.gif") {
                  $(this).parent().parent().parent().children('.innerBox').height(0);
                  /*$(this).parent().visible = false;*/

                  $(this).attr("src", "/images/plusgreyhover.gif");
                  $(this).addClass('plusGrey');
                  $(this).removeClass('minusGrey');

              } else {
                  $(this).parent().parent().parent().children('.innerBox').height('100%');
                  //$(this).parent().height('auto');
                  $(this).attr("src", "/images/minusgreyhover.gif");
                  $(this).addClass('minusGrey');
                  $(this).removeClass('plusGrey');
              }
              
              if (isIE7OrLower)
              {
                    setFooter();
              }
          });
          
          $('.expanderJobDetails').click(function(e) {
              if ($(this).attr("src") == "/images/minusgreyhover.gif") {
                  $(this).parent().parent().parent().children('.innerBox').height('350px');
                  /*$(this).parent().visible = false;*/

                  $(this).attr("src", "/images/plusgreyhover.gif");
                  $(this).addClass('plusGrey');
                  $(this).removeClass('minusGrey');

              } else {
                  $(this).parent().parent().parent().children('.innerBox').height('100%');
                  //$(this).parent().height('auto');
                  $(this).attr("src", "/images/minusgreyhover.gif");
                  $(this).addClass('minusGrey');
                  $(this).removeClass('plusGrey');
              }
              
              if (isIE7OrLower)
              {
                    setFooter();
              }
          });

          $('.expander').mouseenter(function(e) {
              if ($(this).attr("src") == "/images/minusgrey.gif") {

                  $(this).attr("src", "/images/minusgreyhover.gif");

              } else {

                  $(this).attr("src", "/images/plusgreyhover.gif");
              }


          }).mouseleave(function(e) {

              if ($(this).attr("src") == "/images/minusgreyhover.gif") {

                  $(this).attr("src", "/images/minusgrey.gif");

              } else {

                  $(this).attr("src", "/images/plusgrey.gif");
              }
          });
          
          
          $('.expanderJobDetails').mouseenter(function(e) {
              if ($(this).attr("src") == "/images/minusgrey.gif") {

                  $(this).attr("src", "/images/minusgreyhover.gif");

              } else {

                  $(this).attr("src", "/images/plusgreyhover.gif");
              }


          }).mouseleave(function(e) {

              if ($(this).attr("src") == "/images/minusgreyhover.gif") {

                  $(this).attr("src", "/images/minusgrey.gif");

              } else {

                  $(this).attr("src", "/images/plusgrey.gif");
              }
          });
          
        
        $(".payNow").mouseenter(function(e) {              
              $(this).children('img').attr("src", "../images/tradie/btns/payNow_over.jpg");              
        }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/tradie/btns/payNow.jpg");
        });
          
        $(".confirmPayment").mouseenter(function(e) {              
              $(this).children('img').attr("src", "../images/tradie/btns/confirmPayment_over.jpg");              
        }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/tradie/btns/confirmPayment.jpg");
        });  
          
        $(".applyForThisJobButton").mouseenter(function(e) {              
              $(this).children('img').attr("src", "../images/tradie/btns/starApply_grey_over.jpg");              
        }).mouseleave(function(e) {
              $(this).children('img').attr("src", "../images/tradie/btns/starApply_grey.jpg");
        });
          
        /* Rollovers for tradie data grid titles */
        $(".aJobTitle input").mouseenter(function(e) {              
          $(this).attr("src", "../images/tradie/btns/aJobTitle_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/tradie/btns/aJobTitle.gif");
        });

        $(".aDate input").mouseenter(function(e) {              
          $(this).attr("src", "../images/tradie/btns/aDate_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/tradie/btns/aDate.gif");
        });
        
        $(".aUserName input").mouseenter(function(e) {              
          $(this).attr("src", "../images/tradie/btns/aUserName_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/tradie/btns/aUserName.gif");
        });
        $(".aStatus input").mouseenter(function(e) {              
          $(this).attr("src", "../images/tradie/btns/aStatus_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/tradie/btns/aStatus.gif");
        });
        $(".aJobType input").mouseenter(function(e) {              
          $(this).attr("src", "../images/tradie/btns/aJobType_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/tradie/btns/aJobType.gif");
        });
        $(".aSuburb input").mouseenter(function(e) {              
          $(this).attr("src", "../images/tradie/btns/aSuburb_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/tradie/btns/aSuburb.gif");
        });
        $(".aUsername input").mouseenter(function(e) {              
          $(this).attr("src", "../images/tradie/btns/aUsername_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/tradie/btns/aUsername.gif");
        });
        $(".aComms input").mouseenter(function(e) {              
          $(this).attr("src", "../images/tradie/btns/aComms_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/tradie/btns/aComms.gif");
        });
        $(".postCommentTradie").mouseenter(function(e) {              
          $(this).attr("src", "../images/tradie/btns/postComment_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/tradie/btns/postComment.gif");
        });
        
        
        /* Rollovers for renovator data grid titles */
        $(".aRDate input").mouseenter(function(e) {              
          $(this).attr("src", "../images/renovator/btns/aAppDate_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/renovator/btns/aAppDate.gif");
        });

        $(".aRTradie input").mouseenter(function(e) {              
          $(this).attr("src", "../images/renovator/btns/aTradie_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/renovator/btns/aTradie.gif");
        });
        
        $(".aRMemberSince input").mouseenter(function(e) {              
          $(this).attr("src", "../images/renovator/btns/aMemberSince_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/renovator/btns/aMemberSince.gif");
        });
        
        $(".aRRecommendations input").mouseenter(function(e) {              
          $(this).attr("src", "../images/renovator/btns/aRecommendations_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/renovator/btns/aRecommendations.gif");
        });
        
        $(".aRDate").mouseenter(function(e) {              
          $(this).attr("src", "../images/renovator/btns/aAppDate_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/renovator/btns/aAppDate.gif");
        });

        $(".aRTradie").mouseenter(function(e) {              
          $(this).attr("src", "../images/renovator/btns/aTradie_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/renovator/btns/aTradie.gif");
        });
        
        $(".aRMemberSince").mouseenter(function(e) {              
          $(this).attr("src", "../images/renovator/btns/aMemberSince_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/renovator/btns/aMemberSince.gif");
        });
        //
        $(".postComment").mouseenter(function(e) {              
          $(this).attr("src", "../images/renovator/btns/postComment_over.gif");              
        }).mouseleave(function(e) {              
          $(this).attr("src", "../images/renovator/btns/postComment.gif");
        });
        
       
        
        
        
        
        //Reno View job page btns
        $(".circleBtnRollOver").mouseenter(function(e) {                     
              if ( $(this).children('img').attr("src") == "../images/renovator/btns/circlePlus.gif") {                  
                  $(this).children('img').attr("src", "../images/renovator/btns/circlePlus_over.gif");
              } else {                              
                  $(this).children('img').attr("src", "../images/renovator/btns/circleMinus_over.gif");                  
              }
          }).mouseleave(function(e) {             
              if ( $(this).children('img').attr("src") == "../images/renovator/btns/circlePlus_over.gif") {                  
                  $(this).children('img').attr("src", "../images/renovator/btns/circlePlus.gif");               
              } else {                              
                  $(this).children('img').attr("src", "../images/renovator/btns/circleMinus.gif");                  
              }
          });
        $('.circleBtnRenoJobDetails').click(function(e) {
             if ($(this).children('img').attr("src") == "../images/renovator/btns/circlePlus_over.gif") {
                  $('.innerBox').css("display", "block");
                  $('.jobtitle2').css("display", "none");
                  
                  $(this).children('img').attr("src", "../images/renovator/btns/circleMinus.gif");               
              } else {
                  $('.innerBox').css("display", "none");
                  $('.jobtitle2').css("display", "block");                 
                  $(this).children('img').attr("src", "../images/renovator/btns/circlePlus_over.gif");                  
              }
              if (isIE7OrLower)
              {
                    setFooter();
              }
         });
         $('.circleBtnRenoApplicants').click(function(e) {
             if ($(this).children('img').attr("src") == "../images/renovator/btns/circlePlus_over.gif") {
                  $('.innerTableApplicants').css("display", "block");
                  $(this).children('img').attr("src", "../images/renovator/btns/circleMinus.gif");               
              } else {
                  $('.innerTableApplicants').css("display", "none");                 
                  $(this).children('img').attr("src", "../images/renovator/btns/circlePlus_over.gif");                  
              }
              
              if (isIE7OrLower)
              {
             
                    setFooter();
              }
         });
         $('.circleBtnRenoShortlist').click(function(e) {
             if ($(this).children('img').attr("src") == "../images/renovator/btns/circlePlus_over.gif") {
                  $('.innerBoxShortList').css("display", "block");
                  $(this).children('img').attr("src", "../images/renovator/btns/circleMinus.gif");               
              } else {
                  $('.innerBoxShortList').css("display", "none");                 
                  $(this).children('img').attr("src", "../images/renovator/btns/circlePlus_over.gif");                  
              }
              if (isIE7OrLower)
              {
                    setFooter();
              }
         });
         $('.circleBtnRenoAwarded').click(function(e) {
             if ($(this).children('img').attr("src") == "../images/renovator/btns/circlePlus_over.gif") {
                  $('.innerTableAwarded').css("display", "block");
                  $(this).children('img').attr("src", "../images/renovator/btns/circleMinus.gif");               
              } else {
                  $('.innerTableAwarded').css("display", "none");                 
                  $(this).children('img').attr("src", "../images/renovator/btns/circlePlus_over.gif");                  
              }
              if (isIE7OrLower)
              {
                    setFooter();
              }
         });
         
         //Communication btns
         $('.short1Communication').click(function(e) {
             if ($(this).children('img').attr("src") == "../images/renovator/btns/circlePlus_over.gif") {
                  $('.short1MessageArea').css("display", "block");
                  $(this).children('img').attr("src", "../images/renovator/btns/circleMinus.gif");               
              } else {
                  $('.short1MessageArea').css("display", "none");                 
                  $(this).children('img').attr("src", "../images/renovator/btns/circlePlus_over.gif");                  
              }
              if (isIE7OrLower)
              {
                    setFooter();
              }
         });
         
         $('.short2Communication').click(function(e) {
             if ($(this).children('img').attr("src") == "../images/renovator/btns/circlePlus_over.gif") {
                  $('.short2MessageArea').css("display", "block");
                  $(this).children('img').attr("src", "../images/renovator/btns/circleMinus.gif");               
              } else {
                  $('.short2MessageArea').css("display", "none");                 
                  $(this).children('img').attr("src", "../images/renovator/btns/circlePlus_over.gif");                  
              }
              if (isIE7OrLower)
              {
                    setFooter();
              }
         });
         
         $('.short3Communication').click(function(e) {
             if ($(this).children('img').attr("src") == "../images/renovator/btns/circlePlus_over.gif") {
                  $('.short3MessageArea').css("display", "block");
                  $(this).children('img').attr("src", "../images/renovator/btns/circleMinus.gif");               
              } else {
                  $('.short3MessageArea').css("display", "none");                 
                  $(this).children('img').attr("src", "../images/renovator/btns/circlePlus_over.gif");                  
              }
              if (isIE7OrLower)
              {
                    setFooter();
              }
         });
         
         $('.awardedCommunication').click(function(e) {
             if ($(this).children('img').attr("src") == "../images/renovator/btns/circlePlus_over.gif") {
                  $('.applicationMessageArea').css("display", "block");
                  $(this).children('img').attr("src", "../images/renovator/btns/circleMinus.gif");               
              } else {
                  $('.applicationMessageArea').css("display", "none");                 
                  $(this).children('img').attr("src", "../images/renovator/btns/circlePlus_over.gif");                  
              }
              if (isIE7OrLower)
              {
                    setFooter();
              }
         });
         
         
         
         
         
         
         

      });




      $(document).ready(function() {

          $('.screenShieldNoJS').hide();
          $('.javascriptWarning').hide();

          $('.message_content').hide();
          $('.message_action').click(function() {
              $(this).next('.message_content').toggle();

          });

//          $('.message_reply').click(function() {
//              $('.screenShield').show();
//              $('.newMessage').css("margin-left", ((($(window).width() - 500) / 2)) + "px");
//              $('.newMessage').css("margin-top", ((($(window).height() - 240) / 2)) + "px");

//              $('.newMessage').show();
//          });


          $('.message_termsconditions').click(function() {
          
              var spanAvailability = $get("spanAvailability");
              var spanEmailAvailability = $get("spanEmailAvailability");
              var spanSuburbValid = $get("spanSuburbValid");

              var email = $get("ctl00_cphMain_txtEmail");
              var username = $get("ctl00_cphMain_txtUsername");
              var suburb = $get("ctl00_cphMain_txtSuburb");

              /* execute the ajax calls to validate the email/username/suburb to handle when onblur hasn't fired due to a page refresh */
              checkEmailUsage(email.value);
              checkUsernameUsage(username.value);
              checkSuburb(suburb.value);

              /* If the generated page validators for group 'prepopup' are valid, and the email/username/suburb are valid */
              ValidateModuleList();
              if (Page_ClientValidate('prepopup') == true && ValidateModuleList() == true && emailValid == true && usernameValid == true && suburbValid == true) {

                    /* show the terms and conditions popup centered */
                  $('.screenShield').show();
                  $('.terms_conditions_message').css("margin-left", ((($(window).width() - 700) / 2)) + "px");
                  $('.terms_conditions_message').css("margin-top", ((($(window).height() - 440) / 2)) + "px");

                  $('.terms_conditions_message').show();
              } else {
                    /* display error message */
                  alert('One or more fields is invalid, please check your information');
              }
          });


            /* close the terms and conditions popup */
          $('.close_popup').click(function() {
              $('.screenShield').hide();
              $('.terms_conditions_message').hide();
          });

      });

      $(document).ready(function() {

          $('.complete_popup_button').click(function() {
              

              

              
                  /* show the terms and conditions popup centered */
                  $('.screenShield').show();
                  
                  $('.complete_job_confirmation').css("margin-left", ((($(window).width() - 300) / 2)) + "px");
                  $('.complete_job_confirmation').css("margin-top", ((($(window).height() - 120) / 2)) + "px");

                  $('.complete_job_confirmation').show();
              
          });


          /* close the complete popup */
          $('.close_complete_popup').click(function() {
              $('.screenShield').hide();
              $('.complete_job_confirmation').hide();
          });

      });

        $(document).ready(function() {

          $('.close_job_popup_button').click(function() {
              

              

              
                  /* show the terms and conditions popup centered */
                  $('.screenShield').show();
                  $('.close_job_confirmation').css("margin-left", ((($(window).width() - 300) / 2)) + "px");
                  $('.close_job_confirmation').css("margin-top", ((($(window).height() - 120) / 2)) + "px");

                  $('.close_job_confirmation').show();
              
          });


          /* close the complete popup */
          $('.close_close_job_popup').click(function() {
              $('.screenShield').hide();
              $('.close_job_confirmation').hide();
          });

      });

      


      
      
      

      $(window).bind("resize", resizeWindow);
      resizeWindow();

      function resizeWindow(e) {
          if (!browserIE6) {
//              $('.newMessage').css("margin-left", ((($(window).width() - 500) / 2)) + "px");
//              $('.newMessage').css("margin-top", ((($(window).height() - 240) / 2)) + "px");
              $('.terms_conditions_message').css("margin-left", ((($(window).width() - 700) / 2)) + "px");
              $('.terms_conditions_message').css("margin-top", ((($(window).height() - 440) / 2)) + "px");

              $('.complete_job_confirmation').css("margin-left", ((($(window).width() - 300) / 2)) + "px");
              $('.complete_job_confirmation').css("margin-top", ((($(window).height() - 120) / 2)) + "px");
          }
      }





       /* Registration Validation */

       
        var emailValid = false;
        var usernameValid = false;
        var suburbValid = false;

        function emailChecker(email) {
            email = email.replace(/["']{1}/gi,"");
            var emailCheckerTimer;
            var spanEmailAvailability = $get("spanEmailAvailability");


            clearTimeout(emailCheckerTimer);
            if (email.length == 0)
                spanEmailAvailability.innerHTML = "";
            else {
                spanEmailAvailability.innerHTML = "<span style='color: #ccc; text-decoration:blink;'>Checking...</span>";
                emailCheckerTimer = setTimeout("checkEmailUsage('" + email + "');", 0);
            }
        }

        



            function usernameChecker(username) {
                username = username.replace(/["']{1}/gi,"");
                var usernameCheckerTimer;
                var spanAvailability = $get("spanAvailability");
               
                
                clearTimeout(usernameCheckerTimer);
                if (username.length == 0)
                    spanAvailability.innerHTML = "";
                else {
                    spanAvailability.innerHTML = "<span style='color: #ccc; text-decoration:blink;'>Checking...</span>";
                    usernameCheckerTimer = setTimeout("checkUsernameUsage('" + username + "');", 0);
                }
            }

            function suburbChecker(suburb) {
                suburb = suburb.replace(/["']{1}/gi,"");
                var suburbCheckerTimer;
                var spanSuburbValid = $get("spanSuburbValid");


                clearTimeout(suburbCheckerTimer);

                spanSuburbValid.innerHTML = "<span style='color: #ccc; text-decoration:blink;'>Checking...</span>";
                    suburbCheckerTimer = setTimeout("checkSuburb('" + suburb + "');", 0);
                
            }

            function checkUsernameUsage(username) {
                // initiate the ajax pagemethod call
                // upon completion, the OnSucceded callback will be executed
                if (username.length == 0)
                {
                
                }
                else 
                {
                    PageMethods.IsUserAvailable(username, OnSucceeded);
                }
            }

            function checkEmailUsage(email) {
                // initiate the ajax pagemethod call
                // upon completion, the OnSucceded callback will be executed
                PageMethods.IsEmailAvailable(email, OnSucceeded);
            }

            function checkSuburb(suburb) {
                // initiate the ajax pagemethod call
                // upon completion, the OnSucceded callback will be executed
                PageMethods.IsSuburbValid(suburb, OnSucceeded);
            }

            // Callback function invoked on successful completion of the page method.
            function OnSucceeded(result, userContext, methodName) {
                var spanAvailability = $get("spanAvailability");
                var spanEmailAvailability = $get("spanEmailAvailability");
                var spanSuburbValid = $get("spanSuburbValid");
                
                if (methodName == "IsUserAvailable") {
                    if (result == true) {
                        spanAvailability.innerHTML = "<span style='color: LimeGreen;'>Available</span>";
                        usernameValid = true;
                    }
                    else {
                        spanAvailability.innerHTML = "<span>Unavailable</span>";
                        usernameValid = false;
                    }
                }
                if (methodName == "IsEmailAvailable") {
                    if (result == true)
                    {
                        spanEmailAvailability.innerHTML = "<span style='color: LimeGreen;'></span>";
                        emailValid = true;
                    }
                    else {
                        spanEmailAvailability.innerHTML = "<span>Already In Use</span>";
                        emailValid = false;
                        

                    }


                }
                if (methodName == "IsSuburbValid") {
                    if (result == true) {
                        spanSuburbValid.innerHTML = "<span style='color: LimeGreen;'></span>";
                        
                        suburbValid = true;
                       
                        
                    }
                    else {
                        spanSuburbValid.innerHTML = "<span>Invalid Suburb, Please select one from the list</span>";
                        
                        suburbValid = false;
                       
                    }
                }
            }
            
            $(document).ready(function() {



            });
            
    
    
      function toggle(tabOn,tabStyle) {
if (document.getElementById(tabOn).style.display == 'none') 
    {
        document.getElementById(tabOn).style.display = 'block';
        document.getElementById(tabStyle).className = 'h2';
    }else{
        document.getElementById(tabOn).style.display = 'none';
        document.getElementById(tabStyle).className = 'h2-clear';
    }
}