function WriteSelectedProduct(value, v1, v2, v3, v4, v5) {
    var hd = document.getElementById("hdSeletedProduct");
    var hdAttachCategory = document.getElementById("hdAttachCategory");
    var f = document.getElementById("aspnetForm");
    hd.value = value;
    hdAttachCategory.value = v5;
    if (v2 == '') {
        f.action = String.format("/{0}/{1}/{2}.aspx", v1, v3, v4);
    }
    else {
        f.action = String.format("/{0}/{1}/{2}/{3}.aspx", v1, v2, v3, v4);

    }
}
function WriteSelectedProductFromCate(value, v1, v2, v3, v4, v5,v6) {
    var hdFromCategory = document.getElementById("hdFromCategory");
    var hd = document.getElementById("hdSeletedProduct");
    var hdAttachCategory = document.getElementById("hdAttachCategory");
    var f = document.getElementById("aspnetForm");
    hd.value = value;
    hdAttachCategory.value = v5;
    hdFromCategory.value = v6;
    if (v2 == '') {
        f.action = String.format("/{0}/{1}/{2}.aspx", v1, v3, v4);
    }
    else {
        f.action = String.format("/{0}/{1}/{2}/{3}.aspx", v1, v2, v3, v4);

    }
}
//choose a left menu
function WriteSelectedCategory(value, v1, v2, v3, title) {

    var hd = document.getElementById("hdCategory");
    var f = document.getElementById("aspnetForm");
    hd.value = value;
    if (v2 == '') {
        f.action = String.format("/{0}/{1}.aspx", v1, v3);
    }
    else {
        f.action = String.format("/{0}/{1}/{2}.aspx", v1, v2, v3);
    }

}


function WriteSelectedManufacturer(value, v1, v2, v3, title, isManufacturer) {

    var f = document.getElementById("aspnetForm");
    var hd;
    if (isManufacturer == true) {
        var hdManu = document.getElementById("hdManufacturer");
        hdManu.value = value;
        hd = document.getElementById("hdCategory");
        hd.value = "";
        f.action = String.format("/{0}/{1}.aspx", v1, v2);
    }
    else {
        hd = document.getElementById("hdCategory");
        hd.value = value;
        if (v2 == '') {
            f.action = String.format("/{0}/{1}.aspx", v1, v3);
        }
        else {
            f.action = String.format("/{0}/{1}/{2}.aspx", v1, v2, v3);
        }
    }
}

function SetWidthForNoWrap() {
    var tds = document.getElementsByTagName("td");
    if (navigator.appName == "Microsoft Internet Explorer") {
        for (var t = 0; t < tds.length; t++) {
            var style = tds[t].getAttribute("style");
            if (style != null) {
                var styleString = style + "";
                if (styleString.toString().indexOf("[object]") == 0) {
                    if (style["width"] == "90%") {
                        tds[t].style.width = '0%';
                        //tds[t].style.fontSize = '0px';
                    }
                }
                else {
                    if (styleString.indexOf("90%", 0) != -1) {
                        tds[t].style.width = '0%';
                        //tds[t].style.fontSize = '0px';
                    }
                }
            }
        }
    }
    else {
        for (var t = 0; t < tds.length; t++) {
            if (tds[t].getAttribute("nowrap") != null && tds[t].getAttribute("nowrap") == '') {
                tds[t].style.width = "0px";
                tds[t].style.fontSize = '0';
            }
            if (tds[t].getAttribute("style") == 'padding: 3px 0px 0px; width: 636px;') {

                tds[t].style.padding = "3px 3px 0px 0px";
            }
        }
    }
}

/*end*/




//if (window.addEventListener)
//    window.addEventListener("load", createcssmenu2, false)
//else if (window.attachEvent)
//    window.attachEvent("onload", createcssmenu2)
