
<!--
function handlegradfest(x)
{
	if (x)
	{
		if (document.forms[0].Pickup[0])
		{
//alert("Pickup!");
		//	document.forms[0].Pickup[1].checked = true;
		//	document.forms[0].Pickup[0].disabled = true;
		//	document.forms[0].Pickup[1].disabled = true;
		}
		else
		{
			alert("No pickup!");
		}
	}
	else
	{
	
	}
}

function img_act(imgName)
{
	if (document.images)
	{
		imgOn = eval(imgName + "on.src");
		document [imgName].src = imgOn;
	}
}

function img_inact(imgName)
{
	if (document.images)
	{
		imgOff = eval(imgName + "off.src");
		document [imgName].src = imgOff;
	}
}

function myBillingInfo()
{
	if (document.forms[0].CopyShipInfo.checked)
	{
		document.forms[0].BillFirstName.value = document.forms[0].ShipFirstName.value;
		document.forms[0].BillLastName.value = document.forms[0].ShipLastName.value;
		document.forms[0].BillOrganization.value = document.forms[0].ShipOrganization.value;
		document.forms[0].BillAddress1.value = document.forms[0].ShipAddress1.value;
		document.forms[0].BillAddress2.value = document.forms[0].ShipAddress2.value;
		document.forms[0].BillCity.value = document.forms[0].ShipCity.value;
		document.forms[0].BillZipCode.value = document.forms[0].ShipZipCode.value;
		document.forms[0].BillState.selectedIndex = document.forms[0].ShipState.selectedIndex;
	}
	else
	{
		document.forms[0].BillFirstName.value = "";
		document.forms[0].BillLastName.value = "";
		document.forms[0].BillOrganization.value = "";
		document.forms[0].BillAddress1.value = "";
		document.forms[0].BillAddress2.value = "";
		document.forms[0].BillCity.value = "";
		document.forms[0].BillZipCode.value = "";
		document.forms[0].BillState.selectedIndex = 0;
	}
}

function myShipStudentName()
{
	if (document.forms[0].CopyShipName.checked)
	{
		document.forms[0].ShipFirstName.value = document.forms[0].StudentFirstName.value;
		document.forms[0].ShipLastName.value = document.forms[0].StudentLastName.value;
	}
	else
	{
		document.forms[0].ShipFirstName.value = "";
		document.forms[0].ShipLastName.value = "";
	}
}

function fillDegree()
{
	if (document.forms[0].DegreeList.options[document.forms[0].DegreeList.selectedIndex].value != "Other")
	{
		document.forms[0].Degree.value = document.forms[0].DegreeList.options[document.forms[0].DegreeList.selectedIndex].text
	}
	else
	{
		document.forms[0].Degree.value = ""
	}
}

function fillMajor()
{
	if (document.forms[0].MajorList.options[document.forms[0].MajorList.selectedIndex].value != "Other")
	{
		document.forms[0].Major.value = document.forms[0].MajorList.options[document.forms[0].MajorList.selectedIndex].text
	}
	else
	{
		document.forms[0].Major.value = ""
	}
}
function fillAddDesc()
{
	if (document.forms[0].AddDescList.options[document.forms[0].AddDescList.selectedIndex].value != "Other")
	{
		document.forms[0].AddDesc.value = document.forms[0].AddDescList.options[document.forms[0].AddDescList.selectedIndex].text
	}
	else
	{
		document.forms[0].AddDesc.value = ""
	}
}

function changelabel()
{
	label1.style.fontFamily = 'Arial';
	label1.style.fontSize = '12px';
	label1.innerText = "Your information is being processed. Please wait for confirmation page. It may take up to 45 seconds for the confirmation page to display."
	label1.style.color = "#FF0000";
}

function NewWindow(mypage, myname, w, h, scroll)
{
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',noresize';
	win = window.open(mypage, myname, winprops);    
}

function PopupPic(sPicURL,title)
{
	window.open( "/popup.asp?"+sPicURL+"&title="+title, "", "resizable=1,scrollbars=yes,HEIGHT=200,WIDTH=200");
}

function PopupPic2(sPicURL1,sPicURL2,title)
{
	window.open( "/popup2.asp?"+"&pic1="+sPicURL1+"&pic2="+sPicURL2+"&title="+title, "", "resizable=1,scrollbars=yes,HEIGHT=200,WIDTH=200");
}

