﻿function AddToCartFormValidator(theForm) {
    submitonce(theForm);
    if (document.getElementById('lns').innerText == "" && document.getElementById('Span6').disabled == "disabled") {
        try {
            alert("Please select Letters/Numbers.");
            theForm.Color.focus();
            submitenabled(theForm);
        } catch (err) { }
        return (false);
    }
    if ((theForm.Quantity.value * 1) < 1) {
        try {
            alert("Please specify the quantity you want to add to your cart");
            theForm.Quantity.focus();
            submitenabled(theForm);
        } catch (err) { }
        return (false);
    }
    if (theForm.Color.selectedIndex < 1) {
        try {
            alert("Please select a color.");
            theForm.Color.focus();
            submitenabled(theForm);
        } catch (err) { }
        return (false);
    }
    submitenabled(theForm);
    return (true);
}
function t_valid() {
    return (validateForm(this) && AddToCartFormValidator(this));
}
function subform() {
    document.AddToCartForm.IsWishList.value = '0';
    document.AddToCartForm.IsGiftRegistry.value = '0';
    if (validateForm(document.AddToCartForm) && AddToCartFormValidator(document.AddToCartForm)) {
        document.getElementById('Span6').disabled = "";
        document.getElementById('Quantity').disabled = false;
        document.AddToCartForm.submit();
        document.getElementById('Span6').disabled = "DISABLED";
        document.getElementById('Quantity').disabled = "DISABLED";
    }
}

var thisoldrow;
var thisoldcol;
var thiscell;
var thisoldbutton = "";
var thisoldcolbutton;
var cellrow;
var cellcol;
var myVarID;
var myPrice;

function myPriced(selqty) {
    findVar2(selqty);
    if (selqty > 2) {
        return myPrice2
    }
    else {
        return myPrice
    }
}

function findmecol(thisButton) {
    try {
        if (thisoldbutton.id == undefined) { return; }
    }
    catch (err) { return; }
    ClearQtyList();
    OptionQtyList(1, 1);
    OptionQtyList(2, 2);
    OptionQtyList(3, 3);
    OptionQtyList(4, 4);
    OptionQtyList(5, 5);
    OptionQtyList(6, 6);
    OptionQtyList(7, 7);
    OptionQtyList(8, 8);
    OptionQtyList(9, 9);
    OptionQtyList(10, 10);
    document.getElementById('Quantity').selectedIndex = 0;
    document.AddToCartForm.btnsel.disabled = "DISABLED";
    document.getElementById('Span6').disabled = "DISABLED";
    document.getElementById('Quantity').disabled = "DISABLED";
    try {
        thisoldcolbutton.className = "btn";
    }
    catch (err) { }
    try {
        document.getElementById(thisoldcolbutton.id + thisoldbutton.id).className = "";
    } catch (err) { }
    if (thisButton.value == "PACK") {
        document.AddToCartForm.btnsel.disabled = "";
        ex = thisoldbutton.id;
    } else {
        document.getElementById('Span6').disabled = "";
        document.getElementById('Quantity').disabled = false;
        ex = thisoldbutton.id;
    }
    thisButton.className = "btn2";
    thisoldcolbutton = thisButton;
    document.getElementById(thisButton.id + thisoldbutton.id).className = "cellsel";
    if (thisButton.value == "PACK") {
        myPrice = document.getElementById('PRICE' + ex).value;
        myPrice2 = document.getElementById('KPRICE' + ex).value;
        myVarID = ex;
    } else {
        myPrice = document.getElementById('KPRICE' + ex).value;
        myVarID = ex + 'K';
    }
    var exy = varArray;
    ClearOptionList();
    var col;
    var vid;
    for (x in exy) {
        if (exy[x] == ex) {
            x++;
            vid = exy[x];
            x++;
            col = exy[x];
            x++;
            document.getElementById('desc').innerText = exy[x];
            OptionList(vid, vid);
        }
    }
    clearln();
    document.getElementById('Quantity').selectedIndex = 0;
    document.getElementById('lns').innerText = "";
    document.getElementById('sprice').innerText = "";
    document.AddToCartForm.btnadd.disabled = "";
    document.AddToCartForm.btnsel.value = "Select Letters";
    document.AddToCartForm.Color.selectedIndex = 0;
    document.getElementById('colorspan').disabled = "";
    document.getElementById('Color').disabled = false;
}

