// JavaScript Document

// Form Element Validation
function checkForm(which)
{
	var strguestName;
	var strCompanyName;
	var strEmail;
	var strDeliverydate;
	var strPh;
	var strFax;
	var rndNumber=0.0;
	
	strName = document.getElementById('txtName').value;
	strEmail = document.getElementById('txtEmail').value;
	strComments = document.getElementById('txtComments').value;	

	if(strName != "" && strEmail != "" && strComments != "")
	{
		var emailok = true;
		//alert(emailok);
		//var temp = window.document.forms[0].reqRequestor_Email; // ## If you change the field name of the Requestor, you will need to update here as well. ##
		var temp = document.getElementById('txtEmail');  // ## validate by id ##	
		var atsym = temp.value.indexOf('@');
		var period = temp.value.lastIndexOf('.');
		var space = temp.value.indexOf(' ');
		var length = temp.value.length - 1;
		if ((atsym < 1) || (period <= atsym+1) || (period == length ) || (space != -1))
		{ 
			var emailok = false;
			// ## You can change your Valid Email alert message here ##
			alert('###### VALID EMAIL REQUIRED ###### \n Please enter a Valid Email Address! \n\n An example of a Valid Email Address would be \n\n userid@email.com \n');
			temp.value='';
			temp.focus();
		}
		return emailok;
		//validEmail();
		//rndNumber = Math.random()*65536;
		//rndNumber = Math.floor(rndNumber);
		//subThanks(rndNumber);
//		subThanks();
		//return true;
	}
	else
	{
		alert("##### INCOMPLETE FORM ERROR ##### \n\n Some of the fields in this form (marked with an asterisk *)are mandatory. \n\n Please complete all these fields before submitting your request.");
//		alert(myArr);
		return false;
	}
		//setTimeout('reloadIt()', 6000);	
}