//Event.observe(window, 'load', alertGoToiPhoneVersion, false);
Event.observe(window, 'load', init, false);

function init(){
	var myGlobalHandlers = 
	{
		onCreate: function()
		{
			if (!$('chargement'))
			{
				creationIndicateurtop();
			}
			Element.show('chargement');
		},
		onComplete: function()
		{
			if(Ajax.activeRequestCount == 0)
			{
				Element.hide('chargement');
			}
		}
	};
	
	Ajax.Responders.register(myGlobalHandlers);

	new Ajax.PeriodicalUpdater($('HomePage_Photos'),'action_ChangePhotoHomePage.php',
	{
		method: 'post',
		frequency: 5,
		decay: 1
	});
	
	//ligne des users connectés au site
	new Ajax.PeriodicalUpdater($('TopMsgAdmin'),'action_ChangeTopMsgAdmin.php',
	{
		method: 'post',
		frequency: 60,
		decay: 1
	});
}


function creationIndicateurtop(){
	new Insertion.Top($('chargementajax'), '<div id="chargement" style="display: none;"><img src="interface/loading.gif" align="absmiddle" height="19" /></div>');
}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

