//window.onfocus = generateCaptcha();
function validateCaptcha()
	{
		if(document.all)
		{
	 		if(document.getElementById("captchaText").value != document.getElementById("captchaCode").innerText)
			{
				alert("You must enter the correct validation code before continuing.");
				document.getElementById("captchaText").focus();
				document.getElementById("captchaText").value = "";
				generateCaptcha();
				return (false);
			}    		
		} 
		else
		{
	 		if(document.getElementById("captchaText").value != document.getElementById("captchaCode").textContent)
			{
				alert("You must enter the correct validation code before continuing.");
				document.getElementById("captchaText").focus();
				document.getElementById("captchaText").value = "";
				generateCaptcha();
				return (false);
			}    
		}
		generateCaptcha();
		document.getElementById("captchaText").value = "";
		return true;
	}
function generateCaptcha()
	{
		if(document.all)
		{
     		document.getElementById("captchaCode").innerText = Math.floor(Math.random()*999999);
		} 
		else
		{
		    document.getElementById("captchaCode").textContent = Math.floor(Math.random()*999999);
		}
	}

function contactFormValidation(contactForm) {
if (validateCaptcha() == true)
{
	if(contactForm.Name.value != "") {
	
	}
	else
	{
	alert ("Please enter your name in the \"Contact Name\" box. \nThank you.");
	contactForm.Name.focus();
	return false;
	}
		
	if(contactForm.emailOrPhone.value != "") {
	
	}
	else
	{
	alert ("Please enter your email address or phone number in the \"Email Address or Phone Number\" box. \nThank you.");
	contactForm.emailOrPhone.focus();
	return false;
	}
	document.forms.contactForm.action = 'sendmail52.asp'
}	
else
{
	return false;
}
}
