var enableGA = false;

function AjaxHTMLUpdate(url,e, period)
{
	if(e==undefined)
		e = $('content');
	if( period != undefined && typeof period == 'number' )
		new Ajax.PeriodicalUpdater(e, url, {frequency:period});
	else
		new Ajax.Updater(e, url, {method:'get', evalScripts:true});
	if( enableGA == true && period == undefined )
		pageTracker._trackPageview(url);
}

function displayPopup()
{
	new Effect.Parallel( [ new Effect.Appear("popuplayer", {from:0,to:0.5}), new Effect.Appear("popup", {from:0,to:1.0}) ], { duration: 1.0 } );
}

function closePopup()
{
	new Effect.Fade("popup");
	new Effect.Fade("popuplayer");
}

var openedMenu;
var targetMenu;
var mouseOverMenu = false;
function rollOverMenu(e)
{
	if( e != undefined )
	{
		openedMenu = e;
		e.style.display = "block";
	}
	mouseOverMenu = true;
}

function rollOutMenu(e)
{
	if( e != undefined && ( mouseOverMenu == false || e != openedMenu ) )
	{
		e.style.display = "none";
		imageOut(e.parentNode.getElementsByTagName("img")[0]);
	}
	else
		if( e.parentNode != undefined )
			imageOver(e.parentNode.getElementsByTagName("img")[0]);
}

function imageOver(e)
{
	if( e != undefined && e.getAttribute("onmouseover") != null )
	{
		var str = e.getAttribute("onmouseover").toString();
		var resultat = str.match(/\'(.*)\'/);
		e.src = resultat[1];
	}
}

function imageOut(e)
{
	if( e != undefined && e.getAttribute("onmouseout") != null )
	{
		var str = e.getAttribute("onmouseout").toString();
		var resultat = str.match(/\'(.*)\'/);
		e.src = resultat[1];
	}
}

function timer(e)
{
	mouseOverMenu = false;
	setTimeout(function(){rollOutMenu(e)}, navigator.appName=='Microsoft Internet Explorer' && Browser.Version() == 6 ? 50 : 1);
}
