 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.oSpacer = f.spacer;
        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(), data(), getcopy(11), doStyle(), doSwatch(0), tot_cook();
    };


    function data() {
        var ucpr;
        var siz = oUppht.selectedIndex;
        siz = siz == -1 ? 0 : siz;
        this.dStr = dArr[getFont()][siz];
        var alum = oForm.colorOpt[0].checked;
        ucpr = alum == true ? dStr[1] : dStr[2];
        var daColor = oForm.color1[oForm.color1.selectedIndex].text;
        ucpr = /(Painted)/.test(daColor) ? ucpr * 90 / 100 : /(Patina|Polished)/.test(daColor) ? ucpr * 130 / 100 : /(Anodized)/.test(daColor) ? ucpr * 145 / 100 : /(Oxidized)/.test(daColor) ? ucpr * 115 / 100 : ucpr;
        oUpPrice.value = fixP(ucpr);
        analysis();
    };


    function analysis() {
        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";
        };
        oPgTotal.value = fixP(parseFloat(oPgTotal.value) * Qty);
        oTotal.value = oPgTotal.value = fixP(parseFloat(oPgTotal.value) + parseFloat(oPattern.value));
        oForm.cartT2.value = fixP(parseFloat(oForm.cartT.value) + parseFloat(oPgTotal.value));
    };


    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/cast/symbols/" + oFont.value.toLowerCase() + ".jpg";
    };


    function showPD() {
        oSpacer.disabled = oMount.selectedIndex == 2 ? false : (oSpacer.selectedIndex = 0, true);
        oForm.brick.disabled = oMount.selectedIndex == 2 ? false : (oForm.brick.value = "0\"", true);
    };


    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 mtrl = oForm.colorOpt[0].checked == true ? "Aluminum" : "Bronze";
        var cookStr = "Product Type   ~ Cast Symbol" + "|Material      ~ " + mtrl + "|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.selectedIndex > 0 ? oStud[oStud.selectedIndex].text : "") + "|Spacer Length\t~ " + (oSpacer.selectedIndex > 0 ? oSpacer[oSpacer.selectedIndex].text : "") + "|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 doSwatch(x) {
        var c = new Array;
        if (x == 0) {
            c[0] = "0000 | 000000 | Choose Aluminum Finish";
            c[1] = "1333 | B2B6B9 | 1333 Satin Aluminum";
            c[2] = "3222 | C8C5C0 | 3222 Clear Anodized";
            c[3] = "4555 | 628469 | 4555 Nouveau Patina";
            c[4] = "3258 | D1A460 | 3258 Gold Anodized";
            c[5] = "4312 | 60534B | 4312 Medium Bronze Anodized";
            c[6] = "4313 | 4F4A46 | 4313 Dark Bronze Anodized";
            c[7] = "3204 | 363A3D | 3204 Black Anodized";
            c[8] = "p5687 | FFFFFF | p5687 Painted White";
            c[9] = "p4310 | 918E95 | p4310 Painted Dove Grey";
            c[10] = "p0209 | 999999 | p0209 Painted Grey";
            c[11] = "p2025 | 000000 | p2025 Painted Black";
            c[12] = "p2718 | F9E7C3 | p2718 Painted Opaque Ivory";
            c[13] = "p8090 | C2D346 | p8090 Painted Safety Green";
            c[14] = "p2037 | FAD900 | p2037 Painted Lemon Yellow";
            c[15] = "p2000 | FBD100 | p2000 Painted Yellow";
            c[16] = "p0217 | FDEC20 | p0217 Painted Citrus Yellow";
            c[17] = "p0218 | FFD34C | p0218 Painted Sundance Yellow";
            c[18] = "p0254 | D8940B | p0254 Painted School bus Yellow";
            c[19] = "p2119 | F65507 | p2119 Painted Orange";
            c[20] = "p2662 | F24024 | p2662 Painted Red-Orange";
            c[21] = "p0256 | DB5607 | p0256 Painted Rampart Orange";
            c[22] = "p2793 | EE1108 | p2793 Painted Red";
            c[23] = "p0214 | B92E03 | p0214 Painted Mexicali Red";
            c[24] = "p2240 | AB0E17 | p2240 Painted Maroon";
            c[25] = "p2280 | 533D40 | p2280 Painted Black Cherry";
            c[26] = "p2410 | F63C87 | p2410 Painted Magenta";
            c[27] = "p2287 | 3E174E | p2287 Painted purple";
            c[28] = "p0246 | 928FC5 | p0246 Painted Violet Toner";
            c[29] = "p2767 | 201A32 | p2767 Painted Midnight Blue";
            c[30] = "p2050 | 13308C | p2050 Painted Dark Blue";
            c[31] = "p2860 | 1D54D3 | p2860 Painted Medium Blue";
            c[32] = "p3000 | 3996F5 | p3000 Painted Blue";
            c[33] = "p2648 | 009CC9 | p2648 Painted Light Blue";
            c[34] = "p5425 | 677B82 | p5425 Painted Marine Reef Blue";
            c[35] = "p3210 | 64D1CB | p3210 Painted Teal Blue";
            c[36] = "p2108 | 438120 | p2108 Painted Light Green";
            c[37] = "p0222 | 238820 | p0222 Painted Emerald Green";
            c[38] = "p2030 | 305C27 | p2030 Painted Dark Green";
            c[39] = "p0259 | 227527 | p0259 Painted Federal Green";
            c[40] = "p2162 | 283931 | p2162 Painted Hunter Green";
            c[41] = "p2418 | 563019 | p2418 Painted Brown";
            c[42] = "m6371 | D29A43 | m6371 Metallic Yellow Gold";
            c[43] = "m2756 | 9D6D3D | m2756 Metallic Gold";
            c[44] = "m0401 | D39003 | m0401 Metallic Aztec Gold";
            c[45] = "m0253 | C07764 | m0253 Metallic Copper";
            c[46] = "m0402 | 945103 | m0402 Metallic Aztec Copper";
            c[47] = "m0312 | 7F654C | m0312 Metallic Medium Bronze";
            c[48] = "m0314 | 836158 | m0314 Metallic Old Copper";
            c[49] = "m3130 | 3D3332 | m3130 Metallic Duranodic Bronze";
            c[50] = "m8886 | BEB3B7 | m8886 Metallic Silver";
        } else {
            c[0] = "0000 | 000000 | Choose Bronze Finish";
            c[1] = "1444 | BF9D8A | 1444 Satin Bronze";
            c[2] = "6555 | 7F503E | 6555 Oxidized Bronze";
            c[3] = "5444 | 5C5451 | 5444 Dark Oxidized";
            c[4] = "1144 | CEA182 | 1144 Polished Bronze";
            c[5] = "8555 | 59827E | 8555 Patina-Traditional";
            c[6] = "8777 | 3B98A0 | 8777 Patina-Turquoise";
        };
        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", 232, 334);
        } else {
            myid = myid.substr(0, 4);
            zoom(true, "__colors/cast/c" + myid + "_L.jpg", "CLICK ANYWHERE TO CLOSE", 182, 300);
        };
    };


    function showSymbol(myid) {
        zoom(true, "gallery/Fgallery8-" + myid + ".jpg", "CLICK ANYWHERE TO CLOSE", 232, 334);
    };

