function trimstring(strr)
	{
    	var i;
    	while(strr.charAt(0)==' ')
    	{
        	strr=strr.substring(1);
    	}
   		while(strr.charAt(strr.length-1)==' ')
    	{
        	strr=strr.substring(0,strr.length-1);
    	}
    	return strr;
	}
	
	function validateEmail(email)
	{
	
		// This function is used to validate a given e-mail 
		// address for the proper syntax
	
		if (email == ""){
			return false;
		}
		badStuff = ";:/,' \"\\";
		for (i=0; i<badStuff.length; i++){
			badCheck = badStuff.charAt(i)
			if (email.indexOf(badCheck,0) != -1){
				return false;
			}
		}
		posOfAtSign = email.indexOf("@",1)
		if (posOfAtSign == -1){
			return false;
		}
		if (email.indexOf("@",posOfAtSign+1) != -1){
			return false;
		}
		posOfPeriod = email.indexOf(".", posOfAtSign)
		if (posOfPeriod == -1){
			return false;
		}
		if (posOfPeriod+2 > email.length){
			return false;
		}
		return true
	}
	
	function chk_form(thisform)
	{
		with(thisform)
		{
			if(trimstring(name.value)=="")
			{
				alert("Please Fill Your Name");
				name.focus();
				return false;
			}
		
			if(trimstring(email.value)=="")
			{
				alert("Please Fill The Email Address");
				email.focus();
				return false;
			}
			if(!validateEmail(email.value))
			{
				alert("Please provide a Valid Email Address");
				email.focus();
				return false;
			}
			if(trimstring(comments.value)=="")
			{
				alert("Pleas Fill Some Comments");
				comments.focus();
				return false;
			}
		}
	}