/**
    Version : 29 juin 2009
*/
// ****** Listes de recherche par catégories ************************************************** //

var ESPACES = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";


// But : Créer dynamiquement les listes des catégories de formations, ainsi éviter les problèmes de rafraîchissement lorsque 
// l'internaute utilise la fonction Précédent du navigateur.
// Date : 9 mai 2008
function createSelectCategories()
{
  document.write("<form name=\"formCategories\">");
  
  document.write("<div id=\"menu1\">");
  document.write("<select name=\"menu1\" onChange=\"createSelectSubCategories(value,'0')\">");
  //document.write("<option value=\"0\" selected>-----------------------------------------</option>");
  document.write("<option value=\"0\" selected>Choose a category >>" + ESPACES + "</option>");
  document.write("<option value=\"1\">Cd-rom Courses</option>");
  document.write("<option value=\"2\">Web Courses</option>");
  //document.write("<option value=\"3\">Aide-mémoire (Paper)</option>");
  document.write("<option value=\"4\">Authoring tool</option>");
  document.write("</select></div>");
  
  document.write("<div id=\"menu2\">");
  document.write("<select name=\"menu2\" style=\"visibility:visible;\">");
  document.write("<option value=\"0\" selected>-</option>");
  document.write("</select></div>");
  
  document.write("<div id=\"menu3\">");
  document.write("<select name=\"menu3\" style=\"visibility:visible;\">");
  document.write("<option value=\"0\" selected>-</option>");
  document.write("</select></div>");
  
  document.write("</form>");
  
}

// But : Réinitialiser un menu en le vidant
// Param : String identifiant le menu
// Date : 18 avril 2008
function reinitSelectSubCategories(menuID)
{
	var strTemp = "";
	
	strTemp = "<div id=\""+menuID+"\">";
	strTemp = strTemp + "<select name=\""+menuID+"\" style=\"visibility:visible;\">";
	strTemp = strTemp + "<option value=\"0\" selected>-</option>";
	strTemp = strTemp + "</select></div>";

	modifierContenuListes (menuID,strTemp);

}

// But : Créer l'élément de sélection de la sous-catégorie pour la recherche de section de cours
// Param : idCat : Number identifiant la catégorie du catalogue
// Param : idSubCat : Number identifiant la sous-catégorie correspondante à la catégorie sélectionnée
// Date : 23 decembre 2008
function createSelectSubCategories(idCat,idSubCat)
{
	var numIdCat = Number(idCat); // Conversion des strings en valeurs entières
	var numIdSubCat = Number(idSubCat);
	var nomCategories = new Array();
	var strTemp = "";

	switch (numIdCat){
	case 1 : // Bureautique (cdrom)
		//nomCategories[0] = "-----------------------------------------";
		nomCategories[0] = "Choose a category >>" + ESPACES;
		nomCategories[1] = "Office Automation (90)";
		//nomCategories[2] = "Educational software (4)";
		
		strTemp = getSelectHTML("menu2",nomCategories,numIdCat,numIdSubCat,1);
		modifierContenuListes ("menu2",strTemp);
		
		if (numIdSubCat == 0) reinitSelectSubCategories("menu3");
		if (numIdSubCat > 0) createSelectLinks(numIdCat,numIdSubCat);

		break;
	case 2 : // Bureautique WEB
		//nomCategories[0] = "-----------------------------------------";
		nomCategories[0] = "Choose a category >>" + ESPACES;
		nomCategories[1] = "Office Automation (392)";
		nomCategories[2] = "Practical Evaluations (358)";
		nomCategories[3] = "Theory Evaluations (358)";
		nomCategories[4] = "Accounting (2)";
		nomCategories[5] = "Computer science (213)";
		nomCategories[6] = "Languages (63)";
		nomCategories[7] = "Educational software (8)";
        nomCategories[8] = "Office Automation Manual (81)";
		nomCategories[9] = "Management soft. pack. (2)";

		strTemp = getSelectHTML("menu2",nomCategories,numIdCat,numIdSubCat,1);
		modifierContenuListes ("menu2",strTemp);
		
		if (numIdSubCat == 0) reinitSelectSubCategories("menu3");
		if (numIdSubCat!=0) createSelectLinks(numIdCat,numIdSubCat);

		break;
	case 3 : // Aide-mémoire
		createSelectLinks(numIdCat,'1');
		break;	
	case 4 : // Logiciels d'édition
		window.location.href ="http://www.tacticsoftware.com/english/tactic_editor_index.html";
		break;	
	default:
		reinitSelectSubCategories("menu2");
		reinitSelectSubCategories("menu3");
		break;
	}
}

