﻿


function doTguvaSubmit(){
	
	fname=document.MyForm.fname.value;
	if (fname=="")
	 	{ msg="נא להזין שם ";
		  document.MyForm.fname.value = msg;
		  window.setTimeout("document.MyForm.fname.value=''",1500);
		  return;}
		  
		  
	phone=document.MyForm.phone.value;
	if (phone=="")
	 	{ msg="נא להזין טלפון ";
		  document.MyForm.phone.value = msg;
		  window.setTimeout("document.MyForm.phone.value=''",1500);
		  return;}	
		  
		email=document.MyForm.email.value;
	if (email=="")
	 	{ msg="נא להזין מייל";
		  document.MyForm.email.value = msg;
		  window.setTimeout("document.MyForm.email.value=''",1500);
		  return;}		  	  
		  
		  
	email=document.MyForm.email.value;
	if (!email=="")
	{if ((email.indexOf("@")<2) || (email.lastIndexOf(".")<=(email.indexOf("@")+2) || ((email.length<8)) || (email.charAt(0) == "-" || email.charAt(0) == "_" || email.charAt(0) == "@" || email.charAt(0) == "-" || email.charAt(0) == "_" || email.charAt(0) == "."))) 
	  	{ msg= "נא להזין מייל תקין";
		  document.MyForm.email.value = msg;
		  window.setTimeout("document.MyForm.email.value=''",1500);
		  return;}}
	
 

   	if (document.MyForm.agree.checked == false)
	 	{ alert("יש להסכים לתנאי האתר");
	 	//msg="נא להזין מייל";
		  //document.MyForm.email.value = msg;
		  //window.setTimeout("document.MyForm.email.value=''",1500);
		  return;}

	document.MyForm.submit();	
}






