

<!--
function checkForm(form) {
	var error = 0;
	var errorMsg = "";
	var retMsg = "";
	var stateReg = "(^(ACT|NSW|NT|QLD|SA|TAS|VIC|WA|Outside Australia)\$)";
	
	retMsg = isFieldValid(form.Name.value,"Name",1,80,"text");

	if (retMsg.indexOf('invalid') >= 0)	{
			errorMsg += "The <b>Name</b> field only accepts alphabetical characters.<br/><br/>";
	} else {
		if (retMsg.indexOf('mandatory') >= 0)	{
				errorMsg += "Your <b>Name</b> needs to be provided so we know who to contact.<br/><br/>";
		}
	}

	retMsg = isFieldValid(form.Email.value,"Email",1,80,"email");

	if (retMsg.indexOf('valid') >= 0)	{
			errorMsg += "Please type in a valid email address in the <b>Email</b> field. This should be in the format name@domain.com.au or similar.<br/><br/>";
	} else {
		if (retMsg.indexOf('mandatory') >= 0)	{
				errorMsg += "Your <b>Email</b> address needs to be provided so we can contact you.<br/><br/>";
		}
	}

	retMsg = isFieldValid(form.Phone.value,"Phone",10,20,"alphaNum");

	if ((retMsg.indexOf('invalid') >= 0) || (retMsg.indexOf('length') >= 0))	{
			errorMsg += "Your <b>Phone</b> needs to be provided so that we can contact you to discuss your Private Wealth needs. Please include your relevant state or international dialing codes so we may contact you appropriately.  The phone number field can contain 20 characters (including spaces)<br/><br/>";
	} else {
		if (retMsg.indexOf('mandatory') >= 0)	{
				errorMsg += "Your <b>Phone</b> number needs to be provided so we can contact you. <br/><br/>";
		}
	}

	retMsg = isFieldValid(getSelectedOptionValue(form.State),"State",2,17,"custom",stateReg);

	if (retMsg.indexOf('valid') >= 0)	{
			errorMsg += "Please select an option from the <b>State</b> drop down box.<br/><br/>";
	} else {
		if (retMsg.indexOf('mandatory') >= 0)	{
				errorMsg += "Please select an option from the <b>State</b> drop down box.<br/><br/>";
		}
	}

	return errorMsg;
}

function CheckForm410(form) {
	var errorMsg = checkForm(form);
	var reEnterMsg = "Please resubmit the relevant information.<br/><br/>";
	if (isEmpty(errorMsg)) {
			form.RequestedInfo.value = getMoreInfoOptions(form) ;
			form.submit();
	} else {
		popup = window.open("","qantas_card","width=400,height=400,toolbar=0,location=0,directories=0,status=0,menuBar=0,scrollBars=1,resizable=1");
		popup.document.write("<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'><html><head>");
		popup.document.write("<link rel='stylesheet' href='/css/National/GlobalStyle.css' type='text/css'></head>");
		popup.document.write("<title>Contact a Private Wealth adviser</title>");
		popup.document.write("<body>");
		popup.document.write("<h3>Unfortunately there were some problems in submitting your information</h3>");
		popup.document.write(errorMsg);
		popup.document.write("<br>");
		popup.document.write(reEnterMsg);
		popup.document.write("<center><form><input type=button value=Close onClick=javascript:window.close();></center></form>");
		popup.document.write("</body>");
		popup.document.write("</html>");
		popup.document.close();
		return false;
	}
}

function getMoreInfoOptions(form) {
	var moreInfoString = "";

	if (form.WealthPlanning.checked) {
		moreInfoString = moreInfoString + "Wealth Planning";
	}

	if (form.RelationshipBanking.checked) {
		moreInfoString = moreInfoString + ", Relationship Banking";
	}

	if (form.InvestmentAdvisory.checked) {
		moreInfoString = moreInfoString + ", Investment Advisory";
	}

	if (form.CapitalMarkets.checked) {
		moreInfoString = moreInfoString + ", Capital Markets";
	}

	if (form.RiskManagement.checked) {
		moreInfoString = moreInfoString + ", Risk Management";
	}

	if (form.AssetServices.checked) {
		moreInfoString = moreInfoString + ", Asset Services";
	}

	if (form.CrossBorderSolutions.checked) {
		moreInfoString = moreInfoString + ", Cross-Border Solutions";
	}

	if (form.TrustsPhilanthropy.checked) {
		moreInfoString = moreInfoString + ", Trusts & Philanthropy";
	}

	return moreInfoString;
}
//-->
