<!--
// A5 order form only at present
// A5 size rate for single side = 0.5
// A5 size rate for double side = 0.9
function updatePaperChoices_A5Leaflets()
{
	//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('150gsm art paper','150');				
		document.frmPrintOrder.frmStock.options[document.frmPrintOrder.frmStock.options.length] = new Option('170gsm art paper','170');
	}
	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('150gsm art paper','150');				
	}
}




function updatePaperChoices_A5Menus()
{
	//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('130gsm art paper','130');				
  		document.frmPrintOrder.frmStock.options[document.frmPrintOrder.frmStock.options.length] = new Option('150gsm art paper','150');						
  		document.frmPrintOrder.frmStock.options[document.frmPrintOrder.frmStock.options.length] = new Option('170gsm art paper','170');				
	}
	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('130gsm art paper','130');				
  		document.frmPrintOrder.frmStock.options[document.frmPrintOrder.frmStock.options.length] = new Option('150gsm art paper','150');						
  		document.frmPrintOrder.frmStock.options[document.frmPrintOrder.frmStock.options.length] = new Option('170gsm art paper','170');				
	}
}


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=="A5")
	{
		if (iSides=="1")
		{
			lSizeRate=0.5
		}else{
			lSizeRate=0.9
		}
	}	
	
	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 = 10.0;
		}		
		if (sColourType=="2"){
			lPantoneCharge = 20.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 A5 LEAFLETS

// A5 Leaflets			a5leaflets.js		
//130 gsm prices					
					
if (sStock == "130"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "500"){Rate = 	62.185	;}
			if (quantity == "1000"){Rate = 	78.725	;}
			if (quantity == "2000"){Rate = 	83.585	;}
			if (quantity == "5000"){Rate = 	105.455	;}
			if (quantity == "10000"){Rate = 	200.97	;}
			if (quantity == "15000"){Rate = 	238.635	;}
			if (quantity == "20000"){Rate = 	291.625	;}
			if (quantity == "30000"){Rate = 	343.4	;}
			if (quantity == "50000"){Rate = 	541.885	;}
		}			
		if (iColours == "2"){			
			if (quantity == "500"){Rate = 	74.335	;}
			if (quantity == "1000"){Rate = 	95.735	;}
			if (quantity == "2000"){Rate = 	115.175	;}
			if (quantity == "5000"){Rate = 	132.185	;}
			if (quantity == "10000"){Rate = 	254.43	;}
			if (quantity == "15000"){Rate = 	299.9925	;}
			if (quantity == "20000"){Rate = 	374.245	;}
			if (quantity == "30000"){Rate = 	438.17	;}
			if (quantity == "50000"){Rate = 	616	;}
		}			
		if (iColours == "3"){			
			if (quantity == "500"){Rate = 	93.775	;}
			if (quantity == "1000"){Rate = 	120.035	;}
			if (quantity == "2000"){Rate = 	127.325	;}
			if (quantity == "5000"){Rate = 	144.335	;}
			if (quantity == "10000"){Rate = 	258.075	;}
			if (quantity == "15000"){Rate = 	310.32	;}
			if (quantity == "20000"){Rate = 	405.835	;}
			if (quantity == "30000"){Rate = 	562.1	;}
			if (quantity == "50000"){Rate = 	749.65	;}
		}			
	}else{ //130gsm 2 sides				
		if (iColours == "1"){			
			if (quantity == "500"){Rate = 	81.625	;}
			if (quantity == "1000"){Rate = 	103.025	;}
			if (quantity == "2000"){Rate = 	107.885	;}
			if (quantity == "5000"){Rate = 	137.045	;}
			if (quantity == "10000"){Rate = 	270.225	;}
			if (quantity == "15000"){Rate = 	314.14725	;}
			if (quantity == "20000"){Rate = 	391.255	;}
			if (quantity == "30000"){Rate = 	460.04	;}
			if (quantity == "50000"){Rate = 	617.215	;}
		}			
		if (iColours == "2"){			
			if (quantity == "500"){Rate = 	98.635	;}
			if (quantity == "1000"){Rate = 	120.035	;}
			if (quantity == "2000"){Rate = 	144.335	;}
			if (quantity == "5000"){Rate = 	175.925	;}
			if (quantity == "10000"){Rate = 	341.91	;}
			if (quantity == "15000"){Rate = 	400.23	;}
			if (quantity == "20000"){Rate = 	506.68	;}
			if (quantity == "30000"){Rate = 	592.475	;}
			if (quantity == "50000"){Rate = 	792.175	;}
		}			
		if (iColours == "3"){			
			if (quantity == "500"){Rate = 	122.935	;}
			if (quantity == "1000"){Rate = 	151.625	;}
			if (quantity == "2000"){Rate = 	169.85	;}
			if (quantity == "5000"){Rate = 	218.45	;}
			if (quantity == "10000"){Rate = 	318.825	;}
			if (quantity == "15000"){Rate = 	396.585	;}
			if (quantity == "20000"){Rate = 	510.325	;}
			if (quantity == "30000"){Rate = 	689.675	;}
			if (quantity == "50000"){Rate = 	907.6	;}
		}			
	}				
}// end 130gsm					
					