function PopupPic3(sPicURL1,sPicURL2,sPicURL3,title)
{
	window.open( "/popup3.asp?"+"&pic1="+sPicURL1+"&pic2="+sPicURL2+"&pic3="+sPicURL3+"&title="+title, "", "resizable=1,scrollbars=yes,HEIGHT=200,WIDTH=200");
}

function generatecgnumber(dgr,h,w,cid)
{
	var gown = "";
	var msg = "";
	var strDegree = dgr;
	var classID = cid;
	
	classID = classID.toLowerCase();
	
	switch (h)
	{
		case "4.8":
			gown += "XS"
			break
		case "4.10":
			gown += "XS"
			break
		case "5.1":
			if (w > 190)	{ gown += "1X"; }
			else		{ gown += "S"; }
			break
		case "5.4":
			if (w > 190)	{ gown += "1X"; }
			else		{ gown += "SM"; }
			break
		case "5.7":
			if (w > 250)	{ gown += "2X"; }
			else		{ gown += "M"; }
			break
		case "5.10":
			if (w > 250)	{ gown += "2X"; }
			else		{ gown += "ML"; }
			break
		case "6.1":
			if (w > 300)	{ gown += "3X"; }
			else		{ gown += "L"; }
			break
		case "6.4":
			if (w > 300)	{ gown += "3X"; }
			else		{ gown += "LXL"; }
			break
		case "6.7":
			if (w > 300)	{ gown += "3X"; }
			else		{ gown += "XL"; }
			break
		case "6.9":
			if (w > 300)	{ gown += "3X"; }
			else		{ gown += "XL"; }
			break
	}
	
	if (strDegree.indexOf("1") != -1)	{ gown += "BA"; }
	if (strDegree.indexOf("2") != -1)	{ gown += "BA"; }
	if (strDegree.indexOf("3") != -1)	{ gown += "MA"; }
	if (strDegree.indexOf("4") != -1)	{ gown += "MA"; }
	if (strDegree.indexOf("5") != -1)	{ gown += "DR"; }
	
	if ((classID.indexOf("lewis") != -1) || (classID.indexOf("north central") != -1))	{ gown += "H"; }
	else	{ gown += "V"; }

	msg += "degree: " + dgr + "\n";
	msg += "height: " + h + "\n";
	msg += "weight: " + w + "\n";
	msg += "classid: " + cid + "\n";
	msg += "gown: " + gown + "\n";

//	alert(msg);
	
	return gown;
}

function generateCGRentalNumber(dgr,h,w,cid)
{
	var rentalGown = "GOWN-";
	var msg = "";
	var strDegree = dgr;
	var classID = cid;
	
	switch (h)
	{
		case "4.8":
			rentalGown += "0";
			break
		case "4.10":
			rentalGown += "0";
			break
		case "5.1":
			rentalGown += "0";
			break
		case "5.4":
			rentalGown += "1";
			break
		case "5.7":
			rentalGown += "2";
			break
		case "5.10":
			rentalGown += "3";
			break
		case "6.1":
			rentalGown += "4";
			break
		case "6.4":
			rentalGown += "5";
			break
		case "6.7":
			rentalGown += "6";
			break
		case "6.9":
			rentalGown += "6";
			break
	}
	
	rentalGown += "-"
	
	if (strDegree.indexOf("1") != -1)	{ rentalGown += "BA"; }
	if (strDegree.indexOf("2") != -1)	{ rentalGown += "BA"; }
	if (strDegree.indexOf("3") != -1)	{ rentalGown += "MA"; }
	if (strDegree.indexOf("4") != -1)	{ rentalGown += "MA"; }
	if (strDegree.indexOf("5") != -1)	{ rentalGown += "DR"; }
	
	rentalGown += "-RENTAL";

	msg += "degree: " + dgr + "\n";
	msg += "height: " + h + "\n";
	msg += "weight: " + w + "\n";
	msg += "classid: " + cid + "\n";
	msg += "rentalGown: " + rentalGown + "\n";

//	alert(msg);
	
	return rentalGown;
}

