//Magic Menu V2.1.1 - http://www.ToutJavaScript.com/magicmenu
var main="";

function CREERMAGIC() {

	main=new CreerMain(20,125,18);

	m1=new CreerMenu("m1",0,"");
		main.Add("Actualité",85,"m1","");
			m1.add("Actu du club","http://www.bodhi.fr/pages/actualites/club/actu_club.html","","");
			m1.add("Actu locale","http://www.bodhi.fr/pages/actualites/locale/actu_locale.html","","");
			m1.add("Actu de la ligue","http://www.bodhi.fr/pages/actualites/ligue/actu_ligue.html","","");
			m1.add("Actu fédérale","http://www.bodhi.fr/pages/actualites/federation/actu_federale.html","","");
			m1.add("Actu nationale","http://www.bodhi.fr/pages/actualites/nationale/actu_nationale.html","","");
	
	m2=new CreerMenu("m2",0,"");
		main.Add("Forum",85,"m2","");
			m2.add("Accéder au forum","http://www.bodhi.fr/phpbb3/index.php","","_blank");
	
	m3=new CreerMenu("m3",0,"");
		main.Add("Le Club",85,"m3","");
			m3.add("L'association","http://www.bodhi.fr/pages/club/association.html","","");
			m3.add("Horaires et calendrier","http://www.bodhi.fr/pages/club/horaires09-10.html","","");
			m3.add("Adhésion","http://www.bodhi.fr/pages/adhesion/adhesion.html","","");
	
	m4=new CreerMenu("m4",0,"");
		main.Add("Liens",85,"m4","");
			m4.add("Ouvrir la liste des partenaires","http://www.bodhi.fr/pages/liens.html","","");
	
	m5=new CreerMenu("m5",0,"");
		main.Add("l'Aïkido",85,"m5","");
			m5.add("Qu'est-ce que l'Aïkido?","http://www.bodhi.fr/pages/aikido/aikido.html","","");
			m5.add("Le Fondateur","http://www.bodhi.fr/pages/aikido/o_sensei.html","","");
			m5.add("Etiquette et protocole","http://www.bodhi.fr/pages/aikido/etiquette.html","","");
			m5.add("Les fédérations","http://www.bodhi.fr/pages/aikido/federations.html","","");
			m5.add("Principes et techniques","http://www.bodhi.fr/pages/aikido/techniques.html","","");
			m5.add("Quelques grands noms","http://www.bodhi.fr/pages/aikido/senseis.html","","");
	
	m6=new CreerMenu("m6",0,"");
		main.Add("Le Dojo",85,"m6","");
			m6.add("Album photos","http://www.bodhi.fr/pages/en_construction.html","","");
			m6.add("Se rendre au Dojo","http://www.bodhi.fr/pages/dojo/carte.html","","");
			m6.add("Règlement intérieur","http://www.bodhi.fr/pages/en_construction.html","","");
	
	m7=new CreerMenu("m7",0,"");
		main.Add("Favoris",85,"m7","");
			m7.add("Gérer vos favoris","","","");
	
	m8=new CreerMenu("m8",0,"");
		main.Add("Ressources",105,"m8","");
			m8.add("Glossaire","http://www.bodhi.fr/pages/ressources/glossaire.html","","");
			m8.add("Livres et vidéos","http://www.bodhi.fr/pages/en_construction.html","","");
			m8.add("L'Aïkido par l'image","http://www.bodhi.fr/pages/ressources/aikidoparlimage.html","","");
			m8.add("Progression technique","http://www.bodhi.fr/pages/ressources/pregression_tableaux.html","","");
	
	m9=new CreerMenu("m9",0,"");
		main.Add("FAQ",55,"m9","");
			m9.add("Vos questions et leurs réponses","http://www.bodhi.fr/pages/faq.html","","");
	
	m10=new CreerMenu("m10",0,"");
		main.Add("Contact",85,"m10","");
			m10.add("Faites nous vos suggestions","http://www.bodhi.fr/pages/contact/requete/contacts.html","","");
			m10.add("Abonnez vous aux MAJ","http://bodhi.fr/pages/contact/maj/form_inscr_MAJ.html","","");
	} 
		
		
CREERMAGIC();

