 var mytyped = "";

    function getObj(f) {
        this.oForm = f;
        this.oUppht = f.upperheight;
        this.oFont = f.font;
        this.oStyle = f.style;
        this.oUpPrice = f.price1;
        this.oWidth = f.width;
        this.oMount = f.mounts;
        this.oStud = f.stud;
        this.oTempl = f.template;
        this.oColor = f.color1;
        this.oPgTotal = f.pgTotal;
        this.oQty = f.qty;
        this.oPattern = f.pTotal;
        this.oTotal = f.s_pgTotal;
        this.oMatte = f.matteColor;
        this.oFin = f.finish;
        this.di = document.images;
        return this, resetForm(), copyright(), doFont(), doSize(), dyMounts(), data(), getcopy("11", f.mounts), doStyle(), doSwatch(0), tot_cook();
    };


    function data() {
        var ucpr;
        var siz = oUppht.selectedIndex;
        siz = siz == -1 ? 0 : siz;
        this.dStr = dArr[getFont()][siz];
        if (oFont.selectedIndex < oFont.length - 1) {
            oWidth.value = dStr[2];
            ucpr = fixP(dStr[1]);
        } else {
            oWidth.value = "N/A";
            ucpr = fixP(dStr[oStyle.selectedIndex + 1]);
        };
        var mnt = oMount[oMount.selectedIndex].value.substr(0, 2);
        ucpr = mnt > 1 && mnt < 38 ? ucpr : (ucpr = ucpr * 90 / 100);
        ucpr = oForm.colorOpt[1].checked == true ? ucpr * 130 / 100 : ucpr;
        oUpPrice.value = fixP(ucpr);
        oWidth.value += "\"";
        analysis();
    };


    function analysis() {
        oMatte.disabled = oForm.colorOpt[1].checked == true ? false : true;
        if (oMatte.disabled == true) {
            oMatte.checked = false;
        };
        oPgTotal.value = fixP(parseFloat(oUpPrice.value));
        var pt = oTempl[oTempl.selectedIndex].text.substr(0, 2);
        var Qty = parseFloat(oQty.value);
        if (pt == "St" || pt == "Po") {
            addon = patternPrice;
            oPattern.value = fixP(addon * Qty);
        } else {
            oPattern.value = "0.00";
        };
        if (oForm.colorOpt[1].checked == true) {
            oFin.value = fixP(parseFloat(oUpPrice.value) * 30 / 100 * Qty);
        } else {
            oFin.value = "0.00";
        };
        oPgTotal.value = fixP(parseFloat(oPgTotal.value) * Qty);
        oTotal.value = oPgTotal.value = fixP(parseFloat(oPgTotal.value) + parseFloat(oPattern.value) + parseFloat(oFin.value));
        oForm.cartT2.value = fixP(parseFloat(oForm.cartT.value) + parseFloat(oPgTotal.value));
    };


    function dyMounts() {
        var oldIdx = oMount.selectedIndex;
        var x = 0;
        var h = oUppht.value;
        if (h == 2) {
            x = 0;
        } else if (h > 2 && h < 9) {
            x = 1;
        } else {
            x = 2;
        };
        var daLen = mtArr[x].length;
        for (var j = oMount.options.length - 1; j > 0; j--) {
            oMount.options[j] = null;
        };
        for (var k = 0; k < daLen; k++) {
            oMount.options[k] = new Option(mtArr[x][k][0], mtArr[x][k][1]);
        };
        oMount.selectedIndex = oldIdx > -1 && oldIdx < daLen ? oldIdx : 0;
    };


    function dyTemp() {
        var mnt = parseFloat(oMount[oMount.selectedIndex].value.substr(0, 2));
        if (mnt < 4) {
            x = 0;
        } else if (mnt > 3 && mnt < 7) {
            x = 1;
        } else {
            x = 0;
        };
        var daLen = pArr[x].length;
        for (var j = oTempl.options.length - 1; j > 0; j--) {
            oTempl.options[j] = null;
        };
        for (var k = 0; k < daLen; k++) {
            oTempl.options[k] = new Option(pArr[x][k][0], pArr[x][k][1]);
        };
        oTempl.selectedIndex = 0;
        oForm.imgpatn.src = "__mounts/yuk.png";
    };


    function getFont() {
        fon = oFont.selectedIndex;
        fon = fon == -1 ? 0 : fon;
        return fon;
    };


    function doStyle() {
        var daLen = sArr[getFont()].length;
        for (var j = oStyle.options.length - 1; j > 0; j--) {
            oStyle.options[j] = null;
        };
        for (var k = 0; k < daLen; k++) {
            oStyle.options[k] = new Option(sArr[fon][k][0], sArr[fon][k][1]);
        };
        oStyle.selectedIndex = 0;
    };


    function doFont() {
        var fArr = new Array;
        fArr = F.split("/");
        var faLen = fArr.length;
        for (var i = 0; i < faLen; i++) {
            var fFont = fArr[i].split("~");
            oFont.options[i] = new Option(fFont[0], fFont[1]);
        };
        oFont.selectedIndex = 0;
    };


    function doSize() {
        var daLen = dArr[getFont()].length;
        for (var j = oUppht.options.length - 1; j > 0; j--) {
            oUppht.options[j] = null;
        };
        for (var k = 0; k < daLen; k++) {
            oUppht.options[k] = new Option(dArr[fon][k][0] + "\"", dArr[fon][k][0]);
        };
        oUppht.selectedIndex = 0;
        di.imgF.src = "gImages/formed/fsymbols/" + oFont.value.toLowerCase() + ".jpg";
    };


    function showPD() {
        var mnt = parseInt(oMount[oMount.selectedIndex].value.substr(0, 2));
        if (mnt == 3) {
            oStud.disabled = false;
            oForm.brick.disabled = true;
        } else if (mnt == 4) {
            oStud.disabled = false;
            oForm.brick.disabled = false;
        } else if (mnt > 4 && mnt < 7) {
            oStud.disabled = false;
            oForm.brick.disabled = false;
        } else {
            oStud.disabled = true;
            oForm.brick.disabled = true;
            oStud.options.selectedIndex = 0;
        };
    };


    function addTo(arg) {
        analysis();
        var qVal = oForm.qty.value;
        var rc = oColor.selectedIndex == 0 ? "Please select a color" : "";
        if (rc) {
            return alert(rc);
        };
        if (isNaN(qVal) ||
            qVal.indexOf(".") != -1 || qVal < 1 || qVal.charAt(0) == 0) {
            alert("The quantity entered is incorrect : " + qVal + " - whole numbers only     ");
            return oForm.qty.value = 1;
        };
        var cookStr = "Product Type   ~ Formed Symbol" + "|Material      ~ Plastic" + "|Symbol        ~ " + oStyle[oStyle.selectedIndex].text + "|Height        ~ " + oUppht[oUppht.selectedIndex].text + "|Color         ~ " + oColor[oColor.selectedIndex].text + "|Mount         ~ " + oMount[oMount.selectedIndex].text + "|Ptn           ~ " + oTempl[oTempl.selectedIndex].text + "|sLen          ~ " + oStud.value + "|Mortar Gap    ~ " + oForm.brick.value + "|Qty           ~ " + parseFloat(qVal) + "|Price         ~ " + fixP(parseFloat(oTotal.value));
        cookStr = cookStr.replace(/\s+\~\s/g, "~");
        cookStr = cookStr.replace(/\s+\|\s/g, "|");
        cookStr = cookStr.replace(/["]/g, "#Y");
        cookStr = cookStr.replace(/[']/g, "#Z");
        toCook("item_", cookStr);
        location.href = "s_viewCart.htm";
    };


    function doMatte() {
        var x = /(Matte)/.test(oColor[oColor.selectedIndex].text);
        if (oMatte.checked == true && oColor.selectedIndex > 0) {
            if (oColor[oColor.selectedIndex].text.substr(0, 1) == "P") {
                if (x == false) {
                    oColor[oColor.selectedIndex].text = oColor[oColor.selectedIndex].text.substr(0, 5) + " Matte" + oColor[oColor.selectedIndex].text.substr(5);
                };
            } else {
                if (x == false) {
                    oColor[oColor.selectedIndex].text = oColor[oColor.selectedIndex].text.substr(0, 4) + " Matte " + oColor[oColor.selectedIndex].text.substr(5);
                };
            };
        } else {
            oColor[oColor.selectedIndex].text = oColor[oColor.selectedIndex].text.replace(/ Matte /g, " ");
        };
        analysis();
    };


    function doSwatch(x) {
        var c = new Array;
        if (x == 0) {
            c[0] = "c0000 | 000000 | Choose Pigmented Color";
            c[1] = "c5687 | FFFFFF | c5687 White";
            c[2] = "c4660 | F7D1AC | c4660 Desert Sand";
            c[3] = "c4310 | 918E95 | c4310 Dove Grey";
            c[4] = "c2025 | 000000 | c2025 Black";
            c[5] = "c2718 | F9E7C3 | c2718 Opaque Ivory";
            c[6] = "c2037 | FAD900 | c2037 Lemon Yellow";
            c[7] = "c2000 | FBD100 | c2000 Yellow";
            c[8] = "c2119 | F65507 | c2119 Orange";
            c[9] = "c2662 | F24024 | c2662 Red-Orange";
            c[10] = "c2793 | EE1108 | c2793 Red";
            c[11] = "c2240 | AB0E17 | c2240 Maroon";
            c[12] = "c2280 | 533D40 | c2280 Black Cherry";
            c[13] = "c2410 | F63C87 | c2410 Magenta";
            c[14] = "c2287 | 3E174E | c2287 purple";
            c[15] = "c2767 | 201A32 | c2767 Midnight Blue";
            c[16] = "c2050 | 13308C | c2050 Dark Blue";
            c[17] = "c2860 | 1D54D3 | c2860 Medium Blue";
            c[18] = "c3000 | 3996F5 | c3000 Blue";
            c[19] = "c2648 | 009CC9 | c2648 Light Blue";
            c[20] = "c3210 | 64D1CB | c3210 Teal Blue";
            c[21] = "c3555 | 647A3C | c3555 Spring Green";
            c[22] = "c2108 | 438120 | c2108 Light Green";
            c[23] = "c2030 | 305C27 | c2030 Dark Green";
            c[24] = "c2162 | 283931 | c2162 Hunter Green";
            c[25] = "m6371 | D29A43 | c6371 Yellow Gold";
            c[26] = "m2756 | 9D6D3D | c2756 Gold";
            c[27] = "m0253 | C07764 | c0253 Copper";
            c[28] = "c2418 | 563019 | c2418 Brown";
            c[29] = "m0312 | 7F654C | c0312 Medium Bronze";
            c[30] = "m3130 | 3D3332 | c3130 Duranodic Bronze";
            c[31] = "m8886 | BEB3B7 | c8886 Silver";
        } else if (x == 1) {
            c[0] = "p0000 | 000000 | Choose Solid Paint Color";
            c[1] = "p5687 | FFFFFF | p5687 White";
            c[2] = "p4310 | 918E95 | p4310 Dove Grey";
            c[3] = "p0209 | 999999 | p0209 Grey";
            c[4] = "p2025 | 000000 | p2025 Black";
            c[5] = "p2718 | F9E7C3 | p2718 Opaque Ivory";
            c[6] = "p8090 | C2D346 | p8090 Safety Green";
            c[7] = "p2037 | FAD900 | p2037 Lemon Yellow";
            c[8] = "p2000 | FBD100 | p2000 Yellow";
            c[9] = "p0217 | FDEC20 | p0217 Citrus Yellow";
            c[10] = "p0218 | FFD34C | p0218 Sundance Yellow";
            c[11] = "p0254 | D8940B | p0254 School bus Yellow";
            c[12] = "p2119 | F65507 | p2119 Orange";
            c[13] = "p2662 | F24024 | p2662 Red-Orange";
            c[14] = "p0256 | DB5607 | p0256 Rampart Orange";
            c[15] = "p2793 | EE1108 | p2793 Red";
            c[16] = "p0214 | B92E03 | p0214 Mexicali Red";
            c[17] = "p2240 | AB0E17 | p2240 Maroon";
            c[18] = "p2280 | 533D40 | p2280 Black Cherry";
            c[19] = "p2410 | F63C87 | p2410 Magenta";
            c[20] = "p2287 | 3E174E | p2287 purple";
            c[21] = "p0246 | 928FC5 | p0246 Violet Toner";
            c[22] = "p2767 | 201A32 | p2767 Midnight Blue";
            c[23] = "p2050 | 13308C | p2050 Dark Blue";
            c[24] = "p2860 | 1D54D3 | p2860 Medium Blue";
            c[25] = "p3000 | 3996F5 | p3000 Blue";
            c[26] = "p2648 | 009CC9 | p2648 Light Blue";
            c[27] = "p5425 | 677B82 | p5425 Marine Reef Blue";
            c[28] = "p3210 | 64D1CB | p3210 Teal Blue";
            c[29] = "p2108 | 438120 | p2108 Light Green";
            c[30] = "p0222 | 238820 | p0222 Emerald Green";
            c[31] = "p2030 | 305C27 | p2030 Dark Green";
            c[32] = "p0259 | 227527 | p0259 Federal Green";
            c[33] = "p2162 | 283931 | p2162 Hunter Green";
            c[34] = "p2418 | 563019 | p2418 Brown";
            c[35] = "m6371 | D29A43 | m6371 Metallic Yellow Gold";
            c[36] = "m2756 | 9D6D3D | m2756 Metallic Gold";
            c[37] = "m0401 | D39003 | m0401 Metallic Aztec Gold";
            c[38] = "m0253 | C07764 | m0253 Metallic Copper";
            c[39] = "m0402 | 945103 | m0402 Metallic Aztec Copper";
            c[40] = "m0312 | 7F654C | m0312 Metallic Medium Bronze";
            c[41] = "m0314 | 836158 | m0314 Metallic Old Copper";
            c[42] = "m3130 | 3D3332 | m3130 Metallic Duranodic Bronze";
            c[43] = "m8886 | BEB3B7 | m8886 Metallic Silver";
        } else {
            c[0] = "c0000 | 000000 | Choose Lightable Color";
            c[1] = "c1838 | FFFFFF | c1838 White";
            c[2] = "c1800 | FBD100 | c1800 Yellow";
            c[3] = "c1819 | F65507 | c1819 Orange";
            c[4] = "c1862 | F24024 | c1862 Red-Orange";
            c[5] = "c1893 | EE1108 | c1893 Red";
            c[6] = "c1848 | 009CC9 | c1848 Light Blue";
            c[7] = "c1855 | 647A3C | c1855 Spring Green";
        };
        var cData = c[0].split(" | ");
        var cHex = cData[1];
        cHex = cHex.replace(/^\s+/g, "").replace(/\s+$/g, "");
        var cLen = c.length;
        var list = "012345789ABCDEF";
        var fgCol = 0;
        for (var j = oColor.options.length - 1; j > 0; j--) {
            oColor.options[j] = null;
        };
        for (var i = 0; i < cLen; i++) {
            cArr = c[i].split(" | ");
            fgCol = list.indexOf(cArr[1].substr(0, 1)) + list.indexOf(cArr[1].substr(2, 1)) + list.indexOf(cArr[1].substr(4, 1));
            oColor.options[i] = new Option(cArr[2], cArr[1]);
            oColor.options[i].style.background = "#" + cArr[1];
            oColor.options[i].style.width = "180px";
            oColor.options[i].style.color = fgCol > 24 ? "#000000" : "#FFFFFF";
            oColor.selectedIndex = 0;
        };
    };


    function showLg(myid) {
        if (myid.substr(0, 1) == "p") {
            myid = myid.substr(1, 4);
            zoom(true, "gImages/minn/colors/" + myid + ".jpg", "CLICK ANYWHERE TO CLOSE", 343, 350);
        } else if (myid.substr(0, 1) == "m") {
            myid = myid.substr(1, 4);
            zoom(true, "__colors/metallic/" + myid + ".jpg", "CLICK ANYWHERE TO CLOSE", 343, 350);
        } else {
            myid = myid.substr(1, 4);
            zoom(true, "gImages/formed/colors/" + myid + ".jpg", "CLICK ANYWHERE TO CLOSE", 343, 350);
        };
    };


    function showSymbol(myid) {
        zoom(true, "gallery/Fgallery1-" + myid + ".jpg", "CLICK ANYWHERE TO CLOSE", 232, 334);
    };

