
	function checkcode(thecode) 
	{ 
		var fom = document.getElementById('inquiryform')	
		var http = createAjax();
		http.open("GET", 'captcheck.php?code='+ fom.code.value, false); 
		http.send(null); 
		if(http.responseText.indexOf('Invalid')+1) 
		{ 
			alert('The entered code was not correct. Please try again'); 
			fom.code.value=''; 
			fom.code.focus(); 
		} 
		else
			fom.submit(); 	
	} 
	
	function checkform() 
	{ // First the normal form validation 
	var fom = document.getElementById('inquiryform')
	if(trim(fom.organization.value)=='')
	{
	alert('Please enter the Organization Name!'); 
	fom.organization.focus(); 
	return false; 
	}

	if(trim(fom.website_Address.value)=='http://www.' || trim(fom.website_Address.value)=='')
	{
		alert('Please enter the Web address!'); 
		fom.website_Address.focus();
		return false; 
	}	

	if(trim(fom.Name.value)=='')
	{
		alert('Please enter your Name!'); 
		fom.Name.focus();
		return false; 
	}
			
	if(trim(fom.Email.value)=='')
	{
		alert('Please enter your Email Address!'); 
		fom.Email.focus();
		return false; 
	}
			
	if(trim(fom.Email.value)!='' && echeck(fom.Email.value)==false)
	{
		alert('Please enter valid Email Address!'); 
		fom.Email.focus();
		return false; 
	}

	if(trim(fom.siteonline.value)=='---------')
	{
		alert('Please select how long your website been online!'); 
		fom.siteonline.focus();
		return false; 
	}

	if(trim(fom.BusinessType.value)=='')
	{
		alert('Please describe your Buisness!'); 
		fom.BusinessType.focus();
		return false; 
	}

	if(trim(fom.custlocation.value)=='-----')
	{
		alert('Please select where your customer Location!'); 
		fom.custlocation.focus();
		return false; 
	}

	if(trim(fom.MarketingGoals.value)=='')
	{
		alert('Please enter your Marketing Goals!'); 
		fom.MarketingGoals.focus();
		return false; 
	}

	if(fom.code.value=='') 
	{ 
	alert('Please enter the string from the displayed image'); 
	fom.code.value=''; 
	fom.code.focus(); 
	return false; 
	} // Now the Ajax CAPTCHA validation 
	checkcode(fom.code.value); 
	return false; 
	} 


