// menu de routage
//--------------------------------------------------------------------------------------------------------------------------
// var menu=new CreerMenu(2,"Choose your continent","Choose your country"," **** titre 3 **** ","titre 4","self");
// CreerMenu(Nb de listes, titre1, titre2, titre3, target)
// Nb listes=4 maxi
// Les 4 titres sont obligatoires (meme si Nb_liste<4)
// target=nom de la frame ou "self" si c'est la fenetre elle meme, "_blank" pour une nouvelle
// Pour ajouter les liens dans les listes, utiliser menu.Add
// Menu.Add(numéro de la liste, texte, page à charger)
/*
menu.Add(1,"Africa ","");
	menu.Add(2,"Algeria","http://www.e-doceo.net/fra/index.php?pays=Algeria");
	menu.Add(2,"Egypt","http://www.e-doceo.net/eng/index.php?pays=Egypt");
	menu.Add(2,"Lybia","http://www.e-doceo.net/eng/index.php?pays=Lybia");
	menu.Add(2,"Morocco","http://www.e-doceo.net/maroc_fr/index.php?pays=Maroc");
	menu.Add(2,"Senegal","http://www.e-doceo.net/fra/index.php?pays=Senegal");
	menu.Add(2,"Tunisia","http://www.e-doceo.net/fra/index.php?pays=Tunisia");

menu.Add(1,"Asia ","");
	menu.Add(2,"China","http://www.e-doceo.net/eng/index.php?pays=China");
	menu.Add(2,"Israel","http://www.e-doceo.net/eng/index.php?pays=Israel");
	menu.Add(2,"Japan","http://www.e-doceo.net/eng/index.php?pays=Japan");
	menu.Add(2,"North_Korea","http://www.e-doceo.net/eng/index.php?pays=North_Korea");
	menu.Add(2,"South_Korea","http://www.e-doceo.net/eng/index.php?pays=South_Korea");
	menu.Add(2,"Singapore","http://www.e-doceo.net/eng/index.php?pays=Singapore");
	menu.Add(2,"Taiwan","http://www.e-doceo.net/eng/index.php?pays=Taiwan");

menu.Add(1,"Europe","");
	menu.Add(2,"Austria","http://www.e-doceo.net/eng/index.php?pays=Austria");
	menu.Add(2,"Belgium ( fr )","http://www.e-doceo.net/belgique_fr/index.php?pays=Belgique");
	menu.Add(2,"Belgium ( en )","http://www.e-doceo.net/belgique_uk/index.php?pays=Belgium");
	menu.Add(2,"Denmark","http://www.e-doceo.net/eng/index.php?pays=Denmark");
	menu.Add(2,"Finland","http://www.e-doceo.net/eng/index.php?pays=Finland");
	menu.Add(2,"France","http://www.e-doceo.net/home/fr/presentation.php?active=0");
	menu.Add(2,"France-DOM","http://www.e-doceo.net/DOM/index.php?pays=DOM");
	menu.Add(2,"Germany","http://www.e-doceo.net/eng/index.php?pays=Germany");
	menu.Add(2,"Ireland","http://www.e-doceo.net/eng/index.php?pays=Ireland");
	menu.Add(2,"Italy","http://www.e-doceo.net/eng/index.php?pays=Italy");
	menu.Add(2,"Netherlands","http://www.e-doceo.net/eng/index.php?pays=Netherlands");
	menu.Add(2,"Norway","http://www.e-doceo.net/eng/index.php?pays=Norway");
	menu.Add(2,"Poland","http://www.e-doceo.net/eng/index.php?pays=Poland");
	menu.Add(2,"Portugal","http://www.e-doceo.net/eng/index.php?pays=Portugal");
	menu.Add(2,"Romania","http://www.e-doceo.net/eng/index.php?pays=Romania");
	menu.Add(2,"Spain","http://www.e-doceo.net/fra/index.php?pays=Spain");
	menu.Add(2,"Sweden","http://www.e-doceo.net/eng/index.php?pays=Sweden");
	menu.Add(2,"Suisse","http://www.e-doceo.net/suisse_fr/index.php?pays=Suisse");
	menu.Add(2,"United-Kingdom","http://www.e-doceo.net/eng/index.php?pays=United-Kingdom");

menu.Add(1,"Oceania","");
	menu.Add(2,"Australia","http://www.e-doceo.net/eng/index.php?pays=Australia");
	menu.Add(2,"New-Zealand","http://www.e-doceo.net/eng/index.php?pays=New-Zealand");

menu.Add(1,"North America","");
	menu.Add(2,"Canada ( fr )","http://www.e-doceo.net/canada_fr/index.php?pays=Canada");
	menu.Add(2,"Canada ( en )","http://www.e-doceo.net/canada_uk/index.php?pays=Canada");
	menu.Add(2,"United-States","http://www.e-doceo.net/eng/index.php?pays=United-States");
	
menu.Add(1,"Central America","");
	menu.Add(2,"Antilles","http://www.e-doceo.net/DOM/index.php?pays=DOM");

menu.Add(1,"South America","");
	menu.Add(2,"Argentina","http://www.e-doceo.net/fra/index.php?pays=Argentina");
	menu.Add(2,"Bolivia","http://www.e-doceo.net/fra/index.php?pays=Bolivia");
	menu.Add(2,"Brazil","http://www.e-doceo.net/fra/index.php?pays=Brazil");
	menu.Add(2,"Chile","http://www.e-doceo.net/fra/index.php?pays=Chile");
	menu.Add(2,"Colombia","http://www.e-doceo.net/fra/index.php?pays=Colombia");
	menu.Add(2,"Ecuador","http://www.e-doceo.net/fra/index.php?pays=Ecuador");
	menu.Add(2,"Guyana","http://www.e-doceo.net/DOM/index.php?pays=DOM");
	menu.Add(2,"Paraguay","http://www.e-doceo.net/fra/index.php?pays=Paraguay");
	menu.Add(2,"Peru","http://www.e-doceo.net/fra/index.php?pays=Peru");
	menu.Add(2,"Suriname","http://www.e-doceo.net/fra/index.php?pays=Suriname");
	menu.Add(2,"Uruguay","http://www.e-doceo.net/fra/index.php?pays=Uruguay");
	menu.Add(2,"Venezuela","http://www.e-doceo.net/fra/index.php?pays=Venezuela");
*/
var menu=new CreerMenu(1,"Choose your country","Choose your country"," **** titre 3 **** ","titre 4","self");
menu.Add(1,"Belgium ","http://www.e-doceo.be");
menu.Add(1,"Canada ","http://ca.e-doceo.net");
menu.Add(1,"Espa&ntilde;a ","http://es.e-doceo.net");
menu.Add(1,"France ","http://www.e-doceo.net/fr/home.php?active=0");
menu.Add(1,"México ","http://mx.e-doceo.net");
menu.Add(1,"Netherlands ","http://nl.e-doceo.net");
menu.Add(1,"Switzerland ","http://ch.e-doceo.net");
menu.Add(1,"Other ","http://world.e-doceo.net");


