var orderform;
var itemname;
var itemnumber;
var itemdescription;
var itemcost;

function initializeForm()
{
	if (document.paypal)
	{
		
		orderform = document.paypal;
		
		if (orderform.itemname)
		{
			if (orderform.itemname.value)
			{
				itemname = orderform.itemname.value;
				itemcost = orderform.amount.value;
				updateForm();
				updateFormPlus();
			}
		}
	}
}

function additionalItemChecks(strOptionValue)
{
	if (itemname == "Ttime T-shirt")
	{
		if (strOptionValue == "White")
		{
			orderform.amount.value = "19.00";
			itemcost = orderform.amount.value;
			orderform.os1.value = "White";

		}
		if (strOptionValue == "Black")
		{
			orderform.amount.value = "21.00";
			itemcost = orderform.amount.value;
			orderform.os1.value= "Black";

		}
		if (strOptionValue == "Olive")
		{
			orderform.amount.value = "21.00";
			itemcost = orderform.amount.value;
			orderform.os1.value= "Olive";

		}

		if (strOptionValue == "Navy Blue")
		{
			orderform.amount.value = "21.00";
			itemcost = orderform.amount.value;
			orderform.os1.value= "Navy Blue";

		}
		if (strOptionValue == "Asphalt")
		{
			orderform.amount.value = "21.00";
			itemcost = orderform.amount.value;
			orderform.os1.value= "Asphalt";

		}
		if (strOptionValue == "Plum")
		{
			orderform.amount.value = "24.00";
			itemcost = orderform.amount.value;
			orderform.os1.value= "Plum";

		}
		/*if (strOptionValue == "Pink")
		{
			orderform.amount.value = "24.00";
			itemcost = orderform.amount.value;
			orderform.os1.value= "Pink";

		}*/
		if (strOptionValue == "Chartreuse")
		{
			orderform.amount.value = "24.00";
			itemcost = orderform.amount.value;
			orderform.os1.value= "Chartreuse";

		}
		if (strOptionValue == "Turquoise")
		{
			orderform.amount.value = "24.00";
			itemcost = orderform.amount.value;
			orderform.os1.value= "Turquoise";

		}
		if (strOptionValue == "Periwinkle")
		{
			orderform.amount.value = "24.00";
			itemcost = orderform.amount.value;
			orderform.os1.value= "Periwinkle";

		}
		if (strOptionValue == "XL-White")
		{
			orderform.amount.value = "21.00";
			itemcost = orderform.amount.value;
			orderform.os1.value = "White";

		}
		if (strOptionValue == "XL-Black")
		{
			orderform.amount.value = "23.00";
			itemcost = orderform.amount.value;
			orderform.os1.value= "Black";

		}
		if (strOptionValue == "XL-Navy Blue")
		{
			orderform.amount.value = "23.00";
			itemcost = orderform.amount.value;
			orderform.os1.value= "Navy Blue";

		}
		if (strOptionValue == "XL-Asphalt")
		{
			orderform.amount.value = "23.00";
			itemcost = orderform.amount.value;
			orderform.os1.value= "Asphalt";

		}
		if (strOptionValue == "XL-Plum")
		{
			orderform.amount.value = "26.00";
			itemcost = orderform.amount.value;
			orderform.os1.value= "Plum";

		}
		/*if (strOptionValue == "XL-Pink")
		{
			orderform.amount.value = "26.00";
			itemcost = orderform.amount.value;
			orderform.os1.value= "Pink";

		}*/
		if (strOptionValue == "XL-Chartreuse")
		{
			orderform.amount.value = "26.00";
			itemcost = orderform.amount.value;
			orderform.os1.value= "Chartreuse";

		}
	orderform.item_number.value = itemnumber;
	}
}

function updateForm()
{
	itemcost = orderform.amount.value;
	itemnumber = itemname;

		if (orderform.option1.value.length > 0)
		{
			additionalItemChecks(orderform.option1.value);
		}

}

function updateFormPlus()
{
	itemcost = orderform.amount.value;
	itemnumber = itemname;

		if (orderform.color2.value.length > 0)
		{
			additionalItemChecks(orderform.color2.value);
		}

}

