
var partPick    = "";
var surfacePick = "";
var formatPick  = "";
var sizePick    = "";

var Data            = new Array();
var description     = "";
var descriptionOrg  = "";
var cost            = "";
var costOrg         = "";

var screenAddon = "";
var quietMotor  = '<input type="checkbox" name="quietMotor" value="yes" onClick="addonSelected()">Quiet Motor';
var lowVoltage  = '<input type="checkbox" name="lowVoltage" value="yes" onClick="addonSelected()">Low Voltage Control Built-In';

var quietMotorPrice = 155.99;
var lowVoltagePrice = 199.99;

function setOptions(chosen) {
var selbox = document.myform.opttwo;
selbox.options.length = 0;
if (chosen == " ") {
selbox.options[selbox.options.length] = new Option('Please select one of the options above first',' ');
}

if (chosen == "999") {
selbox.options[selbox.options.length] = new Option('Screen Format',' ');
setOptionsTwo("99");
}
if (chosen == "Glass Beaded") {
selbox.options[selbox.options.length] = new Option('Screen Format','99');
selbox.options[selbox.options.length] = new Option('HDTV','HDTV');
selbox.options[selbox.options.length] = new Option('NTSC','NTSC');
selbox.options[selbox.options.length] = new Option('AV','AV');
}

if (chosen == "Matt White") {
selbox.options[selbox.options.length] = new Option('Screen Format','99');
selbox.options[selbox.options.length] = new Option('HDTV','HDTV');
selbox.options[selbox.options.length] = new Option('NTSC','NTSC');
selbox.options[selbox.options.length] = new Option('AV','AV');
}

surfacePick = chosen;
}

function setOptionsTwo(chosen) {
var selbox = document.myform.optthree;
selbox.options.length = 0;

if (chosen == " ") {
selbox.options[selbox.options.length] = new Option('Please select one of the options above first',' ');
}
if (chosen == "99") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
}
if (chosen == "AV" && surfacePick == "Glass Beaded") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('11 ft x 22 ft','11 ft x 22 ft');
selbox.options[selbox.options.length] = new Option('12 ft x 24 ft','12 ft x 24 ft');
selbox.options[selbox.options.length] = new Option('13 ft x 26 ft','13 ft x 26 ft');
selbox.options[selbox.options.length] = new Option('14 ft x 28 ft','14 ft x 28 ft');
selbox.options[selbox.options.length] = new Option('15 ft x 20 ft','15 ft x 20 ft');
selbox.options[selbox.options.length] = new Option('16 ft 6 inch x 22 ft','16 ft 6 inch x 22 ft');
selbox.options[selbox.options.length] = new Option('18 ft x 24 ft','18 ft x 24 ft');
selbox.options[selbox.options.length] = new Option('19 ft 6 inch x 26 ft','19 ft 6 inch x 26 ft');
selbox.options[selbox.options.length] = new Option('20 ft x 20 ft','20 ft x 20 ft');
selbox.options[selbox.options.length] = new Option('21 ft x 28 ft','21 ft x 28 ft');
selbox.options[selbox.options.length] = new Option('22 ft x 22 ft','22 ft x 22 ft');
selbox.options[selbox.options.length] = new Option('24 ft x 24 ft','24 ft x 24 ft');
}


if (chosen == "AV" && surfacePick == "Matt White") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('11 ft x 22 ft','11 ft x 22 ft');
selbox.options[selbox.options.length] = new Option('12 ft x 24 ft','12 ft x 24 ft');
selbox.options[selbox.options.length] = new Option('13 ft x 26 ft','13 ft x 26 ft');
selbox.options[selbox.options.length] = new Option('14 ft x 28 ft','14 ft x 28 ft');
selbox.options[selbox.options.length] = new Option('15 ft x 20 ft','15 ft x 20 ft');
selbox.options[selbox.options.length] = new Option('16 ft 6 inch x 22 ft','16 ft 6 inch x 22 ft');
selbox.options[selbox.options.length] = new Option('18 ft x 24 ft','18 ft x 24 ft');
selbox.options[selbox.options.length] = new Option('19 ft 6 inch x 26 ft','19 ft 6 inch x 26 ft');
selbox.options[selbox.options.length] = new Option('20 ft x 20 ft','20 ft x 20 ft');
selbox.options[selbox.options.length] = new Option('21 ft x 28 ft','21 ft x 28 ft');
selbox.options[selbox.options.length] = new Option('22 ft x 22 ft','22 ft x 22 ft');
selbox.options[selbox.options.length] = new Option('24 ft x 24 ft','24 ft x 24 ft');
}


