var ignoreMe;if(document.body){ignoreMe=document.body.scrollTop}if(document.documentElement.scrollTop){ignoreMe=document.documentElement.scrollTop}var g_lMyC21Account=null;var g_strMyC21FName=null;var g_cMyC21AccountType=null;var g_globalAfterLoginCallback=null;var g_globalAfterLoginCallbackArgs=null;function MyC21AccountLogout(){document.cookie="talksacct=; expires=Thu, 1 Jan 70 00:00:01 GMT; path=/communities/";document.cookie="myc21=; expires=Thu, 1 Jan 70 00:00:01 GMT; path=/";document.cookie="myc21auth=; expires=Thu, 1 Jan 70 00:00:01 GMT; path=/";
var A=document.getElementById("beacontext");if(A){A.innerHTML='<a onClick="return displayMyC21Login(null);" href="/myc21/standalone/login.jsp">Sign in</a><br>Not registered? <a href="/myc21/standalone/register.jsp" onClick="return DisplayRegisterPopup();">Sign up</a>'}SetInnerHtml("openhouseplancount","");var B=location.href;if(B.search(/myc21/)>-1){location.href="/"}g_lMyC21Account=null;g_strMyC21FName=null}function processMyC21Account(){var A=GetCookie("myc21");if(A){A=A.replace('"',"");A=A.replace('"',"");
if(A){var B=A.split(":");if(B.length>3){g_lMyC21Account=B[0];if(g_lMyC21Account>0){g_cMyC21AccountType=B[1];if(g_cMyC21AccountType=="G"){g_strMyC21FName="Guest"}else{if(g_cMyC21AccountType=="R"){g_strMyC21FName=B[2].replace(/\+/g," ");g_strMyC21FName=unescape(g_strMyC21FName)}else{g_lMyC21Account=null;return false}}count=B[3];if(count!=""){SetInnerHtml("openhouseplancount","("+count+")")}return true}}}}return false}function updateOpenHousePlanCount(A){processMyC21Account();document.cookie='myc21="'+g_lMyC21Account+":"+g_cMyC21AccountType+":"+escape(g_strMyC21FName)+":"+A+'"; path=/';
SetInnerHtml("openhouseplancount","("+A+")")}function loginMyC21AccountAndPerformAction(C,B,A){if(g_lMyC21Account==null){if(!processMyC21Account()){HideOpenHouseDateDisplay();g_globalAfterLoginCallback=C;g_globalAfterLoginCallbackArgs=B;displayMyC21Login();return false}}if(g_cMyC21AccountType=="G"&&(A==null||!A)){displayGuestRestriction();return false}C(B);return false}function setMyC21TabContent(B){var A=document.getElementById("beacontext");if(A){A.innerHTML=B}}function setMyC21TabLoggedIn(){setMyC21TabLoggedInWithValue(g_strMyC21FName)
}function setMyC21TabLoggedInWithValue(A){var A="Welcome "+A+"<br/>";A+='<a href="#" onclick="return MyC21AccountLogout();">Logout</a> &nbsp; ';A+='<a href="/myc21/results/properties.jsp">Go to My C21 page</a>';setMyC21TabContent(A)}function setMyC21TabGuestLoggedIn(){var A="Welcome Guest<br/>";A+='<a href="/myc21/standalone/register.jsp" onClick="return DisplayRegisterPopup();">Register</a>';setMyC21TabContent(A)}function setSavedImage(B){var A=document.getElementById(B);if(A){if(B=="option_save_icon"){A.src="/images/search/h_check_icon.gif"
}else{if(B=="save_img"){A.src="/images/search/topbar_save_on.gif"}else{if(B.indexOf("save_img_v2_")>=0){A.src="/images/search/save_check_but_yel.gif"}else{A.src="/images/myc21/save_but_on.gif"}}}}}function getInputValue(B){var A=document.getElementById(B);if(A){return A.value}return""}function setFocus(B){var A=document.getElementById(B);if(A){A.focus()}}function clearInputValue(B){var A=document.getElementById(B);if(A){A.value=""}}function setInputValue(B,C){var A=document.getElementById(B);if(A){A.value=C}}function getCenterPosition(){try{if(window.innerWidth){return(window.innerWidth/2)-120+"px"
}else{if(document.body&&document.body.clientWidth){return(document.body.clientWidth/2)-120+"px"}else{return"125px"}}}catch(A){}return"125px"}function positionPopup(D,C){if(D&&!(g_pBrowser.bIsMsIe&&g_pBrowser.fVersionMajor)){var B=CyberCoreFindPosX(D)-100;if(g_pBrowser.bIsMsIe){if(document.getElementById("page_sidebar")){B-=(CyberCoreFindWidth(document.getElementById("page_sidebar"))+10)}}var A=CyberCoreFindPosY(D);C.style.left=B+"px";C.style.top=A+"px";if(parseInt(C.style.left)<0){C.style.left="125px"}if(parseInt(C.style.top)<0){C.style.top="65px"
}}else{if(D){var A=CyberCoreFindPosY(D);C.style.top=A+"px";C.style.left=getCenterPosition()}else{C.style.top="125px";C.style.left=getCenterPosition()}}}function doMyC21Login(){RemoveClass("myc21loginload","hide");AddClass("myc21loginsubmit","hide");return true}function doCallbackAfterLogin(){if(g_lMyC21Account!=null){g_globalAfterLoginCallback(g_globalAfterLoginCallbackArgs)}return false}function doMortgageRecalculation(){var C=parseFloat(document.getElementById("mortgageamt").value);var B=parseFloat(document.getElementById("mortgagerate").value)/100;
var D=parseInt(document.getElementById("mortgageterm").value);var A=(C*((B/12)/(1-Math.pow((1+(B/12)),(-12*D)))));HidePopup("mortgagepopup");var E=document.getElementById("propertyMonthlyPayment");if(E){E.innerHTML="$"+AddCommas(A.toFixed(2))}}function displayMortgageRecalculator(D,C){var A=document.getElementById("mortgagepopup");if(A){try{positionPopup(D,A);A.style.left=(parseInt(A.style.left)-100)+"px";setInputValue("mortgageamt",C);setInputValue("mortgagerate","6.25");setInputValue("mortgageterm","30")}catch(B){}A.style.display="block";
A.style.zIndex=50000}return false}function displayGuestRestriction(){var C=document.getElementById("myc21popup");if(C){try{positionPopup(pObj,C);C.style.left=(parseInt(C.style.left)-250)+"px"}catch(D){}ShowModal();C.style.display="block";C.style.zIndex=50000;var B=(new Date()).getTime();var A=document.getElementById("myc21frame");if(A){A.src="/myc21/forms/guestrestriction.jsp?rid="+escape(B)}}return false}function displayMyC21Login(E){var C=document.getElementById("myc21popup");if(C){try{positionPopup(E,C);C.style.left=(parseInt(C.style.left)-250)+"px"
}catch(D){}ShowModal();C.style.display="block";C.style.zIndex=50000;var B=(new Date()).getTime();var A=document.getElementById("myc21frame");if(A){A.src="/myc21/forms/login.jsp?rid="+escape(B)}}return false}function hideAndResetAddItemPopup(){HidePopup("myc21addpopup");clearInputValue("myc21addnickname");clearInputValue("myc21addnotes");clearInputValue("myc21addparms");DisableFormElements("myc21addpopup",false);AddClass("myc21addsaved","hide");RemoveClass("myc21addsubmit","hide")}function doMyC21AddItem(){var C=getInputValue("myc21addnickname");
var D=getInputValue("myc21addnotes");var E=getInputValue("myc21addparms");var A=getInputValue("myc21addimgid");var B=(new Date()).getTime();var G="/ajaxservlet/myc21/saveitem?"+E+"&nickname="+escape(C)+"&notes="+escape(D)+"&rid="+escape(B);if(E.indexOf("type=S")>-1){if(!getInputValue("myc21addnotifyend").match(/\d{2}\/\d{2}\/\d{4}/)){alert("Please enter a date in the correct format MM/DD/YYYY");return }else{if(1*getInputValue("myc21addfreq")>Math.ceil(((new Date(getInputValue("myc21addnotifyend"))).getTime()-(new Date()).getTime())/(1000*60*60*24))){alert("The entered frequency will never be triggered with the current end date. Please enter another end date or frequency.");
return }}G+="&freq="+getInputValue("myc21addfreq")+"&notifyend="+getInputValue("myc21addnotifyend")}var F=function(K){if(K.readyState==4&&K.status==200){var H=GetNodeValue(K.responseXML,"results");if(H&&H=="success"){AddClass("myc21addload","hide");RemoveClass("myc21addsaved","hide");var J=GetNodeValue(K.responseXML,"type");var L=GetNodeValue(K.responseXML,"key");if(J&&J!=""&&L&&L!=""){c21Reporting(J,"Saved",L)}setSavedImage(A);window.setTimeout(hideAndResetAddItemPopup,2000)}else{var I=GetNodeValue(K.responseXML,"message");
if(!I){I="An error occurred while processing your request.  Please try again."}SetInnerHtml("myc21adderror",I);DisableFormElements("myc21addpopup",false);AddClass("myc21addload","hide");RemoveClass("myc21addsubmit","hide")}}};DisableFormElements("myc21addpopup",true);RemoveClass("myc21addload","hide");AddClass("myc21addsubmit","hide");g_AjaxQueue.schedule("myc21add",G,F);dcsMultiTrack("WT.cg_n","Engage","WT.z_engage_type","Engage","WT.z_engage_event","Add Note");return false}function displayMyC21SaveItemPopup(E,C,A){var B=document.getElementById("myc21addpopup");
if(B){try{positionPopup(E,B);ShowModal();setInputValue("myc21addparms",C);setInputValue("myc21addimgid",A);AddClass("myc21addload","hide");RemoveClass("myc21addsubmit","hide");SetInnerHtml("myc21adderror","");SetInnerHtml("additemadditional","");document.getElementById("additempopupcallout").style.height="177px";setFocus("myc21addnickname")}catch(D){}B.style.display="block";B.style.zIndex=50000}return false}function saveOfficeToMyC21(B,A){loginMyC21AccountAndPerformAction(this.saveOfficeToMyC21Body,arguments)
}function saveOfficeToMyC21Body(A){var C=A[0];var B=A[1];displayMyC21SaveItemPopup(C,"type=O&office_key="+escape(B),"save_img"+B);dcsMultiTrack("WT.cg_n","Engage","WT.z_engage_type","Engage","WT.z_engage_event","Save Office");return false}function saveAgentToMyC21(B,A){loginMyC21AccountAndPerformAction(this.saveAgentToMyC21Body,arguments)}function saveAgentToMyC21Body(A){var C=A[0];var B=A[1];displayMyC21SaveItemPopup(C,"type=A&sa_key="+escape(B),"save_img"+B);dcsMultiTrack("WT.cg_n","Engage","WT.z_engage_type","Engage","WT.z_engage_event","Save Agent");
return false}function saveOpenHouseToMyC21(D,B,C,A){loginMyC21AccountAndPerformAction(this.saveOpenHouseToMyC21Body,arguments,true)}function saveOpenHouseToMyC21Body(C){var F=C[0];var B=C[1];var E=C[2];var A=C[3];var D=(new Date()).getTime();var H="/ajaxservlet/openhouse/saveevent?tr_key="+escape(F)+"&start="+escape(B)+"&rid="+escape(D);var G=function(L){if(L.readyState==4&&L.status==200){var I=GetNodeValue(L.responseXML,"result");if(I&&I=="success"){var K=document.getElementById("openhouse_save_"+F+"_"+B);if(K){K.innerHTML='<img src="/images/myc21/save_but_on.gif" alt="saved" align="top" />'
}var M=GetNodeValue(L.responseXML,"message");HideOpenHouseDateDisplay();displaySavedOpenHousePopup(M,B,E,A)}else{var J=GetNodeValue(L.responseXML,"message");if(!J){J="An error occurred while processing your request.  Please try again."}alert(J)}}};g_AjaxQueue.schedule("myc21add",H,G);return false}function printCommercialListing(A,B){window.print()}function printListing(A){c21Reporting("listing","PropPrinted",A);window.print();dcsMultiTrack("WT.cg_n","Engage","WT.z_engage_type","Engage","WT.z_engage_event","Print Listing")
}function printListingUpdated(F){var A=false;if(window.location.href.search("directions.jsp")>=0){var B=document.forms.directionsform.faddress.value;var G=document.forms.directionsform.fcity.value;var E=document.forms.directionsform.fstate.value;var D=document.forms.directionsform.fzip.value;var C=getDirectionErrors(B,G,E,D);if(C!=""){alert(C);return true}else{button=document.getElementById("print_button");button.href=button.href+"&faddress="+B+"&fcity="+G+"&fstate="+E+"&fzip="+D}}else{if(!window.location.href.search("index.jsp")&&!window.location.href.search("heighborhoods.jsp")){window.print();
A=true}}c21Reporting("listing","PropPrinted",F);dcsMultiTrack("WT.cg_n","Engage","WT.z_engage_type","Engage","WT.z_engage_event","Print Listing");return !A}function printAgent(A){window.print();c21Reporting("agent","Printed",A);dcsMultiTrack("WT.cg_n","Engage","WT.z_engage_type","Engage","WT.z_engage_event","Print Agent")}function printAgentUpdated(D){if(window.location.href.search("directions.jsp")>=0){var A=document.forms.directionsform.faddress.value;var F=document.forms.directionsform.fcity.value;var E=document.forms.directionsform.fstate.value;
var C=document.forms.directionsform.fzip.value;var B=getDirectionErrors(A,F,E,C);if(B!=""){alert(B);return true}else{button=document.getElementById("print_button");button.href=button.href+"&faddress="+A+"&fcity="+F+"&fstate="+E+"&fzip="+C}}else{window.print()}c21Reporting("agent","Printed",D);dcsMultiTrack("WT.cg_n","Engage","WT.z_engage_type","Engage","WT.z_engage_event","Print Agent");return false}function printOffice(A){c21Reporting("office","Printed",A);dcsMultiTrack("WT.cg_n","Engage","WT.z_engage_type","Engage","WT.z_engage_event","Print Office");
window.print()}function printOfficeUpdated(D){if(window.location.href.search("directions.jsp")>=0){var A=document.forms.directionsform.faddress.value;var F=document.forms.directionsform.fcity.value;var E=document.forms.directionsform.fstate.value;var C=document.forms.directionsform.fzip.value;var B=getDirectionErrors(A,F,E,C);if(B!=""){alert(B);return false}else{button=document.getElementById("print_button");button.href=button.href+"&faddress="+A+"&fcity="+F+"&fstate="+E+"&fzip="+C}}else{window.print()}c21Reporting("office","Printed",D);
dcsMultiTrack("WT.cg_n","Engage","WT.z_engage_type","Engage","WT.z_engage_event","Print Office");return false}function printTeam(A){window.print()}function printTeamUpdated(E){if(window.location.href.search("directions.jsp")>=0){var A=document.forms.directionsform.faddress.value;var F=document.forms.directionsform.fcity.value;var D=document.forms.directionsform.fstate.value;var C=document.forms.directionsform.fzip.value;var B=getDirectionErrors(A,F,D,C);if(B!=""){alert(B);return true}else{button=document.getElementById("print_button");
button.href=button.href+"&faddress="+A+"&fcity="+F+"&fstate="+D+"&fzip="+C}}else{window.print()}return false}function getDirectionErrors(A,F,E,D){var C="";var B=false;if(A==""||F==""||E==""||D==""){B=true}if(B){C="Please correct the following problems to go to the print view:\n";if(A==""){C+="\nPlease fill in an address."}if(F==""){C+="\nPlease fill in a city."}if(E==""){C+="\nPlease fill in a state."}if(D==""){C+="\nPlease fill in a zip code."}}return C}function savePressReleaseToMyC21(B,A){loginMyC21AccountAndPerformAction(this.savePressReleaseToMyC21Body,arguments)
}function savePressReleaseToMyC21Body(B){var C=B[0];var A=B[1];displayMyC21SaveItemPopup(C,"type=R&pr_id="+escape(A),"this_pr_save");dcsMultiTrack("WT.cg_n","Engage","WT.z_engage_type","Engage","WT.z_engage_event","Save Press Release");return false}function savePropertyToMyC21(C,B,A){loginMyC21AccountAndPerformAction(this.savePropertyToMyC21Body,arguments)}function savePropertyToMyC21Body(A){var E=A[0];var D=A[1];var B="save_img";try{B=A[2]}catch(C){B="save_img"}if(B==null||B==""){B="save_img"}displayMyC21SaveItemPopup(E,"type=P&tr_key="+escape(D),B+D);
dcsMultiTrack("WT.cg_n","Engage","WT.z_engage_type","Engage","WT.z_engage_event","Save Property");return false}function saveSearchToMyC21(C,B,A){loginMyC21AccountAndPerformAction(this.saveSearchToMyC21Body,arguments)}function updateSearchToMyC21(E){var F=E.parentNode.parentNode.parentNode;var B=F.cells[2].getElementsByTagName("SELECT")[0];var C=F.cells[3].getElementsByTagName("INPUT")[0];if(!C.value.match(/\d{2}\/\d{2}\/\d{4}/)){alert("Please enter a date in the correct format MM/DD/YYYY");return }else{if(Math.ceil(((new Date(C.value)).getTime()-(new Date()).getTime())/(1000*60*60*24))<=0||1*B.options[B.selectedIndex].value>Math.ceil(((new Date(C.value)).getTime()-(new Date()).getTime())/(1000*60*60*24))){alert("The entered frequency will never be triggered with the current end date. Please enter another end date or frequency.");
return }}var A="/ajaxservlet/myc21/saveitem?type=S&search_type=P&itemid="+E.getAttribute("itemid")+"&freq="+B.options[B.selectedIndex].value+"&notifyend="+escape(C.value)+"&r="+(new Date()).getTime();var D=function(H){if(H.readyState==4&&H.status==200){var G=GetNodeValue(H.responseXML,"results");if(G&&G=="success"){alert("Search Update Saved.");E.getElementsByTagName("img")[0].src="/images/myc21/save_but_on.gif"}else{alert("Error saving updates, please try again.")}}};g_AjaxQueue.schedule("myc21update",A,D);
return false}function saveSearchToMyC21Body(C){var F=C[0];var B=C[1];var A=C[2];var D=A;displayMyC21SaveItemPopup(F,"type=S&search_type="+escape(B)+"&query="+escape(D),"option_save_icon");document.getElementById("additempopupcallout").style.height="270px";var E=["Frequency:","<select class='contactform' id='myc21addfreq' style='width:100%;display:block'>","<option value='1'>Daily","<option value='7'>Weekly","<option value='14'>Bi-Monthly","<option value='30'>Monthly","<option value='92'>Quarterly","</select>","Length:<br/>","<input id='myc21addnotifyend' class='contactform' style='margin-bottom:5px' type='text' size='8'/>","&nbsp;<img onclick=\"getCalendar(document.getElementById('myc21addnotifyend'))\" style='cursor:pointer;vertical-align:-3px' src='/images/calendar.gif'/>"];
SetInnerHtml("additemadditional",E.join(""));dcsMultiTrack("WT.cg_n","Engage","WT.z_engage_type","Engage","WT.z_engage_event","Save Search");return false}function saveCalculatorToMyC21(C,A,B){loginMyC21AccountAndPerformAction(this.saveCalculatorToMyC21Body,arguments)}function saveCalculatorToMyC21Body(A){var D=A[0];var B=A[1];var C=A[2];displayMyC21SaveItemPopup(D,"type=C&calc_type="+escape(B)+"&url="+escape(C),"save_img");return false}function saveDirectionsToMyC21(A){loginMyC21AccountAndPerformAction(this.saveDirectionsToMyC21Body,arguments)
}function saveDirectionsToMyC21Body(d){var a=d[0];var V=document.getElementById("endAddress");var g=document.getElementById("endCity");var X=document.getElementById("endState");var J=document.getElementById("endZip");var Q=document.getElementById("endLat");var A=document.getElementById("endLong");var C=document.getElementById("endProvince");var M=document.getElementById("endCountry");var H=document.getElementById("startAddress");var Z=document.getElementById("startCity");var e=document.getElementById("startState");
var h=document.getElementById("startZip");var D=document.getElementById("startLat");var b=document.getElementById("startLong");var F=document.getElementById("startProvince");var E=document.getElementById("startCountry");var T=document.getElementById("distance");if(V&&g&&X&&J&&Q&&A&&C&&M&&H&&Z&&e&&h&&D&&b&&F&&E&&T){var B=V.value;var I=g.value;var O=X.value;var f=J.value;var U=Q.value;var Y=A.value;var W=C.value;var j=M.value;var N=H.value;var i=Z.value;var P=e.value;var c=h.value;var S=D.value;var L=b.value;var R=F.value;
var K=E.value;var G=T.value;displayMyC21SaveItemPopup(a,"type=D&endaddress="+escape(B)+"&endcity="+escape(I)+"&endstate="+escape(O)+"&endzip="+escape(f)+"&endlat="+escape(U)+"&endlong="+escape(Y)+"&endprovince="+escape(W)+"&endcountry="+escape(j)+"&startaddress="+escape(N)+"&startcity="+escape(i)+"&startstate="+escape(P)+"&startzip="+escape(c)+"&startlat="+escape(S)+"&startlong="+escape(L)+"&startprovince="+escape(R)+"&startcountry="+escape(K)+"&distance="+escape(G)+"","save_directions_button");dcsMultiTrack("WT.cg_n","Engage","WT.z_engage_type","Engage","WT.z_engage_event","Save Directions")
}else{alert("We could not save your directions.  Please try again later.")}return false}function updateStateDisplayForCountry(){var C=document.getElementById("country");if(C){var B=document.getElementById("provincefield");var A=document.getElementById("statedropdown");if(B&&A){if(C.value!="US"){B.style.display="";A.style.display="none"}else{var D=document.getElementById("province");if(D){D.value=""}B.style.display="none";A.style.display=""}}}}function processUserTypeChange(){var C=document.getElementById("usertypeselect");
var A=document.getElementById("emailoptin_section");var B=document.getElementById("emailoptin");if(C&&B){if(C.options[C.selectedIndex].value=="O"){B.checked=false;A.style.visibility="hidden"}else{A.style.visibility="visible"}}}function toggleEmailUsername(){var B=document.getElementById("emailusername");if(B){if(B.checked){var C=document.getElementById("email");var A=document.getElementById("username");if(C&&A){A.value=C.value}}}}function clearEmailUsernameCb(){var A=document.getElementById("emailusername");
if(A){A.checked=false}}function DisplayNotes(E,B){var C=document.getElementById("notespopup");if(C){try{positionPopup(E,C);C.style.left=(parseInt(C.style.left)-100)+"px";var A=document.getElementById("notescontent");if(A){A.innerHTML=B}}catch(D){}C.style.display="block";C.style.zIndex=50000}return false}function DisplayRegisterPopup(E){var C="";if(typeof (E)!="undefined"){C="&email="+escape(E)}var F=document.getElementById("myc21popup");if(F){F.style.top="60px";try{if(window.innerWidth){F.style.left=(window.innerWidth/2)-321+"px"
}else{if(document.body&&document.body.clientWidth){F.style.left=(document.body.clientWidth/2)-321+"px"}else{F.style.left="150px"}}}catch(G){}ShowModal();F.style.display="block";F.style.zIndex=50000;var D=(new Date()).getTime();var B=document.getElementById("myc21frame");if(B){B.src="/myc21/forms/register.jsp?rid="+escape(D)+C}var A=document.getElementById("header_2010_logo");if(A){A.scrollIntoView()}}return false}function HidePopup(A){if(typeof A=="string"){A=document.getElementById(A)}if(A){A.style.display="none";
A.style.zIndex=0}HideModal();return false}function ShowPopup(D,B,A){if(typeof B=="string"){B=document.getElementById(B)}if(B){try{positionPopup(D,B);B.style.left=(parseInt(B.style.left)+A)+"px"}catch(C){}B.style.display="block";B.style.zIndex=50000}return false}function resizeDialog(C,D,A){var E=document.getElementById(C+"outer");if(E){E.style.height=(D+99)+"px";E.style.width=(A+51)+"px"}var B=document.getElementById(C+"inner");if(B){B.style.height=(D+48)+"px"}var B=document.getElementById(C+"frame");if(B){B.style.height="100%"
}};