<!--
// A4 order form only at present
// A4 size rate for single side = 0.6
// 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;

	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=="C3")
	{
		if (iSides=="1")
		{
			lSizeRate=0.5;
		}
	}	

	if (sSize=="C4")
	{
		if (iSides=="1")
		{
			lSizeRate=0.5;
		}
	}	
	
	if (sSize=="DL")
	{
		if (iSides=="1")
		{
			lSizeRate=0.5;
		}
	}
	
	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 CALENDARS

// Other printing 		envelopes.js				
// Envelopes						
if (sSize == "C4"){						
	if (sStock == "whiteSS"){					
		if (iSides == "1"){				
			if (iColours == "1"){			
				if (quantity == "500"){Rate = 	122.935	;}
				if (quantity == "1000"){Rate = 	139.475	;}
				if (quantity == "2000"){Rate = 	225.27	;}
				if (quantity == "5000"){Rate = 	425.275	;}
				if (quantity == "10000"){Rate = 	720.05	;}
				if (quantity == "20000"){Rate = 	1323.65	;}
			}			
			if (iColours == "2"){			
				if (quantity == "500"){Rate = 	176.395	;}
				if (quantity == "1000"){Rate = 	196.58	;}
				if (quantity == "2000"){Rate = 	321.255	;}
				if (quantity == "5000"){Rate = 	616.03	;}
				if (quantity == "10000"){Rate = 	1054.175	;}
				if (quantity == "20000"){Rate = 	1906.85	;}
			}			
			if (iColours == "3"){			
				if (quantity == "500"){Rate = 	0	;}
				if (quantity == "1000"){Rate = 	0	;}
				if (quantity == "2000"){Rate = 	0	;}
				if (quantity == "5000"){Rate = 	0	;}
				if (quantity == "10000"){Rate = 	0	;}
				if (quantity == "20000"){Rate = 	0	;}
			}			
		}				
	}					
	if (sStock == "manillaSS"){					
		if (iSides == "1"){				
			if (iColours == "1"){			
				if (quantity == "500"){Rate = 	118.075	;}
				if (quantity == "1000"){Rate = 	132.185	;}
				if (quantity == "2000"){Rate = 	214.335	;}
				if (quantity == "5000"){Rate = 	405.835	;}
				if (quantity == "10000"){Rate = 	683.6	;}
				if (quantity == "20000"){Rate = 	1275.05	;}
			}			
			if (iColours == "2"){			
				if (quantity == "500"){Rate = 	166.675	;}
				if (quantity == "1000"){Rate = 	189.29	;}
				if (quantity == "2000"){Rate = 	309.105	;}
				if (quantity == "5000"){Rate = 	592.945	;}
				if (quantity == "10000"){Rate = 	1014.08	;}
				if (quantity == "20000"){Rate = 	1836.38	;}
			}			
			if (iColours == "3"){			
				if (quantity == "500"){Rate = 	0	;}
				if (quantity == "1000"){Rate = 	0	;}
				if (quantity == "2000"){Rate = 	0	;}
				if (quantity == "5000"){Rate = 	0	;}
				if (quantity == "10000"){Rate = 	0	;}
				if (quantity == "20000"){Rate = 	0	;}
			}			
		}				
	}					
}						
						
