
var partPick    = "";
var surfacePick = "";
var formatPick  = "";
var sizePick    = "";

var Data            = new Array();
var description     = "";
var descriptionOrg  = "";
var cost            = "";
var costOrg         = "";
var weight          = "";
var weightOrg       = "";

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 == "HC Matte 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('Square','Square');
}

if (chosen == "High Power") {
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('Square','Square');
}

if (chosen == "Matte 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('Square','Square');
}

if (chosen == "Silver Matte") {
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('Square','Square');
}

if (chosen == "Video Spectra 1.5") {
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('Square','Square');
}

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 == "NTSC" && surfacePick == "HC Matte White") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('43 inch x 57 inch','43 inch x 57 inch');
selbox.options[selbox.options.length] = new Option('50 inch x 67 inch','50 inch x 67 inch');
selbox.options[selbox.options.length] = new Option('60 inch x 80 inch','60 inch x 80 inch');
}


if (chosen == "NTSC" && surfacePick == "High Power") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('43 inch x 57 inch','43 inch x 57 inch');
selbox.options[selbox.options.length] = new Option('50 inch x 67 inch','50 inch x 67 inch');
selbox.options[selbox.options.length] = new Option('60 inch x 80 inch','60 inch x 80 inch');
}


if (chosen == "NTSC" && surfacePick == "Matte White") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('43 inch x 57 inch','43 inch x 57 inch');
selbox.options[selbox.options.length] = new Option('50 inch x 67 inch','50 inch x 67 inch');
selbox.options[selbox.options.length] = new Option('60 inch x 80 inch','60 inch x 80 inch');
}


if (chosen == "NTSC" && surfacePick == "Silver Matte") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('43 inch x 57 inch','43 inch x 57 inch');
selbox.options[selbox.options.length] = new Option('50 inch x 67 inch','50 inch x 67 inch');
selbox.options[selbox.options.length] = new Option('60 inch x 80 inch','60 inch x 80 inch');
}


if (chosen == "NTSC" && surfacePick == "Video Spectra 1.5") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('43 inch x 57 inch','43 inch x 57 inch');
selbox.options[selbox.options.length] = new Option('50 inch x 67 inch','50 inch x 67 inch');
selbox.options[selbox.options.length] = new Option('60 inch x 80 inch','60 inch x 80 inch');
}


if (chosen == "HDTV" && surfacePick == "HC Matte White") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('45 inch x 80 inch','45 inch x 80 inch');
selbox.options[selbox.options.length] = new Option('52 inch x 92 inch','52 inch x 92 inch');
}


if (chosen == "HDTV" && surfacePick == "High Power") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('45 inch x 80 inch','45 inch x 80 inch');
selbox.options[selbox.options.length] = new Option('52 inch x 92 inch','52 inch x 92 inch');
}


if (chosen == "HDTV" && surfacePick == "Matte White") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('45 inch x 80 inch','45 inch x 80 inch');
selbox.options[selbox.options.length] = new Option('52 inch x 92 inch','52 inch x 92 inch');
}


if (chosen == "HDTV" && surfacePick == "Silver Matte") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('45 inch x 80 inch','45 inch x 80 inch');
}


if (chosen == "HDTV" && surfacePick == "Video Spectra 1.5") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('45 inch x 80 inch','45 inch x 80 inch');
selbox.options[selbox.options.length] = new Option('52 inch x 92 inch','52 inch x 92 inch');
}


if (chosen == "Square" && surfacePick == "HC Matte White") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('50 inch x 50 inch','50 inch x 50 inch');
selbox.options[selbox.options.length] = new Option('60 inch x 60 inch','60 inch x 60 inch');
selbox.options[selbox.options.length] = new Option('70 inch x 70 inch','70 inch x 70 inch');
}


if (chosen == "Square" && surfacePick == "High Power") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('50 inch x 50 inch','50 inch x 50 inch');
selbox.options[selbox.options.length] = new Option('60 inch x 60 inch','60 inch x 60 inch');
selbox.options[selbox.options.length] = new Option('70 inch x 70 inch','70 inch x 70 inch');
}


if (chosen == "Square" && surfacePick == "Matte White") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('50 inch x 50 inch','50 inch x 50 inch');
selbox.options[selbox.options.length] = new Option('60 inch x 60 inch','60 inch x 60 inch');
selbox.options[selbox.options.length] = new Option('70 inch x 70 inch','70 inch x 70 inch');
}


