// JavaScript Document
    
    
	<!--//

	function redFont(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.color= "#CC0000";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.color= "#CC0000";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.color= "#CC0000";
	}
	}


	function yellowFont(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.color= "#FFCC00";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.color= "#FFCC00";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.color= "#FFCC00";
	}
	}


	function greenFont(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.color= "#339900";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.color= "#339900";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.color= "#339900";
	}
	}


	function brownFont(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.color= "#996633";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.color= "#996633";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.color= "#996633";
	}
	}


	function blackFont(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.color= "#000000";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.color= "#000000";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.color= "#000000";
	}
	}


	function orangeFont(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.color= "#FF6600";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.color= "#FF6600";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.color= "#FF6600";
	}
	}


	function blueFont(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.color= "#0033CC";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.color= "#0033CC";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.color= "#0033CC";
	}
	}


	function violetFont(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.color= "#763AB1";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.color= "#763AB1";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.color= "#763AB1";
	}
	}


	function scarletFont(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.color= "#894589";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.color= "#894589";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.color= "#894589";
	}
	}


	function greyFont(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.color= "#666666";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.color= "#666666";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.color= "#666666";
	}
	}


	function pinkFont(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.color= "#FF99CC";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.color= "#FF99CC";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.color= "#FF99CC";
	}
	}


	function seaFont(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.color= "#009393";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.color= "#009393";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.color= "#009393";
	}
	}


	function whiteFont(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.color= "#FFFFFF";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.color= "#FFFFFF";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.color= "#FFFFFF";
	}
	}


	function bluelightFont(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.color= "#00CCFF";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.color= "#00CCFF";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.color= "#00CCFF";
	}
	}


	function bluedarkFont(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.color= "#003366";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.color= "#003366";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.color= "#003366";
	}
	}






	function redBackground(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.background= "#CC0000";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.background= "#CC0000";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.background= "#CC0000";
	}
	}


	function yellowBackground(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.background= "#FFCC00";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.background= "#FFCC00";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.background= "#FFCC00";
	}
	}


	function greenBackground(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.background= "#339900";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.background= "#339900";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.background= "#339900";
	}
	}


	function brownBackground(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.background= "#996633";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.background= "#996633";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.background= "#996633";
	}
	}


	function blackBackground(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.background= "#000000";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.background= "#000000";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.background= "#000000";
	}
	}


	function orangeBackground(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.background= "#FF6600";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.background= "#FF6600";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.background= "#FF6600";
	}
	}


	function blueBackground(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.background= "#0033CC";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.background= "#0033CC";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.background= "#0033CC";
	}
	}


	function violetBackground(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.background= "#763AB1";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.background= "#763AB1";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.background= "#763AB1";
	}
	}


	function scarletBackground(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.background= "#894589";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.background= "#894589";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.background= "#894589";
	}
	}


	function greyBackground(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.background= "#666666";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.background= "#666666";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.background= "#666666";
	}
	}


	function pinkBackground(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.background= "#FF99CC";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.background= "#FF99CC";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.background= "#FF99CC";
	}
	}


	function seaBackground(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.background= "#009393";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.background= "#009393";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.background= "#009393";
	}
	}


	function whiteBackground(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.background= "#FFFFFF";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.background= "#FFFFFF";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.background= "#FFFFFF";
	}
	}


	function bluelightBackground(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.background= "#00CCFF";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.background= "#00CCFF";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.background= "#00CCFF";
	}
	}


	function bluedarkBackground(divName)
	{
	if (document.getElementById)
	{
	// this is the way the standards work
	var style3 = document.getElementById(divName).style;
	style3.background= "#003366";
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var style3 = document.all[divName].style;
	style3.background= "#003366";
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var style3 = document.layers[divName].style;
	style3.background= "#003366";
	}
	}



	function isNum(functionValue)
	{

		for (i=0; i<functionValue.length; i++)
		{
			if (functionValue.charAt(i) < "0") {return false}

			if (functionValue.charAt(i) > "9") {return false}
		}

		return true
	}




	function decimalize(inputValue)
	{

		var decimalString;	//convert to string

		decimalString  = "" + Math.round(eval(inputValue) * Math.pow(10,2));



		var decpoint = decimalString.length - 2;

		decimalString = decimalString.substring(0,decpoint) + "." + decimalString.substring(decpoint,decimalString.length);


		return decimalString;


	}




	function doCalcs()
	{
		 with (document.form1)
		 {
		 	VATrate = 21.00;

		 	var extras = 20.00;  // initialise with standard packaging charge
		 	if (mergefile.value != "") {extras = extras + 80.00;}	//file merge charge

		 	if (logofile.value != "") {extras = extras + 50.00;}	//logo charge


			if (quantity0.value != "")
			{
				total0amount  = quantity0.value * price0.value + extras;
				if (!(noVAT.checked))
				{
					total0amount = total0amount + ((total0amount/100)*VATrate);
				}
				total0.value = decimalize(total0amount);
			}

			
			if (quantity1.value != "")
			{
				total1amount  = quantity1.value * price1.value + extras;
				if (!(noVAT.checked))
				{
					total1amount = total1amount + ((total1amount/100)*VATrate);
				}
				total1.value = decimalize(total1amount);
			}
			
			if (quantity2.value != "")
			{
				total2amount  = quantity2.value * price2.value + extras;
				if (!(noVAT.checked))
				{
					total2amount = total2amount + ((total2amount/100)*VATrate);
				}
				total2.value = decimalize(total2amount);
			}
			
			if (quantity3.value != "")
			{
				total3amount  = quantity3.value * price3.value + extras;
				if (!(noVAT.checked))
				{
					total3amount = total3amount + ((total3amount/100)*VATrate);
				}
				total3.value = decimalize(total3amount);
			}

		 }
	}





	function priceNow()
	{


	var price100 = 1.30;
	var price250 = 1.12;
	var price500 = 0.58;
	var price1000 = 0.41;
	var price2500 = 0.36;
	var price5000 = 0.24;

	priceGroup    = new Array (1.3,1.12,0.58,0.41,0.36,0.24,0.24,0.24,0.24);
    	quantityGroup = new Array (100,250,500,1000,2500,5000,10000,10000,10000);



    //initialise

    with (document.form1)
	{
    	quantity0.value = "";
    	quantity1.value = "";
    	quantity2.value = "";
    	quantity3.value = "";
    	price0.value = "";
    	price1.value = "";
    	price2.value = "";
    	price3.value = "";
    	total0.value = "";
    	total1.value = "";
    	total2.value = "";
    	total3.value = "";






		if ((quantity.value > 0) && (quantity.value < 100))
		{

				quantity0.value = quantity.value;	//display selected quantity in first row

				i=1;
				price0.value    = priceGroup[i-1];

				i=0;
				quantity1.value = quantityGroup[i];
				price1.value    = priceGroup[i];
				quantity2.value = quantityGroup[i+1];
				price2.value    = priceGroup[i+1];
				quantity3.value = quantityGroup[i+2];
				price3.value    = priceGroup[i+2];


				doCalcs();

		}



		if ((quantity.value >= 100) && (quantity.value <= 5000))
		{


		quantity0.value = quantity.value;	//display selected quantity in first row


		for (var i=1; i<=6; i++)
		{
			if ((quantity.value >= quantityGroup[i-1]) && (quantity.value < quantityGroup[i]))
			{
				price0.value    = priceGroup[i-1];
				quantity1.value = quantityGroup[i];
				price1.value    = priceGroup[i];
				quantity2.value = quantityGroup[i+1];
				price2.value    = priceGroup[i+1];
				quantity3.value = quantityGroup[i+2];
				price3.value    = priceGroup[i+2];
				//alert(i) // debug
			}
		}



			doCalcs();


			// blank out dummy entries (of 10000)

			if (quantity0.value == "10000"){quantity0.value="";price0.value = ""; total0.value = "";}
			if (quantity1.value == "10000"){quantity1.value="";price1.value = ""; total1.value = "";}
			if (quantity2.value == "10000"){quantity2.value="";price2.value = ""; total2.value = "";}
			if (quantity3.value == "10000"){quantity3.value="";price3.value = ""; total3.value = "";}


		}  // end of main 100-5000 loop






		if (quantity.value > 5000)
		{

			quantity0.value = quantity.value;	//display selected quantity in first row

			price0.value = "POA";
			total0.value = "POA";
		}




	}
	return false;


	}



