 

function mmLoadMenus() {
  if (window.mm_menu_1126113621_0) return;
  window.mm_menu_1126113621_0 = new Menu("root",327,17,"Verdana, Arial, Helvetica, sans-serif",10,"#000000","#000000","#e5eff4","#8eabb7","left","middle",3,0,1000,-5,7,true,true,true,3,true,false);
  mm_menu_1126113621_0.addMenuItem("Ahuntsic-Cartierville","location='http://www.ville.montreal.qc.ca/ar09fr'");
  mm_menu_1126113621_0.addMenuItem("Anjou","location='http://www.ville.montreal.qc.ca/ar12fr'");
  mm_menu_1126113621_0.addMenuItem("Beaconsfield-Baie d’Urfé","location='http://www.ville.montreal.qc.ca/ar04fr'");
  mm_menu_1126113621_0.addMenuItem("Côte-des-Neiges–Notre-Dame-de-Grâce","location='http://www.ville.montreal.qc.ca/ar17fr'");
  mm_menu_1126113621_0.addMenuItem("Côte-Saint-Luc–Hampstead–Montréal-Ouest","location='http://www.ville.montreal.qc.ca/ar18fr'");
  mm_menu_1126113621_0.addMenuItem("Dollard-Des Ormeaux–Roxboro","location='http://www.ville.montreal.qc.ca/ar06fr'");
  mm_menu_1126113621_0.addMenuItem("Dorval–L’Île-Dorval","location='http://www.ville.montreal.qc.ca/ar07fr'");
  mm_menu_1126113621_0.addMenuItem("Kirkland","location='http://www.ville.montreal.qc.ca/ar03fr'");
  mm_menu_1126113621_0.addMenuItem("Lachine","location='http://www.ville.montreal.qc.ca/ar19fr'");
  mm_menu_1126113621_0.addMenuItem("LaSalle","location='http://www.ville.montreal.qc.ca/ar20fr'");
  mm_menu_1126113621_0.addMenuItem("L’Île-Bizard–Sainte-Geneviève–Sainte-Anne-de-Bellevue","location='http://www.ville.montreal.qc.ca/ar01fr'");
  mm_menu_1126113621_0.addMenuItem("Mercier–Hochelaga-Maisonneuve","location='http://www.ville.montreal.qc.ca/ar27fr'");
  mm_menu_1126113621_0.addMenuItem("Montréal-Nord","location='http://www.ville.montreal.qc.ca/ar10fr'");
  mm_menu_1126113621_0.addMenuItem("Mont-Royal","location='http://www.ville.montreal.qc.ca/ar15fr'");
  mm_menu_1126113621_0.addMenuItem("Outremont","location='http://www.ville.montreal.qc.ca/ar16fr'");
  mm_menu_1126113621_0.addMenuItem("Pierrefonds-Senneville","location='http://www.ville.montreal.qc.ca/ar02fr'");
  mm_menu_1126113621_0.addMenuItem("Plateau-Mont-Royal","location='http://www.ville.montreal.qc.ca/ar25fr'");
  mm_menu_1126113621_0.addMenuItem("Pointe-Claire","location='http://www.ville.montreal.qc.ca/ar05fr'");
  mm_menu_1126113621_0.addMenuItem("Rivière-des-Prairies–Pointe-aux-Trembles–Montréal-Est","location='http://www.ville.montreal.qc.ca/ar11fr'");
  mm_menu_1126113621_0.addMenuItem("Rosemont–La Petite-Patrie","location='http://www.ville.montreal.qc.ca/ar26fr'");
  mm_menu_1126113621_0.addMenuItem("Saint-Laurent","location='http://www.ville.montreal.qc.ca/ar08fr'");
  mm_menu_1126113621_0.addMenuItem("Saint-Léonard","location='http://www.ville.montreal.qc.ca/ar13fr'");
  mm_menu_1126113621_0.addMenuItem("Sud-Ouest","location='http://www.ville.montreal.qc.ca/ar22fr'");
  mm_menu_1126113621_0.addMenuItem("Verdun","location='http://www.ville.montreal.qc.ca/ar21fr'");
  mm_menu_1126113621_0.addMenuItem("Ville-Marie","location='http://www.ville.montreal.qc.ca/ar24fr'");
  mm_menu_1126113621_0.addMenuItem("Villeray–Saint-Michel–Parc-Extension","location='http://www.ville.montreal.qc.ca/ar14fr'");
  mm_menu_1126113621_0.addMenuItem("Westmount","location='http://www.ville.montreal.qc.ca/ar23fr'");
   mm_menu_1126113621_0.hideOnMouseOut=true;
   mm_menu_1126113621_0.menuBorder=1;
   mm_menu_1126113621_0.menuLiteBgColor='#e5eff4';
   mm_menu_1126113621_0.menuBorderBgColor='#00415d';
   mm_menu_1126113621_0.bgColor='#e5eff4';

  mm_menu_1126113621_0.writeMenus();
} // mmLoadMenus()


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];}
}
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 load1(form) {
     var url = form.Llist_1.options[form.Llist_1.selectedIndex].value;
     if (url != '')      {

        if (url.substr(0,4) == "http")
        {
	    form.reset();
	    location.href = url;
        }
        else
        {
            form.reset();
	    location.href = url;
        }

        location.href = url;

     }
    return false;
}
*/
// Ouvrir un lien html à partir d'une liste déroulante.
function load1(form) {
     var url = form.Llist_1.options[form.Llist_1.selectedIndex].value;
 	 urlBeginning = url.substr(0, url.length-14); // ex. : http://www.nomDomaine.com
	 urlEnd = url.substr(url.length-14, url.length-1); // ?target=_blank 
	 
     if(url != ''){
        if (urlEnd == "?target=_blank") 
        {
	    	form.reset();
	    	window.open(urlBeginning); // Ouvrir le lien dans une nouvelle fenêtre
        }
        else 
        {
            form.reset();
	    	location.href = url; // Ouvrir le lien dans la même fenêtre
        }
     }
}





