<!--//--><![CDATA[//><!--
 sfHover = function() {
	 var sfEls = document.getElementById("menu").getElementsByTagName("LI");
	 for (var i=0; i<sfEls.length; i++) {
	 	 sfEls[i].onmouseover=function() {this.className+=" sfhover";}
		 sfEls[i].onmouseout=function()  {this.className=this.className.replace(new RegExp(" sfhover\\b"), "");}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]>

function ajax_maj(f,imgid,rub,limit) {
    document.getElementById('messageChargement').style.display = 'block';
	var XHR = new XHRConnection();
	XHR.setRefreshArea('contenu');
	XHR.sendAndLoad("../pages/phototheque.php?ajax=1&f="+f+"&imgid="+imgid+"&rub="+rub+"&limit="+limit, "GET");
	return true;
}

function chig(iaa,mode)
{
	if (mode == 1)
	{document.getElementById(iaa).style.backgroundPosition='left bottom';}
	else if (mode == 0)
	{document.getElementById(iaa).style.backgroundPosition='left top';}
}

 function cacher(partie)
{ if(document.getElementById)
document.getElementById(partie).style.display = 'none'
}
function afficher(partie)
{ if(document.getElementById)
document.getElementById(partie).style.display = 'block'
}

function cachertout()
{
 cacher('v2');
 cacher('v3');
 cacher('v4');
 cacher('v5');
 cacher('v6');
 cacher('v7');
}
function activer(partie)
{ 
 cachertout();
 afficher(partie); 
}

// Affichage d'un indicateur de chargement - Pour Prototype.js
// Parametre : showindicator="nom_cadre_a_afficher". 

Ajax.Responders.register({
  onCreate: function() {
    if(Ajax.activeRequestCount>0 && showindicator) $(showindicator).style.display = 'block';
  },
  onComplete: function() {
    if(Ajax.activeRequestCount==0 && showindicator) $(showindicator).style.display = 'none';
	showindicator = '';
  }
});

// Change le style des onglets

function changestyle(id,listeOnglets)
{
	for(i = 0; i < listeOnglets.length; i++) {
		listeOnglets[i].style.background = '#e3f8e9';
		listeOnglets[i].style.border = '1px solid #000000';
	}
	$(id).style.background = '#74d190';
	$(id).style.borderBottom = '1px solid #74d190';	
}
