function OuvrirSection( Section ) 
{
    var Pages = Section.getElementsByTagName("div");
    for ( var i = 0; i < Pages.length; i++ )
	{
        Pages[i].style.display = 'block';
    }
}

function RefermerSection( Section ) 
{
    var Liens = Section.getElementsByTagName("div");
    for ( var i = 0; i < Liens.length; i++ )
	{
        Liens[i].style.display = 'none';
    }
}

function OTSIMenu()
{
	var Divs = document.getElementsByTagName('div');
	for ( var i = 0; i < Divs.length; i++ )
	{
		if ( Divs[i].className == "OTSIMenu" )
		{
			var OTSIMenuSections = Divs[i].getElementsByTagName('div');
			for ( var j = 0; j < OTSIMenuSections.length; j++ )
			{
				if ( OTSIMenuSections[j].className == "OTSIMenuSection" )
					{
					OTSIMenuSections[j].onmouseover = function() { OuvrirSection( this ); };
					OTSIMenuSections[j].onmouseout = function() { RefermerSection( this ); };
					var OTSIMenuLiens = OTSIMenuSections[j].getElementsByTagName('div');
					for ( var k = 0; k < OTSIMenuLiens.length; k++ )
					{
						if ( OTSIMenuLiens[k].className == "OTSIMenuLien" )
						{
							OTSIMenuLiens[k].onmouseover = function() { this.className = "OTSIMenuLienHover"; };
							OTSIMenuLiens[k].onmouseout = function() { this.className = "OTSIMenuLien"; };
						}
					}
				}
			}
		}
	}
	Ajuster();
}

function Ajuster()
{
	var marge = ( ( Math.round( document.body.offsetWidth - 20 ) / 2 ) ) - Math.round( 918 / 2 );
	
	if ( document.body.offsetWidth > 1024 ) { marge = "10.5%"; }
	else if ( document.body.offsetWidth > 600 ) { marge = "3%"; } 
	else { marge = "3%"; }
	if ( marge < 12) { marge = "12px"; }	
	var Divs = document.getElementsByTagName('div');
	for ( var i = 0; i < Divs.length; i++ )
	{
		if ( Divs[i].className == "OTSIMenu" )
		{
			Divs[i].style.left = marge;
		}
	}
}

window.onload = OTSIMenu
window.onresize = Ajuster