var carousselSubmit = null;
var carousselVideoId = function (videoId) { };

function applyWatermark() {
    $('.watermark').each(function(){
           if ($(this).val() == $(this).attr('title')) {$(this).addClass('on');}
           $(this).focus(function(){
                   $(this).filter(function() {return $(this).val() == "" || $(this).val() == $(this).attr('title')}).removeClass("on").val("");
                   $(this).removeClass("swap_value");
           });
           $(this).blur(function(){
                   $(this).filter(function() {return $(this).val() == ""}).addClass("on").val($(this).attr('title'));
                   $(this).addClass("swap_value");
           });
    });
}

function listTypeSelectorHome(){
     /*index page - switch between gallery and list view of products */
     $("#listTypeSelector .listType a").click(function(){
        $this = $(this);
        if(!$this.hasClass("active")) {
             $("#listTypeSelector .listType a").each(function(){
                $(this).removeClass("active");
             });
            $(this).addClass("active");
            var relActive = $this.attr("rel");
            
            $("#listContainer .homeBlock").each(function(){
                if($(this).hasClass(relActive)){
                    $(this).css("display","block");
                } else{
                    $(this).css("display","none");
                } 
            });
        } 
        return false; 
    });
     $("#listTypeSelector .sort a").click(function(){
         $("#listTypeSelector .sort a").each(function(){
            $(this).removeClass("active");
         });
         $(this).addClass("active");
    });
}

function listTypeSelectorFrame() {
    /*index page - switch between gallery and list view of products */
    $("#listTypeSelector .listType a").click(function() {
        $this = $(this);
        if (!$this.hasClass("active")) {
            $("#listTypeSelector .listType a").each(function() {
                $(this).removeClass("active");
            });
            $(this).addClass("active");
            var relActive = $this.attr("rel");
            var frame = document.getElementsByName('CompareIFrame')[0];
            var jframe = $("#" + frame.id);

            if (relActive)
                jframe.contents().find("body .HiddenField").val(relActive);

            jframe.contents().find("body #listContainer .contentProduct").each(function() {
                if ($(this).hasClass(relActive)) {
                    $(this).css("display", "block");
                } else {
                    $(this).css("display", "none");
                }
            });

            SetLinkToSelectedView();
        }
        return false;
    });
    $("#listTypeSelector .sort a").click(function() {
        $("#listTypeSelector .sort a").each(function() {
            $(this).removeClass("active");
        });
        $(this).addClass("active");
    });
}

function SetLinkToSelectedView() {
    $(".filterBlockDescription a, .filterResults a").each(function () {
        var t = $(this);
        if (t.attr('href')) {
            t.attr('href', t.attr('href').replace('/view/list', ''));
            t.attr('href', t.attr('href').replace('/view/gallery', ''));

            var sep = '/';
            if (t.attr('href').charAt(t.attr('href').length - 1) == '/') {
                sep = '';
            }

            if (IsGallerySelected()) {
                t.attr('href', t.attr('href') + sep + 'view/gallery');
            }
            else {
                t.attr('href', t.attr('href') + sep + 'view/list');
            }
        }
    });
}

function IsGallerySelected() {
    return $("#listTypeSelector .listType .blockGallery a").hasClass("active");
}

function IsListSelected() {
    return $("#listTypeSelector .listType .blockList a").hasClass("active");
}

function mainNavReposition(){
    $("#navigation.horizontal .level2:first").css("left","1px");	
}

function mainNavigationHoverState(){
    /* main navigation hover state */
    $("#navigation ul.level1 > li").hover(
        function(){
            var $this = $(this);
            var cssHover = $this.children('ul').length ? 'over' : 'over_empty';
            $this.addClass('over').children('a').addClass(cssHover);
        },
        function(){
            var $this = $(this);
            var cssHover = 'over';
            var cssHover = $this.children('ul').length ? 'over' : 'over_empty';
            $this.removeClass('over').children('a').removeClass(cssHover);
        });	
}

