function MortgageCalc(num){window.location.href=WebRoot+"tools/calculators/mortgage_calculator.aspx?price="+num;}function Listing(IdListing){var UGen=new UrlGen(QSCache.QueryString);UGen.RemoveParam("LID");UGen.AddParam("LID",IdListing);var strURL=WebRoot+"controls/ajaxcalls/DetailListingPath.aspx?"+UGen.ToString();$AJAX.GetForDelegate(function(AjaxResponse){window.location.href=AjaxResponse;},strURL);}function ListingPage(No,Position){QSCache.Position=Position;var UGen=new UrlGen(QSCache.QueryString);UGen.RemoveParam("No");UGen.AddParam("No",No);QSCache.QueryString=UGen.ToString();$AJAX.GetForDelegate(ListingPageHandler,WebRoot+"Controls/AjaxCalls/DetailListingIds.aspx?"+QSCache.QueryString);}function ListingPageHandler(AJAXResponse){if(AJAXResponse.length>0){var arrListingIds=AJAXResponse.split(',');var IdListing=arrListingIds[QSCache.Position];var UGen=new UrlGen(QSCache.QueryString);UGen.RemoveParams(["LIDS","LID"]);UGen.AddParam("LIDS",AJAXResponse.replace(/,/g,'--'));UGen.AddParam("LID",IdListing);var strURL=WebRoot+"controls/ajaxcalls/DetailListingPath.aspx?"+UGen.ToString();$AJAX.GetForDelegate(function(AjaxResponse){window.location.href=AjaxResponse;},strURL);}}function LoadGallery(SEOSection,IdListing){var strURL=WebRoot+"controls/ajaxcalls/GetDetailGallery.aspx?SEO=true&SEOSection="+SEOSection+"&LID="+IdListing;$AJAX.GetForDelegate(function(AjaxResponse){if(AjaxResponse!=""){gE("gallery_view").innerHTML=AjaxResponse;}else{gE("gallery_view").innerHTML="No Gallery found.";}},strURL);}function LoadCommunityData(AddrZip){var strURL=WebRoot+"controls/ajaxcalls/GetCommunityData.aspx?AddrZip="+AddrZip;$AJAX.GetForDelegate(function(AjaxResponse){alert(AjaxResponse);if(AjaxResponse!=""){gE("nabe_view").innerHTML=AjaxResponse;}},strURL);}function LoadRecentlySold(Address,AddressCityState,AddressZip,AddressLatLon){var strURL=WebRoot+"controls/ajaxcalls/GetRecentlySold.aspx?SEO=true&Address="+Address+"&AddressCityState="+AddressCityState+"&AddressZip="+AddressZip+"&AddressLatLon="+AddressLatLon;$AJAX.GetForDelegate(function(AjaxResponse){if(AjaxResponse!=""){gE("recently_sold_homes").innerHTML=AjaxResponse;if(gE("sold_homes_js")){window.setTimeout(function(){var v="";var mylist=gE("sold_homes_js");for(i=0;i<mylist.childNodes.length;i++){v=v+mylist.childNodes[i].nodeValue;}eval(v);},200);}}else{gE("sold_homes").innerHTML="Information not available.";}},strURL);}var GalleryWin;function PrintGallery(gallerylink){if(GalleryWin!=null){GalleryWin.close();}GalleryWin=window.open(gallerylink,'myGallery','height=650, width=800, toolbar=no, status=no, directories=no, menubar=no, resizable=no, scrollbars=yes, left=0, top=0');}