var PCPC = []; //ProductCategoryPrintingCharges global array
var category = [];
var categoryPrintType = [];
var printType = [];
var printTypeDescription = [];
var description = [];
var descriptionPrice = [];

var price = []; //Plastic Pad Print array
descriptionPrice = [];
description = [];
printTypeDescription = [];
printType = [];
categoryPrintType = [];
category = [];
price[0] = "Minimum";
price[1] = 50;
descriptionPrice[0] = price;
price = [];
price[0] = 500;
price[1] = 50;
descriptionPrice[1] = price;
price = [];
price[0] = 10000;
price[1] = 0.12;
descriptionPrice[2] = price;
price = [];
price[0] = Infinity;
price[1] = 0.11;
descriptionPrice[3] = price;
description[0] = "Print";
description[1] = descriptionPrice;
printTypeDescription[0] = description;
price = []; //Plastic Pad Setup array
descriptionPrice = [];
description = [];
price[0] = 500;
price[1] = 50;
descriptionPrice[0] = price;
price = [];
price[0] = 10000;
price[1] = 50;
descriptionPrice[1] = price;
price = [];
price[0] = Infinity;
price[1] = 50;
descriptionPrice[2] = price;
description[0] = "Setup";
description[1] = descriptionPrice;
printTypeDescription[1] = description;
price = []; //Plastic Pad Repeat Setup array
descriptionPrice = [];
description = [];
price[0] = 500;
price[1] = 20;
descriptionPrice[0] = price;
price = [];
price[0] = 10000;
price[1] = 20;
descriptionPrice[1] = price;
price = [];
price[0] = Infinity;
price[1] = 20;
descriptionPrice[2] = price;
description[0] = "Repeat Setup";
description[1] = descriptionPrice;
printTypeDescription[2] = description;
printType[0] = "Pad";
printType[1] = printTypeDescription;
categoryPrintType[0] = printType;
price = []; //Plastic Screen Print array
descriptionPrice = [];
description = [];
printTypeDescription = [];
printType = [];
price[0] = "Minimum";
price[1] = 90;
descriptionPrice[0] = price;
price = [];
price[0] = 500;
price[1] = 90;
descriptionPrice[1] = price;
price = [];
price[0] = 10000;
price[1] = 0.17;
descriptionPrice[2] = price;
price = [];
price[0] = Infinity;
price[1] = 0.15;
descriptionPrice[3] = price;
description[0] = "Print";
description[1] = descriptionPrice;
printTypeDescription[0] = description;
price = []; //Plastic Screen Setup array
descriptionPrice = [];
description = [];
price[0] = 500;
price[1] = 85;
descriptionPrice[0] = price;
price = [];
price[0] = 10000;
price[1] = 85;
descriptionPrice[1] = price;
price = [];
price[0] = Infinity;
price[1] = 85;
descriptionPrice[2] = price;
description[0] = "Setup";
description[1] = descriptionPrice;
printTypeDescription[1] = description;
price = []; //Plastic Screen Repeat Setup array
descriptionPrice = [];
description = [];
price[0] = 500;
price[1] = 50;
descriptionPrice[0] = price;
price = [];
price[0] = 10000;
price[1] = 50;
descriptionPrice[1] = price;
price = [];
price[0] = Infinity;
price[1] = 50;
descriptionPrice[2] = price;
description[0] = "Repeat Setup";
description[1] = descriptionPrice;
printTypeDescription[2] = description;
printType[0] = "Screen";
printType[1] = printTypeDescription;
categoryPrintType[1] = printType;
category[0] = "1";
category[1] = categoryPrintType;
PCPC[0] = category;

