function validate()
	{
		var name = document.getElementById('Name');
		var namevalid=/^[a-zA-Z ]+$/;
		var company = document.getElementById('Company');
		var email = document.getElementById('email');
		var address = document.getElementById('Address');
		var scode = document.getElementById('security_code');
		if (name.value.length == 0 )
		{
			alert("Please enter your name.");
			name.focus();
			name.value="";
			return false;
		}
		else if (name.value.search(namevalid) == -1 )
		{
			alert("Please enter your name.");
			name.focus();
			name.value="";
			return false;
		}
		else if (company.value.length == 0 )
		{
			alert("Please enter your company name.");
			company.focus();
			company.value="";
			return false;
		}
		else if (email.value.length == 0 )
		{
			alert("Please enter email address.");
			email.focus();
			email.value="";
			return false;
		}		
		else if(!validateEmailv2(email.value))
		{
			alert("Please enter valid email address.");
			email.focus();
			email.value="";
			return false;
		}
		else if (address.value.length == 0 )
		{
			alert("Please enter your address.");
			address.focus();
			address.value="";
			return false;
		}
		else if (scode.value.length == 0 )
		{
			alert("Please enter security code given below.");
			scode.focus();
			scode.value="";
			return false;
		}
		/*else if (!(
				code.value == "QY6XI" ||
			 	code.value == "V4XYC" ||
			 	code.value == "VC324" ||
			 	code.value == "XCO8Z" ||
				code.value == "ZY580" ))
		{
			alert("Please type the correct characters you see in the image.");
			code.focus( );
			return false;
		}*/
		return true;
}
	function validateEmailv2(email)
	{
		// a very simple email validation checking. 
		// you can add more complex email checking if it helps 
		if(email.length <= 0)
		{
			return true;	
		}
		var splitted = email.match("^(.+)@(.+)$");
		if(splitted == null) return false;
		if(splitted[1] != null )
		{
			var regexp_user=/^\"?[\w-_\.]*\"?$/;
			if(splitted[1].match(regexp_user) == null) return false;
		}
		if(splitted[2] != null)
		{
			var regexp_domain=/^[\w-\.]*\.[A-Za-z]{2,4}$/;
			if(splitted[2].match(regexp_domain) == null) 
			{
				var regexp_ip =/^\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\]$/;
				if(splitted[2].match(regexp_ip) == null) return false;
			}// if
			return true;
		}
		return false;
	}
	
	
