<!--
// A4 order form only at present
// A4 size rate for single side = 1.0	
// A4 size rate for double side = 1.8
function updatePaperChoices_A4Letterheads()
{
	//if the user chooses full colour from the colour menu, then the economy option disappears from the paper menu
	
	if (document.frmPrintOrder.frmColours.options[document.frmPrintOrder.frmColours.selectedIndex].text == "Full colour")
	{		
		document.frmPrintOrder.frmStock.options.length = 0;	
  		document.frmPrintOrder.frmStock.options[document.frmPrintOrder.frmStock.options.length] = new Option('100gsm laid','100laid');				
  		document.frmPrintOrder.frmStock.options[document.frmPrintOrder.frmStock.options.length] = new Option('100gsm zeta','100zeta');								
  		document.frmPrintOrder.frmStock.options[document.frmPrintOrder.frmStock.options.length] = new Option('100gsm conqueror','100c');			
  		document.frmPrintOrder.frmStock.options[document.frmPrintOrder.frmStock.options.length] = new Option('CX22 conqueror','cx22');					
	}
	else
	{
		document.frmPrintOrder.frmStock.options.length = 0;
		document.frmPrintOrder.frmStock.options[document.frmPrintOrder.frmStock.options.length] = new Option('80gsm bond paper','80');
  		document.frmPrintOrder.frmStock.options[document.frmPrintOrder.frmStock.options.length] = new Option('100gsm bond paper','100');							
  		document.frmPrintOrder.frmStock.options[document.frmPrintOrder.frmStock.options.length] = new Option('100gsm laid','100laid');				
  		document.frmPrintOrder.frmStock.options[document.frmPrintOrder.frmStock.options.length] = new Option('100gsm zeta','100zeta');								
  		document.frmPrintOrder.frmStock.options[document.frmPrintOrder.frmStock.options.length] = new Option('100gsm conqueror','100c');			
  		document.frmPrintOrder.frmStock.options[document.frmPrintOrder.frmStock.options.length] = new Option('CX22 conqueror','cx22');					
	}	
}



function setCheckedValue(radioObj, newValue) {
	if(!radioObj)
		return;
	var radioLength = radioObj.length;
	if(radioLength == undefined) {
		radioObj.checked = (radioObj.value == newValue.toString());
		return;
	}
	for(var i = 0; i < radioLength; i++) {
		radioObj[i].checked = false;
		if(radioObj[i].value == newValue.toString()) {
			radioObj[i].checked = true;
		}
	}
}