if (chosen == "NTSC" && surfacePick == "Glass Beaded") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('25 ft','25 ft');
selbox.options[selbox.options.length] = new Option('27 ft 6 inch','27 ft 6 inch');
selbox.options[selbox.options.length] = new Option('30 ft','30 ft');
selbox.options[selbox.options.length] = new Option('32 ft 6 inch','32 ft 6 inch');
selbox.options[selbox.options.length] = new Option('35 ft','35 ft');
}


if (chosen == "NTSC" && surfacePick == "Matt White") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('25 ft','25 ft');
selbox.options[selbox.options.length] = new Option('27 ft 6 inch','27 ft 6 inch');
selbox.options[selbox.options.length] = new Option('30 ft','30 ft');
selbox.options[selbox.options.length] = new Option('32 ft 6 inch','32 ft 6 inch');
selbox.options[selbox.options.length] = new Option('35 ft','35 ft');
}


if (chosen == "HDTV" && surfacePick == "Glass Beaded") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('270 inch','270 inch');
selbox.options[selbox.options.length] = new Option('300 inch','300 inch');
selbox.options[selbox.options.length] = new Option('324 inch','324 inch');
selbox.options[selbox.options.length] = new Option('354 inch','354 inch');
selbox.options[selbox.options.length] = new Option('384 inch','384 inch');
}


if (chosen == "HDTV" && surfacePick == "Matt White") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('270 inch','270 inch');
selbox.options[selbox.options.length] = new Option('300 inch','300 inch');
selbox.options[selbox.options.length] = new Option('324 inch','324 inch');
selbox.options[selbox.options.length] = new Option('354 inch','354 inch');
selbox.options[selbox.options.length] = new Option('384 inch','384 inch');
}


 formatPick = chosen; 
}
function storeSize(chosen) {
sizePick= chosen;
}

function saveValues() {
document.Prod.PartNo.value = partPick;
document.Prod.Item.value = description;
document.Prod.Price.value = cost;
}

function displayValues() {
document.getElementById('unitInfo').innerHTML = surfacePick + " " + formatPick + " " + sizePick
document.getElementById('cost').innerHTML = "Our Price $" + cost +" Including Free Shipping<br><br>"

document.getElementById('button').innerHTML = '<input type="submit" value="ADD TO CART" class="btn">';
}

function displayAddons() {
  document.getElementById('access').innerHTML = screenAddon;
}