var font="Tempus Sans ITC";
var colBarre="maroon";
var colFond="maroon";
var colContour="silver";
var colOver="orange";
var colTextOff="orange";
var colTextOn="maroon";
var cssTexte=";font-weight:bold;color:orange;font-family:Tempus Sans ITC;font-size:14px";
var hauteur=18;
var nivmax=4;
var delai=30;
var isout=0;

function CreerMain(X,Y,haut,colFOn,colFOff,colTOn,colTOff) {
	this.nb=0;
	this.X=X;
	this.Y=Y;
	this.haut=haut;
	this.Add=AddMain;
	this.Print=PrintMain;
	}

function AddMain(txt,larg,mnu,url,target) {
	var m=new Object;
	m.txt=txt;
	m.larg=larg,m.mnu=mnu,m.url=url;
	m.target=target;
	this.nb++;
	this[this.nb]=m;
	if(mnu!=''){eval(mnu+'.parent="'+txt+'"')};
	}

function PrintMain() {
var larg=0;	for (i=1;i<=main.nb;i++) {larg+=main[i].larg+1;}
this.X=Math.round((mmgetlarg()-larg)/2);
	X=this.X; Y=this.Y; A="";
	for (var i=1;i<=this.nb;i++) {
 if (this[i].mnu==""){this[i].mnu='0';}
		if ((document.all)||(window.sidebar)) {
         var clic=""; var style=""; if(this[i].url!="") {style="cursor:hand;"; clic=" onclick='window.location=\""+this[i].url+"\"'";}
			A+="<DIV id='main"+i+"' style='position:absolute;left:"+X+";top:"+Y+";"+style+"width:"+this[i].larg+";height:"+this.haut+";background-color:"+colBarre+";"+cssTexte+";text-align:center' onmouseover='start("+i+","+this[i].mnu+","+X+","+(Y+this.haut+1)+")'"+clic+">"+this[i].txt+"</DIV>";
		}
		if (document.layers) {
alert("Version de démo non compatible avec Netscape");
		}
		X+=this[i].larg+1;
	}
	document.write(A);
}

function CreerMenu(nom,niv,target) {this.nb=0; this.X=0;this.Y=0; this.width=1; this.niv=niv; this.parent=""; this.ON=-1;this.nom=nom;this.target=""; if ((target!="")&&(target!=null)) this.target=target;this.add=Add;this.aff=Aff;this.addFavoris=AddListeFavoris;}

function Add(lib,lnk,mnu,target) {var rub = new Object;	rub.lib=lib; rub.target=target;	rub.lnk=""; if ((lnk!="")&&(lnk!=null)) rub.lnk=lnk; rub.mnu=""; if ((mnu!="")&&(mnu!=null)) {rub.mnu=mnu; mnu.parent=this}	this[this.nb]=rub;	this.nb++;}

function start(i,mnu,x,y) {
	isout=1;hideall(i);isout=0
x=parseInt(GetLeft("main"+i));
	if (mnu!=0){mnu.aff(x,y)};
	BGCalque("main"+i,colOver); FontCalque("main"+i,colTextOn); SizeCalque("fond",mmgetlarg()-x+20);
MoveCalque("fond",x-50,y+1+mmtop);
	MoveCalque("fond",x-50,y+1);
	ShowCalque("fond");
	return false;
}

function onfond() {
	isout=1;
	setTimeout("hideall()",delai);
}

function hideall(i) {
	if (isout==1) {
		for (var i=0;i<nivmax;i++) {HideCalque("niv"+i); HideCalque("fond");}
		for (var i=1;i<=main.nb;i++) {BGCalque("main"+i,colBarre); FontCalque("main"+i,colTextOff);}
	window.status="";MoveCalque("fond",1,1);
	}
}

function hide(mnu) {
	if (mnu.ON>-1) {
		if (mnu[mnu.ON].mnu!="") {
			var nom="niv"+mnu[mnu.ON].mnu.niv;
			HideCalque(nom);
			hide(mnu[mnu.ON].mnu);
		}
	}
	mnu.ON=-1;
}

function over(mnu,i) {
	var nom="niv"+mnu.niv+"n"+i;
	var nomtd=nom+"td";
	isout=0;
	BGCalque(nom,colOver);
	FontCalque(nomtd,colTextOn);
}

function out(mnu,i) {
	var nom="niv"+mnu.niv+"n"+i; 	var nomtd=nom+"td";
	if (mnu[i].lib!="-") {
		BGCalque(nom,colFond);
		FontCalque(nomtd,colTextOff)
	}
}