//80 gsm prices					
if (sStock == "80"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "500"){Rate = 	50.035	;}
			if (quantity == "1000"){Rate = 	71.435	;}
			if (quantity == "2000"){Rate = 	78.725	;}
			if (quantity == "5000"){Rate = 	95.735	;}
			if (quantity == "10000"){Rate = 	179.1	;}
			if (quantity == "15000"){Rate = 	219.5675	;}
			if (quantity == "20000"){Rate = 	260.035	;}
			if (quantity == "30000"){Rate = 	318.685	;}
			if (quantity == "50000"){Rate = 	444.685	;}
		}			
		if (iColours == "2"){			
			if (quantity == "500"){Rate = 	57.325	;}
			if (quantity == "1000"){Rate = 	83.585	;}
			if (quantity == "2000"){Rate = 	103.025	;}
			if (quantity == "5000"){Rate = 	120.035	;}
			if (quantity == "10000"){Rate = 	226.485	;}
			if (quantity == "15000"){Rate = 	279.1025	;}
			if (quantity == "20000"){Rate = 	331.72	;}
			if (quantity == "30000"){Rate = 	401.305	;}
			if (quantity == "50000"){Rate = 	561.325	;}
		}			
		if (iColours == "3"){			
			if (quantity == "500"){Rate = 0;}		
			if (quantity == "1000"){Rate = 0;}		
			if (quantity == "2000"){Rate = 0;}		
			if (quantity == "5000"){Rate = 0;}		
			if (quantity == "10000"){Rate = 0;}		
			if (quantity == "15000"){Rate = 0;}		
			if (quantity == "20000"){Rate = 0;}		
			if (quantity == "30000"){Rate = 0;}		
			if (quantity == "50000"){Rate = 0;}		
		}			
	}else{ //80 gsm prices 2 sides				
		if (iColours == "1"){			
			if (quantity == "500"){Rate = 	62.185	;}
			if (quantity == "1000"){Rate = 	83.585	;}
			if (quantity == "2000"){Rate = 	95.735	;}
			if (quantity == "5000"){Rate = 	127.325	;}
			if (quantity == "10000"){Rate = 	237.42	;}
			if (quantity == "15000"){Rate = 	291.2525	;}
			if (quantity == "20000"){Rate = 	345.085	;}
			if (quantity == "30000"){Rate = 	415.885	;}
			if (quantity == "50000"){Rate = 	549.175	;}
		}			
		if (iColours == "2"){			
			if (quantity == "500"){Rate = 	70.69	;}
			if (quantity == "1000"){Rate = 	103.025	;}
			if (quantity == "2000"){Rate = 	128.54	;}
			if (quantity == "5000"){Rate = 	157.7	;}
			if (quantity == "10000"){Rate = 	303.03	;}
			if (quantity == "15000"){Rate = 	376.3025	;}
			if (quantity == "20000"){Rate = 	449.575	;}
			if (quantity == "30000"){Rate = 	534.955	;}
			if (quantity == "50000"){Rate = 	701.05	;}
		}			
		if (iColours == "3"){			
			if (quantity == "500"){Rate = 0;}		
			if (quantity == "1000"){Rate = 0;}		
			if (quantity == "2000"){Rate = 0;}		
			if (quantity == "5000"){Rate = 0;}		
			if (quantity == "10000"){Rate = 0;}		
			if (quantity == "15000"){Rate = 0;}		
			if (quantity == "20000"){Rate = 0;}		
			if (quantity == "30000"){Rate = 0;}		
			if (quantity == "50000"){Rate = 0;}		
		}			
	}				
}// end 80gsm					
					