price = []; //Metal Pad Print array
descriptionPrice = [];
description = [];
printTypeDescription = [];
printType = [];
categoryPrintType = [];
category = [];
price[0] = "Minimum";
price[1] = 90;
descriptionPrice[0] = price;
price = [];
price[0] = 250;
price[1] = 90;
descriptionPrice[1] = price;
price = [];
price[0] = 500;
price[1] = 0.18;
descriptionPrice[2] = price;
price = [];
price[0] = 1000;
price[1] = 0.16;
descriptionPrice[3] = price;
price = [];
price[0] = Infinity;
price[1] = 0.15;
descriptionPrice[4] = price;
description[0] = "Print";
description[1] = descriptionPrice;
printTypeDescription[0] = description;
price = []; //Metal Pad Setup array
descriptionPrice = [];
description = [];
price[0] = 250;
price[1] = 50;
descriptionPrice[0] = price;
price = [];
price[0] = 500;
price[1] = 50;
descriptionPrice[1] = price;
price = [];
price[0] = 1000;
price[1] = 50;
descriptionPrice[2] = price;
price = [];
price[0] = Infinity;
price[1] = 50;
descriptionPrice[3] = price;
description[0] = "Setup";
description[1] = descriptionPrice;
printTypeDescription[1] = description;
price = []; //Metal Pad Repeat Setup array
descriptionPrice = [];
description = [];
price[0] = 250;
price[1] = 20;
descriptionPrice[0] = price;
price = [];
price[0] = 500;
price[1] = 20;
descriptionPrice[1] = price;
price = [];
price[0] = 1000;
price[1] = 20;
descriptionPrice[2] = price;
price = [];
price[0] = Infinity;
price[1] = 20;
descriptionPrice[3] = price;
description[0] = "Repeat Setup";
description[1] = descriptionPrice;
printTypeDescription[2] = description;
printType[0] = "Pad";
printType[1] = printTypeDescription;
categoryPrintType[0] = printType;
price = []; //Metal Screen Print array
descriptionPrice = [];
description = [];
printTypeDescription = [];
printType = [];
price[0] = "Minimum";
price[1] = 120;
descriptionPrice[0] = price;
price = [];
price[0] = 250;
price[1] = 120;
descriptionPrice[1] = price;
price = [];
price[0] = 500;
price[1] = 0.40;
descriptionPrice[2] = price;
price = [];
price[0] = 1000;
price[1] = 0.32;
descriptionPrice[3] = price;
price = [];
price[0] = Infinity;
price[1] = 0.24;
descriptionPrice[4] = price;
description[0] = "Print";
description[1] = descriptionPrice;
printTypeDescription[0] = description;
price = []; //Metal Screen Setup array
descriptionPrice = [];
description = [];
price[0] = 250;
price[1] = 85;
descriptionPrice[0] = price;
price = [];
price[0] = 500;
price[1] = 85;
descriptionPrice[1] = price;
price = [];
price[0] = 1000;
price[1] = 85;
descriptionPrice[2] = price;
price = [];
price[0] = Infinity;
price[1] = 85;
descriptionPrice[3] = price;
description[0] = "Setup";
description[1] = descriptionPrice;
printTypeDescription[1] = description;
price = []; //Metal Screen Repeat Setup array
descriptionPrice = [];
description = [];
price[0] = 250;
price[1] = 50;
descriptionPrice[0] = price;
price = [];
price[0] = 500;
price[1] = 50;
descriptionPrice[1] = price;
price = [];
price[0] = 1000;
price[1] = 50;
descriptionPrice[2] = price;
price = [];
price[0] = Infinity;
price[1] = 50;
descriptionPrice[3] = price;
description[0] = "Repeat Setup";
description[1] = descriptionPrice;
printTypeDescription[2] = description;
printType[0] = "Screen";
printType[1] = printTypeDescription;
categoryPrintType[1] = printType;

