/*************************************************************************
  Gestion des <div> HTML statiques(Layers) et dynamiques(menu dynamique)
  Harrison & Wolf
  version : 2.3
  Date de création : 21/11/03
  Date de modification : 21/08/07
*************************************************************************/
function NAVHAUT_HTML(menuObjName, relativePath, imgSrc)
{
	
	menuObj = getMenuByName(menuObjName);
	if(!menuObj) return "";
	
	var relativePath='';
	//var relativePath='fr\/';
	var str ='';
	var CRLF = '\n\r';
		CRLF='';
	str+='<div id=\"'+menuObj.name+'\">'+CRLF;
	str+='<table width=\"'+menuObj.width+'\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"#179ccb\">'+CRLF;
	
			str+='<tr>'+CRLF;
		str+='<td bgcolor=\"#FFFFFF\" colspan=\"5\"><img src=\"http:\/\/www.naftogaz-algeria.com\/images\/spacer.gif\" width=\"180\" height=\"1\"><\/td>'+CRLF;
		str+='<\/tr>'+CRLF;
			str+='<tr>'+CRLF;
		str+='<td width=\"1\" height=\"7\" bgcolor=\"#FFFFFF\"><img src=\"http:\/\/www.naftogaz-algeria.com\/images\/spacer.gif\" width=\"1\" height=\"7\"><\/td>'+CRLF;
		str+='<td width=\"20\" height=\"7\" bgcolor=\"#179ccb\"><img src=\"http:\/\/www.naftogaz-algeria.com\/images\/spacer.gif\" width=\"20\" height=\"7\"><\/td>'+CRLF;
		str+='<td width=\"1\" height=\"7\" bgcolor=\"#FFFFFF\"><img src=\"http:\/\/www.naftogaz-algeria.com\/images\/spacer.gif\" width=\"1\" height=\"7\"><\/td>'+CRLF;
		str+='<td width=\"'+(menuObj.width-23)+'\" height=\"7\" bgcolor=\"#179ccb\" align=\"left\"><img src=\"http:\/\/www.naftogaz-algeria.com\/images\/spacer.gif\" width=\"'+(menuObj.width-23)+'\" height=\"7\"><\/td>'+CRLF;
		str+='<td width=\"1\" height=\"7\" bgcolor=\"#FFFFFF\"><img src=\"http:\/\/www.naftogaz-algeria.com\/images\/spacer.gif\" width=\"1\" height=\"7\"><\/td>'+CRLF;
		str+='<\/tr>'+CRLF;

	
	
	for(var i=1;i<=menuObj.itemList.length;i++)
	{
		str+='<tr>'+CRLF;
		
		str+='<td width=\"1\" height=\"17\" bgcolor=\"#FFFFFF\" align=\"center\" valign=\"top\"><img src=\"http:\/\/www.naftogaz-algeria.com\/images\/spacer.gif\" width=\"1\" height=\"17\" ><\/td>'+CRLF;
		
		str+='<td width=\"20\" height=\"17\" bgcolor=\"#179ccb\" align=\"center\" valign=\"top\"><img src=\"http:\/\/www.naftogaz-algeria.com\/images\/spacer.gif\" name=\"puce'+menuObj.name+ndigit(i,2)+'\" id=\"puce'+menuObj.name+ndigit(i,2)+'\" width=\"20\" height=\"17\" id=\"puce'+menuObj.name+'0'+i+'\"><\/td>'+CRLF;
		
		str+='<td width=\"1\" height=\"17\" bgcolor=\"#FFFFFF\" valign=\"top\"><img src=\"http:\/\/www.naftogaz-algeria.com\/images\/spacer.gif\" width=\"1\" height=\"17\"><\/td>'+CRLF;
		
		str+='<td width=\"'+(menuObj.width-23)+'\" height=\"17\" class=\"navGaucheTexte\" align=\"left\">&nbsp;&nbsp;&nbsp;<a href=\"'+menuObj.itemList[i-1].url+'\" class=\"navGaucheTexte\" target=\"'+menuObj.itemList[i-1].target+'\" onMouseOver=\"FixePuce('+menuObj.itemList.length+','+ i +",\'"+relativePath+"\',\'"+menuObj.name+"\', \'"+imgSrc+"\'"+')\">'+menuObj.itemList[i-1].label+'<\/a><\/td>'+CRLF;
				
		str+='<td width=\"1\" height=\"17\" bgcolor=\"#FFFFFF\" align=\"center\" valign=\"top\"><img src=\"http:\/\/www.naftogaz-algeria.com\/images\/spacer.gif\" width=\"1\" height=\"17\"><\/td>'+CRLF;
		
		str+='<\/tr>'+CRLF;

	}
	

			str+='<tr>'+CRLF;
		str+='<td width=\"1\" height=\"7\" bgcolor=\"#FFFFFF\"><img src=\"http:\/\/www.naftogaz-algeria.com\/images\/spacer.gif\" width=\"1\" height=\"7\"><\/td>'+CRLF;
		str+='<td width=\"20\" height=\"7\" bgcolor=\"#179ccb\"><img src=\"http:\/\/www.naftogaz-algeria.com\/images\/spacer.gif\" width=\"20\" height=\"7\"><\/td>'+CRLF;
		str+='<td width=\"1\" height=\"7\" bgcolor=\"#FFFFFF\"><img src=\"http:\/\/www.naftogaz-algeria.com\/images\/spacer.gif\" width=\"1\" height=\"7\"><\/td>'+CRLF;
		str+='<td width="'+(menuObj.width-23)+'" height="7" bgcolor=\"#179ccb\" align=\"left\"><img src=\"http:\/\/www.naftogaz-algeria.com\/images\/spacer.gif\" width=\"'+(menuObj.width-23)+'\" height=\"7\"><\/td>'+CRLF;
		str+='<td width=\"1\" height=\"7\" bgcolor=\"#FFFFFF\"><img src=\"http:\/\/www.naftogaz-algeria.com\/images\/spacer.gif\" width=\"1\" height=\"7\"><\/td>'+CRLF;
		str+='<\/tr>'+CRLF;	
		str+='<tr>'+CRLF;
		str+='<td bgcolor=\"#FFFFFF\" colspan=\"5\"><img src=\"http:\/\/www.naftogaz-algeria.com\/images\/spacer.gif\" width=\"180\" height=\"1\"><\/td>'+CRLF;
		str+='<\/tr>'+CRLF;

	str+='<\/table>'+CRLF;
	str+='<\/div>'+CRLF;
	return str;
}