// But : Obtenir le code HTML des contrôles Select
// Param : menuId : String identifiant le menu
// Param : nomCategories : Array qui contient les noms de chacunes des options
// Param : numIdCat : Number identifiant la catégorie sélectionnée
// Param : numIdSubCat : Number identifiant la sous catégorie sélectionnée
// Param : type : Number identifiant le type l'appel de la fonction javascript adéquate (1 : createSelectSubCategories, 2 : selectLinks)
// Return : Le code HTML sous format String
// Date : 17 avril 2008
function getSelectHTML(menuId,nomCategories, numIdCat, numIdSubCat, type)
{
	var strTemp = ""; // Chaine du code HTML
	var strSelected = ""; // code HTML indiquant que l'option est sélectionnée ou non
	var j = 0; // L'indice qui attribut la valeur à l'option. Ne peut pas être i à cause des lignes "vides".
	
	//alert("getSelectHTML("+menuId+", "+nomCategories+", "+numIdCat+", "+numIdSubCat+", "+type+")");
	
	if (type == 1) { // Obtenir l'appel de fonction adéquat lorsque une option de la liste change
		strTemp = "<select name=\""+menuId+"\" onChange=\"createSelectSubCategories('"+numIdCat+"',value)\">";
	}else{
		strTemp = "<select name=\""+menuId+"\" onChange=\"selectLink('"+numIdCat+"','"+numIdSubCat+"',value)\">";
	}
	
	for(var i=0; i < nomCategories.length; i++) {
		
		if (type == 1) strSelected = (numIdSubCat==i)?" selected":""; // Si c'est l'option qui a été sélectionnée...
		
		if(nomCategories[i] == "-----------------------------------------"){ // Si la ligne "vide" alors sa valeur est toujours 0.
			if(i == 0){
				j++; // Si la première ligne alors on incrémente la valeur de j. 
				if (type == 2) strSelected = " selected"; // Si les options sont des liens, alors la première option est toujours celle sélectionnée.
			}
			strTemp = strTemp + "<option value=\"0\""+strSelected+">"+nomCategories[i]+"</option>";
			
		}else{
			strTemp = strTemp + "<option value=\""+j+"\""+strSelected+">"+nomCategories[i]+"</option>";
			j++;
		}
		strSelected = "";
	}
	strTemp = strTemp + "</select>";
	
	//alert ("HTML : "+strTemp);
	
	return strTemp;
}


