window.onload=startList;
function startList() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("menu");
		node = navRoot;//getnextnode(navRoot);
		while (node) {
			node = getnextnode(navRoot,node);
			if (node) {
				if (node.nodeName=="LI") {
					node.onmouseover=function() {
						this.className+=" menuover";
					}
					node.onmouseout=function() {
						this.className=this.className.replace(" menuover", "");
					}
				}
			}
		}
	}
	initrec();
}

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;
}

// ******************** popup poster *************		 	
	picto="";
	function AffImage(pictureposter){
		picto = pictureposter;
		wi=100;
		hi=100;
		titre="Poster";
		legendetex="";
		stats="toolbar=no,location=no,directories=no,status=no,menubar=no," ;
		stats += "resizable=yes,left=0,top=0,width=" + wi + ",height="+hi ;
		imgwin = window.open ("",titre,stats);
		window.setTimeout("makepage(picto,legendetex)",100) ;
	}
	function makepage(pic,legendetexx){
	legendetexxx=legendetexx;
	if (legendetexxx=="") espace=0;
	else espace=85;
		imgwin.document.clear();
		imgwin.document.write("<head><title>Poster</title>");
		imgwin.document.write("<s"+"cript language='Java"+"Script'>function resizeme(){picheight=document.images['posterpic'].height+20;picwidth=document.images['posterpic'].width;this.window.resizeTo(picwidth+20,picheight+40+"+espace+");}<"+"/s"+"cript>");
		imgwin.document.write("</head><body style='margin:0;' bgcolor='Black' text='White' onload='window.setTimeout(\"resizeme();\",100);'><center><table><tr><td>");
		imgwin.document.write("<a href='#' onclick='if (self.opener) self.opener.focus();self.close();'><img name='posterpic' align='absmiddle' src='"+pic+"' border='0' alt=''></a>");
		imgwin.document.write("</td></tr><tr><td><center><font face='Verdana,Geneva,Arial,Helvetica,sans-serif' size=2>"+legendetexxx+"</font></center></td></tr></table></center></body>");
		imgwin.document.close();
		imgwin.focus();
	}
// ******************** fin popup poster *************

function printdoc() {
	opennamedwin('about:blank','imprime',600,400,0,0);
	document.forms.print.doc.value=document.body.innerHTML;
	document.forms.print.submit();
}

function _opennamedwin(URL, Nom, WW, HH, LL, TT) {

	var h=600;
	var w = 230;
	var t=0;
	var l = 0;
	self.window.name="Waaps";
	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 + "px,height=" + h + "px,top=" + t + ",left=" + l);
	Aide=window.open("", Nom,"width="+w+",resizable=yes,scrollbars=yes,toolbar=no,status=no");
	Aide.window.moveTo(l,t);
	Aide.location=URL;
	Aide.focus();

}

//******************************************************************************************************
function opennamedwin( URL, Nom, WW, HH ) {
//******************************************************************************************************
 
  if (typeof(WW) == 'undefined') {
    WW = "";
  } else {
    WW = ",width=" + WW;
  }
 
  if (typeof(HH) == 'undefined') {
    HH = "";
  } else {
    HH = ",height=" + HH;
  }
    
//  alert('width = |' + WW + '|\n' + 
//        'height = |' + HH + '|' ) ; 
    
  strWinProp = " toolbar=no"        //Back, Forward, etc...
               + ",location=no"     //URL field
               + ",directories=no"   //"What's New", etc...
               + ",status=yes"       //Status Bar at bottom of window.
               + ",menubar=no"       //Menubar at top of window.
               + ",resizable=yes"    //Allow resizing by dragging.
               + ",scrollbars=yes"   //Displays scrollbars is document is larger than window.
               + ",titlebar=yes"     //Displays titlebar. Signed script required for "no" to work in Netscape.
               + ",top=0"            //Offset of windows top edge from screen.
               + ",left=0"           //Offset of windows left edge from screen.
//             + ",width=788"        //Standard 640,800/788, popup's 350
//             + ",height=541"       //Standard 480,600/541, popup's 500              
               + WW            //Width
               + HH           //Heigth
               + "";
 
  winMsg = window.open(URL, Nom, strWinProp);  //parms: URL,window name,properties.
  winMsg.focus();
  return false;
}

function goanim(anim,SID) {
	if (document.getElementById) {
		o=document.getElementById("anim"+anim).innerText;
		self.location="/catalogue.php?sid="+SID+"&REC="+o;
	}
}

var rec="";
var section="";
var lsection="";

function initrec(){
	if (document.forms["recherche"]) {
		document.forms["recherche"].REC.value=rec;
		document.forms["recherche"].ID.value=section;
		if (section!="") {
			document.getElementById("lsection").innerHTML="ne chercher que dans <br />\""+lsection+"\"";
		}else{
			document.getElementById("csection").style.display="none";
		}
	}
}