function ChooseProd() {

Data[0] = new Array("114086","Glass Beaded","AV","11 ft x 22 ft","","","","Paragon, 11 ft x 22 ft, AV, Glass Beaded, 110 V","2768");
Data[1] = new Array("114085","Matt White","AV","11 ft x 22 ft","","","","Paragon, 11 ft x 22 ft, AV, Matt White, 110 V","2768");
Data[2] = new Array("114092","Glass Beaded","AV","12 ft x 24 ft","","","","Paragon, 12 ft x 24 ft, AV, Glass Beaded, 110 V","2943");
Data[3] = new Array("114091","Matt White","AV","12 ft x 24 ft","","","","Paragon, 12 ft x 24 ft, AV, Matt White, 110 V","2943");
Data[4] = new Array("114098","Glass Beaded","AV","13 ft x 26 ft","","","","Paragon, 13 ft x 26 ft, AV, Glass Beaded, 110 V","6691");
Data[5] = new Array("114097","Matt White","AV","13 ft x 26 ft","","","","Paragon, 13 ft x 26 ft, AV, Matt White, 110 V","6691");
Data[6] = new Array("114102","Glass Beaded","AV","14 ft x 28 ft","","","","Paragon, 14 ft x 28 ft, AV, Glass Beaded, 110 V","8507");
Data[7] = new Array("114101","Matt White","AV","14 ft x 28 ft","","","","Paragon, 14 ft x 28 ft, AV, Matt White, 110 V","8507");
Data[8] = new Array("114082","Glass Beaded","AV","15 ft x 20 ft","","","","Paragon, 15 ft x 20 ft, AV, Glass Beaded, 110 V","2699");
Data[9] = new Array("114081","Matt White","AV","15 ft x 20 ft","","","","Paragon, 15 ft x 20 ft, AV, Matt White, 110 V","2699");
Data[10] = new Array("114088","Glass Beaded","AV","16 ft 6 inch x 22 ft","","","","Paragon, 16 ft 6 inch x 22 ft, AV, Glass Beaded, 110 V","2840");
Data[11] = new Array("114087","Matt White","AV","16 ft 6 inch x 22 ft","","","","Paragon, 16 ft 6 inch x 22 ft, AV, Matt White, 110 V","2840");
Data[12] = new Array("114094","Glass Beaded","AV","18 ft x 24 ft","","","","Paragon, 18 ft x 24 ft, AV, Glass Beaded, 110 V","3689");
Data[13] = new Array("114093","Matt White","AV","18 ft x 24 ft","","","","Paragon, 18 ft x 24 ft, AV, Matt White, 110 V","3689");
Data[14] = new Array("114100","Glass Beaded","AV","19 ft 6 inch x 26 ft","","","","Paragon, 19 ft 6 inch x 26 ft, AV, Glass Beaded, 110 V","8740");
Data[15] = new Array("114099","Matt White","AV","19 ft 6 inch x 26 ft","","","","Paragon, 19 ft 6 inch x 26 ft, AV, Matt White, 110 V","8740");
Data[16] = new Array("114084","Glass Beaded","AV","20 ft x 20 ft","","","","Paragon, 20 ft x 20 ft, AV, Glass Beaded, 110 V","2870");
Data[17] = new Array("114083","Matt White","AV","20 ft x 20 ft","","","","Paragon, 20 ft x 20 ft, AV, Matt White, 110 V","2870");
Data[18] = new Array("114104","Glass Beaded","AV","21 ft x 28 ft","","","","Paragon, 21 ft x 28 ft, AV, Glass Beaded, 110 V","10115");
Data[19] = new Array("114103","Matt White","AV","21 ft x 28 ft","","","","Paragon, 21 ft x 28 ft, AV, Matt White, 110 V","10115");
Data[20] = new Array("114090","Glass Beaded","AV","22 ft x 22 ft","","","","Paragon, 22 ft x 22 ft, AV, Glass Beaded, 110 V","2913");
Data[21] = new Array("114089","Matt White","AV","22 ft x 22 ft","","","","Paragon, 22 ft x 22 ft, AV, Matt White, 110 V","2913");
Data[22] = new Array("114096","Glass Beaded","AV","24 ft x 24 ft","","","","Paragon, 24 ft x 24 ft, AV, Glass Beaded, 110 V","4652");
Data[23] = new Array("114095","Matt White","AV","24 ft x 24 ft","","","","Paragon, 24 ft x 24 ft, AV, Matt White, 110 V","4652");
Data[24] = new Array("114114","Glass Beaded","NTSC","25 ft","","","","Paragon, 25 ft, NTSC, Glass Beaded, 110 V","2699");
Data[25] = new Array("114113","Matt White","NTSC","25 ft","","","","Paragon, 25 ft, NTSC, Matt White, 110 V","2699");
Data[26] = new Array("114116","Glass Beaded","NTSC","27 ft 6 inch","","","","Paragon, 27 ft 6 inch, NTSC, Glass Beaded, 110 V","2840");
Data[27] = new Array("114115","Matt White","NTSC","27 ft 6 inch","","","","Paragon, 27 ft 6 inch, NTSC, Matt White, 110 V","2840");
Data[28] = new Array("114212","Glass Beaded","HDTV","270 inch","","","","Paragon, 270 inch, HDTV, Glass Beaded, 110 V","2699");
Data[29] = new Array("114209","Matt White","HDTV","270 inch","","","","Paragon, 270 inch, HDTV, Matt White, 110 V","2699");
Data[30] = new Array("114118","Glass Beaded","NTSC","30 ft","","","","Paragon, 30 ft, NTSC, Glass Beaded, 110 V","3689");
Data[31] = new Array("114117","Matt White","NTSC","30 ft","","","","Paragon, 30 ft, NTSC, Matt White, 110 V","3689");
Data[32] = new Array("114213","Glass Beaded","HDTV","300 inch","","","","Paragon, 300 inch, HDTV, Glass Beaded, 110 V","2840");
Data[33] = new Array("114210","Matt White","HDTV","300 inch","","","","Paragon, 300 inch, HDTV, Matt White, 110 V","2840");
Data[34] = new Array("114120","Glass Beaded","NTSC","32 ft 6 inch","","","","Paragon, 32 ft 6 inch, NTSC, Glass Beaded, 110 V","8740");
Data[35] = new Array("114119","Matt White","NTSC","32 ft 6 inch","","","","Paragon, 32 ft 6 inch, NTSC, Matt White, 110 V","8740");
Data[36] = new Array("114214","Glass Beaded","HDTV","324 inch","","","","Paragon, 324 inch, HDTV, Glass Beaded, 110 V","3689");
Data[37] = new Array("114211","Matt White","HDTV","324 inch","","","","Paragon, 324 inch, HDTV, Matt White, 110 V","3689");
Data[38] = new Array("114122","Glass Beaded","NTSC","35 ft","","","","Paragon, 35 ft, NTSC, Glass Beaded, 110 V","10115");
Data[39] = new Array("114121","Matt White","NTSC","35 ft","","","","Paragon, 35 ft, NTSC, Matt White, 110 V","10115");
Data[40] = new Array("114215","Glass Beaded","HDTV","354 inch","","","","Paragon, 354 inch, HDTV, Glass Beaded, 110 V","8740");
Data[41] = new Array("114216","Matt White","HDTV","354 inch","","","","Paragon, 354 inch, HDTV, Matt White, 110 V","8740");
Data[42] = new Array("114217","Glass Beaded","HDTV","384 inch","","","","Paragon, 384 inch, HDTV, Glass Beaded, 110 V","10115");
Data[43] = new Array("114208","Matt White","HDTV","384 inch","","","","Paragon, 384 inch, HDTV, Matt White, 110 V","10115");


   for (i = 0; i < Data.length; i++) {
        if (surfacePick == Data[i][1] && formatPick == Data[i][2] && sizePick == Data[i][3])
        partPick = Data[i][0];
   }

    for (i = 0; i < Data.length; i++) {
        if (partPick == Data[i][0]) {
            if (Data[i][5] == "ql")     screenAddon = quietMotor + "<br>" + lowVoltage;
        else if (Data[i][4] == "q" ) {
            screenAddon = quietMotor;
            if (Data[i][6] == "l")  screenAddon = quietMotor + "<br>" + lowVoltage;
        }
        else if (Data[i][6] == "l") screenAddon = lowVoltage;
        else screenAddon = "";

            description = Data[i][7];
            descriptionOrg = description;
            cost = parseFloat(Data[i][8]);
            costOrg = cost;
        }
   }

   saveValues();
    displayValues();
}



