<!--
// 1/3 A4 order form only at present
// 1/3 A4 size rate for single side = 0.6
// 1/3 A4 size rate for double side = 0.9

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=="comps")
	{
		if (iSides=="1")
		{
			lSizeRate=0.6;
		}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 = 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 A4 LEAFLETS

// Third A4 Comp slips			compslips.js		
//80 gsm prices					
					
if (sStock == "80"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "500"){Rate = 	33.3895	;}
			if (quantity == "1000"){Rate = 	34.42225	;}
			if (quantity == "2000"){Rate = 	41.6515	;}
			if (quantity == "5000"){Rate = 	60.19625	;}
			if (quantity == "10000"){Rate = 	97.37525	;}
			if (quantity == "20000"){Rate = 	0	;}
		}			
		if (iColours == "2"){			
			if (quantity == "500"){Rate = 	42.68425	;}
			if (quantity == "1000"){Rate = 	44.74975	;}
			if (quantity == "2000"){Rate = 	51.979	;}
			if (quantity == "5000"){Rate = 	75.6875	;}
			if (quantity == "20000"){Rate = 	130.42325	;}
			if (quantity == "20000"){Rate = 	0	;}
		}			
		if (iColours == "3"){			
			if (quantity == "500"){Rate = 	86.485	;}
			if (quantity == "1000"){Rate = 	91.345	;}
			if (quantity == "2000"){Rate = 	133.87	;}
			if (quantity == "5000"){Rate = 	163.775	;}
			if (quantity == "10000"){Rate = 	265.835	;}
			if (quantity == "20000"){Rate = 	461.725	;}
		}			
	}				
}// end 80gsm					
					
					
//100 gsm prices					
if (sStock == "100"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "500"){Rate = 	35.24845	;}
			if (quantity == "1000"){Rate = 	36.384475	;}
			if (quantity == "2000"){Rate = 	44.33665	;}
			if (quantity == "5000"){Rate = 	63.810875	;}
			if (quantity == "10000"){Rate = 	104.707775	;}
			if (quantity == "20000"){Rate = 	0	;}
		}			
		if (iColours == "2"){			
			if (quantity == "500"){Rate = 	45.472675	;}
			if (quantity == "1000"){Rate = 	47.744725	;}
			if (quantity == "2000"){Rate = 	55.6969	;}
			if (quantity == "5000"){Rate = 	80.85125	;}
			if (quantity == "20000"){Rate = 	141.060575	;}
			if (quantity == "20000"){Rate = 	0	;}
		}			
		if (iColours == "3"){			
			if (quantity == "500"){Rate = 	97.42	;}
			if (quantity == "1000"){Rate = 	101.065	;}
			if (quantity == "2000"){Rate = 	143.59	;}
			if (quantity == "5000"){Rate = 	226.955	;}
			if (quantity == "10000"){Rate = 	393.41	;}
			if (quantity == "20000"){Rate = 	567.43	;}
		}			
	}				
}// end 100gsm					
					
//100 gsm laid prices					
if (sStock == "100laid"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "500"){Rate = 	43.717	;}
			if (quantity == "1000"){Rate = 	55.07725	;}
			if (quantity == "2000"){Rate = 	78.8305	;}
			if (quantity == "5000"){Rate = 	166.5695	;}
			if (quantity == "10000"){Rate = 	266.74625	;}
			if (quantity == "20000"){Rate = 	0	;}
		}			
		if (iColours == "2"){			
			if (quantity == "500"){Rate = 	61.27375	;}
			if (quantity == "1000"){Rate = 	75.73225	;}
			if (quantity == "2000"){Rate = 	95.3545	;}
			if (quantity == "5000"){Rate = 	185.159	;}
			if (quantity == "20000"){Rate = 	313.22	;}
			if (quantity == "20000"){Rate = 	0	;}
		}			
		if (iColours == "3"){			
			if (quantity == "500"){Rate = 	116.86	;}
			if (quantity == "1000"){Rate = 	126.58	;}
			if (quantity == "2000"){Rate = 	199.48	;}
			if (quantity == "5000"){Rate = 	314.435	;}
			if (quantity == "10000"){Rate = 	550.145	;}
			if (quantity == "20000"){Rate = 	750.895	;}
		}			
	}				
}// end 100gsm laid					
					
