// 									 \\
//***********************************\\
//  fonction menuSection(laSection)  \\
// 									 \\
//***********************************\\
// laSection :	nom de la page       \\
//-------------- 					 \\
// Cette fonction recois en paramètre\\
// le nom de la page et envoit de    \\
// l'information au flash. Il va     \\
// modifier la variable "section"    \\
// du flash et lui passer en         \\
// paramètre le nom de la page       \\
// contenu dans laSection.           \\
// 				     \\
//***********************************\\
// 																	 \\
// Créé par : Guillaume Tremblay	   \\
// Date : 2007-01-31				         \\
// 									                 \\
function menuSection(laSection)
{
	var sCurrentUrl = document.getElementById('txtCurrentPage').value;
		
	document.getElementById("oFlashLogo").SetVariable("section", laSection);
	document.getElementById("oFlashMenu").SetVariable("section", laSection);
	document.getElementById("oFlashMenu").SetVariable("sCurrentUrl", sCurrentUrl);
}

function currentSectionHighlight()
{
	var oForm = document.getElementById("Form1");
	var regPage = new RegExp(".*/(.*)\.aspx","i");
		
	var resPage = regPage.exec(document.location);
  if (resPage == null) 
  {
    return false;
  } 
  else 
  {  
		// Found page and change css class
		var oDivMenu = document.getElementById("content-menu");
		var regCurentPage = new RegExp(".*/(.*)\.aspx","i");
		
		if(oDivMenu)
		{
			nLiOnDiv = oDivMenu.firstChild.firstChild.childNodes.length;
							
			for(var a=0; a < nLiOnDiv; a++)
			{
				
				oLi = oDivMenu.childNodes[0].childNodes[0].childNodes[a];
						
				oLiLinkId = oLi.id;
				if(!oLiLinkId)
				{							
					var resCurentPage = regCurentPage.exec(oLi.childNodes(0));
					if (resCurentPage == null) 
					{
						return false;
					} 
					else 
					{
						oLi.id = _getLinkName(resCurentPage[1]);	
					}
				}
			}
			
			//Change CSS Class of link
			sLinkName = _getLinkName(resPage[1]);
			oLink = document.getElementById(sLinkName);
			
			if(oLink) 
			{
				// Link ID found, change visuel
				sCurentLinkName = oLink.childNodes(0).innerHTML;
				oLink.innerHTML = "<b>" + sCurentLinkName + "</b>";
			}		
		} 
  }
}

function _getLinkName(sLink)
{
	return sLink + "nav";
}




