/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */


//Daplacement bar sous menu

$(function (){redimBord(($(this).width() / 2) - 579);});

$(window).resize(
    function (){
        redimBord(($(this).width() / 2) - 579);
    });

function redimBord (dimension){
    $("#bordHeaderDroit").css("width", dimension + "px");
    $("#bordHeaderGauche").css("width", dimension + "px");
}

$(".langue").mouseover(
    function (){
       lang = $(this).attr("id").charAt(0) + $(this).attr("id").charAt(1);
       changeLang(lang, "Actif");
    }
 );

$(".langue").mouseout(
    function (){
       lang = $(this).attr("id").charAt(0) + $(this).attr("id").charAt(1);
       changeLang(lang, "Inactif");
    }
);

function changeLang (lang, statut){
    $("." + lang).attr({src: "./skin/default/img/langue/"+lang+statut+".png", alt: "Logo jQuery!"})
}

$("li.liensSousMenu").mouseover(
    function (){
        $(this).css("background-image", 'url(./skin/default/img/menu/selection.png)');
    }
);

$("li.liensSousMenu").mouseout(
    function (){
        $(this).css("background-image", "none");
    }
);

$("#ongletAccueil").mouseover(
    function () {
        if($("#backgroundAccueil").css("top") == (-54 + "px")){
            $(this).css("color", "black");
            $("#backgroundAccueil").animate({top: "0px"}, 800, null,null);
        }
    }

);

$("#ongletAccueil").mouseout(
    function () {
         $(this).css("color", "black");
        $("#backgroundAccueil").animate({top: "-54px"}, 800, null, null);
      
    }

);

$("#ongletActivites").mouseover(
    function () {
    if($("#backgroundActivites").css("top") == (0 + "px")){
        $(this).css("color", "black");
        $("#backgroundActivites").animate({top: "-54px"}, 800, null, null);
    }
    }

);

$("#ongletActivites").mouseout(
    function () {
         $(this).css("color", "black");
        $("#backgroundActivites").animate({top: "0px"}, 800, null, function () {$(this).css("color", "white")});
    }

);


$("#ongletForelite").mouseover(
    function () {
    if($("#backgroundForelite").css("top") == (-54 + "px")){
        $(this).css("color", "black");
        $("#backgroundForelite").animate({top: "0px"}, 800, null, null);
    }
    }

);

$("#ongletForelite").mouseout(
    function () {

        $("#backgroundForelite").animate({top: "-54px"}, 800, null, function () {$(this).css("color", "white")});
    }

);

$("#ongletAPropos").mouseover(
    function () {
    if($("#backgroundAPropos").css("top") == (0 + "px")){
        $(this).css("color", "black");
        $("#backgroundAPropos").animate({top: "-54px"}, 800, null, null);
    }
    }

);

$("#ongletAPropos").mouseout(
    function () {
        $("#backgroundAPropos").animate({top: "0px"}, 800, null, function () {$(this).css("color", "white")});
    }

);

