var IMG_PATH = '/img/'

function main() {
	initlayers();
	navTopInit();	
	if(currentSection!=null) resetCurrent();
	}

// Fonction de popUp windows
function popwin(url,name,width,height,center,top,left,scroll,resize)
/*
url = URL du document
name = Nom de la fenêtre
width = Largeur de la fenêtre
height = Hauteur de la fenêtre
center = boolean (1 = centré dans l'écran, 0 = positionnement avec coordonnés en partant du coin supérieur droit)
top = Position Y de la fenêtre en partant du haut (Peut être combiné avec une fenêtre centrée en utilisant une valeure négative ou positive)
left = Position X de la fenêtre en partant de la droite (Peut être combiné avec une fenêtre centrée en utilisant une valeure négative ou positive)
scroll = boolean (1 = avec barre de défilement, 0 = sans barre de défilement)
resize = boolean (1 = redimensionnable, 0 = pas redimensionnable)
*/
	{
	if (center==1)
		{
		var winleft = parseInt((screen.width - width ) / 2 + left);
		var wintop = parseInt((screen.height - height) / 2 + top);
		}
	else
		{
		var winleft = left;
		var wintop = top;
		}
	window.open(url,name,"width=" + width + ",height=" + height + ",top=" + wintop + ",left=" + winleft + "menubar=0,status=0,scrollbars=" + scroll + ",resizable=" + resize + ",toolbar=0,location=0,directories=0").focus();
	}

// Fonction d'effet roll-over image
function rollIO(id,state) {
	//if(id != currentSection) eval("document." + id + ".src = '/i/" + currentLanguage + "/img/bt_" + id + "_" + state + ".gif\'");  
	if(id != currentSection) eval("document.bt_" + id + ".src = IMG_PATH + 'bt_" + id + "_" + state + ".gif\'");	
	}

// Fonction indicateur de section - état ON dans le menu principal
function resetCurrent() {
	//if(currentSection!=null) eval("document." + currentSection + ".src = '/i/" + currentLanguage + "/img/bt_" + currentSection + "_on.gif\'");	
	if(currentSection!=null) eval("document.bt_" + currentSection + ".src = IMG_PATH + 'bt_" + currentSection + "_on.gif\'");	
	}

// Ajuste le DHTML après un "resize" de la fenêtre
function fix() { 
	bVer=''; 
	bName = navigator.appName.toLowerCase(); 
	bVer = navigator.appVersion.substring(0,3); 
	if(bName == "netscape" && bVer< '4.08') 
		{ 
		return false; 
		} 
		else 
		{ 
		document.location = document.location; 
		}
	}

/* Menu DHTML */
// Variables pour le menu
var nTposX = nTposY = 0;
var hTable = "<table cellpadding='0' cellspacing='0' border='0' class='Bg9'>\n<tr><td colspan='4' height='2'><spacer type='block' height='2'></td></tr>";
var hLine = "<tr><td colspan='4' height='1' class='Bg0'><spacer type='block' height='1'></td></tr>";
var hTableEnd = "<td colspan='4' height='2'><spacer type='block' height='2'></td></tr>\n</table>";

// Création des menus
function navTopInit() {
	var offsetX = 1;
	var offsetY;
	
	if(isgecko){ offsetY = 10 }else{ offsetY = 33 };
	for(n=0; n<navTop.length; n++) {
		var html = '';
		if(navTop[n][0]) {
			//var div = eval("nT" + n);
			var div = document.getElementById("nT" + n);
			div.setxy(getanx("nTxy" + n)+offsetX,getany("nTxy" + n)+offsetY);
			html += hTable
			for(i=0; i<navTop[n].length; i++) {
				html += "<tr>\n<td width='5'><spacer type='block' width='5'></td>\n"
				+ "<td valign='top'><p class='ntBul'><img src='/img/spc.gif' width='3' height='7' name='b" + n + "_" + i + "'>&nbsp;</p></td>\n<td valign='top'><p class='ntBul'><a href='"
				+ navTop[n][i+1]
				+ "' class='ntLnk' onmouseover=\"document.b" + n + "_" + i + ".src = '/img/nTArrow.gif';\" onmouseout='document.b" + n + "_" + i + ".src = \"/img/spc.gif\";'>"
				+ navTop[n][i]
				+ "</a><br></p></td>\n<td width='8'><spacer type='block' width='5'></td>\n</tr>\n";
				// html += hLine;
				i++
				}
			html += hTableEnd;
			div.bt = null;
			div.html(html);
			div.onmouseover = nTShow;
			div.onmouseout = nTHide;
			}
		}	
	}
	
function nTShow() {
	this.show();
	if(this.bt) rollIO(this.bt,"on")
	}

function nTHide() {
	this.hide();
	if(this.bt) rollIO(this.bt,"off")
	}

function show(obj) 
{
    if (isns4) obj.visibility = "show";
    else if (obj.style) obj.style.visibility = "visible";
}
 
function hide(obj) 
{
    if (isns4) obj.visibility = "hide";
    else if (obj.style) obj.style.visibility = "hidden";
}

function nTOn(id,bt,b) {
	//var div = eval("nT" + id);
	var div = document.getElementById("nT" + id);
	  rollIO(bt,b)
	  div.bt = bt;
	  div.b = b;
	  show(div);
	}
	
function nTOff(id,bt,b) {
	//var div = eval("nT" + id);
	var div = document.getElementById("nT" + id);
	  rollIO(bt,b);
	  hide(div);
	}

