function validate()
		{
		
			if(document.frmContact.txtName.value.length<1)
			{
				alert('Please Enter the Name');
				document.frmContact.txtName.focus();
				return false;
			
			}

			else if(document.frmContact.txtEmail.value.length<1)
			{
				alert('Please Enter the Email Address');
				document.frmContact.txtEmail.focus();
				return false;
			
			}
			else if(document.frmContact.txtSubject.value.length<1)
			{
				alert('Please Enter the Subject');
				document.frmContact.txtSubject.focus();
				return false;
			
			}
				else if(document.frmContact.txtComment.value.length<1)
			{
				alert('Please Enter the Comment');
				document.frmContact.txtComment.focus();
				return false;
			
			}
			
			
			
			if(checkformat()==true)
					{
						
						document.frmContact.submit();
						return true;
					}
					else
					{
						
						return false;
					}

				
		
		}
		function checkformat()
	{
		var valid="";
		var ok="";
		var temp="";
		var field;
		var missinginfo = "";
		
		//----------------------------------------------------------------------------
		// Name format
		//----------------------------------------------------------------------------
		 valid = "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ"
		 ok = "yes";
		 temp="";
		 field=document.getElementById('txtName');
		 
			for (var i=0; i<field.value.length; i++) 
				{
					temp = "" + field.value.substring(i, i+1);
					if (valid.indexOf(temp) == "-1") ok = "no";
				}
		if (ok == "no") 
				{
				alert("Error ! Please Enter Only Alphabats in Name!");
				field.value=trimAll(field.value);
				//setTimeout(function(){field.focus()}, 10);
				field.focus();
				field.select();
				return false;
				}
		
		//---------------------------------------------------------------------------
		// Email format
		//----------------------------------------------------------------------------
			
			missinginfo = "";
			field=document.getElementById('txtEmail');
					if ((field.value.indexOf('@') == -1) || (field.value.indexOf('.') == -1)) 
						{
						missinginfo += "\n     -  Email address";
						}
					
				if (missinginfo != "")
			 	{
					alert("Error ! Please Enter Valid Email-Id!");
					field.focus();
					field.select();
					return false;
				}
				return true;
	}
			
function trimAll(sString) 
    {
			while (sString.substring(0,1) == ' ')
			{
			sString = sString.substring(1, sString.length);
			}
			while (sString.substring(sString.length-1, sString.length) == ' ')
			{
			sString = sString.substring(0,sString.length-1);
			}
			return sString;
    } 