function clear(mnu) {
	  for (var j=0;j<mnu.nb;j++) {
	   out(mnu,j);
	   hide(mnu);
	}
}

function mmover(mnu,i) {
	clear(mnu);
	over(mnu,i);
	mnu.ON=i;
	if (mnu[i].mnu!="") {
		mnu[i].mnu.aff();
	}
var ok=1; var Y=""; var Z=mnu[i].lib; var u=mnu; while (u.niv>0) {Z=u.parent[u.parent.ON].lib+" > "+Z;u=u.parent;} Z=u.parent+" > "+Z;
for (var j=0;j<Z.length ;j++ ){
	if (Z.charAt(j)=="<") {ok=0;}
	if (ok==1) {Y+=Z.charAt(j) }
	if (Z.charAt(j)==">") {ok=1;}
}window.status=Y;
}

function mmclick(mnu) {
	lnk=mnu[mnu.ON].lnk;
	if (lnk!="") {
			if (mnu[mnu.ON].target=="_blank") {window.open(lnk)}
			else {
				if   (mnu[mnu.ON].target=="")	{window.location=lnk;}
				else {parent.frames[mnu[mnu.ON].target].location.href=lnk;}
			}
	}
}
var mmtop=0;

function mmgettop() {if (document.layers){return parseInt(window.pageYOffset)} else {return parseInt(document.body.scrollTop)}}

function mmreposh() {
	var top=mmgettop(); var X=main.X;
	if (top!=mmtop) {MoveCalque("fond",X-1,top+main.Y); for (i=1;i<=main.nb;i++) {MoveCalque("main"+i,X,top+main.Y);X+=main[i].larg+1}}
	setTimeout("mmreposh()",500); mmtop=top;
}
function mmgetlarg() {if (document.layers){return parseInt(document.width)} else {return parseInt(document.body.offsetWidth)}}
var mmlarg=0;

function mmrepos() {
if (mmgetlarg()!=mmlarg){var larg=0;for (i=1;i<=main.nb;i++) {larg+=main[i].larg+1;}
var X=Math.round((mmgetlarg()-larg)/2);	main.X=X;MoveCalque("fond",X-1,main.Y)
for (i=1;i<=main.nb;i++) {MoveCalque("main"+i,X,main.Y);X+=main[i].larg+1;}}
mmlarg=mmgetlarg();	setTimeout("mmrepos()",1000);}

function AFF() {
var n=new Image; n.src="http://www.bodhi.fr/images/fleche_tao3.GIF";var m=new Image; m.src="http://www.bodhi.fr/images/puce_tao3.GIF";	if ((document.all)||(window.sidebar)) {
var A="<DIV id='fond' style='position:absolute;top:10;left:85;width:500;height:400;visibility:hidden;font-family:"+font+"' onmouseover='onfond()'></DIV>";A+="<DIV id='niv0' style='position:absolute;top:10;left:85;visibility:visible;font-family:"+font+"'></DIV>";A+="<DIV id='niv1' style='position:absolute;top:10;left:85;visibility:visible;font-family:"+font+"'></DIV>";A+="<DIV id='niv2' style='position:absolute;top:10;left:85;visibility:visible;font-family:"+font+"'></DIV>";A+="<DIV id='niv3' style='position:absolute;top:10;left:85;visibility:visible;font-family:"+font+"'></DIV>";}	document.write(A);main.Print();
setTimeout("mmrepos()",85);
setTimeout("mmreposh()",85);
}