function findme(thisButton) {
    ClearQtyList();
    OptionQtyList(1, 1);
    OptionQtyList(2, 2);
    OptionQtyList(3, 3);
    OptionQtyList(4, 4);
    OptionQtyList(5, 5);
    OptionQtyList(6, 6);
    OptionQtyList(7, 7);
    OptionQtyList(8, 8);
    OptionQtyList(9, 9);
    OptionQtyList(10, 10);
    document.getElementById('Quantity').selectedIndex = 0;
    document.AddToCartForm.btnsel.disabled = "disabled";
    document.getElementById('desc').innerText = "";
    document.getElementById('colorspan').disabled = "";
    document.getElementById('Color').disabled = false;
    document.getElementById('Span6').disabled = ""
    document.getElementById('Quantity').disabled = false;
    try {
        thisoldbutton.className = "btn";
    }
    catch (err) { }
    try {
        thisoldcolbutton.className = "btn";
    }
    catch (err) { }
    try {
        document.getElementById(thisoldcolbutton.id + thisoldbutton.id).className = "";
    }
    catch (err) { }
    thisButton.className = "btn2";
    thisoldbutton = thisButton;
    ex = thisButton.id;
    myVarID = ex;
    myPrice = document.getElementById('PRICE' + thisButton.id).value;
    myPrice2 = document.getElementById('KPRICE' + thisButton.id).value;
    var exy = varArray;
    ClearOptionList();
    var col;
    var vid;
    for (x in exy) {
        if (exy[x] == ex) {
            x++;
            vid = exy[x];
            x++;
            col = exy[x];
            x++;
            document.getElementById('desc').innerText = exy[x];
            OptionList(vid, vid);
        }
    }
    clearln();
    document.getElementById('lns').innerText = "";
    document.getElementById('sprice').innerText = "";
    document.AddToCartForm.btnadd.disabled = "";
    document.AddToCartForm.btnsel.disabled = "disabled";
    document.AddToCartForm.btnsel.value = "Select Letters";
    document.AddToCartForm.Color.selectedIndex = 0;
}

function findmelo(thisButton) {
    ex = thisButton.id;
    myVarID = ex;
    myPrice = document.getElementById('PRICE' + thisButton.id).value;
    myPrice2 = document.getElementById('KPRICE' + thisButton.id).value;
    var exy = varArray;
    ClearOptionList();
    var col;
    var vid;
    for (x in exy) {
        if (exy[x] == ex) {
            x++;
            vid = exy[x];
            x++;
            col = exy[x];
            OptionList(vid, vid);
        }
    }
    clearln();
    document.getElementById('lns').innerText = "";
    document.getElementById('sprice').innerText = "";
    document.AddToCartForm.btnadd.disabled = "";
    document.AddToCartForm.btnsel.disabled = "";
    document.AddToCartForm.btnsel.value = "Select Letters";
    document.AddToCartForm.Color.selectedIndex = 0;
    document.getElementById('colorspan').disabled = "";
    document.getElementById('Color').disabled = false;
}

function findVar(color) {
    var exy = varArray;
    var col;
    var vid;
    for (x in exy) {
        if (exy[x] == ex) {
            x--;
            x--;
            document.forms.AddToCartForm.VariantID.value = exy[x];
        }
    }
    document.getElementById('Quantity').selectedIndex = 0;
    document.getElementById('sprice').innerText = "";
}