function CollectCOANames()
{
	var coanames = new Array(8);
	var coacnt;
	var coaname = 1;
	var apppkgExists = false;

	// CHECK IF APPPKG EXISTS
	for (i=0;i<document.forms[0].length;i++)
	{
		 if (document.forms[0].elements[i].name == "apppkg" )	{ apppkgExists = true; }
	}

	coanames[0] = document.forms[0].coa1.value;
	coanames[1] = document.forms[0].coa2.value;
	coanames[2] = document.forms[0].coa3.value;
	coanames[3] = document.forms[0].coa4.value;

	for (coacnt = 0; coacnt < document.forms[0].coa.selectedIndex; coacnt++)
	{
		if (coanames[coacnt] != "")
		{
			eval("document.forms[0].Certificate" + coaname + ".value = '" + escape(coanames[coacnt]) + "'");
			coaname++;
		}
	}

	if (apppkgExists)
	{
		coanames[4] = document.forms[0].apppkgcoa1.value;
		coanames[5] = document.forms[0].apppkgcoa2.value;
		coanames[6] = document.forms[0].apppkgcoa3.value;
		coanames[7] = document.forms[0].apppkgcoa4.value;

		for (coacnt = 4; coacnt < (document.forms[0].apppkg.selectedIndex + 4); coacnt++)
		{
			if (coanames[coacnt] != "")
			{
				eval("document.forms[0].Certificate" + coaname + ".value = '" + escape(coanames[coacnt]) + "'");
				coaname++;
			}
		}
	}
	coaname--;

	if ((coaname < 4) && (document.forms[0].Certificate4.value != ""))
	{
		document.forms[0].Certificate4.value = "";
	}
	if ((coaname < 3) && ((document.forms[0].Certificate3.value != "") || (document.forms[0].Certificate4.value != "")))
	{
		document.forms[0].Certificate3.value = "";
		document.forms[0].Certificate4.value = "";
	}
	if ((coaname < 2) && ((document.forms[0].Certificate2.value != "") || (document.forms[0].Certificate3.value != "") || (document.forms[0].Certificate4.value != "")))
	{
		document.forms[0].Certificate2.value = "";
		document.forms[0].Certificate3.value = "";
		document.forms[0].Certificate4.value = "";
	}
	if ((coaname < 1) && ((document.forms[0].Certificate1.value != "") || (document.forms[0].Certificate2.value != "") || (document.forms[0].Certificate3.value != "") || (document.forms[0].Certificate4.value != "")))
	{
		document.forms[0].Certificate1.value = "";
		document.forms[0].Certificate2.value = "";
		document.forms[0].Certificate3.value = "";
		document.forms[0].Certificate4.value = "";
	}

		document.forms[0].Certificate1.value = unescape(document.forms[0].Certificate1.value);
		document.forms[0].Certificate2.value = unescape(document.forms[0].Certificate2.value);
		document.forms[0].Certificate3.value = unescape(document.forms[0].Certificate3.value);
		document.forms[0].Certificate4.value = unescape(document.forms[0].Certificate4.value)

// BUILD TEST MESSAGE
	var msgcoa = "";

	msgcoa += "Index1: " + document.forms[0].coa.selectedIndex + "\n"
	if (apppkgExists)
	{
		msgcoa += "Index2: " + document.forms[0].apppkg.selectedIndex + "\n"
	}
	msgcoa += "Lenght: " + coanames.length + "\n";
	msgcoa += "COA1: " + coanames[0] + "\n";
	msgcoa += "COA2: " + coanames[1] + "\n";
	msgcoa += "COA3: " + coanames[2] + "\n";
	msgcoa += "COA4: " + coanames[3] + "\n";
	if (apppkgExists)
	{
		msgcoa += "COA5: " + coanames[4] + "\n";
		msgcoa += "COA6: " + coanames[5] + "\n";
		msgcoa += "COA7: " + coanames[6] + "\n";
		msgcoa += "COA8: " + coanames[7] + "\n";
	}
	msgcoa += "Certificate1: " + document.forms[0].Certificate1.value + "\n";
	msgcoa += "Certificate2: " + document.forms[0].Certificate2.value + "\n";
	msgcoa += "Certificate3: " + document.forms[0].Certificate3.value + "\n";
	msgcoa += "Certificate4: " + document.forms[0].Certificate4.value + "\n";
	
	return msgcoa;

}