function VATCheck()
{
	with (document.form1)
	{
		if (noVAT.checked)
		{
			alert("VAT charge will not appear.\nVAT Number can be entered in next step, if appropriate");
		}
		else
		{
			alert("VAT will be charged");
		}
	}
}




function checkForm()	// check form prior to submission (client-side validation)
{

	var formOK = true;

	var warningString = "Please correct the following:\n";
	var validated=true;



	with (document.form1)
	{

		if (header.value =="")
		{
			warningString= warningString+ '\nNo tag header text has been entered';
			formOK =false;
		}


		if (quantity.value =="")
		{
			warningString= warningString+ '\nNo quantity has been entered';
			formOK =false;
		}


		if (startingnumber.value =="")
		{
			warningString= warningString+ '\nNo starting number has been entered';
			formOK =false;
		}



		if (quantity.value != "")
		{
			if (!(isNum(quantity.value)))
			{
				warningString= warningString+ '\nQuantity must be a valid number';
				formOK =false;
		    }
		}
		
		
		
		if (quantity.value != "")
		{
			if (quantity.value <= 0)
			{
				warningString= warningString+ '\nQuantity must be greater than zero';
				formOK =false;
		    }
		}		



		if (prefixnumber.value != "")
		{
			if (!(isNum(prefixnumber.value)))
			{
				warningString= warningString+ '\nPrefix number must be a valid number';
				formOK =false;
		    }
		}




		if (suffixnumber.value != "")
		{
			if (!(isNum(suffixnumber.value)))
			{
				warningString= warningString+ '\nSuffix number must be a valid number';
				formOK =false;
		    }
		}



		if (startingnumber.value != "")
		{
			if (!(isNum(startingnumber.value)))
			{
				warningString= warningString+ '\nStarting number must be a valid number';
				formOK =false;
		    }
		}




		//check the  merge filename for validity

		if (mergefile.value != "")   // try another test - ensure only one dot in filename
		{

			dotpos = mergefile.value.indexOf('.');
			if (dotpos != -1)
			{
				AfterDot = mergefile.value.substring(dotpos+1,mergefile.value.length);

		        	if (AfterDot.indexOf('.') != -1)	//check for another dot
				{
					warningString= warningString+ '\nIncorrect file merge file format';
					formOK =false;
				}
			}
			else		//no dot at all
			{
				warningString= warningString+ '\nIncorrect file merge file format';
				formOK =false;
			}
		}


		if (mergefile.value != "")   // try another test - ensure .doc,.csv, .xls file extension
		{

			start = mergefile.value.indexOf('.');   // dot position +1 = extension start point
			if ((mergefile.value.substring(start,mergefile.value.length).toUpperCase() != '.DOC') && (mergefile.value.substring(start,mergefile.value.length).toUpperCase() != '.CSV') && (mergefile.value.substring(start,mergefile.value.length).toUpperCase() != '.XLS'))
			{
				warningString= warningString+ '\n\nIncorrect file merge file format\nMust be valid .DOC (Word), CSV or XLS (Excel) File';
				formOK =false;
			}

		}




		//check the  logo filename for validity

		if (logofile.value != "")   // try another test - ensure only one dot in filename
		{

			dotpos = logofile.value.indexOf('.');
			if (dotpos != -1)
			{
				AfterDot = logofile.value.substring(dotpos+1,logofile.value.length);

		        	if (AfterDot.indexOf('.') != -1)	//check for another dot
				{
					warningString= warningString+ '\nIncorrect graphics file format';
					formOK =false;
				}
			}
			else		//no dot at all
			{
				warningString= warningString+ '\nIncorrect graphics file format';
				formOK =false;
			}
		}


		if (logofile.value != "")   // try another test - ensure .jpg,.gif etc.. file extension
		{
			start = logofile.value.indexOf('.');   // dot position +1 = extension start point
			if ((logofile.value.substring(start,logofile.value.length).toUpperCase() != '.JPG') && (logofile.value.substring(start,logofile.value.length).toUpperCase() != '.JPEG') && (logofile.value.substring(start,logofile.value.length).toUpperCase() != '.GIF') && (logofile.value.substring(start,logofile.value.length).toUpperCase() != '.TIFF') && (logofile.value.substring(start,logofile.value.length).toUpperCase() != '.TIF') && (logofile.value.substring(start,logofile.value.length).toUpperCase() != '.DXF') && (logofile.value.substring(start,logofile.value.length).toUpperCase() != '.EPS'))
			{
				warningString= warningString+ '\n\nIncorrect graphics file format\nMust be valid .JPG/JPEG, GIF, TIF/TIFF, DXF or EPS File';
				formOK =false;
			}

		}






		if ( !formOK )
		{
			alert(warningString);
			validated=false;
		}


	}

	return validated;	// if all checks in checkForm are passed a TRUE will be returned
}






	function showPage()   // most of page will not be displayed unless javascript enabled
	{
	// this is the way the standards work
	if (document.getElementById)
	{
	var container_style = document.getElementById('container').style;
	container_style.display = "block"
	}
	else if (document.all)
	{
	// this is the way old msie versions work
	var container_style = document.all['container'].style;
	container_style.display = "block"
	}
	else if (document.layers)
	{
	// this is the way nn4 works
	var container_style = document.layers['container'].style;
	container_style.display = "block"
	}
	}



	//-->



