/******************************************************************************
* ixoctFunctions.js
******************************************************************************/


$(document).ready(function () {
    $('.ixoct-main-menu ul').superfish({
        delay: 400,                                         // one second delay on mouseout 
        animation: { opacity: 'show', height: 'show' },     // fade-in and slide-down animation 
        speed: 'fast',                                      // faster animation speed 
        autoArrows: false,                                  // disable generation of arrow mark-up 
        dropShadows: false                                  // disable drop shadows 
    });


    if (document.getElementById("ixoct-zoom") != null) {
        $("a#ixoct-zoom").fancybox({
            'titleShow': false,
            'padding': 5,
            'showNavArrows': false,
            'centerOnScroll': true,
            'overlayOpacity': 0.3,
            'overlayColor': '#413728',
            'type': 'image'
        });
    }


    $("#inputSearch").focus(function () {
        valueInputSearch = $(this).val();
        if ($(this).val() == "" || $(this).val() == "Rechercher" || $(this).val() == "Search" || $(this).val() == "Suche") {
            $(this).val("");
        }
    });


    var allItems = $("div.gshpCategoryListItem");
    if (allItems != 0) {
        for (i = 0; i < allItems.length - 0; i++) {
            if ((i + 1) % 3 == 0) {
                $(allItems[i]).css("margin-right", "0");
            }
        }
    }


    if (document.getElementById("ixoct-step2") != null) {
        var filter6 = $("#ixoct-step2").val();
        if (filter6 != '') {
            $("#inputSearchCata").val(filter6);
            $("#ixoct-search-text").text(filter6);
        }
    }


    var rayonnage = $(".gshpCategoryListItem");
    if (rayonnage.length > 0) {
        $(".filterBarContent").css("display", "none");
        $(".gshpProductList").css("display", "none");
    }


    if (typeof (getLangsToHide) != "undefined") {
        var tab = getLangsToHide();
        for (var i = 0; i < tab.length; i++) {
            if (tab[i] == 'de')
                $('.Deutsch').hide();
            if (tab[i] == 'fr')
                $('.Français').hide();
            if (tab[i] == 'en')
                $('.English').hide();
        }
    }
});
