function bookmarksite(title, url){
    if (document.all)
        window.external.AddFavorite(url, title);
    else if (window.sidebar)
        window.sidebar.addPanel(title, url, "")
}

$(document).ready(function() {

    var actif = true;

    $('#nav li:not(.actif):not(animated)').hover(function(){

        if('#nav li:not(animated)'){
            if(actif == true){
                actif = false;
                $(this).find('h1').animate({
                    height: '36'
                }, 200);
                $(this).find('h1 a').animate({
                    height:'36',
                    lineHeight:'36',
                    fontSize:'15'
                }, 150);
                $(this).find('h1 a span.puce').animate({
                    top:'14'
                }, 200, function(){
                    actif = true;
                });

                actif = true;
            }
        }
    },
    function(){

        if(actif == true){
            actif = false;
            $(this).find('h1').animate({
                height: '20'
            }, 150);
            $(this).find('h1 a').animate({
                height:'20',
                lineHeight:'20',
                fontSize:'12'
            }, 50);
            $(this).find('h1 a span.puce').animate({
                top:'7'
            }, 150, function(){
                actif = true;
            });

            actif = true;
        }
    });


    $('.boxcolor').hover(function(){
        var id = $(this).attr('id').split('-')[1];
        var nom = $(this).attr('id').split('-')[2];
        $(this).parents('.product').children('.details').children('.boximage.'+nom+':visible').hide();
        $(this).parents('.product').children('.fiche').children('a:visible').hide();
        $('#photo-'+id+'-'+nom).show();
        $('#lien-'+id+'-'+nom).show();
    });

    $('.liens-imgfiche').hover(function(){
        var id = $(this).attr('id').split('-')[1];
        $('.ficheimg:visible').hide();
        $('#photo-'+id).show();
    });


    $("#addpanierbutton").click(function(){
       $("#addtoCartform").submit();
    });


    $('#container #content .bigbox.catalogue .product .details .img img,#container #content .bigbox.fiche #product .image img, #container #content .bigbox.fiche #product .details #photosprod .nav a img').hover(function(){
       $(this).animate({opacity:'0.4'});
    },
    function(){
        $(this).animate({opacity:'1'});
    });

    if($('.tips').length > 0)
        $(".tips").tipTip({delay:100});


    $(".message ul li a.close").click(function(e){
       e.preventDefault();
       $(this).parents('.message').fadeOut();
    });

    Shadowbox.init();

    function modalCartsOpen (dialog, e) {
        $("#modal-cart-alert").load(e);
        dialog.overlay.fadeIn('fast', function () {
            dialog.container.fadeIn('fast', function () {
                dialog.data.hide().slideDown('fast');
            });
        });
    }

    if($("#modal-cart-alert").length > 0){
        $('#modal-cart-alert').modal({
            onOpen: function(p){modalCartsOpen(p,"cart-alerte.php");},
            minHeight:300,
            minWidth:300,
            overlayClose:true
        });
    }


});







Cufon.replace('#nav li h1 a', {hover: true, hoverables: {a: true}});


