hs.graphicsDir = '/jscript/highslide/graphics/'; hs.showCredits = false; hs.align = 'center'; hs.transitions = ['expand', 'crossfade']; hs.fadeInOut = true; hs.outlineType = 'rounded-white';
hs.addSlideshow({ interval: 5000, repeat: false, useControls: true, fixedControls: 'fix', overlayOptions: {className: 'controls-in-heading', opacity: .75, position: 'bottom right', offsetY: 50, hideOnMouseOut: false} });
AC_FL_RunContent = 0;

$(document).ready(function () {
    $('ul.subLevelMenu').hide();

    $(".menu a.menuArrowDown").click(function () {
        $(this).next("ul.subLevelMenu").slideToggle(0).siblings("ul.subLevelMenu").slideUp("slow");
    });

    // FireFox
    $("embed").attr("wmode", "transparent");
    // IE
    var embedTag;
    $("embed").each(function (i) {
        embedTag = $(this).attr("outerHTML");
        if ((embedTag != null) && (embedTag.length > 0)) {
            embedTag = embedTag.replace(/embed /gi, "embed wmode=\"transparent\" ");
            $(this).attr("outerHTML", embedTag);
        } else {
            $(this).wrap("<div></div>");
        }
    });

    slideSwitch();
    setInterval("slideSwitch()", 10000);
   
});

function slideSwitch() {
    var $active = $('#headerllustration IMG.active');

    if ($active.length == 0) $active = $('#headerllustration IMG:last');

    var $next = $active.next().length ? $active.next()
    : $('#headerllustration IMG:first');

    $active.addClass('last-active');

    $active.animate({ opacity: 0.0 }, 1000, function() {
        $active.removeClass('active last-active');
    });

    $next.css({ opacity: 0.0 })
    .addClass('active')
    .animate({ opacity: 1.0 }, 1000);
}


/********* functions *************/

function switchMenu(menuType) {
    if ($("#" + pnlProductsClientID) && $("#" + pnlTrademarksClientID)) {
        if (menuType == 'T') {
            $("#" + pnlTrademarksClientID).show();
            $("#" + hrefTrademarksClientID).addClass('active');
            $("#" + pnlProductsClientID).hide();
            $("#" + hrefProductsClientID).removeClass('active');
        }
        if (menuType == 'P') {
            $("#" + pnlProductsClientID).show();
            $("#" + hrefProductsClientID).addClass('active');
            $("#" + pnlTrademarksClientID).hide();
            $("#" + hrefTrademarksClientID).removeClass('active');
        }
        $.cookie("selectedMenuTab", menuType, {path: '/'});
    }
}

function setFontSize(value) {
    var el = document.getElementById("changeableFontSizeArea");
    if (el.style.fontSize == "") { 
        el.style.fontSize = "1em"; 
    }
    var fontSize = parseFloat(el.style.fontSize);
    if (fontSize <= 0.8 && value == -1) { // too small
        return;
    }
    if (fontSize >= 1.6 && value == 1) { // too big
        return;
    }
    el.style.fontSize = fontSize + (value * 0.2) + "em";
    $.cookie("fontSize", el.style.fontSize, {path: '/', expires: 365 });
    setFontSizeButtonStatus(el.style.fontSize);
}

function setSavedFontSize() {
    var value = $.cookie("fontSize");
    if (value) {
        document.getElementById("changeableFontSizeArea").style.fontSize = value;
        setFontSizeButtonStatus(value)
    }
}

function setFontSizeButtonStatus(value) {
    fontSize = parseFloat(value);
    if (fontSize <= 0.8) { // too small
        $("#" + imgButtonSetFontSizeDownID).addClass("disabled");
    } else {
        $("#" + imgButtonSetFontSizeDownID).removeClass("disabled");
    }
    if (fontSize >= 1.6) { // too big
        $("#" + imgButtonSetFontSizeUpID).addClass("disabled");
    } else {
        $("#" + imgButtonSetFontSizeUpID).removeClass("disabled");
    }
}

function setViewType(value) {
    $.cookie("viewType", value, { path: '/', expires: 365 });
}

function setPageSize(value) {
    $.cookie("pageSize", value, { path: '/', expires: 365 });
}

function setSort(value) {
    $.cookie("itemsSort", value, { path: '/' });
}

function showProductDiscussion() {
    $(".divArticleDiscussion").toggle();
}

function clearSectionFilterValue() {
    $("#" + cboFilterClientID).val(0);
    $("#" + txtFilterMinPriceClientID).val('');
    $("#" + txtFilterMaxPriceClientID).val('');
    $("#" + chkStockOnlyClientID).removeAttr('checked');
}