function Aff(x,y) {
var nom=this.nom;	var niv="niv"+this.niv;
if (this.niv==0) {X=x;Y=Y=main.Y+mmtop+hauteur+1;;}
else {X=this.parent.X+this.parent.width-7;Y=this.parent.Y+(hauteur+4)*this.parent.ON}if ((document.all)||(window.sidebar)) {
var A=""
A+="<TABLE border=0 cellpadding=0 cellspacing=0><TR><TD>"
A+="<TABLE border=0 cellpadding=0 cellspacing=0 style='border-color:"+colContour+";border-style:solid;border-width:1px'>";
for (var i=0;i<this.nb;i++) {
if (this[i].lib=="-") {
A+="<TR><TD style='background-color:"+colFond+";font-size:10px;border-style:none;margin:0px;height:"+(hauteur-2)+"px' colspan=2><DIV  style='background-color:"+colFond+";height:"+(hauteur+2)+"px'><HR noshade style='color:"+colContour+";height:1px'></DIV></TD></TR>"; 
}
else {
var img="http://www.bodhi.fr/images/puce_tao3.GIF";if (this[i].mnu!="") { img="http://www.bodhi.fr/images/fleche_tao3.GIF"}
A+="<TR><TD style='cssTexte;border-style:none;margin:0px'><DIV id='"+niv+"n"+i+"' style='cursor:hand;background-color:"+colFond+cssTexte+"'  onmouseover='mmover("+this.nom+","+i+")' onClick='mmclick("+this.nom+")'><TABLE border=0 width=85% cellspacing=0><TR><TD style='font-size:12px;padding-top:3px;padding-bottom:3px;padding-left:3px;'><DIV id='"+niv+"n"+i+"td' style='"+cssTexte+"'>"+this[i].lib+"</DIV></TD><TD width=10 align=right><IMG src='"+img+"' height='"+hauteur+"' width='"+hauteur+"'></TD></TR></TABLE></DIV></TD></TR>";
}
}
A+="</TABLE>"
A+="</TD><TD width=3 bgcolor=silver style='filter:alpha(opacity=30)'><IMG src='http://www.bodhi.fr/images/fleche_tao3.GIF' width=2></TD><TD width=2 bgcolor=silver style='filter:alpha(opacity=15)'><IMG src='http://www.bodhi.fr/images/fleche_tao3.GIF' width=2></TD></TR>";
A+="<TR><TD height=3 colspan=2 bgcolor=silver style='filter:alpha(opacity=30)'><IMG src='http://www.bodhi.fr/images/fleche_tao3.GIF' height=3></TD></TR><TR><TD height=2 colspan=2 bgcolor=silver style='filter:alpha(opacity=15)'><IMG src='http://www.bodhi.fr/images/fleche_tao3.GIF' height=2></TD></TR></TABLE>";
}
else{
var A="<table border=0 cellspacing=0 cellpadding=1><tr><td bgcolor="+colContour+">";
A+="<TABLE border=0 cellpadding=0 cellspacing=0 bgcolor="+colFond+" width=85%>";

for (var i=0;i<this.nb;i++) {

if (this[i].lib=="-") {
A+="<TR><TD><HR width=99% height=1%></TD></TR>";
}
else {
var img="http://www.bodhi.fr/images/puce_tao3.GIF";if (this[i].mnu!="") { img="http://www.bodhi.fr/images/fleche_tao3.GIF"}
A+="<TR><TD><TABLE border=0 width=85% cellspacing=0><TR><TD><A href='javascript:mmclick("+this.nom+")' onmouseover='mmover("+this.nom+","+i+")'><SPAN style='background-color:"+colFond+cssTexte+"'>"+this[i].lib+"</SPAN></A></TD><TD width=10 align=right><IMG src='"+img+"' height="+hauteur+" width="+hauteur+"></TD></TR></TABLE></TD></TR>";
}
}
A+="</TABLE></TD</TR></TABLE>"
}

if (document.all) {document.all[niv].innerHTML=A+"&nbsp;";document.all[niv].style.top=Y;document.all[niv].style.left=X;document.all[niv].style.visibility="visible";this.X=X;this.Y=Y;this.width=document.all[niv].clientWidth;}

if (window.sidebar) {document.getElementById(niv).innerHTML=A;document.getElementById(niv).style.top=Y;document.getElementById(niv).style.left=X;document.getElementById(niv).style.visibility="visible";this.X=X;this.Y=Y;this.width=document.getElementById(niv).offsetWidth;}

if (document.layers) {document.layers[niv].left=X;document.layers[niv].top=Y;document.layers[niv].document.write(A);document.layers[niv].document.close();document.layers[niv].visibility="show";this.X=X;this.Y=Y;this.width=document.layers[niv].clip.width;}}

function HideCalque(nom) {
if (document.all) {document.all[nom].style.visibility="hidden";}
if (window.sidebar) {document.getElementById(nom).style.visibility="hidden";}
if (document.layers) {document.layers[nom].visibility="hide";}
}

function ShowCalque(nom) {
if (document.all) {document.all[nom].style.visibility="visible";}
if (window.sidebar) {document.getElementById(nom).style.visibility="visible";}
if (document.layers) {document.layers[nom].visibility="show";}
}

