/***********
** 16 pt
***********/
var p16_40 = new Array();
p16_40[500] = 65;
p16_40[1000] = 85;
p16_40[2500] = 125;
p16_40[5000] = 175;
p16_40[10000] = 285;
p16_40[15000] = 350;
p16_40[20000] = 425;
var p16_41 = new Array();
p16_41[500] = 65;
p16_41[1000] = 85;
p16_41[2500] = 125;
p16_41[5000] = 175;
p16_41[10000] = 285;
p16_41[15000] = 365;
p16_41[20000] = 450;
var p16_44 = new Array();
p16_44[500] = 65;
p16_44[1000] = 85;
p16_44[2500] = 125;
p16_44[5000] = 175;
p16_44[10000] = 285;
p16_44[15000] = 375;
p16_44[20000] = 465;
/***********
** Linen
***********/
var linen = new Array();
linen[500] = 80;
linen[1000] = 100;
linen[2500] = 145;
linen[5000] = 195;
linen[10000] = 325;
linen[15000] = 450;
linen[20000] = 560;

/***********
** uncoated
***********/
var uncoated = new Array();
uncoated[500] = 65;
uncoated[1000] = 85;
uncoated[2500] = 145;
uncoated[5000] = 210;
uncoated[10000] = 430;
uncoated[15000] = 525;
uncoated[20000] = 725;

/***********
** Delivery Method
***********/
/*var ground = new Array();
ground[500] = 0;
ground[1000] = 0;
ground[2500] = 0;
ground[5000] = 0;
ground[10000] = 27;
ground[15000] = 40;
ground[20000] = 55;
*/
function calc(){
	f = document.add;
	totalDiv = document.getElementById("subTotal");
	shippingDiv = document.getElementById("shipping");
	stock = f.stock.options[f.stock.selectedIndex].value;
	//turnaround = f.turnaround.options[f.turnaround.selectedIndex].value;
	runsize = f.runsize.options[f.runsize.selectedIndex].value;
	//delivery = f.delivery.options[f.delivery.selectedIndex].value;
	color = f.color.options[f.color.selectedIndex].value;
	shippingCost =0;
	total = 0;
	product = "";
//	alert(runsize+","+turnaround+","+product+","+color);
 if(runsize != "" && stock!= "" && color!= ""){
	  if(stock == "16 pt"){
	  	product = "p16_";
		if(color == "4:0 - 1 sided, full color on front")
			product += "40";
		  else if(color == "4:1 - full color on front, black on back")
			product += "41";
		  else
			product += "44";
	  }else if(stock == "Recycled 100lb Linen Cover")	
	  	product = "linen";
	  else
	    product = "uncoated";
			  
	  total = eval(product+"[runsize]");
 }
 /*
	if(delivery != ""){	  
	  shippingCost = eval("ground[runsize]");	 
	  shippingDiv.innerHTML = "Shipping Cost: $"+shippingCost;
    }else if(delivery == "")
	  shippingDiv.innerHTML = "Shipping Cost: $0";
  */
f.total.value = total;
//total += shippingCost;
totalDiv.innerHTML = "Price: <span style=\"color:#ab3323\">$"+total+"</span>";
//"Subtotal: $"+total;
f.shippingCost.value = shippingCost;
}
function changeOption(obj){
var chosen = obj.options[obj.selectedIndex].value;
//alert(chosen);
f = document.add;
if(chosen == "Recycled 100lb Linen Cover" || chosen == "Recycled 100lb Uncoated Cover"){	
f.coating.options.length=0;
f.coating.options[0]=new Option("No Coating Available", "No Coating", true, false);
//new Option(text, value, defaultSelected, selected)
}else{
f.coating.options.length=0;
f.coating.options[0]=new Option("---Select Type Of Coating---","", true, false);
f.coating.options[1]=new Option("UV Coating on BOTH Sides","UV Coating on BOTH Sides",false, false);
f.coating.options[2]=new Option("UV Coating on FRONT only","UV Coating on FRONT only",false, false);
f.coating.options[3]=new Option("Matte Finish", "Matte Finish", false, false);
}
calc();
}
