 function opebniStore(){
  var winW = 580
  var winH = 480
  var winl = (screen.width - winW) / 2;
  var wint = (screen.height - winH) / 2;
  WPOPUP = window.open("https://ssl.zahav.net.il/expoexpo/ebuy/","shop","toolbar=0,top="+wint+",left="+winl+",location=0,resizable=0,directories=0,status=1,scrollbars=0,menubar=0,resizable=0,width="+winW+",height="+winH);
  WPOPUP.focus();
}




var preloadFlag = false;
function preloadImages() {
	if (document.images) {
        B1_Over = newImage("Images/B1_on.gif");
        B2_Over = newImage("Images/B2_on.gif");
        B3_Over = newImage("Images/B3_on.gif");
        B4_Over = newImage("Images/B4_on.gif");
		preloadFlag = true;
	}
}

function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
}

function change(obj,flag) {
   tmpFileName = obj.name+"_"+flag+".gif"
   obj.src = "Images/"+ tmpFileName;
}

function checkIt(theForm){
  if (theForm.PrivateName.value == "") {
		alert("נא ציין שם פרטי")
		theForm.PrivateName.focus()
		return false
  }
  if (theForm.Family.value == "") {
		alert("נא ציין שם משפחה")
		theForm.Family.focus()
		return false
  }
  if (!validEmail(theForm.Email.value)){
		alert("נא ציין דואר אלקטרוני תקין")
		theForm.Email.focus()
		return false
  }
   
  return true
}





function validPhone(PhoneNum)
{
 var num="0123456789"
 if (PhoneNum.length < 7)
  return false;
 if (parseFloat(PhoneNum)<100000)
  return false;
  
 for (var i=0; i < PhoneNum.length ; i++)
 {
  temp=PhoneNum.substring(i,i+1)
   if(num.indexOf(temp)==-1)
   return false
 }	
 
   return true
}


function validEmail(email) {
invalidChars = " /:,;"
if (email == "") 
{						// cannot be empty
	return false
}

for (i=0; i<invalidChars.length; i++) {	// does it contain any invalid characters?
				badChar = invalidChars.charAt(i)
				if (email.indexOf(badChar,0) > -1) {
					return false
				}
			}
			atPos = email.indexOf("@",1)			// there must be one "@" symbol
			if (atPos == -1) {
				return false
			}
			if (email.indexOf("@",atPos+1) != -1) {	// and only one "@" symbol
				return false
			}
			periodPos = email.indexOf(".",atPos)
			if (periodPos == -1) {					// and at least one "." after the "@"
				return false
			}
			if (periodPos+3 > email.length)	{		// must be at least 2 characters after the "."
				return false
			}
			return true
		}