function bntHover(){
    backgroundHoverBehavior('.buttons .back', '-348px', '-374px');
    backgroundHoverBehavior('.ProVideo .buttons .back', '-1102px', '-1128px');
    backgroundHoverBehavior('.buttons .print', '-52px', '-78px');
    backgroundHoverBehavior('.ProVideo .buttons .print', '-1420px', '-1447px');
    backgroundHoverBehavior('.buttons .seeall', '-104px', '-130px');
    backgroundHoverBehavior('.fr-CA.ProVideo .seeall', '0', '-26px');
    backgroundHoverBehavior('.en-CA.ProVideo .seeall', '-52px', '-78px');
    backgroundHoverBehavior('.buttons .promotions', '-156px', '-182px');
    backgroundHoverBehavior('.ProVideo .buttons .promotions', '-895px', '-921px');
    backgroundHoverBehavior('.buttons .next', '-400px', '-426px');
    backgroundHoverBehavior('.buttons .update', '-452px', '-478px');
    backgroundHoverBehavior('.buttons .details', '-364px', '-398px');
    backgroundHoverBehavior('.buttons .compare', '-504px', '-530px');
    backgroundHoverBehavior('.ProVideo a.compare', '-1312px', '-1339px');
    backgroundHoverBehavior('.ProVideo .close', '-1474px', '-1501px');
 /* backgroundHoverBehavior('.list .buttons .addCart', '-208px', '-234px');
    backgroundHoverBehavior('.ProVideo .buttons .addCart', '-789px', '-815px');*/
    backgroundHoverBehavior('.buttons .unavailableCart', '-650px', '-650px');
/*	backgroundHoverBehavior('.ProVideo .buttons .unavailableCart', '-998px', '-998px');*/
    backgroundHoverBehavior('.buttons .calendar', '-1206px', '-1232px');
    backgroundHoverBehavior('.button.no-icon', '0', '-26px');
    backgroundHoverBehavior('.dialog-choice .close', '-1260px', '-1286px');
    backgroundHoverBehavior('.ProVideo .dialog-choice .close', '-1474px', '-1501px');
    backgroundHoverBehavior('.ProVideo .dialog-choice .no-icon', '-1528px', '-1556px');
    /*backgroundHoverBehavior('.compare .buttons .button.addCart', '-208px', '-234px');*/
    backgroundHoverBehavior('.ProVideo table.compare .buttons .button.addCart', '-789px', '-815px');

    if ( $("body").hasClass("ProVideo")) {
        $(".buttons .addCart span").each(function () {
            if ($(this).text() == "") {
                backgroundHoverBehavior($(this).parent(), '-1947px', '-1973px');
                $(this).parent().css("padding-right", "35px");
            } else {
                backgroundHoverBehavior($(this).parent(), '-789px', '-815px');
            }
        });
        $(".buttons .unavailableCart span").each(function () {
            if ($(this).text() == "") {
                backgroundHoverBehavior($(this).parent(), '-1999px', '-2025px');
                $(this).parent().css("padding-right", "35px");
            } else {
                backgroundHoverBehavior($(this).parent(), '-998px', '-998px');

            }
        });
    } else {
    $(".buttons .addCart span").each(function () {
        if ($(this).text() == "") {
            backgroundHoverBehavior($(this).parent(), '-1843px', '-1869px');
            $(this).parent().css("padding-right", "35px");
        } else {
            backgroundHoverBehavior($(this).parent(), '-208px', '-234px');
        }
    });

        $(".buttons .unavailableCart span").each(function () {
            if ($(this).text() == "") {
                backgroundHoverBehavior($(this).parent(), '-1895px', '-1921px');
                $(this).parent().css("padding-right", "35px");
            } else {
                backgroundHoverBehavior($(this).parent(), '-650px', '-650px');

            }
        });
    }


}


