//var mon_elem = document.getElementById('machin');
//var cote_droit = getPos(mon_elem).r;
var getPos = function (elem) {
    var pos={'r':0,'l':0,'t':0,'b':0};
    var tmp=elem;
 
    do {
        pos.l += tmp.offsetLeft;
        tmp = tmp.offsetParent;
    } while( tmp !== null );
    pos.r = pos.l + elem.offsetWidth;
 
    tmp=elem;
    do {
        pos.t += tmp.offsetTop;
        tmp = tmp.offsetParent;
    } while( tmp !== null );
    pos.b = pos.t + elem.offsetHeight;
 
    return pos;
};

// http://www.editeurjavascript.com/forum/topic,7,39784,0.html
// http://www.editeurjavascript.com/scripts/scripts_navigation_1_111.php

bgcolor='#CC0000';//couleur de fond des rubriques
bgcolor0='#E9967A'; //CC0000';
bgcolor1='#FF69B4'; //CC0000';//couleur de fond des rubriques au passage de la souris
bgcolor2='#FF6347'; //CC0000';
bgcolor3='#48D1CC'; //CC0000';
bgcolor4='#FFA500'; //CC0000';
bgcolor5='#BC8F8F'; //CC0000';
bgcolor6='#33CCFF'; //CC0000';
bgcolor7='#FFB6C1'; //CC0000';
bgcolor8='#D2691E'; //CC0000';
bgcolor9='#ADFF2F'; //CC0000';

zgcolor = new Array;
zgcolor[0] = '#E9967A'; //CC0000';//couleur de fond des sous rubriques au passages de la souris
zgcolor[1] = '#FF69B4'; //CC0000';
zgcolor[2] = '#FF6347'; //CC0000';
zgcolor[3] = '#48D1CC'; //CC0000';
zgcolor[4] = '#FFA500'; //CC0000';
zgcolor[5] = '#BC8F8F'; //CC0000';
zgcolor[6] = '#33CCFF'; //CC0000';
zgcolor[7] = '#FFB6C1'; //CC0000';
zgcolor[8] = '#D2691E'; //CC0000';
zgcolor[9] = '#ADFF2F'; //CC0000';

document.write('<style type="text/css">');                                                                                          
document.write('.popper { POSITION: absolute; z-index:3; }')
document.write('#topgauche { position:absolute; z-index:2; }')
document.write('A:hover.ejsmenu {color:#FFFFFF; text-decoration:none;}')
document.write('A.ejsmenu {color:#FFFFFF; text-decoration:none;}')
document.write('</style>')
document.write('<div style="position:relative;height:25"></div><div id="topdeck"></DIV>');
/*
SCRIPT EDITE SUR L'EDITEUR JAVACSRIPT
http://www.editeurjavascript.com
*/

/*
LIENS
*/

zlien = new Array;
zlien[0] = new Array;
zlien[1] = new Array;
zlien[2] = new Array;
zlien[3] = new Array;
zlien[4] = new Array;
zlien[5] = new Array;

zlien[0][0] = '<A HREF="?pg=nos_coordonnees" CLASS=ejsmenu>Nos coordonnées</A>'; 

zlien[1][0] = '<A HREF="?pg=le_bureau" CLASS=ejsmenu>Le Bureau</A>';
zlien[1][1] = '<A HREF="?pg=son_but" CLASS=ejsmenu>Son but</A>';
zlien[1][2] = '<A HREF="?pg=Illustrations_enfants" CLASS=ejsmenu>Illustrations enfants</A>';
zlien[1][3] = '<A HREF="?pg=Nos_relations" CLASS=ejsmenu>Nos relations</A>';

zlien[2][0] = '<A HREF="?pg=Info-Enseignants" CLASS=ejsmenu>Info Enseignants</A>';
zlien[2][1] = '<A HREF="?pg=Info-adherents" CLASS=ejsmenu>Info adhérents</A>';
zlien[2][2] = '<A HREF="?pg=Info-Bureau" CLASS=ejsmenu>Info Bureau</A>';

zlien[3][0] = '<A HREF="?pg=spectacle_trimestre1" CLASS=ejsmenu>1er TRIMESTRE</A>';
zlien[3][1] = '<A HREF="?pg=spectacle_trimestre2" CLASS=ejsmenu>2eme TRIMESTRE</A>';
zlien[3][2] = '<A HREF="?pg=spectacle_trimestre3" CLASS=ejsmenu>3eme TRIMESTRE</A>';
              
zlien[4][0] = '<A HREF="?pg=photos&saison=2007-2008" CLASS=ejsmenu>Saison 2007-2008</A>';
zlien[4][1] = '<A HREF="?pg=photos&saison=2008-2009" CLASS=ejsmenu>Saison 2008-2009</A>';
zlien[4][2] = '<A HREF="?pg=photos&saison=2009-2010" CLASS=ejsmenu>Saison 2009-2010</A>';
zlien[4][3] = '<A HREF="?pg=photos&saison=2010-2011" CLASS=ejsmenu>Saison 2010-2011</A>';
zlien[4][4] = '<A HREF="?pg=photos&saison=2011-2012" CLASS=ejsmenu>Saison 2011-2012</A>';

   

