var ie = (document.all)?true : false;


function openWin(url, nom, winOpts)
{
	var MinWin;
	MinWin = window.open(url, nom, winOpts);
	if (navigator.appVersion.indexOf("(X11") != -1 ||
		navigator.appVersion.indexOf("(Mac") != -1)
	 MinWin = window.open(url, nom, winOpts);
	if (navigator.appName == "Netscape" && (parseInt(navigator.appVersion) >=3 )) {
		MinWin.focus()
	}
}


function precharge(iObj,iSrc) {
if (document.images) { 
	eval(iObj+' = new Image()')
	eval(iObj+'.src = "'+iSrc+'"')}
}


function roll(nom,iObj) { 
if(document.images)document.images[nom].src = eval(iObj+'.src')
}


function rolldiv(nom,calque,iObj) 
{
	if (document.images)
	{
		   if (document.layers && calque!=null) 
		   	eval('document.'+calque+'.document.images["'+nom+'"].src = '+iObj+'.src')
		   else{
		   	//document.getElementById(nom).src = eval(iObj+".src");
		   	document.images[nom].src = eval(iObj+".src");
		   	}
	}
}


function showdiv(nom)
{
for(i=1;i<=3;i++)
{
	nom2="Div"+i
	actionLay(nom2,0)
}
actionLay(nom,1)
}



function detection() {
	var nav = navigator.appName; 
	var vers = navigator.appVersion;
	if (nav=="Microsoft Internet Explorer") this.nav = "ie"
	else if (nav=="Netscape") this.nav = "ns"
	else this.nav = nav
	this.version = parseInt(vers);
	this.mac = (navigator.userAgent.indexOf("Mac")!=-1) ||(navigator.userAgent.indexOf("Macintosh")!=-1);
	this.win = (navigator.userAgent.indexOf("Windows")!=-1) ||(navigator.userAgent.indexOf("Win")!=-1);
	this.ie = (this.nav == "ie" && this.version >= 4);
	this.ie4 = (vers.indexOf('MSIE 4')>0);
	this.ie5 = (vers.indexOf('MSIE 5')>0);
	this.ie55 = (vers.indexOf('MSIE 5.5')>0);
	this.ns = (this.nav == "ns" && this.version >= 4);
	this.ns4 = (this.nav == "ns" && this.version == 4);
	this.ns5 = (this.nav == "ns" && this.version == 5);
	this.gen4 = (this.ie || this.ns);
}

var layerObj = (!ie) ? 'document' : 'document.all';
var styleObj = (!ie) ? '' : '.style';


function actionLay(nomdiv,val)
{
	table = new Array('hidden','visible')
	if(estce.ns5)
	document.getElementById(nomdiv).style.visibility = table[val]
	else
	eval(layerObj+'.'+nomdiv+styleObj+'.visibility = "'+table[val]+'"')
}


function showmenu(nom,val)
{
	if(val)
		moveLay(nom,poshaut.split(",")[1],poshaut.split(",")[0])
	else
		moveLay(nom,posbas.split(",")[1],posbas.split(",")[0])
	/*if(val)
	madiv="menuhaut"
	else
	madiv="menubas"
	if(ie)
	//mahauteur = eval("document.all."+madiv+".offsetTop");
	mahauteur =document.all.menubas.offsetParent.offsetTop+document.all.menubas.offsetTop;
	else
	mahauteur =document.menubas.pageY
	//mahauteur =  eval("document."+madiv+".pageY");
	alert(mahauteur)*/
	/*if(val)
		moveLay(nom,poshaut.split(",")[1],mahauteur)
	else
		moveLay(nom,posbas.split(",")[1],mahauteur)*/
	actionLay(nom,1)
}


function moveLay(nomdiv,x,y)
{
	if(estce.ns5)
	{
	document.getElementById(nomdiv).style.left = x
	document.getElementById(nomdiv).style.top = y
	}
	else
	{
	eval(layerObj+'.'+nomdiv+ styleObj +'.top='+y) 
	eval(layerObj+'.'+nomdiv+ styleObj +'.left='+x)
	}
}


function VersionNavigateur(Netscape, Explorer)
{
	if ((navigator.appVersion.substring(0,3) >= Netscape && navigator.appName == 'Netscape') ||
	(navigator.appVersion.substring(0,3) >= Explorer && navigator.appName.substring(0,9) == 'Microsoft'))
	return true;
	else return false;
}
var estce = new detection();
poshaut = "81,335";


function goTo(url){
    if (url != "" && url!=null  ) window.location = url;
}


function showdiv2(nom)
{
for(i=1;i<=7;i++)
{
	nom2="Div"+i
	actionLay(nom2,0)
}
actionLay(nom,1)
}