function newWin(){
//URL EN DEV
var urlPath = 'http://hermes.montrealnet.vdm.qc.ca/sel/LesArrondissements/get?lang=fr&codePostal=' + codePostal;

//URL EN PROD
//var urlPath = 'http://servicesenligne2.ville.montreal.qc.ca/sel/LesArrondissements/get?lang=fr&codePostal=' + codePostal;

var confirmWin = window.open(urlPath,'','width=450,height=250,scrollbars=no,left=380,top=0')

	//give a reference between the opener
	//and the popup for backwards compatibility
	if(confirmWin.opener==null){
		confirmWin.opener = self;
	}
}
function newWinEn(){
//URL EN DEV
var urlPath = 'http://hermes.montrealnet.vdm.qc.ca/sel/LesArrondissements/get?lang=en&codePostal=' + codePostal;

//URL EN PROD
//var urlPath = 'http://poseidon2/Appl/LesArrondissements/get?lang=en&codePostal=' + codePostal;

var confirmWin = window.open(urlPath,'','width=450,height=250,scrollbars=no,left=380,top=0')

	//give a reference between the opener
	//and the popup for backwards compatibility
	if(confirmWin.opener==null){
		confirmWin.opener = self;
	}
}

function isValidPostalcode(theForm) {


		//codeD = removeSpaces(theForm.codeD.value);
		//codeF = removeSpaces(theForm.codeF.value);
		//codeD + codeF;
		codePostal = removeSpaces(theForm.codePostal.value);


		if (codePostal.length == 6 && codePostal.search(/^[a-zA-Z]\d[a-zA-Z]\d[a-zA-Z]\d$/) != -1)
		{
		theForm.codePostal.value = codePostal;
		newWin();
		return true;

		}else if (codePostal.length == 7 && codePostal.search(/^[a-zA-Z]\d[a-zA-Z]-\d[a-zA-Z]\d$/) != -1)
		{
		theForm.codePostal.value = codePostal;
		newWin();
		return true;

		}else
		{
		 theForm.codePostal.focus();
  		 alert("Votre 'CODE POSTAL' est invalide. / Your 'POSTAL CODE' is invalid. ");
  		 return false;
		}

	return false;
}