var top = 25;

function pop(msg,pos,theelement)
{


var gauche2 = getPos(theelement).l;
var haut2 = getPos(theelement).t;

	a=true
	//alert("position g: "+ gauche2 +"\n position h: "+ haut2 );
	var pos2 = ( gauche2 * 1 );
	var top2 = ( haut2 * 1 ) + ( top * 1 );
	var content ="<div class=popper style=\"left:"+ pos2 +"px; top:"+ top2 +"px; \" ><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=#000000 WIDTH=200><TR><TD><TABLE WIDTH=100% BORDER=0 CELLPADDING=0 CELLSPACING=1>";
	pass = 0// largeur des colonnes du sousmenu
	while (pass < msg.length)
		{
			content += "<TR><TD BGCOLOR="+bgcolor+" onMouseOver=\"this.style.background='"+zgcolor[pass]+"'\" onMouseOut=\"this.style.background='"+bgcolor+"'\" HEIGHT=20><FONT SIZE=1 FACE=\"Verdana\">  "+msg[pass]+"</FONT></TD></TR>";
			pass++;
		}
	content += "</TABLE></TD></TR></TABLE></div>";

  document.getElementById("topdeck").innerHTML = content;

}

function kill()
{
	document.getElementById("topdeck").innerHTML = "";
}

document.onclick = kill;

document.write('<DIV id=topgauche><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 BGCOLOR=#000000 WIDTH=950><TR><TD><TABLE CELLPADING=0 CELLSPACING=1 BORDER=1 WIDTH=100% HEIGHT=25><TR>')
document.write('<TD WIDTH=135 ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\''+bgcolor2+'\';pop(zlien[0],1,this)" onMouseOut="this.style.background=\''+bgcolor+'\'"><A onClick=href="?pg=accueil" onMouseOver="pop(zlien[0],0)" href=# CLASS=ejsmenu><FONT SIZE=1 FACE="Verdana">ACCUEIL</FONT></a></TD>')
document.write('<TD WIDTH=135 ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\''+bgcolor3+'\';pop(zlien[1],2,this)" onMouseOut="this.style.background=\''+bgcolor+'\'"><A onClick=href="?pg=l_association" onMouseOver="pop(zlien[1],75)" href=# CLASS=ejsmenu><FONT SIZE=1 FACE="Verdana">ASSOCIATION</FONT></a></TD>')
document.write('<TD WIDTH=135 ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\''+bgcolor4+'\';pop(zlien[2],3,this)" onMouseOut="this.style.background=\''+bgcolor+'\'"><A onClick=href="?pg=actualite" onMouseOver="pop(zlien[2],210)" href=# CLASS=ejsmenu><FONT SIZE=1 FACE="Verdana">ACTUALITES</FONT></a></TD>')
document.write('<TD WIDTH=135 ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\''+bgcolor4+'\';pop(zlien[3],4,this)" onMouseOut="this.style.background=\''+bgcolor+'\'"><A onClick=href="?pg=nos_spectacles" onMouseOver="pop(zlien[3],317)" href=# CLASS=ejsmenu><FONT SIZE=1 FACE="Verdana">NOS SPECTACLES</FONT></a></TD>')
document.write('<TD WIDTH=135 ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\''+bgcolor3+'\';pop(zlien[4],5,this)" onMouseOut="this.style.background=\''+bgcolor+'\'"><A onClick=href="?pg=galerie_photos" onMouseOver="pop(zlien[4],530)" href=# CLASS=ejsmenu><FONT SIZE=1 FACE="Verdana">GALERIE PHOTOS</FONT></a></TD>')
document.write('<TD WIDTH=135 ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\''+bgcolor4+'\';pop(zlien[5],6,this)" onMouseOut="this.style.background=\''+bgcolor+'\'"><A onClick=href="?pg=jmf_federation" onMouseOver="pop(zlien[5],700)" href=# CLASS=ejsmenu><FONT SIZE=1 FACE="Verdana">JMF.LA FEDERATION</FONT></a></TD>')
document.write('<TD WIDTH=140 ALIGN=center BGCOLOR='+bgcolor+' onMouseOver="this.style.background=\''+bgcolor4+'\';pop(zlien[6],7,this)" onMouseOut="this.style.background=\''+bgcolor+'\'"><A onClick=href="?pg=revue_de_presse" onMouseOver="pop(zlien[6],800)" href=# CLASS=ejsmenu><FONT SIZE=1 FACE="Verdana">REVUE DE PRESSE</FONT></a></TD>')
document.write('</TR></TABLE></TD></TR></TABLE></DIV></div>')
