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 ConfirmCancel(){
	var tempconfirm;
	tempconfirm = confirm("Are you sure you want to cancel this order?")
	if(tempconfirm){ return true; }
	else { return false; }
}

function SetValue() {
	document.ProcessForm.TrackingNumber.value = document.TrackingForm.Tracking.value;
}

function validateLogin(theForm) {
	if (theForm.email__.value == "") {
		alert("Please enter your email address.");
		theForm.email__.focus();
		return false;
	}

	if (theForm.password__.value == "" && theForm.sendpassword.checked == 0) {
		alert("Please enter a valid password.");
		theForm.password__.focus();
		return false;
	}
	return true;
}
function clear_field(element) {
    val = element.value
    if (val=="Enter Keyword / Part # Here") {
        element.value="";
    }
}
function unclear_field(element) {
    val = element.value;
    if (val=="") {
        element.value="Enter Keyword / Part # Here";
    }
}
$(document).ready(function () {   
    // Automatically Position Cursor on the Search
    $('#SearchField').focus();
    $('#ShopByBrand').change(function(event) {
        var selectedVehicleId = $('#ShopByBrand').val();        
        var url = "/Manufacturer.cfm?ManufacturerId=" + selectedVehicleId;
        window.location.href=(url);
    });
    sbv_loadyears();
});
