//if (window!=top) top.location.href = location.href;
showmenu=true;
// RTO 20080109 : On rajotue un test pour savoir si c'est dom ou pas dom
var DOM = document.getElementById?true:false;
var IE = (document.all&&DOM)?true:false;
var ns = !IE;

if (!document.getElementById) {
  if (document.all) {
    document.getElementById=function(){return ((typeof document.all[arguments[0]]!="undefined")?document.all[arguments[0]]:null);}
  } else if (document.layers) {
    document.getElementById=function(){return ((typeof document.layers[arguments[0]]!="undefined")?document.layers[arguments[0]]:null);}
  } else if (document.getElementByName) {
    document.getElementById=function(){return document.getElementByName(arguments[0]);}
	}
}

function getFenWidth() {
	return (document.body.clientWidth)?document.body.clientWidth:((window.innerWidth)?window.innerWidth-12:0);
}

function getFenHeight() {
	return (document.body.clientHeight)?document.body.clientHeight:((window.innerHeight)?window.innerHeight:0);
}

function CenterMenus() {
	obj_menupos = document.getElementById("menupos");
	obj_menupos_style = (obj_menupos)?((obj_menupos.style)?obj_menupos.style:obj_menupos):null;
	fenWidth = getFenWidth();
	if (obj_menupos_style) obj_menupos_style.left = (fenWidth-784)/2;
}

var tempX = 0;
var tempY = 0;

function getMouseXY(e) {
	// RTO : Modification des tests pour localiser X et Y
	if(IE){
		tempX = event.x + document.documentElement.scrollLeft;
		tempY = event.y + document.documentElement.scrollTop;
	}else if (DOM) {
		tempX = e.clientX + window.pageXOffset;
		tempY = e.clientY + window.pageYOffset;
	} else {
		tempX = e.clientX;
		tempY = e.clientY;
	}
	if (typeof obj_coul != "undefined") {
		if (tempX < 0) tempX = 0;
		if (tempY < 0) tempY = 0;
		if (obj_msg2) {
			if ((tempX > colorX) & (tempX < (colorX+199)) & (tempY > colorX) & (tempY < (colorY+11))) 
				obj_msg2_style.color = "#"+coltab[tempY-1][tempX-1];
			else obj_msg2_style.color = obj_Couleur.value;
		}
	}
	return true;
}

if (!IE) document.captureEvents(Event.MOUSEMOVE);
if (document.addEventListener){
	document.addEventListener('mousemove', getMouseXY, true);
}
document.onmousemove = getMouseXY;

function showHideMenu2(who,v) { //v6.0
	var obj_menupos = document.getElementById("menupos");
	var obj_menupos_doc = (obj_menupos)?((obj_menupos.contentWindow)?obj_menupos.contentWindow.document:obj_menupos.contentDocument):null;
	var obj_menuNshadow = (obj_menupos_doc)?obj_menupos_doc.getElementById("menu"+who+"_shadow"):null;
	var obj_menuNshadow_style = (obj_menuNshadow)?((obj_menuNshadow.style)?obj_menuNshadow.style:obj_menuNshadow):null;
	var obj_menuN = (obj_menupos_doc)?obj_menupos_doc.getElementById("menu"+who):null;
	var obj_menuN_style = (obj_menuN)?((obj_menuN.style)?obj_menuN.style:obj_menuN):null;
  if (obj_menuNshadow.style) v=(v=='show')?'visible':(v=='hide')?'hidden':v;	
	if (obj_menuNshadow) obj_menuNshadow_style.visibility=v; 
  if (obj_menuN) obj_menuN_style.visibility=v; 
	if (obj_menuNshadow) obj_menuNshadow_style.visibility=v; 
}

function showHideMenu(who,v) { //v6.0
	obj_menuNshadow = document.getElementById("menu"+who+"_shadow");
	obj_menuNshadow_style = (obj_menuNshadow)?((obj_menuNshadow.style)?obj_menuNshadow.style:obj_menuNshadow):null;
	obj_menuN = document.getElementById("menu"+who);
	obj_menuN_style = (obj_menuN)?((obj_menuN.style)?obj_menuN.style:obj_menuN):null;
  obj_menuNshadow_style.visibility = v;
  obj_menuN_style.visibility = v;
}

function ShowMenu(who) {
  FlagMenu[who] = false;
  for (i=1;i<nb_menu;i++) if (i!=who) HideMenu(i);
  showHideMenu(who,'visible');
}

function WaitMenuClearTimeout(who) {
  FlagMenu[who] = false;
}

function WaitMenuHide(who) {
  if (FlagMenu[who]) HideMenu(who);
  FlagMenu[who] = false;
}

function WaitMenu(who) {
  FlagMenu[who] = true;
  HideMenuTimeoutRef[who] = setTimeout("WaitMenuHide("+who+")", 500);
}


function HideMenu(who) {
  showHideMenu(who,'hidden');
}

function chgStyleLigneMenu(ligne,over) {
	if (ligne.style) ligne = ligne.style;
	if (over) {
		ligne.color='black';
		ligne.backgroundColor='white';
	} else {
		ligne.color='#47476F';
		ligne.backgroundColor='#FCF3BA';		
	}
}

/*
if (!window.innerWidth) {
  window.innerWidth = (document.body.clientWidth)?document.body.clientWidth:null;
}

if (!window.innerHeight) {
  window.innerHeight = (document.body.clientHeight)?document.body.clientHeight:null;
}
*/