price = []; //Laser Engraving  Text Only Print array
descriptionPrice = [];
description = [];
printTypeDescription = [];
printType = [];
price[0] = "Minimum";
price[1] = 60;
descriptionPrice[0] = price;
price = [];
price[0] = 50;
price[1] = 60;
descriptionPrice[1] = price;
price = [];
price[0] = 250;
price[1] = 0.90;
descriptionPrice[2] = price;
price = [];
price[0] = 500;
price[1] = 0.60;
descriptionPrice[3] = price;
price = [];
price[0] = 1000;
price[1] = 0.50;
descriptionPrice[4] = price;
price = [];
price[0] = 5000;
price[1] = 0.45;
descriptionPrice[5] = price;
price = [];
price[0] = Infinity;
price[1] = "POA";
descriptionPrice[6] = price;
description[0] = "Print Text Only";
description[1] = descriptionPrice;
printTypeDescription[0] = description;
price = []; //Laser  Engraving Text & Logo Print array
descriptionPrice = [];
description = [];
price[0] = "Minimum";
price[1] = 70;
descriptionPrice[0] = price;
price = [];
price[0] = 50;
price[1] = 70;
descriptionPrice[1] = price;
price = [];
price[0] = 250;
price[1] = 1.15;
descriptionPrice[2] = price;
price = [];
price[0] = 500;
price[1] = 0.85;
descriptionPrice[3] = price;
price = [];
price[0] = 1000;
price[1] = 0.55;
descriptionPrice[4] = price;
price = [];
price[0] = 5000;
price[1] = 0.40;
descriptionPrice[5] = price;
price = [];
price[0] = Infinity;
price[1] = "POA";
descriptionPrice[6] = price;
description[0] = "Print Text & Logo";
description[1] = descriptionPrice;
printTypeDescription[1] = description;
price = []; //Laser Engraving Setup array
descriptionPrice = [];
description = [];
price[0] = 50;
price[1] = 50;
descriptionPrice[0] = price;
price = [];
price[0] = 250;
price[1] = 50;
descriptionPrice[1] = price;
price = [];
price[0] = 500;
price[1] = 50;
descriptionPrice[2] = price;
price = [];
price[0] = 1000;
price[1] = 50;
descriptionPrice[3] = price;
price = [];
price[0] = 5000;
price[1] = 50;
descriptionPrice[4] = price;
price = [];
price[0] = Infinity;
price[1] = "POA";
descriptionPrice[5] = price;
description[0] = "Setup";
description[1] = descriptionPrice;
printTypeDescription[2] = description;
price = []; //Laser Engraving Repeat Setup array
descriptionPrice = [];
description = [];
price[0] = 50;
price[1] = 20;
descriptionPrice[0] = price;
price = [];
price[0] = 250;
price[1] = 20;
descriptionPrice[1] = price;
price = [];
price[0] = 500;
price[1] = 20;
descriptionPrice[2] = price;
price = [];
price[0] = 1000;
price[1] = 20;
descriptionPrice[3] = price;
price = [];
price[0] = 5000;
price[1] = 20;
descriptionPrice[4] = price;
price = [];
price[0] = Infinity;
price[1] = "POA";
descriptionPrice[5] = price;
description[0] = "Repeat Setup";
description[1] = descriptionPrice;
printTypeDescription[3] = description;
printType[0] = "Laser";
printType[1] = printTypeDescription;
categoryPrintType[2] = printType;
category[0] = "2";
category[1] = categoryPrintType;
PCPC[1] = category;

function getProductListModuleIDPrefix()
{
	var prefix = "dnn_ctr428_";
	var element = "1";
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element);
	if (colour == null)
	{
		prefix = "dnn_ctr432_";
		colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element);
	}
	else
	{
		return prefix;
	}
	if (colour == null)
	{
		prefix = "dnn_ctr436_";
		colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element);
	}
	else
	{
		return prefix;
	}
	if (colour == null)
	{
		prefix = "dnn_ctr437_";
		colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element);
	}
	else
	{
		return prefix;
	}
	if (colour == null)
	{
		prefix = "dnn_ctr438_";
		colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element);
	}
	else
	{
		return prefix;
	}
	if (colour == null)
	{
		prefix = "dnn_ctr439_";
		colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element);
	}
	else
	{
		return prefix;
	}
	if (colour == null)
	{
		prefix = "dnn_ctr440_";
		colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element);
	}
	else
	{
		return prefix;
	}
	if (colour == null)
	{
		prefix = "dnn_ctr441_";
		colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element);
	}
	else
	{
		return prefix;
	}
	if (colour == null)
	{
		prefix = "dnn_ctr495_";
		colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element);
	}
	else
	{
		return prefix;
	}
	if (colour == null)
	{
		prefix = "dnn_ctr512_";
		colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element);
	}
	else
	{
		return prefix;
	}
	if (colour == null)
	{
		prefix = "dnn_ctr513_";
		colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element);
	}
	else
	{
		return prefix;
	}
	if (colour == null)
	{
		prefix = "dnn_ctr514_";
		colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element);
	}
	return prefix;
}

