//On Error Resume Next%>
var zipstr;
var phonestr;
var struPlace;        //the indexOf the @ in the email
var dotPlace;		//the indexOf the dot in the email
var emailstr;
var name;		//will hold the email string
var i;	
var j;			//for the loop
var dotAftStru=false;   //help to find if ther is "." after the "@"
var zipnotnum=false;
var phonestr=false; 
function Ver_Reset() 
{
document.form1.reset();
}
function Ver_submit(emailstr,name)
	{
					
		struPlace=emailstr.indexOf('@');
		dotPlace=emailstr.indexOf('.');
			if(struPlace==-1 || dotPlace==-1)
			{
					document.form1.eMail.style.backgroundColor="#EAEAEB";
				
			document.form1.eMail.focus();
				return;
			}
			if(struPlace==0 || dotPlace==0)
			{
					document.form1.eMail.style.backgroundColor="#EAEAEB";
			document.form1.eMail.focus();
				return;
			}
			if(struPlace==emailstr.length-1 || dotPlace==emailstr.length-1)
			{
					document.form1.eMail.style.backgroundColor="#EAEAEB";
			document.form1.eMail.focus();
				return;
			}
				 for(i=struPlace+1;i<emailstr.length;i++)
				 {
					  if(emailstr.charAt(i)=='.')
					{
						  dotAftStru=true;
						  
						  break; 
					 }
					 if(dotAftStru=false) 
					    {
					   document.form1.eMail.style.backgroundColor="#EAEAEB";
						document.form1.eMail.focus();
				      	return;
					     }
				}		
         for(i=struPlace+1 ; i<emailstr.length;  i++)
			 {
                if(emailstr.charAt(i)=='@')
				 {
				document.form1.eMail.style.backgroundColor="#EAEAEB";
				document.form1.eMail.focus();
				return;
				  }
                  
              }
           if(name=="")
           {
          	document.form1.f_name.style.backgroundColor="#EAEAEB";
				
			document.form1.f_name.focus();
           return;
           }
             document.form1.submit();
			
				
     }
     
     
     
     function cheakUserPassword(sessionPassword,userPassword)
     {
     
		if (sessionPassword==userPassword)
		{
			//window.open ("basket.asp","fillform","width=350,left=150,height=400,top=50");
			//history.back();
			//window.location="index.asp";
			document.form2.submit();
			}
		else
		alert("try agian");
	     
     }
     
     
     
     
     
   function checkForm(x)
{
	
	if(x != "ok")
	{
		
		if (document.user.Fname.value=="")
		{
		
			document.user.Fname.style.backgroundColor="#ffffff";
			document.user.Fname.focus();
			return;
		}


		if (document.user.Lname.value=="")
		{
			
			document.user.Lname.style.backgroundColor="#ffffff";
			document.user.Lname.focus();
			return;
		}

		if (document.user.Address.value=="")
		{
			
			document.user.Address.style.backgroundColor="#ffffff";
			document.user.Address.focus();
			return;
		}

		if (document.user.city.value=="")
		{
			
			document.user.city.style.backgroundColor="#ffffff";
			document.user.city.focus();
			return;
		}
	
		
	
		
	
	
		if (document.user.phone.value=="")
		{
			
			document.user.phone.style.backgroundColor="#ffffff";
			document.user.phone.focus();
			return;	
		}
			
		if (document.user.Password.value=="")
		{
			alert("בדוק סיסמא");
			document.user.Password.style.backgroundColor="#ffffff";
			document.user.Password.focus();
			return;
		}
			
		if (document.user.ConFirmPassword.value!=document.user.Password.value)
		{
			alert("בדוק סיסמא");
			document.user.ConFirmPassword.focus();
			return;
		}
	}
	document.user.mode.value=x;
	document.user.submit();
}  


   function checkForm_e(x)
{
	
	if(x != "ok")
	{
		
		if (document.user.Fname.value=="")
		{
		
			document.user.Fname.style.backgroundColor="#ffffff";
			document.user.Fname.focus();
			return;
		}


		if (document.user.Lname.value=="")
		{
			
			document.user.Lname.style.backgroundColor="#ffffff";
			document.user.Lname.focus();
			return;
		}

		if (document.user.Address.value=="")
		{
			
			document.user.Address.style.backgroundColor="#ffffff";
			document.user.Address.focus();
			return;
		}

		if (document.user.city.value=="")
		{
			
			document.user.city.style.backgroundColor="#ffffff";
			document.user.city.focus();
			return;
		}
	
			if (document.user.country.value=="")
		{
			
			document.user.country.style.backgroundColor="#ffffff";
			document.user.country.focus();
			return;	
		}
		if (document.user.zip_code.value=="")
		{
			
			document.user.zip_code.style.backgroundColor="#ffffff";
			document.user.zip_code.focus();
			return;	
		}
		
	
	
		if (document.user.phone.value=="")
		{
			
			document.user.phone.style.backgroundColor="#ffffff";
			document.user.phone.focus();
			return;	
		}
			
		if (document.user.Password.value=="")
		{
			alert("Chack Password");
			document.user.Password.style.backgroundColor="#ffffff";
			document.user.Password.focus();
			return;
		}
			
		if (document.user.ConFirmPassword.value!=document.user.Password.value)
		{
			alert("Chack Password");
			document.user.ConFirmPassword.focus();
			return;
		}
	}
	document.user.mode.value=x;
	document.user.submit();
}  


     