function findVar2(selqty) {
    var color = document.getElementById('Color').value;
    if (selqty > 2) {
        ex = myVarID + 'D' + color;
    } else {
        ex = myVarID + color;
    }
    var exy = varArray;
    var col;
    var vid;
    for (x in exy) {
        if (exy[x] == ex) {
            x--;
            x--;
            document.forms.AddToCartForm.VariantID.value = exy[x];
        }
    }
}

function ClearOptionList() {
    var elSel = document.getElementById('Color');
    for (var count = elSel.options.length - 1; count >= 1; count--) {
        elSel.options[count] = null;
    }
}

function OptionList(num, val) {
    var elOptNew = document.createElement('option');
    elOptNew.text = num;
    elOptNew.value = val;
    var elSel = document.getElementById('Color');
    try {
        elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
    }
    catch (ex) {
        elSel.add(elOptNew); // IE only
    }
}

function ClearQtyList() {
    var elSel = document.getElementById('Quantity');
    for (var count = elSel.options.length - 1; count >= 1; count--) {
        elSel.options[count] = null;
    }
}

function OptionQtyList(num, val) {
    var elOptNew = document.createElement('option');
    elOptNew.text = num;
    elOptNew.value = val;
    var elSel = document.getElementById('Quantity');
    try {
        elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
        elSel.selectedIndex = 1;
    }
    catch (ex) {
        elSel.add(elOptNew); // IE only
        elSel.selectedIndex = 1;
    }
}

function bol() {
    ClearOptionList();
    if (thisoldrow.value == 'S3' || thisoldrow.value == 'S5' || thisoldrow.value == 'S7' || thisoldrow.value == 'S16V') {
        OptionList('A');
        OptionList('B');
        OptionList('C');
        OptionList('D');
        OptionList('E');
        OptionList('F');
        OptionList('G');
        OptionList('H');
        OptionList('I');
        OptionList('J');
        OptionList('K');
        OptionList('L');
        OptionList('M');
        OptionList('N');
        OptionList('O');
        OptionList('P');
        OptionList('Q');
        OptionList('R');
        OptionList('S');
        OptionList('T');
        OptionList('U');
        OptionList('V');
        OptionList('W');
        OptionList('X');
        OptionList('Y');
        OptionList('Z');
        OptionList('&');
    }
    OptionList('0');
    OptionList('1');
    OptionList('2');
    OptionList('3');
    OptionList('4');
    OptionList('5');
    OptionList('6');
    OptionList('7');
    OptionList('8');
    OptionList('9');
}


function appendOptionLast(num) {
    var elOptNew = document.createElement('option');
    elOptNew.text = num;
    elOptNew.value = num;
    var elSel = document.getElementById('selqty');

    try {
        elSel.add(elOptNew, null); // standards compliant; doesn't work in IE
    }
    catch (ex) {
        ((elSel.length - 1) > 9) ? elSel.options[elSel.length - 1] = null : 0 - 0;
        elSel.add(elOptNew); // IE only
        elSel.selectedIndex = (elSel.length - 1);
        document.getElementById("sc2").disabled = "";
        cellcolor();
    }
}
function RoundNumber(num, ndec, addz) {
    if (num != "") {
        var factor = Math.pow(10, ndec);

        num = Math.round(num * factor);
        num = num / factor;
        if (addz) {
            var dot = ("" + num).indexOf(".");
            if (dot >= 0) {
                var nzeros = dot + ndec + 1 - ("" + num).length;
                for (i = 0; i < nzeros; i++) {
                    num = num + "0";
                }
            }
            else {
                num = num + ".";
                for (i = 0; i < ndec; i++) {
                    num = num + "0";
                }
            }
        }
    }
    return (num);
}

function isNumberKey(evt) {
    var charCode = (evt.which) ? evt.which : event.keyCode
    if (charCode > 31 && (charCode < 48 || charCode > 57))
        return false;
    return true;
}

