var x_dom=(document.getElementById);var x_iebrowser=document.all;var gCanScroll=(window.scrollTo)?1:0;var gOldScrollY=[];var gOldHTML=[];var gTimerID=null;var gTimerRunning=false;var gTimerDelay=1000;var gTimerSecs=-1;var gTimerDisplaySecs=1;var gSearchType="Res";var gSearchID="";var PageHasBeenDimmed=false;var HasFlashDivBeenMoved=false;function WindowSize(){var A=0,B=0;if(typeof (window.innerWidth)=="number"){A=window.innerWidth;B=window.innerHeight}else{if(document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)){A=document.documentElement.clientWidth;B=document.documentElement.clientHeight}else{if(document.body&&(document.body.clientWidth||document.body.clientHeight)){A=document.body.clientWidth;B=document.body.clientHeight}}}return[A,B]}function DivFindPos(A){var B=curtop=0;if(A.offsetParent){B=A.offsetLeft;curtop=A.offsetTop;while(A=A.offsetParent){B+=A.offsetLeft;curtop+=A.offsetTop}}return[B,curtop]}function MoveToCalculator(){var A=x_iebrowser?x_iebrowser["MortgageCalculator"]:document.getElementById("MortgageCalculator");Coords=DivFindPos(A);window.scrollTo(0,parseInt(Coords[1]))}function CenterFlashDiv(A){if(!HasFlashDivBeenMoved||HasFlashDivBeenMoved=="undefined"){MoveFlashDivToBody()}var B=x_iebrowser?x_iebrowser["MyEZListingDisplay"]:document.getElementById("MyEZListingDisplay");Coords=DivFindPos(B);FlashDiv=x_iebrowser?x_iebrowser[A]:document.getElementById(A);FlashDiv.style.border="2px outset #CCCCCC";FlashDivYPos=Coords[1];ScrollAmount=window.pageYOffset||(document.documentElement&&document.documentElement.scrollTop)||(document.body&&document.body.scrollTop);FlashDiv.style.position="absolute";WinCoords=WindowSize();FlashDiv.style.top=(parseInt(FlashDivYPos)+(WinCoords[1]/2))+"px"}function MoveFlashDivToBody(){FlashDiv=x_iebrowser?x_iebrowser["SearchLargeLoadingBar"]:document.getElementById("SearchLargeLoadingBar");if(FlashDiv){FlashDivParent=FlashDiv.parentNode;FlashDiv=FlashDivParent.removeChild(FlashDiv);FlashDiv=document.getElementsByTagName("body").item(0).appendChild(FlashDiv)}HasFlashDivBeenMoved=true}function DimDisplayDivOpacity(){if(!PageHasBeenDimmed){var A=x_iebrowser?x_iebrowser["MyEZListingDisplay"]:document.getElementById("MyEZListingDisplay");if(!HasFlashDivBeenMoved){MoveFlashDivToBody()}A.style.backgroundColor="#AAAAAA";if(window.event){A.style.filter="alpha(opacity=65)"}else{A.style.opacity="0.65"}PageHasBeenDimmed=true}}function ResetDisplayDivOpacity(){var A=x_iebrowser?x_iebrowser["MyEZListingDisplay"]:document.getElementById("MyEZListingDisplay");Shadowbox.setup($("a.sbox"));A.style.backgroundColor="#FFFFFF";if(window.event){A.style.filter="alpha(opacity=100)"}else{A.style.opacity="1.0"}PageHasBeenDimmed=false;FlashDiv=x_iebrowser?x_iebrowser["SearchLargeLoadingBar"]:document.getElementById("SearchLargeLoadingBar");if(FlashDiv){FlashDivParent=FlashDiv.parentNode;FlashDiv=FlashDivParent.removeChild(FlashDiv);HasFlashDivBeenMoved=false}}function MyEZListingShowListingDetail(D){var B=D.split("|");if(gTimerRunning){clearTimeout(gTimerID)}gTimerRunning=false;$("#MyEZListingDisplay").html(B[0]);ResetDisplayDivOpacity();if(B[1]!="0"){ShowSlideShow(B[1])}if(gCanScroll){Coords=DivFindPos($("#MyEZListingDisplay"));window.scrollTo(0,parseInt(Coords[1]))}$("#GoogleStreetView").html("");var C=new GClientGeocoder();var A=B[2];C.getLatLng(A,function(E){var G={latlng:E};var F=new GStreetviewPanorama(document.getElementById("GoogleStreetView"),G);F.setLocationAndPOV(E)})}function MyEZListingRestorePage(){var A=x_iebrowser?x_iebrowser["MyEZListingDisplay"]:document.getElementById("MyEZListingDisplay");A.innerHTML=gOldHTML.pop();ResetDisplayDivOpacity();if(gCanScroll){window.scrollTo(0,gOldScrollY.pop())}}function MyEZListingStartTheTimer(){if(gTimerSecs==0){var A=x_iebrowser?x_iebrowser["MyEZListingDisplay"]:document.getElementById("MyEZListingDisplay");dv=x_iebrowser?x_iebrowser["SearchLargeLoadingBar"]:document.getElementById("SearchLargeLoadingBar");if(!dv){dv=document.createElement("div");dv.id="SearchLargeLoadingBar"}dv.style.position="absolute";WinCoords=WindowSize();dv.style.left=(WinCoords[0]/2)-100;dv.style.top=(WinCoords[1]/2)-50;dv.style.width=200;dv.style.height=100;dv.zIndex=99999;A.appendChild(dv);ShowLargeLoadingBar();if(gCanScroll){Coords=DivFindPos(A);window.scrollTo(0,parseInt(Coords[1]))}}else{gTimerSecs=gTimerSecs-1;gTimerRunning=true;gTimerID=self.setTimeout("MyEZListingStartTheTimer()",gTimerDelay)}}function MyEZListingStartTheSearchTimer(){if(gTimerSecs==0){ShowLoadingBar();if(gCanScroll){var A=x_iebrowser?x_iebrowser["MyEZListingDisplay"]:document.getElementById("MyEZListingDisplay");if(gCanScroll){Coords=DivFindPos(A);window.scrollTo(0,parseInt(Coords[1]))}}}else{gTimerSecs=gTimerSecs-1;gTimerRunning=true;gTimerID=self.setTimeout("MyEZListingStartTheSearchTimer()",gTimerDelay)}}function MyEZListingGetListingDetail(A){var B=x_iebrowser?x_iebrowser["MyEZListingDisplay"]:document.getElementById("MyEZListingDisplay");gOldHTML.push(B.innerHTML);gOldScrollY.push(document.body.scrollTop!=0?document.body.scrollTop:document.documentElement.scrollTop);gTimerSecs=gTimerDisplaySecs;MyEZListingStartTheTimer();DimDisplayDivOpacity();x_DisplayListingDetails(A,MyEZListingShowListingDetail)}function MyEZListingShowMLSResults(A){var B=x_iebrowser?x_iebrowser["MyEZListingDisplay"]:document.getElementById("MyEZListingDisplay");var C=A.split("~");if(gTimerRunning){clearTimeout(gTimerID)}gTimerRunning=false;B.innerHTML=C[0];ResetDisplayDivOpacity();if(C[1]!=undefined){gSearchID=C[1]}if(gCanScroll){Coords=DivFindPos(B);window.scrollTo(0,parseInt(Coords[1]))}}function MyEZListingDisplayMLSResults(A){var B=x_iebrowser?x_iebrowser["MyEZListingDisplay"]:document.getElementById("MyEZListingDisplay");gOldHTML.push(B.innerHTML);gOldScrollY.push(document.body.scrollTop!=0?document.body.scrollTop:document.documentElement.scrollTop);gTimerSecs=gTimerDisplaySecs;MyEZListingStartTheTimer();x_DisplayMLSResults(A,MyEZListingShowMLSResults)}function MyEZListingClearForm(A){for(i=0;i<A.length;i++){switch(A.elements[i].type){case"text":case"file":case"hidden":case"password":case"textarea":A.elements[i].value="";break;case"checkbox":case"radio":A.elements[i].checked=false;break;case"select-one":case"select-multiple":for(i2=0;i2<A.elements[i].options.length;i2++){A.elements[i].options[i2].selected=false}break}}}function MyEZListingSearchForm(B){var A="";var C="";for(i=0;i<B.length;i++){switch(B.elements[i].type){case"text":case"file":case"hidden":case"password":case"textarea":A+="|"+B.elements[i].name+"_"+B.elements[i].type+"_"+B.elements[i].value;if(B.elements[i].name=="SearchType"){gSearchType=B.elements[i].value}if(B.elements[i].name=="MLSNum"){C=B.elements[i].value}break;case"checkbox":case"radio":A+="|"+B.elements[i].name+"_"+B.elements[i].type+"_"+(B.elements[i].checked?1:0);break;case"select-one":case"select-multiple":for(i2=0;i2<B.elements[i].options.length;i2++){if(B.elements[i].options[i2].selected){A+="|"+B.elements[i].name+"_"+B.elements[i].type+"_"+B.elements[i].options[i2].value;break}}break}}if(C!=""){MyEZListingGetListingDetail(C)}else{MyEZListingDisplayMLSResults(A)}}function MyEZListingGoToResultsPage(A){gReplacePage=true;gTimerSecs=gTimerDisplaySecs;MyEZListingStartTheSearchTimer();x_ChangeMLSResultsPage(gSearchID,A,MyEZListingShowMLSResults)}function MyEZListingSortBy(A){gReplacePage=true;gTimerSecs=gTimerDisplaySecs;MyEZListingStartTheSearchTimer();x_SortMLSResults(gSearchID,A,MyEZListingShowMLSResults)}function MyEZListingChangeRowsPerPage(A){gReplacePage=true;gTimerSecs=gTimerDisplaySecs;MyEZListingStartTheSearchTimer();x_ChangeMLSRowsPerPage(gSearchID,A,MyEZListingShowMLSResults)}function MyEZListingChangeSortSelect(A){gReplacePage=true;gTimerSecs=gTimerDisplaySecs;MyEZListingStartTheSearchTimer();x_ChangeMLSSortSelect(gSearchID,A,MyEZListingShowMLSResults)}function ExpandRem(B){var D="RemShort"+B;var E=x_iebrowser?x_iebrowser[D]:document.getElementById(D);var C="RemFull"+B;var A=x_iebrowser?x_iebrowser[C]:document.getElementById(C);E.style.display="none";A.style.display="inline"}function CollapseRem(B){var D="RemShort"+B;var E=x_iebrowser?x_iebrowser[D]:document.getElementById(D);var C="BioRem"+B;var A=x_iebrowser?x_iebrowser[C]:document.getElementById(C);E.style.display="inline";A.style.display="none"}