
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;
	o.EVENEMENT.selectedIndex = 0;
	date_evenement(0);
	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
}

onload=function(){prelod();}