// But : Créer l'élément de sélection de la liste de liens pour la recherche de section de cours
// Param : idCat : Number identifiant la catégorie du catalogue
// Param : idSubCat : Number identifiant la sous-catégorie correspondante à la catégorie sélectionnée
// Date : 23 decembre 2008
function createSelectLinks(idCat,idSubCat)
{
	var numIdCat = Number(idCat); // Conversion des strings en valeurs entières
	var numIdSubCat = Number(idSubCat);
	var nomCategories = new Array(); // Tableau du contenu de la liste de liens à créer
	
	//alert("createSelectLinks : "+numIdCat+", "+numIdSubCat);
	
	if (numIdCat == 1 ){ // CDROM >>
	
		if(numIdSubCat == 1){ // CDROM >> Bureautique
	
			//nomCategories[0] = "-----------------------------------------";
			nomCategories[0] = "Choose a category >>" + ESPACES;
			nomCategories[1] = "Informatique Pratique";
            nomCategories[2] = "Internet Pratique";
			nomCategories[3] = "-----------------------------------------";
			nomCategories[4] = "Ms Office 2007";
			nomCategories[5] = "Ms Office 2003";
			nomCategories[6] = "Ms Office XP";
			nomCategories[7] = "Ms Office 2000";
			nomCategories[8] = "Ms Office 97";
			nomCategories[9] = "Ms Office 95";
			nomCategories[10] = "Ms Windows";
			nomCategories[11] = "Ms Internet Explorer";
			nomCategories[12] = "-----------------------------------------";
			nomCategories[13] = "OpenOffice.org version 2.0";
			nomCategories[14] = "-----------------------------------------";
			nomCategories[15] = "Lotus";
			nomCategories[16] = "-----------------------------------------";
			nomCategories[17] = "Corel";
			nomCategories[18] = "-----------------------------------------";
			nomCategories[19] = "Netscape";
			nomCategories[20] = "-----------------------------------------";
			nomCategories[21] = "Novell";
			
			strTemp = getSelectHTML("menu3",nomCategories,numIdCat,numIdSubCat,2);
			
			modifierContenuListes ("menu3",strTemp);
		
		} else if (numIdSubCat == 2){ // CDROM >> logiciel pédagogique 
			loadPage("catalogue_pedagogie_cdrom.html","",0);
		} else {
			reinitSelectSubCategories("menu3");
		}
		
	}else if (numIdCat == 2){ // Cours WEB
	
		switch (numIdSubCat){
		case 1 : // Bureautique WEB
			//nomCategories[0] = "-----------------------------------------";
			nomCategories[0] = "Choose a category >>" + ESPACES;
			nomCategories[1] = "Informatique Pratique";
            nomCategories[2] = "Internet Pratique";
			nomCategories[3] = "-----------------------------------------";
			nomCategories[4] = "Ms Office 2007";
			nomCategories[5] = "Ms Office 2003";
			nomCategories[6] = "Ms Office XP";
			nomCategories[7] = "Ms Office 2000";
			nomCategories[8] = "Ms Office 97";
			nomCategories[9] = "Ms Office 95";
			nomCategories[10] = "Ms Windows";
			nomCategories[11] = "Ms Internet Explorer";
			nomCategories[12] = "Ms Project";
			nomCategories[13] = "-----------------------------------------";
			nomCategories[14] = "OpenOffice.org version 2.0";
			nomCategories[15] = "-----------------------------------------";
			nomCategories[16] = "Lotus";
			nomCategories[17] = "-----------------------------------------";
			nomCategories[18] = "Corel";
			nomCategories[19] = "-----------------------------------------";
			nomCategories[20] = "Novell";
			
			strTemp = getSelectHTML("menu3",nomCategories,numIdCat,numIdSubCat,2);
			
			modifierContenuListes ("menu3",strTemp);
			break;
			
        case 2: case 3 : // Évaluation pratique, Évaluation théorique
			//nomCategories[0] = "-----------------------------------------";
			nomCategories[0] = "Choose a category >>" + ESPACES;
			nomCategories[1] = "Informatique Pratique";
            nomCategories[2] = "Internet Pratique";
			nomCategories[3] = "-----------------------------------------";
			nomCategories[4] = "Ms Office 2007";
			nomCategories[5] = "Ms Office 2003";
			nomCategories[6] = "Ms Office XP";
			nomCategories[7] = "Ms Office 2000";
			nomCategories[8] = "Ms Office 97";
			nomCategories[9] = "Ms Office 95";
			nomCategories[10] = "Ms Windows";
			nomCategories[11] = "Ms Internet Explorer";
			nomCategories[12] = "-----------------------------------------";
			nomCategories[13] = "OpenOffice.org version 2.0";
			nomCategories[14] = "-----------------------------------------";
			nomCategories[15] = "Lotus";
			nomCategories[16] = "-----------------------------------------";
			nomCategories[17] = "Corel";
			nomCategories[18] = "-----------------------------------------";
			nomCategories[19] = "Novell";
			
			strTemp = getSelectHTML("menu3",nomCategories,numIdCat,numIdSubCat,2);
			
			modifierContenuListes ("menu3",strTemp);
			break;
		
		case 4 : // Lien vers la comptabilité
			loadPage("catalogue_accounting.html","",1);
			break;
            
		case 5 : // Section Informatique
			//nomCategories[0] = "-----------------------------------------";
			nomCategories[0] = "Choose a category >>" + ESPACES;
			nomCategories[1] = "Certification";
			nomCategories[2] = "-----------------------------------------";
			nomCategories[3] = "Graphics and Publishing Tools";
			nomCategories[4] = "-----------------------------------------";
			nomCategories[5] = "Information Technology";
			
			strTemp = getSelectHTML("menu3",nomCategories,numIdCat,numIdSubCat,2);
			
			modifierContenuListes ("menu3",strTemp);
			break;
            
		case 6 : // Lien vers Langues 
			loadPage("catalogue_languages.html","",1);
			break;
            
		case 7 : // Lien vers Logiciels pédagogiques  
			loadPage("catalogue_educational_software.html","",1);
			break;
            
        case 8 : // Manuals
            nomCategories[0] = "Choose a category >>" + ESPACES;
            nomCategories[1] = "Informatique Pratique";
            nomCategories[2] = "Internet Pratique";
			nomCategories[3] = "-----------------------------------------";            
			nomCategories[4] = "Ms Office 2007";
            nomCategories[5] = "Ms Office 2003";
			nomCategories[6] = "Ms Office XP";
			nomCategories[7] = "Ms Windows";
			nomCategories[8] = "-----------------------------------------";            
			nomCategories[9] = "Lotus";
            
            strTemp = getSelectHTML("menu3",nomCategories,numIdCat,numIdSubCat,2);
			
			modifierContenuListes ("menu3",strTemp);
            break;
            
		case 9 : // Lien vers Progiciels de gestion 
			loadPage("catalogue_management_software.html","",1);
			break;
            
		default:
			reinitSelectSubCategories("menu3");
			break;
		}
	
	}else if (numIdCat == 3 && numIdSubCat == 1){ // Aide-mémoire

		//nomCategories[0] = "-----------------------------------------";
		nomCategories[0] = "Choose a category >>" + ESPACES;
		nomCategories[1] = "Access";
		nomCategories[2] = "Adode Acrobat Reader";
		nomCategories[3] = "Communicator";
		nomCategories[4] = "Domino Web Access";
		nomCategories[5] = "Excel";
		nomCategories[6] = "FrontPage";
		nomCategories[7] = "GroupWise";
		nomCategories[8] = "HTM Guide";
		nomCategories[9] = "InfoPath";
		//nomCategories[10] = "Information Rights Management"; // Trop de caractères
		nomCategories[10] = "Information Rights Manag."; 
		nomCategories[11] = "INotes Web Access";
		nomCategories[12] = "Internet Explorer";
		nomCategories[13] = "IPag Packet";
		nomCategories[14] = "Lotus";
		nomCategories[15] = "Mailmeter for Lotus Notes";
		nomCategories[16] = "MSN Messenger & Netmeeting"; // Trop de caractères
		nomCategories[16] = "MSN & Netmeeting";
		nomCategories[17] = "Navigator";
		nomCategories[18] = "Outlook";
		nomCategories[19] = "Palm Guide";
		nomCategories[20] = "PowerPoint";
		nomCategories[21] = "Project";
		nomCategories[22] = "Publisher";
		nomCategories[23] = "Rim Blackberry";
		nomCategories[24] = "SharePoint";
		nomCategories[25] = "Visio";
		nomCategories[26] = "Windows";
		nomCategories[27] = "Word";
		nomCategories[28] = "WordPerfect";
		
		strTemp = getSelectHTML("menu2",nomCategories,numIdCat,numIdSubCat,2);
		
		modifierContenuListes ("menu2",strTemp);
		
		reinitSelectSubCategories("menu3");
		
	} else {
		reinitSelectSubCategories("menu3");
	}
}

