﻿// JScript File
//function propertyResultsPaging(pageIndex,pageSize)
//{    
//    globalpageIndex = pageIndex;
//    globalpageSize = pageSize;
//    var id='temp';   
//    for(var i = 0; id!=null || id=='temp'; i++)
//    {   
//        id = document.getElementById("trResults" + i);                           
//        if(id!=null)
//        {     
//            
//            if(i >= pageSize * (pageIndex - 1) && i < (pageSize * pageIndex))
//            {   
//                try
//                {   
//                    document.getElementById("trResults" + i).style.display="table-row";                                                                         
//                }
//                catch(ex)
//                {                    
//                    document.getElementById("trResults" + i).style.display="block";                                        
//                }
//            }
//            else                
//                document.getElementById("trResults" + i).style.display="none";
//        }            
//    } 
//}


//function searchResults()
//{
//    var locId = document.getElementById('ddlCitySearch').value;            
//    if(locId == 'Any City')
//        locId = -1;                
//    showProcessImage();    
//    _Default.SearchPropertyByCity(locId,searchResults_CallBack);
//}

//function searchResults_CallBack(response)
//{      
//    document.getElementById('Message').innerHTML = "";
//    if(response!=null && response.error==null && response.value!=null)
//    {        
//        if(response.value == 0)        
//            document.getElementById('divContentPage').innerHTML = "Error While Searching Property.";        
//        else
//        { 
//            document.title = "The Best Place for Searching Your New Home.";
//            document.getElementById('divContentPage').innerHTML = response.value;            
//            pgSz = document.getElementById('hdnPageSize').value;            
//            propertyResultsPaging(1,pgSz);
//        }
//    }     
//}


function showPropertyDetails(propId,FListing)
{       
    globalDetailsHeader = false;
    if(FListing=='featuredlisting')
        globalDetailsHeader = true;
    globalHomesForRentResult = document.getElementById('divContentPage').innerHTML;     
    showProcessImage();   
    _Default.ShowPropertyDetails(propId,showPropertyDetails_CallBack);
}
function showPropertyDetails_CallBack(response)
{
    document.getElementById('Message').innerHTML = "";
    if(response!=null && response.error==null && response.value!=null)
    {        
        if(response.value == 0)        
            document.getElementById('divContentPage').innerHTML = "Error While Fetching Property Details.";        
        else
        { 
            document.title = "Details of the Property...";
            document.getElementById('divContentPage').innerHTML = response.value;
            if(globalDetailsHeader)
            {    
                document.getElementById('tdDetailsHeader').innerHTML = "<a href='/Default.aspx' class='bread-crumbs-normal'>Home</a> &gt;  Featured Listing";
            }   
        }
    }    
}
//function changeImage(img)
//{
//    //alert(document.getElementById('imgFirst'));
//    //alert(img);
//    document.getElementById('imgFirst').src = img;    
//}

//function homesForRentResult()
//{
//    document.getElementById('divContentPage').innerHTML = globalHomesForRentResult;  
//}
function redirectToHomesForRent()
{
    window.location.href = "/HomeForRent.aspx";
}
//function printableVersion()
//{   
//    printWin = window.open("","PrintableVersion","left=50,top=50,scrollbars=1,height=600,width=600");    
//    printWin.document.write("<TITLE>Printable Version</TITLE>");
//    printWin.document.write("<link href='style.css' rel='stylesheet' type='text/css'>");    
//    printWin.document.write("<BODY>");
//    printWin.document.write("<div style='width:100%; height:100%; background-color:White;' >");        
//    printWin.document.write("<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;<input type=button value='Print This Page' onclick='print();'  />");        
//    printWin.document.write("&nbsp;&nbsp;&nbsp;&nbsp;<input type=button value='Close This Window' onclick='window.close();'  />");        
//    printWin.document.write(document.getElementById('divContentPage').innerHTML);    
//    try
//    {
//        printWin.document.getElementById('tdDetailsHeader').innerHTML = "";    
//        printWin.document.getElementById('trPrint1').innerHTML = "";    
//        printWin.document.getElementById('trPrint2').innerHTML = "";    
//        printWin.document.getElementById('trPrint3').innerHTML = "";    
//    }
//    catch(ex){}    
//  
//    printWin.document.write("</div>");
//    printWin.document.write("</BODY>");
//    printWin.document.write("</HTML>");
//    
//    printWin.document.close();
//    
//    //window.open();
//}   
//function redirectNewsUrl(url)
//{
//    window.open(url);
//}
//function directionMap(mapURL)
//{   
//    window.open("/images/Property/"+ mapURL +"","PropertyImage","toolbar=no,scrollbars=yes,top=50,left=50")    
//}