// INITIALISATION DU SCRIPT
var menuList = new Array();
var popTimer = 0;
believeTimer=false;

if (clientIs.ns) document.captureEvents(Event.MOUSEDOWN);
document.onclick = clickHandle;

function clickHandle(evt)
{
	// Gère la chaine d'evenement (click souris)
	believeTimer=true;
	hideall();
	if (clientIs.ns) document.routeEvent(evt);
}

/*************************************************************************
  wrappers (fonctions pouvant apparaitre dans le code d'une page HTML
*************************************************************************/
function initializeMenus()
{
	// Utilisation: onLoad="initializeMenus()" 
	nbMenus = menuList.length;
	
	for(i=0;i<nbMenus;i++)
	{
		menuList[i].calculateSize();
		//alert(menuList[i].name);
		//document.write(menuString);
	}
	
}



// Déclarer un nouveau menu dynamique
function addMenu(menuName,menuSize,menuType, Relativepath, srcImg, menuRefCorner)
{
	// vérification du nom du layer... underscore est incompatible avec Netscape 4.x
	if(menuName.indexOf("_")>=0)
	{
		alert("Impossible de définir un menu dont le nom contient le caractère '_' (underscore): '"+menuName+"'");
		return ;
	}
	
	var newMenu = new menu(menuName,menuSize,menuType, Relativepath, srcImg,menuRefCorner); // Création de l'obet menu dynamique

	// ajout le menu à la liste des menus references
	registerMenu(newMenu)
	//menuList[menuList.length] = newMenu;
	//nbMenus = menuList.length;
}

