﻿
function loadCufon() {
    Cufon.replace('h1');
    Cufon.replace('h2', {hover: true});
	//Cufon.replace('.footerlinklist h3');// 
	Cufon.replace('.h3Replace');// 
    Cufon.replace('.newsText');
}

function formatText(index, panel) {
    return index + "";
}

$(document).ready(function() {
    loadCufon();
    $(".MegaMenuLink").megamenu(".MegaMenuContent", {
        width: "948px"
    });

    $("#MegaMenuContainer>a").each(
        function(i) {
            var linkUrl = $(this).attr('href');
            if (typeof (linkUrl) != "undefined") {
                if (document.location.toString().indexOf(linkUrl) >= 0) {
                    $(this).attr("style", "background:#fff url(css/img/menu-over.jpg) repeat-x bottom;color: #b5b5b5; cursor:default;");
                } else {
                    $(this).attr("style", "");
                }

                if (linkUrl.toString().indexOf('Catalogue')>=0) {
                    if (document.location.toString().indexOf('Categorie') >= 0
                    || document.location.toString().indexOf('Article.aspx') >= 0
                    || document.location.toString().indexOf('Sacs') >= 0) {
                        $(this).attr("style", "background:#fff url(css/img/menu-over.jpg) repeat-x bottom;color: #b5b5b5; cursor:default;");
                    }
                }                        
                
            }
        }
    );
    //force in case default page is used
    if (document.location.toString().indexOf('.aspx') < 0) {
        $("#MegaMenuFirst").attr("style", "background:#fff url(css/img/menu-over.jpg) repeat-x bottom;color: #b5b5b5; cursor:default;");
    }
});
