 
function numchar(str, x)
{
 var count;
 count=0;
   for(i=0; i<=(str.length -1); i++)
     {
       if (str.charAt(i)==x)
       {
         count++;
       }
      }
        return count;
}

function emailOK()
{
 	if ( (document.lform.email.value.length<5) || (numchar(document.lform.email.value," ") >0) || (numchar(document.lform.email.value, "@")!=1)||(numchar(document.lform.email.value, ".")==0) )
   	{
     		return true;   //wrong email address
  	} else 
     	{ 
      		 return false;
      	}
}
 

 

function emailOK1()
{
 	if ( (document.rform.email.value.length<5) || (numchar(document.rform.email.value," ") >0) || (numchar(document.rform.email.value, "@")!=1)||(numchar(document.rform.email.value, ".")==0) )
   	{
     		return true;   //wrong email address
  	} else 
     	{ 
      		 return false;
      	}
 }
   
     
 


 

   
function submit_form()
{
  missinginfo = "";

  if (emailOK())
  {
	
	 missinginfo += "\n   -  Wrong email address. Please specify email";

  }

   if(document.lform.password.value.length<5 )
   {
     missinginfo += "\n   -  Login Password must be 5 - 10";
    
   }


   
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in your:\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else
{
 return true;
} 
   
   
} 




function submit_form1()
{
  missinginfo = "";

  if (emailOK1())
  {
	
	 missinginfo += "\n   -  Wrong email address. Please specify email";

  }

   if( document.rform.password.value.length<5 )
   {
     missinginfo += "\n   -  Login Password must be 5 - 10";
    
   }

    
 
   if(document.rform.password.value.length<5 )
   {
     missinginfo += "\n   -  Password must be 5 - 10";
    
   }
    

   if(document.rform.password.value != rform.password1.value)
    {
     	missinginfo += "\n   -  Passwords must be the same";
    
     } 
   
if (missinginfo != "") {
missinginfo ="_____________________________\n" +
"You failed to correctly fill in your:\n" +
missinginfo + "\n_____________________________" +
"\nPlease re-enter and submit again!";
alert(missinginfo);
return false;
}
else
{
 return true;
} 
   
   
} 

