<!--
// A5 booklets so artwork for A4 form only at present
// A4 size rate for single side = 1.0
// A4 size rate for double side = 1.8

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;
	var iPages;

	iQuantity=document.frmPrintOrder.frmQuantity.value;
	sSize=document.frmPrintOrder.frmSize.value;
	iSides=document.frmPrintOrder.frmSides.value;
	iPages=document.frmPrintOrder.frmPages.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 = 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= Math.round((13.0*iPages/3.00));
		}		
		if (iColours==2)
		{
			lSetup=Math.round((18.0*iPages/3.00));
		}
		if (iColours==3)
		{
			lSetup= Math.round((33.0*iPages/3.00));
		}
	}else{
		lSetup = Math.round((1.1*iColours*lSizeRate*lHourlyRate*iPages/6.05)+(iColours*3));
	}
	
	//add any pantone fees
	lSetup = lSetup + lPantoneCharge;
	
	quantity = iQuantity; //to sort spreadsheet variable name
	
// 	BEGIN COPY PASTE SECTION A5 BOOKLETS

// A5 Booklets			a5booklets.js			
//130 gsm silk art prices						
						
if (sStock == "130"){						
	if (iSides == "2"){					
		if (iColours == "3"){				
			if (iPages == "8"){			
				if (quantity == "500"){Rate = 	341.635	;}
				if (quantity == "1000"){Rate = 	403.6	;}
				if (quantity == "2000"){Rate = 	558.65	;}
				if (quantity == "5000"){Rate = 	799.495	;}
				if (quantity == "10000"){Rate = 	1162.72	;}
				if (quantity == "20000"){Rate = 	1840.15	;}
			}			
			if (iPages == "12"){			
				if (quantity == "500"){Rate = 	438.835	;}
				if (quantity == "1000"){Rate = 	525.1	;}
				if (quantity == "2000"){Rate = 	677.72	;}
				if (quantity == "5000"){Rate = 	1069.225	;}
				if (quantity == "10000"){Rate = 	1532.08	;}
				if (quantity == "20000"){Rate = 	2392.975	;}
			}			
			if (iPages == "16"){			
				if (quantity == "500"){Rate = 	616.97	;}
				if (quantity == "1000"){Rate = 	747.72	;}
				if (quantity == "2000"){Rate = 	996.295	;}
				if (quantity == "5000"){Rate = 	1557.595	;}
				if (quantity == "10000"){Rate = 	2125.55	;}
				if (quantity == "20000"){Rate = 	3200.95	;}
			}			
			if (iPages == "20"){			
				if (quantity == "500"){Rate = 	794.36	;}
				if (quantity == "1000"){Rate = 	961.56	;}
				if (quantity == "2000"){Rate = 	1240.07	;}
				if (quantity == "5000"){Rate = 	1987.705	;}
				if (quantity == "10000"){Rate = 	2854.79	;}
				if (quantity == "20000"){Rate = 	4346.235	;}
			}			
			if (iPages == "24"){			
				if (quantity == "500"){Rate = 	929.915	;}
				if (quantity == "1000"){Rate = 	1133.095	;}
				if (quantity == "2000"){Rate = 	1456.56	;}
				if (quantity == "5000"){Rate = 	2347.37	;}
				if (quantity == "10000"){Rate = 	3308.26	;}
				if (quantity == "20000"){Rate = 	5339.99	;}
			}			
			if (iPages == "28"){			
				if (quantity == "500"){Rate = 	1100.29	;}
				if (quantity == "1000"){Rate = 	1335.06	;}
				if (quantity == "2000"){Rate = 	1729.27	;}
				if (quantity == "5000"){Rate = 	2872.075	;}
				if (quantity == "10000"){Rate = 	4093.63	;}
				if (quantity == "20000"){Rate = 	6805.575	;}
			}			
			if (iPages == "32"){			
				if (quantity == "500"){Rate = 	446.5625	;}
				if (quantity == "1000"){Rate = 	515.66725	;}
				if (quantity == "2000"){Rate = 	787.8575	;}
				if (quantity == "5000"){Rate = 	1129.33975	;}
				if (quantity == "10000"){Rate = 	1816.1255	;}
				if (quantity == "20000"){Rate = 	3271.5045	;}
			}			
			if (iPages == "36"){			
				if (quantity == "500"){Rate = 	1487.21	;}
				if (quantity == "1000"){Rate = 	1780.3	;}
				if (quantity == "2000"){Rate = 	2388.62	;}
				if (quantity == "5000"){Rate = 	3695.845	;}
				if (quantity == "10000"){Rate = 	5288.96	;}
				if (quantity == "20000"){Rate = 	8443.395	;}
			}			
			if (iPages == "40"){			
				if (quantity == "500"){Rate = 	1516.535	;}
				if (quantity == "1000"){Rate = 	2061.405	;}
				if (quantity == "2000"){Rate = 	2795.695	;}
				if (quantity == "5000"){Rate = 	4369	;}
				if (quantity == "10000"){Rate = 	5768.45	;}
				if (quantity == "20000"){Rate = 	9514.795	;}
			}			
		}				
	}					
}// end 130gsm						
	
// 	END COPY PASTE SECTION A4 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;
		lVAT = 0;
		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;
		lVAT = 0;
		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;
}

//-->