function backgroundHoverBehavior(selector, posOff, posOn) {
    $(selector).each(function () {
        $(this).css("background-position", "right " + posOff);
        $(this).find("span").css("background-position", "left " + posOff);
        $(this).hover(
            function () {
                $(this).css("background-position", "right " + posOn);
                $(this).find("span").css("background-position", "left " + posOn);

            },
            function () {
                $(this).css("background-position", "right " + posOff);
                $(this).find("span").css("background-position", "left " + posOff);
            }
        );
    });		
}

function galleryImageBehavior(){
    galleryBehavior('.accessoriesGalleryLarge li','.accessoriesGallerySmall	li');
    galleryBehavior('.workShopGalleryLarge li','.workShopGallerySmall li');
}

function  galleryBehavior(FirstGallery,SecondGallery){
    $(FirstGallery).each(function () {
        $(this).css("display", "none");
    });
    $(FirstGallery).find("a img").each(function () {
        if ($(this).attr("alt") == "") {
            $(this).attr('alt', '&nbsp;');
        }
    });
    $(SecondGallery).eq(0).addClass("selected");
    $(FirstGallery).eq(0).css("display","inline-block");
    
    $(SecondGallery).each(function(){
        $(this).click(
            function(){
                var indexImg = $(this).index(SecondGallery);
                $(FirstGallery).each(function(){
                    $(this).css("display","none");
                });
                
                $(SecondGallery).each(function(){
                    $(this).removeClass("selected");
                });				
                $(FirstGallery).eq(indexImg).css("display","inline-block");
                $(SecondGallery).eq(indexImg).addClass("selected");		
            }
        );	
    });
}


function adjustBgBorderMarginPadding(){
    $(".productOngletCategoryBlock .productOngletBlockInner:last-child").css("border","none");
    $("#onglet li:first").css("margin-left","8px");
    $("#onglet li:last").css("margin-left","8px");
    $(".accessories td:first-child").css("padding-left","0");
    $("#recommendedProductsList li:last").css("background","none");
    $("#expositionsList li:last").css("background", "none");
    $(".ProVideo .filterBlockInner:first").css("border-right","solid 1px #999");
    $(".ProVideo .filterBlockInner:last").css("border-left","solid 1px #666");
    $(".ProVideo .filterBlockDescription div:last").css("border-bottom","none");
    $(".workShopListColFirstLevel:last .workShopList").css("margin-right","0");
    $(".workShopContent .imgCategory input:last").css("margin-right", "0");
    $(".workShopSchedule").each(function(){
        $(this).find("th").eq(0).css("width","160px");
        $(this).find("th").eq(1).css("width", "150px");
        $(this).find("th").eq(3).css("width", "200px");
    })
    $("#accessoriesSheet #accessoriesDescription .blockProduct:last").css("margin-bottom", "10px");
}

function ongletImgCenter(){
    $(".productOngletBlockInner").each(function(){
        if($(this).find(".productOngletImage").height() < $(this).find(".productOngletSideRight").height()){
            $(this).find(".productOngletImage").css("height",$(this).find(".productOngletSideRight").height()+"px");
            var paddingTop = ($(this).find(".productOngletImage").height() - $(this).find("img").height())/2;
            $(this).find(".productOngletImage").css("padding-top", paddingTop+"px");
            $(this).find(".productOngletImage").css("height", $(this).find(".productOngletImage").height()-paddingTop+"px");
        }
    });	
}

function ongletClickBehavior() {
    ongletClickAction("#productOnglet #onglet li", "#productOnglet #productOngletBlock .ongletView");
    ongletClickAction("#laboratoryTabs #onglet li", "#laboratoryTabs #laboratoryBlocks .tabView");
    ongletClickAction("#lecturerTabs #onglet li", "#lecturerTabs #lecturerBlocks .tabView");
    ongletClickAction(".workShopOnglets #onglet li", ".workShopOnglets .ongletView");
}