// But : Remplacer dans l'objet DIV le code html en paramètre
// Param : divID : String du nom DIV pointé
// Param : codeHTML : String du code HTML
// Date : 16 avril 2008
function modifierContenuListes(divID,codeHTML) 
{
	if (document.getElementById)
	{
		document.getElementById(divID).innerHTML = codeHTML;
	}
}

// But : Afficher la page de l'élément sélection de la liste de liens
// Param : idCat : Number identifiant la catégorie du catalogue
// Param : idSubCat : Number identifiant la sous-catégorie correspondante à la catégorie sélectionnée
// Param : idLink : Number identifiant le lien
// Date : 23 decembre 2008
function selectLink(idCat,idSubCat,idLink)
{
	var numIdCat = Number(idCat); // Conversion des strings en valeurs entières
	var numIdSubCat = Number(idSubCat);
	var numIdLink = Number(idLink);
	
	var ancre = ""; // Ancre de la page
	var page = ""; // Page du catalogue
	
	//alert("selectLink("+numIdCat+", "+numIdSubCat+", "+numIdLink+");");
	
	if(numIdCat==1 && numIdSubCat==1) { // Bureautique  (cdrom)
		page = "catalogue_cdrom_courses.html";
				
		switch(numIdLink){
		case 1 : //Initiation à l’informatique
			ancre = "#infoprat";
			break;
        case 2 : //Internet pratique
			ancre = "#InterPrat";
			break;
		case 3 : //Ms Office 2007
			ancre = "#office2007";
			break;
		case 4 : //Ms Office 2003
			ancre = "#office2003";
			break;
		case 5 : //Ms Office XP
			ancre = "#officexp";
			break;
		case 6 : //Ms Office 2000
			ancre = "#office2000";
			break;
		case 7 : //Ms Office 97
			ancre = "#office97";
			break;
		case 8 : //Ms Office 95
			ancre = "#office95";
			break;
		case 9 : //Ms Windows
			ancre = "#windows";
			break;
		case 10 : //Ms Internet Explorer
			ancre = "#iexplorer";
			break;
		case 11 : //OpenOffice.org version 2.0
			ancre = "#openoffice";
			break;
		case 12 : //Lotus
			ancre = "#lotus";
			break;
		case 13 : //Corel
			ancre = "#corel";
			break;
		case 14 : //Netscape
			ancre = "#netscape";
			break;
		case 15 : //Novell
			ancre = "#novell";
			break;
		}
		
	} else if (numIdCat==2 && (numIdSubCat==1)){  // Bureautique (web)
	
		page = "catalogue_office_automation.html";
				
		switch(numIdLink){
		case 1 : //Initiation à l’informatique
			ancre = "#infoprat";
			break;
        case 2 : //Internet Pratique
			ancre = "#InterPrat";
			break;
		case 3 : //Ms Office 2007
			ancre = "#office2007";
			break;
		case 4 : //Ms Office 2003
			ancre = "#office2003";
			break;
		case 5 : //Ms Office XP
			ancre = "#officexp";
			break;
		case 6 : //Ms Office 2000
			ancre = "#office2000";
			break;
		case 7 : //Ms Office 97
			ancre = "#office97";
			break;
		case 8 : //Ms Office 95
			ancre = "#office95";
			break;
		case 9 : //Ms Windows
			ancre = "#windows";
			break;
		case 10 : //Ms Internet Explorer
			ancre = "#iexplorer";
			break;
		case 11 : //Ms Project
			ancre = "#project";
			break;			
		case 12 : //OpenOffice.org version 2.0
			ancre = "#openoffice";
			break;
		case 13 : //Lotus
			ancre = "#lotus";
			break;
		case 14 : //Corel
			ancre = "#corel";
			break;
		case 15 : //Novell
			ancre = "#novell";
			break;
		}	

	} else if (numIdCat==2 && (numIdSubCat==2 || numIdSubCat==3)){// Évaluations pratiques & Théoriques
		if (numIdSubCat==2) {
			page = "catalogue_pratical_evaluation.html";
		} else {
			page = "catalogue_theory_evaluation.html";
		}
				
		switch(numIdLink){
		case 1 : //Initiation à l’informatique
			ancre = "#infoprat";
			break;
        case 2 : //Initiation à l’informatique
			ancre = "#InterPrat";
			break;
		case 3 : //Ms Office 2007
			ancre = "#office2007";
			break;
		case 4 : //Ms Office 2003
			ancre = "#office2003";
			break;
		case 5 : //Ms Office XP
			ancre = "#officexp";
			break;
		case 6 : //Ms Office 2000
			ancre = "#office2000";
			break;
		case 7 : //Ms Office 97
			ancre = "#office97";
			break;
		case 8 : //Ms Office 95
			ancre = "#office95";
			break;
		case 9 : //Ms Windows
			ancre = "#windows";
			break;
		case 10 : //Ms Internet Explorer
			ancre = "#iexplorer";
			break;
		case 11 : //OpenOffice.org version 2.0
			ancre = "#openoffice";
			break;
		case 12 : //Lotus
			ancre = "#lotus";
			break;
		case 13 : //Corel
			ancre = "#corel";
			break;
		case 14 : //Novell
			ancre = "#novell";
			break;
		}	

	} else if (numIdCat==2 && numIdSubCat==5){ // Informatique
	
		page = "catalogue_computer_science.html";
				
		switch(numIdLink){
		case 1 : //Certification
			ancre = "#certificat";
			break;
		case 2 : //Outils d’édition et graphiques
			ancre = "#graphic";
			break;
		case 3 : //Technologie informatique
			ancre = "#techno";
			break;
		}

    } else if (numIdCat==2 && (numIdSubCat==8)){  // Manuals (web)       
        page = "catalogue_manual.html";
				
		switch(numIdLink){
        case 1 : 
			ancre = "#infoprat";
			break;
		case 2 : 
			ancre = "#InterPrat";
			break;
        case 3 : 
			ancre = "#office2007";
			break;
		case 4 : 
			ancre = "#office2003";
			break;
		case 5 : 
			ancre = "#office2002";
			break;
		case 6 : 
			ancre = "#windows";
			break;
		case 7 : 
			ancre = "#lotus";
			break;
		case 8 : 
			ancre = "#lotus";
			break;
		case 9 : 
			ancre = "#lotus";
			break;
		}

	} else if (numIdCat==3){// Aide-mémoire
	
		page = "catalogue_aide_memoire.html";
			
		switch(numIdLink){
		case 1 : //Access
			ancre = "#access";
			break;
		case 2 : //Adode Acrobat Reader
			ancre = "#acrobat";
			break;
		case 3 : //Communicator
			ancre = "#communicator";
			break;
		case 4 : //Domino Web Access
			ancre = "#domino";
			break;
		case 5 : //Excel
			ancre = "#excel";
			break;
		case 6 : //FrontPage
			ancre = "#frontpage";
			break;
		case 7 : //GroupWise
			ancre = "#groupwise";
			break;
		case 8 : //HTM Guide
			ancre = "#htmguide";
			break;
		case 9 : //InfoPath
			ancre = "#infopath";
			break;
		case 10 : //Information Rights Management
			ancre = "#rights";
			break;			
		case 11 : //INotes Web Access
			ancre = "#inotes";
			break;
		case 12 : //Internet Explorer
			ancre = "#iexplorer";
			break;
		case 13 : //IPag Packet
			ancre = "#ipag";
			break;
		case 14 : //Lotus
			ancre = "#lotus";
			break;
		case 15 : //Mailmeter for Lotus Notes
			ancre = "#mailmeter";
			break;			
		case 16 : //MSN Messenger & Netmeeting
			ancre = "#netmeeting";
			break;			
		case 17 : //Navigator
			ancre = "#navigator";
			break;			
		case 18 : //Outlook
			ancre = "#outlook";
			break;
		case 19 : //Palm Guide
			ancre = "#palm";
			break;
		case 20 : //PowerPoint
			ancre = "#powerpoint";
			break;
		case 21 : //Project
			ancre = "#project";
			break;
		case 22 : //Publisher
			ancre = "#publisher";
			break;	
		case 23 : //Rim Blackberry
			ancre = "#blackberry";
			break;	
		case 24 : //SharePoint
			ancre = "#sharepoint";
			break;	
		case 25 : //Visio
			ancre = "#visio";
			break;	
		case 26 : //Windows
			ancre = "#windows";
			break;	
		case 27 : //Word
			ancre = "#word";
			break;	
		case 28 : //WordPerfect
			ancre = "#wordperfect";
			break;				
		}		
		
	}
	
	loadPage(page,ancre,1);
}