// Ajouter une ligne au menu dynamique
function addItemToMenu(menuName,ItemLabel,itemURL,itemTarget,targetMen)
{
	menuObj = getMenuByName(menuName); // on recherche le menu concerne
	if(!menuObj) 
	{	// Il n'existe pas. Vérifier le nom du menu et de la <div>
	 //	alert("Menu '"+menuName+"' non défini. Impossible d'ajouter l'item '"+ItemLabel+"'");
	//	return -1;*
		
		addMenu(menuName,140,'NAVGAUCHE',0); 
		menuObj = getMenuByName(menuName);
		
		
		//return -1;

	}
	menuObj.addItem(ItemLabel,itemURL,itemTarget,targetMen); // On ajoute la ligne au menu
	return 0;
}

// Génération du code HTML des Div HTML dynamiques(menus dynamiques)
function createMenus(urlShim,urlPuce)
{
	// Utilisation: juste avant le tag <body>" 
	var i;
	var menuString = '';
	nbMenus = menuList.length;
	
	// preload des images
	var shimObj = new Image();
	var puceObj = new Image();
	shimObj.src = urlShim; //URL de l'image de calage, relative au document HTML
	shimObj.src = urlPuce; //URL de la puce du menu, relative au document HTML
	
	for(i=0;i<nbMenus;i++)
	{
		if(menuList[i].initialized) continue;
		menuList[i].urlShim = urlShim;
		menuList[i].urlPuce = urlPuce;
		
		menuList[i].writeCSSDefinition(); // insert la déclaration CSS de la <div>
		menuList[i].writeHTML(); // insert le code HTML de la <div>
		menuList[i].setChild(); // construit l'arborescence du menu (la relation parent/enfant entre les objet de classe menu)
		menuList[i].initialized=true;
		//document.write(menuString);
	}
	
	//document.write(menuString);
	//document.close();

}
/*************************************************************************
  fonctions d'ouverture de menu statiques ou dynamiques (openMenu)
*************************************************************************/
function openMenuCommon(layerName)
{
	var navRef = 'dim'+layerName;
	openMenuAt(layerName,navRef,9,-5);
}
function openMenuGauche(layerName)
{
	openMenuAt(layerName,'dim'+layerName,8,-4);
	//openMenuAt(layerName,'dim'+layerName,8,-4);
}

function openMenuHaut(layerName,navRef)
{	
	//ajout du 14/08 Harrison & Wolf
	//if (window.formdiv) {alert('toot')} else {alert('tata')};
	//formcheck(layerName);
	openMenuAt(layerName,navRef,140,0);
	//openMenuAt(layerName,navRef,0,18);
}



