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

function survol(img,mode){
 var flip=(mode=='surv')?"'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++;
  }
 }
}


function findObj(n) {
	var x, d=document;
	if(!(x=d[n])&&d.all) x=d.all[n];
	if(!x && d.getElementById) x=d.getElementById(n);
	return x;
}
document["temp_layer"]=false;
function ShowHide(div,x,y,decalx,decaly){
	if(document["temp_layer"]) findObj(document["temp_layer"]).style.visibility="hidden";
	if(!div) {document["temp_layer"]=false; return;}
	document["temp_layer"]=div;
	var layer=findObj(div);
	layer.style.visibility="visible";
	if(decalx) x+=decalx;
	if(decaly) y+=decaly;
	if(x){layer.style.left = x+"px";}
	if(y){layer.style.top = y+"px";}
}

function getPos(obj){
var pos=[0,0];// x y witdh height
 while(obj.tagName!='BODY'){
 pos[0]+=obj.offsetLeft;
 pos[1]+=obj.offsetTop;
  if(!obj.offsetParent) break;
 obj=obj.offsetParent;
 }
return pos
}

function affiche_s_type(obj,div){
	obj.coord=getPos(obj);
	ShowHide(div,obj.coord[0],obj.coord[1],0,20-(findObj(div).offsetHeight) );
}

onload=function(){prelod();}
