var forms_ENGLISH = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ -"; var forms_HEBREW = " -"; var forms_DIGITS = "0123456789 -"; function IsEmail(sText) { var at="@" var dot="." var lat=sText.indexOf(at) var lstr=sText.length var ldot=sText.indexOf(dot) if (sText=="" || sText==null){ return false } if (sText.indexOf(at)==-1 || sText.indexOf(at)==0 || sText.indexOf(at)==lstr){ return false } if (sText.indexOf(dot)==-1 || sText.indexOf(dot)==0 || sText.indexOf(dot)==lstr){ return false } if (sText.indexOf(at,(lat+1))!=-1){ return false } if (sText.substring(lat-1,lat)==dot || sText.substring(lat+1,lat+2)==dot){ return false } if (sText.indexOf(dot,(lat+2))==-1){ return false } if (sText.indexOf(" ")!=-1){ return false } return true } function ChkStrBy(sText, sValidChars){ var ret = true; if (sText.length==0) return (false); for (i = 0 ; i < (sText.length) && (ret==true) ; i++){ if (sValidChars.indexOf(sText.charAt(i)) == -1){ ret = false; } } return (ret); } function IsNumeric(sText){ return (ChkStrBy(sText,forms_DIGITS)); } function addOpt(){ var j=0; for(i=1900;i<=2000;i++){ j++; document.frmJoin.year[j]=new Option(i,i,false); } for(i=1;i<=12;i++){ document.frmJoin.month[i]=new Option(i,i,false); } for(i=1;i<=31;i++){ document.frmJoin.day[i]=new Option(i,i,false); } } function date_something(sMonth, sYear) { return (new Date(sMonth + "/01/" + sYear) > new Date()); } function doUPD() { if(document.frmJoin.fname.value!=""){ if(document.frmJoin.lname.value!=""){ if(IsEmail(document.frmJoin.email.value)){ //if(document.frmJoin.pass.value.length>=4){ //if(IsNumeric(document.frmJoin.pid.value)==true && document.frmJoin.pid.value.length==9){ //if(document.frmJoin.street.value!=""){ //if(IsNumeric(document.frmJoin.phone.value)==true && document.frmJoin.phone.value.length==7){ //if(document.frmJoin.kidomet.value!=""){ document.frmJoin.submit() //}else{alert("יש לבחור קידומת");document.frmJoin.kidomet.focus();} //}else{alert("יש למלא מספר טלפון");document.frmJoin.phone.focus();} //}else{alert("יש למלא את שם הרחוב");document.frmJoin.street.focus();} //}else{alert("תעודת זהות -בלבד 9 ספרות");document.frmJoin.pid.focus();} //}else {alert("יש להזין סיסמא בעלת 4 תווים");document.frmJoin.pass.focus();} }else {alert("כתובת אימייל אינה נכונה");document.frmJoin.email.focus();} }else{alert("יש להזין שם משפחה");document.frmJoin.lname.focus();} }else{alert("יש להזין שם פרטי");document.frmJoin.fname.focus();} } function doJoin() { if(document.frmJoin.fname.value!=""){ if(document.frmJoin.lname.value!=""){ if(IsEmail(document.frmJoin.email.value)){ if(document.frmJoin.pass.value.length>=4){ //if(IsNumeric(document.frmJoin.pid.value)==true && document.frmJoin.pid.value.length==9){ //if(document.frmJoin.street.value!=""){ //if(IsNumeric(document.frmJoin.phone.value)==true && document.frmJoin.phone.value.length==7){ //if(document.frmJoin.kidomet.value!=""){ document.frmJoin.submit() //}else{alert("יש לבחור קידומת");document.frmJoin.kidomet.focus();} //}else{alert("יש למלא מספר טלפון");document.frmJoin.phone.focus();} //}else{alert("יש למלא את שם הרחוב");document.frmJoin.street.focus();} //}else{alert("תעודת זהות -בלבד 9 ספרות");document.frmJoin.pid.focus();} }else {alert("יש להזין סיסמא בעלת 4 ספרות או מספרים");document.frmJoin.pass.focus();} }else {alert("כתובת אימייל אינה נכונה");document.frmJoin.email.focus();} }else{alert("יש להזין שם משפחה");document.frmJoin.lname.focus();} }else{alert("יש להזין שם פרטי");document.frmJoin.fname.focus();} } function doDelivery() { if(document.frmDelivery.fname.value!=""){ if(document.frmDelivery.street.value!=""){ //if(IsNumeric(document.frmDelivery.phone.value)==true && document.frmDelivery.phone.value.length==7){ //if(document.frmDelivery.kidomet.value!=""){ if(document.frmDelivery.country.value!=""){ if(document.frmDelivery.agree.checked==true){ document.frmDelivery.submit(); }else {alert('יש לקרוא ולהסכים לתנאי השימוש באתר')} }else{alert("יש למלא עיר");document.frmDelivery.country.focus();} //}else{alert("Fill in a zip code");document.frmDelivery.kidomet.focus();} //}else{alert("Fill in a phone number");document.frmDelivery.phone.focus();} }else{alert("מלא את הכתובת");document.frmDelivery.street.focus();} }else{alert("מלא את שמך המלא");document.frmDelivery.lname.focus();} } function doPayAgree(){ if(document.forms.pay.agree.checked==true){ document.forms.pay.submit(); } else alert('יש לאשר את הפרטים') } function doPay(){ var field=document.forms.pay; thetime=new Date() var themonth=field.month.options[field.month.selectedIndex].text; var theyear=field.year.options[field.year.selectedIndex].text; if(field.fullname.value!=''){ if(field.pid.value.length==9 && IsNumeric(field.pid.value)==true){ if(field.creditcard.value.length<=25 && IsNumeric(field.creditcard.value)==true){ if(field.svcnumber.value.length<=4 && field.svcnumber.value.length>2 && IsNumeric(field.svcnumber.value)==true){ if(new Date(themonth + "/31/" + theyear) >= thetime){ if(field.cardtypeid.value!=''){ document.forms.pay.submit() }else{ alert("בחר סוג כרטיס אשראי"); field.cardtypeid.focus(); return false; } }else{ alert("בדוק את תוקף כרטיס האשראי"); field.month.focus(); return false; } }else{ alert("יש להזין שדה CVV"); field.svcnumber.focus(); field.svcnumber.select(); return false; } }else{ alert("יש להזין מספר כרטיס אשראי"); field.creditcard.focus(); field.creditcard.select(); return false; } }else{ alert("יש להזין תעודת זהות"); field.pid.focus(); field.pid.select(); return false; } }else{ alert("יש להזין שם מלא"); field.fullname.focus(); return false; } } function passChng(){ if(document.passW.pass0.value!=''){ if((document.passW.pass1.value.length>=4) && (document.passW.pass2.value.length>=4)){ if(document.passW.pass1.value == document.passW.pass2.value) { passW.submit() }else{alert('שדה אימות סיסמא אינו נכון');return false;} }else{alert('מינימום 4 אותיות או מספרים ');return false;} }else{alert('הכנס את הסיסמא הנוכחית');return false;} } function doRemind(){ if(document.frmJoin.email.value==''){ alert("יש להזין כתובת מייל") }else{ location.href="?act=remind&emailremind="+document.frmJoin.email.value; } }