<!--// JavaScript Document
function validate_controls()
{
if (document.mail.txtname.value=="")
	{
		alert ("Please type your name...");
		document.mail.txtname.focus();
		return false;
	}
	
	if (check_text(document.mail.txtname.value)==false)
	{
	alert("please enter alphabeticals only");
	document.mail.txtname.focus();
		return false;
	}
	if (document.mail.txtemail.value=="")
	{
		alert ("Please type your email");
		document.mail.txtemail.focus();
		return false;
	}
     if (isEmail(document.mail.txtemail.value)==false)
	{
		alert ("Please enter valid email");
		document.mail.txtemail.focus();
		return false;
	}
	if (document.mail.txtrname.value=="")
	{
		alert ("Please type reciepent's name...");
		document.mail.txtrname.focus();
		return false;
	}
	if (check_text(document.mail.txtrname.value)==false)
	{
	alert("please enter alphabeticals only");
	document.mail.txtrname.focus();
		return false;
	}
		if (document.mail.txtremail.value=="")
	{
		alert ("Please type reciepent's email");
		document.mail.txtremail.focus();
		return false;
	}
	
	if (isEmail(document.mail.txtremail.value)==false)
	{
		alert ("Please enter valid reciepent's email");
		document.mail.txtremail.focus();
		return false;
	}
	
function isEmail ( string ) 
	{
		if(string == "")
		  return false;
		  
		 if (string.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
			 return true;
		 else
			 return false;
	}
function check_text(str,i)
{
		
		validString = 1;
		for( var idx=0; idx< str.length; idx++ )
		{
			ch = str.charAt(idx);
			/*Uif(i==13 || i==14 || i==15 || i==16 )
			{*/
             if(!((ch>='a') && (ch <='z')) && !((ch>='A') && (ch <='Z')) && !(ch==' '))
			{
				validString = 0;
				break;
			}
			/*}
			if(i==12)
			{
			if(!((ch>=0) && (ch <=9)) && (!(ch=='-')  && !(ch=='/')))
			{
				validString = 0;
				break;
			}
			}
			if(i==17)
			{
			if(!((ch>=0) && (ch <=9)))
			{
				validString = 0;
				break;
			}
			}*/
		}
		if (validString==0)
			return false;
		
}

	return true;
}//end tag of function
//-->