function calculateTotal(element) {
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour"+element);
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave"+element);
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty"+element);
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup"+element);
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty"+element);
	var txtTotal = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtTotal"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtTotal"+element);
	var categoryID = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfCategoryID"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfCategoryID");
	var price1 = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfAttacheSalesPrice1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfAttacheSalesPrice1");
	var price2 = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfAttacheSalesPrice2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfAttacheSalesPrice2");
	var price3 = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfAttacheSalesPrice3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfAttacheSalesPrice3");
	var price4 = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfAttacheSalesPrice4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfAttacheSalesPrice4");
	var unitCost = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfUnitCost"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfUnitCost"+element);
	var hiddenTotal = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfTotal"+element] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfTotal"+element);
	var total = "";
	var printedTotal = "";
	var categoryArray, categoryPrintTypeArray, printTypeArray, printTypeDescriptionArray, descriptionArray, descriptionPriceArray, priceArray;
	var numberOfColours;
	
	if ((colour.options[colour.selectedIndex].value != "-1") || (colourEngrave.options[colourEngrave.selectedIndex].value != "-1") || (positionQty.options[positionQty.selectedIndex].value != "-1") || (setup.options[setup.selectedIndex].value != "-1") || (txtQty.value != ""))
	{
		txtTotal.value = total;
		unitCost.value = 0;
		total = 0;
		printedTotal = 0;
		if (colour.options[colour.selectedIndex].value != "-1")
		{
			if (colourEngrave.options[colourEngrave.selectedIndex].value != "-1")
			{
				if ((positionQty.options[positionQty.selectedIndex].value != "-1") || (colourEngrave.options[colourEngrave.selectedIndex].value == "Unprinted"))
				{
					if (colourEngrave.options[colourEngrave.selectedIndex].value == "Unprinted")
					{
						positionQty.selectedIndex = 0;
						positionQty.disabled = true;
						setup.selectedIndex = 0;
						setup.disabled = true;
					}
					else
					{
						positionQty.disabled = false;
						setup.disabled = false;
						//setup.selectedIndex = 1;
					}
					if ((setup.options[setup.selectedIndex].value != "-1") || (colourEngrave.options[colourEngrave.selectedIndex].value == "Unprinted"))
					{
						if ((txtQty.value != "") && (txtQty.value > 0))
						{
							categoryArray = PCPC[0];
							//Plastic pens
							if (categoryArray[0] == categoryID.value)
							{
								//Unprinted plastic pens
								if (txtQty.value <= 500)
								{
									total = (txtQty.value * price1.value).toFixed(2);
									printedTotal = total;
								}
								else if (txtQty.value <= 2500)
								{
									total = (txtQty.value * price2.value).toFixed(2);
									printedTotal = total;
								}
								else if (txtQty.value <= 10000)
								{
									total = (txtQty.value * price3.value).toFixed(2);
									printedTotal = total;
								}
								else if (txtQty.value <= 20000)
								{
									total = (txtQty.value * price4.value).toFixed(2);
									printedTotal = total;
								}
								else
								{
									total = "POA";
								}
								//Printed plastic pens
								if ((colourEngrave.options[colourEngrave.selectedIndex].value != "Unprinted") && (total != "POA"))
								{
									categoryPrintTypeArray = categoryArray[1];
									for (i = 0; i < categoryPrintTypeArray.length; i++)
									{
										printTypeArray = categoryPrintTypeArray[i];
										if (colourEngrave.options[colourEngrave.selectedIndex].value.substring(0, 3) == printTypeArray[0].substring(0, 3))
										{
											switch (colourEngrave.options[colourEngrave.selectedIndex].value.substring(0, 3))
											{
												case "Pad":
													numberOfColours = parseInt(colourEngrave.options[colourEngrave.selectedIndex].value.substring(3, 4));
													break;
												case "Scr":
													numberOfColours = parseInt(colourEngrave.options[colourEngrave.selectedIndex].value.substring(6, 7));
													break;
												default:
													numberOfColours = 1;
											}
											printTypeDescriptionArray = printTypeArray[1];
											for (j = 0; j < printTypeDescriptionArray.length; j++)
											{
												descriptionArray = printTypeDescriptionArray[j];
												//Print calculation
												if (descriptionArray[0] == "Print")
												{
													descriptionPriceArray = descriptionArray[1];
													for (k = 0; k < descriptionPriceArray.length; k++)
													{
														priceArray = descriptionPriceArray[k];
														if ((priceArray[0] != "Minimum") && (txtQty.value <= priceArray[0]))
														{
															if (k == 1)
															{
																total = (parseFloat(total) + (parseFloat(priceArray[1] * parseFloat(positionQty.options[positionQty.selectedIndex].value)) * numberOfColours)).toFixed(2);
															}
															else
															{
																total = (parseFloat(total) + ((txtQty.value * parseFloat(priceArray[1])) * parseFloat(positionQty.options[positionQty.selectedIndex].value) * numberOfColours)).toFixed(2);
															}
															break;
														}
													}
													//check for meeting the minimum Print pricing
													descriptionPriceArray = descriptionArray[1];
													for (k = 0; k < descriptionPriceArray.length; k++)
													{
														priceArray = descriptionPriceArray[k];
														if ((priceArray[0] == "Minimum") && (total < priceArray[1]))
														{
															total = (parseFloat(priceArray[1]) + (parseFloat(printedTotal) * parseFloat(positionQty.options[positionQty.selectedIndex].value) * numberOfColours)).toFixed(2);
															break;
														}
													}
												}
												//Setup/Repeat setup calculation
												else
												{
													if (setup.options[setup.selectedIndex].value == descriptionArray[0])
													{
														descriptionPriceArray = descriptionArray[1];
														for (k = 0; k < descriptionPriceArray.length; k++)
														{
															priceArray = descriptionPriceArray[k];
															if (txtQty.value <= priceArray[0])
															{
																total = (parseFloat(total) + (parseFloat(priceArray[1]) * parseFloat(positionQty.options[positionQty.selectedIndex].value) * numberOfColours)).toFixed(2);
																break;
															}
														}
														break;
													}
												}
											}
											break;
										}
									}
								}
							}
							//Metal pens
							else
							{
								categoryArray = PCPC[1];
								//Unprinted metal pens
								if (txtQty.value <= 500)
								{
									total = (txtQty.value * price1.value).toFixed(2);
									printedTotal = total;
								}
								else if (txtQty.value <= 2500)
								{
									total = (txtQty.value * price2.value).toFixed(2);
									printedTotal = total;
								}
								else if (txtQty.value <= 10000)
								{
									total = (txtQty.value * price3.value).toFixed(2);
									printedTotal = total;
								}
								else if (txtQty.value <= 20000)
								{
									total = (txtQty.value * price4.value).toFixed(2);
									printedTotal = total;
								}
								else
								{
									total = "POA";
								}
								//Printed metal pens
								if ((colourEngrave.options[colourEngrave.selectedIndex].value != "Unprinted") && (total != "POA"))
								{
									categoryPrintTypeArray = categoryArray[1];
									for (i = 0; i < categoryPrintTypeArray.length; i++)
									{
										printTypeArray = categoryPrintTypeArray[i];
										if (colourEngrave.options[colourEngrave.selectedIndex].value.substring(0, 3) == printTypeArray[0].substring(0, 3))
										{
											switch (colourEngrave.options[colourEngrave.selectedIndex].value.substring(0, 3))
											{
												case "Pad":
													numberOfColours = parseInt(colourEngrave.options[colourEngrave.selectedIndex].value.substring(3, 4));
													break;
												case "Scr":
													numberOfColours = parseInt(colourEngrave.options[colourEngrave.selectedIndex].value.substring(6, 7));
													break;
												default:
													numberOfColours = 1;
											}
											printTypeDescriptionArray = printTypeArray[1];
											for (j = 0; j < printTypeDescriptionArray.length; j++)
											{
												descriptionArray = printTypeDescriptionArray[j];
												//Print calculation
												if (((colourEngrave.options[colourEngrave.selectedIndex].value.substring(0, 3) != "Las") && (descriptionArray[0] == "Print")) || 
													((colourEngrave.options[colourEngrave.selectedIndex].value.substring(0, 5) == "Laser") && ("Print"+colourEngrave.options[colourEngrave.selectedIndex].value.substring(5, colourEngrave.options[colourEngrave.selectedIndex].value.length) == descriptionArray[0])))
												{
													descriptionPriceArray = descriptionArray[1];
													for (k = 0; k < descriptionPriceArray.length; k++)
													{
														priceArray = descriptionPriceArray[k];
														if ((priceArray[0] != "Minimum") && (txtQty.value <= priceArray[0]))
														{
															if (k == 1)
															{
																total = (parseFloat(total) + (parseFloat(priceArray[1] * parseFloat(positionQty.options[positionQty.selectedIndex].value)) * numberOfColours)).toFixed(2);
															}
															else
															{
																total = (parseFloat(total) + ((txtQty.value * parseFloat(priceArray[1])) * parseFloat(positionQty.options[positionQty.selectedIndex].value) * numberOfColours)).toFixed(2);
															}
															break;
														}
													}
													//check for meeting the minimum Print pricing
													descriptionPriceArray = descriptionArray[1];
													for (k = 0; k < descriptionPriceArray.length; k++)
													{
														priceArray = descriptionPriceArray[k];
														if ((priceArray[0] == "Minimum") && (total < priceArray[1]))
														{
															total = (parseFloat(priceArray[1]) + (parseFloat(printedTotal) * parseFloat(positionQty.options[positionQty.selectedIndex].value) * numberOfColours)).toFixed(2);
															break;
														}
													}
												}
												//Setup/Repeat setup calculation
												else
												{
													if (setup.options[setup.selectedIndex].value == descriptionArray[0])
													{
														descriptionPriceArray = descriptionArray[1];
														for (k = 0; k < descriptionPriceArray.length; k++)
														{
															priceArray = descriptionPriceArray[k];
															if (txtQty.value <= priceArray[0])
															{
																total = (parseFloat(total) + (parseFloat(priceArray[1]) * parseFloat(positionQty.options[positionQty.selectedIndex].value) * numberOfColours)).toFixed(2);
																break;
															}
														}
														break;
													}
												}
											}
											break;
										}
									}
								}
							}
							if (total == "POA")
							{
								txtTotal.value = total;
							}
							else if (total > 0)
							{
								txtTotal.value = "$" + total;
								unitCost.value = (parseFloat(total) / txtQty.value).toFixed(2);
							}
							hiddenTotal.value = total;
						}
					}
				}
				else
				{
					if (positionQty.disabled == true)
					{
						positionQty.disabled = false;
						if (setup.disabled == true)
						{
							setup.disabled = false;
							//setup.selectedIndex = 1;
						}
					}
				}
			}
		}
	}
}