function ongletClickAction(tab, block) {
    var ongletToSelect = 0;
    var ongletIndex = 0;
    indexOngletLiSelected = 0;
    $(tab).eq(0).addClass("selected");
    $(block).each(function () {
        if ($(this).index(block) == 0) {
            $(this).addClass("selected");
        } else {
            $(this).hide();
        }
    });

    $(tab).each(function () {
        $(this).click(
            function(){
                var indexOngletLiSelected = $(this).index(tab);
                $(tab).each(function () {
                    if ($(this).index(tab) == indexOngletLiSelected) {
                        $(this).addClass("selected");	
                    } else {
                        $(this).removeClass("selected");
                    }
                });
                $(block).each(function () {
                    var ongletToSelect = indexOngletLiSelected;
                    var ongletIndex = $(this).index(block);
                    if(ongletIndex == ongletToSelect){
                        $(this).css("display","block");
                        if(ongletIndex == 2 || ongletIndex == 3){
                            ongletImgCenter();	
                        }
                    } else{
                        $(this).css("display","none");	
                    }
                });				
            }
        );			
    });
}

function addSpanButtons(){
    $(".buttons a").each(function(){
        var contentLink = $(this).text();
        $(this).html("<span>"+contentLink+"</span>");
    });
}


function leftMenuLevel1AddClassHover(){
    $(".one li").hover(
        function(){
            $(this).addClass("oneLiHover");
        },
        function(){
            $(this).removeClass("oneLiHover");
        }
    );
}

function skinCompareTable(){
    $('.compare tbody > tr').each(function(){
        $('td:odd', $(this)).css({'background-color': '#eee'})
        $('td:first', $(this)).css({'border-left':'none'})
        $('td:first', $(this)).css({'width':'155px'})
        $('td:last', $(this)).css({'border-right':'none'})
    });
    $('.ProVideo .compare tbody > tr').each(function(){
        $('td:odd', $(this)).css({'background': '#333'})
    });    
    
    $(".compare thead td:first").css({'border-left':'none'})
    $(".compare thead td:last").css({'border-right':'none'})
}

function skinSpecTable(){
    $(".specTable tr:even").each(function(){
        $(this).css({'background-color': '#eee'});
    });
    $(".ProVideo .specTable tr:even").each(function(){
        $(this).css({'background-color': '#333'});
    });
}

function paginationHidden() {
    if ($(".paginationPrev").attr("disabled") == "disabled" || $(".paginationPrev").attr("disabled") == true) {
       /* test disabled for FF, true for IE*/
        $(".paginationPrev").css("display","none");
   }

    if ($(".paginationNext").attr("disabled") == "disabled" || $(".paginationNext").attr("disabled") == true) {
        $(".paginationNext").css("display","none");
   } 
}

function mainMenuLevel2Bottom(){
  $(".level1 li").hover(
        function(){
                /*necessaire pour IE7*/
                if($(this).hasClass("last")){
                    $(this).find(".level2").css("right","1px");
                } else if($(this).hasClass("first")){
                    $(this).find(".level2").css("left","1px");
                } else {
                    $(this).find(".level2").css("left","0");
                } 
                /****************/
                $(this).find("ul").addClass("LIHover");                
                var widthL2 = $(".level2.LIHover").width()-6+"px";
                $(".level2Center").css("width",widthL2);
                $(".level2Left").css("display","block");
                $(".level2Right").css("display","block");
                $(".level2Center").css("display","block");   
                            
        },
        function(){
                 $(this).find("ul").removeClass("LIHover");
        }
    );
}

function proVideoResizeHeightH2(){
    maxHeight = 0;
    $(".ProVideo .h2Category h2").each(function(){
        if($(this).height()>maxHeight){
            maxHeight = $(this).height();
        }
    });
    $(".ProVideo .h2Category h2").each(function(){
         $(this).css("height",maxHeight+"px");
    });
}

/* Returns query parameter value */
function gup(name) {
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regexS = "[\\?&]" + name + "=([^&#]*)";
    var regex = new RegExp(regexS);
    var results = regex.exec(window.location.href);
    if (results == null)
        return "";
    else
        return results[1];
}

function paymentCardSkin(){
    $(".paymentCard li:last").css("border-right","none");
    $(".paymentCard li:last").css("margin-right","0");
    $(".paymentCard li:last").css("padding-right","0");
}

