﻿function MenusPageAccueil()
{
    var strHtml="";
    strHtml+="<a href=\"index.htm\" class=\"OngletOn\" title=\"Accueil\" onMouseOut=\"window.status=''; return true\" onMouseOver=\"window.status='Accueil'; return true\">Accueil</a>&nbsp;|&nbsp";
	for(var i=0;i<_Root.Liste.length;i++)
	{
		if(_Root.Liste[i].Level==0)
		{		    
	        strHtml+="<a href=\"entreprendreetreussir.htm?p="+_Root.Liste[i].Id+"\" class=\"OngletOff\" title='"+_Root.Liste[i].Libelle+"' onMouseOut=\"window.status=''; return true\" onMouseOver=\"window.status='"+_Root.Liste[i].Libelle+"'; return true\">";
	        strHtml+=_Root.Liste[i].Libelle;
            strHtml+="</a>&nbsp;|&nbsp;";
		}
	}
	document.getElementById("PanelMenuOnglets").innerHTML=strHtml;
}


function Application_RefreshMenus()
{
    //ONGLETS
    var strHtml="";
    var currentOnglet="";
    var currentOngletLink="";
    
    strHtml+="<a href=\"index.htm\" class=\"OngletOff\" title=\"Accueil\" onMouseOut=\"window.status=''; return true\" onMouseOver=\"window.status='Accueil'; return true\">Accueil</a>&nbsp;|&nbsp";
	for(var i=0;i<_Root.Liste.length;i++)
	{
		if(_Root.Liste[i].Level==0)
		{		    
		    if(_Root.Liste[i].IsBaisser() || _Root.Liste[i].IsCourant)
		    {
	            strHtml+="<a class=\"OngletOn\" title='"+_Root.Liste[i].Libelle+"' onMouseOut=\"window.status=''; return true\" onMouseOver=\"window.status='"+_Root.Liste[i].Libelle+"'; return true\"  href=\"javascript:LoadContent('"+_Root.Liste[i].Chemin+"')\">";
	            strHtml+=_Root.Liste[i].Libelle;
                strHtml+="</a>&nbsp;|&nbsp;";
                currentOnglet=_Root.Liste[i].Libelle;
                currentOngletLink=_Root.Liste[i].Chemin;
		    }
		    else
		    {
	            strHtml+="<a class=\"OngletOff\" title='"+_Root.Liste[i].Libelle+"' onMouseOut=\"window.status=''; return true\" onMouseOver=\"window.status='"+_Root.Liste[i].Libelle+"'; return true\"  href=\"javascript:LoadContent('"+_Root.Liste[i].Chemin+"')\">";
	            strHtml+=_Root.Liste[i].Libelle;
                strHtml+="</a>&nbsp;|&nbsp;";
		    }
		}
	}
	document.getElementById("PanelMenuOnglets").innerHTML=strHtml;



    //MENU
    var strHtmlLeft="";
    strHtmlLeft += "<div class=\"MenuTitreOnglet\"><a onMouseOut=\"window.status=''; return true\" onMouseOver=\"window.status='"+currentOnglet+"'; return true\" href=\"javascript:LoadContent('"+currentOngletLink+"')\">" + currentOnglet +"</a></div>";

    for(var i=0;i<_Root.Liste.length;i++)
    {
	    if((_Root.Liste[i].Visible==true)&&(_Root.Liste[i].Pere!=""))
	    {   		
	        //premier niveau
	        if (_Root.Liste[i].Level==1)
	        {
                if(_Root.Liste[i].IsBaisser() || _Root.Liste[i].IsCourant)
	            {
	                var strHtmlLeft2="";
	                for(var j=0;j<_Root.Liste.length;j++)
                    {                        
                        if(_Root.Liste[j].Visible==true && _Root.Liste[j].Pere!="" && _Root.Liste[j].Level>1)
	                    {   	
	                        var indent=15;
		    	            indent=(_Root.Liste[j].Level)*indent;  
		    	            if(_Root.Liste[j].IsBaisser() || _Root.Liste[j].IsCourant)
	                        {strHtmlLeft2 +="<div class=\"ItemOn\" style=\"margin-left:"+indent+"px\"><a onMouseOut=\"window.status=''; return true\" onMouseOver=\"window.status='"+_Root.Liste[j].Libelle+"'; return true\" href=\"javascript:LoadContent('"+_Root.Liste[j].Chemin+"')\" >"+_Root.Liste[j].Libelle+"</a></div>";}
	                        else
	                        {strHtmlLeft2 +="<div class=\"ItemOff\" style=\"margin-left:"+indent+"px\"><a onMouseOut=\"window.status=''; return true\" onMouseOver=\"window.status='"+_Root.Liste[j].Libelle+"'; return true\" href=\"javascript:LoadContent('"+_Root.Liste[j].Chemin+"')\" >"+_Root.Liste[j].Libelle+"</a></div>";}
                        }
                    }
                    
                    if (strHtmlLeft2!="")
                    {strHtmlLeft+="<div class=\"ItemLvl1On\"><img align=\"absmiddle\" src=\"skin/imgs/menu.jpg\" /><a onMouseOut=\"window.status=''; return true\" onMouseOver=\"window.status='"+_Root.Liste[i].Libelle+"'; return true\" href=\"javascript:LoadContent('"+_Root.Liste[i].Chemin+"')\" >"+_Root.Liste[i].Libelle+"</a>"+"<div style=\"margin-top:5px\">"+strHtmlLeft2+"</div>";}
                    else
                    {strHtmlLeft+="<div class=\"ItemLvl1On\"><img align=\"absmiddle\" src=\"skin/imgs/menu.jpg\" /><a onMouseOut=\"window.status=''; return true\" onMouseOver=\"window.status='"+_Root.Liste[i].Libelle+"'; return true\" href=\"javascript:LoadContent('"+_Root.Liste[i].Chemin+"')\" >"+_Root.Liste[i].Libelle+"</a>";}
	                
	                strHtmlLeft+="</div>";
	            }
	            else
	            {
	                if (_Root.Liste[i].IsPere())
	                {strHtmlLeft+="<div class=\"ItemLvl1Off\"><img align=\"absmiddle\" src=\"skin/imgs/menu.jpg\" /><a onMouseOut=\"window.status=''; return true\" onMouseOver=\"window.status='"+_Root.Liste[i].Libelle+"'; return true\" href=\"javascript:LoadContent('"+_Root.Liste[i].Chemin+"')\" >"+_Root.Liste[i].Libelle+"</a></div>";}
	                else
	                {strHtmlLeft+="<div class=\"ItemLvl1Off\"><img align=\"absmiddle\" src=\"skin/imgs/menu.jpg\" /><a onMouseOut=\"window.status=''; return true\" onMouseOver=\"window.status='"+_Root.Liste[i].Libelle+"'; return true\" href=\"javascript:LoadContent('"+_Root.Liste[i].Chemin+"')\" >"+_Root.Liste[i].Libelle+"</a></div>";}
	            }
			}
		}
	}
	document.getElementById("PanelMenuGauche").innerHTML=strHtmlLeft;			
}


function LoadContent(id)
{    
    window.status="Chargement...";
    top.document.getElementById("frame_contenu").src=id;   
    window.status="";
}