<!--
// A4 booklets so artwork for A3 form only at present
// A4 size rate for single side = 1.8
// A4 size rate for double side = 2.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=="A3")
	{
		if (iSides=="1")
		{
			lSizeRate=1.8;
		}else{
			lSizeRate=2.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/2.00));
		}		
		if (iColours==2)
		{
			lSetup=Math.round((18.0*iPages/2.00));
		}
		if (iColours==3)
		{
			lSetup= Math.round((33.0*iPages/2.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 A4 BOOKLETS

// A4 Booklets			a4booklets.js			
//130 gsm silk art prices						
						
if (sStock == "130"){						
	if (iSides == "2"){					
		if (iColours == "3"){				
			if (iPages == "8"){			
				if (quantity == "500"){Rate = 	440.05	;}
				if (quantity == "1000"){Rate = 	508.835	;}
				if (quantity == "2000"){Rate = 	677.25	;}
				if (quantity == "5000"){Rate = 	1040.035	;}
				if (quantity == "10000"){Rate = 	1423.28	;}
				if (quantity == "20000"){Rate = 	2651.77	;}
			}			
			if (iPages == "12"){			
				if (quantity == "500"){Rate = 	597.53	;}
				if (quantity == "1000"){Rate = 	689.4	;}
				if (quantity == "2000"){Rate = 	950.125	;}
				if (quantity == "5000"){Rate = 	1414.225	;}
				if (quantity == "10000"){Rate = 	1870.4	;}
				if (quantity == "20000"){Rate = 	3450.025	;}
			}			
			if (iPages == "16"){			
				if (quantity == "500"){Rate = 	825.95	;}
				if (quantity == "1000"){Rate = 	951.84	;}
				if (quantity == "2000"){Rate = 	1272.875	;}
				if (quantity == "5000"){Rate = 	1968.815	;}
				if (quantity == "10000"){Rate = 	2694.41	;}
				if (quantity == "20000"){Rate = 	4978.035	;}
			}			
			if (iPages == "20"){			
				if (quantity == "500"){Rate = 	1100.815	;}
				if (quantity == "1000"){Rate = 	1263.155	;}
				if (quantity == "2000"){Rate = 	1731.34	;}
				if (quantity == "5000"){Rate = 	2548.37	;}
				if (quantity == "10000"){Rate = 	3535.075	;}
				if (quantity == "20000"){Rate = 	6357.06	;}
			}			
			if (iPages == "24"){			
				if (quantity == "500"){Rate = 	1370.02	;}
				if (quantity == "1000"){Rate = 	1580.49	;}
				if (quantity == "2000"){Rate = 	2176.055	;}
				if (quantity == "5000"){Rate = 	3236.69	;}
				if (quantity == "10000"){Rate = 	4270.54	;}
				if (quantity == "20000"){Rate = 	7853.825	;}
			}			
			if (iPages == "28"){			
				if (quantity == "500"){Rate = 	408.52975	;}
				if (quantity == "1000"){Rate = 	500.355	;}
				if (quantity == "2000"){Rate = 	659.2195	;}
				if (quantity == "5000"){Rate = 	1113.17375	;}
				if (quantity == "10000"){Rate = 	1792.0555	;}
				if (quantity == "20000"){Rate = 	3051.52875	;}
			}			
			if (iPages == "32"){			
				if (quantity == "500"){Rate = 	1848.895	;}
				if (quantity == "1000"){Rate = 	2149.55	;}
				if (quantity == "2000"){Rate = 	2864.52	;}
				if (quantity == "5000"){Rate = 	4390.99	;}
				if (quantity == "10000"){Rate = 	5996.87	;}
				if (quantity == "20000"){Rate = 	11134.39	;}
			}			
			if (iPages == "36"){			
				if (quantity == "500"){Rate = 	2134.42	;}
				if (quantity == "1000"){Rate = 	2518.91	;}
				if (quantity == "2000"){Rate = 	3355.38	;}
				if (quantity == "5000"){Rate = 	5122.42	;}
				if (quantity == "10000"){Rate = 	6694.28	;}
				if (quantity == "20000"){Rate = 	12388.27	;}
			}			
			if (iPages == "40"){			
				if (quantity == "500"){Rate = 	2482.46	;}
				if (quantity == "1000"){Rate = 	2919.195	;}
				if (quantity == "2000"){Rate = 	3911.735	;}
				if (quantity == "5000"){Rate = 	6145.1	;}
				if (quantity == "10000"){Rate = 	8036.6	;}
				if (quantity == "20000"){Rate = 	26253.225	;}
			}			
		}				
	}					
}// 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;
		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;
}

//-->