browser=navigator.userAgent;ctlFHAVerB="";window.onload=function(){var ctlVer=document.getElementById("hidCTLFindAHomeVerB");if(ctlVer!=null){if(ctlVer.value.toUpperCase().indexOf("VERA")!=-1){var divMetaData=document.getElementById(ctlVer.value+"_divMetaData");if(parseInt(document.documentMode)==8&&browser.indexOf("MSIE")!=-1){divMetaData.style.top="-40px"}}if(ctlVer.value.toUpperCase().indexOf("VERB")!=-1){if(parseInt(document.documentMode)==8&&browser.indexOf("MSIE")!=-1){var trSearch2SepTop=document.getElementById("trSearch2SepTop");var tdSearch2=document.getElementById("tdSearch2");var tdLastUpdate=document.getElementById("tdLastUpdate");var tdBaths1=document.getElementById("tdBaths1");trSearch2SepTop.style.display="block";tdSearch2.style.paddingBottom="10px";tdLastUpdate.style.paddingLeft="10px";tdBaths1.style.paddingLeft="7px"}}}if(browser.indexOf("Safari")!=-1){resetSafari();}if(browser.indexOf("Firefox")!=-1){resetFirefox();}if(browser.indexOf("Chrome")!=-1){resetChrome();}var hidFieldBuyerGuide=parent.document.getElementById("hidFieldBuyerGuide");if(hidFieldBuyerGuide!=null){hidFieldBuyerGuide.value='Y'}};function resetChrome(){var tdLotSizeDDL=document.getElementById("tdLotSizeDDL");if(tdLotSizeDDL!=null){tdLotSizeDDL.style.paddingRight="10px"}}function resetSafari(){ctlFHAVerB=document.getElementById("hidCTLFindAHomeVerB");var divFAH2_verB=document.getElementById(ctlFHAVerB.value+"_divFAH2_verB");var tdWhatCanIAfford=document.getElementById("tdWhatCanIAfford");var trSearch2SepTop=document.getElementById("trSearch2SepTop");var trSearch2SepBottom=document.getElementById("trSearch2SepBottom");var tdLastUpdate=document.getElementById("tdLastUpdate");var tdBeds=document.getElementById("tdBeds");var tdBaths=document.getElementById("tdBaths");var tdBaths1=document.getElementById("tdBaths1");var tdHomeAge=document.getElementById("tdHomeAge");var tdHomeAge1=document.getElementById("tdHomeAge1");var tdMapSearch=document.getElementById("tdMapSearch");var tdMapSearch1=document.getElementById("tdMapSearch1");var tdPriceRange=document.getElementById("tdPriceRange");var tdPriceTo=document.getElementById("tdPriceTo");var tdSqFt=document.getElementById("tdSqFt");var tdLotSize=document.getElementById("tdLotSize");var tdLevels=document.getElementById("tdLevels");var tdParking=document.getElementById("tdParking");var trSearch2=document.getElementById("trSearch2");var tdPriceRange=document.getElementById("tdPriceRange");var tdLotSizeDDL=document.getElementById("tdLotSizeDDL");divFAH2_verB.style.height="357px";trSearch2SepTop.style.display="block";trSearch2SepBottom.style.display="block";trSearch2SepBottom.style.height="5px";tdLastUpdate.style.paddingLeft="10px";tdBaths.style.paddingLeft="14px";tdHomeAge.style.paddingLeft="14px";tdMapSearch.style.paddingBottom="5px";tdMapSearch1.style.paddingBottom="5px";tdPriceRange.style.paddingTop="4px";tdPriceTo.style.paddingTop="4px";tdBeds.style.paddingTop="4px";tdBaths1.style.paddingTop="4px";tdSqFt.style.paddingTop="4px";tdLotSize.style.paddingTop="4px";tdHomeAge1.style.paddingTop="4px";tdLevels.style.paddingTop="4px";tdParking.style.paddingTop="4px";tdLotSizeDDL.style.paddingRight="10px"}function resetFirefox(){ctlFHAVerB=document.getElementById("hidCTLFindAHomeVerB");var divFAH2_verB=document.getElementById(ctlFHAVerB.value+"_divFAH2_verB");var tdWhatCanIAfford=document.getElementById("tdWhatCanIAfford");var trSearch2=document.getElementById("trSearch2");var tdSearch2=document.getElementById("tdSearch2");var trSearch2SepTop=document.getElementById("trSearch2SepTop");var trSearch2SepBottom=document.getElementById("trSearch2SepBottom");var tdLastUpdate=document.getElementById("tdLastUpdate");var tdBedsDDL=document.getElementById("tdBedsDDL");var tdBaths=document.getElementById("tdBaths");var tdBathsDDL=document.getElementById("tdBathsDDL");var tdHomeAge=document.getElementById("tdHomeAge");var tdHomeAgeDDL=document.getElementById("tdHomeAgeDDL");var tdMapSearch=document.getElementById("tdMapSearch");var tdMapSearch1=document.getElementById("tdMapSearch1");var tdPriceRange=document.getElementById("tdPriceRange");var tdSqFtDDL=document.getElementById("tdSqFtDDL");var tdLotSizeDDL=document.getElementById("tdLotSizeDDL");var tdLevelsDDL=document.getElementById("tdLevelsDDL");var tdParkingDDL=document.getElementById("tdParkingDDL");var tdMinPDDL=document.getElementById("tdMinPDDL");var tdMaxPDDL=document.getElementById("tdMaxPDDL");if(divFAH2_verB!=null){divFAH2_verB.style.height="370px"}if(tdSearch2!=null){tdSearch2.style.paddingTop="10px";tdSearch2.style.paddingBottom="10px"}if(trSearch2SepTop!=null){trSearch2SepTop.style.display="none"}if(trSearch2SepBottom!=null){trSearch2SepBottom.style.display="none"}if(trSearch2!=null){trSearch2.style.paddingTop="0px"}if(tdLastUpdate!=null){tdLastUpdate.style.paddingLeft="10px"}if(tdBaths!=null){tdBaths.style.paddingLeft="14px"}if(tdHomeAge!=null){tdHomeAge.style.paddingLeft="14px"}if(divFAH2_verB!=null){tdMapSearch.style.paddingBottom="5px";tdMapSearch1.style.paddingBottom="5px";tdMinPDDL.style.paddingBottom="6px";tdMaxPDDL.style.paddingBottom="6px";tdBedsDDL.style.paddingBottom="6px";tdBathsDDL.style.paddingBottom="6px";tdSqFtDDL.style.paddingBottom="8px";tdLotSizeDDL.style.paddingBottom="6px";tdHomeAgeDDL.style.paddingBottom="6px";tdLevelsDDL.style.paddingBottom="6px";tdParkingDDL.style.paddingBottom="6px"}}function showFindAHomeVerB(){var hidFT4FAHModURL=document.getElementById("hidFT4FAHModURL");var hidFT4FAHAgtURL=document.getElementById("hidFT4FAHAgtURL");if(hidFT4FAHAgtURL.value!=""){window.location.href=hidFT4FAHAgtURL.value+"/findahomelanding.aspx"}else{window.location.href=hidFT4FAHModURL.value+"findahomelanding.aspx"}}function validateCalcFields(event){ctlFHAVerB=document.getElementById("hidCTLFindAHomeVerB");var txtDwnPmt=document.getElementById(ctlFHAVerB.value+"_txtDwnPmt");var lblDwnPmt=document.getElementById("lblDwnPmt");var txtIntRate=document.getElementById(ctlFHAVerB.value+"_txtIntRate");var lblIntRate=document.getElementById("lblIntRate");var txtMoPmt=document.getElementById(ctlFHAVerB.value+"_txtMoPmt");var lblMoPmt=document.getElementById("lblMoPmt");var lblErrorMsg=document.getElementById(ctlFHAVerB.value+"_lblErrorMsg");var bOK=true;txtDwnPmt.className="StandardTextbox";lblDwnPmt.className="findAhome_verB_fieldLabel";txtIntRate.className="StandardTextbox";lblIntRate.className="findAhome_verB_fieldLabel";txtMoPmt.className="StandardTextbox";lblMoPmt.className="findAhome_verB_fieldLabel";lblErrorMsg.innerHTML="";if(txtDwnPmt.value==""){bOK=false;txtDwnPmt.className="ErrorTextbox";lblDwnPmt.className="ErrorTextSmall2"}if(txtIntRate!=null&&txtIntRate.value==""){bOK=false;txtIntRate.className="ErrorTextbox";lblIntRate.className="ErrorTextSmall2"}if(txtIntRate!=null&&parseInt(txtIntRate.value)==0){bOK=false;txtIntRate.className="ErrorTextbox";lblIntRate.className="ErrorTextSmall2"}if(txtMoPmt.value==""){bOK=false;txtMoPmt.className="ErrorTextbox";lblMoPmt.className="ErrorTextSmall2"}if(bOK==false){lblErrorMsg.innerHTML="We are missing some data"}else{GetMaxAffordPrice();}if(event!=null){if(browser.indexOf("Firefox")!=-1||browser.indexOf("Safari")!=-1){event.preventDefault();event.stopPropagation();}else{event.cancelBubble=true;event.returnValue=false}}}function showCalculator(){ctlFHAVerB=document.getElementById("hidCTLFindAHomeVerB");var tblPriceRange=document.getElementById(ctlFHAVerB.value+"_tblPriceRange");var tblHomeAffordability=document.getElementById(ctlFHAVerB.value+"_tblHomeAffordability");var tblCalculate=document.getElementById(ctlFHAVerB.value+"_tblCalculate");var tblCalcResults=document.getElementById(ctlFHAVerB.value+"_tblCalcResults");var divFAH2_verB=document.getElementById(ctlFHAVerB.value+"_divFAH2_verB");var trBeds=document.getElementById("trBeds");var txtDwnPmt=document.getElementById(ctlFHAVerB.value+"_txtDwnPmt");var txtIntRate=document.getElementById(ctlFHAVerB.value+"_txtIntRate");var txtMoPmt=document.getElementById(ctlFHAVerB.value+"_txtMoPmt");var hidMaxAffordPrice=document.getElementById(ctlFHAVerB.value+"_hidMaxAffordPrice");var hiddfIntRate=document.getElementById("hiddfIntRate");var lblErrorMsg=document.getElementById(ctlFHAVerB.value+"_lblErrorMsg");tblPriceRange.style.display="none";tblHomeAffordability.style.display="block";tblCalculate.style.display="block";tblCalcResults.style.display="none";txtDwnPmt.value="";txtIntRate.value=hiddfIntRate.value;txtMoPmt.value="";hidMaxAffordPrice.value="";if(browser.indexOf("Safari")!=-1){divFAH2_verB.style.height="429px";tblHomeAffordability.style.cellPadding="3"}else{if(browser.indexOf("Firefox")!=-1){divFAH2_verB.style.height="428px";tblHomeAffordability.style.cellPadding="3"}else{divFAH2_verB.style.height="450px";trBeds.style.paddingTop="10px";if(parseInt(document.documentMode)==8&&browser.indexOf("MSIE")!=-1){divFAH2_verB.style.height="425px"}}}txtDwnPmt.className="StandardTextbox";lblDwnPmt.className="findAhome_verB_fieldLabel";txtIntRate.className="StandardTextbox";lblIntRate.className="findAhome_verB_fieldLabel";txtMoPmt.className="StandardTextbox";lblMoPmt.className="findAhome_verB_fieldLabel"}function GetMaxAffordPrice(){ctlFHAVerB=document.getElementById("hidCTLFindAHomeVerB");var txtIntRate=document.getElementById(ctlFHAVerB.value+"_txtIntRate");var ddlLoanTerm=document.getElementById(ctlFHAVerB.value+"_ddlLoanTerm");var txtDwnPmt=document.getElementById(ctlFHAVerB.value+"_txtDwnPmt");var txtMoPmt=document.getElementById(ctlFHAVerB.value+"_txtMoPmt");var lblEstPmt1=document.getElementById(ctlFHAVerB.value+"_lblEstPmt1");var hidMaxAffordPrice=document.getElementById(ctlFHAVerB.value+"_hidMaxAffordPrice");var rate=parseFloat(txtIntRate.value)/100;var term=ddlLoanTerm.value;term=replaceAll(term,'yr.','');term=replaceAll(term,'fixed','');term=replaceAll(term,' ','');term*=12;var dp=parseInt(txtDwnPmt.value.replace(",",""));var moPmt=parseInt(txtMoPmt.value.replace(",",""));hidMaxAffordPrice.value="";var n=(Math.pow(1+(rate/12),term))-1;var d=(Math.pow(1+(rate/12),term))*rate/12;var maxPrice=dp+(moPmt*(n/d));maxPrice=CurrencyFormatted(maxPrice);maxPrice=RoundUpDownCalcValue(maxPrice);hidMaxAffordPrice.value=maxPrice;maxPrice=CommaFormatted(maxPrice);if(maxPrice!="0"){lblEstPmt1.innerHTML="$"+maxPrice;showCalcResults();}else{showPriceRange();}}function CurrencyFormatted(amount){var i=parseFloat(amount);if(isNaN(i)){i=0.00}var minus='';if(i<0){minus='-'}i=Math.abs(i);i=parseInt((i+.005)*100);i/=100;s=new String(i);if(s.indexOf(".")!=-1){var a=s.split(".");s=a[0];}s=minus+s;return s}function CommaFormatted(amount){var delimiter=",";var i=parseInt(amount);if(isNaN(i)){return''}var minus='';if(i<0){minus='-'}i=Math.abs(i);var n=new String(i);var a=[];while(n.length>3){var nn=n.substr(n.length-3);a.unshift(nn);n=n.substr(0,n.length-3);}if(n.length>0){a.unshift(n);}n=a.join(delimiter);amount=n;amount=minus+amount;return amount}function RoundUpDownCalcValue(sValue){var calcValue=parseInt(sValue);var tmpResult=0;if(calcValue>=50000&&calcValue<400000){for(var i=50000;i<400000;i+=25000){if(i>calcValue){tmpResult=i-25000;break}}if(tmpResult==0){tmpResult=400000}}if(calcValue>=400000&&calcValue<900000){for(var i=400000;i<900000;i+=50000){if(i>calcValue){tmpResult=i-50000;break}}if(tmpResult==0){tmpResult=900000}}if(calcValue>=900000&&calcValue<1000000){for(var i=900000;i<1000000;i+=100000){if(i>calcValue){tmpResult=i-100000;break}}if(tmpResult==0){tmpResult=1000000}}if(calcValue>=1000000&&calcValue<2000000){for(var i=1000000;i<2000000;i+=250000){if(i>calcValue){tmpResult=i-250000;break}}if(tmpResult==0){tmpResult=2000000}}if(calcValue>=2000000&&calcValue<5000000){for(var i=2000000;i<5000000;i+=500000){if(i>calcValue){tmpResult=i-500000;break}}if(tmpResult==0){tmpResult=5000000}}if(calcValue>=5000000&&calcValue<7500000){if(calcValue==5000000){tmpResult=5000000}if(calcValue>5000000){tmpResult=7500000}}if(calcValue>=7500000&&calcValue<10000000){if(calcValue==7500000){tmpResult=7500000}if(calcValue>7500000){tmpResult=10000000}}if(calcValue>=10000000&&calcValue<350000000){for(var i=10000000;i<35000000;i+=5000000){if(i>calcValue){tmpResult=i-5000000;break}}if(tmpResult==0){tmpResult=350000000}}if(calcValue>=35000000){tmpResult=35000000}return tmpResult}function showCalcResults(){ctlFHAVerB=document.getElementById("hidCTLFindAHomeVerB");var tblPriceRange=document.getElementById(ctlFHAVerB.value+"_tblPriceRange");var tblHomeAffordability=document.getElementById(ctlFHAVerB.value+"_tblHomeAffordability");var tblCalculate=document.getElementById(ctlFHAVerB.value+"_tblCalculate");var tblCalcResults=document.getElementById(ctlFHAVerB.value+"_tblCalcResults");var divFAH2_verB=document.getElementById(ctlFHAVerB.value+"_divFAH2_verB");tblPriceRange.style.display="none";tblHomeAffordability.style.display="block";tblCalculate.style.display="none";tblCalcResults.style.display="block";divFAH2_verB.style.height="375px";var trCalcResults=document.getElementById("trCalcResults");var tdCalcResults=document.getElementById(ctlFHAVerB.value+"_tdCalcResults");var tdMaxPrice=document.getElementById(ctlFHAVerB.value+"_tdMaxPrice");if(browser.indexOf("Safari")!=-1){trCalcResults.style.paddingLeft="20px";tdCalcResults.style.paddingLeft="50px";divFAH2_verB.style.height="357px"}if(browser.indexOf("Firefox")!=-1){tblCalcResults.style.width="720px";trCalcResults.style.paddingLeft="20px";tdMaxPrice.style.width="55%";tdCalcResults.style.width="45%";tdCalcResults.style.paddingLeft="6px";divFAH2_verB.style.height="358px"}if(parseInt(document.documentMode)==8&&browser.indexOf("MSIE")!=-1){divFAH2_verB.style.height="345px"}}function showPriceRange(){ctlFHAVerB=document.getElementById("hidCTLFindAHomeVerB");var tblPriceRange=document.getElementById(ctlFHAVerB.value+"_tblPriceRange");var tdPriceRange=document.getElementById("tdPriceRange");var tblHomeAffordability=document.getElementById(ctlFHAVerB.value+"_tblHomeAffordability");var divFAH2_verB=document.getElementById(ctlFHAVerB.value+"_divFAH2_verB");var trBeds=document.getElementById("trBeds");var ddlMinPrice=document.getElementById(ctlFHAVerB.value+"_ddlMinPrice");var ddlMaxPrice=document.getElementById(ctlFHAVerB.value+"_ddlMaxPrice");var tblCalculate=document.getElementById(ctlFHAVerB.value+"_tblCalculate");var tblCalcResults=document.getElementById(ctlFHAVerB.value+"_tblCalcResults");var tdWhatCanIAfford=document.getElementById("tdWhatCanIAfford");var lblPriceRange=document.getElementById("lblPriceRange");var hidMaxAffordPrice=document.getElementById(ctlFHAVerB.value+"_hidMaxAffordPrice");var lblErrorMsg=document.getElementById(ctlFHAVerB.value+"_lblErrorMsg");tblPriceRange.style.display="block";tblHomeAffordability.style.display="none";tblCalculate.style.display="none";tblCalcResults.style.display="none";lblPriceRange.style.width="30px";ddlMinPrice.selectedIndex=0;ddlMaxPrice.selectedIndex=0;hidMaxAffordPrice.value="";if(lblErrorMsg!=null&&lblErrorMsg.innerHTML!=""){lblErrorMsg.innerHTML=""}if(browser.indexOf("Safari")!=-1){resetSafari();tdPriceRange.style.width="78px"}else{if(browser.indexOf("Firefox")!=-1){resetFirefox();tdPriceRange.style.width="76px"}else{divFAH2_verB.style.height="365px";if(parseInt(document.documentMode)==8&&browser.indexOf("MSIE")!=-1){divFAH2_verB.style.height="355px"}}}trBeds.style.paddingTop="0px"}function clearOut(sCTLVer){ctlFHAVerB=document.getElementById("hidCTLFindAHomeVerB");var txtCityZipMLSId=document.getElementById(ctlFHAVerB.value+"_txtCityZipMLSId");var lblErrorMsg=document.getElementById(ctlFHAVerB.value+"_lblErrorMsg");if(txtCityZipMLSId.value=="City or ZIP code or MLS ID"){txtCityZipMLSId.value="";if((sCTLVer=="A"||sCTLVer=="B")&&lblErrorMsg.innerHTML!=""){lblErrorMsg.innerHTML=""}if(sCTLVer=="B"){txtCityZipMLSId.className="fieldTextMedium"}else{if(sCTLVer=="C"){txtCityZipMLSId.className="fieldTextMedium2"}else{txtCityZipMLSId.className="fieldTextMedium3"}}}if(sCTLVer=="A"||sCTLVer=="B"){if(txtCityZipMLSId.value==""&&lblErrorMsg.innerHTML!=""){lblErrorMsg.innerHTML="";if(sCTLVer=="B"){txtCityZipMLSId.className="fieldTextMedium"}else{if(sCTLVer=="C"){txtCityZipMLSId.className="fieldTextMedium2"}else{txtCityZipMLSId.className="fieldTextMedium3"}}}}}function showFAHRegistration(sURL){var hidFAHReg=parent.document.getElementById("hidFAHReg");var hidHBTTReg=parent.document.getElementById("hidHBTTReg");var ifra=getIFrameID();var bvMPE=getMPEBehaviorID();var width="730px";var height="442px";if(browser.indexOf("Safari")!=-1||browser.indexOf("Chrome")!=-1){width="775px";height="424px"}if(browser.indexOf("Firefox")!=-1){height="411px"}if(hidFAHReg!=null){hidFAHReg.value="Y"}if(hidHBTTReg!=null){hidHBTTReg.Value=""}changeIFRAMESource(sURL,ifra,bvMPE,width,height)}function showMapSearch(){var hidFT4FAHModURL=document.getElementById("hidFT4FAHModURL");var hidFT4FAHAgtURL=document.getElementById("hidFT4FAHAgtURL");if(hidFT4FAHAgtURL.value!=""){window.location.href=hidFT4FAHAgtURL.value+"/mapsearchlanding.aspx"}else{window.location.href=hidFT4FAHModURL.value+"mapsearchlanding.aspx"}}function validateSearchFields(event,sVer){ctlFHAVerB=document.getElementById("hidCTLFindAHomeVerB");var txtCityZipMLSId=document.getElementById(ctlFHAVerB.value+"_txtCityZipMLSId");var lblErrorMsg=document.getElementById(ctlFHAVerB.value+"_lblErrorMsg");var bOK=true;if(sVer=="A"){txtCityZipMLSId.className="fieldTextMedium3"}if(sVer=="B"){txtCityZipMLSId.className="fieldTextMedium"}if(lblErrorMsg!=null){lblErrorMsg.innerHTML=""}if(txtCityZipMLSId.value=="City or ZIP code or MLS ID"||txtCityZipMLSId.value==""){bOK=false;if(sVer=="A"){txtCityZipMLSId.className="ErrorTextboxItalicMed3"}if(sVer=="B"){txtCityZipMLSId.className="ErrorTextboxItalic"}if(sVer=="C"){bOK=true}}if(bOK==false){if(lblErrorMsg!=null){lblErrorMsg.innerHTML="Missing Data."}}else{if(sVer=="B"){var hidMaxAffordPrice=document.getElementById(ctlFHAVerB.value+"_hidMaxAffordPrice");var tblPriceRange=document.getElementById(ctlFHAVerB.value+"_tblPriceRange");var hidMinPrice=document.getElementById(ctlFHAVerB.value+"_hidMinPrice");var hidMaxPrice=document.getElementById(ctlFHAVerB.value+"_hidMaxPrice");hidMinPrice.value="";hidMaxPrice.value="";if(hidMaxAffordPrice.value!="0"&&tblPriceRange.style.display=="none"){hidMinPrice.value=0;hidMaxPrice.value=hidMaxAffordPrice.value}}var hidCL2Reg=parent.document.getElementById("hidCL2Reg");var btnSearchHid=document.getElementById(ctlFHAVerB.value+"_btnSearchHid");if(hidCL2Reg!=null){if(hidCL2Reg.value.toUpperCase()=="Y"){showRegCL2("PPCSRCH","");}else{btnSearchHid.click();}}else{btnSearchHid.click();}}if(event!=null){if(browser.indexOf("Firefox")!=-1||browser.indexOf("Safari")!=-1){event.preventDefault();event.stopPropagation();}else{event.cancelBubble=true;event.returnValue=false}}}function KeyPressFunctionFAH(btnButton,event){if(event.keyCode==13){var hidCTLFindAHomeID=document.getElementById("hidCTLFindAHomeVerB");var myBtn=document.getElementById(hidCTLFindAHomeID.value+"_"+btnButton);if(browser.indexOf("Firefox")!=-1||browser.indexOf("Safari")!=-1){event.preventDefault();event.stopPropagation();if(btnButton=="btnCalc"){validateCalcFields(event);}else{myBtn.click(event);}}else{event.returnValue=false;myBtn.click();}}}function RedirFindAHomeLanding(propTags){var hidFT4FAHAgtURL=document.getElementById("hidFT4FAHAgtURL");var hidFT4FAHModURL=document.getElementById("hidFT4FAHModURL");if(hidFT4FAHAgtURL.value!=""){window.location.href=hidFT4FAHAgtURL.value+"/findahomelanding.aspx?sproptags="+propTags.toLowerCase();}else{window.location.href=hidFT4FAHModURL.value+"findahomelanding.aspx?sproptags="+propTags.toLowerCase();}}function changeFormat(objID){var hidCTLFindAHomeID=document.getElementById("hidCTLFindAHomeVerB");var txtObj=document.getElementById(hidCTLFindAHomeID.value+"_"+objID);txtObj.value=formatCurrency(txtObj.value);}function formatCurrency(num){num=num.toString().replace(/\$|\,/g,'');if(isNaN(num))num="0";sign=(num==(num=Math.abs(num)));num=Math.floor(num*100+0.50000000001);cents=num%100;num=Math.floor(num/100).toString();if(cents<10)cents="0"+cents;for(var i=0;i<Math.floor((num.length-(1+i))/3);i++)num=num.substring(0,num.length-(4*i+3))+','+num.substring(num.length-(4*i+3));return(((sign)?'':'-')+num);}function ACEItemSelectedFAH(){var hidCTLFindAHomeID=document.getElementById("hidCTLFindAHomeVerB");var btnSearch=document.getElementById(hidCTLFindAHomeID.value+"_btnSearch");btnSearch.click();}function ACEItemSelectedFAHvC(){var hidCTLFindAHomeID=document.getElementById("hidCTLFindAHomeVerB");var btnFind=document.getElementById(hidCTLFindAHomeID.value+"_btnFind");btnFind.click();}function GoToBRL(sCity,sZip){var hidCTLFindAHomeID=document.getElementById("hidCTLFindAHomeVerB");var hidBtn=document.getElementById(hidCTLFindAHomeID.value+"_hidBtn");if(hidBtn!=null){hidBtn.click();}var hidFT4FAHModURL=document.getElementById("hidFT4FAHModURL");var sParam="";var hidBRMGWOOn=document.getElementById(hidCTLFindAHomeID.value+"_hidBRMGWOOn");if(sCity!=""){if(hidBRMGWOOn.value.toUpperCase()=="Y"){sParam="sCities="+sCity+"|&sZip=&iMin=0&iMax=0&iBeds=0|1|2|3|4|5|&sPropTypes=HSE|CABN|PUD|CONDO|TWNH|&iLeases=0&iBa=0|1^1.75|2^2.75|3^3.75|4|&iMinSqFt=0&iMaxSqFt=0&sOptFeat=&age=0&garage=0&dPropStatus=0|1|25|50|&lot=&level=&propTags=AP"}else{sParam="sCities="+sCity+"&sZip=&iMin=0&iMax=0&iBeds=0|1|2|3|4|5|&sPropTypes=HSE|CABN|PUD|CONDO|TWNH|&iLeases=0&iBa=0|1^1.75|2^2.75|3^3.75|4|&iMinSqFt=0&iMaxSqFt=0&sOptFeat=&age=0&garage=0&dPropStatus=0|1|25|50|&lot=&level=&propTags=AP"}}else{if(hidBRMGWOOn.value.toUpperCase()=="Y"){sParam="sCities=&sZip="+sZip+"|&iMin=0&iMax=0&iBeds=0|1|2|3|4|5|&sPropTypes=HSE|CABN|PUD|CONDO|TWNH|&iLeases=0&iBa=0|1^1.75|2^2.75|3^3.75|4|&iMinSqFt=0&iMaxSqFt=0&sOptFeat=&age=0&garage=0&dPropStatus=0|1|25|50|&lot=&level=&propTags=AP"}else{sParam="sCities=&sZip="+sZip+"&iMin=0&iMax=0&iBeds=0|1|2|3|4|5|&sPropTypes=HSE|CABN|PUD|CONDO|TWNH|&iLeases=0&iBa=0|1^1.75|2^2.75|3^3.75|4|&iMinSqFt=0&iMaxSqFt=0&sOptFeat=&age=0&garage=0&dPropStatus=0|1|25|50|&lot=&level=&propTags=AP"}}if(hidBRMGWOOn.value.toUpperCase()=="Y"){window.location.href=hidFT4FAHModURL.value+"buyersresultsmap.aspx?"+sParam.toLowerCase();}else{window.location.href=hidFT4FAHModURL.value+"buyersresultslist.aspx?"+sParam.toLowerCase();}}function showRegCL2(sCTA,sAreaCode){var width="758px";var height="478px";if(browser.indexOf("Safari")!=-1){width="789px";if(browser.indexOf("Chrome")!=-1){height="486px"}else{height="477px"}}if(browser.indexOf("Firefox")!=-1){height="465px"}var hidMnuABTestOff=document.getElementById("ctlMenu_hidMnuABTestOff");var hidMnuABTestCode=document.getElementById("ctlMenu_hidMnuABTestCode");if(hidMnuABTestOff.value.toUpperCase()=="N"&&hidMnuABTestCode.value.toUpperCase()=="B"){width="484px";height="468px";if(browser.indexOf("Safari")!=-1){width="484px";height="466px"}if(browser.indexOf("Firefox")!=-1){width="480px";height="435px"}}if(sCTA.toUpperCase()=="PPCSRCH"){AssignCL2HiddenFields();}var hidCL2App=parent.document.getElementById("hidCL2App");var hidCL2CTA=parent.document.getElementById("hidCL2CTA");var hidHostSourceSK=parent.document.getElementById("hidHostSourceSK");var hidCLAreaCode=parent.document.getElementById("hidCLAreaCode");if(hidCL2App!=null){if(hidCLAreaCode!=null&&sCTA.toUpperCase()=="PPCBR"){hidCLAreaCode.value=sAreaCode}hidCL2CTA.value=sCTA;var sURL=hidCL2App.value+"LightBox/Registration.aspx?REGType=FR&lPerson_sk=0&lSource_sk="+hidHostSourceSK.value+"&sCTA="+sCTA;var ifra=getIFrameID();var bvMPE=getMPEBehaviorID();changeIFRAMESource(sURL,ifra,bvMPE,width,height)}}function AssignCL2HiddenFields(){var ctlFHAVerB=document.getElementById("hidCTLFindAHomeVerB");var chkSFR=document.getElementById(ctlFHAVerB.value+"_chkSFR");var chkCondo=document.getElementById(ctlFHAVerB.value+"_chkCondo");var chkMulti=document.getElementById(ctlFHAVerB.value+"_chkMulti");var chkLand=document.getElementById(ctlFHAVerB.value+"_chkLand");var chkComm=document.getElementById(ctlFHAVerB.value+"_chkComm");var chkFarm=document.getElementById(ctlFHAVerB.value+"_chkFarm");var chkTime=document.getElementById(ctlFHAVerB.value+"_chkTime");var chkMfd=document.getElementById(ctlFHAVerB.value+"_chkMfd");var chkOther=document.getElementById(ctlFHAVerB.value+"_chkOther");var ddlMinPrice=document.getElementById(ctlFHAVerB.value+"_ddlMinPrice_Input");var ddlMaxPrice=document.getElementById(ctlFHAVerB.value+"_ddlMaxPrice_Input");var ddlBeds=document.getElementById(ctlFHAVerB.value+"_ddlBeds_Input");var ddlBaths=document.getElementById(ctlFHAVerB.value+"_ddlBaths_Input");var ddlMinSqFt=document.getElementById(ctlFHAVerB.value+"_ddlMinSqft_Input");var ddlMaxSqFt=document.getElementById(ctlFHAVerB.value+"_ddlMaxSqFt_Input");var ddlLotSize=document.getElementById(ctlFHAVerB.value+"_ddlLotSize_Input");var ddlHomeAge=document.getElementById(ctlFHAVerB.value+"_ddlHomeAge_Input");var ddlLevels=document.getElementById(ctlFHAVerB.value+"_ddlLevels_Input");var ddlParking=document.getElementById(ctlFHAVerB.value+"_ddlParking_Input");var chkAir=document.getElementById(ctlFHAVerB.value+"_chkAir");var chkFire=document.getElementById(ctlFHAVerB.value+"_chkFire");var chkPool=document.getElementById(ctlFHAVerB.value+"_chkPool");var chkSpa=document.getElementById(ctlFHAVerB.value+"_chkSpa");var chkView=document.getElementById(ctlFHAVerB.value+"_chkView");var chk1LevelBed=document.getElementById(ctlFHAVerB.value+"_chk1LevelBed");var chkGatedComm=document.getElementById(ctlFHAVerB.value+"_chkGatedComm");var chkShortSales=document.getElementById(ctlFHAVerB.value+"_chkShortSales");var chkFTListingOnly=document.getElementById(ctlFHAVerB.value+"_chkFTListingOnly");var ddlPropTypes=document.getElementById(ctlFHAVerB.value+"_ddlPropTypes");var hidCLMinPrice=parent.document.getElementById("hidCLMinPrice");var hidCLMaxPrice=parent.document.getElementById("hidCLMaxPrice");var hidCLBed=parent.document.getElementById("hidCLBed");var hidCLBath=parent.document.getElementById("hidCLBath");var hidCLMinSqFt=parent.document.getElementById("hidCLMinSqFt");var hidCLMaxSqFt=parent.document.getElementById("hidCLMaxSqFt");var hidCLPropType=parent.document.getElementById("hidCLPropType");var hidCLLotSize=parent.document.getElementById("hidCLLotSize");var hidCLAge=parent.document.getElementById("hidCLAge");var hidCLGarage=parent.document.getElementById("hidCLGarage");var hidCLLevels=parent.document.getElementById("hidCLLevels");var hidCLOptFeat=parent.document.getElementById("hidCLOptFeat");var hidCLShortSales=parent.document.getElementById("hidCLShortSales");var hidCLFTOnly=parent.document.getElementById("hidCLFTOnly");var hidCLPropTag=parent.document.getElementById("hidCLPropTag");if(hidCLMinPrice!=null){hidCLMinPrice.value=ddlMinPrice.value.replace("$","");hidCLMinPrice.value=hidCLMinPrice.value.replace(",","");}if(hidCLMaxPrice!=null){hidCLMaxPrice.value=ddlMaxPrice.value.replace("$","");hidCLMaxPrice.value=hidCLMaxPrice.value.replace(",","");}if(hidCLBed!=null){hidCLBed.value=ddlBeds.value}if(hidCLBath!=null){hidCLBath.value=ddlBaths.value}if(hidCLMinSqFt!=null){hidCLMinSqFt.value=ddlMinSqFt.value.replace(",","");}if(hidCLMaxSqFt!=null){hidCLMaxSqFt.value=ddlMaxSqFt.value.replace(",","");}if(hidCLPropType!=null){if(chkSFR.checked==true){hidCLPropType.value="HSE|CABN|PUD|"}if(chkCondo.checked==true){hidCLPropType.value+="CONDO|TWNH|"}if(chkMulti.checked==true){hidCLPropType.value+="DUPL|TRIP|FOUR|RI|"}if(chkLand.checked==true){hidCLPropType.value+="LAND|"}if(chkComm.checked==true){hidCLPropType.value+="COMM|REST|BUSOP|"}if(chkFarm.checked==true){hidCLPropType.value+="FARM|"}if(chkTime.checked==true){hidCLPropType.value+="RENT|TIME|"}if(chkMfd.checked==true){hidCLPropType.value+="MOBIL|"}if(chkOther.checked==true){hidCLPropType.value+="COOP|UNK|OYO|"}}if(hidCLLotSize!=null){hidCLLotSize.value=ddlLotSize.value}if(hidCLAge!=null){hidCLAge.value=ddlHomeAge.value}if(hidCLGarage!=null){hidCLGarage.value=ddlParking.value}if(hidCLLevels!=null){hidCLLevels.value=ddlLevels.value}if(hidCLShortSales!=null){if(ddlPropTypes.value.toLowerCase()=="foreclosures/reos"){if(chkShortSales.checked==true){hidCLShortSales.value="1|25|50|"}else{hidCLShortSales.value="1|25|"}}else{if(chkShortSales.checked==true){hidCLShortSales.value="0|1|25|50|"}else{hidCLShortSales.value="0|1|25|"}}}if(hidCLPropTag!=null){hidCLPropTag.value=ddlPropTypes.value}if(hidCLFTOnly!=null){hidCLFTOnly.value="N";if(chkFTListingOnly.checked==true){hidCLFTOnly.value="Y"}}if(hidCLOptFeat!=null){if(chkAir.checked==true){hidCLOptFeat.value="AIR|"}if(chkFire.checked==true){hidCLOptFeat.value+="FIRE|"}if(chkPool.checked==true){hidCLOptFeat.value+="POOL|"}if(chkSpa.checked==true){hidCLOptFeat.value+="SPA|"}if(chkView.checked==true){hidCLOptFeat.value+="VIEW|"}if(chk1LevelBed.checked==true){hidCLOptFeat.value+="1LBD|"}if(chkGatedComm.checked==true){hidCLOptFeat.value+="GCOM|"}}}