function CheckBox() {
partPick = partPick.substring(0,6);
cost = costOrg;
description = descriptionOrg;

if (document.Prod.quietMotor) {
    if (document.Prod.quietMotor.checked) {
        document.Prod.quietMotor.setAttribute("checked","checked");
        partPick = partPick + "Q";
        cost = cost + quietMotorPrice;
        description = description + ", With Quiet Motor";

    } else {
        document.Prod.quietMotor.removeAttribute("checked");
        partPick = partPick.replace("Q","");

    }

}

    if (document.Prod.lowVoltage) {
        if (document.Prod.lowVoltage.checked) {
        document.Prod.lowVoltage.setAttribute("checked","checked");
        partPick = partPick + "L";
        cost = cost + lowVoltagePrice;
        description = description + ", With Low Voltage Controller";

    } else {
        document.Prod.lowVoltage.removeAttribute("checked");
        partPick = partPick.replace("L","");

    }

}
   if (document.Prod.quietMotor && document.Prod.lowVoltage) {
        if (document.Prod.quietMotor.checked && document.Prod.lowVoltage.checked) {
            partPick = partPick.substring(0,6) + "QL";
            cost = costOrg + quietMotorPrice + lowVoltagePrice;
            description = descriptionOrg + ", With Quiet Motor & Low Voltage Controller";
    }
}

cost = cost.toFixed(2);
}

function addonSelected() {
     CheckBox();
     saveValues();
     displayValues();
}

function resetCost() {
     if (sizePick != 9999 && formatPick != 99)
         displayAddons()
     else {
          document.getElementById('access').innerHTML = "";
          document.getElementById('unitInfo').innerHTML = "";
          document.getElementById('cost').innerHTML = "Select a Material, Format and Screen Size below<br><br>";
          document.getElementById('button').innerHTML = '<input disabled type="submit"value="ADD TO CART" class="btn">';
     }
}
