function addToFavorites(b,a){if(window.external){window.external.AddFavorite(b,a)}else{alert("Sorry! Your browser doesn't support this function.")}}var menuTimeout=400;var menuSections=new Array();var menuCountHide=new Array();var menuSectionCnt=0;var menuBoxCnt=0;function menuShow(c,b){for(var a=0;a<menuSections.length;a++){if(menuSections[a]!=c){menuHide(menuSections[a],menuCountNodes(menuSections[a]))}}for(var a=1;a<=b;a++){document.getElementById(c+"-"+a).style.visibility="visible"}}function menuHide(c,b){for(var a=1;a<=b;a++){document.getElementById(c+"-"+a).style.visibility="hidden"}document.getElementById(c).style.zIndex=-1}function menuTryHide(c,b,a){if(a!=menuCountHide[c]){return}menuHide(c,b)}function menuCountNodes(b){ret=0;nodes=document.getElementById(b).childNodes.length;for(var a=0;a<nodes;a++){if(document.getElementById(b).childNodes[a].nodeType==1){ret++}}return ret}function menuInitSection(d){var c=menuCountNodes(d);for(var a=0;a<=c;a++){var b=(a==0?(d+"-top"):(d+"-"+a));if(a==0){document.getElementById(b).onmouseover=function(){menuShow(d,c);menuCountHide[d]++;for(var e=0;e<menuSections.length;e++){document.getElementById(d).style.zIndex=1;if(menuSections[e]!=d){document.getElementById(menuSections[e]).style.zIndex=-1}}}}else{document.getElementById(b).onmouseover=function(){menuCountHide[d]++}}document.getElementById(b).onmouseout=function(){setTimeout("menuTryHide('"+d+"', "+c+", "+menuCountHide[d]+")",menuTimeout)}}}function menuMakeId(a){for(var b=0;b<a.length;b++){switch(a[b].className){case"top":menuSectionCnt++;menuBoxCnt=0;a[b].id="menu-"+menuSectionCnt+"-top";break;case"section":a[b].id="menu-"+menuSectionCnt;menuSections[menuSections.length]=a[b].id;break;case"box":menuBoxCnt++;a[b].id="menu-"+menuSectionCnt+"-"+menuBoxCnt;break}if(a[b].childNodes){menuMakeId(a[b].childNodes)}}}function menuInit(){menuMakeId(document.getElementById("menu").childNodes);for(var a=0;a<menuSections.length;a++){menuCountHide[menuSections[a]]=0}for(var a=0;a<menuSections.length;a++){menuInitSection(menuSections[a])}}function doRange(b,a){if(document.getElementById("all")){document.getElementById("all").className="range"}if(document.getElementById("one")){document.getElementById("one").className="range"}if(document.getElementById("two")){document.getElementById("two").className="range"}if(document.getElementById("three")){document.getElementById("three").className="range"}if(document.getElementById("four")){document.getElementById("four").className="range"}document.getElementById(b).className="range-sel";document.getElementById("frame").src=a}function selCity(){if(document.getElementById("rad1").checked){document.getElementById("mon").style.display="block";document.getElementById("oce").style.display="none"}else{document.getElementById("mon").style.display="none";document.getElementById("oce").style.display="block"}}function doSearch(){if(document.getElementById("rad1").checked){if(document.getElementById("moncity").value==""){alert("Please Select a City and search again.");return false}else{document.homeSearch.action="http://www.njhomessite.com/"+document.getElementById("stype").value+"/"+document.getElementById("moncity").value+".htm";return true}}else{if(document.getElementById("ocecity").value==""){alert("Please Select a City and search again.");return false}else{document.homeSearch.action="http://www.njhomessite.com/"+document.getElementById("stype").value+"/"+document.getElementById("ocecity").value+".htm";return true}}};
