var slideVal = document.getElementById("SlidePopup").value;

if(slideVal=='0') {
	//document.write ("<DIV id=PText style='z-index:99;left:10px;top:10px'></DIV>");
	document.write("<DIV id=SlideDIV ></DIV>");
	document.getElementById('SlideDIV').style.visibility = 'visible';
	document.getElementById("Diapo").style.visibility='visible';
	
	function next() {
		numsav=num;
		num= Math.floor( Math.random()*(nb_img-1) );
		if(num==numsav && num<nb_img) num=num+1;

		if(next_img.src != rep+tabImgSave[num].Img) {
			next_img = new Image;
			next_img.src = rep+tabImgSave[num].Img;
		}
		myCounter = setTimeout("launch()", 500*Tempo_img);
	}

	function launch() {
		//document.getElementById("PText").innerHTML = num+" - "+numsav;
		document.getElementById("SlideDIV").innerHTML = "<a href='"+tabImgSave[num].Url+"'><img id=SlideImg src='"+next_img.src+"' border=1 height=148 >"+tabImgSave[num].Title+"</a>";
		next();
	}
	
	function stop() { alert("STOP");clearTimeout(myCounter);num = 0;}
}

//*************************SlidePopup*******************
if(slideVal=='1') {
	
	/* 
 SCRIPT EDITE SUR L'EDITEUR JAVASCRIPT
 http://www.editeurjavascript.com
 */
 /* Detection du navigateur */
 function browserVersionDetect() { 
	this.ver=navigator.appVersion;
	this.vnum=navigator.appVersion.split(" ")[0];
	this.bwfamily = navigator.appName;
	this.ie6=(this.ver.match(/MSIE 6/))?1:0;
	this.ie5=(this.ver.match(/MSIE 5/))?1:0; 
	this.ie4=(this.ver.match(/MSIE 4/))?1:0; 
	this.ns5=((this.bwfamily.match(/Netscape/)) && (this.vnum.match(/^5\.\d+(\.\d+)*$/)))?1:0; 
	this.ns4=((this.bwfamily.match(/Netscape/)) && (this.vnum.match(/^4\.\d+(\.\d+)*$/)))?1:0;
	this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns5 || this.ns4);
	return this;
}
 var na = browserVersionDetect();
 slide_url_image = document.getElementById("SNM").value;
 slide_url_click = document.getElementById("SID").value;

 var color1="#F5E100";var color2="#025AC8";var color3="#000099";var image="img/box_pub.png"
 if (slide_url_image!="") {
 if(!document.all && document.getElementById)
         ejs_hauteur = window.innerHeight-500;
 else
         //ejs_hauteur = document.body.clientHeight-500;
		 ejs_hauteur = 300;
 
 document.write('<style type="text/css">\n');
 document.write('#ejs_slide_box ');
 document.write('	{');
 document.write('	z-index:10;');
 document.write('	position:absolute;');
 document.write('	-moz-border-radius: 20px;');
 document.write('	width:280px;');
 document.write('	height:220px;');
 document.write('	top:'+ejs_hauteur+'px;');
 document.write('	left:-262px;');
 //document.write('	background-color:'+color1+';');
 //document.write('	background-image:URL('+image+');');
 //document.write('	border-color:'+color2+';');
 //document.write('	border-width:1px;');
 //document.write('	border-style:solid;');
 document.write('	}\n');
 
 document.write('#ejs_slide_bouton ');
 document.write('	{');
 document.write('	position:absolute;');
 document.write('        color:'+color3+';');
 document.write('	-moz-border-radius: 20px;');
 document.write('	top:5px;');
 document.write('	left:265px;');
 document.write('	background-color:'+color1+';');
 document.write('	font-family:arial;');
 document.write('	font-weight:bold;');
 document.write('	text-decoration:none;');
 document.write('	font-size:15px;');
 document.write('	}\n');
 
 document.write('#ejs_slide_image ');
 document.write('	{');
 document.write('	position:absolute;');
 document.write('	z-index:10;');
 document.write('	-moz-border-radius: 20px;');
 document.write('	WIDTH:250px;');
 document.write('	top:20px;');
 document.write('	left:10px;');
 //document.write('	border-color:#000000;');
 //document.write('	border-width:1px;');
 //document.write('	border-style:solid;');
 document.write('	}\n');
 
 document.write('.ejs_slide_blanc\n');
 document.write('	{\n');
 document.write('	color:'+color3+';');
 document.write('	font-family:arial;');
 document.write('	font-weight:bold;');
 document.write('	text-decoration:none;');
 //document.write('	font-size:15px;');
 document.write('	}');
 document.write('</style>');
 
 var slide_tempo;
 slide_x = -262;
 slide_ismoving = false;
 slide_first = true;
 
 function slide_start()
 	{
 	if(slide_x == -262 && !slide_ismoving){
 		if (document.getElementById("Entete").value=="home") {
		slide_deballe();
		} else  {
		slide_first = false;}
	} else {(!slide_ismoving)
 		slide_remballe();}
 	}
 
 function slide_deballe()
 	{
 	slide_ismoving = true;
 	if(slide_x < 10)
 		{
 		slide_x += 5;
 		slide_move();
 		setTimeout("slide_deballe()", 10);
 		}
 	else
 		{
 		slide_ismoving = false;
 		if(slide_first)
 			slide_tempo = setTimeout("slide_start()", 2000);
 		slide_first = false;
 		}	
 	}
 
 function slide_remballe()
 	{
 	clearTimeout(slide_tempo);
 	slide_ismoving = true;
 	if(slide_x > -262)
 		{
 		slide_x -= 5;
 		slide_move();
 		setTimeout("slide_remballe()", 10);
 		}
 	else
 		slide_ismoving = false;
 	}
 
 function slide_move()
 	{
 	if(document.getElementById)
 		{
 		document.getElementById("ejs_slide_box").style.left=slide_x+'px';
		//document.getElementById("ejs_slide_image").style.left=slide_x+10+'px';
 		}
 	}
 
 function slide_close()
 	{
 	if(document.getElementById)
 		{
 		document.getElementById("ejs_slide_box").innerHTML = '';
 		document.getElementById("ejs_slide_box").style.top = -100;
 		document.getElementById("ejs_slide_box").style.left = -100;
 		document.getElementById("ejs_slide_box").style.width = 1;
 		document.getElementById("ejs_slide_box").style.height = 1;
 		}
 	}
 
 
 document.write('<div id="ejs_slide_box" style=z-index:1000">');
 document.write('<table width="100%" height="100%" style="background-image:url(../../js/commun/+image+)"><tr><td>&nbsp;</td></tr></table>');
 document.write('<div id="ejs_slide_bouton"><td><img src="../../js/commun/img/arrow_right11.gif" border=0 onclick="slide_deballe();return(false)"><br /><img src="../../js/commun/img/arrow_left11.gif" border=0 onclick="slide_start();return(false)"><br /><a href="#" onclick="slide_close();return(false)" class="ejs_slide_blanc"><img src="../../js/commun/img/close11.gif" border=0></a></td></div>');
if (slide_url_image!="img/no_photo.png") {
 document.write('<div id="ejs_slide_image"><table width="250"><td align=center valign=middle><a href="../../js/commun/'+slide_url_click+'" target="_self"><img src="../../js/commun/'+slide_url_image+'" width="250" border=0 ></a></td></table></div>');
} else {
 document.write('<div id="ejs_slide_image"><table width="250" height="190"><td align=center valign=middle><a href="../../js/commun/'+slide_url_click+'" target="_self"><img src="../../js/commun/'+slide_url_image+'" border=0 ></a></td></table></div>');
}
 document.write('</div>');
 //window.onload = cacheOff();
 if (na.ns5) { window.onload = slide_start;window.onload = cacheOff();}
 }
 
}