if (sSize == "C5"){						
	if (sStock == "whiteSS"){					
		if (iSides == "1"){				
			if (iColours == "1"){			
				if (quantity == "500"){Rate = 	98.635	;}
				if (quantity == "1000"){Rate = 	120.035	;}
				if (quantity == "2000"){Rate = 	176.67	;}
				if (quantity == "5000"){Rate = 	340.225	;}
				if (quantity == "10000"){Rate = 	549.95	;}
				if (quantity == "20000"){Rate = 	983.45	;}
			}			
			if (iColours == "2"){			
				if (quantity == "500"){Rate = 	139.945	;}
				if (quantity == "1000"){Rate = 	167.42	;}
				if (quantity == "2000"){Rate = 	248.355	;}
				if (quantity == "5000"){Rate = 	488.455	;}
				if (quantity == "10000"){Rate = 	799.025	;}
				if (quantity == "20000"){Rate = 	1396.55	;}
			}			
			if (iColours == "3"){			
				if (quantity == "500"){Rate = 	0	;}
				if (quantity == "1000"){Rate = 	0	;}
				if (quantity == "2000"){Rate = 	0	;}
				if (quantity == "5000"){Rate = 	0	;}
				if (quantity == "10000"){Rate = 	0	;}
				if (quantity == "20000"){Rate = 	0	;}
			}			
		}				
	}					
	if (sStock == "manillaSS"){					
		if (iSides == "1"){				
			if (iColours == "1"){			
				if (quantity == "500"){Rate = 	94.99	;}
				if (quantity == "1000"){Rate = 	115.175	;}
				if (quantity == "2000"){Rate = 	170.595	;}
				if (quantity == "5000"){Rate = 	328.075	;}
				if (quantity == "10000"){Rate = 	529.295	;}
				if (quantity == "20000"){Rate = 	949.43	;}
			}			
			if (iColours == "2"){			
				if (quantity == "500"){Rate = 	133.87	;}
				if (quantity == "1000"){Rate = 	157.7	;}
				if (quantity == "2000"){Rate = 	233.775	;}
				if (quantity == "5000"){Rate = 	467.8	;}
				if (quantity == "10000"){Rate = 	767.435	;}
				if (quantity == "20000"){Rate = 	1346.735	;}
			}			
			if (iColours == "3"){			
				if (quantity == "500"){Rate = 	0	;}
				if (quantity == "1000"){Rate = 	0	;}
				if (quantity == "2000"){Rate = 	0	;}
				if (quantity == "5000"){Rate = 	0	;}
				if (quantity == "10000"){Rate = 	0	;}
				if (quantity == "20000"){Rate = 	0	;}
			}			
		}				
	}					
}						
						
if (sSize == "DL"){						
	if (sStock == "whiteSS"){					
		if (iSides == "1"){				
			if (iColours == "1"){			
				if (quantity == "500"){Rate = 	59.755	;}
				if (quantity == "1000"){Rate = 	73.865	;}
				if (quantity == "2000"){Rate = 	120.78	;}
				if (quantity == "5000"){Rate = 	218.725	;}
				if (quantity == "10000"){Rate = 	343.4	;}
				if (quantity == "20000"){Rate = 	599.51	;}
			}			
			if (iColours == "2"){			
				if (quantity == "500"){Rate = 	81.625	;}
				if (quantity == "1000"){Rate = 	98.165	;}
				if (quantity == "2000"){Rate = 	164.52	;}
				if (quantity == "5000"){Rate = 	307.42	;}
				if (quantity == "10000"){Rate = 	489.2	;}
				if (quantity == "20000"){Rate = 	820.64	;}
			}			
			if (iColours == "3"){			
				if (quantity == "500"){Rate = 	0	;}
				if (quantity == "1000"){Rate = 	0	;}
				if (quantity == "2000"){Rate = 	0	;}
				if (quantity == "5000"){Rate = 	0	;}
				if (quantity == "10000"){Rate = 	0	;}
				if (quantity == "20000"){Rate = 	0	;}
			}			
		}				
	}					
	if (sStock == "manillaSS"){					
		if (iSides == "1"){				
			if (iColours == "1"){			
				if (quantity == "500"){Rate = 	57.325	;}
				if (quantity == "1000"){Rate = 	71.435	;}
				if (quantity == "2000"){Rate = 	117.135	;}
				if (quantity == "5000"){Rate = 	211.435	;}
				if (quantity == "10000"){Rate = 	331.25	;}
				if (quantity == "20000"){Rate = 	581.285	;}
			}			
			if (iColours == "2"){			
				if (quantity == "500"){Rate = 	77.98	;}
				if (quantity == "1000"){Rate = 	94.52	;}
				if (quantity == "2000"){Rate = 	157.23	;}
				if (quantity == "5000"){Rate = 	284.335	;}
				if (quantity == "10000"){Rate = 	470.975	;}
				if (quantity == "20000"){Rate = 	793.91	;}
			}			
			if (iColours == "3"){			
				if (quantity == "500"){Rate = 	0	;}
				if (quantity == "1000"){Rate = 	0	;}
				if (quantity == "2000"){Rate = 	0	;}
				if (quantity == "5000"){Rate = 	0	;}
				if (quantity == "10000"){Rate = 	0	;}
				if (quantity == "20000"){Rate = 	0	;}
			}			
		}				
	}					
}						


// 	END COPY PASTE SECTION ENVELOPES
	
	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.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 + "; Sides:" + iSides + ";\nColours:" + iColours + "; Pantone Mixes: " + sColourType + ";\nArtwork Supplied: " + bArtwork;
}

//-->