function validateuserdata1() {
	var valid = true, output = '';
	var x = document.ccform.cardNumber.value;
	var anum=/(^\d+$)|(^\d+\.\d+$)/;
	
	if (anum.test(x)){
			valid = true;
		}
		else{
			if (window.document.ccform.payment_interval[2].checked == ''){
				valid = false;
				output += 'Please enter a valid credit card number\n';
			}
    	}
	
	if (window.document.ccform.name.value.length == 0) {
        valid = false;
        output += 'Please enter your first name\n';
	
	}
	if (window.document.ccform.lname.value.length == 0) {
        valid = false;
        output += 'Please enter your last name\n';
	
	}
	if (window.document.ccform.address.value.length == 0) {
        valid = false;
        output += 'Please enter your address\n';
	
	}
	if (window.document.ccform.city.value.length == 0) {
        valid = false;
        output += 'Please enter your city\n';
	
	}
	if (window.document.ccform.zip.value.length == 0) {
        valid = false;
        output += 'Please enter your ZIP code\n';
	
	}
	if (window.document.ccform.dayphone.value.length == 0) {
        valid = false;
        output += 'Please enter your daytime telephone number\n';
	}
	
	if (window.document.ccform.evening_phone.value.length == 0) {
        valid = false;
        output += 'Please enter your evening telephone number\n';
	}
	
	if (window.document.ccform.billing_name.value.length == 0) {
        valid = false;
        output += 'Please enter your billing first name\n';
	}
	if (window.document.ccform.billing_lname.value.length == 0) {
        valid = false;
        output += 'Please enter your billing last name\n';
	}
	
	if (window.document.ccform.billing_address.value.length == 0) {
        valid = false;
        output += 'Please enter your billing address\n';
	}
	
	if (window.document.ccform.billing_city.value.length == 0) {
        valid = false;
        output += 'Please enter your billing city\n';
	}	

	if (window.document.ccform.billing_zip.value.length == 0) {
        valid = false;
        output += 'Please enter your billing ZIP code\n';
	}
	
	if (document.ccform.subscription_type[0].checked == '' && document.ccform.subscription_type[1].checked == '' && document.ccform.subscription_type[2].checked == '' && document.ccform.subscription_type[3].checked == '' && document.ccform.subscription_type[4].checked == '' && document.ccform.subscription_type[5].checked == '' && document.ccform.subscription_type[6].checked == '' && document.ccform.subscription_type[7].checked == '' && document.ccform.subscription_type[8].checked == '' && document.ccform.subscription_type[9].checked == '' && document.ccform.subscription_type[10].checked == '' && document.ccform.subscription_type[11].checked == '') {
		valid = false;
		output += 'Please select your subscription type\n';
	}
	
	//if (document.ccform.free_gift[0].checked == '' && document.ccform.free_gift[1].checked == '' && document.ccform.free_gift[2].checked == '' && document.ccform.free_gift[3].checked == '') {
		//valid = false;
		//output += 'Please select your free gift\n';
	//}
	
	if (window.document.ccform.agree.checked == "0") {
		valid = false;
		output += 'Please Read the Terms of Use and check the box\n';
	}	
	
	if (window.document.ccform.payment_interval[2].checked == ''){
		if (window.document.ccform.cardMonth.value.length == 0) {
			valid = false;
			output += 'Please select the month your card expires\n';
		
		}
	
		if (window.document.ccform.cardYear.value.length == 0) {
			valid = false;
			output += 'Please select the year your card expires\n';
			
		}
		
		if (window.document.ccform.cardNumber.value.length == 0) {
			valid = false;
			output += 'Please enter a credit card number\n';
			}
			
		if (window.document.ccform.cardNumber.value.length <= 15) {
			valid = false;
			output += 'Please use a sixteen digit credit card number';
			}
	}
	
	if (!valid){
        alert(output);
		return false;
		}

	
}


function validateuserdata2() {
var valid = true, output = '';
var x = document.ccform.cardNumber.value;
var anum=/(^\d+$)|(^\d+\.\d+$)/;
	
	if (anum.test(x)){
			valid = true;
		}
		else{
			valid = false;
			output += 'Please enter a valid credit card number\n';
    	}

	if (window.document.ccform.name.value.length == 0) {
        valid = false;
        output += 'Please enter your first name\n';
	
	}
	if (window.document.ccform.lname.value.length == 0) {
        valid = false;
        output += 'Please enter your last name\n';
	
	}
	if (window.document.ccform.address.value.length == 0) {
        valid = false;
        output += 'Please enter your address\n';
	
	}
	if (window.document.ccform.city.value.length == 0) {
        valid = false;
        output += 'Please enter your city\n';
	
	}
	if (window.document.ccform.zip.value.length == 0) {
        valid = false;
        output += 'Please enter your ZIP code\n';
	
	}
	if (window.document.ccform.dayphone.value.length == 0) {
        valid = false;
        output += 'Please enter your daytime telephone number\n';
	}
	
	if (window.document.ccform.evening_phone.value.length == 0) {
        valid = false;
        output += 'Please enter your evening telephone number\n';
	}
		
	if (document.ccform.agree.checked == "0") {
		valid = false;
		output += 'Please Read the Terms of Use and check the box\n';
	}

	if (window.document.ccform.cardMonth.value.length == 0) {
        valid = false;
		output += 'Please select the month your card expires\n';
	
    }

	if (window.document.ccform.cardYear.value.length == 0) {
        valid = false;
		output += 'Please select the year your card expires\n';
		
    }
	
    if (window.document.ccform.cardNumber.value.length == 0) {
        valid = false;
		output += 'Please enter a credit card number\n';
		}
		
	if (window.document.ccform.cardNumber.value.length <= 15) {
		valid = false;
		output += 'Please use a sixteen digit credit card number';
		}
	
	if (!valid){
        alert(output);
		return false;
		}
}


