	VERSION = "10.2B";
	
	function Charge(id_onglet,lien){
		if(lien.indexOf('?')>0) {
			lien=lien+'&onglet='+id_onglet;
		} else {
			lien=lien+'?onglet='+id_onglet;
		}
		window.location.href=lien;
	}
	function Onglet(titre){
		this.titre=titre;
		this.nombre=0;
		this.pere='';
		this.active=new Array();
		this.liens=new Array();
		this.texte=new Array();
		this.id=new Array();
		this.add_link=Onglet_add_link;
		this.afficher=Onglet_afficher;
	}
	function Onglet_add_link(texte, lien, id, pere, active){
		this.liens[this.nombre]=lien;
		this.texte[this.nombre]=texte;
		this.id[this.nombre]=id;
		this.pere=pere;
		this.active[this.nombre]=active;
		this.nombre++;
	}
	function Popup(url, width, height, scroll) {
		larg=width;
		haut=height;
		postop=(screen.height-haut)/2;
		posleft=(screen.width-larg)/2;

		var parameters = ', toolbar=no, menubar=no, resizable=yes, location=no, directories=no, status=no,top='+postop+',left='+posleft;
		window.open(url, '', config='height=' + height + ', width=' + width + ',scrollbars=' + scroll +',' + parameters);
	}
	function Onglet_afficher(){
		var i;
		var classOnglet;
		document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr onMouseOver="javascript:ouvre(\''+this.pere+'\');" onMouseOut="javascript:ouvreTimeOut(openedTab);">');
		for (i=0;i<this.nombre;i++){
			if(this.active[i] == 1) {
				document.write("<td class=\"onglet2MilieuActif\">");
				document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td class="onglet2Fleche" nowrap="nowrap">');
				document.write("<a href=\"javascript:Charge("+this.id[i]+",'"+this.liens[i]+"')\" class=\"onglet2Actif\">"+this.texte[i]+"</a></td></tr></table></td>");
			} else {
				document.write("<td class=\"onglet2Milieu\" nowrap=\"nowrap\">");
				document.write("<a href=\"javascript:Charge("+this.id[i]+",'"+this.liens[i]+"')\" class=\"onglet2\">"+this.texte[i]+"</a></td>");
			}
		}
		document.write('<td class="onglet2Fin"></td>');
		document.write('</tr></table>');
	}
	function Onglet_box(){
		this.nombre=0;
		this.onglets=new Array();
		this.ajouter_onglet=Onglet_box_ajouter_onglet;
		this.afficher=Onglet_box_afficher;
	}
	function Onglet_box_ajouter_onglet(titre){
		this.onglets[this.nombre]=new Onglet(titre);
		this.nombre++;
	}
	function Onglet_box_afficher(){
		document.write('<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr>');		
		for (var i=0;i<this.nombre;i++){
			document.write('<td>');
			
			document.write('<div id="div'+i+'A" style="display:none;">');
			document.write('<table border="0" cellpadding="0" cellspacing="0"><tr onMouseOver="javascript:ouvre(\''+i+'\');" onMouseOut="javascript:ouvreTimeOut(openedTab);">');
			document.write('<td><img src="onglet1SelecGauche.png"/><br/></td>');
			document.write('<td><img src="onglet1SelecEspace.png"/><br/></td>');
			document.write('<td id="header'+i+'" class="onglet1SelecMilieu"><a href="javascript:ouvre(\''+i+'\');Charge('+this.onglets[i].id[0]+',\''+this.onglets[i].liens[0]+'\');" class=\"onglet1Actif\">'+this.onglets[i].titre+'</a><br/></td>');
			document.write('<td><img src="onglet1SelecEspace.png"/><br/></td>');
			document.write('<td><img src="onglet1SelecDroite.png"/><br/></td>');
			document.write('<td><img src="onglet1Separateur.png"/><br/></td>');
			document.write('</tr></table>');
			document.write('</div>');
			
			document.write('<div id="div'+i+'B" style="display:none;">');
			document.write('<table border="0" cellpadding="0" cellspacing="0"><tr onMouseOver="javascript:ouvre(\''+i+'\');" onMouseOut="javascript:ouvreTimeOut(openedTab);">');
			document.write('<td><img src="onglet1Espace.png"/><br/></td>');
			document.write('<td><img src="onglet1Espace.png"/><br/></td>');
			document.write('<td id="header'+i+'" class="onglet1Milieu"><a href="javascript:ouvre(\''+i+'\');Charge('+this.onglets[i].id[0]+',\''+this.onglets[i].liens[0]+'\');" class=\"onglet1\">'+this.onglets[i].titre+'</a><br/></td>');
			document.write('<td><img src="onglet1Espace.png"/><br/></td>');
			document.write('<td><img src="onglet1Espace.png"/><br/></td>');
			document.write('<td><img src="onglet1Separateur.png"/><br/></td>');
			document.write('</tr></table>');
			document.write('</div>');
			
			document.write('<td>');
		}
		//document.write('<td class="onglet1Fin" width="100%"><img src="stockIcons/help_16.png" width="16" height="16" border=\"0\"></td>');
		document.write('<td class="onglet1Fin" width="100%">&nbsp;</td>');		
		document.write('</tr></table>');
		for (var i=0;i<this.nombre;i++){
		     /*
		     et ici, le style des onglets
		     */
			document.write('<div id="div'+i+'" style="display:none;" width="100%">');
			this.onglets[i].afficher();
			document.write('</div>');
		}
		nombre=this.nombre;
	}
	function ouvre(id){
		a=document.getElementById('div'+id);
		for (i=0;i<nombre;i++){
			document.getElementById('div'+i).style.display="none";
			document.getElementById('div'+i+'A').style.display="none";
			document.getElementById('div'+i+'B').style.display="block";
		}
		document.getElementById('div'+id).style.display="block";
		document.getElementById('div'+id+'A').style.display="block";
		document.getElementById('div'+id+'B').style.display="none";
	}
	var timerMenu;
	function ouvreTimeOut(idTmp){
		clearTimeout(timerMenu);
		timerMenu = setTimeout("ouvre("+idTmp+")", 10000);
	}
	function ChargeLien(lien){
		if(lien.indexOf('?')>0) {
			window.location=lien + '&onglet=${onglet}';
		} else {
			window.location=lien + '?onglet=${onglet}';
		}
	}
	////////////////////////////////////
	///change selected CSS
	/////////////////////
	
	
	
	///////////////
	function closeSubMenu() {
	if (!stillInMenuCell)
	subMenuLayerName.style.visibility = 'hidden';
	}
	
	
	
	/////////////
	function ChangeCss(menu) {
		var menuAChanger = document.getElementById(menu);
		var menuGaucheAChanger = document.getElementById(menu + 'Gauche');
		var menuDroiteAChanger = document.getElementById(menu + 'Droite');

		if(menu.indexOf('Bandeau') > -1) {
			menuAChanger.setAttribute('class', 'menuAppliItem');
			menuAChanger.setAttribute('className', 'menuAppliItem');
			var menuAChanger2 = document.getElementById(menu+'2');
			if(menuAChanger2) {
				menuAChanger2.setAttribute('class', 'menuAppliItem');
				menuAChanger2.setAttribute('className', 'menuAppliItem');
			}
			menuGaucheAChanger.setAttribute('class', 'menuAppliItemGauche');
			menuGaucheAChanger.setAttribute('className', 'menuAppliItemGauche');
			menuDroiteAChanger.setAttribute('class', 'menuAppliItemDroite');
			menuDroiteAChanger.setAttribute('className', 'menuAppliItemDroite');
		} else {
			menuAChanger.setAttribute('class', 'menuItem');
			menuAChanger.setAttribute('className', 'menuItem');
			menuGaucheAChanger.setAttribute('class', 'menuItemGauche');
			menuGaucheAChanger.setAttribute('className', 'menuItemGauche');
			menuDroiteAChanger.setAttribute('class', 'menuItemDroite');
			menuDroiteAChanger.setAttribute('className', 'menuItemDroite');
			var lienAChanger = document.getElementById(menu + 'Lien');
			if(lienAChanger) {
				lienAChanger.setAttribute('class', 'menuItem');
				lienAChanger.setAttribute('className', 'menuItem');
			}
		}
	}
	
	////////////////
	function ChangeCssSelected(menu) {
		var menuAChanger = document.getElementById(menu);
		var menuGaucheAChanger = document.getElementById(menu + 'Gauche');
		var menuDroiteAChanger = document.getElementById(menu + 'Droite');
		
		if(menu.indexOf('Bandeau') > -1) {
			menuAChanger.setAttribute('class', 'menuAppliItemSelec');
			menuAChanger.setAttribute('className', 'menuAppliItemSelec');
			var menuAChanger2 = document.getElementById(menu+'2');
			if(menuAChanger2) {
				menuAChanger2.setAttribute('class', 'menuAppliItemSelec');
				menuAChanger2.setAttribute('className', 'menuAppliItemSelec');
			}
			menuGaucheAChanger.setAttribute('class', 'menuAppliItemSelecGauche');
			menuGaucheAChanger.setAttribute('className', 'menuAppliItemSelecGauche');
			menuDroiteAChanger.setAttribute('class', 'menuAppliItemSelecDroite');
			menuDroiteAChanger.setAttribute('className', 'menuAppliItemSelecDroite');
		} else {
			menuAChanger.setAttribute('class', 'menuItemSelec');
			menuAChanger.setAttribute('className', 'menuItemSelec');
			menuGaucheAChanger.setAttribute('class', 'menuItemSelecGauche');
			menuGaucheAChanger.setAttribute('className', 'menuItemSelecGauche');
			menuDroiteAChanger.setAttribute('class', 'menuItemSelecDroite');
			menuDroiteAChanger.setAttribute('className', 'menuItemSelecDroite');
			var lienAChanger = document.getElementById(menu + 'Lien');
			if(lienAChanger) {
				lienAChanger.setAttribute('class', 'menuItemSelec');
				lienAChanger.setAttribute('className', 'menuItemSelec');
			}
		}
	}
	
	///////////////
	
	function cacheMenuPere(menu) {
		var menuAOuvrir = document.getElementById(menu);
		var menuFleche = document.getElementById(menu + 'fleche');
		
		if (menuFleche != null) {
			menuFleche.src = 'boutonFlecheBas.png';
		}
		
		menuAOuvrir.style.display='none';
	}
	
	function showMenuPere(menu, premier) {
		var menuAOuvrir = document.getElementById(menu);
		var parentMenu = document.getElementById(menu + 'Parent');
		var menuFleche = document.getElementById(menu + 'fleche');

		if (menuFleche != null) {
			menuFleche.src = 'boutonFlecheHaut.png';
		}
		menuAOuvrir.style.display='block';
		
		if(!premier || premier == '1') {
			menuAOuvrir.style.left = '-8px';
		} else if(parseInt(premier) > 1) {
			menuAOuvrir.style.left = '-' + premier + 'px';
		}
	}
	
	function cacheTag(menu) {
		var menuAOuvrir = document.getElementById(menu);
		
		menuAOuvrir.style.display='none';
	}
	
	function showTag(menu) {
		var menuAOuvrir = document.getElementById(menu);
		
		menuAOuvrir.style.display='block';
		menuAOuvrir.style.left = '-5px';
	}
	
	function addBeforeButton(id){
		document.getElementById('divBefore').innerHTML = document.getElementById(id).innerHTML;
	}
	function addAfterButton(id){
		document.getElementById('divAfter').innerHTML = document.getElementById(id).innerHTML;
	}
	
	var filtrageBandeau = 0;
	function LaunchRecherche(){
		if(document.getElementById('searchStringBandeau').value != ''){
			if(filtrageBandeau!=0){
				document.getElementById('formRecherche').action='recherchePasseport.action?onglet=110&filtrage='+filtrageBandeau;
				return true;
			}else{
				alert('<s:text name="alert.passeport.filtre.filtreInconnu" />')
			}
		}else{
			alert('<s:text name="alert.passeport.filtre.chaineVide" />');
		}
	}
	function setBandeauRecherche(filtre) {
		if(filtrageBandeau > 0) {
			ChangeCss('BandeauRecherche'+filtrageBandeau);
		}
		filtrageBandeau = filtre;
	}
	
	
	function AddListIntervenantModal(idTargetField) {
			var windowListIntervenant;
			larg=700;
			haut=500;
			postop=(screen.height-haut)/2
			posleft=(screen.width-larg)/2
			window.showModalDialog('PickUpPeople.xsp?idTargetField='+idTargetField,'','dialogwidth='+larg+',dialogheight='+haut+',top='+postop+',scrollbars=yes,resizable=no,left='+posleft);
			return false;
	}
		
	function AddListIntervenant(idTargetField) {
			var windowListIntervenant;
			larg=700;
			haut=500;
			postop=(screen.height-haut)/2
			posleft=(screen.width-larg)/2
			windowListIntervenant = window.open('PickUpPeople.xsp?idTargetField='+idTargetField,'','width='+larg+',height='+haut+',top='+postop+',scrollbars=yes,resizable=yes,left='+posleft);
	}	
	
	function AddListRole(idTargetField) {
			var windowListRoles;
			larg=500;
			haut=400;
			postop=(screen.height-haut)/2
			posleft=(screen.width-larg)/2
			windowListIntervenant = window.open('PickUpRole.xsp?idTargetField='+idTargetField+'&m=0','','width='+larg+',height='+haut+',top='+postop+',scrollbars=yes,resizable=yes,left='+posleft);
	}	
		
	function AddListRoles(idTargetField) {
			var windowListRoles;
			larg=500;
			haut=400;
			postop=(screen.height-haut)/2
			posleft=(screen.width-larg)/2
			windowListIntervenant = window.open('PickUpRoles.xsp?idTargetField='+idTargetField,'','width='+larg+',height='+haut+',top='+postop+',scrollbars=yes,resizable=yes,left='+posleft);
	}	
	
	function AddListMateriel(idTargetField) {
			var windowListMateriel;
			larg=600;
			haut=400;
			postop=(screen.height-haut)/2
			posleft=(screen.width-larg)/2
			windowListMateriel = window.open('PickUpMateriel.xsp?idTargetField='+idTargetField,'','width='+larg+',height='+haut+',top='+postop+',scrollbars=yes,resizable=yes,left='+posleft);
	}	
	
	var windowPickupApplication;
	function AddListApplication(idTargetField) {
			larg=600;
			haut=400;
			postop=(screen.height-haut)/2
			posleft=(screen.width-larg)/2
			windowPickupApplication = window.open('ApplicationVAvancement.xsp?idTargetField='+idTargetField,'','width='+larg+',height='+haut+',top='+postop+',scrollbars=yes,resizable=yes,left='+posleft);
	}	
	
	var windowPickupVersion;
	function AddListVersion(idTargetField) {
			larg=600;
			haut=400;
			postop=(screen.height-haut)/2
			posleft=(screen.width-larg)/2
			windowPickupVersion = window.open('VersionVAvancement.xsp?idTargetField='+idTargetField,'','width='+larg+',height='+haut+',top='+postop+',scrollbars=yes,resizable=yes,left='+posleft);
	}
	
	var windowPickupProjet;
	function AddListProjet(idTargetField) {
			larg=600;
			haut=400;
			postop=(screen.height-haut)/2
			posleft=(screen.width-larg)/2
			windowPickupProjet = window.open('ProjetVAvancement.xsp?idTargetField='+idTargetField,'','width='+larg+',height='+haut+',top='+postop+',scrollbars=yes,resizable=yes,left='+posleft);
	}
	
	var windowPickupMateriel;
	function AddPickupMateriel(idTargetField) {
			larg=600;
			haut=400;
			postop=(screen.height-haut)/2
			posleft=(screen.width-larg)/2
			windowPickupMateriel = window.open('MaterielVAvancement.xsp?idTargetField='+idTargetField,'','width='+larg+',height='+haut+',top='+postop+',scrollbars=yes,resizable=yes,left='+posleft);
	}
	
	var windowPickupDMO;
	function AddPickupDMO(idTargetField) {
			larg=600;
			haut=400;
			postop=(screen.height-haut)/2
			posleft=(screen.width-larg)/2
			var n = URLEncode(document.getElementById(idTargetField).value);
			windowPickupDMO = window.open('DemandeVOuvertes.xsp?N='+n,'','width='+larg+',height='+haut+',top='+postop+',scrollbars=yes,resizable=yes,left='+posleft);
	}
	
	
    
	function showBulle2(contentDiv,height,width) {

		var frameWidth;
		var frameHeight;
		if (self.innerWidth) {
			frameWidth = self.innerWidth - 5;
			frameHeight = self.innerHeight;
		} else if (document.documentElement && document.documentElement.clientWidth) {
			frameWidth = document.documentElement.clientWidth - 5;
			frameHeight = document.documentElement.clientHeight - 1;
		} else if (document.body) {
			frameWidth = document.body.clientWidth - 5;
			frameHeight = document.body.clientHeight - 5;
		}
		//alert((posX + width) +'>'+ frameWidth + ' / ' + (posY + height) +'>'+ frameHeight);
		
		var contexteLanguette = "contexteLanguette";
		var top = 10;
		var left = -20;
		var posDivX = 0;
		var posDivY = 0;
		if((posX + width + 20) > frameWidth) {
			posDivX = posX - width - 40;
			left = width;
			contexteLanguette = "contexteLanguetteDroite";
		}else{
			posDivX = posX;
		}
		if((posY + height + 20) > frameHeight) {
			//alert("a");
			top = posY;
			posDivY = posY - height + 60;
			top = top - posDivY + 20;
		}else{
			//alert("b");
			posDivY = posY;
		}
		
		var contentHTML = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\"><tr><td valign=\"top\"><img src=\"img/" + contexteLanguette + ".png\" style=\"position:absolute;left:" + left + "px;top:" + top + "px\"/></td><td><table border=\"0\" style=\"background-color: #FFFFFF;\" cellpadding=\"0\" cellspacing=\"0\" width=\""+width+"\" height=\""+height+"\">";
			contentHTML +="<tr><td class=\"bulleHautGauche\"></td><td class=\"bulleCadreHaut\"></td><td class=\"bulleHautDroite\"></td></tr>";
			contentHTML +="<tr><td class=\"bulleCadreGauche\"></td><td height=\"100%\">";
			contentHTML +=contentDiv;
			contentHTML +="</td><td class=\"bulleCadreDroite\"></td></tr>";
			contentHTML +="<tr><td class=\"bulleBasGauche\"></td><td class=\"bulleCadreBas\"></td><td class=\"bulleBasDroite\"></td></tr></table></td></tr></table>";
		
		var descDiv = document.getElementById('bulle');
		descDiv.style.display = 'block';
		descDiv.innerHTML = contentHTML;
		
		// Assignation des nouvelles coordonn\u00E9es au div
		descDiv.style.left = posDivX + 20 + 'px';
		descDiv.style.top = posDivY - 20 + 'px';
		//if (posDivX > (posXTmp-70) && posDivX < (posXTmp+70)
		//	&& posDivY > (posYTmp-10) && posDivY < (posYTmp+10)) {
				dojo.fadeIn({ node:descDiv, delay:100 }).play();
		//}
	}    
	

	/*********************************************************************
	 * No onMouseOut event if the mouse pointer hovers a child element 
	 * *** Please do not remove this header. ***
	 * This code is working on my IE7, IE6, FireFox, Opera and Safari
	 * 
	 * Usage: 
	 * <div onMouseOut="fixOnMouseOut(this, event, 'JavaScript Code');"> 
	 *		So many childs 
	 *	</div>
	 *
	 * @Author Hamid Alipour Codehead @ webmaster-forums.code-head.com		
	**/
	function is_child_of(parent, child) {
		if( child != null ) {			
			while( child.parentNode ) {
				if( (child = child.parentNode) == parent ) {
					return true;
				}
			}
		}
		return false;
	}
	function fixOnMouseOut(element, event, JavaScript_code) {
		var current_mouse_target = null;
		if( event.toElement ) {				
			current_mouse_target 			 = event.toElement;
		} else if( event.relatedTarget ) {				
			current_mouse_target 			 = event.relatedTarget;
		}
		if( !is_child_of(element, current_mouse_target) && element != current_mouse_target ) {
			eval(JavaScript_code);
		}
	}
	
	function hideBulle() {
		var descDiv = document.getElementById('bulle');
		dojo.fadeOut({ node:descDiv, delay:100 }).play();
		//descDiv.style.display = 'none';
	}
	
	function URLEncode (clearString) {
		  var output = '';
		  var x = 0;
		  clearString = clearString.toString();
		  var regex = /(^[a-zA-Z0-9_.]*)/;
		  while (x < clearString.length) {
		    var match = regex.exec(clearString.substr(x));
		    if (match != null && match.length > 1 && match[1] != '') {
		    	output += match[1];
		      x += match[1].length;
		    } else {
		      if (clearString[x] == ' ')
		        output += '%20';
		      else {
		        var charCode = clearString.charCodeAt(x);
		        var hexVal = charCode.toString(16);
		        output += '%' + ( hexVal.length < 2 ? '0' : '' ) + hexVal.toUpperCase();
		      }
		      x++;
		    }
		  }
		  return output;
		}
		

	

		

		
		

