var menuTop = 200;
var menuLeft = 200;

var domSMenu = null;
var oldDomSMenu = null;
var t = 0;
var lDelay = 5;
var lCount = 0;
var pause = 100; 

if(document.images){
			menu_img = Array();
				menu_img[0] = "images/Bienvenue_off.gif";
				menu_img[1] = "images/Bienvenue_on.gif";
				menu_img[2] = "images/Menu_off.gif";
				menu_img[3] = "images/Menu_on.gif";
				menu_img[4] = "images/Information_off.gif";
				menu_img[5] = "images/Information_on.gif";
				menu_img[6] = "images/Garantie_off.gif";
				menu_img[7] = "images/Garantie_on.gif";
				menu_img[8] = "images/Emploi_off.gif";
				menu_img[9] = "images/Emploi_on.gif";
				menu_img[10] = "images/Contact_off.gif";
				menu_img[11] = "images/Contact_on.gif";
				menu_img[12] = "images/News_off.gif";
				menu_img[13] = "images/News_on.gif";
			im = new Array();
			for (var i = 0; i < menu_img.length; i++){
			im[i] = new Image();
			im[i].src = menu_img[i];
			}	
		}
		function toggleImage(imgName, num){
			if(document.images && imgName){
				imgName.src = im[num].src;
			}
			return;	
		}  

function popMenu(menuNum){ 

	if (isDHTML) {
///// Sets the previous menu's visibility to hidden
		t = 2;
		if (oldDomSMenu) {
			oldDomSMenu.visibility = 'hidden';
			oldDomSMenu.display = 'none'; 
			oldDomSMenu.zIndex = '0'; 
			t = 2; 
			lCount = 0;
			oldDomSMenu = null;
		}
  
///// Defines the DOMs	of the menu objects
		var idMenu = 'menuHead';
		var domMenu = findDOM(idMenu,0);

		var idMenuOpt = 'menuHead' + menuNum;
		var domMenuOpt = findDOM(idMenuOpt,0);		

		var idSMenu = 'menu' + menuNum;
		var domSMenu = findDOM(idSMenu,1);

///// Defines the positions of the sub-menus   
		//if (idMenuOpt) { 
			/*alert(domMenuOpt);
			if (domMenuOpt.offsetLeft){	 
				alert('ok');
				var menuLeft = object.offsetLeft;
				} 
			else{
				alert('not ok');	
	   			var menuLeft = 0;  
				}
   		//}*/		   
			
		if (idMenuOpt == 'menuHead2')
			//var menuLeft = 147;
			var menuLeft = -2;
		else if (idMenuOpt == 'menuHead3')
			//var menuLeft = 225;	
			var menuLeft = 175;	
		else if (idMenuOpt == 'menuHead6')	
			//var menuLeft = 470; 
			var menuLeft = 375;
		else
			var menuLeft = 0;

///// Positions and shows the menu
		if (oldDomSMenu != domSMenu) {
			domSMenu.left = menuLeft; 
			//domSMenu.top = menuTop;
			domSMenu.visibility = 'visible'; 
			domSMenu.display = 'inline';
			domSMenu.zIndex = '100';
			oldDomSMenu = domSMenu;
		}

///// Resets oldDom if it is the same as the current DOM
		else { oldDomSMenu = null; }
	}

////// Returns a 'null' value for non-DHTML Browsers 
	else { return null; }
}


function delayHide() {
///// Checks to see if there is a menu showing and whether 
///// the global variable 't' has been set to 0
	if ((oldDomSMenu)&&(t == 0)) {
///// Hides the old menu, resets menu conditions, 
///// and stops the function running
        oldDomSMenu.visibility = 'hidden'; 
		oldDomSMenu.display = 'none';
        oldDomSMenu.zIndex = '0';
        oldDomSMenu = null;
        lCount = 0; 
        return false;
    }

///// Interupts the function if another menu is opened
    if (t == 2) { lCount = 0; return false; }

///// Repeats the function adding 1 to lCount each time until 
///// lCount is equal to lDelay and then sets 't' to 0 so that 
///// the menu will hide when it runs again
    if (t == 1) { 
        lCount = lCount + 1;
        //if (lDelay <= lCount) { t = 0; }
        if (lDelay <= lCount) { t = 0; delayHide()}
        if (lDelay > lCount) { setTimeout('delayHide(' + t + ')',pause); }	
    }
}
	   
function swapMenu(num){
			return;	
} 
