function validateCC(theForm) {
	if (theform.CreditCardSelect.selectedIndex == 0) {
		alert("Please select a credit card type.");
		theform.CreditCardSelect.focus();
		return (false);
	}
	 
	if (theform.ExpirationMonthSelect.selectedIndex == 0) {
		alert("Please select an expiration month.");
		theform.ExpirationMonthSelect.focus();
		return (false);
	}
	
	if (theform.ExpirationYearSelect.selectedIndex == 0) {
		alert("Please select an expiration year.");
		theform.ExpirationYearSelect.focus();
		return (false);
	}

	<!--- Credit Card Validation --->
	var ccstring = theform.CreditCardNumber.value; // set the cc string to some credit card number
	var invalid = 0;
	var p_ccstring = ""; // all non-number junk will be parsed out
	var running_total = 0;
	var temp;
	// go through ccstring and remove all non-numbers
	for (var i = 0; i < ccstring.length; i++) {
		temp = parseInt(ccstring.charAt(i));
		if (!(isNaN(temp))) p_ccstring = p_ccstring + temp; // string context
	}
	// go through LUHN formula
	// PASS 1
	for (i = p_ccstring.length - 2; i >= 0; i -= 2) {
		temp = parseInt(p_ccstring.charAt(i)) * 2;
		temp = temp + ""; // change number to string context for manipulation below
		if (temp.length == 2) running_total += parseInt(temp.charAt(0)) + parseInt(temp.charAt(1)) + 0;
		else running_total += parseInt(temp);
	}
	// PASS 2
	for (i = p_ccstring.length - 1; i >= 0; i -= 2) {
        running_total += parseInt(p_ccstring.charAt(i));
	}
	// now, run MOD 10 on running_total
	invalid = running_total % 10;
	if (running_total == 0)
        invalid = 1;
	if (ccstring == 0)
        invalid = 1;
	if (invalid) {
		alert("Please enter a valid credit card number."); // credit card is valid
		theform.CreditCardNumber.focus();
		return(false);
	}
	return (true);
}

function validateLogin(theForm) {
	if (theform.username__.value == "") {
		alert("Please enter a valid username.");
		theform.username__.focus();
		return (false);
	}
	if ((theform.password.value == "") && (theform.EmailPassword.checked == 0)) {
		alert("Please enter a valid password.");
		theform.password.focus();
		return (false);
	}
	return (true);
}