function homeOngletsBehavior(){
    $(".tabs li").click(function () {
        var indexOngletSelected = $(this).index(".tabs li");
        $(".tabs li").each(function () {
            $(this).removeClass("selected");
        });
        $(".homeOnglets").each(function () {
            $(this).removeClass("selected");
        });
        $(".tabs li").eq(indexOngletSelected).addClass("selected");
        $(".homeOnglets").eq(indexOngletSelected).addClass("selected");
        $("#homeOnglets>div").each(function() {
            $(this).find("#listTypeSelector .gallery").addClass("active");
            $(this).find("#listTypeSelector .list").removeClass("active");
            $(".homeOnglets.selected #listContainer").find(".list").hide();
            $(".homeOnglets.selected #listContainer").find(".gallery").show();
        });
    });
}

function emptyCell(){
   emptyCellBehavior(".partnerList td");
}

function emptyCellBehavior(emptyCells){
   $(emptyCells).each(function(){
        if($(this).html()==""){
            $(this).css("background","none");
        }
   }); 
}

function workShopSlideShow(){
    $("#workShopVideoSlideshow").each(function(){
        var sizeLiVideo = $(this).find("li").size();	
        if(sizeLiVideo > 4){
            $("#workShopVideoSlideshow").jCarouselLite({
                circular: false,
                vertical:true,
                visible: 4,
                start: 0,
                scroll: 1,
                auto:0,
                speed: 100,
                btnNext: ".btnNextVert",
                btnPrev: ".btnPrevVert"
            });	
        } else {
            $("#workShopVideoSlideshowOuter .btnNextVert").addClass("disabled");
            $("#workShopVideoSlideshowOuter .btnPrevVert").addClass("disabled");
        }
    });
    $("#workShopVideoSlideshow li").click(function () {
        var indexSlideSelected = $(this).index("#workShopVideoSlideshow li");
        $("#workShopVideoSlideshow li").removeClass("selected");
        $("#workShopVideoDisplay li").removeClass("selected");
        $("#workShopVideoSlideshow li").eq(indexSlideSelected).addClass("selected");
        if (carousselSubmit != null) {
            var data = $("#workShopVideoSlideshow li").eq(indexSlideSelected).attr("data");
            if (!data)
                data = 0;
            carousselVideoId(data);
            carousselSubmit.trigger('click');
        }
    });
}

function suggestedWorkShopSlideShow() {
    if ($("#suggestedWorkShopsSlideShow ul").children().size() == 0) {
        return;
    }

    if ($("#suggestedWorkShopsSlideShow ul").children().size() == 1) {
        $(".prevSuggestedWorkShops").hide();
        $(".nextSuggestedWorkShops").hide();
        
        contentSingleWorkshop = "<div class=singleSuggestedWorkshop>"+$("#suggestedWorkShopsSlideShow li").eq(0).html()+"</div>";
        $("#suggestedWorkShopsSlideShow ul").after(contentSingleWorkshop);
        $("#suggestedWorkShopsSlideShow").addClass("singleWorkshop");
        $("#suggestedWorkShopsSlideShow ul").hide();

    }

    $("#suggestedWorkShopsSlideShow").each(function () {
        $("#suggestedWorkShopsSlideShow").jCarouselLite({
            circular: true,
            vertical:false,
            visible: 1,
            start: 0,
            scroll: 1,
            auto:0,
            speed: 100,
            btnNext: ".nextSuggestedWorkShops",
            btnPrev: ".prevSuggestedWorkShops"
        });	
    });
}



function lecturerPortfolioSlideShow() {
   $('#lecturerPortfolioSlideshow').carouFredSel({
        auto: false,
        circular: true,
        items: {
            width: "variable",
            minimum: 3
        },
        scroll: {
            items: 1
        },
        next: '#nextPortfolio',
        prev: '#prevPortfolio'
    });
    /* ajustement du padding des photos dans le slideshow */
    $("#lecturerPortfolioSlideshow li img").each(function () {
        heightImg = $(this).height();
        heightSlideshow = $("#lecturerPortfolioSlideshow").height();
        marginImg = (heightSlideshow - heightImg-2) / 2 + "px"; /* -2 pour la bordure */
        $(this).css("margin-top", marginImg);
    });

}

