// JavaScript Document

$().ready(function () {



    /*****************************/

    $('#encart_plus_photo').hide();

    $('.plus_photo').click(function () {
        $('#encart_plus_photo').show();
    });

    $('#close_plus_photo').click(function () {
        $('#encart_plus_photo').hide();
    });



    /*****************************/



    $('#header').mouseover(function () {
        $("#nav li").removeClass("selectedNav");
        $('#menuContent').hide();
        $('#spacer2b,#textefil').show();
    });


    $('#outg').mouseover(function () {
        $("#nav li").removeClass("selectedNav");
       
        $('#menuContent').hide();
        $('#spacer2b,#textefil').show();
    });
    $('#outd').mouseover(function () {
        $('#menuContent').hide();
        $('ul#nav ul').hide();
        $('#spacer2b,#textefil').show();
    });

    $('#spacer2').mouseout(function () {
        $('#menuContent').hide();

        $('#spacer2b,#textefil').show();
    });

    

    $('#menuContent').mouseover(function () {
        $(this).show();
    });


    $('.CarrouselMenu').mouseover(function () {
        $('#menu2GContent').show();
    });


    $('#menu2GContent').mouseover(function () {
        $(this).show();
    });




    $('#headB').mouseover(function () {
        $('#menu2GContent,#spacer2b').hide();
        $('#sliderdiv,#textefil').show();
    });

    $('#blkbas').mouseover(function () {
        $('#menu2GContent,#spacer2b').hide();
        $('#sliderdiv,#textefil').show();
    });

    $('.CarrouselMenuLink ').mouseover(function () {

        $('#sliderdiv,#spacer2b').hide();
        $('#menu2GContent,#textefil').show();
    });




    $('.CarrouselMenuLink').click(function () {
        return false;
    });


    /*****************************/

    //panier
    $('#openLink').click(function () {
        $(this).hide();
        $('#openLinkContent').hide();
        $('#closeLinkContent, #closeLink, #panierContent').show();
    });

    $('#closeLink').click(function () {
        $(this).hide();
        $('#closeLinkContent,#panierContent').hide();
        $('#openLinkContent,#openLink').show();
    });

    /*****************************/
    //Menu Haut	


    $('.headMenu').mouseover(function () {

        var display = "Classic";

        if ($(this).hasClass("AB")) {
            display = "AB";
        }

        var id = $(this).attr("id");

        if (display == "AB") {
            var data = $("#" + id).next("div").html();
            $("#menuContent").html(data);
            //$('ul#nav ul').hide();
            $('#menuContent,#spacer2b').show();

        }

        if (display == "Classic") {
            //$("#" + id).next("ul").show();
            $('#menuContent').hide();
            $('#spacer2b').show();
        }




        //        if ($(this).hasClass("AB")) {
        //            display = "AB";
        //            $('#menuContent,#spacer2b').show();
        //        }
        //        var id = $(this).attr("id");


        //        $('#spacer2b,#textefil').hide();

        //        $.ajax({
        //            type: "GET",
        //            url: $(this).attr("href"),
        //            success: function (data) {

        //                if (display == "AB") {
        //                    $("#menuContent").html(data);
        //                    $('#menuContent,#spacer2b').show();
        //                }

        //                if (display == "Classic") {
        //                    $("#" + id).next("ul").html(data);
        //                    $('#menuContent').hide();
        //                    $('#spacer2b').show();
        //                }
        //            }
        //        });


        $('#textefil').hide();


    });


    $('.headMenu').click(function () {
        return false;
    });

    //    $('.CarrouselMenuLink').mouseover(function () {


    //        $('#sliderdiv,#spacer2b').hide();
    //        $('#textefil').show();
    //        $('.CarrouselMenu').css({ 'backgroundImage': '' });
    //        $(this).parent(".CarrouselMenu").css({ 'backgroundImage': 'url(/Content/img/picto-fleche-menu.jpg)' })

    //        $.ajax({
    //            type: "GET",
    //            url: $(this).attr("href"),
    //            success: function (data) {
    //                $("#menu2GContent").html(data);

    //                $('.LetterBrands').hide();
    //                $('.LetterBrands:first').show();


    //                $('.Letter').click(function () {
    //                    var letter = $(this).html();
    //                    $('.LetterBrands').hide();
    //                    $('#Letter' + letter).show();
    //                    return false;
    //                });
    //            }
    //        });

    //        $('#menu2GContent').show();

    //    });



    /********************************************/

    //Common 

    $('[type=password]').focus(function () {
        $(this).val("");
        ;
    });


    $('.inputTextDeleteContent').focus(function () {
        $(this).val("");
        ;
    });



    $("#nav li").mouseover(function () {

        $("#nav li").removeClass("selectedNav");
        $(this).addClass("selectedNav");
        $(this).addClass("iehover");
    });

    $("#nav li").mouseout(function () {
        $(this).removeClass("iehover");
    });


    $("#nav ul").mouseout(function () {
        $("#nav li").removeClass("selectedNav");
    });

});


