function checkPageForm()
{
	var pass = true;
	var error = Array();
	var nameStr = document.getElementById('yui1');
	var email = document.getElementById('agdsl6');
	var msg = document.getElementById('ghjk67');
	
	
	if(	trim(nameStr.value) == "" )
	{
		pass = false;
		error.push("Please fill in a name");	
	}
	
		if(	trim(msg.value) == "" )
	{
		pass = false;
		error.push("Please fill in an enquiry or question");	
	}
	
	if(	trim(email.value) == "" )
	{
		pass = false;
		error.push("Please fill in a email address");	
	}
	else
	{
		var emailvalue = email.value;
		var notallowed = "*&^$%#!~`';<>()][\/{}+= ";
		
		for (var i = 0; i< notallowed.length; i++) 
		{ 
			var sign = notallowed.substr(i, 1);
		
			if(emailvalue.match('\\'+sign))
			{
				error.push("the character "+sign+" can not be used in a url");
				pass = false;
			}
		} 
		
		if(echeck(email.value) == false)
		{
			
			error.push("email adress is incorrect ");
			pass = false;
		
		}
		
	}
	
	
	if(pass == true )
	{
		return true;	
	}
	else
	{
		var errormsg = "";
		
		for (var i = 0; i<error.length; i++) { 
		errormsg +=  error[i]+"\n";
		}
		
		alert("Errors occured. please see the list below \n"+ errormsg);
		
		
		return false;
	}
	
	
}


/**
 * DHTML email validation script. Courtesy of SmartWebby.com (http://www.smartwebby.com/dhtml/)
 */

function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		 
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
	
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
	
		    return false
		 }

 		 return true					
	}




   function trim(strnew)
   {
	   
    var s = strnew.replace(/^(\s)*/, '');
     s = s.replace(/(\s)*$/, '');
     return s;
   }