function colour1(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour1");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave1");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty1");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup1");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty1");
	var freight = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlFreight"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlFreight");
	var hfdoc1 = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfdoc1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfdoc1");
	var hfSearch = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfSearch"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfSearch");
	
	if (hfdoc1.value == "1")
	{
		args.IsValid = true;
		return;
	}
	if (hfSearch.value == "1")
	{
		args.IsValid = true;
		return;
	}
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == "") && (freight.options[freight.selectedIndex].value == "-1"))
	{
		args.IsValid = false;
		return;
	}
	if (colour.options[colour.selectedIndex].value == "-1")
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function colour2(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour2");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave2");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty2");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup2");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty2");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if (colour.options[colour.selectedIndex].value == "-1")
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function colour3(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour3");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave3");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty3");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup3");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty3");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if (colour.options[colour.selectedIndex].value == "-1")
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function colour4(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour4");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave4");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty4");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup4");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty4");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if (colour.options[colour.selectedIndex].value == "-1")
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function colour5(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour5");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave5");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty5");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup5");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty5");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if (colour.options[colour.selectedIndex].value == "-1")
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function colourEngrave1(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour1");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave1");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty1");
	var validatorPositionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_cvalPositionQty1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_cvalPositionQty1");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup1");
	var validatorSetup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_cvalSetup1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_cvalSetup1");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty1");
	var freight = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlFreight"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlFreight");
	var hfdoc1 = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfdoc1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfdoc1");
	var hfSearch = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfSearch"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfSearch");
	
	if (hfdoc1.value == "1")
	{
		args.IsValid = true;
		return;
	}
	if (hfSearch.value == "1")
	{
		args.IsValid = true;
		return;
	}
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == "") && (freight.options[freight.selectedIndex].value == "-1"))
	{
		args.IsValid = false;
		return;
	}
	if (colourEngrave.options[colourEngrave.selectedIndex].value == "-1")
	{
		args.IsValid = false;
	}
	else
	{
		args.IsValid = true;
	}
	if (args.Value == "Unprinted")
	{
		validatorPositionQty.style.visibility = "hidden";
		validatorSetup.style.visibility = "hidden";
	}
	else
	{
		validatorPositionQty.style.visibility = "visible";
		validatorSetup.style.visibility = "visible";
	}
}