function CreerMenu(profondeur,titre1,titre2,titre3,titre4,target) {
	this.nb=0;this.prof=profondeur;
	this.titre1=titre1; this.titre2=titre2; this.titre3=titre3; this.titre4=titre4; this.target=target
	this.Add=AddObjet;
	this.Aff=AffMenu;
}
function AddObjet(deep,txt,page) {
	var rub = new Object;
	rub.deep=deep;
	rub.txt=txt;
	rub.page=page;
	this[this.nb]=rub;
	this.nb++;
}
function AffMenu() {
	var Z="<FORM name='mf'>";
	Z+="<SELECT size=1 name='list1' onChange='Clic(1)'><OPTION selected>"+this.titre1+"</OPTION>";
	for (var i=0;i<this.nb;i++) {
		if (this[i].deep==1) {
			Z+="<OPTION value='"+i+"'>"+this[i].txt+"</OPTION>"
		}
	}
	Z+="</SELECT>";
	for (var i=2;i<=menu.prof;i++) {
		Z+="<SELECT name='list"+i+"' onChange='Clic("+i+")'><OPTION>"+eval("menu.titre"+i)+"</OPTION><OPTION></OPTION><OPTION></OPTION><OPTION></OPTION><OPTION></OPTION><OPTION></OPTION></SELECT>";
	}
	Z+="</FORM>";
	document.write(Z);
}
function add() {
	var c=new Option("ADD","",true,true);
	document.forms[0].elements["list"].options[0]=c;
}
function Clic(no) {
	var valeur=document.forms["mf"].elements["list"+no].options[ document.forms["mf"].elements["list"+no].selectedIndex].value;
	if ((valeur!="")&&(valeur!=null)&&(no<menu.prof)) {
		var deep=menu[valeur].deep;
		var no2=1;
		for (var noX=(no+1);noX<=menu.prof;noX++) {
			document.forms["mf"].elements["list"+eval(noX)].options.length=0;
			var titre=eval("menu.titre"+noX);
			var c=new Option(titre);
			document.forms["mf"].elements["list"+(noX)].options[0]=c;
			document.forms["mf"].elements["list"+(noX)].selectedIndex=0;
		}
		valeur++;
		for (var i=valeur;i<menu.nb;i++) {
			//alert(i);
			if (menu[i].deep==deep+1) { 
				//alert("no="+no+" texte="+menu[i].txt);
				var c=new Option(menu[i].txt,i);
				document.forms["mf"].elements["list"+(no+1)].options[no2]=c;
				no2++;
			} else { if (menu[i].deep==deep){i=menu.nb;}}
		}
		document.forms["mf"].elements["list"+(no+1)].options.length=no2+1;
		document.forms["mf"].elements["list"+(no+1)].selectedIndex=0;
		Clic(no+1)
		valeur--;
	}
	if ((valeur!="")&&(valeur!=null)) {
		var page=menu[valeur].page;
		if ((page!="")&&(page!=null)) {
			if (menu.target=="self") {window.location=page}
			else if (menu.target=="_blank") {window.open(page,"","menubar,scrollbars,toolbar,status,location")}
			else {parent.frames[menu.target].location.href=page;}
		}
	}
}
// Fonctions destinées à afficher l'arborescence du menu
function space(i) {var Z="";for (var j=0;j<i;j++){Z+="&nbsp;&nbsp;&nbsp;&nbsp;";}return Z}
function Arbo(m) {
	var Z="<BR>";
	for (var i=0;i<m.nb;i++) {
		Z+=space(m[i].deep)+m[i].txt+"&nbsp;&nbsp; <A href='"+m[i].page+"'>"+m[i].page+"</A><BR>"
	}
	document.write(Z);	
}
// Section utile pour la démonstration
// fin de menu de routage
//--------------------------------------------------------------------------------------------------------------------------