function validateuserdata3() {
	var valid = true, output = '';
	
	if (document.ccform.billing_name.value.length == 0) {
        valid = false;
        output += 'Please enter your billing first name\n';
	}
	if (document.ccform.billing_lname.value.length == 0) {
        valid = false;
        output += 'Please enter your billing last name\n';
	}
	
	if (document.ccform.billing_address.value.length == 0) {
        valid = false;
        output += 'Please enter your billing address\n';
	}
	
	if (document.ccform.billing_city.value.length == 0) {
        valid = false;
        output += 'Please enter your billing city\n';
	}
	
	if (document.ccform.billing_state.value.length == 0) {
        valid = false;
        output += 'Please enter your billing state\n';
	}
	
	if (document.ccform.billing_zip.value.length == 0) {
        valid = false;
        output += 'Please enter your billing ZIP code\n';
	}
	
	//if (document.ccform.subscription_type.checked == '') {
		//valid = false;
		//output += 'Please select your subscription type\n';
	//}
	
	if (document.ccform.email.value.length == 0) {
        valid = false;
        output += 'Please enter your email address\n';
	}else{
		//EMail validation
		var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
		var check=/@[\w\-]+\./;
		var checkend=/\.[a-zA-Z]{2,4}$/;
	
		if(((document.ccform.email.value.search(exclude) != -1)||(document.ccform.email.value.search(check)) == -1)||(document.ccform.email.value.search(checkend) == -1)){
			valid = false;
        	output += 'That does not appear to be a valid email address! Please enter your email address again\n';
		}
		}
	
	if (document.ccform.email.value != document.ccform.xemail.value) {
        valid = false;
        output += 'Your email addresses do not match\n';
	}
	
	if (document.ccform.pw.value.length == 0) {
        valid = false;
        output += 'Please enter a password\n';
	}
	
	if (document.ccform.pw.value != document.ccform.xpw.value) {
        valid = false;
        output += 'Your passwords do not match\n';
	}
	
	if (document.ccform.payment_interval.checked == '') {
		valid = false;
		output += 'Please select your payment interval\n';
	}
	
	
	
	if (document.ccform.cardNumber.value.length == 0) {
        valid = false;
		output += 'Please enter your credit card number\n';	
    }else{		
		var x = document.ccform.cardNumber.value;
		var anum=/(^\d+$)|(^\d+\.\d+$)/;
		
		if (anum.test(x)){
				valid = true;
			}
			else{
				valid = false;
				output += 'Please enter a valid credit card number\n';
			}	
	if (x.substring(0,1) == 3){
	 	valid = false;
		output += 'Sorry but we currently do not accept American Express\n';	
	}}

	if (document.ccform.cardMonth.value.length == 0) {
        valid = false;
		output += 'Please select the month your card expires\n';	
    }

	if (document.ccform.cardYear.value.length == 0) {
        valid = false;
		output += 'Please select the year your card expires\n';		
    }
	
	if (document.ccform.cardCSV.value.length == 0) {
        valid = false;
		output += 'Please enter your credit card verification number\n';		
    }
	
	if (document.ccform.agree.checked == "0") {
		valid = false;
		output += 'Please Read the Terms of Use and check the box\n';
	}
				
	if (!valid){
        alert(output);
		return false;
		}

	
}

