
function calc() {
var iTot = 0;
var mTot = 0;
	document.forms["add_cart1"].elements["quantity"].value = document.forms["add_cart1"].elements["quantity_50_100_10000"].value;


	if (document.forms["add_cart1"].elements["quantity"].type=="select-one")
	{ var quantity = document.forms["add_cart1"].elements["quantity"].options[document.forms["add_cart1"].elements["quantity"].selectedIndex].value; }
	else
	{ var quantity = document.forms["add_cart1"].elements["quantity"].value; }

	if (document.forms["add_cart1"].elements["colors_eventtickets"].type=="select-one")
	{ var colors_eventtickets = document.forms["add_cart1"].elements["colors_eventtickets"].options[document.forms["add_cart1"].elements["colors_eventtickets"].selectedIndex].value; }
	else
	{if (document.forms["add_cart1"].elements["colors_eventtickets"].length>0)
{

	for (var i=0; i < document.forms["add_cart1"].elements["colors_eventtickets"].length; i++)
	{if (document.forms["add_cart1"].elements["colors_eventtickets"][i].checked)
	{var colors_eventtickets =i ;
	break;}}
}else
{
	var colors_eventtickets =0;
	}}

	if (document.forms["add_cart1"].elements["numbering"].type=="select-one")
	{ var numbering = document.forms["add_cart1"].elements["numbering"].options[document.forms["add_cart1"].elements["numbering"].selectedIndex].value; }
	else
	{if (document.forms["add_cart1"].elements["numbering"].length>0)
{

	for (var i=0; i < document.forms["add_cart1"].elements["numbering"].length; i++)
	{if (document.forms["add_cart1"].elements["numbering"][i].checked)
	{var numbering =i ;
	break;}}
}else
{
	var numbering =0;
	}}

	if (document.forms["add_cart1"].elements["proof"].type=="select-one")
	{ var proof = document.forms["add_cart1"].elements["proof"].options[document.forms["add_cart1"].elements["proof"].selectedIndex].value; }
	else
	{if (document.forms["add_cart1"].elements["proof"].length>0)
{

	for (var i=0; i < document.forms["add_cart1"].elements["proof"].length; i++)
	{if (document.forms["add_cart1"].elements["proof"][i].checked)
	{var proof =i ;
	break;}}
}else
{
	var proof =0;
	}}

	if (document.forms["add_cart1"].elements["turnaround1235_recon"].type=="select-one")
	{ var turnaround1235_recon = document.forms["add_cart1"].elements["turnaround1235_recon"].options[document.forms["add_cart1"].elements["turnaround1235_recon"].selectedIndex].value; }
	else
	{if (document.forms["add_cart1"].elements["turnaround1235_recon"].length>0)
{

	for (var i=0; i < document.forms["add_cart1"].elements["turnaround1235_recon"].length; i++)
	{if (document.forms["add_cart1"].elements["turnaround1235_recon"][i].checked)
	{var turnaround1235_recon = document.forms["add_cart1"].elements["turnaround1235_recon"][i].value;

	var index_turnaround = i;
	break;}}
}else
{
	var turnaround1235_recon = document.forms["add_cart1"].elements["turnaround1235_recon"].value;

	var index_turnaround = 0;
	}}

	if ((quantity > 0 && quantity < 100))
	{
		turnaround1235_recon = index_turnaround;
iTot = iTot + ((((.30*quantity)*itemInfo[1][0][document.forms["add_cart1"].elements["colors_eventtickets"].selectedIndex])+((20*itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex])+(itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex]*((quantity/1000)*20))))* itemInfo[1][5][turnaround1235_recon]+14)+itemInfo[1][3][document.forms["add_cart1"].elements["proof"].selectedIndex];
		mTot = mTot + iTot /quantity;
	}


	if ((quantity >= 100 && quantity < 125))
	{
		turnaround1235_recon = index_turnaround;
iTot = iTot + ((((.27*quantity)*itemInfo[1][0][document.forms["add_cart1"].elements["colors_eventtickets"].selectedIndex])+((20*itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex])+(itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex]*((quantity/1000)*20))))* itemInfo[1][5][turnaround1235_recon]+14)*1.2+itemInfo[1][3][document.forms["add_cart1"].elements["proof"].selectedIndex];
		mTot = mTot + iTot /quantity;
	}


	if ((quantity >= 125 && quantity < 250))
	{
		turnaround1235_recon = index_turnaround;
iTot = iTot + ((((.27*quantity)*itemInfo[1][0][document.forms["add_cart1"].elements["colors_eventtickets"].selectedIndex])+((20*itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex])+(itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex]*((quantity/1000)*20))))* itemInfo[1][5][turnaround1235_recon]+14)*1.2+itemInfo[1][3][document.forms["add_cart1"].elements["proof"].selectedIndex];
		mTot = mTot + iTot /quantity;
	}


	if ((quantity >= 250 && quantity < 375))
	{
		turnaround1235_recon = index_turnaround;
iTot = iTot + ((((.25*quantity)*itemInfo[1][0][document.forms["add_cart1"].elements["colors_eventtickets"].selectedIndex])+((20*itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex])+(itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex]*((quantity/1000)*20))))* itemInfo[1][5][turnaround1235_recon]+14)*1.2+itemInfo[1][3][document.forms["add_cart1"].elements["proof"].selectedIndex];
		mTot = mTot + iTot /quantity;
	}


	if ((quantity >= 375 && quantity < 500))
	{
		turnaround1235_recon = index_turnaround;
iTot = iTot + ((((.23*quantity)*itemInfo[1][0][document.forms["add_cart1"].elements["colors_eventtickets"].selectedIndex])+((20*itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex])+(itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex]*((quantity/1000)*20))))* itemInfo[1][5][turnaround1235_recon]+14)*1.2+itemInfo[1][3][document.forms["add_cart1"].elements["proof"].selectedIndex];
		mTot = mTot + iTot /quantity;
	}


	if ((quantity >= 500 && quantity < 750))
	{
		turnaround1235_recon = index_turnaround;
iTot = iTot + ((((.21*quantity)*itemInfo[1][0][document.forms["add_cart1"].elements["colors_eventtickets"].selectedIndex])+((20*itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex])+(itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex]*((quantity/1000)*20))))* itemInfo[1][5][turnaround1235_recon]+14)*1.2+itemInfo[1][3][document.forms["add_cart1"].elements["proof"].selectedIndex];
		mTot = mTot + iTot /quantity;
	}


	if ((quantity >= 750 && quantity < 1000))
	{
		turnaround1235_recon = index_turnaround;
iTot = iTot + ((((.19*quantity)*itemInfo[1][0][document.forms["add_cart1"].elements["colors_eventtickets"].selectedIndex])+((20*itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex])+(itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex]*((quantity/1000)*20))))* itemInfo[1][5][turnaround1235_recon]+14)*1.2+itemInfo[1][3][document.forms["add_cart1"].elements["proof"].selectedIndex];
		mTot = mTot + iTot /quantity;
	}


	if ((quantity >= 1000 && quantity < 1250))
	{
		turnaround1235_recon = index_turnaround;
iTot = iTot + ((((.17*quantity)*itemInfo[1][0][document.forms["add_cart1"].elements["colors_eventtickets"].selectedIndex])+((20*itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex])+(itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex]*((quantity/1000)*20))))* itemInfo[1][5][turnaround1235_recon]+19)*1.2+itemInfo[1][3][document.forms["add_cart1"].elements["proof"].selectedIndex];
		mTot = mTot + iTot /quantity;
	}


	if ((quantity >= 1250 && quantity < 1500))
	{
		turnaround1235_recon = index_turnaround;
iTot = iTot + ((((.15*quantity)*itemInfo[1][0][document.forms["add_cart1"].elements["colors_eventtickets"].selectedIndex])+((20*itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex])+(itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex]*((quantity/1000)*20))))* itemInfo[1][5][turnaround1235_recon]+19)*1.2+itemInfo[1][3][document.forms["add_cart1"].elements["proof"].selectedIndex];
		mTot = mTot + iTot /quantity;
	}


	if (quantity >= 1500)
	{
		turnaround1235_recon = index_turnaround;
iTot = iTot + (((145+(((quantity-1000)/1000)*75)*itemInfo[1][0][document.forms["add_cart1"].elements["colors_eventtickets"].selectedIndex])+((20*itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex])+(itemInfo[1][1][document.forms["add_cart1"].elements["numbering"].selectedIndex]*((quantity/1000)*20))))* itemInfo[1][5][turnaround1235_recon]+19)*1.2+itemInfo[1][3][document.forms["add_cart1"].elements["proof"].selectedIndex];
		mTot = mTot + iTot /quantity;
	}

		
