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_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_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_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];}
}


/* ### FONCTION MENU ### */

	function pop(obj) {
		var o_div = document.getElementById(obj);
		if (o_div.style.display != 'block') {
			o_div.style.display = 'block';
		} else {
			o_div.style.display = 'none';
		}
		//o_div.style.display = (o_div.style.display != 'block') ? 'block' : 'none';
	}
	function f_on(v_calque) {
		document.getElementById(v_calque).style.visibility = "visible";
	}
	function f_off(v_calque) {
		document.getElementById(v_calque).style.visibility = "hidden";
	}

/* ### FONCTION POPUP ### */
  var selObj = null;
//init


 /* 
function OldShowPopUP(PopUpId) {
      if (PopupMainID.style.display=='block') { 
PopupMainID.style.display='none';
document.getElementById(PopUpId).style.display='none';		 
      } else { 
PopupMainID.style.background='url(img_mep/content/bkg_popup/bkg_popup_265x470_'+PopUpId+'.gif)';
PopupMainID.style.display='block';
document.getElementById(PopUpId).style.display='block';
var currentContent = PopUpId;
      }
   }
 */   
 
/* */
var currentContent = null;
function ShowPopUP(PopUpId) { /* open popup */
 if (currentContent!= null) {
	 
	 //closePopUP();  //currentContent
	 //openPopUP(PopUpId);
	 var urlToReload ="http://"+location.host+location.pathname+"?ShowPopUP="+PopUpId;
window.location.replace(urlToReload);	 
   } else {
	 //openPopUP(PopUpId);	   
	 var urlToReload ="http://"+location.host+location.pathname+"?ShowPopUP="+PopUpId;
window.location.replace(urlToReload);
   }
}
/* close popup */
function OldclosePopUP() { //currentContent
//document.getElementById(currentContent).innerHTML='';		
document.getElementById(currentContent).style.display='none';		
PopupMainID.style.display='none';
//alert(currentContent +'doit etre close');
currentContent = null;
}

function closePopUP() { //currentContent
//var urlToReload ="http"+location.host+location.pathname;
var urlToReload ="http://"+location.host+location.pathname;
window.location.replace(urlToReload);
//currentContent = null;
}


function openPopUP(PopUpId) {
PopupMainID.style.background='url(http://www.bruno-saint-hilaire.com/EN/img_mep/content/bkg_popup/bkg_popup_265x470_'+PopUpId+'.gif)';
PopupMainID.style.display='block';
document.getElementById(PopUpId).style.display='block';
currentContent = PopUpId;
}



/* */



   function moveHandler(e){
      if (e == null) { e = window.event } 
      if (e.button<=1&&dragOK){
         selObj.style.left=e.clientX-dragXoffset+'px';
         selObj.style.top=e.clientY-dragYoffset+'px';
         return false;
      }
   }

   function cleanup(e) {
      document.onmousemove=null;
      document.onmouseup=null;
      selObj.style.cursor=orgCursor;
      dragOK=false;
   }

   function dragHandler(e){
      var htype='-moz-grabbing';
      if (e == null) { e = window.event; htype='move';} 
      var target = e.target != null ? e.target : e.srcElement;
      selObj=target;
      orgCursor=target.style.cursor;
      if (target.className=="PopupMainFrame") {
         target.style.cursor=htype;
         dragOK=true;
         dragXoffset=e.clientX-parseInt(selObj.style.left);
         dragYoffset=e.clientY-parseInt(selObj.style.top);
         document.onmousemove=moveHandler;
         document.onmouseup=cleanup;
         return false;
      }
   }
	 
	 document.onmousedown=dragHandler;

//Default browsercheck, added to all scripts!
function checkBrowser(){
	this.ver=navigator.appVersion
	this.dom=document.getElementById?1:0
	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom)?1:0;
	this.ie4=(document.all && !this.dom)?1:0;
	this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0;
	this.ns4=(document.layers && !this.dom)?1:0;
	this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5)
	return this
}
bw=new checkBrowser()
//With nested layers for netscape, this function hides the layer if it's visible and visa versa
	 
/* showHide */
function showHide(div,nest){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
	if(obj.visibility=='visible' || obj.visibility=='show') obj.visibility='hidden'
	else obj.visibility='visible'
}
function showHide2(div,nest){
	obj=bw.dom?document.getElementById(div).style:bw.ie4?document.all[div].style:bw.ns4?nest?document[nest].document[div]:document[div]:0;
	if(obj.display=='block' || obj.display=='show') obj.display='none'
	else obj.display='block'
}
/* Alert javascript en cours d integration */
function AlertEnCoursIntegration (){
alert('Rubrique en cours d\'integration/developpement.');
}