//100 gsm tinted laid prices					
if (sStock == "100laidtint"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "500"){Rate = 	49.5004	;}
			if (quantity == "1000"){Rate = 	63.1327	;}
			if (quantity == "2000"){Rate = 	91.6366	;}
			if (quantity == "5000"){Rate = 	195.0734	;}
			if (quantity == "10000"){Rate = 	315.2855	;}
			if (quantity == "20000"){Rate = 	0	;}
		}			
		if (iColours == "2"){			
			if (quantity == "500"){Rate = 	70.5685	;}
			if (quantity == "1000"){Rate = 	87.9187	;}
			if (quantity == "2000"){Rate = 	111.4654	;}
			if (quantity == "5000"){Rate = 	217.3808	;}
			if (quantity == "20000"){Rate = 	371.054	;}
			if (quantity == "20000"){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 == "20000"){Rate = 	0	;}
		}			
	}				
}// end 100gsm laid tinted					
					
//100 gsm conqueror prices					
if (sStock == "100c"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "500"){Rate = 	51.979	;}
			if (quantity == "1000"){Rate = 	66.4375	;}
			if (quantity == "2000"){Rate = 	102.58375	;}
			if (quantity == "5000"){Rate = 	213.04325	;}
			if (quantity == "10000"){Rate = 	325.613	;}
			if (quantity == "20000"){Rate = 	0	;}
		}			
		if (iColours == "2"){			
			if (quantity == "500"){Rate = 	73.66675	;}
			if (quantity == "1000"){Rate = 	92.25625	;}
			if (quantity == "2000"){Rate = 	138.73	;}
			if (quantity == "5000"){Rate = 	238.862	;}
			if (quantity == "20000"){Rate = 	401.00375	;}
			if (quantity == "20000"){Rate = 	0	;}
		}			
		if (iColours == "3"){			
			if (quantity == "500"){Rate = 	116.86	;}
			if (quantity == "1000"){Rate = 	126.58	;}
			if (quantity == "2000"){Rate = 	199.48	;}
			if (quantity == "5000"){Rate = 	314.435	;}
			if (quantity == "10000"){Rate = 	550.145	;}
			if (quantity == "20000"){Rate = 	750.895	;}
		}			
	}				
}// end 100gsm conqueror					
					
//100 gsm zeta matt prices					
if (sStock == "100z"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "500"){Rate = 	51.979	;}
			if (quantity == "1000"){Rate = 	66.4375	;}
			if (quantity == "2000"){Rate = 	102.58375	;}
			if (quantity == "5000"){Rate = 	213.04325	;}
			if (quantity == "10000"){Rate = 	325.613	;}
			if (quantity == "20000"){Rate = 	0	;}
		}			
		if (iColours == "2"){			
			if (quantity == "500"){Rate = 	73.66675	;}
			if (quantity == "1000"){Rate = 	92.25625	;}
			if (quantity == "2000"){Rate = 	138.73	;}
			if (quantity == "5000"){Rate = 	238.862	;}
			if (quantity == "20000"){Rate = 	401.00375	;}
			if (quantity == "20000"){Rate = 	0	;}
		}			
		if (iColours == "3"){			
			if (quantity == "500"){Rate = 	116.86	;}
			if (quantity == "1000"){Rate = 	126.58	;}
			if (quantity == "2000"){Rate = 	199.48	;}
			if (quantity == "5000"){Rate = 	314.435	;}
			if (quantity == "10000"){Rate = 	550.145	;}
			if (quantity == "20000"){Rate = 	750.895	;}
		}			
	}				
}// end 100gsm zeta matt					

// 	END COPY PASTE SECTION COMPSLIPS
	
	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 + ";\nColours:" + iColours + "; Pantone Mixes: " + sColourType + ";\nArtwork Supplied: " + bArtwork;
}

//-->