<!--
var product_surcharge = 0.00;
//size pricing
//var hideittext="";
//var k =document.getElementById("hideit2");
//alert("asdf" + document.getElementById("hideit2"));

var framing_1 = new Array(8);
framing_1[0] = 0.00;
framing_1[1] = 325.00;
framing_1[2] = 425.00;
framing_1[3] = 540.00;
framing_1[4] = 650.00;
framing_1[5] = 875.00;
framing_1[6] = 1000.00;
framing_1[7] = 1125.00;

//this array associates the menus with the price id in the pricing table
var aframing_1 = new Array(8);
aframing_1[0] = 0; //none
aframing_1[1] = 49; //10x14
aframing_1[2] = 50; //14x20
aframing_1[3] = 51; //16x24
aframing_1[4] = 52; //20x30
aframing_1[5] = 53; //27x40
aframing_1[6] = 54; //34x50
aframing_1[7] = 55; //40x60

//double matted
var framing_2 = new Array(8);
framing_2[0] = 0.00;
framing_2[1] = 365.00;
framing_2[2] = 475.00;
framing_2[3] = 600.00;
framing_2[4] = 725.00;
framing_2[5] = 1000.00;
framing_2[6] = 0.00;
framing_2[7] = 0.00;

//double matted: this array associates the menus with the price id in the pricing table
var aframing_2 = new Array(8);
aframing_2[0] = 64; //loose
aframing_2[1] = 65; //10x14
aframing_2[2] = 66; //14x20
aframing_2[3] = 67; //16x24
aframing_2[4] = 68; //20x30
aframing_2[5] = 69; //27x40
aframing_2[6] = 64; //34x50 - loose, not available
aframing_2[7] = 64; //40x60 - loose, not available

//matted and framed
var framing_3 = new Array(8);
framing_3[0] = 0.00;
framing_3[1] = 465.00;	//10x14
framing_3[2] = 595.00;	//14x20
framing_3[3] = 745.00;	//16x24
framing_3[4] = 895.00;	//20x30
framing_3[5] = 1225.00;	//27x40
framing_3[6] = 0.00;		//34x50 (N/A)
framing_3[7] = 0.00;		//40x60	(N/A)

//matted and framed: this array associates the menus with the price id in the pricing table
var aframing_3 = new Array(8);
aframing_3[0] = 64; //loose
aframing_3[1] = 70; //10x14
aframing_3[2] = 71; //14x20
aframing_3[3] = 72; //16x24
aframing_3[4] = 73; //20x30
aframing_3[5] = 74; //27x40
aframing_3[6] = 64; //34x50 - loose, not available
aframing_3[7] = 64; //40x60 - loose, not available


//super gloss paper
var paper_2 = new Array(8);
paper_2[0] = 0.00;
paper_2[1] = 75.00;
paper_2[2] = 100.00;
paper_2[3] = 150.00;
paper_2[4] = 200.00;
paper_2[5] = 300.00;
paper_2[6] = 350.00;
paper_2[7] = 400.00;
//super gloss
var apaper_2 = new Array(8);
apaper_2[0] = 56; //gloss
apaper_2[1] = 57; //10x14
apaper_2[2] = 58; //14x20
apaper_2[3] = 59; //16x24
apaper_2[4] = 60; //20x30
apaper_2[5] = 61; //27x40
apaper_2[6] = 62; //34x50
apaper_2[7] = 63; //40x60

function CalculatePrice()
{
	var productprice = 0;
	var paper_1_price = 0;

	var paper_2_price = paper_2[document.priceform.product_size.selectedIndex];;
	var framing_1_price = framing_1[document.priceform.product_size.selectedIndex];
	var framing_2_price = framing_2[document.priceform.product_size.selectedIndex];
	var framing_3_price = framing_3[document.priceform.product_size.selectedIndex];
	
	
	if (document.priceform.product_paper[1].checked)   {
		productprice += paper_2_price;
		document.priceform.attribute2.value = apaper_2[document.priceform.product_size.selectedIndex];
	}
	if (document.priceform.product_framing[0].checked) {
		productprice += framing_1_price;
		document.priceform.attribute1.value = aframing_1[document.priceform.product_size.selectedIndex];
	}
	if (document.priceform.product_framing[1].checked) {
		productprice += framing_2_price;
		document.priceform.attribute3.value = aframing_2[document.priceform.product_size.selectedIndex];
	}
	if (document.priceform.product_framing[2].checked) {
		productprice += framing_3_price;
		document.priceform.attribute3.value = aframing_3[document.priceform.product_size.selectedIndex];
	}
	
	var itemcount = document.priceform.product_qty.value;
	
	if(document.priceform.product_size.value == ""){
	    CalculateTotal(0);}
	else
	{
		CalculateTotal(productprice*itemcount);
		CalculatePaper_2(paper_2_price*itemcount);
		if(framing_2_price > 0){
		    CalculateFraming_2((framing_2_price - framing_1_price)*itemcount);}
		else {
		    CalculateFraming_2(0);}
		if(framing_3_price > 0){
		    CalculateFraming_3((framing_3_price - framing_1_price)*itemcount);}
		else {
		   CalculateFraming_3(0); }
	}
	//alert ('attribute1 is '+document.priceform.attribute1.value+"\n"+
	//'attribute2 is '+document.priceform.attribute2.value+"\n"+
	//'attribute3 is '+document.priceform.attribute3.value+"\n");
}

