Nav = Class.create();

Nav.prototype = {
	
	initialize: function () {		
		this.tabNav = new Array("/exposition/","/congres/","/evenements/","/presse/","/informations/");
		this.myUrl = document.location.href;
		this.navNodes = new Array;
		if ($("navTop")) this.navNodes = $("navTop").getElementsByTagName("li");
		var cnt = 0;
		for (var i=0;i<this.navNodes.length;i++) {
			if (this.navNodes[i].parentNode.tagName == "UL" && this.navNodes[i].getElementsByTagName("ol") ) {
				this.navNodes[i].id = cnt + "nav";
				//if (this.myUrl.indexOf(this.tabNav[cnt])==-1) {
					Event.observe(this.navNodes[i],"mouseover",this.showHide.bindAsEventListener(this,this.navNodes[i].getElementsByTagName("ol")[0],"block"));
					Event.observe(this.navNodes[i],"mouseout",this.showHide.bindAsEventListener(this,this.navNodes[i].getElementsByTagName("ol")[0],"none"));
					this["roll"+cnt] = new Roll(this.navNodes[i]);	
				//}
				if (this.myUrl.indexOf(this.tabNav[cnt])==-1) {
				}
				else 
					this.hide(this.navNodes[i].getElementsByTagName("img")[0]);
				cnt ++;
			}
		}
	 },
	 
	showHide: function (e,o,state) {
		if (o) { 
			o.style.display = state;
			var rollState = (state == "block") ?1 :0;
			this["roll"+parseInt(o.parentNode.id)].manual(rollState)
		}
	 },
	 
	 hide: function (o) {
		var navSRC = o.src; 
		navSRC = navSRC.replace("-0.gif","-1.gif");
		o.src = navSRC;
	 }

}

Event.observe(window, "load", function () {  
	var myNav = new Nav();
});
