
function isValidProduct1String(strProduct)
{
	return strProduct=="4hourbasic-online"  || strProduct=="8hour-online" || strProduct=="firsttimedriver-online" || strProduct=="maturedriverprogram";
}
//================================================================================
function isValidProduct2String(strProduct)
{
	return strProduct=="4hourbasic-video" || strProduct=="4hourbasic-cdrom" || strProduct=="4hourbasic-livecomedy" || strProduct=="firsttimedriver-cdrom"
}
//================================================================================
function runPaymentPattern1(strProduct)
{
	if(!isValidProduct1String(strProduct))
	{
		alert("Error: strProduct is not a valid product string: " + strProduct);
		return;
	}
	
	payWithCreditCardOrCheck(strProduct,1);

}
//================================================================================
function runPaymentPattern2(strProduct)
{
	if(!isValidProduct2String(strProduct))
	{
		alert("Error: strProduct is not a valid product string: " + strProduct);
		return;
	}
	
	payWithCreditCardOrCheck(strProduct,2);
}
//================================================================================
function payWithCreditCardOrCheck(strProduct, intPaymentPattern)
{
	if(intPaymentPattern != 1 && intPaymentPattern !=2)
	{
		alert("Error : intPaymentPattern must be 1 or 2");
		return;
	}

	var strURL = "payByCreditCardOrCheck.asp";
	strURL += "?product=" + strProduct;
	strURL += "&paymentPattern=" + intPaymentPattern;
	//var newWindow = window.open(strURL ,null,"height=150,width=300,status=no,toolbar=no,menubar=no,location=no");	
	//newWindow.focus();
	window.location = strURL;
}