<!--
// A3 order form only at present
// A3 size rate for single side = 1.8
// A3 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 iInserts;
	var j;
	var i;
	var lHourlyRate = 22.00;

	iQuantity=document.frmPrintOrder.frmQuantity.value;
	sSize=document.frmPrintOrder.frmSize.value;
	iSides=document.frmPrintOrder.frmSides.value;
	iInserts=document.frmPrintOrder.frmNumberInserts.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.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 = 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 Inserts			folderinserts.js				
//130 gsm satin art prices							
							
if (sSize == "A4"){							
	if (sStock == "130"){						
		if (iColours == "3"){					
			if (iInserts == "2"){				
				if (iSides == "1"){			
					if (quantity == "250"){Rate = 	353.68	;}
					if (quantity == "500"){Rate = 	370.69	;}
					if (quantity == "1000"){Rate = 	432.185	;}
					if (quantity == "2000"){Rate = 	501.44	;}
					if (quantity == "3000"){Rate = 	520.41	;}
					if (quantity == "4000"){Rate = 	549.1	;}
					if (quantity == "5000"){Rate = 	556.39	;}
					if (quantity == "10000"){Rate = 	792.07	;}
					if (quantity == "15000"){Rate = 	1033.16	;}
				}else{ // 2 sides 			
					if (quantity == "250"){Rate = 	375.55	;}
					if (quantity == "500"){Rate = 	422.935	;}
					if (quantity == "1000"){Rate = 	482	;}
					if (quantity == "2000"){Rate = 	618.08	;}
					if (quantity == "3000"){Rate = 	660.135	;}
					if (quantity == "4000"){Rate = 	675.46	;}
					if (quantity == "5000"){Rate = 	714.34	;}
					if (quantity == "10000"){Rate = 	975.535	;}
					if (quantity == "15000"){Rate = 	1373.36	;}
				}			
			}				
			if (iInserts == "3"){				
				if (iSides == "1"){			
					if (quantity == "250"){Rate = 	439.945	;}
					if (quantity == "500"){Rate = 	466.675	;}
					if (quantity == "1000"){Rate = 	553.685	;}
					if (quantity == "2000"){Rate = 	666.21	;}
					if (quantity == "3000"){Rate = 	690.04	;}
					if (quantity == "4000"){Rate = 	728.45	;}
					if (quantity == "5000"){Rate = 	767.025	;}
					if (quantity == "10000"){Rate = 	1103.08	;}
					if (quantity == "15000"){Rate = 	1387.94	;}
				}else{ // 2 sides 			
					if (quantity == "250"){Rate = 	472.75	;}
					if (quantity == "500"){Rate = 	544.435	;}
					if (quantity == "1000"){Rate = 	627.8	;}
					if (quantity == "2000"){Rate = 	841.17	;}
					if (quantity == "3000"){Rate = 	899.02	;}
					if (quantity == "4000"){Rate = 	917.99	;}
					if (quantity == "5000"){Rate = 	996.66	;}
					if (quantity == "10000"){Rate = 	1378.885	;}
					if (quantity == "15000"){Rate = 	1898.24	;}
				}			
			}				
			if (iInserts == "4"){				
				if (iSides == "1"){			
					if (quantity == "250"){Rate = 	553.75	;}
					if (quantity == "500"){Rate = 	592.9	;}
					if (quantity == "1000"){Rate = 	712.85	;}
					if (quantity == "2000"){Rate = 	849	;}
					if (quantity == "3000"){Rate = 	890.65	;}
					if (quantity == "4000"){Rate = 	936.35	;}
					if (quantity == "5000"){Rate = 	958.05	;}
					if (quantity == "10000"){Rate = 	1408.45	;}
					if (quantity == "15000"){Rate = 	1785.65	;}
				}else{ // 2 sides 			
					if (quantity == "250"){Rate = 	602.35	;}
					if (quantity == "500"){Rate = 	709	;}
					if (quantity == "1000"){Rate = 	820.85	;}
					if (quantity == "2000"){Rate = 	1119	;}
					if (quantity == "3000"){Rate = 	1187.65	;}
					if (quantity == "4000"){Rate = 	1244.15	;}
					if (quantity == "5000"){Rate = 	1306.35	;}
					if (quantity == "10000"){Rate = 	1840.45	;}
					if (quantity == "15000"){Rate = 	2541.65	;}
				}			
			}				
		}					
	}						
}							


// 	END COPY PASTE SECTION A4 INSERTS
	
	if (Rate != 0){
		lSubtotal=Math.round(Math.abs((Rate*1)+lSetup)*90)/100;
		document.frmPrintOrder.PSelected_Price.value=lSubtotal+"";
	
		lVAT=Math.round((Math.abs(lSubtotal))*0.20*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.20*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;
}

//-->
