// Script written by Narasinha joshi Date:30/9/09

//Registration with us validation

function registration(seekerregistration)
	{
			if(seekerregistration.name.value=="")
				{
					alert("Please Enter the Name");
					seekerregistration.name.focus;
					return false;
					
				}
			var indexdot;
var indexat;
var email=seekerregistration.email.value;
indexat=email.indexOf("@");
indexdot=email.indexOf(".");
if(indexat==-1)
	{
		alert("Enter the Valid email Id Ex:yourname@yourmail.com");
		seekerregistration.email.focus;
		return false;
	}
	
  if(indexdot==-1)
	{
	alert("Enter the Valid email Id Ex:yourname@yourmail.com");
	seekerregistration.email.focus;
	return false;
	}  
	
if(seekerregistration.password.value=="")
					   {
						alert("Enter the Password");
						seekerregistration.password.focus;
						return false;
					   }   
					   
					   //password comparision
					   
					   var password1=seekerregistration.password.value;
					   var password2=seekerregistration.conpassword.value;
					   
						if(password1!=password2)
						{
								alert("passwords did not match,please type the password again");
								seekerregistration.conpassword.focus;
								return false;
						}
						   
					if(seekerregistration.city.value=="")
					  		 {
								alert("Please Enter the City");
								seekerregistration.city.focus;
								return false;
					   		 }
							 if(seekerregistration.state.value=="")
					  		 {
								alert("Please Enter the State");
								seekerregistration.state.focus;
								return false;
					   		 }
							 
							 
							 if(seekerregistration.zip.value.search(/\d{5}/)==-1)
   		{
      		alert("Please enter valid Zip Code");
			seekerregistration.zip.focus;
      		return false;
   		}							 
							 
							 
							  if(seekerregistration.mobile.value.search(/\d{3}\-\d{3}\-\d{4}/)==-1)
   {
      alert("The phone number you entered is not valid.\r\nPlease enter a phone number with the format xxx-xxx-xxxx.");
      seekerregistration.zip.focus;
	  return false;
   }
							 if(seekerregistration.occupation.value=="")
					  		 {
								alert("Please Enter the occupation");
								seekerregistration.occupation.focus;
								return false;
					   		 }
							  if(seekerregistration.specialization.value=="")
					  		 {
								alert("Please Enter the Specialization");
								seekerregistration.specialization.focus;
								return false;
					   		 }
							  if(seekerregistration.licencein.value=="")
					  		 {
								alert("Please Enter the licenced in date");
								seekerregistration.licencein.focus;
								return false;
					   		 }
							 
							 
							 if(seekerregistration.ssn.value.search(/\d{3}\-\d{2}\-\d{4}/)==-1)
   								{
     						 alert("The SSN number you entered is not valid.\r\nPlease enter a SSN number with the format xxx-xx-xxxx.");
      						 seekerregistration.ssn.focus;
							 return false;
   								}
							 
							 
							  if(seekerregistration.primary_pre.value=="")
					  		 {
								alert("Please Enter the Primary Preference");
								seekerregistration.primary_pre.focus;
								return false;
					   		 }

	}
						
						// login page validations
						
							
						function loginpage(login)
						{
							var indexdot;
							var indexat;
							var email=login.email.value;
							indexat=email.indexOf("@");
							indexdot=email.indexOf(".");
		if(indexat==-1)
			{
				alert("Enter the Valid email Id Ex:yourname@yourmail.com");
				login.email.focus;
				return false;
			}
	
  		if(indexdot==-1)
			{
				alert("Enter the Valid email Id Ex:yourname@yourmail.com");
				login.email.focus;
				return false;
			} 
	
	  if(login.password.value=="")
					  		 {
								alert("Please Enter the password");
								login.password.focus;
								return false;
					   		 }

	
	
						}
						
						
						