function colourEngrave2(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour2");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave2");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty2");
	var validatorPositionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_cvalPositionQty2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_cvalPositionQty2");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup2");
	var validatorSetup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_cvalSetup2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_cvalSetup2");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty2");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if (colourEngrave.options[colourEngrave.selectedIndex].value == "-1")
	{
		args.IsValid = false;
	}
	else
	{
		args.IsValid = true;
	}
	if (args.Value == "Unprinted")
	{
		validatorPositionQty.style.visibility = "hidden";
		validatorSetup.style.visibility = "hidden";
	}
	else
	{
		validatorPositionQty.style.visibility = "visible";
		validatorSetup.style.visibility = "visible";
	}
}

function colourEngrave3(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour3");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave3");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty3");
	var validatorPositionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_cvalPositionQty3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_cvalPositionQty3");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup3");
	var validatorSetup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_cvalSetup3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_cvalSetup3");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty3");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if (colourEngrave.options[colourEngrave.selectedIndex].value == "-1")
	{
		args.IsValid = false;
	}
	else
	{
		args.IsValid = true;
	}
	if (args.Value == "Unprinted")
	{
		validatorPositionQty.style.visibility = "hidden";
		validatorSetup.style.visibility = "hidden";
	}
	else
	{
		validatorPositionQty.style.visibility = "visible";
		validatorSetup.style.visibility = "visible";
	}
}

