function IsNumeric(sText)

{
   var ValidChars = "0123456789";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }
function $(str)
{
	return document.getElementById(str);
}
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 validFormCon(strIdForm, lang_name)
{
	if (lang_name==''){
		lang_name = 'he';
	}
	
	var oFrm = $(strIdForm);
	if(oFrm.txtName.value==""){
		if (lang_name=='he'){
			alert("נא הכנס שם");
		}else{
			alert("Please insert a name");
		}
		oFrm.txtName.focus();
		return false;
	}
//	if((oFrm.txtPhone.value=="")||(!IsNumeric(oFrm.txtPhone.value))){
//		if (lang_name=='he'){
//			alert("נא הכנס מספר טלפון חוקי");
//		}else{
//			alert("Please insert a valid phone number");
//		}
//		oFrm.txtPhone.focus();
//		return false;
//	}
	if(!IsEmail(oFrm.txtEmail.value)||(oFrm.txtEmail.value=='')){
		if (lang_name=='he'){
			alert("כתובת הדוא\"ל שהכנסת ריקה או אינה חוקית");
		}
		else{
			alert("The email address is invalid or empty");
		}
		oFrm.txtEmail.focus();
		return false;
	}
//	if(oFrm.txtText.value==""){
//		if (lang_name=='he'){
//			alert("נא הכנס נושא הפנייה");
//		}
//		else{
//			alert("Please insert a message subject");
//		}
//		oFrm.txtText.focus();
//		return false;
//	}
	return true;
}