function removeSpaces(string) {
	var newString = '';
	for (var i = 0; i < string.length; i++) {
		if (string.charAt(i) != ' ') newString += string.charAt(i);
	}
	return newString;
}



   var browser = navigator.appName;
   var version = navigator.appVersion.charAt(0);
   var timerID = 0;
   function call_window(fichier)
        {
       if(((browser == "Netscape") && (version >= 2)))
         {
           popup=window.open(fichier,'archives','width=600,height=450,scrollbars=0,left=200,top=100')
           popup.location.href=fichier;
           popup.focus()
         }
       else
         {
           clearTimeout(timerID)
           popup=window.open(fichier,'archives','width=600,height=450,scrollbars=0,left=200,top=100')
		            }
     }

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

/* Name : showIt
   Purpose : show an object (table, div, p, ...) corresponding to an id.
   Input : you must specified an id for the object you want to show.
   Output  : the object is shown.                                          */   
function showIt(id){
	for(i=0;i<document.getElementsByTagName("div").length;i++){
		if(document.getElementsByTagName("div")[i].id==id || document.getElementsByTagName("div")[i].id==id.toUpperCase()){
			var obj = document.getElementsByTagName("div")[i];
			if(obj.style.display == "none"){
				obj.style.display = "block"; 
				
			} else if(obj.style.display == "block"){
				obj.style.display = "none"; 
			}
		}
	}
	/*var obj = document.getElementById(id);
	if(obj.style.display == "none"){
		obj.style.display = "block"; 
	} else if(obj.style.display == "block"){
		obj.style.display = "none"; 
	}*/
}

function printPopUp() {
	var str = document.getElementById("ariane").innerHTML;
	var index = str.lastIndexOf('&gt;');
	var titre_bande="";
	var langue = "fr";
	var print_text = "Imprimer ce texte";
	if(index != -1){
		titre_bande = str.substring(index+4,str.length);
	}else{
		titre_bande = str;
	}
	newWindow = window.open('','name','scrollbars=yes,height=500,width=592');
	body = "<html><head>";	
	for(i=0;i<document.getElementsByTagName("link").length;i++){
		body += '<link href="'+document.getElementsByTagName("link")[i].href+'" rel="stylesheet" type="text/css">';
	}
	body += '</head><body><table width="575" border="0" cellspacing="0" cellpadding="0"><tr>'+
    '<td width="138" rowspan="2"><img src="/pls/portal/docs/page/librairie_fr/images/pop_print2_01.gif" width="138" height="50"></td>'+
    '<td height="12" colspan="3" bordercolor="0" bgcolor="#8C0000"></td></tr>'+
    '<tr><td height="38" colspan="3" background="/pls/portal/docs/page/librairie_fr/images/pop_print2_03.gif" class="titre_print"><img src="/pls/portal/docs/page/librairie_fr/images/spacer.gif" width="2" height="1">'+
	titre_bande+
	'</td></tr>'+
    '<tr><td height="28" bgcolor="#ffffff">&nbsp;</td>'+
    '<td width="313" class="eMediumGrey9" bgcolor="#ffffff">'
	/*if(document.getElementById('ariane')!=null){
		body += document.getElementById('ariane').innerHTML;
	}*/
	if(document.getElementById('langue')!=null){
		langue = document.getElementById('langue').innerHTML;
		if(langue=='en')print_text="Print this text";
	}
    body += '</td><td width="11" bgcolor="#ffffff"><img src="/pls/portal/docs/page/librairie_fr/images/fleche_noir.gif" width="3" height="5" align="right" vspace="3" hspace="4"></td>'+
    '<td width="113" valign="middle" class="eRed10" bgcolor="#ffffff"><a href="javascript:window.print()" class="eRed11Bold">'+print_text+'</a></td>'+
    '</tr></table><table cellspacing="0" width="575" height="422" border="0" bgcolor="#ffffff" cellpadding="5"><tr valign="top"><td>';
	if(document.getElementById('titre')!=null){
		body += document.getElementById('titre').innerHTML;
	}
	if(document.getElementById('stitre')!=null){
		body += document.getElementById('stitre').innerHTML;
	}
	for(i=0;i<document.getElementsByTagName('div').length;i++){
		if(document.getElementsByTagName('div')[i].id=='print'){
			body += document.getElementsByTagName('div')[i].innerHTML;
		}
	}
	if(document.getElementById('generique')!=null){
		body += document.getElementById('generique').innerHTML;
	}
	body += "</td></tr></table>";
	body += '<script type="text/javascript">'+
	'for(i=0;i<document.getElementsByTagName("div").length;i++){'+
	'document.getElementsByTagName("div")[i].style.display="block"}'+
	'for(k=0;k<document.getElementsByTagName("span").length;k++){'+
	'spanID = document.getElementsByTagName("span")[k].id;'+
	'if(spanID.indexOf("menu_o")!=-1){'+
	'document.getElementsByTagName("span")[k].style.display="none";}}'+
	'</script>'
	body += "</body></html>";
	newWindow.document.write(body);
	
	newWindow.document.close();
}

