<!--
function submitForm()
{
var objSubmitForm = document.frmEmail;
if ( validateForm(objSubmitForm) )
	{
	objSubmitForm.submit();
	}
}

function validateForm(form)
{
var intCounter;
var blnSelected;
var objInput1;
var objInput2;
//-------------------------------------
// First Name
//-------------------------------------
objInput1 = form.First_Name002;
if ( processTextBox(objInput1, "First Name") == false ) return false;
//-------------------------------------
// Last Name
//-------------------------------------
objInput1 = form.Last_Name003;
if ( processTextBox(objInput1, "Last Name") == false ) return false;
//-------------------------------------
// Address
//-------------------------------------
objInput1 = form.Address004;
if ( processTextBox(objInput1, "Address") == false ) return false;
//-------------------------------------
// No. of weeks
//-------------------------------------
//objInput1 = form.Number_of_Weeks_015
//if ( processTextBox(objInput1, "Number of Weeks") == false ) return false
//-------------------------------------
// Start date
//-------------------------------------
//objInput1 = form.Earliest_Start_Date016
//if ( processTextBox(objInput1, "Start Date") == false ) return false
//-------------------------------------
// End Date
//-------------------------------------
//objInput1 = form.Latest_End_Date017
//if ( processTextBox(objInput1, "End Date") == false ) return false
//-------------------------------------
// Email (in Shortlist Email to a Friend
//-------------------------------------
objInput1 = form.Email001;
if (objInput1 != undefined) {
	var intFail = 0;
	var objEmail = new String(objInput1.value);
	var intLen = objEmail.length;
	// Test Length
	if (intLen >= 10) // xx@yyy.zzz
		{
		// Test @ exists and position
		var strSearch = /@/i;
		var intFoundPos = objEmail.search(strSearch);
		var intMaxPos = intLen - 7;
		if (intFoundPos >= 2 && intFoundPos < intMaxPos)
			{
			// test . exists and position
			strSearch = /./i;
			intFoundPos = objEmail.search(strSearch);
			if (intFoundPos != -1)
				{
				// OK
				}
			else
				{
				intFail = 1;
				}
			}
		else
			{
			intFail = 1;
			}
		}
	else
		{
		intFail = 1;
		}

	if ( intFail == 1)
		{
		alert("Please input a valid email address.");
		objInput1.focus();
		objInput1.select();
		return false;
		}
	//-------------------------------------
}
return true;
}


function processTextBox(objTextBox, strDescription)
{
if (objTextBox != undefined) {
	if ( Trim(objTextBox.value) == "" )
		{
		alert("Please input your " + strDescription + ". This is required to process your order.");
		objTextBox.focus();
		objTextBox.select();
		return false;
		}
}
return true
}


function processCombo(objCombo, intStart)
{
var intCounter;
var blnSelected;
blnSelected = 0;
for (intCounter = intStart; intCounter < objCombo.options.length; intCounter++)
	{
	if (objCombo.options[intCounter].selected)
		{
		blnSelected = 1;
		}
	}
return blnSelected;
}

function Trim(sString) 
{
	while (sString.substring(0,1) == ' ')
	{
	sString = sString.substring(1, sString.length);
	}
	while (sString.substring(sString.length-1, sString.length) == ' ')
	{
	sString = sString.substring(0,sString.length-1);
	}
	return sString;
}
// -->
