<!--
//Linux mode I hope..
function window_onload()
{
	document.formfeedback.fullname.focus();
}

function formfeedback_onsubmit()
{
	//Get all values to required fields.
	var strFullName = document.formfeedback.fullname.value;
	var strTelephone = document.formfeedback.telephone.value;
	var strEmail = document.formfeedback.email.value;
	var intCategory = document.formfeedback.category.selectedIndex;
	var strGuestComments = document.formfeedback.guestcomments.value;
	//var stopbots = document.formfeedback.stopbots.value;
	//var stopbots = "";
	strEmail = strEmail.Trim()
	strTelephone = strTelephone.Trim()
	
	if(IsValidForm(strFullName, strTelephone, strEmail, intCategory, strGuestComments))
	{
		document.formfeedback.stopbots.value = "yes";
		//stopbots = document.formfeedback.stopbots.value = "yes";
		//alert("stopbots:"+stopbots);
		return true;
		//return false;
	}
	else
	{
		//Position Cursor to the first missing field in the form.
		SetCursor(strFullName, strTelephone, strEmail, intCategory,
		strGuestComments);
		return false;
	}
}

//Add the "Trim" Method to the String Class.
String.prototype.Trim = TrimLeadingTrailingSpaces;

//Build the Trim Method.
function TrimLeadingTrailingSpaces()
{
	//Set the pattern to match.
	var strRegExpTrim1 = /^\s*|\s*$/g;
	//Strip the leading and trailing spaces.
	//Note "this" keyword is the string passed
	//to this method.	
	var TrimString = this.replace(strRegExpTrim1, "");
	return TrimString;
}

function IsValidForm(strFullName, strTelephone, strEmail, intCategory, strGuestComments)
{
	//Check for empty required fields.
	if(HasEmptyFields(strFullName, strTelephone, strEmail, intCategory, strGuestComments))
	{
		return false;
	}
	else if(!IsValidEmail(strEmail))
	{
		return false;
	}
	else
	{
		return true;
	}
}

function IsValidEmail(strEmail)
{
	var strTempEmail = new String(strEmail);
	var strRegExpEmail = "^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\-]+\.[a-zA-Z0-9\.\-]+$";
	var strTempRegExpEmail = new RegExp(strRegExpEmail);
	
	if(strTempRegExpEmail.test(strTempEmail))
	{
		return true;
	}
	else
	{
		alert("It appears you have not entered a valid e-mail format.\nPlease renter a valid e-mail.");
		document.formfeedback.email.focus();
		document.formfeedback.email.select();
		return false;
	}
}

function HasEmptyFields(strFullName, strTelephone, strEmail, intCategory, strGuestComments)
{
	//Initialize strError variable.
	var strError = ""
	
	if(strFullName == "")
	{
		strError += "Name\n"
	}
	
	if(strTelephone == "")
	{
		strError += "Telephone\n"
	}
	
	if(strEmail == "")
	{
		strError += "E-Mail\n"
	}
	
	if(intCategory == 0)
	{
		strError += "Category\n"
	}
	
	if(strGuestComments == "")
	{
		strError += "Comments\n"
	}
	
	if(strError == "")
	{
		return false;
	}
	else
	{
		strError1 = "You have missing required field(s).\nPlease fill in these field(s).\n\n"
		strError = strError1 + strError;
		alert(strError);
		return true
	}
}	

function SetCursor(strFullName, strTelephone, strEmail, intCategory, strGuestComments)
{
	//Set Cursor to the first missing field in the form.
	if(strFullName == "")
	{
		document.formfeedback.fullname.focus();
	}
	else if(strTelephone == "")
	{
		document.formfeedback.telephone.focus();
	}
	else if(strEmail == "")
	{
		document.formfeedback.email.focus();
	}
	else if(intCategory == 0)
	{
		document.formfeedback.category.focus();

	}	
	else if(strGuestComments == "")
	{
		document.formfeedback.guestcomments.focus();
	}
}
//-->