
<script language="JavaScript" type="text/javascript">
<!--
var submitbutton = "";
function formvalid(obj){
	with(obj){
		msg = "";
		if(submitbutton == "Cancel"){
			return true;
		}
		if(!rerun_validation(obj)) return false;
		<cfif listfindnocase("current/print/web",variables.currenttabs) GT 0>
			if(!fieldChecked(type) && !subscriber_number.value){
				msg = msg + 'A type of subscription or subscriber number is required.\n';
			}
		<cfelseif listfindnocase("print/web,web/print,print,web",variables.tabname) GT 0>
			if(!fieldChecked(type)){
				msg = msg + 'A type of subscription is required.\n';
			}
		<cfelseif listfindnocase("contact",variables.tabname) GT 0>
			if(!first_name.value){
				msg = msg + 'An entry in the "First Name" field is required.\n';
			}
			if(!last_name.value){
				msg = msg + 'An entry in the "Last Name" field is required.\n';
			}
			if(!email.value){
				msg = msg + 'An entry in the "Email" field is required.\n';
			}			
		<cfelseif listfindnocase("mailing",variables.tabname) GT 0>
			if(!first_name.value){
				msg = msg + 'An entry in the "First Name" field is required.\n';
			}
			if(!last_name.value){
				msg = msg + 'An entry in the "Last Name" field is required.\n';
			}
			<cfif request.thispage NEQ "gift">
			if(!email.value){
				msg = msg + 'An entry in the "Email" field is required.\n';
			}
			</cfif>
			if(!address1.value){
				msg = msg + 'An entry in the "Address" field is required.\n';
			}			
			if(!city.value){
				msg = msg + 'An entry in the "City" field is required.\n';
			}			
			if(state.selectedIndex <= 0){
				msg = msg + 'An entry in the "State/Province" field is required.\n';
			}			
			if(!zip.value){
				msg = msg + 'An entry in the "Zip/Postal Code" field is required.\n';
			}			
		<cfelseif listfindnocase("login",variables.tabname) GT 0>
			if(!username.value){
				msg = msg + 'An entry in the "Username" field is required.\n';
			}
			if(!password.value){
				msg = msg + 'An entry in the "Password" field is required.\n';
			}
			if(!confirm_password.value){
				msg = msg + 'An entry in the "Confirm Password" field is required.\n';
			}			
			if(password.value != confirm_password.value){
				msg = msg + 'The password and password confirmations are not equal.\n';
			}
		<cfelseif listfindnocase("billing",variables.tabname) GT 0>
			if(!bill_first_name.value){
				msg = msg + 'An entry in the "Billing First Name" field is required.\n';
			}
			if(!bill_last_name.value){
				msg = msg + 'An entry in the "Billing Last Name" field is required.\n';
			}
			if(!bill_address1.value){
				msg = msg + 'An entry in the "Billing Street" field is required.\n';
			}
			if(!bill_city.value){
				msg = msg + 'An entry in the "Billing City" field is required.\n';
			}
			if(bill_state.selectedIndex <= 0){
				msg = msg + 'An entry in the "Billing State" field is required.\n';
			}
			if(!bill_zip.value){
				msg = msg + 'An entry in the "Billing Zip" field is required.\n';
			}
			if(cc_type.selectedIndex <= 0){
				msg = msg + 'An entry in the "Credit Card Type" field is required.\n';
			}
			if(!ccnumber.value){
				msg = msg + 'An entry in the "Credit Card Number" field is required.\n';
			}
			if(ccmonth.selectedIndex <= 0 || ccyear.selectedIndex <= 0){
				msg = msg + 'An entry in the "Credit Card Expiration Date" field is required.\n';
			}
		</cfif>

		if(msg != ""){
			alert(msg);
			return false;
		}
		else {
			return true;
		}
	}
}
function ph(obj,e,which){
	if(obj.value.length==3 && e.keyCode != 9 && e.keyCode != 16){
		obj.form.elements["phone"+which].focus()
	}
}
//-->
</script>
