
if(window.opener){ 
fenOuvrante=window.opener; 
fenOuvrante.name='maman'; }

function survol(img,mode){
 var flip=s?"'norm','surv'":"'surv','norm'";
 document[img].src=eval("document['"+img+"'].src.replace("+flip+")");
}

function ouvrirPage(page,t,l,w,h){
  window.open(page,"mafen","toolbar=0,menubar=0,scrollbars=1,resizable=1,location=0,directories=0,top="+t+",left="+l+",width="+w+",height="+h);
}

function newsletter(){//alert(document.inscrire.mail.value)
var mail=String(document.form1.mail.value);
regEmail=/^([a-z]([_\.0-9a-z-]+)?@)([a-z]([_\.0-9a-z-]+)?\.)([a-z]{2,4})$/i;
  if(regEmail.test(mail)){
  finscription=window.open("","inscription","top=50,left=50,width=401,height=171,resizable=1,scrollbars=0,toolbar=0,menubar=0,location=0,directories=0");
  document.form1.target="inscription";
  document.form1.action="../inscription_newsletter.php";
  document.form1.submit();
  document.form1.target="";
  document.form1.action="";
  }else{alert("\n\nInscrivez une adresse valide!\n\n");}
}

function prelod(){
var d=document ,di=d.images, im=new Array();
 for(var i=0,j=0;i<di.length;i++){
  if(di[i].src.indexOf("_norm.")!=-1){
   im[j]= new Image();
   im[j].src=di[i].src.replace("_norm.", "_surv.");
    if(!di[i].onmouseover){
	di[i].onmouseover=Function("this.src=this.src.replace('_norm.','_surv.')");di[i].onmouseout=Function("this.src=this.src.replace('_surv.','_norm.')")
	}
   j++;
  }
 }
}

//Calendrier
function calendrier(field){
	o=document.fglobal;
	ladate=o.elements[field].value;
	calendarField=field;
	var vtmp = new Array(3);
	if(ladate == "")
	{	today = new Date();
		vtmp[0] = today.getDay();
		vtmp[1] = today.getMonth()+1;
		vtmp[2] = today.getYear();
		if(vtmp[2] < 1000) vtmp[2]+=1900;
	}else{
		vtmp=ladate.split("/");
	}
	window.open("../../_include/calendrier.php?y=" + vtmp[2] + "&m=" + vtmp[1] + "&d=" + vtmp[0],"calendrier","width=180,height=200,scrollbars=no,left=200,top=150");
}

function retourDate(dat){
	o=document.fglobal;
	el=o.elements[calendarField];
	el.disabled=false;
	el.value=dat;
	el.disabled=true;
	calendarField="";
	change_from = true;	//Variable pour changement de la médiathèque
	o.EVENEMENT.selectedIndex = 0;
}

onload=function(){prelod();}





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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

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