function expositionSlideShow() {
    $('#expositionSlideshow').carouFredSel({
        auto: false,
        circular: true,
        items: {
            width: "variable",
            minimum: 3
        },
        scroll: {
            items: 1
        },
        next: '#nextPortfolioExposition',
        prev: '#prevPortfolioExposition'
    });
    /* ajustement du padding des photos dans le slideshow */
    $("#expositionSlideshow li img").each(function () {
        heightImg = $(this).height();
        heightSlideshow = $("#expositionSlideshow").height();
        marginImg = (heightSlideshow - heightImg - 2) / 2 + "px"; /* -2 pour la bordure */
        $(this).css("margin-top", marginImg);
    });
}

function resizeColsFullMasterPage(){
        $("#center").css("width", "753px");
        $("#sideRight").css("width", "0px");
}

function categoryTableSize(){
       $(".category tr").each(function(){
          $(this).find(".h2Category").eq(0).css("width","191px");
          $(this).find(".h2Category").eq(1).css("width","191px");
          $(this).find(".h2Category h2").eq(2).css("padding-right", "0");
       });
       
       $(".categoryList tr").each(function(){
          $(this).find("td").eq(0).css("width","191px");
          $(this).find("td").eq(1).css("width","191px");   
          $(this).find(".categorySubTitle:last").css("margin-right","0");

    });
    $(".laboratories tr").each(function () {
        $(this).find(".h2Category").eq(0).css("width", "191px");
        $(this).find(".h2Category").eq(1).css("width", "191px");
        $(this).find(".h2Category").eq(2).css("width", "191px");
        $(this).find(".h2Category h2").eq(3).css("padding-right", "0");
       });
}

function workShopScheduleLecturerShow() {
    $(".workShopScheduleLecturer").click(function () {
        indexTr = $(this).parent().parent().index(".workShopSchedule tr");
        $(".workShopSchedule tr").eq(indexTr + 1).toggle();
    });
}

function alignmentworkShopListContentLink() {
    $(".workShopListContentLink a").each(function () {
        heightLink = $(this).outerHeight();
        heightTD = $(this).parent().outerHeight();
        if (heightLink < heightTD) {
            $(this).parent().css("padding-top", (heightTD - heightLink) / 2 + "px");
        }

    });
}

function workShopGalleryEmpty() {
    $(".workShopGalleryLarge").each(function () {
        if ($(this).children().size() == 0) {
            $(this).parent().hide();
            $("#workShopDescription").css("width", "auto");
        }

    });
    $("#workShopDescription h2").each(function () {
        if ($(this).html() == "") {
            $(this).hide();
        }

    });

    $("#suggestedWorkShopsSlideShow li").each(function () {
        if ($(this).children().size() < 2) {
            $(this).find(".suggestedWorkShopLeft").css("width", "auto");
        }
    });
}