/* Foncition utilisée par le bouton langue*/
function redirectUrl(url,message){
	switch (message) {
		case 'msg1' : 
			msg = "Cette page n'est pas disponible, vous serez redirigé vers la page d'accueil.";
			break;
		case 'msg2' : 
			msg = "Cette page n'est pas disponible, vous serez redirigé vers la page d'accueil du portail.";
			break;
		case 'msg1en' : 
			msg = "This page is not available, you will be redirected to the main page.";
			break;
		case 'msg2en' : 
			msg = "This page is not available, you will be redirected to the portal's main page.";
			break;
		default : 
			msg = "Cette page n'est pas disponible, vous serez redirigé vers la page d'accueil.";
	}
	var redir = confirm(msg);
	if (redir==true) {
		window.location=url;
	} 
}

// 
function RObj(ea) {
var LS="";var QS=new Object()
function Err(arg) {if (ea) alert("Request Object Error:\n====================\n"+arg)}
function URID(t) {var d="";if (t) {for (var i=0; i<t.length; ++i) {var c=t.charAt(i);d+=(c=="+" ? " ":c);};};return unescape(d);}
function OL(o) {var l=0;for (var i in o) {if (typeof(o[i])!="function") l++;};return l;}
function AK(key) {var auk=true;for (var u in QS) {if (typeof(QS[u])!="function" && u.toString().toLowerCase()==key.toLowerCase()) {auk=false;return u;}};if (auk) {QS[key]=new Object();QS[key].toString=function() {return TS(QS[key])};QS[key].Count=function() {return OL(QS[key])};QS[key].Count.toString=function() {return OL(QS[key]).toString()};QS[key].Item=function(e) {if (typeof(e)=="undefined") return QS[key];else {if (typeof(e)=="number") {var a=QS[key][Math.ceil(e)];if (typeof(a)=="undefined") Err("ERROR: Index out of range in\nRequest.QueryString(\""+key+"\").Item("+e+")");return a;}else Err("ERROR: Expecting numeric input in\nRequest.QueryString(\""+key+"\").Item(\""+e+"\")");}};QS[key].Item.toString=function(e) {if (typeof(e)=="undefined") return QS[key].toString();else {var a=QS[key][e];if (typeof(a)=="undefined") Err("ERROR: Index out of range in\nRequest.QueryString(\""+key+"\").Item("+e+")");return a.toString();};};QS[key].Key=function(e) {var t=typeof(e);if (t=="string") {var a=QS[key][e];return (typeof(a)!="undefined" && a && a.toString() ? e:"");}else Err("ERROR: Object doesn't support this property or method\nRequest.QueryString.Key("+(e?e:"")+")");};QS[key].Key.toString=function() {return "undefined"};};return key}
function AVTK(key, val) {if (key!="") {var key=AK(key);var l=OL(QS[key]);QS[key][l+1]=val;}}
function TS(o) {var s="";for (var i in o) {var ty=typeof(o[i]);if (ty=="object") s+=TS(o[i]);else if (ty!="function") s+=o[i]+", ";};var l=s.length;if (l>1) return(s.substring(0,l-2));return (s=="" ? "undefined":s);}
function KM(k, o) {var k=k.toLowerCase();for (var u in o) {if (typeof(o[u])!="function" && u.toString().toLowerCase()==k) return u;};}
if (window.location && window.location.search) {LS=window.location.search;var l=LS.length;if (l>0) {LS=LS.substring(1,l);var preAmpAt=0;var ampAt=-1;var eqAt=-1;var k=0;var skip=false;for (var i=0; i<l; ++i) {var c=LS.charAt(i);if (LS.charAt(preAmpAt)=="=" || (preAmpAt==0 && i==0 && c=="=")) skip=true;if (c=="=" && eqAt==-1 && !skip) eqAt=i;if (c=="&" && ampAt==-1) {if (eqAt!=-1) ampAt=i;if (skip) preAmpAt=i+1;skip=false;};if (ampAt>eqAt) {AVTK(URID(LS.substring(preAmpAt,eqAt)),URID(LS.substring(eqAt+1,ampAt)));preAmpAt=ampAt+1;eqAt=ampAt=-1;++k;};};if (LS.charAt(preAmpAt)!="=" && (preAmpAt!=0 || i!=0 || c!="=")) {if (preAmpAt!=l) {if (eqAt!=-1) AVTK(URID(LS.substring(preAmpAt,eqAt)),URID(LS.substring(eqAt+1,l)));else if (preAmpAt!=l-1) AVTK(URID(LS.substring(preAmpAt,l)),"");};if (l==1) AVTK(LS.substring(0,1),"");};};};var TC=OL(QS);if (!TC) TC=0
QS.toString=function() {return LS.toString()};QS.Count=function() {return (TC ? TC:0)};QS.Count.toString=function() {return (TC ? TC.toString():"0")};QS.Item=function(e) {if (typeof(e)=="undefined") return LS;else {if (typeof(e)=="number") {var e=Math.ceil(e);var c=0;for (var i in QS) {if (typeof(QS[i])!="function" && ++c==e) return QS[i];};Err("ERROR: Index out of range in\nRequest.QueryString().Item("+e+")");}else return QS[KM(e, QS)];};return "undefined";};QS.Item.toString=function() {return LS.toString()};QS.Key=function(e) {var t=typeof(e);if (t=="number") {var e=Math.ceil(e);var c=0;for (var i in QS) {if (typeof(QS[i])!="function" && ++c==e) return i;}}else if (t=="string") {var e=KM(e, QS);var a=QS[e];return (typeof(a)!="undefined" && a && a.toString() ? e:"");}else Err("ERROR: Wrong number of arguments or invalid property assignment\nRequest.QueryString().Key("+(e?e:"")+")");Err("ERROR: Index out of range in\nRequest.QueryString().Item("+e+")");};QS.Key.toString=function() {Err("ERROR: Wrong number of arguments or invalid property assignment\nRequest.QueryString().Key");}
this.QueryString=function(k) {if (typeof(k)=="undefined") return QS;else {var k=KM(k, QS);if (typeof(QS[k])=="undefined") {t=new Object();t.Count=function() {return 0};t.Count.toString=function() {return "0"};t.toString=function() {return "undefined"};t.Item=function(e) {return "undefined"};t.Item.toString=function() {return "undefined"};t.Key=function(e) {Err("ERROR: Object doesn't support this property or method\nRequest.QueryString.Key("+(e?e:"")+")");};t.Key.toString=function() {return "undefined"};return t;}if (typeof(k)=="number") return QS.Item(k);else return QS[k];}}
this.QueryString.toString=function() {return LS.toString();};this.QueryString.Count=function() {return (TC ? TC:0)};this.QueryString.Count.toString=function() {return (TC ? TC.toString():"0")};this.QueryString.Item=function(e) {if (typeof(e)=="undefined") return LS.toString();else {if (typeof(e)=="number") {var e=Math.ceil(e);var c=0;for (var i in QS) {if (typeof(QS[i])!="function" && ++c==e) return QS[i];};Err("ERROR: Index out of range in\nRequest.QueryString.Item("+e+")");}else return QS[KM(e, QS)];}if (typeof(e)==("number")) Err("ERROR: Index out of range in\nRequest.QueryString.Item("+e+")");return "undefined";}
this.QueryString.Item.toString=function() {return LS.toString()};this.QueryString.Key=function(e) {var t=typeof(e);if (t=="number") {var e=Math.ceil(e);var c=0;for (var i in QS) {if (typeof(QS[i])=="object" && (++c==e)) {return i;}}}else if (t=="string") {var e=KM(e, QS);var a=QS[e];return (typeof(a)!="undefined" && a && a.toString() ? e:"");}else Err("ERROR: Wrong number of arguments or invalid property assignment\nRequest.QueryString.Key("+(e?e:"")+")");Err("ERROR: Index out of range in\nRequest.QueryString.Item("+e+")");};this.QueryString.Key.toString=function() {Err("ERROR: Wrong number of arguments or invalid property assignment\nRequest.QueryString.Key");};this.Version=0.67;this.Author="<A HREF=\"http://andrewu.co.uk/request.asp?ref=CSJSRequestObjectSrc\">Andrew Urquhart</A>";}
var Request=new RObj(true);

