 function movepic(img_name,img_src)
 {
    document[img_name].src=img_src;
 }

 function validate()
 {
   var strValidChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
   var blnResult = true; 
   var trimFname;
   var trimLname;
   var found=0;
   if((document.frm.email.value.indexOf("@")==-1)||(document.frm.email.value.indexOf(".")==-1))
   {
   found=1
   }
   if(document.frm.email.value.indexOf(" ")>0)
   {
   found=1
   }
   if(found==1)
   {
     alert("An email address is required to sign-in.  Please enter your valid email address to register");
     document.frm.email.focus();
     return;
   }
   if (document.frm.email.value.length==0)
   {
     alert("An email address is required to sign-in.  Please enter your valid email address to register");
     return;
   }
   if(document.frm.email.value==false)
   {
     alert("An email address is required to sign-in.  Please enter your valid email address to register");
     document.frm.email.focus();
     return;
   }
   if(document.frm.cfemail.value!=document.frm.email.value){
     alert("The confirm email address entered does not match the email above.  Please reconfirm your email to continue your registration.");
     document.frm.cfemail.focus();
     return;
   }
   if(document.frm.cfemail.value!=false)
   {
    var found1=0;
    if((document.frm.cfemail.value.indexOf("@")==-1)||(document.frm.cfemail.value.indexOf(".")==-1))
    {
    found1=1
    }
    if(document.frm.cfemail.value.indexOf(" ")>0)
    {
    found1=1
    }
    if(found1==1)
    {
      alert("Please confirm your email address to continue the registration process");
      document.frm.cfemail.focus();
      return;
    }
    if (document.frm.cfemail.value.length==0)
    {
      alert("Please confirm your email address to continue the registration process");
      return;
    }
    if(document.frm.cfemail.value==false)
    {
      alert("Please confirm your email address to continue the registration process");
      document.frm.cfemail.focus();
      return;
    }
    if(document.frm.cfemail.value!=document.frm.email.value){
      alert("The confirm email address is same as the email is required to sign-in.  Please enter a same confirm email address to register");
      document.frm.cfemail.focus();
      return;
    }
   }
   
   
   
   if(document.frm.fname.value==false)
   {
     alert("A first name is required for registration.  Please enter a first name to continue the registration process.");
     document.frm.fname.focus();
     return;
   }
   trimFname=document.frm.fname.value;
 		while (trimFname.substring(0,1) == ' ')
 		{
  		  trimFname = trimFname.substring(1,trimFname.length);
  		}
  		while (trimFname.substring(trimFname.length-1,trimFname.length) == ' ')
  		{
    			trimFname = trimFname.substring(0,trimFname.length-1);
  		}
     for (i = 0; i < trimFname.length && blnResult == true; i++){
 	strChar = trimFname.charAt(i);
 	if (strValidChars.indexOf(strChar) == -1){
 		alert("A first name is required for registration.  Please enter your valid first name without special characters to continue the registration process.");
 		document.frm.fname.focus();
 		blnResult = false;
		return;
 	}
    }
   if(document.frm.lname.value==false)
   {
     alert("A last name is required for registration.  Please enter a last name to continue the registration process.");
     document.frm.lname.focus();
     return;
   }
   trimLname=document.frm.lname.value;
 		while (trimLname.substring(0,1) == ' ')
 		{
  		  trimLname = trimLname.substring(1,trimLname.length);
  		}
  		while (trimLname.substring(trimLname.length-1,trimLname.length) == ' ')
  		{
    			trimLname = trimLname.substring(0,trimLname.length-1);
  		}
     for (i = 0; i < trimLname.length && blnResult == true; i++){
 	strChar = trimLname.charAt(i);
 	if (strValidChars.indexOf(strChar) == -1){
 		alert("A last name is required for registration.  Please enter your valid last name without special characters to continue the registration process.");
 		document.frm.lname.focus();
 		blnResult = false;
		return;
 	}
    }
   
   if(document.frm.password.value==false)
   {
     alert("A password is required for registration.  Please enter a password to continue the registration process.");
     document.frm.password.focus();
     return;
   }
   if(document.frm.cfpassword.value==false)
   {
     alert("A confirm password is required for registration.  Please enter a confirm password to continue the registration process.");
     document.frm.cfpassword.focus();
     return;
   }
   if(document.frm.cfpassword.value!=document.frm.password.value){
     alert("The password entered does not match the password above.  Please reconfirm your password to continue your registration.");
     document.frm.cfpassword.focus();
     return;
   }
   if(document.frm.password.value!=false)
   {
      ok= passwordcheck(document.frm.password.value);
      if(ok==0)
       {
         alert("The password entered for this email address was not between 5-11 characters.  Please make this correction to continue registration.");
         document.frm.password.focus();
         return;
       }
   }
   //or did not have at least 2 numeric and 4 alphabetic characters
   if(document.frm.cfpassword.value!=false)
   {
       cfok= passwordcheck(document.frm.cfpassword.value);
       if(cfok==0)
       {
         alert("The confirm password entered for this email address was not between 5-11 characters.  Please make this correction to continue registration.");
         document.frm.cfpassword.focus();
         return;
       }
   }
   if(document.frm.phone.value==false)
   {
     alert("A phone number is required for registration.  Please enter a phone number to continue the registration process");
     document.frm.phone.focus();
     return;
   }
   if(document.frm.phone.value!=false)
   {
     if(isNaN(document.frm.phone.value))
     {
     alert("The phone number must be numeric. Please correct the phone number to continue.");
     document.frm.phone.focus();
     return;
     }
   }
   if(document.frm.accept.checked==false)
   {
    alert("Please accept the legal disclaimer to register on this website");
    document.frm.accept.focus();
    return;
   }
   
   document.frm.submit();
 }
 
 function passwordcheck(myString)
 {
  var re0 = /[^0-9]/g;
  var re1 = /[a-zA-Z0-9]/g;
  var re2 = /[^a-zA-Z]/g;
  var digitString = myString.replace(re0, "");
  var specialString = myString.replace(re1, "");
  var charString = myString.replace(re2, "");
   var x = digitString.length;
   var y = specialString.length;
   var p= charString.length;
   var z= myString.length;
   var passok=0;
  // if(z>=5 && z<=11 && y==0 && x>=2 && p>=4)
  if(z>=5 && z<=11 && y==0)
   {
     passok =1;
   }
   return passok;
   //alert("number of digits: " + digitString.length);
   //alert("number of special characters: " + specialString.length);
   //alert("number of characters: " + myString.length);
 }
function firstfocus(){
   document.frm.email.focus();
 }

 function callme(str_param){
 	if (str_param != "condition"){
		document.frm.action="../static.php?file=6";
		document.frm.method="post";
		document.frm.submit();
	}
	else{ 	
		if(document.frm.accept.checked==true){
			document.frm.action="../static.php?file=6";
			document.frm.method="post";
			document.frm.submit();
		}
	}	
 }

 function enterCheck(e)
{
	 var characterCode
	 if(e && e.which){
	 e = e
	 characterCode = e.which
	 }
	 else{
	 e = event
	 characterCode = e.keyCode
	 }	 
	 if(characterCode == 13){
	 validate();
	 return false
	 }
	return true
	
           
}