// ------------------------------------------------------------------- // Image swapping below // ------------------------------------------------------------------- function MM_swapImgRestore() { //v3.0 var i,x,a=document.MM_sr; for(i=0;a&&i0&&parent.frames.length) { d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);} if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i maxPhoto){ photo = 0; } currentPhoto = photo; break; case "prev": photo = currentPhoto-1; if(photo < 0){ photo = maxPhoto; } currentPhoto = photo; break; } document['modelPhotoGallery'].src = imageArray[currentPhoto]; } var currentElevation = 0; function BrowseElevation(action){ switch(action){ case "next": elevation = currentElevation+1; if(elevation > maxElevation){ elevation = 0; } currentElevation = elevation; break; case "prev": elevation = currentElevation-1; if(elevation < 0){ elevation = maxElevation; } currentElevation = elevation; break; } document['modelPhotoGallery'].src = elevationArray[currentElevation]; } function showButtons(elementID,action){ if(action == "out"){ timer2ID = setTimeout ( "hideAllButtons()", 500 ); } else { switch(elementID){ case "elevationBrowser": hidePhotoGalleryButtons(); break; case "photoGallery": hideElevationButtons(); break; } document.getElementById(elementID).getElementsByTagName("a")[0].style.visibility = 'visible'; document.getElementById(elementID).getElementsByTagName("a")[1].style.visibility = 'visible'; clearTimeout(timer2ID); } } function hideAllButtons() { hidePhotoGalleryButtons(); hideElevationButtons(); } function hidePhotoGalleryButtons() { try { document.getElementById("photoGalleryBrowser").getElementsByTagName("a")[0].style.visibility = 'hidden'; document.getElementById("photoGalleryBrowser").getElementsByTagName("a")[1].style.visibility = 'hidden'; } catch(err) { } } function hideElevationButtons() { try { document.getElementById("elevationBrowser").getElementsByTagName("a")[0].style.visibility = 'hidden'; document.getElementById("elevationBrowser").getElementsByTagName("a")[1].style.visibility = 'hidden'; } catch(err) { } } // ------------------------------------------------------------------- // rollover panels // ------------------------------------------------------------------- var timerID = ""; function rollPanel(elementID,action,page){ if(action == "out"){ switch(elementID){ default: if(page != 'searchbycomm') { timerID = setTimeout ( "hideAll()", 500 ); } break; } if(page == "searchbycomm"){ hideSpecific(elementID); } } else { switch(elementID){ default: if(page != 'searchbycomm') { hideAll(); } break; case "searchByCommunity": document.getElementById('browseCommunity').className = 'browseActive'; hideSpecific('searchByType'); hideSpecific('searchByPrice'); hideSubmenus(); break; case "searchByType": document.getElementById('browseType').className = 'browseActive'; hideSpecific('searchByCommunity'); hideSpecific('searchByPrice'); hideSubmenus(); break; case "searchByPrice": document.getElementById('browsePrice').className = 'browseActive'; hideSpecific('searchByCommunity'); hideSpecific('searchByType'); hideSubmenus(); break; } document.getElementById(elementID).style.display = "block"; clearTimeout(timerID); } } function hideAll(){ hideSubmenus(); document.getElementById('searchByCommunity').style.display = "none"; document.getElementById('searchByType').style.display = "none"; document.getElementById('searchByPrice').style.display = "none"; document.getElementById('browseCommunity').className = ''; document.getElementById('browseType').className = ''; document.getElementById('browsePrice').className = ''; } function hideSubmenus() { for(var i = 0; i < document.getElementsByClassName('submenu').length; i++) { document.getElementsByClassName('submenu')[i].style.display = "none"; } } function hideSpecific(which){ document.getElementById(which).style.display = "none"; switch(which){ case "searchByCommunity": document.getElementById('browseCommunity').className = ''; case "searchByType": document.getElementById('browseType').className = ''; case "searchByPrice": document.getElementById('browsePrice').className = ''; break; } } // ------------------------------------------------------------------- // function to format a number with separators. returns formatted number. // num - the number to be formatted // decpoint - the decimal point character. if skipped, "." is used // sep - the separator character. if skipped, "," is used // ------------------------------------------------------------------- function FormatNumberBy3(num, decpoint, sep) { // check for missing parameters and use defaults if so if (arguments.length == 2) { sep = ","; } if (arguments.length == 1) { sep = ","; decpoint = "."; } // need a string for operations num = num.toString(); // separate the whole number and the fraction if possible a = num.split(decpoint); x = a[0]; // decimal y = a[1]; // fraction z = ""; if (typeof(x) != "undefined") { // reverse the digits. regexp works from left to right. for (i=x.length-1;i>=0;i--) z += x.charAt(i); // add seperators. but undo the trailing one, if there z = z.replace(/(\d{3})/g, "$1" + sep); if (z.slice(-sep.length) == sep) z = z.slice(0, -sep.length); x = ""; // reverse again to get back the number for (i=z.length-1;i>=0;i--) x += z.charAt(i); // add the fraction back in, if it was there if (typeof(y) != "undefined" && y.length > 0) x += decpoint + y; } return x; } function processSelectedPrice(valueArray){ spread = maxPrice-minPrice; slide1Value = (spread*valueArray[0])+minPrice; slide2Value = (spread*valueArray[1])+minPrice; $('pricevalue1').innerHTML="$"+FormatNumberBy3(slide1Value); $('pricevalue2').innerHTML="$"+FormatNumberBy3(slide2Value); document.forms.searchForm.price1.value=slide1Value; document.forms.searchForm.price2.value=slide2Value; } function processSelectedPriceSearchBy(valueArray){ spread = maxPriceSearchBy-minPriceSearchBy; slide1Value = (spread*valueArray[0])+minPriceSearchBy; slide2Value = (spread*valueArray[1])+minPriceSearchBy; $('pricevalue1SearchBy').innerHTML="$"+FormatNumberBy3(slide1Value); $('pricevalue2SearchBy').innerHTML="$"+FormatNumberBy3(slide2Value); document.forms.searchByPriceForm.price1.value=slide1Value; document.forms.searchByPriceForm.price2.value=slide2Value; }