if(iTot == 0)
{
tTot = iTot;
document.getElementById("sptotal").innerHTML = 'Free';
document.forms["add_cart1"].elements["total"].value = '$0.00';
document.forms["add_cart1"].elements["price"].value = '$0.00';
document.getElementById("spprice").innerHTML = 'Free';
}
else
{
if (document.forms["add_cart1"].elements["price_factor"].value == 1)
{
        tTot = Math.round(iTot * 100) / 100 + .00001;
	    var price_factor = 1;
        tTot = tTot*price_factor;var totX = "" + tTot;
	    totX = totX.substring(0,totX.indexOf(".") + 3);
	    if(totX > 0 )
        {
            document.getElementById("sptotal").innerHTML = "$" + totX;
        }
        else
        {
            document.getElementById("sptotal").innerHTML = "Free";}
	        document.forms["add_cart1"].elements["total"].value = "$" + totX;

	        pTot = (tTot/quantity);
	        var totX = "" + pTot;
	        totX = totX.substring(0,totX.indexOf(".") + 4);
	        document.forms["add_cart1"].elements["price"].value = "$" + totX;
	        if(totX > 0 )
            {
                document.getElementById("spprice").innerHTML =  "$" + totX;
            }
            else
            {
                document.getElementById("spprice").innerHTML =  "Free";
             }

}
else
{
tTot = Math.round(iTot * 100) / 100 + .00001;
	var maxDisc = 0;
var price_factor = document.forms["add_cart1"].elements["price_factor"].value;
var calculatedDisc;
var discountedTotal;
var iDiscount;
var youSave;
var displayDisc;

calculatedDisc = tTot*(1-price_factor);
if(calculatedDisc > maxDisc && maxDisc > 0 )
{
    discountedTotal=tTot-maxDisc;
    iDiscount = maxDisc;
    displayDisc = "" + (Math.round(iDiscount* 100) / 100 + .001);
    displayDisc = displayDisc.substring(0, displayDisc.indexOf(".") + 3);
    document.getElementById("idYouSave").innerHTML = "$" + displayDisc;}
else
{
    discountedTotal=tTot*price_factor;
    iDiscount = (1-price_factor)*100;
displayDisc = "" + (Math.round(calculatedDisc* 100) / 100 + .001);
displayDisc = displayDisc.substring(0, displayDisc.indexOf(".") + 3);
document.getElementById("idYouSave").innerHTML ="" + Math.round(iDiscount) + "%" ;
document.getElementById("idYouSaveNew").innerHTML =  "- $" + displayDisc ;
}
var xDiscountedTotal = "" + discountedTotal;


	
xDiscountedTotal = xDiscountedTotal.substring(0,xDiscountedTotal.indexOf(".") + 3);
document.getElementById("idNowOnly").innerHTML = "$" + xDiscountedTotal;
	var totX = "" + tTot;
	totX = totX.substring(0,totX.indexOf(".") + 3);
	if(totX > 0 )
{
document.getElementById("sptotal").innerHTML = "$" + totX;}
else
{
document.getElementById("sptotal").innerHTML = "Free";}


	document.forms["add_cart1"].elements["total"].value = "$" + totX;

	pTot = (tTot/quantity);
	var totX = "" + pTot;
	totX = totX.substring(0,totX.indexOf(".") + 4);
pTot = (discountedTotal/quantity);
totX = "" + pTot;
totX = totX.substring(0,totX.indexOf(".") + 4);
	document.forms["add_cart1"].elements["price"].value = "$" + totX;
	if(totX > 0 )
{
document.getElementById("spprice").innerHTML =  "$" + totX;}
else
{
document.getElementById("spprice").innerHTML =  "Free";}

}
}
}


