﻿
/*menu*/

$(document).ready(function() {
    //effet menu
    $('#navigation ul li a').hover(function() {
        $(this).animate({ paddingRight: '40px' }, 150);
    }, function() {
        $(this).animate({ paddingRight: '29px' }, 150);
    });
    //tabs
    $('#tabs').tabs();
    //hover sur article
    $('#principal .produit').hover(function() {
        $(this).animate({ backgroundColor: '#ca6e38' }, 500);
        $(this).find('h2').animate({ color: '#fff9d0' }, 250);
    }, function() {
        $(this).animate({ backgroundColor: '#fff9d0' }, 500);
        $(this).find('h2').animate({ color: '#ca6e38' }, 250);
    });
});

function InitJQueryFct() {
    $(document).ready(function() {


        //on réduit le choix ral
        $('#ctl00_ContentPlaceHolder1_ChoixRALBardage table:first').hide();
        $('#ctl00_ContentPlaceHolder1_ChoixRALToiture table:first').hide();

        //click choix
        $('#ChoisirRALBardage').click(function() {
            $('#ctl00_ContentPlaceHolder1_ChoixRALBardage table:first').show();
        });
        $('#ChoisirRalToiture').click(function() {
            $('#ctl00_ContentPlaceHolder1_ChoixRALToiture table:first').show();
        });
        //
        $('#ctl00_ContentPlaceHolder1_ChoixRALBardage .tRAL').click(function() {
            $('#ctl00_ContentPlaceHolder1_ChoixRALBardage table:first').hide();
            var t = $(this).html();
            $('#ctl00_ContentPlaceHolder1_tbRALBardage').val(t);
            setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$tbRALBardage\',\'\')', 0);

        });
        $('#ctl00_ContentPlaceHolder1_ChoixRALToiture .tRAL').click(function() {
            $('#ctl00_ContentPlaceHolder1_ChoixRALToiture table:first').hide();
            var t = $(this).html();
            $('#ctl00_ContentPlaceHolder1_tbRALToiture').val(t);
            setTimeout('__doPostBack(\'ctl00$ContentPlaceHolder1$tbRALBardage\',\'\')', 0);
        });
        //on ferme
        $('.closed').click(function() {
            $('#ctl00_ContentPlaceHolder1_ChoixRALBardage table:first').hide();
            $('#ctl00_ContentPlaceHolder1_ChoixRALToiture table:first').hide();
        });


        $(".accordion h2:first").addClass("active");
        $(".accordion h3:first").addClass("active");
        $(".accordion h4:first").addClass("active");
        $(".accordion p:not(:first)").hide();
        $(".accordion ul:not(:first)").hide();


        $(".accordion h2").click(function() {
            $(this).next("p").slideToggle("slow")
		.siblings("p:visible").slideUp("slow");
            $(this).next("ul").slideToggle("slow")
		.siblings("ul:visible").slideUp("slow");
            $(this).toggleClass("active");
            $(this).siblings("h2").removeClass("active");
        });


        $(".accordion h3").click(function() {
            $(this).next("p").slideToggle("slow")
		.siblings("p:visible").slideUp("slow");
            $(this).next("ul").slideToggle("slow")
		.siblings("ul:visible").slideUp("slow");
            $(this).toggleClass("active");
            $(this).siblings("h3").removeClass("active");
        });

        $(".accordion h4").click(function() {
            $(this).next("p").slideToggle("slow")
		.siblings("p:visible").slideUp("slow");
            $(this).next("ul").slideToggle("slow")
		.siblings("ul:visible").slideUp("slow");
            $(this).toggleClass("active");
            $(this).siblings("h4").removeClass("active");
        });


    });
    jQuery(function($) {
        $("a[rel^='lightbox']").slimbox({/* Put custom options here */
    }, null, function(el) {
        return (this == el) || ((this.rel.length > 8) && (this.rel == el.rel));
    });
});
}