/*************************/
/* START PRODUCT SECTION */
/*************************/
function FreeShipping(n,STATUS,SUBTOTAL,PROMOCODE)
{
	if ((SUBTOTAL > 0) && (PROMOCODE == 1))
	{
		eval("document.forms[0].Product" + n + "Number.value = \"SHIPPING_PROMOTION\";")
		eval("document.forms[0].Product" + n + "Description.value = \"Promotional Discount - Free Shipping\";")
		eval("document.forms[0].Product" + n + "Qty.value = 1;")
		eval("document.forms[0].Product" + n + "UnitPrice.value = 0;")
	

		if (STATUS == 1)
		{
			n += 1;
			
			eval("document.forms[0].Product" + n + "Number.value = \"TOTEBAG\";")
			eval("document.forms[0].Product" + n + "Description.value = \"Traditions Congratulations Tote Bag - FREE\";")
			eval("document.forms[0].Product" + n + "Qty.value = 1;")
			eval("document.forms[0].Product" + n + "UnitPrice.value = 0;")
		}
	}
	else
	{
		eval("document.forms[0].Product" + n + "Number.value = \"\";")
		eval("document.forms[0].Product" + n + "Description.value = \"\";")
		eval("document.forms[0].Product" + n + "Qty.value = \"\";")
		eval("document.forms[0].Product" + n + "UnitPrice.value = \"\";")
		
		if (STATUS == 1)
		{
			n += 1;
	
			eval("document.forms[0].Product" + n + "Number.value = \"\";")
			eval("document.forms[0].Product" + n + "Description.value = \"\";")
			eval("document.forms[0].Product" + n + "Qty.value = \"\";")
			eval("document.forms[0].Product" + n + "UnitPrice.value = \"\";")
		}
	}
}

function FreeToteBag(n,SUBTOTAL,PROMOCODE)
{
	if ((SUBTOTAL > 0) && (PROMOCODE == 2))
	{
		eval("document.forms[0].Product" + n + "Number.value = \"TOTEBAG\";")
		eval("document.forms[0].Product" + n + "Description.value = \"Traditions Congratulations Tote Bag - FREE\";")
		eval("document.forms[0].Product" + n + "Qty.value = 1;")
		eval("document.forms[0].Product" + n + "UnitPrice.value = 0;")
	}
	else
	{
		eval("document.forms[0].Product" + n + "Number.value = \"\";")
		eval("document.forms[0].Product" + n + "Description.value = \"\";")
		eval("document.forms[0].Product" + n + "Qty.value = \"\";")
		eval("document.forms[0].Product" + n + "UnitPrice.value = \"\";")
	}
}
/***********************/
/* END PRODUCT SECTION */
/***********************/

/****************************/
/* START VALIDATION SECTION */
/****************************/

function validateShippingInfo()
{
	var msgShip = "";
	
//SHIPPING INFO
	if (document.main.ShipFirstName.value == "")
	{
		msgShip += "Please enter FIRST NAME in shipping information.\n";
	}
	if (document.main.ShipLastName.value == "")
	{
		msgShip += "Please enter LAST NAME in shipping information.\n";
	}
	if (!document.main.CopyShipName.checked)
	{
		if (document.main.StudentFirstName.value == "")
		{
			msgShip += "Please enter STUDENT FIRST NAME in shipping information.\n";
		}
		if (document.main.StudentLastName.value == "")
		{
			msgShip += "Please enter STUDENT LAST NAME in shipping information.\n";
		}
	}
	if (document.main.ShipAddress1.value == "")
	{
		msgShip += "Please enter ADDRESS in shipping information.\n";
	}
	if (document.main.ShipCity.value == "")
	{
		msgShip += "Please enter CITY in shipping information.\n";
	}
	if (document.main.ShipState.selectedIndex == 0)
	{
		msgShip += "Please select STATE in shipping information.\n";
	}
	if (document.main.ShipZipCode.value == "")
	{
		msgShip += "Please enter ZIP CODE in shipping information.\n";
	}

	var strPhone = document.main.ShipPhone.value
	if ((document.main.ShipPhone.value == "") || (strPhone.length != 10))
	{
		msgShip += "Please enter PHONE NUMBER as a 10 digit number (1234567890).\n";
	}

	var strEmail = document.main.ShipEmail.value
	if ((document.main.ShipEmail.value == "") || (strEmail.indexOf("@",0) == -1))
	{
		msgShip += "Please enter a valid EMAIL ADDRESS in shipping information.\n";
	}
	
	return (msgShip);
// END OF SHIPPING INFO
}