var itemInfo = new Array(1) ;
var fieldInfo = new Array(1) ;
var pfInfo = new Array(1) ;
var baseInfo = new Array(1) ;
itemInfo[1] = new Array(6);
fieldInfo[1] = new Array(6);
pfInfo[1] = new Array(6);
var sDescArr = new Array(6);
fieldInfo[1][0] = "colors_eventtickets";
itemInfo[1][0] = new Array(3);
pfInfo[1][0] = new Array(3);
itemInfo[1][0][0] = 1.00;
pfInfo[1][0][0] = 'NON';
itemInfo[1][0][1] = 1.80;
pfInfo[1][0][1] = 'NON';
itemInfo[1][0][2] = 1.80;
pfInfo[1][0][2] = 'NON';
fieldInfo[1][1] = "numbering";
itemInfo[1][1] = new Array(4);
pfInfo[1][1] = new Array(4);
itemInfo[1][1][0] = 0;
pfInfo[1][1][0] = 'NON';
itemInfo[1][1][1] = 1.00;
pfInfo[1][1][1] = 'NON';
itemInfo[1][1][2] = 1.00;
pfInfo[1][1][2] = 'NON';
itemInfo[1][1][3] = 1.00;
pfInfo[1][1][3] = 'NON';
fieldInfo[1][2] = "perforation";
itemInfo[1][2] = new Array(2);
pfInfo[1][2] = new Array(2);
itemInfo[1][2][0] = 1.00;
pfInfo[1][2][0] = 'NON';
itemInfo[1][2][1] = 0;
pfInfo[1][2][1] = 'NON';
fieldInfo[1][3] = "proof";
itemInfo[1][3] = new Array(3);
pfInfo[1][3] = new Array(3);
itemInfo[1][3][0] = 0;
pfInfo[1][3][0] = 'NON';
itemInfo[1][3][1] = 35.00;
pfInfo[1][3][1] = 'NON';
itemInfo[1][3][2] = 50.00;
pfInfo[1][3][2] = 'NON';
fieldInfo[1][4] = "quantity_50_100_10000";
itemInfo[1][4] = new Array(30);
pfInfo[1][4] = new Array(30);
itemInfo[1][4][0] = 50.00;
pfInfo[1][4][0] = 'NON';
itemInfo[1][4][1] = 100.00;
pfInfo[1][4][1] = 'NON';
itemInfo[1][4][2] = 150.00;
pfInfo[1][4][2] = 'NON';
itemInfo[1][4][3] = 200.00;
pfInfo[1][4][3] = 'NON';
itemInfo[1][4][4] = 250.00;
pfInfo[1][4][4] = 'NON';
itemInfo[1][4][5] = 300.00;
pfInfo[1][4][5] = 'NON';
itemInfo[1][4][6] = 350.00;
pfInfo[1][4][6] = 'NON';
itemInfo[1][4][7] = 400.00;
pfInfo[1][4][7] = 'NON';
itemInfo[1][4][8] = 450.00;
pfInfo[1][4][8] = 'NON';
itemInfo[1][4][9] = 500.00;
pfInfo[1][4][9] = 'NON';
itemInfo[1][4][10] = 600.00;
pfInfo[1][4][10] = 'NON';
itemInfo[1][4][11] = 700.00;
pfInfo[1][4][11] = 'NON';
itemInfo[1][4][12] = 800.00;
pfInfo[1][4][12] = 'NON';
itemInfo[1][4][13] = 900.00;
pfInfo[1][4][13] = 'NON';
itemInfo[1][4][14] = 1000.00;
pfInfo[1][4][14] = 'NON';
itemInfo[1][4][15] = 1250.00;
pfInfo[1][4][15] = 'NON';
itemInfo[1][4][16] = 1500.00;
pfInfo[1][4][16] = 'NON';
itemInfo[1][4][17] = 1750.00;
pfInfo[1][4][17] = 'NON';
itemInfo[1][4][18] = 2000.00;
pfInfo[1][4][18] = 'NON';
itemInfo[1][4][19] = 2500.00;
pfInfo[1][4][19] = 'NON';
itemInfo[1][4][20] = 3000.00;
pfInfo[1][4][20] = 'NON';
itemInfo[1][4][21] = 3500.00;
pfInfo[1][4][21] = 'NON';
itemInfo[1][4][22] = 4000.00;
pfInfo[1][4][22] = 'NON';
itemInfo[1][4][23] = 4500.00;
pfInfo[1][4][23] = 'NON';
itemInfo[1][4][24] = 5000.00;
pfInfo[1][4][24] = 'NON';
itemInfo[1][4][25] = 6000.00;
pfInfo[1][4][25] = 'NON';
itemInfo[1][4][26] = 7000.00;
pfInfo[1][4][26] = 'NON';
itemInfo[1][4][27] = 8000.00;
pfInfo[1][4][27] = 'NON';
itemInfo[1][4][28] = 9000.00;
pfInfo[1][4][28] = 'NON';
itemInfo[1][4][29] = 10000.00;
pfInfo[1][4][29] = 'NON';
fieldInfo[1][5] = "turnaround1235_recon";
itemInfo[1][5] = new Array(2);
pfInfo[1][5] = new Array(2);
itemInfo[1][5][0] = 1.00;
pfInfo[1][5][0] = 'NON';
itemInfo[1][5][1] = 1.30;
pfInfo[1][5][1] = 'NON';
baseInfo[1] = 0;