function calcPrintCost() {

	var sSize;
	var lSizeRate; //single default
	var iQuantity;
	var iSides;
	var iColours;
	var lSetup;
	var bArtwork;
	var lSubtotal=0.0;
	var lVAT;
	var lTotal;
	var iIndex;
	var quantity;
	var Rate;
	var sStock;
	var lPantoneCharge = 0.0;
	//var sColourType;
	var fStock;
	var fSize;
	var j;
	var i;
	var lHourlyRate = 22.00;

	iQuantity=document.frmPrintOrder.frmQuantity.value;
	sSize=document.frmPrintOrder.frmSize.value;
	iSides=document.frmPrintOrder.frmSides.value;
	
	fSize=document.frmPrintOrder.frmSize.options[document.frmPrintOrder.frmSize.selectedIndex].text;
	fStock=document.frmPrintOrder.frmStock.options[document.frmPrintOrder.frmStock.selectedIndex].text;

	if (sSize=="A4")
	{
		if (iSides=="1")
		{
			lSizeRate=1.0
		}else{
			lSizeRate=1.8
		}
	}	
	
	iColours=document.frmPrintOrder.frmColours.value;
	bArtwork=document.frmPrintOrder.frmArtwork.value;
	sStock=document.frmPrintOrder.frmStock.value;
	
	if (iColours!="3") {
		
		j=document.frmPrintOrder.frmPantones.length; //alert(j)
		for (i=0; i<j; i++){
			if(document.frmPrintOrder.frmPantones[i].checked) var sColourType = document.frmPrintOrder.frmPantones[i].value
		}
		
		if ((sColourType=="None")||(sColourType=="Full")) {
			lPantoneCharge = 0.0;
		}
		if (sColourType=="1"){
			lPantoneCharge = 18.0;
		}		
		if (sColourType=="2"){
			lPantoneCharge = 36.0;
		}			
	}else{
		lPantoneCharge = 0.0;
		
		j=document.frmPrintOrder.frmPantones.length; //alert(j)
		for (i=0; i<j; i++){
			if ((document.frmPrintOrder.frmPantones[i].checked)== true){
				document.frmPrintOrder.frmPantones[i].checked = false;
			}
		}
	}
	
	

		
	if (bArtwork=="yes")
	{
		//setup is checking fee depending on no of colours
		if (iColours==1)
		{
			lSetup=13.0
		}		
		if (iColours==2)
		{
			lSetup=18.0
		}
		if (iColours==3)
		{
			lSetup=33.0
		}
	}else{
		lSetup = Math.round((1.1*iColours*lSizeRate*lHourlyRate)+(iColours*3));
	}
	
	//add any pantone fees
	lSetup = lSetup + lPantoneCharge
	
	quantity = iQuantity; //to sort spreadsheet variable name
	
// 	BEGIN COPY PASTE SECTION A3 LEAFLETS

// A4 Letterheads			a4letterheads.js		
//80 gsm prices					
					
if (sStock == "80"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "250"){Rate = 	47.605	;}
			if (quantity == "500"){Rate = 	50.035	;}
			if (quantity == "1000"){Rate = 	62.185	;}
			if (quantity == "2000"){Rate = 	69.475	;}
			if (quantity == "5000"){Rate = 	153.585	;}
			if (quantity == "10000"){Rate = 	243.025	;}
			if (quantity == "20000"){Rate = 	420.385	;}
		}			
		if (iColours == "2"){			
			if (quantity == "250"){Rate = 	58.54	;}
			if (quantity == "500"){Rate = 	60.97	;}
			if (quantity == "1000"){Rate = 	74.335	;}
			if (quantity == "2000"){Rate = 	86.485	;}
			if (quantity == "5000"){Rate = 	190.035	;}
			if (quantity == "10000"){Rate = 	296.485	;}
			if (quantity == "20000"){Rate = 	529.735	;}
		}			
		if (iColours == "3"){			
			if (quantity == "250"){Rate = 	103.495	;}
			if (quantity == "500"){Rate = 	105.925	;}
			if (quantity == "1000"){Rate = 	110.785	;}
			if (quantity == "2000"){Rate = 	171.535	;}
			if (quantity == "5000"){Rate = 	214.335	;}
			if (quantity == "10000"){Rate = 	345.085	;}
			if (quantity == "20000"){Rate = 	606.28	;}
			}		
		}			
}// end 80gsm					
					
if (sStock == "100"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "250"){Rate = 	71.905	;}
			if (quantity == "500"){Rate = 	74.335	;}
			if (quantity == "1000"){Rate = 	98.635	;}
			if (quantity == "2000"){Rate = 	130.225	;}
			if (quantity == "5000"){Rate = 	233.775	;}
			if (quantity == "10000"){Rate = 	382.75	;}
			if (quantity == "20000"){Rate = 	625.75	;}
		}			
		if (iColours == "2"){			
			if (quantity == "250"){Rate = 	88.915	;}
			if (quantity == "500"){Rate = 	91.345	;}
			if (quantity == "1000"){Rate = 	122.935	;}
			if (quantity == "2000"){Rate = 	167.89	;}
			if (quantity == "5000"){Rate = 	288.45	;}
			if (quantity == "10000"){Rate = 	494.53	;}
			if (quantity == "20000"){Rate = 	801.925	;}
		}			
		if (iColours == "3"){			
			if (quantity == "250"){Rate = 	115.645	;}
			if (quantity == "500"){Rate = 	118.075	;}
			if (quantity == "1000"){Rate = 	122.935	;}
			if (quantity == "2000"){Rate = 	184.9	;}
			if (quantity == "5000"){Rate = 	300.6	;}
			if (quantity == "10000"){Rate = 	527.335	;}
			if (quantity == "20000"){Rate = 	698.65	;}
			}		
		}			
}// end100gsm					
					