function colourEngrave4(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour4");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave4");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty4");
	var validatorPositionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_cvalPositionQty4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_cvalPositionQty4");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup4");
	var validatorSetup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_cvalSetup4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_cvalSetup4");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty4");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if (colourEngrave.options[colourEngrave.selectedIndex].value == "-1")
	{
		args.IsValid = false;
	}
	else
	{
		args.IsValid = true;
	}
	if (args.Value == "Unprinted")
	{
		validatorPositionQty.style.visibility = "hidden";
		validatorSetup.style.visibility = "hidden";
	}
	else
	{
		validatorPositionQty.style.visibility = "visible";
		validatorSetup.style.visibility = "visible";
	}
}

function colourEngrave5(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour5");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave5");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty5");
	var validatorPositionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_cvalPositionQty5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_cvalPositionQty5");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup5");
	var validatorSetup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_cvalSetup5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_cvalSetup5");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty5");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if (colourEngrave.options[colourEngrave.selectedIndex].value == "-1")
	{
		args.IsValid = false;
	}
	else
	{
		args.IsValid = true;
	}
	if (args.Value == "Unprinted")
	{
		validatorPositionQty.style.visibility = "hidden";
		validatorSetup.style.visibility = "hidden";
	}
	else
	{
		validatorPositionQty.style.visibility = "visible";
		validatorSetup.style.visibility = "visible";
	}
}

