﻿browser=navigator.userAgent;msie=browser.indexOf("MSIE ");msieVer=parseInt(browser.substring(msie+5,browser.indexOf(".",msie)));newWindow="";function gotoluxuryportfolio(){var height=900;var width=1050;var left=150;var top=10;var windowFeatures='width='+width+',height='+height+',status, resizable, scrollbars, left='+left+',top='+top+',screenX='+left+',screenY='+top;if(newWindow.location&&!newWindow.closed){newWindow.focus();}else{newWindow=open("http://firstteam.luxuryportfolio.com/cobranded.cfm","FT3LuxuryPortfolio",windowFeatures);newWindow.focus();}}function getGeneralOmniture(){var hidClientSk=document.getElementById("hidClientSk");var hidOmniKeyWord=document.getElementById("hidOmniKeyWord");var hidOmniCampaign=document.getElementById("hidOmniCampaign");var hidOmniChanel=document.getElementById("hidOmniChanel");var hidOmniFirstVisit=document.getElementById("hidOmniFirstVisit");cleanProps();s.pageName="Corp Home Page";if(hidClientSk.value==""){s.prop1="0";s.eVar1="0";s.eVar22="Non-Registered"}else{s.prop1=hidClientSk.value;s.eVar1=hidClientSk.value;s.eVar22="Registered"}if(hidOmniKeyWord.value!=""){s.prop19=hidOmniKeyWord.value;s.eVar19=hidOmniKeyWord.value}if(hidOmniCampaign.value!=""){s.campaign=hidOmniCampaign.value}if(hidOmniFirstVisit.value=="Y"){s.events="event1"}}function setOmnitureREGULAR_REG(){var s=s_gi(document.getElementById("hidOmniRSID").value);getGeneralOmniture();var hidClientSk=document.getElementById("hidClientSk").value;s.events="event12,event11,event3:clientid"+hidClientSk+",event2";s.eVar8="Log In";s.tl(this,'o','Log In - Registration Submitted and Logged IN')}function setOmnitureCONTACT(){var s=s_gi(document.getElementById("hidOmniRSID").value);getGeneralOmniture();s.prop18='Submit Contact Us';s.tl(this,'o','Submit Contact Us')}function InitOmnitureCONTACT(){var s=s_gi(document.getElementById("hidOmniRSID").value);cleanProps();s.prop17='Initiate Contact Us';s.tl(this,'o','Initiate Contact Us');}function cleanProps(){s.prop2=null;s.prop3=null;s.prop4=null;s.prop5=null;s.prop6=null;s.prop7=null;s.prop8=null;s.prop9=null;s.prop10=null;s.prop11=null;s.prop12=null;s.prop13=null;s.prop14=null;s.prop15=null;s.prop16=null;s.prop17=null;s.prop18=null;s.prop20=null;s.prop22=null;s.prop23=null;s.prop24=null;s.prop25=null;s.prop26=null;s.prop27=null;s.prop28=null;s.prop29=null;s.prop30=null;s.prop31=null;s.prop32=null;s.prop33=null;s.prop34=null;s.prop35=null;s.prop36=null;s.prop37=null;s.prop38=null;s.prop39=null;s.prop40=null;s.prop41=null;s.prop42=null;s.prop43=null;s.prop44=null;s.prop45=null;s.prop46=null;s.prop47=null;s.prop48=null;s.prop49=null;s.prop50=null;s.eVar2=null;s.eVar3=null;s.eVar4=null;s.eVar5=null;s.eVar6=null;s.eVar7=null;s.eVar8=null;s.eVar9=null;s.eVar10=null;s.eVar11=null;s.eVar12=null;s.eVar13=null;s.eVar14=null;s.eVar15=null;s.eVar16=null;s.eVar17=null;s.eVar18=null;s.eVar20=null;s.eVar23=null;s.eVar24=null;s.eVar25=null;s.eVar26=null;s.eVar27=null;s.eVar28=null;s.eVar29=null;s.eVar30=null;s.eVar31=null;s.eVar32=null;s.eVar33=null;s.eVar34=null;s.eVar35=null;s.eVar36=null;s.eVar37=null;s.eVar38=null;s.eVar39=null;s.eVar40=null;s.eVar41=null;s.eVar42=null;s.eVar43=null;s.eVar44=null;s.eVar45=null;s.eVar46=null;s.eVar47=null;s.eVar48=null;s.eVar49=null;s.eVar50=null;s.events=null}function hideQSDDLs(sHide){var DDLs="";if(browser.indexOf("Firefox")!=-1){DDLs=document.getElementsByTagName("ddl");}else{DDLs=document.body.all.tags("select");}var ddlID="";for(var i=0;i<=DDLs.length-1;i++){ddlID=DDLs(i).id;if((ddlID.indexOf('ddlMinPrice')!=-1)||(ddlID.indexOf('ddlMaxPrice')!=-1)||(ddlID.indexOf('ddlCounties')!=-1)||(ddlID.indexOf('lstSelected')!=-1)||(ddlID.indexOf('ddlBedrooms')!=-1)||(ddlID.indexOf('ddlBaths')!=-1)){var mySampleDDL=document.getElementById(ddlID);mySampleDDL.style.visibility=sHide}}}function closeVideoDiv(sDiv){var divGhost=document.getElementById("divMasterGhost");var vid=document.getElementById("spnVideo");var div=document.getElementById(sDiv);vid.innerHTML="";divGhost.style.visibility="hidden";div.style.visibility="hidden";hideQSDDLs("visible");}function showVideoDiv(){hideQSDDLs("hidden");var divGhost=document.getElementById("divMasterGhost");var divSelected=document.getElementById("divVideo");divGhost.style.visibility="visible";MaximizeGhosting(divGhost,"#000000","alpha(opacity:50)","absolute","501",document.body.clientHeight);var strVideo="<embed pluginspage='http://download.microsoft.com/download/winmediaplayer/nsplugin/6.4/WIN98/EN-US/wmpplugin.exe' align='baseline' src='mms://vc.firstteam.com/1' width='320' height='240' type='application/x-mplayer2' bgcolor='#000000' autostart='1' standby='Click to Start' showcontrols='1'>";var spnVideo=document.getElementById("spnVideo");spnVideo.innerHTML=strVideo;divSelected.style.position="absolute";divSelected.style.top=(parseInt(screen.height/2)-parseInt(divSelected.clientHeight/2))-100;divSelected.style.left=parseInt(screen.width/2)-parseInt(divSelected.clientWidth/2);divSelected.style.visibility="visible"}window.onload=function(){changeMenuBackground();loadCountyDDL();contactFromEmail();};function changeMenuBackground(){var hidPageTheme=document.getElementById("hidPageTheme");var divCorpHomeDiv1=document.getElementById("divCorpHomeDiv1");if(hidPageTheme.value=="estates"){divCorpHomeDiv1.style.backgroundImage="url(App_Themes/Estates/Images/light_grey_bckgrnd.gif)"}else{divCorpHomeDiv1.style.backgroundImage="url(App_Themes/Corporate/Images/light_grey_bckgrnd.gif)"}}function loadCountyDDL(){var ddlCounties=document.getElementById("ddlCounties");CountyList();var counties=this.county;for(var i=0;i<counties.length;i++){var county=counties[i].split("^");var optn=document.createElement("OPTION");optn.text=county[1];optn.value=county[0];ddlCounties.options.add(optn);}var lstSelected=document.getElementById("lstSelected");if(lstSelected.length>0){var iSelCounty=getCookie("QSCountySK");var iSelIndex=0;switch(parseInt(iSelCounty)){case 0:iSelIndex=0;break;case 9:iSelIndex=1;break;default:iSelIndex=parseInt(iSelCounty)+1;break}ddlCounties.selectedIndex=iSelIndex}doNotShowCountyErrMsg();}function getCitiesByCounty(selIndex){createCookie("QSCountySK",selIndex,20);CityList();var cities=this.city;var lstSelected=document.getElementById("lstSelected");lstSelected.length=0;for(var i=0;i<cities.length-1;i++){var city=cities[i].split("^");if(selIndex==city[0]){var optn=document.createElement("OPTION");optn.text=city[2];optn.value=city[1];lstSelected.options.add(optn);}}doNotShowCountyErrMsg();}function doNotShowCountyErrMsg(){var trCountyErrMsg=document.getElementById("trCountyErrMsg");if(browser.indexOf("Firefox")!=-1||browser.indexOf("Safari")!=-1){if(trCountyErrMsg.style.display=="table-row"){trCountyErrMsg.style.display="none"}}else{if(trCountyErrMsg.style.display=="block"){trCountyErrMsg.style.display="none"}}}function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}else var expires="";document.cookie=name+"="+value+expires+"; path=/"}function deleteCookie(name){createCookie(name,"",-1);}function getCookie(c_name){if(document.cookie.length>0){c_start=document.cookie.indexOf(c_name+"=");if(c_start!=-1){c_start+=c_name.length+1;c_end=document.cookie.indexOf(";",c_start);if(c_end==-1)c_end=document.cookie.length;return unescape(document.cookie.substring(c_start,c_end));}}return""}function contactFromEmail(){var hidEmail=document.getElementById('hidContactEmail');var sEmail=hidEmail.value;if(sEmail!=""){showContact();hidEmail.value=""}}function changeButtonImage(sType,sTheme){var btnSearch=document.getElementById("btnSearch");if(sType=='highlight'){if(sTheme=="estates"){btnSearch.src="App_Themes/Estates/Images/QS_Search_Off.gif"}else{btnSearch.src="App_Themes/Corporate/Images/QS_Search_On.gif"}document.body.style.cursor='hand'}else{if(sTheme=="estates"){btnSearch.src="App_Themes/Estates/Images/QS_Search_On.gif"}else{btnSearch.src="App_Themes/Corporate/Images/QS_Search_Off.gif"}document.body.style.cursor='default'}}function homeSearch(event){var map=document.forms[0].elements["ddlCounties"];var cities=document.forms[0].elements["lstSelected"];var min=document.forms[0].elements["ddlMinPrice"];var max=document.forms[0].elements["ddlMaxPrice"];var bed=document.forms[0].elements["ddlBedrooms"];var bath=document.forms[0].elements["ddlBaths"];var selectedMap="";var selectedCountyName="";var selectedCities="";var selectedMin="";var selectedMax="";var selectedBed=0;var selectedBath=0;if(cities.selectedIndex=="-1"){alert("Please select a County\nand a City to continue.")}else{selectedMap=map.options[map.selectedIndex].value;selectedCountyName=map.options[map.selectedIndex].text;selectedCities=cities.options[cities.selectedIndex].value+"|";selectedMin=min.options[min.selectedIndex].value*1000;selectedMax=max.options[max.selectedIndex].value*1000;selectedBed=bed.options[bed.selectedIndex].value;selectedBath=bath.options[bath.selectedIndex].value;if(selectedMin>selectedMax&&selectedMax!=0){alert("Please select a minimum price that is\nlower than the maximum price.")}else{var myURL="PropertiesFound.aspx?sCities="+selectedCities+"&sZip=&iMin="+selectedMin+"&iMax="+selectedMax+"&iBeds="+selectedBed+"&sPropTypes=HSE|PUD|CABN|DUPL|TRIP|FOUR|CONDO|TWNH|&iLeases=0&iBa="+selectedBath+"&iMinSqFt=0&iMaxSqFt=0&sOptFeat=&age=0&garage=0&lMap_sk="+selectedMap+"&Page=HOME&dPropStatus=&szCounty_nm="+selectedCountyName;location.href=myURL}}if(browser.indexOf("Firefox")!=-1||browser.indexOf("Safari")!=-1){event.preventDefault();event.stopPropagation();}else if(browser.indexOf("MSIE ")!=-1){event.cancel=true;event.returnValue=false}}function isBadEmail(email){var result=false;var sEmail=email;var iAt=sEmail.indexOf("@");var iPeriod=sEmail.indexOf(".");var iLen=sEmail.length-1;var iAtPeriod=sEmail.substring(iAt,iAt+2);if((iAt<1)||(iAt==iLen)||(iPeriod==iLen)||(sEmail.indexOf(" ")>0)||(sEmail.indexOf(",")>0)){result=true}if(sEmail.lastIndexOf("@")!=iAt){result=true}if((sEmail.indexOf(".com")<5)&&(sEmail.indexOf(".org")<5)&&(sEmail.indexOf(".gov")<5)&&(sEmail.indexOf(".net")<5)&&(sEmail.indexOf(".mil")<5)&&(sEmail.indexOf(".edu")<5)&&(sEmail.indexOf(".us")<5)&&(sEmail.indexOf(".ca")<5)&&(sEmail.indexOf(".tv")<5)){result=true}if(iAtPeriod=="@."){result=true}return result}function isBadPassword(sPass){var result=false;var sChar="";var sUpper=sPass.toUpperCase();var sValid="ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890-_@.";for(var i=0;i<sPass.length;i++){sChar=sUpper.charAt(i);if(sValid.indexOf(sChar)<0){result=true}}return result}function validateEmail(event){var tEmail=document.getElementById("txtEmailAddr");var tPass=document.getElementById("txtEmailPwd");var trBadLogin=document.getElementById("trBadLogin");var lBad=document.getElementById("lblBadLogin");var sMessage="";if(tEmail.value==""){sMessage+="bad email address"}else{if(isBadEmail(tEmail.value)){sMessage+="bad email address"}}if(tPass.value==""){sMessage+="bad password";tPass.focus();}if(sMessage!=''){trBadLogin.style.display="block";lBad.innerHTML="Invalid ID or Password.<br/>Please Try Again.";if(browser.indexOf("Firefox")!=-1||browser.indexOf("Safari")!=-1){event.preventDefault();event.stopPropagation();}else{event.cancel=true;event.returnValue=false}}}function showPasswordDiv(){var btnForgotPwd=document.getElementById("btnForgotPwd");btnForgotPwd.click();}function showRegDiv(){var btnRegisterToday=document.getElementById("btnRegisterToday");btnRegisterToday.click();}function ClearEntry(ctl){var ctlName=document.getElementById(ctl);ctlName.value=""}function MaximizeGhosting(ctrlName,bgcolor,opacity,posType,zindex,height1){var divGhost=document.getElementById(ctrlName.id);var myHeight=0;var myWidth=0;if(browser.indexOf("Firefox")!=-1){myHeight=parent.screen.availHeight;myWidth=parent.screen.availWidth}else{myHeight=screen.availHeight;myWidth=screen.availWidth}if(divGhost!=null){divGhost.style.top="0px";divGhost.style.left="0px";divGhost.style.width=myWidth+"px";;divGhost.style.height=myHeight+"px";if(browser.indexOf("Firefox")!=-1){divGhost.style.setProperty("-moz-opacity",.5,'');}else if(browser.indexOf("Safari")!=-1){divGhost.style.opacity=0.5}else{divGhost.style.filter=opacity}divGhost.style.backgroundColor=bgcolor;divGhost.style.position=posType;divGhost.style.zIndex=zindex}}function showCountyErrorMsg(){var ddlCounties=document.forms[0].elements["ddlCounties"];var trCountyErrMsg=document.getElementById("trCountyErrMsg");var divCorpHomeDiv2=document.getElementById("divCorpHomeDiv2");var divCorpHomeGap=document.getElementById("divCorpHomeGap");var tblHomeSearch=document.getElementById("tblHomeSearch");if(ddlCounties.options[ddlCounties.selectedIndex].value==0){if(browser.indexOf("Firefox")!=-1||browser.indexOf("Safari")!=-1){trCountyErrMsg.style.display="table-row";var spnCountyErr=document.getElementById("spnCountyErr");spnCountyErr.innerHTML="First Select a County";divCorpHomeDiv2.style.height="16px";divCorpHomeGap.style.top="10px"}else{if(msie>0&&msieVer!=6){divCorpHomeDiv2.style.height="10px";divCorpHomeGap.style.top="12px"}else{divCorpHomeDiv2.style.height="2px";divCorpHomeGap.style.top="8px"}trCountyErrMsg.style.display="block"}}}function showAreaMap(iVisible){var d=document.getElementById("divCountyMap");if(iVisible=="Y"){d.style.display="block"}else{d.style.display="none"}}function PopulateCities(result,context){getCities(result);var trCountyErrMsg=document.getElementById("trCountyErrMsg");var divCorpHomeDiv2=document.getElementById("divCorpHomeDiv2");var divCorpHomeGap=document.getElementById("divCorpHomeGap");if(trCountyErrMsg.style.display=="block"||trCountyErrMsg.style.display=="table-row"){if(browser.indexOf("Firefox")!=-1||browser.indexOf("Safari")!=-1){divCorpHomeDiv2.style.height="16px";divCorpHomeGap.style.top="16px";var spnCountyErr=document.getElementById("spnCountyErr");spnCountyErr.innerHTML=""}else{if(msie>0&&msieVer!=6){divCorpHomeDiv2.style.height="14px";divCorpHomeGap.style.top="18px"}else{divCorpHomeDiv2.style.height="10px";divCorpHomeGap.style.top="14px"}trCountyErrMsg.style.display="none"}}}function getCities(result){var rows=result.split('|');var cities=document.forms[0].elements["lstSelected"];cities.length=0;for(var i=0;i<rows.length;i++){var values=rows[i].split('^');var option=document.createElement("OPTION");option.value=values[0];option.innerHTML=values[1];cities.appendChild(option);}}function showHotBuys(){window.location.href="HotBuysLanding1.aspx"}