function closeln2() {
    document.getElementById("tblsel").style.visibility = "hidden";
}
function closeln() {
    var varr;
    var charr;
    varr = 0 - 0;
    document.getElementById("tblsel").style.visibility = "hidden";
    charr = '';
    charr = (document.getElementById('Text1').value > '') ? (charr + '(' + document.getElementById('Text1').value + ')A') : '';
    charr = (document.getElementById('Text2').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text2').value + ')B') : charr;
    charr = (document.getElementById('Text3').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text3').value + ')C') : charr;
    charr = (document.getElementById('Text4').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text4').value + ')D') : charr;
    charr = (document.getElementById('Text5').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text5').value + ')E') : charr;
    charr = (document.getElementById('Text6').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text6').value + ')F') : charr;
    charr = (document.getElementById('Text7').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text7').value + ')G') : charr;
    charr = (document.getElementById('Text8').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text8').value + ')H') : charr;
    charr = (document.getElementById('Text9').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text9').value + ')I') : charr;
    charr = (document.getElementById('Text10').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text10').value + ')J') : charr;
    charr = (document.getElementById('Text11').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text11').value + ')K') : charr;
    charr = (document.getElementById('Text12').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text12').value + ')L') : charr;
    charr = (document.getElementById('Text13').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text13').value + ')M') : charr;
    charr = (document.getElementById('Text14').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text14').value + ')N') : charr;
    charr = (document.getElementById('Text15').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text15').value + ')O') : charr;
    charr = (document.getElementById('Text16').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text16').value + ')P') : charr;
    charr = (document.getElementById('Text17').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text17').value + ')Q') : charr;
    charr = (document.getElementById('Text18').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text18').value + ')R') : charr;
    charr = (document.getElementById('Text19').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text19').value + ')S') : charr;
    charr = (document.getElementById('Text20').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text20').value + ')T') : charr;
    charr = (document.getElementById('Text21').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text21').value + ')U') : charr;
    charr = (document.getElementById('Text22').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text22').value + ')V') : charr;
    charr = (document.getElementById('Text23').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text23').value + ')W') : charr;
    charr = (document.getElementById('Text24').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text24').value + ')X') : charr;
    charr = (document.getElementById('Text25').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text25').value + ')Y') : charr;
    charr = (document.getElementById('Text26').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text26').value + ')Z') : charr;
    charr = (document.getElementById('Text27').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text27').value + ')0') : charr;
    charr = (document.getElementById('Text29').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text29').value + ')0') : charr;
    charr = (document.getElementById('Text30').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text30').value + ')1') : charr;
    charr = (document.getElementById('Text31').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text31').value + ')2') : charr;
    charr = (document.getElementById('Text32').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text32').value + ')3') : charr;
    charr = (document.getElementById('Text33').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text33').value + ')4') : charr;
    charr = (document.getElementById('Text34').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text34').value + ')5') : charr;
    charr = (document.getElementById('Text35').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text35').value + ')6') : charr;
    charr = (document.getElementById('Text36').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text36').value + ')7') : charr;
    charr = (document.getElementById('Text37').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text37').value + ')8') : charr;
    charr = (document.getElementById('Text38').value > '') ? (charr + ((charr > '') ? ', ' : '') + '(' + document.getElementById('Text38').value + ')9') : charr;
    varr = varr + parseInt(document.getElementById('Text1').value - 0);
    varr = varr + parseInt(document.getElementById('Text2').value - 0);
    varr = varr + parseInt(document.getElementById('Text3').value - 0);
    varr = varr + parseInt(document.getElementById('Text4').value - 0);
    varr = varr + parseInt(document.getElementById('Text5').value - 0);
    varr = varr + parseInt(document.getElementById('Text6').value - 0);
    varr = varr + parseInt(document.getElementById('Text7').value - 0);
    varr = varr + parseInt(document.getElementById('Text8').value - 0);
    varr = varr + parseInt(document.getElementById('Text9').value - 0);
    varr = varr + parseInt(document.getElementById('Text10').value - 0);
    varr = varr + parseInt(document.getElementById('Text11').value - 0);
    varr = varr + parseInt(document.getElementById('Text12').value - 0);
    varr = varr + parseInt(document.getElementById('Text13').value - 0);
    varr = varr + parseInt(document.getElementById('Text14').value - 0);
    varr = varr + parseInt(document.getElementById('Text15').value - 0);
    varr = varr + parseInt(document.getElementById('Text16').value - 0);
    varr = varr + parseInt(document.getElementById('Text17').value - 0);
    varr = varr + parseInt(document.getElementById('Text18').value - 0);
    varr = varr + parseInt(document.getElementById('Text19').value - 0);
    varr = varr + parseInt(document.getElementById('Text20').value - 0);
    varr = varr + parseInt(document.getElementById('Text21').value - 0);
    varr = varr + parseInt(document.getElementById('Text22').value - 0);
    varr = varr + parseInt(document.getElementById('Text23').value - 0);
    varr = varr + parseInt(document.getElementById('Text24').value - 0);
    varr = varr + parseInt(document.getElementById('Text25').value - 0);
    varr = varr + parseInt(document.getElementById('Text26').value - 0);
    varr = varr + parseInt(document.getElementById('Text27').value - 0);
    varr = varr + parseInt(document.getElementById('Text29').value - 0);
    varr = varr + parseInt(document.getElementById('Text30').value - 0);
    varr = varr + parseInt(document.getElementById('Text31').value - 0);
    varr = varr + parseInt(document.getElementById('Text32').value - 0);
    varr = varr + parseInt(document.getElementById('Text33').value - 0);
    varr = varr + parseInt(document.getElementById('Text34').value - 0);
    varr = varr + parseInt(document.getElementById('Text35').value - 0);
    varr = varr + parseInt(document.getElementById('Text36').value - 0);
    varr = varr + parseInt(document.getElementById('Text37').value - 0);
    varr = varr + parseInt(document.getElementById('Text38').value - 0);
    document.getElementById('lns').innerText = charr;
    ClearQtyList();
    OptionQtyList(varr, varr);
    document.getElementById('sprice').innerText = "$" + RoundNumber(myPrice * varr, 2, true);
    document.forms.AddToCartForm.TextOption.value = document.getElementById('lns').innerText;
}
function clearln() {
    document.getElementById('Text1').value = '';
    document.getElementById('Text2').value = '';
    document.getElementById('Text3').value = '';
    document.getElementById('Text4').value = '';
    document.getElementById('Text5').value = '';
    document.getElementById('Text6').value = '';
    document.getElementById('Text7').value = '';
    document.getElementById('Text8').value = '';
    document.getElementById('Text9').value = '';
    document.getElementById('Text10').value = '';
    document.getElementById('Text11').value = '';
    document.getElementById('Text12').value = '';
    document.getElementById('Text13').value = '';
    document.getElementById('Text14').value = '';
    document.getElementById('Text15').value = '';
    document.getElementById('Text16').value = '';
    document.getElementById('Text17').value = '';
    document.getElementById('Text18').value = '';
    document.getElementById('Text19').value = '';
    document.getElementById('Text20').value = '';
    document.getElementById('Text21').value = '';
    document.getElementById('Text22').value = '';
    document.getElementById('Text23').value = '';
    document.getElementById('Text24').value = '';
    document.getElementById('Text25').value = '';
    document.getElementById('Text26').value = '';
    document.getElementById('Text27').value = '';
    document.getElementById('Text29').value = '';
    document.getElementById('Text30').value = '';
    document.getElementById('Text31').value = '';
    document.getElementById('Text32').value = '';
    document.getElementById('Text33').value = '';
    document.getElementById('Text34').value = '';
    document.getElementById('Text35').value = '';
    document.getElementById('Text36').value = '';
    document.getElementById('Text37').value = '';
    document.getElementById('Text38').value = '';
}
function btnclick(row, thisrow) {
    try {
        thisoldrow.className = "btn";
        thisoldcol.className = "btn";
        cellclear();
        ((document.getElementById('selqty').length - 1) > 9) ? document.getElementById('selqty').options[document.getElementById('selqty').length - 1] = null : 0 - 0;
        document.getElementById("btnsln").style.visibility = "hidden";
        document.getElementById("sc3").style.visibility = "hidden";
        document.getElementById("sdesc").innerText = "";
        document.getElementById("sprice").innerText = "";
        document.getElementById("scolor").style.backgroundColor = "";
        document.forms.form1.btnadd.disabled = "false";
        document.forms.form1.select1.selectedIndex = 0;
        document.forms.form1.selcolor.selectedIndex = 0;
        document.forms.form1.selqty.selectedIndex = 0;
        document.getElementById('lns').innerText = '';
        clearln();
    } catch (err) {
    };
    document.getElementById("sc1").disabled = "";
    document.getElementById("sc2").disabled = "";
    document.getElementById("sc3").disabled = "";
    thisrow.className = "btn2";
    document.getElementById("sdesc").innerText = thisrow.value;
    cellrow = row;
    thisoldrow = thisrow;
    document.forms.form1.btnpk.disabled = (document.getElementById("tblprice").rows[row].cells[4].innerHTML == "&nbsp;");
    document.forms.form1.btnpc.disabled = (document.getElementById("tblprice").rows[row].cells[5].innerHTML == "&nbsp;");
    document.forms.form1.btnts.disabled = (document.getElementById("tblprice").rows[row].cells[6].innerHTML == "&nbsp;");
    document.forms.form1.btnkt.disabled = (document.getElementById("tblprice").rows[row].cells[7].innerHTML == "&nbsp;");
}
function btnclickcol(col, thiscol) {
    try {
        thisoldcol.className = "btn";
        cellclear();
        ((document.getElementById('selqty').length - 1) > 9) ? document.getElementById('selqty').options[document.getElementById('selqty').length - 1] = null : 0 - 0;
        document.getElementById("btnsln").style.visibility = "hidden";
        document.getElementById("sc3").style.visibility = "hidden";
        document.getElementById('lns').innerText = '';
        document.getElementById("sdesc").innerText = "";
        document.getElementById("sprice").innerText = "";
        document.getElementById("scolor").style.backgroundColor = "";
        document.forms.form1.btnadd.disabled = "";
        document.forms.form1.select1.selectedIndex = 0;
        document.forms.form1.selcolor.selectedIndex = 0;
        document.forms.form1.selqty.selectedIndex = 0;
        clearln();
    } catch (err) {
    };
    thiscol.className = "btn2";
    if (thiscol.value == "PIECE") {
        (document.forms.form1.btnpc.disabled == false) ? document.getElementById("btnsln").style.visibility = "" : document.getElementById("btnsln").style.visibility = "hidden";
    }
    if (thiscol.value == "PACK") {
        bol();
        document.getElementById("sc3").style.visibility = "";
        document.getElementById("sc3").disabled = "";
    }
    document.getElementById("sdesc").innerText = thisoldrow.value + "  " + thiscol.value;
    document.getElementById("sc1").disabled = "";
    document.getElementById("sc2").disabled = "";
    thisoldcol = thiscol;
    cellcol = col;
    cellcolor();
}
function selln() {
    document.getElementById("tblln").style.visibility = "hidden";
    document.getElementById("tblnum").style.visibility = "hidden";
    document.getElementById("tblsel").style.zIndex = 1;
    document.getElementById("tblsel").style.visibility = "";
    if (document.AddToCartForm.btnsel.value == "Select Letters") {
        document.getElementById("tblln").style.visibility = "";
        document.getElementById("Text1").focus();
    } else {
        document.getElementById("tblnum").style.visibility = "";
        document.getElementById("Text29").focus();
    }

}
function cellcolor() {
    document.getElementById("sprice").innerText = "$" + RoundNumber((document.getElementById(thecell).innerText * document.forms.form1.selqty.options[document.forms.form1.selqty.selectedIndex].value), 2, true);
}
function cellclear() {
    thecell = cellcol + "" + cellrow;
    document.getElementById(thecell).className = "";
}
