var ie=/MSIE/.test(navigator.userAgent);var moz=!ie&&navigator.product=="Gecko";var APN="/zipcode.nsf/guidezip?OpenAgent&locid=";var GZF="/zipcode.nsf/getzip?OpenForm&locid=";var MER="הערך שהקלדת אינו מופיע ברשימה - הקלד ערך חדש או בחר מהרשימה";function gEN(en){return document.getElementsByName(en)[0];}function sFE(en){var lct;if(moz){gEN(en).firstChild.focus();}else{lct=gEN(en+"_text");lct.select();lct.focus();}}function WriteErrorMsg(text){if(navigator.appName=="Netscape"){document.YVNNN.document.DOC.document.write(text);document.YVNNN.document.DOC.document.close();}else{document.all.ERRie.innerHTML='';document.all.ERRie.innerHTML+=text;}}function locations(){var mv=gEN("menu").value;var lp=moz?gEN("locations").firstChild:gEN("locations_popup");var li=lp.selectedIndex;var lid;var m;if(li!=-1){lid=lp.options[li].value;if(lid.substr(0,1)=="2"){m=" המיקוד עבור כל הישוב ";m+=" "+moz?lp.options[li].text:gEN("locations_text").value+" ";m+=" הוא ";m+=" "+lid.substr(1,5);WriteErrorMsg(m);}else{location=GZF+lid.substr(6,4)+"&streetid=0"+(mv=="1"?"":"&m=0");}}else{alert(MER);}}function streets(){if(moz){gkSt();}else{ieSt();}}function ieSt(){var lid=gEN("locid").value;var sid=gEN("streetid");var stp=gEN("streets_popup");if(stp.selectedIndex!=-1){sid.value=stp.options[stp.selectedIndex].value;gEN("streetname").value=gEN("streets_text").value;var sS=(screen.height<700||screen.width<1000)?1:0;var wP='TOP=200,LEFT=200,WIDTH='+(sS?'400':'600')+',HEIGHT='+(sS?'300':'450')+',scrollbars';if(gEN("menu").value=="1"){window.open(APN+lid+"&streetid="+sid.value,'',wP);}else{location=APN+lid+"&streetid="+sid.value;}}else{alert(MER);}}function gkSt(){var lid=gEN("locid").value;var sid=gEN("streetid");var stp=gEN("streets").firstChild;if(stp.selectedIndex!=-1){sid.value=stp.options[stp.selectedIndex].value;gEN("streetname").value=stp.options[stp.selectedIndex].text;var sS=(screen.height<700||screen.width<1000)?1:0;var wP='TOP=200,LEFT=200,WIDTH='+(sS?'400':'600')+',HEIGHT='+(sS?'300':'450')+',scrollbars';if(gEN("menu").value=="1"){window.open(APN+lid+"&streetid="+sid.value,'',wP);}else{location=APN+lid+"&streetid="+sid.value;}}else{alert(MER);}}function checkFields(en){switch(en){case"locations":locations();break;case"streets":streets();break;default:break;}}function oGZ(){var GZB="/zipcode.nsf/getzipbigcities?OpenForm&locid=";var mv=gEN("menu").value;var ld=gEN("locid").value;if(ld=="0"){sFE("locations");}else{if(ld=="3000"||ld=="5000"){location=GZB+ld+"&firstchar="+escape('א')+(mv=="0"?"&m="+mv:"");}else{sFE("streets");}}}function oGZB(){var ld=gEN("locid").value;if(ld!="3000"&&ld!="5000"){alert("לא ניתן לקבל את המידע כפי שביקשת ");history.go(-1);}else{sFE("streets");}}