// But : Charger la page demandée en effectuant les opérations préalables
// Param : URL : String de la page
// Param : ancre : String de l'ancre, s'il y en a un présent
// Param : checkDevise : Number témoin si la vérification de la devise est nécessaire
// Date : 17 avril 2008
function loadPage(URL,ancre,isDevise)
{
	//alert("loadPage("+URL+", "+ancre+", "+isDevise+");");
	if (isDevise == 1){
		URL = checkDevise(URL); // Vérifier la devise
	}
	
	if (ancre != ""){
		URL = URL + ancre; // Si ancre non vide, alors l'ajouter à l'URL
	}
	
	window.location.href = URL; // Afficher la page correspondante

}

// But : Vérifier la devise actuelle afin de modifier l'accès à la page
// Param : URL : String de la page d'accès au catalogue
// Return : URL : String de la page d'accès au catalogue modifiée selon la devise 
// *** Dépend de l'accessibilité des fichiers cookies.js et devise.js.
// Date : 18 avril 2008
function checkDevise(URL)
{
	var deviseID;
	var numDeviseID = 0;
	
	deviseID = LireCookie("epcdevise");
	numDeviseID = Number(deviseID);
	
	switch(numDeviseID){
		case 1: // canadien (euro -> canadien)
			if (URL.lastIndexOf("_euro.html")>0){
				URL = URL.substring(0,URL.lastIndexOf("_euro.html"));
				URL = URL  + ".html";
			}
			break;
		
		case 2: // euro (canadien -> euro)
			if (URL.lastIndexOf(".html")>0){
				URL = URL.substring(0,URL.lastIndexOf(".html"));
				URL = URL + "_euro.html";
			}
			break;
	}
	
	return URL;
}


