window.onload=init;
function init() {
	affdate();
	startList("menu","a")
	startList("menug","b")
	startList("listesalle","c")
	if (courmenu!="") {
		o=_gel("i"+courmenu);
		if(o) roll(o,"on");
	}
	if (courgmenu!="") {
		o=_gel(courgmenu);
		if (o) o.className="on";
	}
}
var courmenu="";
var courgmenu="";

function startList(n,t) {
	if (document.getElementById) {
		navRoot = _gel(n);
		node = navRoot;//getnextnode(navRoot);
		while (node) {
			node = getnextnode(navRoot,node);
			if (node) {
				if (node.nodeName=="LI") {
					if (t=="b") {
						node.onmouseover=function() {
							this.className="on";
						}
						node.onmouseout=function() {
							if(this.id!=courgmenu) this.className="";
						}
					}else{
						 if (t=="c") {
							node.onmouseover=function() {
								this.className="on";
								o=document.getElementById("i"+this.id);
								oo=document.getElementById("rollvisite");
								if (o && oo) oo.innerHTML="<table><tr><td>"+o.title+"</td></tr></table>";
							}
							node.onmouseout=function() {
								if(this.id!=courgmenu) this.className="";
								o=document.getElementById("i"+this.id);
								oo=document.getElementById("rollvisite");
								if (o && oo) oo.innerHTML="<table><tr><td>Survolez les vignettes pour lire le nom des salles</td></tr></table>";
							}
						}else{
							node.onmouseover=function() {
								o=document.getElementById("i"+this.id);
								if (o) roll(o,'on');
							}
							node.onmouseout=function() {
								o=document.getElementById("i"+this.id);
								if (o) roll(o,'off');
							}
						}
					}
				}
			}
		}
	}
}



function affdate() {
	o=_gel("ladate");
	if (o) {
		d = new Date();
		j=d.getDate();
		if (j<10) {j="0"+j;}
		m=d.getMonth()+1;
		if (m<10) {m="0"+m;}
		h=d.getHours();
		if (h<10) {h="0"+h;}
		n=d.getMinutes();
		if (n<10) {n="0"+n;}
		s=d.getSeconds();
		if (s<10) {s="0"+s;}
		o.innerHTML=" - "+j+"/"+m+"/"+d.getFullYear();	//+" "+h+":"+n+":"+s;
	}
}

function _gel(o) {
	oo=false;
	if (document.getElementById) {
		oo=document.getElementById(o);
	}else{
		if (document.all) oo=eval("document.all"+o);
	}
	return oo;
}

function getnextnode(source,o) {
	if (!o) return false;
	oo=false;
	if (o.firstChild) return o.firstChild;
	if (o.nextSibling) return o.nextSibling;
	o=o.parentNode;
	while (!oo && o && (o!=source)) {
		oo=o.nextSibling;
		o=o.parentNode;
	}
	return oo;
}

function position(o,s) {
	l=0;
	t=0;
	while (o) {
		l+=o.offsetLeft;
		t+=o.offsetTop;
		o=o.offsetParent;
	}
	r=(s==0) ? l:t;
	return r;
}

function opennamedwin(URL, Nom, WW, HH, LL, TT) {

	var h=600;
	var w = 230;
	var t=0;
	var l = 0;
	self.window.name="Peugeot";
	var Aide="";
	if (Nom=="") {Nom="Aide";}
	if (WW) {w=WW;}
	if (HH) {h=HH;}
	if (LL) {l=LL;}
	if (TT) {t=TT;}

	Aide=window.open("", Nom,"resizable=yes,scrollbars=yes,toolbar=no,status=no,width=" + w + ",height=" + h + ",top=" + t + ",left=" + l);
	Aide.window.moveTo(l,t);
	Aide.location=URL;
	Aide.focus();

}

function closewin() {
	if (self.opener) {
		self.opener.focus();
		self.close();
	}else{
		alert("La page n'a pas été ouverte dans une fenêtre popup");
	}
}

function roll(o,s) {
	ss=(s=='on') ? "off":"on";
	if (o.id=="i"+courmenu && s=="off") return;
	if (o) o.src=o.src.replace("_"+ss+".","_"+s+".");
}

function homeactu(sens) {
	o=_gel("homeactu");
	t=(sens) ? "block":"none";
	if (o) o.style.display=t;
}

function PlayVideo(picture,duree){
	//picto = picture;
	wi=360;
	hi=360;
	titre="VideoPlayer";
	if (! duree) duree=30;
	if (isNaN(duree)) duree=30;
	stats="toolbar=no,location=no,directories=no,status=no,menubar=no," ;
	stats += "resizable=yes,width=" + wi + ",height="+hi ;
	imgwin = window.open ("/vinclude/playvideo.php?v="+picture+"&d="+duree,titre,stats);
	imgwin.focus();
	//window.setTimeout("makepagevideo('"+picture+"',"+duree+")",100) ;
}