function BGCalque(nom,BG) {
if (document.all) {document.all[nom].style.backgroundColor=BG;}
if (window.sidebar) {document.getElementById(nom).style.backgroundColor=BG;}
}

function FontCalque(nom,Font) {
if (document.all) {document.all[nom].style.color=Font;}
if (window.sidebar) {document.getElementById(nom).style.color=Font;}
}

function MoveCalque(nom,X,Y) {
if (document.all) {document.all[nom].style.top=Y;document.all[nom].style.left=X;}
if (window.sidebar) {document.getElementById(nom).style.top=Y;document.getElementById(nom).style.left=X;}
if (document.layers) {document.layers[nom].top=Y;document.layers[nom].left=X;}
}

function GetLeft(nom) {
if (document.all) {return document.all[nom].style.left;}
if (window.sidebar) {return document.getElementById(nom).style.left}
if (document.layers) {return document.layers[nom].left;}
}

function SizeCalque(nom,larg) {
if (document.all) {document.all[nom].style.width=larg;}
if (window.sidebar) {document.getElementById(nom).style.width=larg;}
if (document.layers) {document.layers[nom].width=larg;}
}

function AddListeFavoris() {
	var tab=GetMesFavoris();var a=-1;var i=0;var b=""
	if (tab!=null)	{
		for (i=0;i<tab.length;i++){
			if (window.location.href==tab[i].url){a=i; b=" <<"} else {b=""}
			this.add((i+1)+" : "+tab[i].titre+b,tab[i].url,"","");
		}
		this.add("-","","","");
	}
	if (a==-1){if (i<9){this.add("Ajouter cette page dans ce menu","javascript:AddMonFavori()","","");}}
	else {this.add("Supprimer cette page de ce menu","javascript:DelMonFavori("+a+")","","");}
	if (tab!=null){this.add("Gérer mes favoris...","javascript:GererFavoris()","","");}
}
function GererFavoris() {isout=1;hideall();window.open("favoris.htm","gererfavo","width=400,height=300,toolbar=no,scrollbars=no,menubar=no");}
function DelMonFavori(n) {
isout=1; hideall();var tab=GetMesFavoris();
if (confirm("Etes-vous sûr de vouloir supprimer le favori :"+tab[n].titre+" ?")) {
var i=0; var f=""
for (var i=0;i<tab.length;i++)	{
		if (i!=n){f+=tab[i].titre+"%%"+tab[i].url+"$$"}
	}
	SetCook("mesfavo",f);
		CREERMAGIC();
	}
}
function GetMesFavoris() {
	var f=GetCook("mesfavo");
	if (f==null) {return null}
	var tab=new Array(); var i=0;
	while (f.indexOf("$$",0)>0) {
		obj=new Object();
		obj.titre=f.substring(0,f.indexOf("%%",0));
		obj.url=f.substring(f.indexOf("%%",0)+2,f.indexOf("$$",0));
		tab[i]=obj;
		f=f.substring(f.indexOf("$$",0)+2);
		i++;
	}
	return tab;
}
function AddMonFavori() {
	isout=1; hideall()
	var f=GetCook("mesfavo");
	if (f==null) {f=""}
	var url=window.location.href;
	t=prompt("Vous allez ajouter cette page dans le menu Favoris\nChoisissez un titre :",document.title);
	if (t!=null){
		if (t.indexOf("<",0)>=0){alert("Titre incorrect : le caractère < est interdit :)")}
		else {f=f+t.substring(0,50)+"%%"+url+"$$";SetCook("mesfavo",f);CREERMAGIC();}
	}
}
function SetCook(nom,val){date_exp=new Date(2009,12,31);date_exp=date_exp.toGMTString();document.cookie=nom+"="+escape(val)+";expires="+date_exp+";path=/";}
function getCookVal(offset) {var endstr=document.cookie.indexOf (";", offset);if (endstr==-1) {endstr=document.cookie.length;}	return unescape(document.cookie.substring(offset, endstr));}
function GetCook(name) {
var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;
while (i<clen) {var j=i+alen;		if (document.cookie.substring(i, j)==arg){return getCookVal(j);}		i=document.cookie.indexOf(" ",i)+1;		if (i==0) break;}
return null;}
// VERSION