function popupPromotion() {
    $(".gallery .promotionProductBlockTopCenter").hover(
        function () {
            $(this).parent().parent().parent().find(".promotionProductBlock-hover").show();
        }

    );
    $(".gallery .promotionProductBlock-hover").hover(
        null,
        function () {

            $(this).hide("slow");
        }
    );
   $(".ProVideo .gallery .promotionProductBlockTopCenter").hover(
        function () {
            $(this).parent().parent().parent().parent().find(".promotionProductBlock-hover").show();
        }

    );
    $(".ProVideo .gallery .promotionProductBlock-hover").hover(
        null,
        function () {

            $(this).hide("slow");
        }
    );

    $(".list .promotionProductBlockTopCenter").hover(
        function () {
            $(this).parent().parent().parent().parent().find(".promotionProductBlock-hover").show();
        }

    );
    $(".list .promotionProductBlock-hover").hover(
        null,
        function () {

            $(this).hide("slow");
        }
    );
}

    function pageGallery() {
        $("#listContainer .gallery.homeBlock table:first").each(function () {
            $(this).addClass("productTable");
        })
        homeGalleryTDSize = $("#listContainer .gallery .productTable tr:first").children().size();
        maxHeightPromotion = 0;
        $("#listContainer .gallery .productTable tr").each(function () {

            for (i = 0; i < homeGalleryTDSize; i++) {
                if ($(this).find(".promotion").eq(i).height() > maxHeightPromotion) {
                    maxHeightPromotion = $(this).find(".promotion").eq(i).height();
                    
                }
            }
            for (i = 0; i < homeGalleryTDSize; i++) {
                $(this).find(".TRPromotion TD").eq(i).css("height", maxHeightPromotion + "px");
            }
            maxHeightPromotion = 0;
        });

     
    }



    $(document).ready(function () {
        $('#headerQuicklinks li:first-child, #breadcrumbs li:first-child, ul.one li:first-child, #bottomContent .col:first-child, .box li:first-child, #navigation li:first-child, .accessories .box:first-child').addClass('first'); /* to apply proper styling in IE6 which does not undestand :first-child */
        $('.box li:last, #navigation li:last-child, ul.level2 li:last-child').addClass('last'); /* IE7 + different last item on main nav */
        $('#navigation ul.level1 > li').each(function (index) {
            $(this).addClass('item' + ++index);
        });
        applyWatermark();
        mainNavigationHoverState();
        if (frames['CompareIFrame']) {
            listTypeSelectorFrame();
        }
        else {
            listTypeSelectorHome();
        }
        mainNavReposition();
        skinCompareTable();
        skinSpecTable();
        addSpanButtons();
        bntHover();
        adjustBgBorderMarginPadding();
        ongletClickBehavior();
        leftMenuLevel1AddClassHover();
        categoryTableSize();
        paginationHidden();
        mainMenuLevel2Bottom();
        proVideoResizeHeightH2();
        homeOngletsBehavior();
        workShopSlideShow();
        suggestedWorkShopSlideShow();
        galleryImageBehavior();
        paymentCardSkin();
        emptyCell();
        lecturerPortfolioSlideShow();
        expositionSlideShow();
        workShopScheduleLecturerShow();
        alignmentworkShopListContentLink();
        workShopGalleryEmpty();
        popupPromotion();
        pageGallery();
        totalTD = 0;
        tdToAdd = 0;
        $(".proVideoCategoryList tr").each(function () {
            totalTD = $(this).find("td").size();
            if (totalTD < 3 || totalTD > 0) {
                tdToAdd = 3 - totalTD;
                for (i = 0; i < tdToAdd; i++) {
                    $(this).eq(0).append("<td style='background:none'></td>");
                }
            }
        });
        $(".ProVideo #listContainer .gallery table tr").each(function () {
            totalTD = $(this).find("td").size();
            if (totalTD < 3) {
                tdToAdd = 3 - totalTD;
                for (i = 0; i < tdToAdd; i++) {
                    $(this).eq(0).append("<td style='background:none; border-top:none;border-bottom:none;'></td>");
                }
            }
        });
        $(".ProVideo #listContainer .gallery table tr").each(function () {
            $(this).find("td").eq(2).css("border-right", "none");
        });
        $(".proVideoCategoryList tr").each(function () {
            $(this).find("td").eq(2).css("border-right", "none");

        });

        if ($("body").hasClass("ProVideo")) {
            $(".seeall").removeClass("button");
        }
        $("a[rel^='prettyPhoto']").prettyPhoto({
            gallery_markup: ''

        });

        $("#commercialCustomer #pageContent").css("height", $(".topContent").height() - $("#pageHeader").height() + "px");

        $("#workShopVideoSlideshowOuter .btnPrevVert").addClass("disabled");

        $(".productPromotionLight").each(function () {
            $(".ProVideo .promotionProductBlockContent").eq(0).css("border-top", "none");
        })

    });


