﻿$(document).ready(function()
{  
    $("#aspnetForm select").enable();
   __doPostBack('ctl00$cphMainContainer$lnkSaveWebsiteActivity','');
});

function gotoPage(iPage){
    $("#ctl00_cphMainContainer_AgoraInternalPage").val(iPage);
    __doPostBack('ctl00$cphMainContainer$LinkButtonPaging','')
}


        
function ClearCompare()
{
    var ctrl_comp_mls = $('.comp_props');
    var str_comp_mls = '';
    
    for(i=0; i<ctrl_comp_mls.length; i++)
    {
        ctrl_comp_mls[i].checked = false;
    }
}


function CompareProperties()
{
    // Creating comparison object from ClassName
    var ctrl_comp_mls = $('.comp_props');
    var str_comp_mls = '';
    
    for(i=0; i<ctrl_comp_mls.length; i++)
    {
        if(!ctrl_comp_mls[i].checked) continue;
        
        if(str_comp_mls != '') str_comp_mls += ',';
        
        str_comp_mls += ctrl_comp_mls[i].value;
    }
    
    if(str_comp_mls.split(',').length < 2)
    {
        alert('Please select at least 2 properties for comparison');
        return;
    }
    
    if(str_comp_mls.split(',').length > 4)
    {
        alert('You can compare maximum 4 properties');        
        return;
    }
   // location.href = 'PropertyCompare.aspx?0110=' + str_comp_mls + "&sch=" + escape(location.search);
    location.replace('PropertyCompare.aspx?0110_exc=' + str_comp_mls + "&sch=" + escape(location.search) );
   //window.opener.location.replace('PropertyCompare.aspx');
}

function GoRefineSearch() {
    var tab = getQuerystring("tab", "1");
    var boardId = getQuerystring("9369", "");
    
   
    
    switch(parseInt(tab))
    {                
        case 101: document.location.replace('PropertySearch_101.aspx' + location.search); break;
        case 102: document.location.replace('PropertySearch_102.aspx' + location.search); break;
        case 104: document.location.replace('PropertySearch_104.aspx' + location.search); break;
        case 105: document.location.replace('PropertySearch_105.aspx' + location.search); break;
        case 107: document.location.replace('PropertySearch_107.aspx' + location.search); break;
        
        case 3: document.location.replace('PropertySearchSubdivision.aspx' + location.search); break;
        case 4: document.location.replace('PropertySearchRadius.aspx' + location.search); break;
        case 5: document.location.replace('PropertySearchAddress.aspx' + location.search); break;
        case 6: document.location.replace('PropertySearchMLS.aspx' + location.search); break;
        case 7: document.location.replace('PropertySearchPayment.aspx' + location.search); break;
        case 8: document.location.replace('PropertySearchOpenHomes.aspx' + location.search); break;
        case 3101: document.location.replace('PropertySearchPayment_101.aspx' + location.search); break;  
        case 3102: document.location.replace('PropertySearchPayment_102.aspx' + location.search); break;  
        case 3104: document.location.replace('PropertySearchPayment_104.aspx' + location.search); break;  
        case 3105: document.location.replace('PropertySearchPayment_105.aspx' + location.search); break;       
        case 3107: document.location.replace('PropertySearchPayment_107.aspx' + location.search); break;  
        default:document.location.replace('PropertySearch_101.aspx' + location.search); break;
    }
    
    
}

function SetShowingTime(BoardId, MlsNumber, Broker){
    var oImgShowingTime = new Image(10,10);
    oImgShowingTime.src = "http://links.showingtime.com/showingalert/images/wbShowingAlert_dtl.gif?SITEID=www.rhr.com&broker=" + Broker  + "MLSID=" + BoardId + "&listingid=" + MlsNumber + "&source=S";
}