function validateuserdataD() {
	var valid = true, output = '';
	
	if (window.document.ccform.billing_name.value.length == 0) {
        valid = false;
        output += 'Please enter your billing first name\n';
	}
	if (window.document.ccform.billing_lname.value.length == 0) {
        valid = false;
        output += 'Please enter your billing last name\n';
	}
	
	if (window.document.ccform.billing_address.value.length == 0) {
        valid = false;
        output += 'Please enter your billing address\n';
	}
	
	if (window.document.ccform.billing_city.value.length == 0) {
        valid = false;
        output += 'Please enter your billing city\n';
	}
	
	if (window.document.ccform.billing_state.value.length == 0) {
        valid = false;
        output += 'Please enter your billing state\n';
	}
	
	if (window.document.ccform.billing_zip.value.length == 0) {
        valid = false;
        output += 'Please enter your billing ZIP code\n';
	}
	
	if (document.ccform.subscription_type.checked == '') {
		valid = false;
		output += 'Please select your subscription type\n';
	}
	
	if (window.document.ccform.email.value.length == 0) {
        valid = false;
        output += 'Please enter your email address\n';
	}else{
		//EMail validation
		var exclude=/[^@\-\.\w]|^[_@\.\-]|[\._\-]{2}|[@\.]{2}|(@)[^@]*\1/;
		var check=/@[\w\-]+\./;
		var checkend=/\.[a-zA-Z]{2,4}$/;
	
		if(((window.document.ccform.email.value.search(exclude) != -1)||(window.document.ccform.email.value.search(check)) == -1)||(window.document.ccform.email.value.search(checkend) == -1)){
			valid = false;
        	output += 'That does not appear to be a valid email address! Please enter your email address again\n';
		}
		}
	
	if (window.document.ccform.email.value != window.document.ccform.xemail.value) {
        valid = false;
        output += 'Your email addresses do not match\n';
	}
	
	if (window.document.ccform.pw.value.length == 0) {
        valid = false;
        output += 'Please enter a password\n';
	}
	
	if (window.document.ccform.pw.value != window.document.ccform.xpw.value) {
        valid = false;
        output += 'Your passwords do not match\n';
	}
				
	if (!valid){
        alert(output);
		return false;
		}	
}

function validateuserdata4() {
	var valid = true, output = '';
	if (window.document.ccform.name.value.length == 0) {
        valid = false;
        output += 'Please enter your first name\n';
	}
	if (window.document.ccform.lname.value.length == 0) {
        valid = false;
        output += 'Please enter your last name\n';
	}
	
	if (window.document.ccform.address.value.length == 0) {
        valid = false;
        output += 'Please enter your address\n';
	}
	if (window.document.ccform.dayphone.value.length == 0) {
        valid = false;
        output += 'Please enter your daytime telephone number\n';
	}	
	if (window.document.ccform.city.value.length == 0) {
        valid = false;
        output += 'Please enter your city\n';
	}
	if (window.document.ccform.zip.value.length == 0) {
        valid = false;
        output += 'Please enter your ZIP code\n';
	}	
	if (!valid){
        alert(output);
		return false;
		}	
}


function validateuserdataCI() {
	var valid = true, output = '';
	var anum=/(^\d+$)|(^\d+\.\d+$)/;
	if (window.document.ccform.na.value.length == 0) {
        valid = false;
        output += 'Please enter your first name\n';
	}
	if (window.document.ccform.lna.value.length == 0) {
        valid = false;
        output += 'Please enter your last name\n';
	}
	
	if (window.document.ccform.ad.value.length == 0) {
        valid = false;
        output += 'Please enter your address\n';
	}
	
	if (window.document.ccform.ci.value.length == 0) {
        valid = false;
        output += 'Please enter your city\n';
	}
	
	if (window.document.ccform.zi.value.length == 0) {
        valid = false;
        output += 'Please enter your zip code\n';
	}
	
	if (window.document.ccform.ph.value.length == 0) {
        valid = false;
        output += 'Please enter your phone number\n';
	}
	
	//if (window.document.ccform.em.value.length == 0) {
        //valid = false;
        //output += 'Please enter your email address\n';
	//}
	
	if (window.document.ccform.de.value == 'none') {
        valid = false;
        output += 'Please select you area of delivery interest\n';
	}
	
	if (window.document.ccform.cj.value.length == 0) {
        valid = false;
        output += 'Please enter your current job\n';
	}
	
	if (window.document.ccform.cs.value.length == 0) {
        valid = false;
        output += 'Please enter your current work schedule\n';
	}
	
	if (!valid){
        alert(output);
		return false;
		}

	
}


function copy(address){

var name = document.ccform.name.value;
var lname = document.ccform.lname.value;
var address = document.ccform.address.value;
var city = document.ccform.city.value;
var zip = document.ccform.zip.value;

document.ccform.billing_name.value = name;
document.ccform.billing_lname.value = lname;
document.ccform.billing_address.value = address;
document.ccform.billing_city.value = city;
document.ccform.billing_zip.value = zip;

}

function openpopup1(){
var popurl="terms.htm"
winpops = window.open(popurl,"","scrollbars=yes,toolbar=no,width=400,height=400")
}

function openpopup2(){
var popurl="subscription_options.asp"
winpops = window.open(popurl,"","scrollbars=yes,toolbar=no,width=400,height=600")
}

var checkflag = "false";
function check(field) {
	if (checkflag == "false") {
		for (i = 0; i < field.length; i++) {
			field[i].checked = true;}
			checkflag = "true";
			return "Uncheck All To Print"; }
		else {
			for (i = 0; i < field.length; i++) {
			field[i].checked = false; }
			checkflag = "false";
			return "Check All To Print"; }
	}