function openMenuAt(layerName,navRef,xoffset,yoffset,cornerRef)
{
	if(!navRef) return ;
	//pos = getElementPosition(navRef);
	pos = new point(navRef); // Récupère la position de l'image shim de reference. La class point se trouve dans common.js v3                                                                      
	pos.x = (!xoffset) ? 0 : xoffset;
	pos.y = (!yoffset) ? 0 : yoffset;
	
	var menuObj = getMenuByName(layerName);

	if(!menuObj) return; 
	
	var layerObj = menuObj.layerObject.getStyle();
                                                                           
	if(!layerObj) // l'objet <div> n'existe pas ! Vérifiez la déclaration CSS et l'attribut id de la div
	{
		debug("La <div> (layer ou menu dynamique) '"+layerName+"' n'existe pas!");
		closeMenu('');	
		return;
	}
	
	// On calcul la position par rapport au coin de reference (celui qui touche l'image de reference)
	if(menuObj.refCorner==0)	// left top
	{
		
		// nothing
	}
	if(menuObj.refCorner==1)	// left bottom
	{
		pos.x = -menuObj.size.x-1;
	}
	if(menuObj.refCorner==2)	// right top
	{
		pos.y = -menuObj.size.y-1;
		pos.x = -menuObj.size.x-1;
	}
	if(menuObj.refCorner==3)	// right bottom
	{
		pos.y = -menuObj.size.y-1;
	}
	if(menuObj.refCorner==4)	// center top
	{
		pos.x = (pos.getSize().x/2)-(menuObj.size.x/2)-1;
	}
	if(menuObj.refCorner==5)	// center bottom
	{
		pos.y = -(menuObj.size.y)-1;
		pos.x = (pos.getSize().x/2)-(menuObj.size.x/2)-1;
	}


	menuObj.setPosition(pos.getPosition().x + pos.x , pos.getPosition().y + pos.y); // on repositionne le layer/menu avant son apparition

	openMenu(layerName);  // Le layer/menu apparait
}

// Fonction faisant apparaitre la <div> HTML. On peut l'utiliser seul avec des <div> statiques 
function openMenu(menuName)
{
	// Utilisation: onMouseOver="openMenu('attribut id de la <div>')"
	believeTimer = false;
	clearTimeout(popTimer);
	//LG alert("menuname= "+menuName);
	if (typeof(menuName) != "string") return;
	//if(!menuName || menuName==null) return;	
	//if(getArrayPos(lay,menuName)<0) lay[lay.length]=menuName;

 	
	menuObj = getMenuByName(menuName)

	if(!menuObj) 
	{
		//alert(menuName);
		menuObj=new HWLAYER(menuName);
		menuObj.setRef(menuName);
		if(!menuObj.getRef()) return ;
		registerMenu(menuObj);
	}
	
	hideall(menuName);

	menuObj.display();
}
function closeMenu(menuName) 
{
	// Utilisation: onMouseOut="closeMenu()"
	believeTimer = true;
	if (typeof(menuName) != "string")
	//if (!menuName ||menuName==null )
		//appel venant de la page html suite à un mouseOut
		{ 
			popTimer = setTimeout("hideall()", 500);
		}
	else
		//appel du à l'ouverture d'un autre menu
		{
			hideall(menuName);
		}
}

/*************************************************************************
  fonctions internes ne devant pas apparaitre sur le document HTML
*************************************************************************/
function hideall(menuName)
{
	if (!believeTimer && (typeof(menuName) != "string") && clientIs.ns && !clientIs.ns6 && !clientIs.ns7) return false;
	
	
	if(menuName) 
	{
		var menuObj = getMenuByName(menuName);
		if(menuObj) var parentArray = menuObj.getParentArray(menuName);
		//alert(parentArray);
	}
	
	for(var i=0;i<nbMenus;i++)
	{
		if(menuList[i].name==menuName || !menuList[i].layerObject.displayed) continue;
		//menuObj = getMenuByName(menuName);
		//alert(menuName+" "+menuList[i].getParentArray());
		if(menuObj)
			if(menuObj.isParent(menuList[i].name)) continue;
	//		if(getArrayPos(parentArray,menuList[i])>0) continue;
	//alert(menuList[i]);
		menuList[i].layerObject.hide();
	}
}

function mouseoverMenuItem(menuName,numero)
{
	// on efface les puces précédemment affichées
	menuObj = getMenuByName(menuName);
	if(!menuObj) return null;

	menuObj.mouseoverMenuItem(numero);

}

function getMenuByName(menuName)
{
	var menuObj ;
	var nbLayers = menuList.length
	var i;
	for(i=0;i<nbLayers;i++)
		if(menuList[i].name==menuName)
			return menuList[i];
	return null;
}
function registerMenu(newMenu)
{
	menuList[menuList.length] = newMenu;
	nbMenus = menuList.length;
}