/*
But : obtenir les objets correspondant à un "id_name" (ex. : menu_on ou menu_off) et à un type d'objet (div, span, etc.).
Entrée : le nom du id et le type d'objets sont présents dans le document.
Sortie : un tableau d'objets est retournés. */
function getObjs(id_name, type_obj)
{
	//Tableau constitué selon le type d'objet.
	var objs = document.getElementsByTagName(type_obj); 
	
	var results= new Array();
	
	results.push(""); // Insérer un élément vide à la position 0 du tableau.
	
	// Insérer les objets correspondant au "id_name" dans un tableau. 
	// Par exemple, ce tableau contiendra tous les id menu_off1, menu_off2, menu_off3, etc. reliés au id_name menu_off.
	for(var i=0;i<objs.length;i++)
	{ 
	    str1 = objs[i].id;
		id_name1 = str1.substring(0,str1.length-1); // id_name sans le numéro à la fin
		id_name2 = str1.substring(0,str1.length-2); // id_name sans les deux derniers numéros à la fin

		if( (id_name == id_name1) || (id_name == id_name2) ){
			results.push(objs[i]);
		}
	}
	
	return results;
}

/*
But : cacher tous les spans correspondant au nom du id fourni (id_name), excepté celui correspond au numéro de id (id_no).
Entrée : id_name et id_no sont définis.
Sortie : les spans sont cachés et le span au numéro "id_no" est affiché. */
function hideAllSpansExceptOne(id_name, id_no){

   //Tableau des spans "id_name" contenus dans le document.
   var spans = getObjs(id_name, "span");
      
   // Cacher tous les spans correspondant au id_name fourni excepté celui relatif à la position fournie.
   
   for(var i=1; i<spans.length; i++)
   {	
		if( (i == id_no) && (spans[i].style.display == "none") ){
		    spans[i].style.display = ""; // afficher l'objet span avec un type d'affichage (style="display: compact").
		}
		else if( (i != id_no) && (spans[i].style.display == "") ){
			spans[i].style.display="none"; 
		}
   }
}