function setOptions(chosen) {
var selbox = document.paypal.os1;

selbox.options.length = 0;
if (chosen == " ") {
selbox.options[selbox.options.length] = new Option('Please select a size first.',' ');

}
if (chosen == "Small") {
selbox.options[selbox.options.length] = new Option('White ($19)','White');
selbox.options[selbox.options.length] = new Option('Black  ($21)','Black');
selbox.options[selbox.options.length] = new Option('Navy Blue  ($21)','Navy Blue');
selbox.options[selbox.options.length] = new Option('Plum  ($24)','Plum');
//selbox.options[selbox.options.length] = new Option('Pink  ($24)','Pink');
selbox.options[selbox.options.length] = new Option('Periwinkle ($24)','Periwinkle');
selbox.options[selbox.options.length] = new Option('Turquoise ($24)','Turquoise');
selbox.options[selbox.options.length] = new Option('Olive  ($21)','Olive');

}
if (chosen == "Medium") {
selbox.options[selbox.options.length] = new Option('White ($19)','White');
selbox.options[selbox.options.length] = new Option('Black  ($21)','Black');
selbox.options[selbox.options.length] = new Option('Navy Blue  ($21)','Navy Blue');
selbox.options[selbox.options.length] = new Option('Plum  ($24)','Plum');
//selbox.options[selbox.options.length] = new Option('Pink  ($24)','Pink');
selbox.options[selbox.options.length] = new Option('Periwinkle ($24)','Periwinkle');
selbox.options[selbox.options.length] = new Option('Turquoise ($24)','Turquoise');
selbox.options[selbox.options.length] = new Option('Olive  ($21)','Olive');

}
if (chosen == "Large") {
selbox.options[selbox.options.length] = new Option('White ($19)','White');
selbox.options[selbox.options.length] = new Option('Asphalt  ($21)','Asphalt');
selbox.options[selbox.options.length] = new Option('Black  ($21)','Black');
selbox.options[selbox.options.length] = new Option('Navy Blue  ($21)','Navy Blue');
selbox.options[selbox.options.length] = new Option('Plum  ($24)','Plum');
//selbox.options[selbox.options.length] = new Option('Pink  ($24)','Pink');
selbox.options[selbox.options.length] = new Option('Periwinkle ($24)','Periwinkle');
selbox.options[selbox.options.length] = new Option('Turquoise ($24)','Turquoise');
selbox.options[selbox.options.length] = new Option('Olive  ($21)','Olive');

}
if (chosen == "Xtra Large") {
selbox.options[selbox.options.length] = new Option('White ($19)','White');
//selbox.options[selbox.options.length] = new Option('Asphalt  ($21)','Asphalt');
selbox.options[selbox.options.length] = new Option('Black  ($21)','Black');
selbox.options[selbox.options.length] = new Option('Navy Blue  ($21)','Navy Blue');
selbox.options[selbox.options.length] = new Option('Plum  ($24)','Plum');
//selbox.options[selbox.options.length] = new Option('Pink  ($24)','Pink');
selbox.options[selbox.options.length] = new Option('Turquoise ($24)','Turquoise');
selbox.options[selbox.options.length] = new Option('Olive  ($21)','Olive');

}
if (chosen == "Large (w/ Long Padding)") {
selbox.options[selbox.options.length] = new Option('White ($19)','White');
selbox.options[selbox.options.length] = new Option('Asphalt  ($21)','Asphalt');
selbox.options[selbox.options.length] = new Option('Black  ($21)','Black');
selbox.options[selbox.options.length] = new Option('Navy Blue  ($21)','Navy Blue');
selbox.options[selbox.options.length] = new Option('Plum  ($24)','Plum');
//selbox.options[selbox.options.length] = new Option('Pink  ($24)','Pink');
selbox.options[selbox.options.length] = new Option('Periwinkle ($24)','Periwinkle');
selbox.options[selbox.options.length] = new Option('Turquoise ($24)','Turquoise');
selbox.options[selbox.options.length] = new Option('Olive  ($21)','Olive');

}
if (chosen == "Xtra Large (w/ Long Padding)") {
selbox.options[selbox.options.length] = new Option('White ($19)','White');
//selbox.options[selbox.options.length] = new Option('Asphalt  ($21)','Asphalt');
selbox.options[selbox.options.length] = new Option('Black  ($21)','Black');
selbox.options[selbox.options.length] = new Option('Navy Blue  ($21)','Navy Blue');
selbox.options[selbox.options.length] = new Option('Plum  ($24)','Plum');
//selbox.options[selbox.options.length] = new Option('Pink  ($24)','Pink');
selbox.options[selbox.options.length] = new Option('Turquoise ($24)','Turquoise');
selbox.options[selbox.options.length] = new Option('Olive  ($21)','Olive');

}
}