/*************************************************************************
  	CLASSES
**************************************************************************
	Nom des classes à suivre:
		menu : classes des menus dynamiques
		menuItem : classes représentant une ligne d'un menu dynamique
		HWLAYER : classes permettant de manipuler une <div> HTML

*************************************************************************/


/*************************************************************************
  	class menu
	modif LG040605
*************************************************************************/
function menu(menuName,menuSize,menuType, Relativepath, srcImg,menuRefCorner)
{
	// vérification du nom du layer... underscore est incompatible avec Netscape 4.x
	if(menuName.indexOf("_")>=0)
	{
		// debug("Impossible de définir un menu dont le nom contient le caractère '_' (underscore)");
		return ;
	}
	
	
	//propriétés
	this.name = menuName;
	this.type = menuType;
	this.initialized=false;
	this.width = menuSize;
	
	if(!menuRefCorner) {
	     this.refCorner=0;
		 }
		 else
		 {
		 	if(menuRefCorner=="lt") this.refCorner=0;  // left top
			else
				if(menuRefCorner=="rt") this.refCorner=1; // right top
				else
					if(menuRefCorner=="rb") this.refCorner=2; // right bottom
					else
						if(menuRefCorner=="lb") this.refCorner=3; // left bottom
						else
							if(menuRefCorner=="ct") this.refCorner=4; // center top
							else
								if(menuRefCorner=="cb") this.refCorner=5; // center bottom
		} ; // 0= haut gauche ( 1= haut droite; 2 = bas droite; 3; bas gauche)
	
	this.urlShim = '';
	this.urlPuce = '';
	this.height = 0;
	this.itemList = new Array();
	this.nbItems = 0;
	this.left = 0;
	this.top = 0;
	this.parent = null;
	this.size = new point();
	this.size.x = menuSize;
	this.layerObject = new HWLAYER(this.name);
	this.position = new point();
	
	this.getName = function()
	{
		return this.name;
	}
	this.getSize = function()
	{
		return this.size;
	}
	// methodes
	this.addItem = function(ItemLabel,itemURL,itemTarget,targetMen) {
	/*
		if(!xtClicDownloadName) xtClicDownloadName ='';
		xtClicDownloadName = xtClicDownloadName.replace(/ +/g,'_')
		xtClicDownloadName = xtClicDownloadName.replace(/[àâä]/g,'a');
		xtClicDownloadName = xtClicDownloadName.replace(/[éèêë]/g,'e');
		xtClicDownloadName = xtClicDownloadName.replace(/[îïì]/g,'i');
		xtClicDownloadName = xtClicDownloadName.replace(/[ôöò]/g,'o');
		xtClicDownloadName = xtClicDownloadName.replace(/[ûüù]/g,'u');
		*/
		
		var newItem = new menuItem(this,ItemLabel,itemURL,itemTarget,targetMen);
		
		this.itemList[this.nbItems] = newItem;
		
		newItem.setRollImage("puce"+this.getName()+ndigit(this.nbItems,2));
		this.nbItems = this.itemList.length;
		return newItem;
		}
	this.getItemByIndex = function(itemIndex)
		{
			
			return (itemIndex>this.nbItems) ? null : this.itemList[itemIndex];
		}
	this.getNumberOfItems = function()
		{
			return this.nbItems;
		}
	this.setChild = function() {
			for(var i=0;i<this.nbItems;i++)
			{
				var obj;
				if(!this.itemList[i].targetMenu) continue;
				obj = getMenuByName(this.itemList[i].targetMenu);

				if(!obj) continue;
				obj.parent = this;
			}
		}
	this.isParent = function(layerName) {
	
		var parentArray = this.getParentArray();
			//// debug("is parent"+parentArray[0]);
		for(var i=0;i<parentArray.length;i++)
		{
			//// debug("parent name="+parentArray[i].name);
			if(parentArray[i]==layerName) return true;
		}
		return false;
	}
	this.getParentArray = function(){
			var parentArray = new Array();
			tmpParent = this;
			
			while(tmpParent!=null)
			{		
				parentArray[parentArray.length]=tmpParent.name;				
				tmpParent = tmpParent.parent;		
			}
			
			return parentArray;
		}
	this.calculateSize = function(){
		
		var a=getElementPosition(this.name+'UL');
		var b=getElementPosition(this.name+'BR');
		
		// modifications du 14/08/07
		// if(!this.size.x) this.size.x = b.x - a.x;
		// if(!this.size.y) this.size.y = b.y - a.y;
		
		
		this.size.x = b.x - a.x+4;
		this.size.y = b.y - a.y;

		if(this.layerObject)
			this.layerObject.size=this.size;
		//modifications : fin
		}
	this.writeCSSDefinition = function(){
		var CRLF = '\n\r';
		CRLF='';
		var CSSDefinitionString ='<style type=\"text\/css\">';
		CSSDefinitionString += '#'+this.name+'{position:absolute; visibility:hidden; z-index:2; left: '+this.left+'px; top: '+this.top+'px}';
		CSSDefinitionString +='<\/style>';
		document.write(CSSDefinitionString);
		document.close();
		return CSSDefinitionString;
		}
	this.writeHTML = function(){
	//// debug(this.type);
		HTMLString = eval(this.type+"_HTML('"+this.getName()+"', '"+Relativepath+"', '"+srcImg+"')");

		document.write(HTMLString);
		document.close();
		return HTMLString;
		}
	this.mouseoverMenuItem = function(numero)
	{
		this.hide();

		menuItemObj=this.getItemByIndex(numero);
		if(!menuItemObj) return;
		
		menuItemObj.setRollImageSrc(this.urlPuce);

	}
	this.hide = function()
	{
		//this.layerObject.hide();
		for (i=0;i<=this.nbItems;i++)
		{
			menuItemObj=this.getItemByIndex(i);
			if(!menuItemObj) continue;
			menuItemObj.setRollImageSrc(this.urlShim);
		}		
	}
	this.setPosition = function(x,y)
	{
		this.layerObject.setPosition(x,y);
	}
	this.getPosition = function()
	{
		return this.layerObject.getPosition();
	}
	this.display = function()
	{
		//modifié le 11/12/03
		var targetMenuObj;
		var targetMenuStyle;
		// modification du 14/08/07
		this.calculateSize();
		// modifications : fin
		
		// on vérifie que le menu est déclaré. si non, on le déclare
		//if(getArrayPos(lay,menuName)<0) lay[lay.length]=menuName;	
	
		//pour netscape
		if(clientIs.ns && !clientIs.ns6 && !clientIs.ns7)
		{
			setTimeout("believeTimer = false;", 200);
		}
		//alert(this.size.x+" "+this.size.y);
		
		this.layerObject.display();
	}

}
/*************************************************************************
  class menuItem
*************************************************************************/
function menuItem(par,ItemLabel,itemURL,itemTarget,targetMen)
{
	if(!par) return null;
	this.parent = par;
	//this.downloadName = xtClicDownloadName;
	this.targetMenu = targetMen;
	this.label = ItemLabel;
	this.url = itemURL;
	this.target = itemTarget;
	this.image = null;
	//if(!xtClicDownloadName) this.downloadName = '';
	
	//if(!targetMen) this.targetMenu = targetMen;

	//if(!targetMen) this.targetMenu = '';
	this.setRollImage = function(imageName)
	{
		
		this.image = new point(imageName);
		return this.image;
	}
	this.setRollImageSrc = function(imageURL)
	{
		var imageRef = this.image.getRef();
		if(!imageRef) return null;

		imageRef.src = imageURL;
		return imageRef.src;
	}

}

