// JavaScript Document
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];}
}
var Objfenetre;
function F_open (url,w,h){
	if (Objfenetre!=null) {
		Objfenetre.close();
	}
	if (parent.parent && parent.parent.visioneuse) {
		parent.location.href=url;
	} else {
		Objfenetre = window.open(url, "winTools", "width="+w+", height="+h+", top=200, left=200, scrollbars=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes");
		Objfenetre.focus();
	}
}

function setOpacity(cur,which)
{
if(document.getElementById)
	{
	if (which==0)
		{
		if(document.all)
			cur.filters.alpha.opacity=100
		else
			cur.style.setProperty("-moz-opacity", 1, "");
		}
	else
		{
		if(document.all)
			cur.filters.alpha.opacity=40
		else
			cur.style.setProperty("-moz-opacity", .4, "");
		}
	}
}

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 showDiv(nom) {
		el = MM_findObj(nom);
		el.style.display = '';
	}
	
	function hideDiv(nom) {
		el = MM_findObj(nom);
		el.style.display = 'none';
	}
	
	function changeImages() {
		if (document.images) {
			for (var i=0; i<changeImages.arguments.length; i+=2) {
				document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
			}
		}
	}
	
/* affichage menu divers */
	//sens : left, top, right, bottom
	function showDivMenu(nom, width, heightmax, sens) { 
		var height;
		var time;
		var left=0;
		var z=0;
		if (sens=='top') {
			height=heightmax;
			while (height>=0) {
				time=6*z;
				window.setTimeout('deroule("'+nom+'", '+width+', '+height+', '+heightmax+', '+left+');',time);
				height=height-2;
				z++;
			}
		}
		else if (sens=='bottom') {
			height=0;
			while (height<=heightmax) {
				time=6*z;
				window.setTimeout('deroule("'+nom+'", '+width+', 0, '+height+', '+left+');',time);
				height=height+2;
				z++;
			}
		}
		else if (sens=='right') {
			var widthmin=0;
			
			while (widthmin<=width) {
				time=6*z;
				window.setTimeout('deroule("'+nom+'", '+widthmin+', 0, '+heightmax+', '+left+');',time);
				widthmin=widthmin+2;
				z++;
			}
		}
		else if (sens=='left') {
			widthmax=width;
			while (width>=0) {
				time=6*z;
				window.setTimeout('deroule("'+nom+'", '+widthmax+', 0, '+heightmax+', '+width+');',time);
				width=width-2;
				z++;
			}
		}
	}
	
	function hideDivMenu(nom, width, heightmax, sens) { 
		var height;
		var time;
		var left=0;
		var z=0;
		 if (sens=='bottom') {
			height=0;
			while (height<=heightmax) {
				time=6*z;
				window.setTimeout('deroule("'+nom+'", '+width+', '+height+', '+heightmax+', '+left+');',time);
				height=height+2;
				z++;
			}
		}
		else if (sens=='top') {
			height=heightmax;
			while (height>=0) {
				time=6*z;
				window.setTimeout('deroule("'+nom+'", '+width+', 0, '+height+', '+left+');',time);
				height=height-2;
				if (height<=0) window.setTimeout('deroule("'+nom+'", '+width+', 0, '+height+', '+left+');',time);
				z++;
			}
		}
		else if (sens=='left') {
			var widthmax=width;
			while (widthmax>=0) {
				time=6*z;
				window.setTimeout('deroule("'+nom+'", '+widthmax+', 0, '+heightmax+', '+left+');',time);
				widthmax=widthmax-2;
				z++;
			}
		}
		else if (sens=='right') {
			var widthmax=0;
			while (widthmax<=width) {
				time=6*z;
				window.setTimeout('deroule("'+nom+'", '+width+', 0, '+heightmax+', '+widthmax+');',time);
				widthmax=widthmax+2;
				z++;
			}
		}
	}
	
	function deroule(nom, right, top, bottom, left) {
		el = MM_findObj(nom);
		el.style.clip='rect('+top+'px '+right+'px '+bottom+'px '+left+'px)';
	}
	
	function affichePopVideo(id)
	{
		window.open("pop_video.php?id="+id,"popvideo","directories=no,location=no,menubar=no,resizable=no,scrollbars=no,status=no,toolbar=no,width=683,height=672");	
	}