//150 gsm prices					
if (sStock == "150"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "500"){Rate = 0;}		
			if (quantity == "1000"){Rate = 0;}		
			if (quantity == "2000"){Rate = 0;}		
			if (quantity == "5000"){Rate = 0;}		
			if (quantity == "10000"){Rate = 0;}		
			if (quantity == "15000"){Rate = 0;}		
			if (quantity == "20000"){Rate = 0;}		
			if (quantity == "30000"){Rate = 0;}		
			if (quantity == "50000"){Rate = 0;}		
		}			
		if (iColours == "2"){			
			if (quantity == "500"){Rate = 0;}		
			if (quantity == "1000"){Rate = 0;}		
			if (quantity == "2000"){Rate = 0;}		
			if (quantity == "5000"){Rate = 0;}		
			if (quantity == "10000"){Rate = 0;}		
			if (quantity == "15000"){Rate = 0;}		
			if (quantity == "20000"){Rate = 0;}		
			if (quantity == "30000"){Rate = 0;}		
			if (quantity == "50000"){Rate = 0;}		
		}			
		if (iColours == "3"){			
			if (quantity == "500"){Rate = 	0	;}
			if (quantity == "1000"){Rate = 	0	;}
			if (quantity == "2000"){Rate = 	0	;}
			if (quantity == "5000"){Rate = 	0	;}
			if (quantity == "10000"){Rate = 	0	;}
			if (quantity == "15000"){Rate =	0	;}
			if (quantity == "20000"){Rate = 	0	;}
			if (quantity == "30000"){Rate =	0	;}
			if (quantity == "50000"){Rate =	0	;}
		}			
	}else{ //150 gsm prices 2 sides				
		if (iColours == "1"){			
			if (quantity == "500"){Rate = 0;}		
			if (quantity == "1000"){Rate = 0;}		
			if (quantity == "2000"){Rate = 0;}		
			if (quantity == "5000"){Rate = 0;}		
			if (quantity == "10000"){Rate = 0;}		
			if (quantity == "15000"){Rate = 0;}		
			if (quantity == "20000"){Rate = 0;}		
			if (quantity == "30000"){Rate = 0;}		
			if (quantity == "50000"){Rate = 0;}		
		}			
		if (iColours == "2"){			
			if (quantity == "500"){Rate = 0;}		
			if (quantity == "1000"){Rate = 0;}		
			if (quantity == "2000"){Rate = 0;}		
			if (quantity == "5000"){Rate = 0;}		
			if (quantity == "10000"){Rate = 0;}		
			if (quantity == "15000"){Rate = 0;}		
			if (quantity == "20000"){Rate = 0;}		
			if (quantity == "30000"){Rate = 0;}		
			if (quantity == "50000"){Rate = 0;}		
		}			
		if (iColours == "3"){			
			if (quantity == "500"){Rate = 	156.955	;}
			if (quantity == "1000"){Rate = 	186.86	;}
			if (quantity == "2000"){Rate = 	241.535	;}
			if (quantity == "5000"){Rate = 	343.595	;}
			if (quantity == "10000"){Rate = 	439.11	;}
			if (quantity == "15000"){Rate = 	502.6625	;}
			if (quantity == "20000"){Rate = 	566.215	;}
			if (quantity == "30000"){Rate = 0;}		
			if (quantity == "50000"){Rate = 0;}		
		}			
	}				
}// end 150gsm					
					