/*************************************************************************
  class HWLAYER
  Definition: c'est la classe layer de base.
  Elle permet de gérer des <div id="nomDeLayer"> HTML statique(layer) ou dynamique(menu dynamique)
*************************************************************************/

function HWLAYER(name)
{ 
	this.name = name;
	this.refName =name;
	this.ref = null;
	this.visible = ((clientIs.ie || clientIs.ns6 || clientIs.ns7) ? ("visible") : "show" );
	this.hidden = ((clientIs.ie || clientIs.ns6 || clientIs.ns7) ? ("hidden") : "hide" );
	this.displayed=false;
	this.layerObject = this;
	this.size = new point();
	
	this.getStyle = function()
	{
		if(clientIs.ns && !clientIs.ns6 && !clientIs.ns7) return this.getRef();
		//var obj = document.getElementById(this.name);
		
		return this.getRef().style;
		//return (!obj) ? null : obj.style;
	}
	this.setRef = function (refName){
		
		this.refName = refName; 	// nom de l'element de référence ( image ! layer (à tester)?! )
		//this.ref = (clientIs.ns && !clientIs.ns6) ? document.images[this.refName] : document.getElementById(this.refName) ;
		
		if(clientIs.dom)
			this.ref = document.getElementById(this.refName);
		else
			this.ref = MMNOAUTOLINK_findObj(this.refName);
			
		if(!this.ref || this.ref==null) this.ref==null;
		return this.ref;
	}
	this.getRef = function (){
	
		//if(!this.ref) this.ref = (clientIs.ns && !clientIs.ns6) ? document.images[this.refName] : document.getElementById(this.refName) ;
			
		if(!this.ref) this.setRef(this.refName);
		
		return this.ref;
	}

	this.display = function(){
		//alert('hello");
		if (typeof(this.refName) != "string" || this.refName=="") return;
	
		//if(!this.refName || this.refName==null) return;
		if(!this.ref) this.setRef(this.refName);
		if(!this.ref) return;
		if(this.displayed) return ;
		

		this.ref.onmouseout =closeMenu;
		this.ref.onmouseover= openMenu;
		
		//this.ref.onmouseout =this.hide;
		//this.ref.onmouseover= this.display;
		var tmpStyle = this.getStyle();
		//alert("Displaying "+this.refName+"<br> "+tmpStyle.left+tmpStyle.top+" "+ this.visible);
		//if(!tmpStyle) return ;
		//this.getRef().visibility = "show"

		tmpStyle.visibility = this.visible;			
		this.displayed = true;
		
		// modification du 14/08/07 pour layer sur elements de formulairfe
		
		cacheObj=document.getElementById("cacheMenu");
		if(cacheObj)
		{
			tmpPos=this.getPosition();
			cacheObj.style.left=tmpPos.x;
			cacheObj.style.top=tmpPos.y;
			
			cacheObj.style.width=this.size.x;
			cacheObj.style.height=this.size.y;	
			//alert(this.size.x+" "+this.size.y);
			cacheObj.style.visibility='visible';
		}
		// modifications: fin
	}

	this.hide = function(){
		if(!this.displayed) return ;
		var tmpStyle = this.getStyle();
		//if(!tmpStyle) return ;
		tmpStyle.visibility = this.hidden;
		this.displayed = false;
		
		// modification du 14/08/07 pour layer sur elements de formulairfe
		if(cacheObj)
		{
			cacheObj=document.getElementById("cacheMenu");	
			cacheObj.style.visibility='hidden';
		}
		// modifications: fin
		
	}
	this.setPosition = function(x,y){
		var tmpStyleObj = this.getStyle();
		tmpStyleObj.left = x;
		tmpStyleObj.top = y;
	}
	this.getPosition = function(){
		var tmpStyleObj = this.getStyle();
		var a = new point()
		
		a.x = tmpStyleObj.left ;
		a.y = tmpStyleObj.top ;
		return a;
	}
}