// JavaScript Document
function loadc()
{
  document.frm2.ctext.value = randomPassword(6);
  document.frm2.pvalid.value='n';
  return false;
}		


function validate()
{
//alert("jo");
	if(isvalidname(document.frm2.txtname.value)!=true)
	{
		alert("Invalid Name! Enter Full Name without special characters!");
		document.frm2.txtname.focus();
		return false;
	}
	
	if(isvalidvalue(document.frm2.txtemail.value)!=true)
	{
		alert("Invalid Email Address!");
		document.frm2.txtemail.focus();
		return false;
	}
	
	if(isvalidemail(document.frm2.txtemail.value)!=true)
                  {
                     alert("Invalid E-mail Address! Please re-enter.");
					 document.frm2.txtemail.focus();
                      return false;
                  }
				  
	if(isvalidun(document.frm2.txtun.value)!=true)
	{
		alert("Invalid Username! Username should be 5-15 alphanumeric characters and CANNOT contain special characters and space!");
		document.frm2.txtun.focus();
		return false;
	}
	
	
	if(document.frm2.pvalid.value!='y' || isvalidpwd(document.frm2.txtpwd.value)!=true)
	{
		alert('Invalid Password');
		document.frm2.txtpwd.focus();
		return false;
	}
	
	
	if(document.frm2.txtpwd.value!=document.frm2.confpwd.value)
	{
		alert('Passwords do not match');
		return false;
	}
	
	if(document.frm2.country.value=='')
	{
		alert('Please specify your country');
		return false;
	}

	if(document.frm2.ec.value =="" || pass111!=document.frm2.ec.value)
			{
			alert("Invalid Code!");
			document.frm2.ec.focus();
			return false;
			}

}