//170 gsm prices					
if (sStock == "170"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "500"){Rate = 0;}		
			if (quantity == "1000"){Rate = 0;}		
			if (quantity == "2000"){Rate = 0;}		
			if (quantity == "5000"){Rate = 0;}		
			if (quantity == "10000"){Rate = 0;}		
			if (quantity == "15000"){Rate = 0;}		
			if (quantity == "20000"){Rate = 0;}		
			if (quantity == "30000"){Rate = 0;}		
			if (quantity == "50000"){Rate = 0;}		
		}			
		if (iColours == "2"){			
			if (quantity == "500"){Rate = 0;}		
			if (quantity == "1000"){Rate = 0;}		
			if (quantity == "2000"){Rate = 0;}		
			if (quantity == "5000"){Rate = 0;}		
			if (quantity == "10000"){Rate = 0;}		
			if (quantity == "15000"){Rate = 0;}		
			if (quantity == "20000"){Rate = 0;}		
			if (quantity == "30000"){Rate = 0;}		
			if (quantity == "50000"){Rate = 0;}		
		}			
		if (iColours == "3"){			
			if (quantity == "500"){Rate = 	112	;}
			if (quantity == "1000"){Rate = 	141.905	;}
			if (quantity == "2000"){Rate = 	151.625	;}
			if (quantity == "5000"){Rate = 	181.53	;}
			if (quantity == "10000"){Rate = 	320.785	;}
			if (quantity == "15000"){Rate = 	411.0675	;}
			if (quantity == "20000"){Rate = 	501.35	;}
			if (quantity == "30000"){Rate = 0;}		
			if (quantity == "50000"){Rate = 0;}		
		}			
	}else{ //170 gsm prices 2 sides				
		if (iColours == "1"){			
			if (quantity == "500"){Rate = 0;}		
			if (quantity == "1000"){Rate = 0;}		
			if (quantity == "2000"){Rate = 0;}		
			if (quantity == "5000"){Rate = 0;}		
			if (quantity == "10000"){Rate = 0;}		
			if (quantity == "15000"){Rate = 0;}		
			if (quantity == "20000"){Rate = 0;}		
			if (quantity == "30000"){Rate = 0;}		
			if (quantity == "50000"){Rate = 0;}		
		}			
		if (iColours == "2"){			
			if (quantity == "500"){Rate = 0;}		
			if (quantity == "1000"){Rate = 0;}		
			if (quantity == "2000"){Rate = 0;}		
			if (quantity == "5000"){Rate = 0;}		
			if (quantity == "10000"){Rate = 0;}		
			if (quantity == "15000"){Rate = 0;}		
			if (quantity == "20000"){Rate = 0;}		
			if (quantity == "30000"){Rate = 0;}		
			if (quantity == "50000"){Rate = 0;}		
		}			
		if (iColours == "3"){			
			if (quantity == "500"){Rate = 	148.45	;}
			if (quantity == "1000"){Rate = 	182	;}
			if (quantity == "2000"){Rate = 	203.87	;}
			if (quantity == "5000"){Rate = 	273.87	;}
			if (quantity == "10000"){Rate = 	396.115	;}
			if (quantity == "15000"){Rate = 	513.735	;}
			if (quantity == "20000"){Rate = 	631.355	;}
			if (quantity == "30000"){Rate = 0;}		
			if (quantity == "50000"){Rate = 0;}		
		}			
	}				
}// end 170gsm					
	
	
// 	END COPY PASTE SECTION A5 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.0*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.0*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 + ";\nColours:" + iColours + "; Pantone Mixes: " + sColourType + ";\nArtwork Supplied: " + bArtwork;
}

//-->