// JavaScript Document
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
var menu1Visible = false;
function afficheMenu1() {
	if (!menu1Visible) { MM_showHideLayers('menu_univers','','show');	}
	else { MM_showHideLayers('menu_univers','','hide');	}
	menu1Visible=!menu1Visible;
}

function okprod(ga,s1,s2) {
	if (s2 != -1) {
		Qs = "?gamme=" + G[ga][0]+"&scat1=" + G[ga][1][s1][0]+"&scat2=" + G[ga][1][s1][1][s2];
		truc1 = G[ga][0].split("#");
		truc2 = G[ga][1][s1][0].split("#");
		truc3 = G[ga][1][s1][1][s2].split("#");
		Qs = "?niv0id=" + truc1[0] +"&niv1id=" + truc2[0] +"&niv2id=" + truc3[0];
	}
	else
	if (s1 != -1) {
		Qs = "?gamme=" + G[ga][0]+"&scat1=" + G[ga][1][s1][0];
		truc1 = G[ga][0].split("#");
		truc2 = G[ga][1][s1][0].split("#");
		Qs = "?niv0id=" + truc1[0] +"&niv1id=" + truc2[0];
	}
	else {
		Qs = "?gamme=" + G[ga][0];		
		truc1 = G[ga][0].split("#");
		Qs = "?niv0id=" + truc1[0];
	}
	//window.location.href = "guidechoix2b.asp"+Qs;
	//alert(Qs);
	document.getElementById("menu_univers").style.visibility = 'hidden';
	loadXMLDoc('contentbodyId','produit.php' + Qs);

}

sfHover = function() {
	
	sfEls = document.getElementById("nav").getElementsByTagName("LI");
	//alert(sfEls.length);
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

//if (window.attachEvent) window.attachEvent("onload", sfHover);

function go_nav()
{
	//alert(G);
	//G = new Array()
	//G[G.length] = ["Manutention humide", [["CUIR"],["synthetique"]]];G[G.length] = ["Manutention  fine", [["CUIR"],["synthetique"]]];G[G.length] = ["Manutention sèche", [["CUIR"],["synthetique"]]];G[G.length] = ["Manutention grasse", [["CUIR"]]];G[G.length] = ["Anti-coupure niveau 3", [["anti-chaleur"],["grip gras", ["cuir"]],["grip humide", ["cuir"]],["grip sec", ["cuir","synthétique"]]]];G[G.length] = ["Anti-coupure niveau 4", [["anti-chaleur"],["grip gras", ["cuir","synthétique"]],["grip humide", ["cuir","synthétique"]],["grip sec", ["cuir","synthétique"]]]];G[G.length] = ["Anti-coupure niveau 5", [["anti-chaleur"],["grip gras", ["cuir","synthétique"]],["grip humide", ["cuir","synthétique"]],["grip sec", ["cuir","synthétique"]]]];G[G.length] = ["Anti-chaleur", [["100°"],["250° et plus"],["400° et plus"],["600° et plus"]]];G[G.length] = ["Anti-froid", [["0 à -10°"],["10° à 0°"],["-10° à -30°"],["-30° à -100° imperméable"]]];G[G.length] = ["Soudure", [["Arc"],["argon"]]];G[G.length] = ["Pompiers"];G[G.length] = ["Forestier", [["Bucheron"],["Forestier"]]];G[G.length] = ["Nettoyage et ramassage de déchets"];G[G.length] = ["Peinture"];G[G.length] = ["Projection de metal fondu"];G[G.length] = ["Chimie légère"];G[G.length] = ["Tabliers"];G[G.length] = ["Casquette"];G[G.length] = ["Chaleur et liquide chaud"];G[G.length] = ["Nettoyage lustrage"];G[G.length] = ["Kevlar / twaron"];G[G.length] = ["Dyneema"];G[G.length] = ["Problemes d allergies"];G[G.length] = ["Anti-piqure"];G[G.length] = ["Manchettes"];
	//G1 = new Array();
	
	machin = '';
	
	
	
	for(i=0;i<G.length;i++) {			
		if (G[i].length == 1) { goprod = "javascript:okprod("+i+",-1,-1)"; } else { goprod = "#"; }
		truc1 = G[i][0].split("#");
		//machin = machin + "<li><a href='"+goprod+"'>"+truc1[1]+"</a>";
		machin = machin + "<li><a href='"+goprod+"'>"+truc1[1]+"</a>";
		if (G[i].length > 1) {
			machin = machin + "<ul>";
			for(j=0;j<G[i][1].length;j++) {	
				if (G[i][1][j].length == 1) { goprod = "javascript:okprod("+i+","+j+",-1)"; } else { goprod = "#"; }
				truc2 = G[i][1][j][0].split("#");
				machin = machin + "<li><a href='"+goprod+"'>&nbsp;&nbsp;"+truc2[1]+"</a>";			
				if (G[i][1][j].length > 1) {
					machin = machin + "<ul>";
					for(k=0;k<G[i][1][j][1].length;k++) {
						truc3 = G[i][1][j][1][k].split("#");
						goprod = "javascript:okprod("+i+","+j+","+k+")";						
			   			machin = machin + "<li><a href='"+goprod+"'>&nbsp;&nbsp;"+truc3[1]+"</a></li>";
					}
					machin = machin + "</ul>";
				}
				machin = machin + "</li>";
			}
			machin = machin + "</ul>";		
		}
		machin = machin + "</li>";
	}
	
	//if (window.attachEvent) window.attachEvent('onload', sfHover);
	//machin = machin + '<img src="../img/loader.gif" onload="if (window.attachEvent) window.attachEvent(\'onload\', sfHover);">';
	return machin;
}