function menu1_over(id)
{
    document.body.style.cursor='hand';
	var d = document.getElementById(id);
    if(d)
    {
        //d.style.backgroundimage="/_layouts/images/rsx/mps/menu_on_1.gif";
        this.setBackgroundImage(id,"/_layouts/images/rsx/mps/menu_on_1.gif");
    }
}

function menu1_out(id)
{
    document.body.style.cursor='default';
	var d = document.getElementById(id);
    if(d)
    {
        //d.style.backgroundimage="/_layouts/images/rsx/mps/menu_off_1.gif";
        this.setBackgroundImage(id,"/_layouts/images/rsx/mps/menu_off_1.gif");
    }
}

function menu1_deploy(id)
{

    var tous=document.getElementById("MPS_MENUG").getElementsByTagName("*");
    for(un in tous){
        var id_temp = tous[un].id;
        if(id_temp!=null)
        {
            if(id_temp.indexOf("sm_")>=0){
	            var d_temp = document.getElementById(id_temp);
                if(d_temp)
                {
                    d_temp.style.display="none";
                }
            }
        }
    }

	var d = document.getElementById(id);
    if(d)
    {
        if(d.style.display=="block")
        {
            d.style.display="none";
        }
        else
        {
            d.style.display="block";
        }
    }
}

function menu2_deploy(id)
{

    var tous=document.getElementById(id).getElementsByTagName("*");
    for(un in tous){
        var id_temp = tous[un].id;
        if(id_temp!=null)
        {
            if(id_temp.indexOf("sm_")>=0){
	            var d_temp = document.getElementById(id_temp);
                if(d_temp)
                {
                    d_temp.style.display="none";
                }
            }
        }
    }

	var d = document.getElementById(id);
    if(d)
    {
        if(d.style.display=="block")
        {
            d.style.display="none";
        }
        else
        {
            d.style.display="block";
        }
    }
}

function menu2_over(id)
{
    document.body.style.cursor='hand';
	var d = document.getElementById(id);
    if(d)
    {
        //d.style.backgroundimage="/_layouts/images/rsx/mps/menu_on_2.gif";
        this.setBackgroundImage(id,"/_layouts/images/rsx/mps/menu_on_2.gif");
    }
}

function menu2_out(id)
{
    document.body.style.cursor='default';
	var d = document.getElementById(id);
    if(d)
    {
        //d.style.backgroundimage="/_layouts/images/rsx/mps/menu_off_2.gif";
        this.setBackgroundImage(id,"/_layouts/images/rsx/mps/menu_off_2.gif");
    }
}

function menu3_over(id)
{
    document.body.style.cursor='hand';
	var d = document.getElementById(id);
    if(d)
    {
        d.style.color="white";
        this.setBackgroundImage(id,"/_layouts/images/rsx/mps/menu_on_3.gif");
    }
}

function menu3_out(id)
{
    document.body.style.cursor='default';
	var d = document.getElementById(id);
    if(d)
    {
        d.style.color="#3e494c";
        this.setBackgroundImage(id,"/_layouts/images/rsx/mps/menu_off_3.gif");
    }
}


function setBackgroundImage (id, imageURL) {
  if (document.layers)
    document[id].background.src = imageURL == 'none' ? null : imageURL;
  else if (document.all)
    document.all[id].style.backgroundImage = imageURL == 'none' ? 'none' 
: 'url(' + imageURL + ')';
  else if (document.getElementById)
    document.getElementById(id).style.backgroundImage = imageURL == 
'none' ? 'none' : 'url(' + imageURL + ')';
}

function ouvrepage(lien)
{
    document.location.href=lien;
}

function afficheselected2eme(id)
{
    var elt_ = document.getElementById("item_2_"+id)
    if (elt_!=null)
    {
        this.setBackgroundImage("item_2_"+id,"/_layouts/images/rsx/mps/menu_on_2.gif");
    }
}


function afficheselected3eme(id)
{
    var elt_ = document.getElementById("item_3_"+id)
    if (elt_!=null)
    {
        this.setBackgroundImage("item_3_"+id,"/_layouts/images/rsx/mps/menu_on_3.gif");
    }
    this.afficheselected3emedet();
}

function afficheselected3emedet()
{
    var s_url = window.location.href;
    var i_pos = s_url.indexOf("tturl=");
    if(i_pos>=0)
    {
        s_url = s_url.substr(i_pos+6);
    }
    s_url = "item_3_http://"+window.location.host+s_url;
    var elt_ = document.getElementById(s_url)
    if (elt_!=null)
    {
        this.setBackgroundImage(s_url,"/_layouts/images/rsx/mps/menu_on_3.gif");
    }
    //alert(s_url);
}

function ouvredetailactu(id)
{
    var elt_ = document.getElementById(id)
    if (elt_!=null)
    {
        if(elt_.style.display=="block")
        {
            elt_.style.display="none";
        }
        else
        {
            elt_.style.display="block";
        }
    }
}

function afficheactudefilante(id)
{
    //alert(id);
    if(id.indexOf("/default.aspx")>=0)
    {
        var elt_ = document.getElementById("IdDivActuDef")
        if (elt_!=null)
        {
            elt_.style.display="block";
        }
    }
}


function affichelog(DivToShow) {
    var d0 = document.getElementById(DivToShow);
    
    if (d0.style.display == 'none')
    	d0.style.display='block';
    else
    	d0.style.display='none';
}

