	//
	//	POV Format Functions
	//
	
	
	
	//	generate HTML for price
	
	function pov_htmlgenerate_price(price) {
		var
			html = "";
		
		if (!isNaN(price)) {
			if (price > 0) {
				html = '&pound;' + price;
			} else {
				if (price == -1) {
					html = 'P.O.A.';
				}
			}
		} else {
			html = price;
		}
		
		return html;
	}
	
	
	//	generate HTML for old price
	
	function pov_htmlgenerate_oldPrice(oldPrice, price) {
		var
			html = "";
		
		if (!isNaN(price) && !isNaN(oldPrice) && oldPrice > price && price > 0) {
			html = '&pound;' + oldPrice;
		}
		
		return html;
	}	var
		pov_options = new Array(0);
	var	
		options = new Array(1);
	options[0] = new Array("Webspace", 1, new Array(3), 0);
	options[0][2][0] = new Array(43, "100 MB (&pound;100.00)", 0, 1, 100.00);
	options[0][2][1] = new Array(44, "200 MB (&pound;190.00)", 0, 1, 190.00);
	options[0][2][2] = new Array(45, "500 MB (&pound;400.00)", 0, 1, 400.00);
	
	var
		bIsColourSelect = false,
		optiontypeDescriptionLink = "",
		optionDescriptionLink = "",
		i = 0, j = 0, k = 0,
		kStart = 0,
		option = null,
		pov_option = null,
		bFirstRow = true;
		updateTimer = 0,
		maxK = 1,
		tpUpdateTimer = 0;
	
	
	
	//	form update Total Price
	
	function form_updateTotalPrice() {
		var
			fTotalPrice,
			fTotalPriceAdded = 0,
			i, j, iMax, jMax, fPrice, iSelected;
		
		if (isNaN(document.productForm.priceRunningTotalBasePrice.value)) {
			try {
				
				document.all.spanPOV_Price.innerHTML = document.productForm.priceRunningTotalBasePrice.value;
				
			} catch (e) {
			}
			return false;
		}
		
		fTotalPrice = document.productForm.priceRunningTotalBasePrice.value * 1;
		iMax = document.productForm.optIcount.value * 1;
		for (i = 0; i < iMax; i++) {
			if (eval('document.productForm.optI' + i + 'type.value') == 2) {
				jMax = eval('document.productForm.optI' + i + 'count.value') * 1;
				for (j = 0; j < jMax; j++) {
					if (
						eval('document.productForm.option0_' + i + '_' + j + '.checked')
						&&
						((fPrice = eval('document.productForm.option0_' + i + '_' + j + '.price')) > 0)
					) {
						if (eval('document.productForm.option0_' + i + '_' + j + '.priceType') * 1 == 1) {
							fTotalPrice = fPrice * 1;
						} else {
							fTotalPriceAdded += fPrice * 1;
						}
					}
				}
			} else {
				iSelected = eval('document.productForm.option0_' + i + '.selectedIndex') * 1;
				if (
					(iSelected != -1)
					&&
					((fPrice = eval('document.productForm.option0_' + i).options[iSelected].price) > 0)
				) {
					if (eval('document.productForm.option0_' + i).options[iSelected].priceType * 1 == 1) {
						fTotalPrice = fPrice * 1;
					} else {
						fTotalPriceAdded += fPrice * 1;
					}
				}
			}
		}
		
		fTotalPrice += fTotalPriceAdded;
	//	fTotalPrice -= pdcPriceDecrement;
		if (window.parent.pdc_DiscountType == 0) {
			fTotalPrice = Math.round((100 - window.parent.pdc_DiscountValue)*fTotalPrice)/100;
		}
		if (window.parent.pdc_DiscountType == 1) {
			fTotalPrice -= window.parent.pdc_DiscountValue;
		}
		
		
		try {
			
			document.all.spanPOV_Price.innerHTML = "&pound; " + fTotalPrice.toFixed(2);
			document.all.spanPOV_VAT.innerHTML = "&pound; " + (1.175*fTotalPrice).toFixed(2) + " inc. VAT";
			
		//	document.all.priceRunningTotalResult.innerHTML = "&pound; " + fTotalPrice.toFixed(2);
			
		} catch (e) {
		}
		
		window.clearTimeout(tpUpdateTimer);
		tpUpdateTimer = 0;
		
		return true;
	}
	
	
	//	form update Total Price Timer
	
	function form_updateTotalPriceTimer() {
		if (tpUpdateTimer != 0) {
			window.clearTimeout(tpUpdateTimer);
			tpUpdateTimer = 0;
		}
		tpUpdateTimer = window.setTimeout("form_updateTotalPrice()", 100);
		return true;
	}
	
	
	//	form on Submit
	
	function form_onSubmit() {
		var
			k = 0;
		
		for (k = 0; k < maxK; k++) {
			counter = eval("parseInt(productForm.input" + k + "count.value)");
			if (counter > 0) {
				return true;
			}
		}
		
		alert("Please select quantity for products to add.");
		return false;
	}
	
	function formUpdate() {
		var
			k = 0,
			freeK = -1;
		
		for (k = 0; k < maxK; k++) {
			counter = eval("parseInt(productForm.input" + k + "count.value)");
			
			if (
				(freeK == -1)
				&&
				!(counter > 0)
			) {
				freeK = k;
			}
		}
		
		for (k = 0; k < maxK; k++) {
			if (k != freeK) {
				counter = eval("parseInt(productForm.input" + k + "count.value)");
				
				if (eval("optionRow" + k + ".style.display") != (counter > 0 ? "block" : "none")) {
					eval("optionRow" + k + '.style.display = "' + (counter > 0 ? "block" : "none") + '";');
				}
			}
		}
		
		if (freeK != -1) {
			if (eval("optionRow" + freeK + ".style.display") != "block") {
				eval("optionRow" + freeK + '.style.display = "block";');
			}
		}
		
		updateTimer = 0;
	}
    
    function optionCount_onkeypress() {
		if (updateTimer != 0) {
//			window.clearTimeout(updateTimer);
		}
//		updateTimer = window.setTimeout("formUpdate()", 500)
	}
	
	if (options.length < 1) {
		maxK = 1;
	}
	
	for (k = 0; k < maxK; k++) {
		document.write('<TR><TD><TABLE border="0" width="100%" cellSpacing="1" cellPadding="0" id="optionRow' + k + '"' + (k > 0 ? ' style="display:none"' : "") + '>');
		bFirstRow = true;
		
		
		for (i = 0; i < pov_options.length; i++) {
			pov_option = pov_options[i];
			if (!bFirstRow) {
				document.write('<TR><TD colSpan="2" height="3"><IMG src="/images/common/pixel-blank.gif" width="1" height="3" /></TD></TR>');
			}
			
			optiontypeDescriptionLink = "";
			if (k == 0 && typeof(pov_option[3]) != "undefined" && pov_option[3] > 0) {
				optiontypeDescriptionLink = '<A class="option-help" href="/options-description.html?id=' + pov_option[3] + '" target="options_description" onclick="return showOptionsDescription(\'' + pov_option[3] + '\');">[<B>?</B>]</A>';
			}
			
			document.write('<TR><TD vAlign="top"><NOBR>' + pov_option[0] + ':&nbsp;' + optiontypeDescriptionLink + '&nbsp;</NOBR></TD><TD width="100%" vAlign="top">');
			
			bIsColourSelect = false;
			if (pov_option[0] == "Colour" && pov_option[1] == 1 && k == 0 && typeof(option_selColours_onchnage) == "function") {
				option_selColoursName = ("document.productForm.pov_option" + k + "_" + i);
				bIsColourSelect = true;
			}
			
			if (pov_option[1] == 1) {
				optionDescriptionLink = "";
				
				//document.write('<SELECT size="1" onchange="return pov_option_onchange(' + k + ');" name="pov_option' + k + '_' + i + '">');
				document.write('<SELECT size="1" onchange="form_updateTotalPriceTimer(); return pov_option_onchange(' + k + ');" name="pov_option' + k + '_' + i + '">');
				
				
				
				for (j = 0; j < pov_option[2].length; j++) {
					
					if (pov_option[2][j][2] > 0 && optionDescriptionLink == "") {
						optionDescriptionLink = '&nbsp;<A id="aPovOptionDescription' + i + '" class="option-help" href="/option-description.html?id=' + pov_option[2][j][2] + '" target="option_description" onclick="return showOptionDescription(\'' + pov_option[2][j][2] + '\');">[<B>?</B>]</A>';
					}
					
					optionValue = pov_option[2][j];
					document.write('<OPTION value="' + optionValue[0] + '">&nbsp;' + optionValue[1] + ' &nbsp;</OPTION>');
				}
				
				if (optionDescriptionLink == "") {
					optionDescriptionLink = '<A id="aPovOptionDescription' + i + '" class="option-help" href="/" target="option_description" onclick="return false;"></A>';
				}
				
				document.write("</SELECT>" + optionDescriptionLink);
			}
			document.write('</TD></TR>');
			bFirstRow = false;
		}
		
		
		if (pov_options.length > 0) {
			divPOV_Options.style.display = "";
		}
		
		if (pov_options.length > 0 && options.length > 0) {
		//	document.write('<TR><TD colSpan="2"><HR /></TD><TR>');
		}
		
		
		for (i = 0; i < options.length; i++) {
			option = options[i];
			if (!bFirstRow) {
				document.write('<TR><TD colSpan="2" height="3"><IMG src="/images/common/pixel-blank.gif" width="1" height="3" /></TD></TR>');
			}
			
			optiontypeDescriptionLink = "";
			if (k == 0 && typeof(option[3]) != "undefined" && option[3] > 0) {
				optiontypeDescriptionLink = '<A class="option-help" href="/options-description.html?id=' + option[3] + '" target="options_description" onclick="return showOptionsDescription(\'' + option[3] + '\');">[<B>?</B>]</A>';
			}
			
			document.write('<TR><TD vAlign="top"><NOBR>' + option[0] + ':&nbsp;' + optiontypeDescriptionLink + '&nbsp;</NOBR></TD><TD width="100%" vAlign="top">');
			
			bIsColourSelect = false;
			if (option[0] == "Colour" && option[1] == 1 && k == 0 && typeof(option_selColours_onchnage) == "function") {
				option_selColoursName = ("document.productForm.option" + k + "_" + i);
				bIsColourSelect = true;
			}
			
			if (option[1] == 2) {
				for (j = 0; j < option[2].length; j++) {
					optionDescriptionLink = "";
					if (option[2][j][2] > 0) {
						optionDescriptionLink = '&nbsp;<A class="option-help" href="/option-description.html?id=' + option[2][j][2] + '" target="option_description" onclick="return showOptionDescription(\'' + option[2][j][2] + '\');">[<B>?</B>]</A>';
					}
					
					optionValue = option[2][j];
					//document.write('<DIV><INPUT type="checkbox" value="1" name="option' + k + '_' + i + '_' + optionValue[0] + '" id="option' + k + '_' + i + '_' + j + '"><LABEL for="option' + k + '_' + i + '_' + j + '"> ' + optionValue[1] + '</LABEL>' + optionDescriptionLink + '</DIV>');
					document.write('<DIV><INPUT onClick="form_updateTotalPriceTimer()" type="checkbox" value="1" name="option' + k + '_' + i + '_' + optionValue[0] + '" priceType="' + optionValue[3] + '" price="' + optionValue[4] + '" id="option' + k + '_' + i + '_' + j + '"><LABEL for="option' + k + '_' + i + '_' + j + '"> ' + optionValue[1] + '</LABEL>' + optionDescriptionLink + '</DIV>');
				}
				
				document.write('<INPUT type="hidden" name="optI' + i + 'count" value="' + j + '">');
				
			} else {
				optionDescriptionLink = "";
				//document.write("<SELECT onchange='return selOptions_onchange(" + (bIsColourSelect ? "true" : "false") + "," + i + ");'" + " size=1 name=option" + k + "_" + i + ">" + (option[1] == 0 ? '<option value="" selected> </option>' : ""));
				document.write("<SELECT onchange='form_updateTotalPriceTimer(); return selOptions_onchange(" + (bIsColourSelect ? "true" : "false") + "," + i + ");'" + " size=1 name=option" + k + "_" + i + ">" + (option[1] == 0 ? '<OPTION value="" selected> </OPTION>' : ""));
				
				for (j = 0; j < option[2].length; j++) {
					if (option[2][j][2] > 0 && optionDescriptionLink == "") {
						optionDescriptionLink = '&nbsp;<A id="aOptionDescription' + i + '" class="option-help" href="/option-description.html?id=' + option[2][j][2] + '" target="option_description" onclick="return showOptionDescription(\'' + option[2][j][2] + '\');">[<B>?</B>]</A>';
					}
					
					optionValue = option[2][j];
					//document.write('<OPTION value="' + optionValue[0] + '">&nbsp;' + optionValue[1] + ' &nbsp;</OPTION>');
					document.write("<OPTION value=" + optionValue[0] + " priceType='" + optionValue[3] + "' price='" + optionValue[4] +"'>&nbsp;" + optionValue[1] + ' &nbsp;</OPTION>');
				}
				document.write("</SELECT>" + optionDescriptionLink);
			}
			
			document.write('<INPUT type="hidden" name="optI' + i + 'type" value="' + option[1] + '">');
			document.write('</TD></TR>');
			bFirstRow = false;
		}
		
		document.write('<INPUT type="hidden" name="optIcount" value="' + i + '">');
		document.write('<TR><TD colSpan="2" height="3"><IMG src="/images/common/pixel-blank.gif" width="1" height="3"></TD></TR>');
		document.write('<TR><TD><NOBR>Special Instructions: &nbsp;</NOBR></TD><TD width="100%"><INPUT type="text" size="15" name="option' + k + 'special"></TD></TR><TR><TD colSpan="2" height="1"><IMG src="/images/common/pixel-blank.gif" width="1" height="1"></TD></TR><TR><TD>Quantity:</TD><TD><INPUT name="input' + k + 'count" id="input' + k + 'count" onkeyup="return optionCount_onkeypress();" type="text" size="3" maxlength="4" value="1"></TD></TR></TABLE></TD></TR>');
	
	}


	function pov_option_onchange(k) {
		//// POV OLD PRICE 02
		var
			pov_price			= 0,
			pov_oldPrice		= 0,
			
			pov_image			= 0,
			
			spanPOV_VAT_innerHTML = "",
			spanPOV_Code_innerHTML = "",
			spanPOV_Options_innerHTML = "",
			
			bDisabled = true,
			
			sOptionList = ",",
			i = 0, j = 0;
		
		if (pov_options.length == 0) {
			return true;
		}
		
		for (i = 0; i < pov_options.length; i++) {
			sOptionList += eval('productForm.pov_option' + k + '_' + i).value + ",";
		}


		
		switch (sOptionList) {
		
			default:
				
				//// POV OLD PRICE 04
				pov_price = 0;
				pov_oldPrice = 0;
				
				pov_image = 0;
				
				spanPOV_VAT_innerHTML = spanPOV_VAT.innerHTML;
				spanPOV_Code_innerHTML = spanPOV_Code.innerHTML;
				spanPOV_Options_innerHTML = spanPOV_Options.innerHTML;
				bDisabled = true;
				break;
		}
		
		try {
			
			document.productForm.submit.disabled = bDisabled;
			
			
			
			//spanPOV_Price.innerHTML = pov_htmlgenerate_price(pov_price);
			document.productForm.priceRunningTotalBasePrice.value = pov_price;
			
			
			
			//// POV OLD PRICE 05
			try {
				spanPOV_OldPrice.innerHTML = pov_htmlgenerate_oldPrice(pov_oldPrice, pov_price);
			} catch(e) {
			}
			
			try {
				spanPOV_Code.innerHTML = spanPOV_Code_innerHTML;
				spanPOV_Options.innerHTML = spanPOV_Options_innerHTML;
				
				spanPOV_VAT.innerHTML = spanPOV_VAT_innerHTML;
			} catch(e) {
			}
			
			if (pov_image > 0) {
				productThumbnail_Over(eval("imgID_" + pov_image + "_Number"));
			}
			
		} catch (e) {
		}
		
		
		for (i = 0; i < pov_options.length; i++) {
			selPovOptions_onchange(false, i);
		}
	}
	
	
	
	var
		sStartOptionList = '';
	k = 0;
	
	for (i = 0; i < pov_options.length; i++) {
		for (j = 0; j < eval('productForm.pov_option' + k + '_' + i).length; j++) {
			if (sStartOptionList.indexOf("," + eval('productForm.pov_option' + k + '_' + i).options[j].value + ",") > -1) {
				eval('productForm.pov_option' + k + '_' + i).selectedIndex = j;
				break;
			}
			
		}
	}
	
	
	//
	//pov_option_onchange(0);
	//
	
	
	
	//	Show Options Description
	
	function showOptionsDescription(otpID) {
		var
			wnd = null;
		
		try {
			
			wnd = window.open(
				"/options-description.html?id=" + otpID,
				"options_description",
				"height=330,width=440,status=no,resizable=no,toolbar=no,titlebar=no,scrollbars=yes"
			);
			
			wnd.focus();
			
			return false;
		} catch(e) {
			return true;
		}
	}
	
	
	//	Show Option Description
	
	function showOptionDescription(optID) {
		var
			wnd = null;
		
		try {
			
			wnd = window.open(
				"/option-description.html?id=" + optID,
				"option_description",
				"height=330,width=440,status=no,resizable=no,toolbar=no,titlebar=no,scrollbars=yes"
			);
			
			wnd.focus();
			return false;
		} catch(e) {
			return true;
		}
	}
	
	
	//
	
	for (i = 0; i < options.length; i++) {
		selOptions_onchange(false, i);
	}
	
	
	
	//	sel Options on Change
	
	function selOptions_onchange(bIsColourSelect, i) {
		if (bIsColourSelect && typeof(option_selColours_onchnage) == "function") {
			option_selColours_onchnage();
		}
		
		var
			a = null,
			optID = 0,
			sel = null;
		
		try {
			sel = eval("document.productForm.option0_" + i);
			
			a = document.getElementById("aOptionDescription" + i);
			
			
			if (options[i][1] == 0) {
				if (sel.selectedIndex == 0) {
					optID = 0;
				} else {
					optID = options[i][2][sel.selectedIndex - 1][2];
				}
			} else {
				optID = options[i][2][sel.selectedIndex][2];
			}
			
			if (optID > 0) {
				a.style.display = "";
				a.href = "/option-description.html?id=" + optID;
				a.onclick = function () { return showOptionDescription(optID); }
			} else {
				a.style.display = "none";
			}
			
		} catch(e) {
		}
		
		return true;
	}
	
	
	//	sel Pov Options on Change
	
	function selPovOptions_onchange(bIsColourSelect, i) {
		if (bIsColourSelect && typeof(option_selColours_onchnage) == "function") {
			option_selColours_onchnage();
		}
		
		var
			a = null,
			optID = 0,
			sel = null;
		
		try {
			sel = eval("document.productForm.pov_option0_" + i);
			a = document.getElementById("aPovOptionDescription" + i);
			
			if (pov_options[i][1] == 0) {
				if (sel.selectedIndex == 0) {
					optID = 0;
				} else {
					optID = pov_options[i][2][sel.selectedIndex - 1][2];
				}
			} else {
				optID = pov_options[i][2][sel.selectedIndex][2];
			}
			
			if (optID > 0) {
				a.style.display = "";
				a.href = "/option-description.html?id=" + optID;
				a.onclick = function () { return showOptionDescription(optID); }
			} else {
				a.style.display = "none";
			}
			
		} catch(e) {
		}
		
		return true;
	}