/*
But : cacher tous les divs correspondant au nom du id fourni (id_name), excepté celui correspond au numéro de id (id_no).
Entrée : id_name et id_no sont définis.
Sortie : les spans sont cachés et le span au numéro "id_no" est affiché. */
function hideAllDivsExceptOne(id_name, id_no){

   //Tableau des divs "id_name" contenus dans le document.
   var divs = getObjs(id_name, "div");
      
   // Cacher tous les divs correspondant au nom du id fourni (id_name), excepté celui relatif à la position fournie (id_no).
   for(var i=1; i<divs.length; i++)
   {	
		if( (i == id_no) && (divs[i].style.display == "none") ){
		    divs[i].style.display = "block"; 
		}
		else if( (i != id_no) && (divs[i].style.display == "block") ){
			divs[i].style.display="none"; 
		}
   }
}


/*
But : afficher tous les spans correspondant au nom du id fourni (id_name), excepté celui correspond au numéro de id (id_no).
Entrée : "id_name" et "id_pos" sont définis dans le document.
Sortie : les spans de type id_name sont affichés, excepté celui de numéro "id_no".
*/
function showAllSpansExceptOne(id_name, id_no){

   //Tableau des spans "id_name" contenus dans le document.
   var spans = getObjs(id_name, "span");
   
   // Cacher tous les spans correspondant au nom d'id fourni (id_name), excepté celui relatif au numéro d'id (id_no).
   for(var i=1;i<spans.length;i++)
   {	
		if( (i == id_no) && (spans[i].style.display == "") ){
   	        spans[i].style.display = "none"; 
		}
		else if( (i != id_no) && (spans[i].style.display == "none") ){
			spans[i].style.display = ""; 
		}
   }
}