function positionQty1(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour1");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave1");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty1");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup1");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty1");
	var freight = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlFreight"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlFreight");
	var hfdoc1 = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfdoc1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfdoc1");
	var hfSearch = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfSearch"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfSearch");
	
	if (hfdoc1.value == "1")
	{
		args.IsValid = true;
		return;
	}
	if (hfSearch.value == "1")
	{
		args.IsValid = true;
		return;
	}
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == "") && (freight.options[freight.selectedIndex].value == "-1"))
	{
		args.IsValid = false;
		return;
	}
	if ((positionQty.options[positionQty.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value != "Unprinted"))
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function positionQty2(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour2");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave2");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty2");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup2");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty2");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if ((positionQty.options[positionQty.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value != "Unprinted"))
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function positionQty3(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour3");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave3");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty3");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup3");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty3");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if ((positionQty.options[positionQty.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value != "Unprinted"))
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function positionQty4(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour4");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave4");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty4");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup4");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty4");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if ((positionQty.options[positionQty.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value != "Unprinted"))
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function positionQty5(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour5");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave5");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty5");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup5");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty5");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if ((positionQty.options[positionQty.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value != "Unprinted"))
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function setup1(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour1");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave1");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty1");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup1");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty1");
	var freight = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlFreight"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlFreight");
	var hfdoc1 = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfdoc1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfdoc1");
	var hfSearch = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfSearch"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfSearch");
	
	if (hfdoc1.value == "1")
	{
		args.IsValid = true;
		return;
	}
	if (hfSearch.value == "1")
	{
		args.IsValid = true;
		return;
	}
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == "") && (freight.options[freight.selectedIndex].value == "-1"))
	{
		args.IsValid = false;
		return;
	}
	if ((setup.options[setup.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value != "Unprinted"))
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function setup2(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour2");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave2");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty2");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup2");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty2");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if ((setup.options[setup.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value != "Unprinted"))
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function setup3(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour3");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave3");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty3");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup3");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty3");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if ((setup.options[setup.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value != "Unprinted"))
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function setup4(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour4");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave4");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty4");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup4");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty4");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if ((setup.options[setup.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value != "Unprinted"))
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function setup5(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour5");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave5");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty5");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup5");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty5");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if ((setup.options[setup.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value != "Unprinted"))
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function qty1(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour1");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave1");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty1");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup1");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty1");
	var freight = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlFreight"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlFreight");
	var hfdoc1 = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfdoc1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfdoc1");
	var hfSearch = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfSearch"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfSearch");
	
	if (hfdoc1.value == "1")
	{
		args.IsValid = true;
		return;
	}
	if (hfSearch.value == "1")
	{
		args.IsValid = true;
		return;
	}
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == "") && (freight.options[freight.selectedIndex].value == "-1"))
	{
		args.IsValid = false;
		return;
	}
	if ((txtQty.value == "") || (txtQty.value <= 0))
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function qty2(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour2");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave2");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty2");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup2");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty2"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty2");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if ((txtQty.value == "") || (txtQty.value <= 0))
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function qty3(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour3");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave3");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty3");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup3");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty3"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty3");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if ((txtQty.value == "") || (txtQty.value <= 0))
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function qty4(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour4");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave4");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty4");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup4");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty4"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty4");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if ((txtQty.value == "") || (txtQty.value <= 0))
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function qty5(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour5");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave5");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty5");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup5");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty5"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty5");
	
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == ""))
	{
		args.IsValid = true;
		return;
	}
	if ((txtQty.value == "") || (txtQty.value <= 0))
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function freight(sender, args)
{
	var prefix = getProductListModuleIDPrefix();
	var colour = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColour1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColour1");
	var colourEngrave = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlColourEngrave1");
	var positionQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlPositionQty1");
	var setup = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlSetup1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlSetup1");
	var txtQty = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_txtQty1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_txtQty1");
	var freight = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_ddlFreight"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_ddlFreight");
	var hfdoc1 = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfdoc1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfdoc1");
	var hfSearch = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfSearch"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfSearch");
	
	if (hfdoc1.value == "1")
	{
		hfdoc1.value = "-1";
		args.IsValid = true;
		return;
	}
	if (hfSearch.value == "1")
	{
		hfSearch.value = "-1";
		args.IsValid = true;
		return;
	}
	if ((colour.options[colour.selectedIndex].value == "-1") && (colourEngrave.options[colourEngrave.selectedIndex].value == "-1") && (positionQty.options[positionQty.selectedIndex].value == "-1") && (setup.options[setup.selectedIndex].value == "-1") && (txtQty.value == "") && (freight.options[freight.selectedIndex].value == "-1"))
	{
		args.IsValid = false;
		return;
	}
	if (freight.options[freight.selectedIndex].value == "-1")
	{
		args.IsValid = false;
		return;
	}
	args.IsValid = true;
}

function doc(sender, args)
{
	var prefix = getProductListModuleIDPrefix();	
	var hfdoc1 = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfdoc1"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfdoc1");
	
	if (hfdoc1.value == "1")
	{
		hfdoc1.value = "-1";
	}
	else
	{
		hfdoc1.value = "1";
	}
}

function search()
{
	var prefix = getProductListModuleIDPrefix();
	var hfSearch = document.all ? document.all[prefix+"ProductList_dlProductDetail_ctl00_hfSearch"] : document.getElementById(prefix+"ProductList_dlProductDetail_ctl00_hfSearch");
	
	if (hfSearch != null)
	{
		hfSearch.value = "1";
	}
}
