// affichage message

function showMessage(strMessage) {
		document.all.message.innerHTML = strMessage;
		return true
	}
	function hideMessage() {
		document.all.message.innerHTML = '';
		return true
	}


	// Ouverture d'une url en 'top'
	function OpenUrl(uri) {
		if (uri.substr(0,7)=='http://'){
			top.location.href = uri}
			else {
		var strURL = "";
		if ( GetSubRub() != "home" )
			strURL = "../"
		else
			strURL = ""
		strURL += uri
		
		top.location.href = strURL
		}
	}

	// Retourne la sous-rubrique cad le nom du FICHER sans l'extension
	function GetSubRub () {
		strUrl = parent.right.location.href
		tblArray = strUrl.split('/')
		strFilename = tblArray[tblArray.length-1]
		subRub = strFilename.replace(".htm","")
		
		return subRub
	}

	// Retourne le nom du sous-rep pour les pages innovations
	function GetRub () {
		strUrl = parent.location.href
		tblArray = strUrl.split('/')
		strFilename = tblArray[tblArray.length-1]
		subRub = strFilename.replace(".htm","")
		subRub = subRub.replace("index_","")
		
		return subRub
	}
	
	// Action de la liste de selection des produits
	function go2url(uri) {
	
		if ( uri != '' )
			top.location.href = '../offre/' + uri	
	}
	
	function go3url(uri) {
	
		if ( uri != '' )
			top.location.href = uri	
	}
	
	function goPlan(uri) {
	if (uri != '') {
		if ( uri.indexOf('../') < 0 )
			{parent.location.href = '../' + uri	}
		else {parent.location.href = uri}
	}}
	
		// Ouverture d'une popup pour les animations flash
	// (les deux fonctions)
	function PopUpSize(PageURL, strName, iwidth, iheight) {
		var strProperties;
		
		strProperties = 'width=' + iwidth + ',height=' + iheight;
		strProperties = strProperties + ',left=100,top=100,directories=0,hotkeys=1,location=0,menubar=0';
		strProperties = strProperties + ',resizable=0,scrollbars=auto,status=0,titlebar=0,toolbar=0';
		return window.open(PageURL, strName, strProperties);
	}
	function OpenFlash(uri) {
		var pPage = PopUpSize(uri,'flash', 630, 440) 
	}
	function PopUpSizeResizable(PageURL, strName, iwidth, iheight) {
		var strProperties;
		
		strProperties = 'width=' + iwidth + ',height=' + iheight;
		strProperties = strProperties + ',left=100,top=100,directories=0,hotkeys=1,location=0,menubar=0';
		strProperties = strProperties + ',scrollbars=yes,status=0,titlebar=0,toolbar=0';
		return window.open(PageURL, strName, strProperties);
	}
	function OpenPopUp(uri,w,h) {
		var pPage = PopUpSizeResizable(uri,'', w, h) 
	}
	
	// Affichage d'une chaine de caracteres
	function echo(strChaine) {
		document.write(strChaine)
	}
	
	
	// GESTION DU MENU DE GAUCHE

	function ClicRub(nu_rub) {
		with(parent) {
	
			if ((menu[nu_rub].page!="")&&(menu[nu_rub].aff=="N")) {
	
				frames["right"].location=menu[nu_rub].page
			}
	
			// fermeture de toutes les rubriques
			for (var i=0;i < menu.nb_rub;i++) {
				if ( i == 7 || i == 8 || i == 9 || i == 10 ) menu[i].aff="N"
			}
			
			if (menu[nu_rub].aff=="O") {
				menu[nu_rub].aff="N"
			}
			else {
				menu[nu_rub].aff="O";
			}		
		}
		if (parent.menu[nu_rub].nb_lien>0) {window.location=document.location;}
	}
	function ClicRubBas(nu_rub) {
		with(parent) {
	
			if ((menu[nu_rub].page!="")&&(menu[nu_rub].aff=="N")) {
	
				frames["right"].location=menu[nu_rub].page
			}
	
			// fermeture de toutes les rubriques
			for (var i=0;i < menu.nb_rub-4;i++) {
				if ( i != nu_rub ) menu[i].aff="N"
			}
			
			if (menu[nu_rub].aff=="O") {
				menu[nu_rub].aff="N"
			}
			else {
				menu[nu_rub].aff="O";
			}		
		}
		if (parent.menu[nu_rub].nb_lien>0) {window.location=document.location;}
	}
	function AffImg(img) {
		document.write("<IMG SRC='"+img+"' height='"+parent.menu.hauteur+"' BORDER=0 ALT='' ALIGN='top' vspace=0>");
	}
	function Aff(men) {
		var espace=(men.nb_rub)-4
		document.write("<table cellpadding=0 cellspacing=0 border=0 width=150>");
		document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
		document.write("<tr><td colspan=2 bgcolor='#ffffff'><img src='../pictures/space.gif' width=150 height=2></td></tr>");
		for(var i=0;i<1;i++) {
			
			document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
			if (men[i].aff=="N") {
				document.write('<tr><td width=20>')
				AffImg(men.imgF);
				document.write("</td><td width=140>")
				document.write("<A class='clsMain' HREF='javascript:ClicRub("+i+")'>");
				document.write(men[i].txt+"</A></td></td>");
			} else {
				document.write("<tr><td width=22>")
				AffImg(men.imgO);
				document.write("</td><td>")
				document.write("<A class='clsMain' HREF='javascript:ClicRub("+i+")'>");
				document.write(men[i].txt+"</A></td></tr>");
				document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
				for(var j=0;j<men[i].nb_lien;j++) {
					document.write('<tr><td width=20>')
					if (j==men[i].nb_lien-1) {
						AffImg(men.imgOptFin);
					} 
					else  {
						AffImg(men.imgOpt);
					}
					document.write('</td><td>')
					target=men.target;
					if (men[i][j].target!="") {target=men[i][j].target;}
					document.write("<A class='clsSub' target='"+target+"' HREF='"+men[i][j].page+"'>");
					document.write(men[i][j].txt+"</A></td></tr>");		
				}
			}
		}
		document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
		document.write("<tr><td width=20><img src='../pictures/rub_fleche.gif'></td><td width=140><A class='clsMain' HREF='../prescription/specification.htm' target='right'>" + lblRub2 + "</a></td></tr>");
		document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
		document.write("<tr><td width=20><img src='../pictures/rub_fleche.gif'></td><td width=140><A class='clsMain' HREF='../selection/aide.htm' target='right'>" + lblRub3 + "</a></td></tr>");
		for(var i=3;i<6;i++) {
			
			document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
			if (men[i].aff=="N") {
				document.write('<tr><td width=20>')
				AffImg(men.imgF);
				document.write("</td><td width=140>")
				document.write("<A class='clsMain' HREF='javascript:ClicRub("+i+")'>");
				document.write(men[i].txt+"</A></td></td>");
			} else {
				document.write("<tr><td width=22>")
				AffImg(men.imgO);
				document.write("</td><td>")
				document.write("<A class='clsMain' HREF='javascript:ClicRub("+i+")'>");
				document.write(men[i].txt+"</A></td></tr>");
				document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
				for(var j=0;j<men[i].nb_lien;j++) {
					document.write('<tr><td width=20>')
					if (j==men[i].nb_lien-1) {
						AffImg(men.imgOptFin);
					} 
					else  {
						AffImg(men.imgOpt);
					}
					document.write('</td><td>')
					target=men.target;
					if (men[i][j].target!="") {target=men[i][j].target;}
					document.write("<A class='clsSub' target='"+target+"' HREF='"+men[i][j].page+"'>");
					document.write(men[i][j].txt+"</A></td></tr>");		
				}
			}
		}
		document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
		document.write("<tr><td width=20><img src='../pictures/rub_fleche.gif'></td><td width=140><A class='clsMain' HREF='../modernization/evolutif.htm' target='right'>" + lblRub7 + "</a></td></tr>");
		document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
		document.write("<tr><td colspan=2 bgcolor='#ffffff'><img src='../pictures/space.gif' width=150 height=2></td></tr>");
		document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
		document.write("</table>")
		
		document.write("<img src='../pictures/space.gif' width=150 height=4><br>&nbsp;<img src='../pictures/space.gif' width=150 height=4><br>");//espace entre les rubriques
		
		document.write("<table cellpadding=0 cellspacing=0 border=0 width=150>")
		document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
		document.write("<tr><td colspan=2 bgcolor='#ffffff'><img src='../pictures/space.gif' width=150 height=2></td></tr>");
		document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
		document.write("<tr><td width=20><img src='../pictures/rub_fleche.gif'></td><td width=140><A class='clsMain' HREF='../training/meo.htm' target='right'>" + lblRub8 + "</a></td></tr>");
		document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
		document.write("<tr><td width=20><img src='../pictures/rub_fleche.gif'></td><td width=140><A class='clsMain' HREF='../download/download.htm' target='right'>" + lblRub9 + "</a></td></tr>");
		document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
		document.write("<tr><td width=20><img src='../pictures/rub_fleche.gif'></td><td width=140><A class='clsMain' HREF='../contact/contact.htm' target='right'>" + lblRub11 + "</a></td></tr>");
		document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
		for(var i=9;i<men.nb_rub ;i++) {// affichage dernières rubriques
			
			if (men[i].aff=="N") {
				document.write('<tr><td width=20>')
				AffImg(men.imgF);
				document.write("</td><td width=140>")
				document.write("<A class='clsMain' HREF='javascript:ClicRubBas("+i+")'>");
				document.write(men[i].txt+"</A></td></td>");
			} else {
				document.write("<tr><td width=22>")
				AffImg(men.imgO);
				document.write("</td><td>")
				document.write("<A class='clsMain' HREF='javascript:ClicRubBas("+i+")'>");
				document.write(men[i].txt+"</A></td></tr>");
				document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
				for(var j=0;j<men[i].nb_lien;j++) {
					document.write('<tr><td width=20>')
					if (j==men[i].nb_lien-1) {
						AffImg(men.imgOptFin);
					} 
					else  {
						AffImg(men.imgOpt);
					}
					document.write('</td><td>')
					target=men.target;
					if (men[i][j].target!="") {target=men[i][j].target;}
					document.write("<A class='clsSub' target='"+target+"' HREF='"+men[i][j].page+"'>");
					document.write(men[i][j].txt+"</A></td></tr>");		
				}
			}
			document.write("<tr><td colspan=2 bgcolor='#000000'><img src='../pictures/space.gif' width=150 height=1></td></tr>");
		}
		
		document.write("</table>")
	}
	
	function CreerMenu(police,ColFerme,ColOuvert,imgO,imgF,imgOption,imgOptionFin,hauteur,target) {
		this.nb_rub=0;
		this.police=police;
		this.colF=ColFerme;
		this.colO=ColOuvert;
		this.imgO=imgO;
		this.imgF=imgF;
		this.imgOpt=imgOption;
		this.imgOptFin=imgOptionFin;
		this.hauteur=hauteur;
		this.target=target;
		this.AddRub=AddRubrique;
		this.AddLien=AddLink;
	}
	
	function AddRubrique(txt,aff,page) {
		var rub = new Object;
		rub.txt=txt;
		rub.aff=aff;
		rub.page=page;
		rub.nb_lien=0;
		this[this.nb_rub]=rub;
		this.nb_rub++;
	}
	
	function AddLink(txt,page,target) {
		var no_rub = this.nb_rub-1;
		var no_lien= this[no_rub].nb_lien;
		var lien = new Object;
			lien.txt=txt;
			lien.page=page;
			lien.target="";
			if ((target!=null)&&(target!="")) {lien.target=target;}
		this[no_rub][no_lien]=lien;
		this[no_rub].nb_lien++;
	}