/*
But : cacher tous les divs correspondant au id ("menu_on" ou "menu_off") fourni.
Entrée : le span à cacher doit exister.
Sortie : les divs correspondant au id fourni sont cachés.  */
function hideAllDivs(id_name){
   //Tableau des divs correspondant au "id_name" contenus dans le document.
   var divs = getObjs(id_name, "div");
   
   // Cacher tous les objets correspondant au id fourni.
   for(var i = 1; i < divs.length; i++)
   {
	   if(divs[i].style.display == "block"){
           divs[i].style.display="none"; 	       	       
	   }
   }
}

/*
But : cacher tous les spans correspondant au id fourni.
Entrée : le span a cacher doit exister.
Sortie : les Spans correspondant au id fourni sont cachés.  */
function hideAllSpans(id_name){
   //Tableau des spans "id" contenus dans le document.
   var spans = getObjs(id_name, "span");
   
   // Cacher tous les objets correspondant au id fourni.
   for(var i = 1; i < spans.length; i++)
   {
	   if(spans[i].style.display == ""){
           spans[i].style.display="none"; 	       	       
	   }
   }
}

/*
But : afficher tous les spans correspondant au id fourni.
Entrée : le span a afficher doit exister.
Sortie : les Spans correspondant au id fourni sont affichés.  */
function showAllSpans(id_name){
   //Tableau des Spans "id" contenus dans le document.
   var spans = getObjs(id_name, "span");

   // Afficher tous les Spans correspondant au id fourni.
   for(var i = 1; i < spans.length; i++)
   {
	   if(spans[i].style.display == "none"){
	       spans[i].style.display = ""; // afficher l'objet span avec un type d'affichage compact (style="display: compact").       
	   }
   }
}


/*
But : afficher un span appellé "menu_on" et un nommé "sub_menu" correspondant à un numéro de id.
Entrée : les spans "menu_on", "menu_off" et "sub_menu" sont définis dans le document.
Sortie : les éléments correspondant au span "menu_on" ou "menu_off" sont affichés. */
function switchMenu(id_no){
	// Afficher tous les éléments du "menu_off", excepté celui de numéro "id_no").
	showAllSpansExceptOne("menu_off", id_no);
	
	// Cacher tous les éléments du "menu_on" et de "sub_menu", excepté celui spécifié
	// au numéro "id_no".
	hideAllSpansExceptOne("menu_on", id_no);
	hideAllDivsExceptOne("sub_menu", id_no);
}