// efface les alertes d'erreurs javascript
function NoError()
	{
	return true;
	}
window.onerror=NoError;

// recommander le site
url = window.location;
titre = document.title;
sujet = "e-doceo ---- e-learning ----";
function sendUrl(){ 
window.location = "mailto:"+prompt('email','')+"?subject="+sujet+"&body= e-doceo : "+titre+" "+url;
   } 

// Mettre en favoris
function favoris() {
      if ( navigator.appName != 'Microsoft Internet Explorer' ){
           window.sidebar.addPanel("e-doceo e-learning software","http://www.e-doceo.net","");
       }
       else {
          window.external.AddFavorite("http://www.e-doceo.net","e-doceo e-learning software");
       }
 }


// getElementById
if(!document.getElementById){
  if(document.all){
    document.getElementById=function(){
if(typeof document.all[arguments[0]]!="undefined"){return document.all[arguments[0]]}else{return null}
    }
  }else if(document.layers){
    document.getElementById=function(){
if(typeof document[arguments[0]]!="undefined"){return document[arguments[0]]}else{return null}
    }
  }
}


// photos aleatoire top
function makeArray(n) {
this.length = n;
for (var i=1; i<=n; i++) {
this[i] = ""; 
}
return this;
}
var i;
function imagealeatoire() {
i = Math.floor(4 * Math.random() + 1);
return image[i];
}
image = new makeArray(4);
image[1]="http://www.e-doceo.net/franchising/img/a.jpg";
image[2]="http://www.e-doceo.net/franchising/img/b.jpg";
image[3]="http://www.e-doceo.net/franchising/img/c.jpg";
image[4]="http://www.e-doceo.net/franchising/img/d.jpg";

function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function MM_goToURL() { //v3.0
  var i, args=MM_goToURL.arguments; document.MM_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// contournement bug ie flash
//--------------------------------------------------------------------------------------------------------------------------

function placerFlashmenu(page) {
	
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="750" height="40">\n');
  document.write('<param name="movie" value="http://www.e-doceo.net/franchising/menu-site2006.swf?active=' + page + '" />\n');
  document.write('<param name="quality" value="high" />\n');
  document.write('<param name="wmode" value="transparent" />\n');
  document.write('<embed src="http://www.e-doceo.net/franchising/menu-site2006.swf?active=' + page + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" width="750" height="40"></embed>\n');
  
  document.write('</object>\n');
  }
  
  
    function placerFlashmondialfr() {
	
  document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="716" height="519">\n');
  document.write('<param name="movie" value="http://www.e-doceo.net/franchising/img/mondial/debut3fr.swf" />\n');
  document.write('<param name="quality" value="high" />\n');
  document.write('<param name="wmode" value="transparent" />\n');
  document.write('<embed src="http://www.e-doceo.net/franchising/img/mondial/debut3fr.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" wmode="transparent" width="716" height="519"></embed>\n');
  
  document.write('</object>\n');
  }

