var isOver = 0
var outOfLayer = 0
var timer1 = null
var timer2 = null

//if (document.getElementById) {
//	layerRef="document.getElementById(";
//	styleSwitch=").style";
//} else {
//	layerRef="document.layers[";
//	styleSwitch="]";
//}


if (document.getElementById) {
	layerRef="document.getElementById(";
	styleSwitch=").style";
} else if (document.all) {
	layerRef="document.all.";
	styleSwitch=".style";
} else {
	layerRef="document.layers[";
	styleSwitch="]";
}


function subAttrib(which) {
	eval('document.sub'+which+'.onmouseover = function () {'+'outOfLayer=1;'+'isOver='+which+';'+'}');
	eval('document.sub'+which+'.onmouseout = function () {'+'isOver=0;'+'hideIfOFF('+which+');'+'}');
}

function attribOMOut () {if (document.layers) {for (i = 1; i < 5; i++) {subAttrib(i)}}}

function setVisibility(which, state) {
	if (state == 1) {
		for (i = 1; i < 5; i++) {
			if (i == which) {
				eval(layerRef+'"sub'+i+'"'+styleSwitch+'.visibility="visible"')
			} else {
				eval(layerRef+'"sub'+i+'"'+styleSwitch+'.visibility="hidden"')
			}
		}
	} else {eval(layerRef+'"sub'+which+'"'+styleSwitch+'.visibility="hidden"')}
}

function hideIfOFF(which) {timer2 = setTimeout('if (isOver == 0) {setVisibility('+which+',0)}', 150)}

function setLayerON(which) {
	if (outOfLayer == 1) {timer1 = setTimeout('isOver = '+which, 150)} else {isOver = which}
	outOfLayer = 0;
}

imgsrc = new Array();

// fonction d'attribution du mouseover/mouseout du menu -----------------------------------------------
links=new Array();
links[0]=new Array('0_1_edito.php','0_2_agences.php','references.php?myrub=0_0','0_3_recrutement.php','0_4_informations.php');
links[1]=new Array('1_1_conference.php','1_2_showrooms.php','1_3_musees.php','1_4_hotellerie.php','1_5_vente.php','1_6_assistance.php','1_7_homecinema.php','1_8_occasion.php','references.php?myrub=1_0');
links[2]=new Array('2_1_evenementiel.php','2_2_broadcast.php','2_3_location.php','2_4_interpretation.php','2_5_exploitation.php','2_6_presentation.php','3_2_decors.php','references.php?myrub=2_0');
links[3]=new Array('3_1_film.php','3_2_decors.php','3_3_video.php','3_4_sousmarines.php','3_5_postprod.php','3_6_dvd.php','3_7_cdrom.php','3_8_internet.php','3_9_duplication.php','references.php?myrub=3_0');
bgcolorsON=new Array('#7DB7E9','#56B100','#F36A1B','#26679E');
bgcolorsOFF=new Array('#26679E','#FFFFFF','#FFFFFF','#FFFFFF');
colorsON=new Array('#FFFFFF','#FFFFFF','#FFFFFF','#FFFFFF');
colorsOFF=new Array('#FFFFFF','#666666','#666666','#666666');
refcolors=new Array('#408400','#AB3F01','#0A365B');

function colon(obj) {
	if (is_ie6up || is_nav6up) obj.style.cursor='pointer';
	if (obj.innerHTML.substring(0,1)!='<') {
		obj.style.color=colorsON[obj.id.substring(2,3)];
		obj.bgColor=bgcolorsON[obj.id.substring(2,3)];
	} else obj.bgColor=refcolors[obj.id.substring(2,3)-1];
}

function coloff(obj) {
	if (obj.innerHTML.substring(0,1)!='<') {
		obj.style.color=colorsOFF[obj.id.substring(2,3)];
		obj.bgColor=bgcolorsOFF[obj.id.substring(2,3)];
	} else obj.bgColor=bgcolorsON[obj.id.substring(2,3)];
}

function jump(obj) {
	document.location=links[obj.id.substring(2,3)][obj.id.substring(4,6)-1]
}

function attribMenuActions() {
	if (document.getElementById('mi1_5')==null) {alert('kj')}
	for (j=0;j<4;j++) {
		i=1;
		while (document.getElementById('mi'+j+'_'+i)!=null) {
			document.getElementById('mi'+j+'_'+i).onmouseover=function() {
				this.style.cursor='pointer';
				if (this.innerHTML.substring(0,1)!='<') {
					this.style.color=colorsON[this.id.substring(2,3)];
					this.bgColor=bgcolorsON[this.id.substring(2,3)];
				} else this.bgColor=refcolors[this.id.substring(2,3)-1];
			}
			document.getElementById('mi'+j+'_'+i).onmouseout=function() {
				if (this.innerHTML.substring(0,1)!='<') {
					this.style.color=colorsOFF[this.id.substring(2,3)];
					this.bgColor=bgcolorsOFF[this.id.substring(2,3)];
				} else this.bgColor=bgcolorsON[this.id.substring(2,3)];
			}
			document.getElementById('mi'+j+'_'+i).onclick=function() {document.location=links[this.id.substring(2,3)][this.id.substring(4,6)-1]}
			i++;
		}
	}
}
