<!--
// 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 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=="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=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 Posters

// A3 Leaflets / Posters & A3 folded to A4			a3leaflets.js a3posters.js		
//130 gsm prices					
					
if (sStock == "130"){					
	if (iSides == "1"){				
		if (iColours == "1"){			
			if (quantity == "500"){Rate = 	0	;}
			if (quantity == "1000"){Rate = 	0	;}
			if (quantity == "2000"){Rate = 	0	;}
			if (quantity == "3000"){Rate = 	0	;}
			if (quantity == "4000"){Rate = 	0	;}
			if (quantity == "5000"){Rate = 	0	;}
			if (quantity == "10000"){Rate = 	0	;}
			if (quantity == "20000"){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 == "3000"){Rate = 	0	;}
			if (quantity == "4000"){Rate = 	0	;}
			if (quantity == "5000"){Rate = 	0	;}
			if (quantity == "10000"){Rate = 	0	;}
			if (quantity == "20000"){Rate = 	0	;}
			if (quantity == "50000"){Rate = 	0	;}
					
		}			
		if (iColours == "3"){			
			if (quantity == "500"){Rate = 	167.89	;}
			if (quantity == "1000"){Rate = 	218.45	;}
			if (quantity == "2000"){Rate = 	245.925	;}
			if (quantity == "3000"){Rate = 	291.5333333	;}
			if (quantity == "4000"){Rate = 	337.1416667	;}
			if (quantity == "5000"){Rate = 	382.75	;}
			if (quantity == "10000"){Rate = 	597.335	;}
			if (quantity == "20000"){Rate = 	1032.05	;}
			if (quantity == "50000"){Rate = 	0	;}
					
		}			
	}else{ //130gsm 2 sides				
		if (iColours == "1"){			
			if (quantity == "500"){Rate = 	0	;}
			if (quantity == "1000"){Rate = 	0	;}
			if (quantity == "2000"){Rate = 	0	;}
			if (quantity == "3000"){Rate = 	0	;}
			if (quantity == "4000"){Rate = 	0	;}
			if (quantity == "5000"){Rate = 	0	;}
			if (quantity == "10000"){Rate = 	0	;}
			if (quantity == "20000"){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 == "3000"){Rate = 	0	;}
			if (quantity == "4000"){Rate = 	0	;}
			if (quantity == "5000"){Rate = 	0	;}
			if (quantity == "10000"){Rate = 	0	;}
			if (quantity == "20000"){Rate = 	0	;}
			if (quantity == "50000"){Rate = 	0	;}
					
		}			
		if (iColours == "3"){			
			if (quantity == "500"){Rate = 	269.95	;}
			if (quantity == "1000"){Rate = 	339.95	;}
			if (quantity == "2000"){Rate = 	428.175	;}
			if (quantity == "3000"){Rate = 	443.39	;}
			if (quantity == "4000"){Rate = 	458.605	;}
			if (quantity == "5000"){Rate = 	504.25	;}
			if (quantity == "10000"){Rate = 	779.585	;}
			if (quantity == "20000"){Rate = 	1311.5	;}
			if (quantity == "50000"){Rate = 	0	;}
		}			
	}				
}// end 130gsm					
	
// 	END COPY PASTE SECTION A3 POSTERS
	
	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.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;
}

//-->