if (sStock == "cx22"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "250"){Rate = 	112	;}
			if (quantity == "500"){Rate = 	113.215	;}
			if (quantity == "1000"){Rate = 	114.43	;}
			if (quantity == "2000"){Rate = 	178.825	;}
			if (quantity == "5000"){Rate = 	367.425	;}
			if (quantity == "10000"){Rate = 	624.535	;}
			if (quantity == "20000"){Rate = 	1075.3	;}
		}			
		if (iColours == "2"){			
			if (quantity == "250"){Rate = 	143.59	;}
			if (quantity == "500"){Rate = 	144.805	;}
			if (quantity == "1000"){Rate = 	146.02	;}
			if (quantity == "2000"){Rate = 	187.33	;}
			if (quantity == "5000"){Rate = 	481.635	;}
			if (quantity == "10000"){Rate = 	818.935	;}
			if (quantity == "20000"){Rate = 	1405.78	;}
		}			
		if (iColours == "3"){			
			if (quantity == "250"){Rate = 	133.87	;}
			if (quantity == "500"){Rate = 	135.085	;}
			if (quantity == "1000"){Rate = 	142.375	;}
			if (quantity == "2000"){Rate = 	215.275	;}
			if (quantity == "5000"){Rate = 	340.695	;}
			if (quantity == "10000"){Rate = 	599.02	;}
			if (quantity == "20000"){Rate = 	797.065	;}
			}		
		}			
}// end cx22 conqueror					
					
if (sStock == "100laid"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "250"){Rate = 	73.12	;}
			if (quantity == "500"){Rate = 	74.335	;}
			if (quantity == "1000"){Rate = 	103.495	;}
			if (quantity == "2000"){Rate = 	135.085	;}
			if (quantity == "5000"){Rate = 	247.14	;}
			if (quantity == "10000"){Rate = 	405.835	;}
			if (quantity == "20000"){Rate = 	668.275	;}
		}			
		if (iColours == "2"){			
			if (quantity == "250"){Rate = 	92.56	;}
			if (quantity == "500"){Rate = 	93.775	;}
			if (quantity == "1000"){Rate = 	132.655	;}
			if (quantity == "2000"){Rate = 	177.61	;}
			if (quantity == "5000"){Rate = 	305.46	;}
			if (quantity == "10000"){Rate = 	526.12	;}
			if (quantity == "20000"){Rate = 	878.47	;}
		}			
		if (iColours == "3"){			
			if (quantity == "250"){Rate = 	142.375	;}
			if (quantity == "500"){Rate = 	143.59	;}
			if (quantity == "1000"){Rate = 	154.525	;}
			if (quantity == "2000"){Rate = 	245.65	;}
			if (quantity == "5000"){Rate = 	396.585	;}
			if (quantity == "10000"){Rate = 	701.08	;}
			if (quantity == "20000"){Rate = 	928.285	;}
			}		
		}			
}// end100gsm laid					
					
