// init variables var oLastPullDownTD = ''; var nHidePullDownTimer = ''; var nPullDownAnim = 0; var nPullDownAnimTimer = ''; var sLastCountQuery = '*'; // functions function getAbsoluteLeft(o) { if(o.offsetParent) { return getAbsoluteLeft(o.offsetParent) + o.offsetLeft; } else { return o.offsetLeft; } } function animatePullDown() { nPullDownAnim++; if(nPullDownAnim<10) { nPercentage = 1 - Math.sin(((10 - nPullDownAnim) / 20) * 3.1415) document.getElementById('divPullDownAnim').style.top = -10 + nPullDownAnim; document.getElementById('divPullDownAnim').style.filter = 'Alpha(opacity=' + Math.floor(nPercentage * 100) + ')'; document.getElementById('divPullDownAnim').style.opacity = nPercentage; if(nPullDownAnimTimer!='') { nPullDownAnimTimer = ''; window.clearTimeout(nPullDownAnimTimer); } nPullDownAnimTimer = window.setTimeout('animatePullDown()', 40); } else { document.getElementById('divPullDownAnim').style.top = 0; document.getElementById('divPullDownAnim').style.filter = ''; document.getElementById('divPullDownAnim').style.opacity = 0.999; document.getElementById('imgPullDownShadow').style.display = ''; } } function clearLastPullDown(o) { if(oLastPullDownTD!='') { oLastPullDownTD.bgColor = ''; oLastPullDownTD.style.paddingTop = 2; document.getElementById(oLastPullDownTD.id + '_links').style.display = 'none'; oLastPullDownTD = ''; } } function countTick() { nPercentage = (Number(new Date()) - nStartCountTime) / 500; if(nPercentage<1) { nCurrentCount = Math.round(nCurrentCount + ((nLastCount - nCurrentCount) * nPercentage)); document.getElementById('idMatches').innerHTML = formatNumber(nCurrentCount); if(nLastDisplayedCount!=nCurrentCount) { playEffect(1) nLastDisplayedCount = nCurrentCount; } window.setTimeout('countTick()', 50); } else { nCurrentCount = nLastCount document.getElementById('idMatches').innerHTML = formatNumber(nLastCount); } } function formatNumber(n) { var sNumber = Number(n).toString(); if(sNumber.length>3) { sNumber = sNumber.substr(0, sNumber.length-3) + ',' + sNumber.substr(sNumber.length-3) } return sNumber; } function getCookie(sName) { sCookie = '; ' + document.cookie; if(sCookie.indexOf('; '+sName+'=')>-1) { return unescape(sCookie.split('; '+sName+'=')[1]+';').split(';')[0]; } else { return ''; } } function getFlashVersion() { if(navigator.plugins && navigator.plugins.length) { x = navigator.plugins["Shockwave Flash"]; if (x) { if (x.description) { y = x.description; return Number(y.charAt(y.indexOf('.')-1)); } } if (navigator.plugins["Shockwave Flash 2.0"]) { return 2; } } else { for(a=20;a>1;a--) { try { o = new ActiveXObject('ShockwaveFlash.ShockwaveFlash.' + a); return a; } catch(e) {} } } return 0; } function hidePullDown() { nHidePullDownTimer = window.setTimeout('clearLastPullDown(); document.getElementById(\'divPullDownPointer\').style.display = \'none\'; document.getElementById(\'divPullDownMenu\').style.display = \'none\';', 10); } function isSameFile(f1, f2) { if(f1.length0) { sList += ','; } sList += document.frm.sStyleList[a].value; } } } setQuery('sl', sList); sList = ''; for(a=0;a0) { sList += ','; } sList += document.frm.sAmenityList[a].value; } } setQuery('al', sList); setQuery('ga', document.frm.nGarage.options[document.frm.nGarage.selectedIndex].value); setQuery('pc', document.frm.nPriceChange.options[document.frm.nPriceChange.selectedIndex].value); setQuery('sf', document.frm.nMinSqFt.value); setQuery('ye', document.frm.nMinYear.value); setQuery('di', document.frm.nDistance.value); setQuery('fo', document.frm.nMinPhoto.options[document.frm.nMinPhoto.selectedIndex].value); setQuery('pa', document.frm.nMinPan.options[document.frm.nMinPan.selectedIndex].value); setQuery('oh', document.frm.nOpenHouse.options[document.frm.nOpenHouse.selectedIndex].value); setQuery('pe', document.frm.nPending.options[document.frm.nPending.selectedIndex].value); } } } // check for missing values to carry over aVars = getCookie('sLastSearch').split('&'); for(a=0;a0) { if(sQuery.length>0) { sQuery += ','; } sQuery += document.frm.sCodeList[a].value; } } document.cookie='sLastCode='+escape(sQuery)+';expires='+(new Date((new Date()).getTime()+(89*86400000))).toGMTString(); if(sQuery.length>0) { sQuery = 'mo=code&cl=' + sQuery; } } if(sLastCountQuery!=sQuery) { if(sQuery!='') { document.images.UpdateCount.src = 'TourCount.asp?' + sQuery; document.getElementById('idSearchButton').style.display = ''; } else { newCount(''); document.getElementById('idSearchButton').style.display = 'none'; } sLastCountQuery = sQuery; } } function updateCountDelay() { if(nUpdateDelay!=null) { window.clearTimeout(nUpdateDelay); } nUpdateDelay = window.setTimeout('updateCount()', 2000); } function updateCurleys() { sBufferLeft='
'; sBufferRight='
'; nRepeatHeight = document.getElementById('idCurleyHeight').offsetHeight - 90 if(nLastCurleyHeight!=nRepeatHeight) { nLastCurleyHeight = nRepeatHeight; nRepeatCount = Math.floor((nRepeatHeight / 449) + 0.5) nImageHeight = Math.floor(nRepeatHeight / nRepeatCount) for(a=0;a
'; sBufferRight+='
'; } document.getElementById('spnCurleyLeft').innerHTML = sBufferLeft + '
'; document.getElementById('spnCurleyRight').innerHTML = sBufferRight + '
'; } } function upgradeImages(nLoadedFlag) { if(!nFullyLoaded) { if(nLoadedFlag) { nFullyLoaded = true; } else { return false; } } for(a=0;a<10;a++) { bg = document.getElementById('bg' + a); if(bg) { if(bg.style.backgroundImage.indexOf('/lo/')>-1) { sFileName = bg.style.backgroundImage.substr(4).split(')')[0].replace('/lo/','/hi/') if(!isSameFile(sFileName, document.images.idQualityPreLoad.src)) { document.images.idQualityPreLoad.src = sFileName; return false; } else { bg.style.backgroundImage='url(' + sFileName + ')'; window.setTimeout('upgradeImages(false)', 10); return false; } } } } for(a=0;a-1) { sFileName = document.images[a].src.replace('/lo/','/hi/'); if(!isSameFile(sFileName, document.images.idQualityPreLoad.src)) { document.images.idQualityPreLoad.src = sFileName; return false; } else { document.images[a].src = sFileName; window.setTimeout('upgradeImages(false)', 10); return false; } } } document.cookie='sQualityMode=hi'+nSizeMode+';path=/;'; afterLoaded(); } function zipMatch(z1, z2) { if(z2) { z2.value = z1.value } } // suppress hovering underlines on top nav if(document.getElementById('fntHomePage')){document.getElementById('fntHomePage').style.textDecoration = 'none';} if(document.getElementById('fntNewSearch')){document.getElementById('fntNewSearch').style.textDecoration = 'none';} if(document.getElementById('fntForSellers')){document.getElementById('fntForSellers').style.textDecoration = 'none';} if(document.getElementById('fntMyAccount')){document.getElementById('fntMyAccount').style.textDecoration = 'none';} // write html portion document.write(''); document.write(''); // detect flash if(getFlashVersion()>5) { document.write(''); document.write(' '); document.write(' '); document.write(''); }