function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

/*function InfoBulle(Texte){
	spanInfo = MM_findObj("spanInfoBulle");
	spanInfo.innerHtml = Texte;

	divInfo = MM_findObj("divInfoBulle");
	divInfo.style.visibility = "visible";
}*/
var InfoBulleX = 0;
var InfoBulleY = 0;
var AideX = 0;
var AideY = 0;
var scrollTop = "";
function LayerPos(evenement)
{
	scrollTop=document.body.scrollTop;
	 if (window.netscape) {
		InfoBulleX = evenement.pageX;		
		InfoBulleY = evenement.pageY;
		AideX = evenement.pageX;		
		AideY = evenement.pageY;
	 }
	 
	 else
	 {
		
		if(document.documentElement.scrollTop){
		InfoBulleX = window.event.x+document.documentElement.scrollLeft;
		InfoBulleY = window.event.y+document.documentElement.scrollTop;
		 }else{  
		InfoBulleX = window.event.x+document.body.scrollLeft;
		InfoBulleY = window.event.y+document.body.scrollTop;
		AideX = window.event.x+document.body.scrollLeft;
		AideY = window.event.y+document.body.scrollTop;
		 }
		 
		
	 }       
}
document.onmouseup = LayerPos;
document.onmousemove = LayerPos;
function InfoBulle(Texte){
	spanInfo = MM_findObj("spanInfoBulle");
	spanInfo.innerHTML = Texte.replace(/##/g,'<br>');
	divInfo = MM_findObj("divInfoBulle");
	if(InfoBulleX >= 730) {
		InfoBulleX=730;
		InfoBulleY=InfoBulleY+5;
	}
	MM_findObj("divInfoBulle").style.left = InfoBulleX+"px";
	MM_findObj("divInfoBulle").style.top = InfoBulleY+"px";
	divInfo.style.visibility = "visible";
}
function FermerInfoBulle(){
	divInfo = MM_findObj("divInfoBulle");
	divInfo.style.visibility = "hidden";
}

function Aide(val,Texte){
	
	spanAideF = MM_findObj("spanAide"+val);
	spanAideF.innerHTML = Texte.replace(/##/g,'<br>');
	
	divAideF = MM_findObj("divAide"+val);	
//	MM_findObj("divAide").style.left = AideX+20;
//	MM_findObj("divAide").style.top = AideY-50;
	divAideF.style.display = 'block';
}
function FermerAide(val){
	divAideF = MM_findObj("divAide"+val);
	divAideF.style.display = 'none';
}

function expandMenu(id) {
	if (document.getElementById("itemMenu_"+id).className == 'plie') {
		document.getElementById("itemMenu_"+id).className = 'deplie'
	}
	else {
		document.getElementById("itemMenu_"+id).className = 'plie'
	}
}

function expandBanner(banner){
		//document.getElementById(banner).style.display="block";	
}
function closeBanner(banner){
		document.getElementById(banner).style.display="none";	
}

var xmlHttp;
var contenu;
var dest;

function requeteContenu (url)
{
	if (window.XMLHttpRequest) {
      xmlHttp = new XMLHttpRequest();
			xmlHttp.onreadystatechange = processReqContenu;
			xmlHttp.open("GET", url, true);
			xmlHttp.send(null);
	// pour IE
	} else if (window.ActiveXObject) {
			xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
			if (xmlHttp) {
					xmlHttp.onreadystatechange = processReqContenu;
					xmlHttp.open("GET", url, true);
					xmlHttp.send();
			}
	}
}
	
function processReqContenu() {
	// Erreur
	if (xmlHttp.readyState == 4) {
		if (xmlHttp.status == 200)
		{
			contenu = xmlHttp.responseText;	
			document.getElementById(dest).innerHTML = contenu;
		}
	}
}

function PopupDiv(id){
	document.getElementById('contientReceptPopup').style.display="block";
	dest = 'receptPopup';
	requeteContenu ('Popup.aspx?IdRessource='+id);	
}

function PopupDivClose(){
	document.getElementById('contientReceptPopup').style.display="none";
	
}