function validate(theform)
{

	str="~!@#$%^&*()_+-<>?:;[]{}()|.\'\"/\\";
	val=theform.username.value;
	len=val.length;
	if (val=='')
	{
		alert ("You should write your User Name");
		theform.username.focus();
		return false;
	}
	for(i=0;i<len;i++)
	 {
  		ch=val.charAt(i);
		if(str.indexOf(ch)!=-1)
		{
			alert ("You should enter letters or digit only in your User Name");
			theform.username.focus();
			theform.username.select();
			return false;
			break;
		}
	}
 



	str="~!@#$%^&*()_+-<>?:;[]{}()|.\'\"/\\";
	val=theform.password1.value;
	len=val.length;
	if (val=='')
	{
		alert ("You should write your Password");
		theform.password1.focus();
		return false;
	}
	for(i=0;i<len;i++)
	 {
  		ch=val.charAt(i);
		if(str.indexOf(ch)!=-1)
		{
			alert ("You shouldn't enter any symbole letters in password");
			theform.password1.focus();
			theform.password1.select();
			return false;
			break;
		}
	}
  




	valP=theform.password1.value;
	valCP=theform.password2.value;
	len=valCP.length;
	if (len=='')
	{
		alert ("You should Confirm your Password");
		theform.password2.focus();
		return false;
	}
	if (valP!=valCP)
	{
		alert ("Write the same Password in Confirm Password");
		theform.password2.focus();
		return false;
	}
	



	str="0123456789~!@#$%^&*()_+-<>?:;[]{}()|.\'\"/\\";
	val=theform.fname.value;
	len=val.length;
	if (val=='')
	{
		alert ("You Must write your First Name");
		theform.fname.focus();
		return false;
	}
	for(i=0;i<len;i++)
	 {
  		ch=val.charAt(i);
		if(str.indexOf(ch)!=-1)
		{
			alert ("You should enter letters only in your First Name");
			theform.fname.focus();
			theform.fname.select();
			return false;
			break;
		}
	}
  



	str="0123456789~!@#$%^&*()_+-<>?:;[]{}()|.\'\"/\\";
	val=theform.mname.value;
	len=val.length;
	if (val=='')
	{
		alert ("You Must write your Middle Name");
		theform.mname.focus();
		return false;
	}
	for(i=0;i<len;i++)
	 {
  		ch=val.charAt(i);
		if(str.indexOf(ch)!=-1)
		{
			alert ("You should enter letters only in your Middle Name");
			theform.mname.focus();
			theform.mname.select();
			return false;
			break;
		}
	}


	str="0123456789~!@#$%^&*()_+-<>?:;[]{}()|.\'\"/\\";
	val=theform.lname.value;
	len=val.length;
	if (val=='')
	{
		alert ("You Must write your Last Name");
		theform.lname.focus();
		return false;
	}
	for(i=0;i<len;i++)
	 {
  		ch=val.charAt(i);
		if(str.indexOf(ch)!=-1)
		{
			alert ("You should enter letters only in your Last Name");
			theform.lname.focus();
			theform.lname.select();
			return false;
			break;
		}
	}
  




	str="0123456789~!@#$%^&*()_+-<>?:;[]{}()|.\'\"/\\";
	val=theform.familyname.value;
	len=val.length;
	if (val=='')
	{
		alert ("You Must write your Family Name");
		theform.familyname.focus();
		return false;
	}
	for(i=0;i<len;i++)
	 {
  		ch=val.charAt(i);
		if(str.indexOf(ch)!=-1)
		{
			alert ("You should enter letters only in your Family Name");
			theform.familyname.focus();
			theform.familyname.select();
			return false;
			break;
		}
	}
 



	ind=theform.nationality.selectedIndex;
	if(theform.nationality[ind].value=="0")
	{
		alert("Select your Nationality");
		theform.nationality.focus();
		return false;
	}
	
    if(theform.nationality[ind].value=="other")
	{
		val=theform.othercnationalityountry.value;
			len=val.length;
			if (val=='')
			{
				alert ("You should write your Other Nationality");
				theform.othercnationalityountry.focus();
				return false;
				
			}
	
	}
	
	
	


	ind=theform.gender.selectedIndex;
	if(theform.gender[ind].value=='0')
	{
		alert("Select your Gender");
		theform.gender.focus();
		return false;
	}
	





	ind=theform.MilitaryStatus.selectedIndex;
	if(theform.MilitaryStatus[ind].value=='0')
	{
		alert("Select your Military Status");
		theform.MilitaryStatus.focus();
		return false;
	}
	




	ind=theform.MaritalStatus.selectedIndex;
	if(theform.MaritalStatus[ind].value=='0')
	{
		alert("Select your Marital Status");
		theform.MaritalStatus.focus();
		return false;
	}
	
	ind=theform.day.selectedIndex;
	if(theform.day[ind].value=='0')
	{
		alert("Select your Birth Day");
		theform.day.focus();
		return false;
	}
	
	ind=theform.month.selectedIndex;
	if(theform.month[ind].value=='0')
	{
		alert("Select your Birth Month");
		theform.month.focus();
		return false;
	}
	
	ind=theform.year.selectedIndex;
	if(theform.year[ind].value=='0')
	{
		alert("Select your Birth Year");
		theform.year.focus();
		return false;
	}
	

	
	ind=theform.country.selectedIndex;
	if(theform.country[ind].value=="0")
	{
		alert("Select your Country");
		theform.country.focus();
		return false;
	}
	

    if(theform.country[ind].value=="other")
	{
		val=theform.othercountry.value;
			len=val.length;
			if (val=='')
			{
				alert ("You should write your Other Country");
				theform.othercountry.focus();
				return false;
				
			}
	
	}
	
	ind=theform.city.selectedIndex;
	if(theform.city[ind].value=='0')
	{
		alert("Select your City");
		theform.city.focus();
		return false;
	}
	
	    if(theform.city[ind].value=="other")
	{
		val=theform.othercity.value;
			len=val.length;
			if (val=='')
			{
				alert ("You should write your Other City");
				theform.othercity.focus();
				return false;
				
			}
	
	}
		
str="0123456789";
	val=theform.HP1.value;
	len=val.length;
	if (val=='')
	{
		alert("You Should Enter One Phone at least");
		theform.HP1.focus();
		return false;
	}
	for(i=0;i<len;i++)
	 {
  		ch=val.charAt(i);
		if(str.indexOf(ch)==-1)
		{
			alert ("You Should Enter Numbers in Phone Field");
			theform.HP1.focus();
			theform.HP1.select();
			return false;
			break;
		}
	}
	
	str="0123456789";
	val=theform.HP2.value;
	len=val.length;
	if (val!='')
	{
		for(i=0;i<len;i++)
	     {
	  		ch=val.charAt(i);
			if(str.indexOf(ch)==-1)
			{
				alert ("You Should Enter Numbers in Phone Field");
				theform.HP2.focus();
				theform.HP2.select();
				return false;
				break;
			}
	     }
	
	}
	
	str="0123456789";
	val=theform.WP1.value;
	len=val.length;
	if (val!='')
	{
		for(i=0;i<len;i++)
	     {
	  		ch=val.charAt(i);
			if(str.indexOf(ch)==-1)
			{
				alert ("You Should Enter Numbers in Phone Field");
				theform.WP1.focus();
				theform.WP1.select();
				return false;
				break;
			}
	     }
	
	}
	
	
	str="0123456789";
	val=theform.WP2.value;
	len=val.length;
	if (val!='')
	{
		for(i=0;i<len;i++)
	     {
	  		ch=val.charAt(i);
			if(str.indexOf(ch)==-1)
			{
				alert ("You Should Enter Numbers in Phone Field");
				theform.WP2.focus();
				theform.WP2.select();
				return false;
				break;
			}
	     }
	
	}
	
	str="0123456789";
	val=theform.MP.value;
	len=val.length;
	if (val!='')
	{
		for(i=0;i<len;i++)
	     {
	  		ch=val.charAt(i);
			if(str.indexOf(ch)==-1)
			{
				alert ("You Should Enter Numbers in Mobile Field");
				theform.MP.focus();
				theform.MP.select();
				return false;
				break;
			}
	     }
	
	}
	
	str="0123456789";
	val=theform.Fax.value;
	len=val.length;
	if (val!='')
	{
		for(i=0;i<len;i++)
	     {
	  		ch=val.charAt(i);
			if(str.indexOf(ch)==-1)
			{
				alert ("You Should Enter Numbers in Fax Field");
				theform.Fax.focus();
				theform.Fax.select();
				return false;
				break;
			}
	     }
	
	}
	
}