if (chosen == "Square" && surfacePick == "Silver Matte") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('50 inch x 50 inch','50 inch x 50 inch');
selbox.options[selbox.options.length] = new Option('60 inch x 60 inch','60 inch x 60 inch');
selbox.options[selbox.options.length] = new Option('70 inch x 70 inch','70 inch x 70 inch');
}


if (chosen == "Square" && surfacePick == "Video Spectra 1.5") {
selbox.options[selbox.options.length] = new Option('Screen Size','9999');
selbox.options[selbox.options.length] = new Option('50 inch x 50 inch','50 inch x 50 inch');
selbox.options[selbox.options.length] = new Option('60 inch x 60 inch','60 inch x 60 inch');
selbox.options[selbox.options.length] = new Option('70 inch x 70 inch','70 inch x 70 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;
document.Prod.Weight.value = weight;
}

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("92737","HC Matte White","NTSC","43 inch x 57 inch","","","","Deluxe Model B, 43 inch x 57 inch, NTSC, HC Matte White","139.05","18");
Data[1] = new Array("83155","High Power","NTSC","43 inch x 57 inch","","","","Deluxe Model B, 43 inch x 57 inch, NTSC, High Power","260.55","18");
Data[2] = new Array("74696","Matte White","NTSC","43 inch x 57 inch","","","","Deluxe Model B, 43 inch x 57 inch, NTSC, Matte White","110.7","18");
Data[3] = new Array("90596","Silver Matte","NTSC","43 inch x 57 inch","","","","Deluxe Model B, 43 inch x 57 inch, NTSC, Silver Matte","139.05","18");
Data[4] = new Array("74219","Video Spectra 1.5","NTSC","43 inch x 57 inch","","","","Deluxe Model B, 43 inch x 57 inch, NTSC, Video Spectra 1.5","139.05","18");
Data[5] = new Array("92743","HC Matte White","HDTV","45 inch x 80 inch","","","","Deluxe Model B, 45 inch x 80 inch, HDTV, HC Matte White","202.5","28");
Data[6] = new Array("92060","High Power","HDTV","45 inch x 80 inch","","","","Deluxe Model B, 45 inch x 80 inch, HDTV, High Power","314.55","28");
Data[7] = new Array("92057","Matte White","HDTV","45 inch x 80 inch","","","","Deluxe Model B, 45 inch x 80 inch, HDTV, Matte White","163.35","28");
Data[8] = new Array("92059","Silver Matte","HDTV","45 inch x 80 inch","","","","Deluxe Model B, 45 inch x 80 inch, HDTV, Silver Matte","202.5","28");
Data[9] = new Array("92058","Video Spectra 1.5","HDTV","45 inch x 80 inch","","","","Deluxe Model B, 45 inch x 80 inch, HDTV, Video Spectra 1.5","202.5","28");
Data[10] = new Array("92729","HC Matte White","Square","50 inch x 50 inch","","","","Deluxe Model B, 50 inch x 50 inch, Square, HC Matte White","95.85","18");
Data[11] = new Array("83176","High Power","Square","50 inch x 50 inch","","","","Deluxe Model B, 50 inch x 50 inch, Square, High Power","226.8","18");
Data[12] = new Array("40215","Matte White","Square","50 inch x 50 inch","","","","Deluxe Model B, 50 inch x 50 inch, Square, Matte White","89.1","18");
Data[13] = new Array("90593","Silver Matte","Square","50 inch x 50 inch","","","","Deluxe Model B, 50 inch x 50 inch, Square, Silver Matte","95.85","18");
Data[14] = new Array("73563","Video Spectra 1.5","Square","50 inch x 50 inch","","","","Deluxe Model B, 50 inch x 50 inch, Square, Video Spectra 1.5","95.85","18");
Data[15] = new Array("92738","HC Matte White","NTSC","50 inch x 67 inch","","","","Deluxe Model B, 50 inch x 67 inch, NTSC, HC Matte White","157.95","23");
Data[16] = new Array("83156","High Power","NTSC","50 inch x 67 inch","","","","Deluxe Model B, 50 inch x 67 inch, NTSC, High Power","276.75","23");
Data[17] = new Array("74697","Matte White","NTSC","50 inch x 67 inch","","","","Deluxe Model B, 50 inch x 67 inch, NTSC, Matte White","128.25","23");
Data[18] = new Array("90597","Silver Matte","NTSC","50 inch x 67 inch","","","","Deluxe Model B, 50 inch x 67 inch, NTSC, Silver Matte","157.95","23");
Data[19] = new Array("73639","Video Spectra 1.5","NTSC","50 inch x 67 inch","","","","Deluxe Model B, 50 inch x 67 inch, NTSC, Video Spectra 1.5","157.95","23");
Data[20] = new Array("95526","HC Matte White","HDTV","52 inch x 92 inch","","","","Deluxe Model B, 52 inch x 92 inch, HDTV, HC Matte White","244.35","31");
Data[21] = new Array("95529","High Power","HDTV","52 inch x 92 inch","","","","Deluxe Model B, 52 inch x 92 inch, HDTV, High Power","338.85","31");
Data[22] = new Array("95525","Matte White","HDTV","52 inch x 92 inch","","","","Deluxe Model B, 52 inch x 92 inch, HDTV, Matte White","203.85","31");
Data[23] = new Array("95527","Video Spectra 1.5","HDTV","52 inch x 92 inch","","","","Deluxe Model B, 52 inch x 92 inch, HDTV, Video Spectra 1.5","244.35","31");
Data[24] = new Array("92730","HC Matte White","Square","60 inch x 60 inch","","","","Deluxe Model B, 60 inch x 60 inch, Square, HC Matte White","105.3","21");
Data[25] = new Array("83177","High Power","Square","60 inch x 60 inch","","","","Deluxe Model B, 60 inch x 60 inch, Square, High Power","237.6","21");
Data[26] = new Array("40223","Matte White","Square","60 inch x 60 inch","","","","Deluxe Model B, 60 inch x 60 inch, Square, Matte White","99.9","21");
Data[27] = new Array("90594","Silver Matte","Square","60 inch x 60 inch","","","","Deluxe Model B, 60 inch x 60 inch, Square, Silver Matte","105.3","21");
Data[28] = new Array("73564","Video Spectra 1.5","Square","60 inch x 60 inch","","","","Deluxe Model B, 60 inch x 60 inch, Square, Video Spectra 1.5","105.3","21");
Data[29] = new Array("92740","HC Matte White","NTSC","60 inch x 80 inch","","","","Deluxe Model B, 60 inch x 80 inch, NTSC, HC Matte White","202.5","28");
Data[30] = new Array("83157","High Power","NTSC","60 inch x 80 inch","","","","Deluxe Model B, 60 inch x 80 inch, NTSC, High Power","314.55","28");
Data[31] = new Array("74698","Matte White","NTSC","60 inch x 80 inch","","","","Deluxe Model B, 60 inch x 80 inch, NTSC, Matte White","163.35","28");
Data[32] = new Array("90598","Silver Matte","NTSC","60 inch x 80 inch","","","","Deluxe Model B, 60 inch x 80 inch, NTSC, Silver Matte","202.5","28");
Data[33] = new Array("73640","Video Spectra 1.5","NTSC","60 inch x 80 inch","","","","Deluxe Model B, 60 inch x 80 inch, NTSC, Video Spectra 1.5","202.5","28");
Data[34] = new Array("92731","HC Matte White","Square","70 inch x 70 inch","","","","Deluxe Model B, 70 inch x 70 inch, Square, HC Matte White","113.4","24");
Data[35] = new Array("83178","High Power","Square","70 inch x 70 inch","","","","Deluxe Model B, 70 inch x 70 inch, Square, High Power","253.8","24");
Data[36] = new Array("40230","Matte White","Square","70 inch x 70 inch","","","","Deluxe Model B, 70 inch x 70 inch, Square, Matte White","109.35","24");
Data[37] = new Array("90595","Silver Matte","Square","70 inch x 70 inch","","","","Deluxe Model B, 70 inch x 70 inch, Square, Silver Matte","113.4","24");
Data[38] = new Array("73565","Video Spectra 1.5","Square","70 inch x 70 inch","","","","Deluxe Model B, 70 inch x 70 inch, Square, Video Spectra 1.5","113.4","24");


   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;
            weight = Data[i][9];
            weightOrg = weight;
        }
   }

   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">';
     }
}