function validateBillingInfo()
{
	var msgBill = "";

// CHECK BILLING INFO
	if (document.main.BillFirstName.value == "")
	{
		msgBill += "Please enter FIRST NAME in billing information.\n";
	}
	if (document.main.BillLastName.value == "")
	{
		msgBill += "Please enter LAST NAME in billing information.\n";
	}
var strAdrBill = document.main.BillAddress1.value
	strAdrBill = strAdrBill.toLowerCase(strAdrBill)
var strPOBoxBill = 0;
	if ((strAdrBill.indexOf("po box") != -1) || (strAdrBill.indexOf("p.o box") != -1) || (strAdrBill.indexOf("p.o. box") != -1) || (strAdrBill.indexOf("pobox") != -1) || (strAdrBill.indexOf("p.o.box") != -1) || (strAdrBill.indexOf("p.obox") != -1) || (strAdrBill.indexOf("po.box") != -1) || (strAdrBill.indexOf("po. box") != -1) || (strAdrBill.indexOf("p o box") != -1))
	{
		strPOBoxBill = 1;
	}
	if (document.main.BillAddress1.value == "")
	{
		msgBill += "Please enter ADDRESS in billing information.\n";
	}
//	if ((document.main.BillAddress1.value != "") && (strPOBoxBill == 1))
//	{
//		msgBill += "Please enter a VALID ADDRESS (NOT A P.O. BOX).\n";
//	}
	if (document.main.BillCity.value == "")
	{
		msgBill += "Please enter CITY in billing information.\n";
	}
	if (document.main.BillState.selectedIndex == 0)
	{
		msgBill += "Please select STATE in billing information.\n";
	}
	if (document.main.BillZipCode.value == "")
	{
		msgBill += "Please enter ZIP CODE in billing information.\n";
	}

	return (msgBill);

//	END OF BILLING INFO
}

function validatePaymentInfo()
{
	var msgCC = "";

// PAYMENT INFO
	if ((!document.main.CCard[0].checked) && (!document.main.CCard[1].checked) && (!document.main.CCard[2].checked) && (!document.main.CCard[3].checked))
	{
		msgCC += "Please select CREDIT CARD TYPE.\n";
	}
var strCCardNo = document.main.CCardNumber.value
	if ((document.main.CCard[0].checked) && !((strCCardNo.length == 13) || (strCCardNo.length == 16)))
	{
		msgCC += "Please enter a valid CREDIT CARD NUMBER using digits only (1234123412341234).\n";
	}
	if ((document.main.CCard[1].checked) && !(strCCardNo.length == 16))
	{
		msgCC += "Please enter a valid CREDIT CARD NUMBER using digits only (1234123412341234).\n";
	}
	if ((document.main.CCard[2].checked) && !(strCCardNo.length == 16))
	{
		msgCC += "Please enter a valid CREDIT CARD NUMBER using digits only (1234123412341234).\n";
	}
	if ((document.main.CCard[3].checked) && !(strCCardNo.length == 15))
	{
		msgCC += "Please enter a valid CREDIT CARD NUMBER using digits only (1234123412341234).\n";
	}
	if ((document.main.ExpDateM.value == "") || (document.main.ExpDateM.value > 12) || (document.main.ExpDateM.value < 0))
	{
		msgCC += "Please enter a valid EXPIRATION MONTH (01-12).\n";
	}
	if ((document.main.ExpDateY.value == "") || (document.main.ExpDateY.value > 99))
	{
		msgCC += "Please enter a valid EXPIRATION YEAR.\n";
	}
	if (document.main.CCardName.value == "")
	{
		msgCC += "Please enter CARD HOLDER'S NAME.\n";
	}

	return (msgCC);
	
// END OF PAYMENT INFO
}

/**************************/
/* END VALIDATION SECTION */
/**************************/

//-->