<!--
function checkWholeForm(theForm) {
    var why = "";
    why += checkFullName(theForm.fullName.value);
    why += notEmpty(theForm.postalAddress.value,"* No postal address entered.\n");
    why += checkEmail(theForm.email.value);
    why += notEmpty(theForm.phone.value,"* No telephone number entered.\n");
    why += checkPayment(theForm);
    if (theForm.totalDollars.value == 0) {
    	why += "* No magazine subscription selected.\n";
    }
    if (why != "") {
    	why = "The following problems were detected:\n\n" + why;
    	why += "\n\nPlease correct these and try again\n";
       alert(why);
       return false;
    }
return true;
};
function checkPayment (strng) {
	var paymentSelected=false, error="", missingCardInfo="";
	for (var i = 0; i < strng.paymentType.length; i++) {
		if(strng.paymentType[i].checked == true) {
			paymentSelected=true;
		}
	}
	if (!paymentSelected) {
		error="* No form of payment was selected.\n";
	}
	else if (strng.paymentType[strng.paymentType.length-1].checked != true) {
		if (strng.cardNumber.value == "") {missingCardInfo="number";}
		else if (strng.cardName.value == "") {missingCardInfo="holder's name";}
		else if (strng.expMonth.selectedIndex == 0) {missingCardInfo="expiry month";}
		else if (strng.expYear.selectedIndex == 0) {missingCardInfo="expiry year";}
		if (missingCardInfo != "") {
			error="* You have elected to pay by credit card, but the credit card "+missingCardInfo+" was not provided.\n";
		}
	}
	return error;
}
function checkFullName (strng,firstORlast) {
 var error = "";
 if (strng == "") {
 	error = "* No full name entered.\n"
 }
 var illegalChars = /[\d\\\/\!\.@#\$%\^\&\*\(\)]/;
 if (illegalChars.test(strng)) {
 	error = "* The entered full name contains numbers or non-valid special characters (?).\n";
 }
 return error;
};
function notEmpty (strng,error) {
 if (strng == "") {
 	return error;
 }
 else {
 	return '';
 }
};
function checkEmail (strng) {
 var error = "";
 var emailFilter=/^.+@.+\..{2,3}$/;
 var illegalChars= /[\(\)\<\>\,\;\:\\\/\"\[\]]/;
 if (strng == "") {
    error = "* No email address entered.\n";
 }
 else if (!(emailFilter.test(strng))) { 
        error = "* Invalid email address entered.\n";
 }
 else if (strng.match(illegalChars)) {
    error = "* The email address contains illegal characters.\n";
 }
 return error;
};
function update(subType) {
	if (subType == 'ADPAUNZ24') {
		document.getElementById('adpBought').innerHTML='AU or NZ: 24 months, 12 editions';
		document.pay.adpDollars.value='165';
	}
	if (subType == 'ADPAUNZ12') {
		document.getElementById('adpBought').innerHTML='AU or NZ: 12 months, 6 editions';
		document.pay.adpDollars.value='99';
	}
	if (subType == 'ADPINT24') {
		document.getElementById('adpBought').innerHTML='INTERNATIONAL: 24 months, 12 editions';
		document.pay.adpDollars.value='440';
	}
	if (subType == 'ADPINT12') {
		document.getElementById('adpBought').innerHTML='INTERNATIONAL: 12 months, 6 editions';
		document.pay.adpDollars.value='220';
	}
	if (subType == 'AUXAUNZ24') {
		document.getElementById('auxBought').innerHTML='AU or NZ: 24 months, 12 editions';
		document.pay.auxDollars.value='38';
	}
	if (subType == 'AUXAUNZ12') {
		document.getElementById('auxBought').innerHTML='AU or NZ: 12 months, 6 editions';
		document.pay.auxDollars.value='22';
	}
	if (subType == 'AUXINT12') {
		document.getElementById('auxBought').innerHTML='INTERNATIONAL: 12 months, 6 editions';
		document.pay.auxDollars.value='38';
	}
	calcTotal();
}
function clearRadio(mag) {
	if(mag == 'ADP') {
		for (var i = 0; i < document.pay.adpSubType.length; i++) {
          document.pay.adpSubType[i].checked = false;
	     }
		document.getElementById('adpBought').innerHTML='not selected. Select above.';
		document.pay.adpDollars.value='0';
	}
	if(mag == 'AUX') {
		for (var i = 0; i < document.pay.auxSubType.length; i++) {
          document.pay.auxSubType[i].checked = false;
	     }
		document.getElementById('auxBought').innerHTML='not selected. Select above.';
		document.pay.auxDollars.value='0';
	}
	calcTotal();
}
function calcTotal() {
	document.pay.totalDollars.value=parseInt(document.pay.adpDollars.value)+parseInt(document.pay.auxDollars.value);
}
function noChange() {
	alert("This value is automatically calculated by selecting your subscription above.  Please do not manually modify it.");
	clearRadio("ADP"); clearRadio("AUX");
}
-->
