/* This is the Javasript file for the instantQuote.html system
this file is the property of Aartplus.com and copying and or using it without prier
permission is strictly prohibited */

function updatePrice() 
{
var paperTypeP = 0.00;
var quantityP = 0.00;
var printingP = 0.00;
var turnaroundP = 0.00;
var proofP = 0.00;
var frontFinishP = 0.00;
var backFinishP = 0.00;
var roundCornersP = 0.00;
var shrinkWrappingP = 0.00;
var setOfP = 0.00;
	
var paperType = parseInt(document.form1.selectbox2.value);
var quantity = parseInt(document.form1.selectbox3.value);
var printing = parseInt(document.form1.selectbox4.value);
var turnaround = parseInt(document.form1.selectbox5.value);
var proof = parseInt(document.form1.selectbox6.value);
var frontFinish = parseInt(document.form1.selectbox7.value);
var backFinish = parseInt(document.form1.selectbox8.value);
var roundCorners = parseInt(document.form1.selectbox9.value);
var shrinkWrapping = parseInt(document.form1.selectbox10.value);
var setsOf = parseInt(document.form1.selectbox3.value);

if (paperType != 1)
	{
	document.form1.selectbox7.disabled=true;
	document.form1.selectbox8.disabled=true;
	var x = document.form1.selectbox7.selectedIndex;
	var y = document.form1.selectbox8.selectedIndex;

	if (x!=0 || y!=0){
		document.form1.selectbox7.selectedIndex = 0;
		document.form1.selectbox8.selectedIndex = 0;	
	}
	document.getElementById('f1').innerHTML = "No Coating";
	document.getElementById('b1').innerHTML = "No Coating";
	frontFinishP = 0.00;
	paperTypeP = 15.50;
	}
	else if(paperType == 1)
	{
	document.form1.selectbox7.disabled=false;
	document.form1.selectbox8.disabled=false;
	document.getElementById('f1').innerHTML = "Aqueous Coating";
	document.getElementById('b1').innerHTML = "Aqueous Coating";
	paperTypeP = 15.50;
	}

switch (quantity){
	case 1:
	quantityP = 0.00;
	break;
	case 2:
	quantityP = 2.00;
	break;
	case 3:
	quantityP = 5.00;
	break;
	default: quantityP = 0.00;
}
if (printing == 1 && quantity == 1)
	{
	printingP = 0.00;
	}	
	else if (printing == 1 && quantity == 2)
	{
	printingP = 0.00;
	}
	else if (printing == 1 && quantity == 3)
	{
	printingP = 0.00;
	}
	else if (printing == 2 && quantity == 1)
	{	
	printingP = 5.00;
	}
	else if (printing == 2 && quantity == 2)
	{	
	printingP = 5.50;
	}
	else if (printing == 2 && quantity == 3)
	{	
	printingP = 5.50;
	}

switch (turnaround){
	case 1:
	turnaroundP = 5;
	break;
	case 2:
	turnaroundP = 10;
	break;
	case 3:
	turnaroundP = 20;
	break;
	case 4:
	turnaroundP = 30;
	break;
	default: turnaroundP = 5;
}
if (proof == 1)
	{
	proofP = 0.00;
	}
	else if (proof == 2)
	{
	proofP = 45.00;
	}

switch (frontFinish){
	case 1: 
	if (quantity == 1){
		frontFinishP = 0.00;
		break;
		}
	else if (quantity == 2){
		frontFinish = 2.50;
		break;
		}
	else if (quantity == 3){
		frontFinish = 5.00;
		break;
		}
	case 2:
	if (quantity == 1){
		frontFinishP = 100.50;
		break;
		} 
	else if (quantity == 2){
		frontFinishP = 11.00;
		break;
		}
	else if (quantity == 3){
		frontFinish = 17.00;
		break;
		}
	case 3:
	if (quantity == 1){
		frontFinishP = 8.50;
		break;
		} 
	else if (quantity == 2){
		frontFinishP = 11.00;
		break;
		}
	else if (quantity == 3){
		frontFinishP = 17.00;
		break;
		}
	default: frontFinishP = 0.00;
}
if (shrinkWrapping !=1)
	{
	shrinkWrappingP = 5.00;
	document.form1.sets_of.disabled = false;
	document.getElementById("lbl").className="";
	}
	else
	{
	document.form1.sets_of.disabled = true;
	document.getElementById("lbl").className="lbl_sets_of";
	shrinkWrappingP = 0.00;
	}
	
var total = (paperTypeP  + printingP + turnaroundP + proofP + frontFinishP + shrinkWrappingP);

window.document.getElementById("price_top").innerHTML = '$'+(total.toPrecision(4));
window.document.getElementById("price_botom").innerHTML = '$'+(total.toPrecision(4));
}