<!--
// 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;
	var LaminateType;
	var sLaminated;
	var iCoverColours;
	var iInsideColours;
	var lamSupp=0;
	var colSupp=0;
	var linsideSetup;
	var loutsideSetup;
	
	LaminateType = "gloss"

	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;
	
	iCoverColours=document.frmPrintOrder.frmColoursCover.value;
	iInsideColours=document.frmPrintOrder.frmColoursInside.value;	

	if (sSize=="A5")
	{
		if (iInsideColours!="0")
		{
			linsideSizeRate=1.8;
			loutsideSizeRate=0.0;
		}else{
			linsideSizeRate=1.8;
			loutsideSizeRate=1.0;
		}
	}
	
	if (sSize=="A4")
	{
		if (iInsideColours!="0")
		{
			linsideSizeRate=1.8;
			loutsideSizeRate=0.0;
		}else{
			linsideSizeRate=1.8;
			loutsideSizeRate=1.0;
		}
	}
	
	if (sSize=="tripleA4")
	{
		if (iInsideColours!="0")
		{
			linsideSizeRate=1.8;
			loutsideSizeRate=0.0;
		}else{
			linsideSizeRate=1.8;
			loutsideSizeRate=1.0;
		}
	}		
	
	sLaminated=document.frmPrintOrder.frmLaminated.value;
	bArtwork=document.frmPrintOrder.frmArtwork.value;
	sStock=document.frmPrintOrder.frmStock.value;
	
	if ((iCoverColours!="3")&&(iInsideColours!="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 (iCoverColours==1)
		{
			loutsideSetup=13.0;
		}		
		if (iCoverColours==2)
		{
			loutsideSetup=18.0;
		}
		if (iCoverColours==3)
		{
			loutsideSetup=33.0;
		}
		if (iInsideColours==0)
		{
			linsideSetup=0.0;
		}		
		if (iInsideColours==1)
		{
			linsideSetup=13.0;
		}		
		if (iInsideColours==2)
		{
			linsideSetup=18.0;
		}
		if (iInsideColours==3)
		{
			linsideSetup=33.0;
		}		
	}else{
		loutsideSetup = Math.round((1.1*iCoverColours*loutsideSizeRate*lHourlyRate)+(iCoverColours*3));
		if (iInsideColours==0)
		{
			linsideSetup=0.0;
		}else{	
			linsideSetup = Math.round((1.1*iInsideColours*linsideSizeRate*lHourlyRate)+(iColours*3));
		}
		//lSetup = Math.round((1.1*iColours*lSizeRate*lHourlyRate)+(iColours*3));
	}
	
	//add any pantone fees
	lSetup = linsideSetup + loutsideSetup + lPantoneCharge;
	
	quantity = iQuantity; //to sort spreadsheet variable name
	
// 	BEGIN COPY PASTE SECTION A4 & A5 FOLDERS WITH OPTIONS

// A4 & A5 Folders Options			foldera5options.js		
//350 gsm satin art prices					
					
if (sSize == "A4"){					
	if (sStock == "350"){				
		if (iCoverColours == "1"){			
			if (quantity == "250"){Rate = 	323.875	;}
			if (quantity == "500"){Rate = 	406.35	;}
			if (quantity == "1000"){Rate = 	562.05	;}
			if (quantity == "2500"){Rate = 	1055.05	;}
		}			
		if (iCoverColours == "2"){			
			if (quantity == "250"){Rate = 	498.075	;}
			if (quantity == "500"){Rate = 	585.95	;}
			if (quantity == "1000"){Rate = 	752.45	;}
			if (quantity == "2500"){Rate = 	1277.85	;}
		}			
		if (iCoverColours == "3"){			
			if (quantity == "250"){Rate = 	778.925	;}
			if (quantity == "500"){Rate = 	877.6	;}
			if (quantity == "1000"){Rate = 	1065.7	;}
			if (quantity == "2500"){Rate = 	1655.9	;}
		}			
		if (iInsideColours == "1"){			
			if (quantity == "250"){colSupp = 	149.2	;}
			if (quantity == "500"){colSupp = 	163.85	;}
			if (quantity == "1000"){colSupp = 	183.9	;}
			if (quantity == "2500"){colSupp = 	225.55	;}
		}			
		if (iInsideColours == "2"){			
			if (quantity == "250"){colSupp = 	283.6	;}
			if (quantity == "500"){colSupp = 	303.65	;}
			if (quantity == "1000"){colSupp = 	334.5	;}
			if (quantity == "2500"){colSupp = 	408.55	;}
		}			
		if (iInsideColours == "3"){			
			if (quantity == "250"){colSupp = 	490.9	;}
			if (quantity == "500"){colSupp = 	521.75	;}
			if (quantity == "1000"){colSupp = 	574.2	;}
			if (quantity == "2500"){colSupp = 	713.05	;}
		}			
		if (LaminateType == "gloss"){			
			if (quantity == "250"){lamSupp = 	81	;}
			if (quantity == "500"){lamSupp = 	81	;}
			if (quantity == "1000"){lamSupp = 	81	;}
			if (quantity == "2500"){lamSupp = 	202.5	;}
		}			
		if (LaminateType == "matt"){			
			if (quantity == "250"){lamSupp = 	81	;}
			if (quantity == "500"){lamSupp = 	81	;}
			if (quantity == "1000"){lamSupp = 	94.5	;}
			if (quantity == "2500"){lamSupp = 	236.25	;}
		}			
	}				
}					
					
//350 gsm satin art prices					
if (sSize == "A5"){					
	if (sStock == "350"){				
		if (iCoverColours == "1"){			
			if (quantity == "250"){Rate = 	292.6875	;}
			if (quantity == "500"){Rate = 	349.525	;}
			if (quantity == "1000"){Rate = 	457.65	;}
			if (quantity == "2500"){Rate = 	798.675	;}
		}			
		if (iCoverColours == "2"){			
			if (quantity == "250"){Rate = 	466.8875	;}
			if (quantity == "500"){Rate = 	529.125	;}
			if (quantity == "1000"){Rate = 	648.05	;}
			if (quantity == "2500"){Rate = 	1021.475	;}
		}			
		if (iCoverColours == "3"){			
			if (quantity == "250"){Rate = 	747.7375	;}
			if (quantity == "500"){Rate = 	820.775	;}
			if (quantity == "1000"){Rate = 	961.3	;}
			if (quantity == "2500"){Rate = 	1399.525	;}
		}			
		if (iInsideColours == "1"){			
			if (quantity == "250"){colSupp = 	51.45	;}
			if (quantity == "500"){colSupp = 	66.1	;}
			if (quantity == "1000"){colSupp = 	86.15	;}
			if (quantity == "2500"){colSupp = 	127.8	;}
		}			
		if (iInsideColours == "2"){			
			if (quantity == "250"){colSupp = 	88.1	;}
			if (quantity == "500"){colSupp = 	108.15	;}
			if (quantity == "1000"){colSupp = 	139	;}
			if (quantity == "2500"){colSupp = 	213.05	;}
		}			
		if (iInsideColours == "3"){			
			if (quantity == "250"){colSupp = 	130.15	;}
			if (quantity == "500"){colSupp = 	161	;}
			if (quantity == "1000"){colSupp = 	213.45	;}
			if (quantity == "2500"){colSupp = 	352.3	;}
		}			
		if (LaminateType == "gloss"){			
			if (quantity == "250"){lamSupp = 	81	;}
			if (quantity == "500"){lamSupp = 	81	;}
			if (quantity == "1000"){lamSupp = 	81	;}
			if (quantity == "2500"){lamSupp = 	202.5	;}
		}			
		if (LaminateType == "matt"){			
			if (quantity == "250"){lamSupp = 	81	;}
			if (quantity == "500"){lamSupp = 	81	;}
			if (quantity == "1000"){lamSupp = 	94.5	;}
			if (quantity == "2500"){lamSupp = 	236.25	;}
		}			
	}				
}					
					
// Triple A4 Folders Options					
//350 gsm satin art prices					
					
if (sSize == "tripleA4"){					
	if (sStock == "350"){				
		if (iCoverColours == "1"){			
			if (quantity == "250"){Rate = 	367.9625	;}
			if (quantity == "500"){Rate = 	464.275	;}
			if (quantity == "1000"){Rate = 	647.65	;}
			if (quantity == "2500"){Rate = 	1223.675	;}
		}			
		if (iCoverColours == "2"){			
			if (quantity == "250"){Rate = 	572.4125	;}
			if (quantity == "500"){Rate = 	674.125	;}
			if (quantity == "1000"){Rate = 	868.3	;}
			if (quantity == "2500"){Rate = 	1476.725	;}
		}			
		if (iCoverColours == "3"){			
			if (quantity == "250"){Rate = 	883.5125	;}
			if (quantity == "500"){Rate = 	996.025	;}
			if (quantity == "1000"){Rate = 	1211.8	;}
			if (quantity == "2500"){Rate = 	1885.025	;}
		}			
		if (iInsideColours == "1"){			
			if (quantity == "250"){colSupp = 	213.2	;}
			if (quantity == "500"){colSupp = 	227.85	;}
			if (quantity == "1000"){colSupp = 	247.9	;}
			if (quantity == "2500"){colSupp = 	289.55	;}
		}			
		if (iInsideColours == "2"){			
			if (quantity == "250"){colSupp = 	344.1	;}
			if (quantity == "500"){colSupp = 	364.15	;}
			if (quantity == "1000"){colSupp = 	395	;}
			if (quantity == "2500"){colSupp = 	469.05	;}
		}			
		if (iInsideColours == "3"){			
			if (quantity == "250"){colSupp = 	581.65	;}
			if (quantity == "500"){colSupp = 	612.5	;}
			if (quantity == "1000"){colSupp = 	666.3	;}
			if (quantity == "2500"){colSupp = 	803.8	;}
		}			
		if (LaminateType == "gloss"){			
			if (quantity == "250"){lamSupp = 	81	;}
			if (quantity == "500"){lamSupp = 	81	;}
			if (quantity == "1000"){lamSupp = 	81	;}
			if (quantity == "2500"){lamSupp = 	202.5	;}
		}			
		if (LaminateType == "matt"){			
			if (quantity == "250"){lamSupp = 	81	;}
			if (quantity == "500"){lamSupp = 	81	;}
			if (quantity == "1000"){lamSupp = 	94.5	;}
			if (quantity == "2500"){lamSupp = 	236.25	;}
		}			
	}				
}
	
// 	END COPY PASTE SECTION A4 & A5 FOLDERS WIT OPTIONS

 if ((sLaminated == "cover")||(sLaminated == "inside")){
	 lamSupp = lamSupp*1;
 }
 if (sLaminated == "both"){
	 lamSupp = lamSupp*2;
 } 
 if (sLaminated == "No"){
	 lamSupp = lamSupp*0;
 }  
 
	if (Rate != 0){
		lSubtotal=Math.round(Math.abs((Rate*1)+(lSetup*1)+(lamSupp*1))*90)/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 + ";\nColours(Cover):" + iCoverColours + "; Colours(Inside):" + iInsideColours + ";\nLaminated:" + sLaminated + "; Pantone Mixes: " + sColourType + "; Artwork Supplied: " + bArtwork;
}

//-->