if (sStock == "100zeta"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "250"){Rate = 	129.01	;}
			if (quantity == "500"){Rate = 	130.225	;}
			if (quantity == "1000"){Rate = 	131.44	;}
			if (quantity == "2000"){Rate = 	194.62	;}
			if (quantity == "5000"){Rate = 	396.585	;}
			if (quantity == "10000"){Rate = 	680.425	;}
			if (quantity == "20000"){Rate = 	1075.3	;}
		}			
		if (iColours == "2"){			
			if (quantity == "250"){Rate = 	176.395	;}
			if (quantity == "500"){Rate = 	177.61	;}
			if (quantity == "1000"){Rate = 	178.825	;}
			if (quantity == "2000"){Rate = 	207.985	;}
			if (quantity == "5000"){Rate = 	518.085	;}
			if (quantity == "10000"){Rate = 	891.835	;}
			if (quantity == "20000"){Rate = 	1405.78	;}
		}			
		if (iColours == "3"){			
			if (quantity == "250"){Rate = 	152.095	;}
			if (quantity == "500"){Rate = 	153.31	;}
			if (quantity == "1000"){Rate = 	154.525	;}
			if (quantity == "2000"){Rate = 	245.65	;}
			if (quantity == "5000"){Rate = 	396.585	;}
			if (quantity == "10000"){Rate = 	701.08	;}
			if (quantity == "20000"){Rate = 	928.285	;}
			}		
		}			
}// end100gsm zeta					
					
if (sStock == "100c"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "250"){Rate = 	103.495	;}
			if (quantity == "500"){Rate = 	104.71	;}
			if (quantity == "1000"){Rate = 	105.925	;}
			if (quantity == "2000"){Rate = 	166.675	;}
			if (quantity == "5000"){Rate = 	349.2	;}
			if (quantity == "10000"){Rate = 	589.3	;}
			if (quantity == "20000"){Rate = 	1013.335	;}
		}			
		if (iColours == "2"){			
			if (quantity == "250"){Rate = 	132.655	;}
			if (quantity == "500"){Rate = 	133.87	;}
			if (quantity == "1000"){Rate = 	135.085	;}
			if (quantity == "2000"){Rate = 	176.395	;}
			if (quantity == "5000"){Rate = 	452.475	;}
			if (quantity == "10000"){Rate = 	769.12	;}
			if (quantity == "20000"){Rate = 	1317.085	;}
		}			
		if (iColours == "3"){			
			if (quantity == "250"){Rate = 	152.095	;}
			if (quantity == "500"){Rate = 	153.31	;}
			if (quantity == "1000"){Rate = 	154.525	;}
			if (quantity == "2000"){Rate = 	245.65	;}
			if (quantity == "5000"){Rate = 	396.585	;}
			if (quantity == "10000"){Rate = 	701.08	;}
			if (quantity == "20000"){Rate = 	928.285	;}
			}		
		}			
}// end100gsm conqueror									
	
// 	END COPY PASTE SECTION A3 LEAFLETS
	
	if (Rate != 0){		lSubtotal=Math.round(Math.abs((Rate*1)+lSetup)*100)/100;
		document.frmPrintOrder.PSelected_Price.value=lSubtotal+"";
	
		lVAT=Math.round((Math.abs(lSubtotal))*0.175*100)/100;
		document.frmPrintOrder.frmVAT.value=lVAT+"";
	
		lTotal=Math.round((Math.abs(lVAT+lSubtotal))*100)/100;
		document.frmPrintOrder.frmTotal.value=lTotal+"";
	}
	else{
		document.frmPrintOrder.PSelected_Price.value="N/A online";
	
		lVAT=Math.round((Math.abs(lSubtotal))*0.175*100)/100;
		document.frmPrintOrder.frmVAT.value="Call for quote";
	
		lTotal=Math.round((Math.abs(lVAT+lSubtotal))*100)/100;
		document.frmPrintOrder.frmTotal.value="";
	}
	
//	document.frmPrintOrder.Order_Summary.value= "Size:" + fSize + "; Quantity:" + quantity + ";\nStock:" + fStock + "; Sides:" + iSides + "; Cost:" + Rate + ";\nColours:" + iColours + "; Pantone Mixes: " + sColourType + ";\nArtwork Supplied: " + bArtwork;
	document.frmPrintOrder.Order_Summary.value= "Size:" + fSize + "; Quantity:" + quantity + ";\nStock:" + fStock + "; Sides:" + iSides + ";\nColours:" + iColours + "; Pantone Mixes: " + sColourType + ";\nArtwork Supplied: " + bArtwork;

}

//-->