function validateJoinForm(theForm) {

if (theForm.cFirstName.value==""){
alert("Please enter your first name.");
theForm.cFirstName.focus();
return(false);
}
if (theForm.cLastName.value==""){
alert("Please enter your surname.");
theForm.cLastName.focus();
return(false);
}

Ctrl = theForm.cEmailAddress;
if (theForm.cEmailAddress.value==""){
alert("Please enter your email address.");
theForm.cEmailAddress.focus();
return(false);
}
else if (Ctrl.value==" " || Ctrl.value.indexOf ('@',0) == -1)
{
alert("Please enter a valid email address.");
theForm.cEmailAddress.focus();
return(false);
}
else if (Ctrl.value==" " || Ctrl.value.indexOf ('.',0) == -1){
alert("Please enter a valid email address.");
theForm.cEmailAddress.focus();
return(false);
}
if (theForm.cPassword.value == "")
{	alert("Please enter a password.");
	theForm.cPassword.focus();
	return (false);	}
if (theForm.cPassword.value != theForm.cPasswordConfirm.value)
{	alert("whoops! Please re-confirm your password.");
	theForm.cPasswordConfirm.focus();
	return (false);	}

if (theForm.cAddress.value==""){
alert("Please enter your address.");
theForm.cAddress.focus();
return(false);
}
if (theForm.cSuburb.value==""){
alert("Please enter your city.");
theForm.cSuburb.focus();
return(false);
}

if (theForm.cState.value==""){
alert("Please enter your state.");
theForm.cState.focus();
return(false);
}
if (theForm.cPostcode.value==""){
alert("Please enter your postcode.");
theForm.cPostcode.focus();
return(false);
}

if (theForm.cTelephone.value=="" | theForm.cTelephone.value=="(  )"){
alert("Please enter your phone number, include your areacode.");
theForm.cTelephone.focus();
return(false);
}


	if (theForm.rName.value==""){
	alert("Please enter the recipients name.");
	theForm.rName.focus();
	return(false);
	}
	if (theForm.rAddress1.value==""){
	alert("Please enter the delivery address.");
	theForm.rAddress1.focus();
	return(false);
	}
	if (theForm.rCity.value==""){
	alert("Please enter the delivery suburb/city.");
	theForm.rCity.focus();
	return(false);
	}
	if (theForm.rState.value==""){
	alert("Please enter the delivery state.");
	theForm.rState.focus();
	return(false);
	}
	if (theForm.rPostcode.value==""){
	alert("Please enter the delivery postocde.");
	theForm.rPostcode.focus();
	return(false);
	}


if (theForm.agreeTerms.checked==false) {
	alert("Please indicate that you have read the terms & conditions.");
	theForm.agreeTerms.focus();
	return(false);
}

return(true);
} 

function validateAccountForm(theForm) {

if (theForm.cFirstName.value==""){
alert("Please enter your first name.");
theForm.cFirstName.focus();
return(false);
}
if (theForm.cLastName.value==""){
alert("Please enter your surname.");
theForm.cLastName.focus();
return(false);
}

Ctrl = theForm.cEmailAddress;
if (theForm.cEmailAddress.value==""){
alert("Please enter your email address.");
theForm.cEmailAddress.focus();
return(false);
}
else if (Ctrl.value==" " || Ctrl.value.indexOf ('@',0) == -1)
{
alert("Please enter a valid email address.");
theForm.cEmailAddress.focus();
return(false);
}
else if (Ctrl.value==" " || Ctrl.value.indexOf ('.',0) == -1){
alert("Please enter a valid email address.");
theForm.cEmailAddress.focus();
return(false);
}
if (theForm.cPassword.value == "")
{	alert("Please enter a password.");
	theForm.cPassword.focus();
	return (false);	}
if (theForm.cPassword.value != theForm.cPasswordConfirm.value)
{	alert("whoops! Please re-confirm your password.");
	theForm.cPasswordConfirm.focus();
	return (false);	}

if (theForm.cAddress.value==""){
alert("Please enter your address.");
theForm.cAddress.focus();
return(false);
}
if (theForm.cSuburb.value==""){
alert("Please enter your city.");
theForm.cSuburb.focus();
return(false);
}

if (theForm.cState.value==""){
alert("Please enter your state.");
theForm.cState.focus();
return(false);
}
if (theForm.cPostcode.value==""){
alert("Please enter your postcode.");
theForm.cPostcode.focus();
return(false);
}

if (theForm.cTelephone.value=="" | theForm.cTelephone.value=="(  )"){
alert("Please enter your phone number, include your areacode.");
theForm.cTelephone.focus();
return(false);
}



return(true);
} 


function copyFields() 
{	if (document.frmAdmin.sameBilling.checked == true) {
		document.frmAdmin.rName.value = document.frmAdmin.cFirstName.value+" "+document.frmAdmin.cLastName.value
		document.frmAdmin.rAddress1.value = document.frmAdmin.cAddress.value
		document.frmAdmin.rCity.value = document.frmAdmin.cSuburb.value
		document.frmAdmin.rState.value = document.frmAdmin.cState.value
		document.frmAdmin.rPostcode.value = document.frmAdmin.cPostcode.value
	} 
	
	if (document.frmAdmin.sameBilling.checked == false) {
		document.frmAdmin.rName.value = ""
		document.frmAdmin.rCompany.value = ""
		document.frmAdmin.rAddress1.value = ""
		document.frmAdmin.rCity.value = ""
		document.frmAdmin.rState.value = ""
		document.frmAdmin.rPostcode.value = ""

	} 
}