/*
But : afficher les éléments associés au span "menu_on" ou au span "menu_off".
Entrée : les spans "menu_on", "menu_off" et "sub_menu" sont définis dans le document.
Sortie : les éléments correspondant au span "menu_on" ou "menu_off" sont affichés. */
function switchMenuOnOff(id_name, id_no){
	if(id_name == "menu_on"){
		// Afficher tous les éléments du "menu_off", excepté celui de numéro "id_no").
		showAllSpansExceptOne("menu_off", id_no);
	
		// Cacher tous les éléments du "menu_on" et de "sub_menu", excepté celui spécifié
		// au numéro "id_no".
		hideAllSpansExceptOne("menu_on", id_no);
		hideAllDivsExceptOne("sub_menu", id_no);
	}	
	else if (id_name == "menu_off"){
	    // Afficher tous les éléments du "menu_off", cacher les éléments de
		// "sub_menu" et du "menu_on".
		showAllSpans("menu_off");
		hideAllSpans("menu_on");
		hideAllDivs("sub_menu");
	}
}


/* Nom : showDiv
   But : afficher un div selon son id.
   Entrée : le id doit exister dans le document.
   Sortie  : le div est affiché.                                       */  
function showDiv(id){
	var obj = document.getElementById(id);
	if (obj.style.display == "none"){ 
		obj.style.display = "block"; 
	}
}

/* Nom : hideDiv
   But : cacher un div selon son id.
   Entrée : le id doit exister dans le document.
   Sortie  : le div est caché.                                       */   
function hideDiv(id){
	var obj = document.getElementById(id);
	if (obj.style.display == "block"){
		obj.style.display = "none"; 
	}
}

/* Nom : img_fleche
   But : vérifie le id de l'image fleche.
          Si img_fleche_f = change l'image pour la flèche ouverte
		                    le id de l'image change pour img_fleche_o
		  Si img_fleche_o = change l'image pour la flèche fermé
		                    le id de l'image change pour img_fleche_f
   Entrés : le id de l'image
   Sortie : l'image et le id est changé                               */
function bt_fleche(id){
	
	if (id == "bt_fleche_f"){
		alert(id);
		document.getElementById("bt_fleche_f").src="/pls/portal/docs/page/librairie_fr/images/bt_fleche_liste_o.gif";
		var x = document.getElementById("bt_fleche_f")/*.id="bt_fleche_o"*/;
		x.id = "bt_fleche_o";
		alert(x.id);
		return x.id;
	}
	else{
		alert(id)
		document.getElementById("bt_fleche_o").src="/pls/portal/docs/page/librairie_fr/images/bt_fleche_liste_f.gif";
		document.getElementById("bt_fleche_o").id="bt_fleche_f";
		return id;
	}
}

/* Dialogue CONFIRM */
function confirmer(url,msg){
	var alerte;
	switch (msg) {
		case 'fr' :
			alerte = "Cette page n'est disponible qu'en anglais";
			break;
		case 'en' :
			alerte = "This page is only available in french";
			break;
		default :
			break;
	}
	var redir = confirm(alerte);
	if (redir==true) {
		window.location=url;
	}
}

// Fonctions pour les flash


function thisMovie(movieName) {
  // IE and Netscape refer to the movie object differently.
  // This function returns the appropriate syntax depending on the browser.
  return document.getElementById(movieName);
  /*if (navigator.appName.indexOf ("Microsoft") !=-1) {
	return window[movieName]
  }	else {
    return document[movieName]
  }*/
}

// Checks if movie is completely loaded.
// Returns true if yes, false if no.
function movieIsLoaded (theMovie) {
  if (typeof(theMovie) != "undefined") {
    return theMovie.PercentLoaded() == 100;
  } else {
    return false;
  }
}

function go(theFrame, movieName) {
  if (movieIsLoaded(thisMovie(movieName))) {
    thisMovie(movieName).GotoFrame(theFrame);
	thisMovie(movieName).Play();
  }
}



