// JavaScript Document
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
	// depl : 0,1 (0=> le div se laisse decouvrir; 1=> le div se déplace en meme temps que l'apparition)
	function showDivMenu(nom, width, heightmax, sens, depl, bordure, vitesse) { 
		var time;
		var left=0;
		var z=0;
		var unitMove=vitesse;
		var action='';
		var el = MM_findObj(nom);
		
		if (sens=='top') {
			var evolution=Math.abs(parseInt(el.style.top));
			while (evolution<heightmax-bordure) {
				time=6*z;
				action='moveDiv( "'+nom+'", -'+evolution+', '+parseInt(el.style.left)+', '+width+', 0, '+(evolution+bordure)+', 0); ';
				window.setTimeout(action,time);
				evolution=evolution+unitMove;
				z++;
			}
		}
		else if (sens=='bottom') {
			var evolution=Math.abs(parseInt(el.style.top));
			while (evolution>=0) {
				time=6*z;
				action='moveDiv( "'+nom+'", -'+(evolution)+', '+parseInt(el.style.left)+', '+width+', '+evolution+', '+heightmax+', 0); ';
				window.setTimeout(action,time);
				evolution=evolution-unitMove;
				z++;
			}
		}/*
		else if (sens=='right') {
			var widthmin=0;
			
			while (widthmin<=width-bordure) {
				time=6*z;
				if (depl!=1) action='deroule("'+nom+'", '+widthmin+', 0, '+heightmax+', '+left+'); ';
				else action='deroule("'+nom+'", '+width+', '+height+', '+heightmax+', '+left+'); ';
				if (depl==1) action=action+'moveDiv("'+nom+'", 0, '+unitMove+'); ';
				window.setTimeout(action,time);
				widthmin=widthmin+unitMove;
				z++;
			}
		}
		else if (sens=='left') {
			var widthmax=width;
			while (width>=bordure) {
				time=6*z;
				if (depl!=1) action='deroule("'+nom+'", '+widthmax+', 0, '+heightmax+', '+width+'); ';
				else action='deroule("'+nom+'", '+width+', '+height+', '+heightmax+', '+left+'); ';
				if (depl==1) action=action+'moveDiv("'+nom+'", 0, -'+unitMove+'); ';
				window.setTimeout(action,time);
				width=width-unitMove;
				z++;
			}
		}*/
	}
	
	function hideDivMenu(nom, width, heightmax, sens, depl, bordure, vitesse) { 
		var height;
		var time;
		var left=0;
		var unitMove=vitesse;
		var action='';
		var z=0;
		var el = MM_findObj(nom);
		
		if (sens=='bottom') {
			var evolution=Math.abs(parseInt(el.style.top));
			while (evolution>=0) {
				time=6*z;
				action='moveDiv( "'+nom+'", -'+evolution+', '+parseInt(el.style.left)+', '+width+', 0, '+(evolution+bordure)+', 0); ';
				window.setTimeout(action,time);
				evolution=evolution-unitMove;
				z++;
			}
		}
		else if (sens=='top') {
			var evolution=Math.abs(parseInt(el.style.top));
			while (evolution<heightmax-bordure) {
				time=6*z;
				action='moveDiv( "'+nom+'", -'+(evolution)+', '+parseInt(el.style.left)+', '+width+', '+evolution+', '+heightmax+', 0); ';
				window.setTimeout(action,time);
				evolution=evolution+unitMove;
				z++;
			}
		}/*
		else if (sens=='left') {
			var widthmax=width;
			while (widthmax>=bordure) {
				time=6*z;
				if (depl!=1) action='deroule("'+nom+'", '+widthmax+', 0, '+heightmax+', '+left+'); ';
				else action='deroule("'+nom+'", '+width+', '+height+', '+heightmax+', '+left+'); ';
				if (depl==1) action=action+'moveDiv("'+nom+'", 0, '+unitMove+'); ';
				window.setTimeout(action,time);
				widthmax=widthmax-unitMove;
				z++;
			}
		}
		else if (sens=='right') {
			var widthmax=0;
			while (widthmax<=width-bordure) {
				time=6*z;
				if (depl!=1) action='deroule("'+nom+'", '+width+', 0, '+heightmax+', '+widthmax+'); ';
				else action='deroule("'+nom+'", '+width+', '+height+', '+heightmax+', '+left+'); ';
				if (depl==1) action=action+'moveDiv("'+nom+'", 0, -'+unitMove+'); ';
				window.setTimeout(action,time);
				widthmax=widthmax+unitMove;
				z++;
			}
		}*/
	}
	
	function deroule( nom, right, top, bottom, left) {
		var objetDiv = MM_findObj(nom);
		objetDiv.style.clip='rect('+top+'px '+right+'px '+bottom+'px '+left+'px)';
	}

	function moveDiv( nom, vert, hor, right, top, bottom, left) {
		var objetDiv = MM_findObj(nom);
		objetDiv.style.left=hor;
		objetDiv.style.top=vert;
		objetDiv.style.clip='rect('+top+'px '+right+'px '+bottom+'px '+left+'px)';
		
		//window.status=objetDiv.style.left+objetDiv.style.top+(bottom-top);
	}	