function CalculateTotal(total)
{
	var value = FormatTotal(total);

	if ((document.priceform.product_framing[1].checked || document.priceform.product_framing[2].checked) && document.priceform.product_size.selectedIndex >= 6) {
	    var priceline = 'Total price: $0.00';}
	else {
	    var priceline = 'Total price: $' + value + ''; }
	
	if(document.getElementById){
		var i = document.getElementById("productTotal");
		i.innerHTML = priceline;
	} else if (document.layers){
		var nslyr = document.layers['productTotal'];
		nslyr.document.open('text/html');
		nslyr.document.write(priceline);
		nslyr.document.close();
	}
}

function CalculatePaper_2(total){
	var value = FormatTotal(total);
	var priceline = '(+ $' + value + ')';
	if(document.getElementById){
		var i = document.getElementById("productPaper_2");
		i.innerHTML = priceline;
	} else if (document.layers){
		var nslyr = document.layers['productPaper_2'];
		nslyr.document.open('text/html');
		nslyr.document.write(priceline);
		nslyr.document.close();
	}
}

function CalculateFraming_2(total)
{
	var value = FormatTotal(total);
	if (value > 0) {var priceline = '(+ $' + value + ')';} else {var priceline = '(not available)';}
	if(document.getElementById){
		var i = document.getElementById("productFraming_2");
		i.innerHTML = priceline;
	//	var j =document.getElementById("hideit2");
//		j.innerHTML = hideit2;
	} else if (document.layers){
		var nslyr = document.layers['productFraming_2'];
		nslyr.document.open('text/html');
		nslyr.document.write(priceline);
		nslyr.document.close();
	}
}

function CalculateFraming_3(total)
{
	var value = FormatTotal(total);
	if (value > 0) {var priceline = '(+ $' + value + ')';;toggleDiv("hideit2", "show");toggleDiv("hideit3", "show");} else {var priceline = '(not available)';toggleDiv("hideit2", "hide");toggleDiv("hideit3", "hide");}
	if(document.getElementById){
		var i = document.getElementById("productFraming_3");
		i.innerHTML = priceline;
	} else if (document.layers){
		var nslyr = document.layers['productFraming_3'];
		nslyr.document.open('text/html');
		nslyr.document.write(priceline);
		nslyr.document.close();
	}
}

function FormatTotal(price){

	var pricestr = String(price);
	var index = pricestr.indexOf(".");
	if(index == -1){return pricestr + ".00";}
	var num = pricestr.substring(index+1);
	
	if(num.length > 2){return pricestr.substring(0, index) + "." + num.substring(0, 2);}
	if(num.length == 1){return pricestr.substring(0, index) + "." + num + "0";}
	if(num.length == 0){return pricestr.substring(0, index) + ".00";}
	return pricestr;
}

function checkSize(){
	if(document.priceform.product_size.value=="") {
		alert ("Please Select a Size");
		return (false);
	}
}

function toggleDiv(whichLayer, action) {
        if (document.getElementById) {
                //this is the way the standards work
                var divtag = document.getElementById(whichLayer);
        } else
        if (document.all) {
                // this is the way old msie versions work
                var divtag = document.all[whichLayer];
        } else if (document.layers) {
                // this is the way nn4 works
                var divtag = document.layers[whichLayer];
        }

        style2 = divtag.style;

        if (!action) { //just toggle
                if (style2.display == "block") {
                        //alert("1 style2.display "+style2.display);
                        style2.display = "none";
                } else {
                        //alert("2 style2.display "+style2.display);
                        style2.display = "block";
                }
        } else { //show or hide
                if (action == 'show')
                        style2.display = "block";
                else
                        style2.display = "none";
        }

}

