// JavaScript Document



//	Colors del menu
var tdColor="#000000";		// color del texto de los elementos del menu
var tdBgColor="#BBDDFF";	// color de fondo de los elementos del menu
var hlColor="BBDDFF";		// color texto cuando puntero encima
var hlBgColor="#000000";	// color fondo cuando punetor encima


// Definicio del menu



//1 h2o point
td_1="H2Opoint"
url_1= "1index.php"
	
	td_1_1="QUI SOM?"
	url_1_1= "1somos.php"
	td_1_2 = "PRINCIPIS"
	url_1_2 = "1principios.php"
	td_1_3 = "ON ESTEM"
	url_1_3 = "1donde.php"
	td_1_4 = "ONGs, ASSOCIACIONS"
	url_1_4 = "1asociaciones.php"
	td_1_5 = "DISTRIBUIDORS"
	url_1_5 = "1distribuidores.php"
	td_1_6 = "ECODEPUR"
	url_1_6 = "1ecodepur.php"
	td_1_7 = "COL.LABORADORS"
	url_1_7 = "1colaboradores.php"
	td_1_8 ="CONFIDENCIALITAT"
	url_1_8 = "1confidencial.php"
	td_1_9 ="INICI"
	url_1_9 = "1index.php"
	
//2  calidad
td_2 ="QUALITAT"
url_2 = "1info_calidad.php"
	td_2_1="INFORMACIÓ"
	url_2_1= "1info_calidad.php"
	td_2_2 = "BEURE I CUINAR"
	url_2_2 = "1info_beber.php"
		td_2_2_1="INFORMACIÓ"
		url_2_2_1="1info_beber.php"
		td_2_2_2 ="OSMOSI"
		url_2_2_2 ="1osmosis.php"
		td_2_2_3 ="DESTIL.LADORES"
		url_2_2_3 ="1destiladores.php"
		td_2_2_4 ="CARBÓ (DECLORADORS)"
		url_2_2_4 ="1carbon.php"
		
	td_2_3 = "LA CALÇ A CASA"
	url_2_3 = "1info_cal.php"
		td_2_3_1="INFORMACIÓ"
		url_2_3_1="1info_cal.php"
		td_2_3_2 ="DESCALCIFICADORS"
		url_2_3_2 ="1descalcificadores.php"
		td_2_3_2_1="INSTALACIÓ"
		url_2_3_2_1= "1des_ins.php"
		td_2_3_3 ="ANTIINCRUSTANTS"
		url_2_3_3 ="1antiincrustantes.php"
	
	td_2_4 ="A LA DUTXA"
	url_2_4 ="1ducha.php"
	
	td_2_5 ="FONTS D'OFICINA"
	url_2_5 ="1fuentes_oficina.php"
	
	
	//3  ahorro
	td_3 ="ESTALVI"
	url_3 = "1info_ahorro.php"
		td_3_1="INFORMACIÓ"
		url_3_1= "1info_ahorro.php"
		td_3_2 = "GRIFERIES"
		url_3_2 = "1grifos.php"
		td_3_3 = "DUTXES"
		url_3_3 = "1duchas.php"
		td_3_4 = "CISTERNES"
		url_3_4 = "1cisternas.php"
		td_3_5 = "JARDINERES"
		url_3_5 = "1jardineras.php"
		td_3_6 = "CONTROL FUITES"
		url_3_6 = "1fugas.php"
		
		
		
	//4  aprovechamiento
	td_4 ="APROFITAMENT"
	url_4 = "1info_aprov.php"
		td_4_1="INFORMACIÓ"
		url_4_1= "1info_aprov.php"
		td_4_2 = "PLUJA"
		url_4_2 = "1generalidades.php"
      td_4_2_1 = "GENERALITATS"
      url_4_2_1 = "1generalidades.php"
      td_4_2_2 = "ESTUDIS PREVIS"
      url_4_2_2 = "1estudiosprevios.php"
      td_4_2_3 = "EQUIPS NECESARIS"
      url_4_2_3 = "1equipos.php"
		td_4_3 = "GRISES"
		url_4_3 = "1grises.php"
		td_4_4 = "RESIDUALS"
		url_4_4 = "1residuales.php"


	//5 serveis
	td_5 ="SERVEIS"
	url_5 = "1servicios.php"
		td_5_1="ANÀLISI"
		url_5_1= "1info_analisis.php"
			td_5_1_1="INFORMACIÓ"
			url_5_1_1="1info_analisis.php"
			td_5_1_2 ="ANÀLISI"
			url_5_1_2 ="1analisis.php"
			td_5_1_3 ="KITS D'ANÀLISI"
			url_5_1_3 ="1kits.php"
		td_5_2 = "AUDITORIA"
		url_5_2 = "1auditoria.php"
		td_5_3 = "SERVEI TÈCNIC"
		url_5_3 = "1servicio.php"
		td_5_4 = "MANTENIMIENT"
		url_5_4 = "1mantenimiento.php"
		//td_5_5 = "PROJECTES"
		//url_5_5 = "1proyectos.php"
		td_5_5 = "FORMACIÓ"
		url_5_5 = "1formacion.php"

		
	//6  cultura
	td_6 ="L'AULA DE L'AIGUA"
	url_6 = "1cultura.php"
		td_6_1="L'AULA DE L'AIGUA"
		url_6_1= "1info_aula.php"
		td_6_1_1="INFORMACIÓ"
		url_6_1_1="1info_aula.php"
		td_6_1_2 ="PROGRAMACIÓ"
		url_6_1_2 ="1programacio_aula.php"
		td_6_2 = "ALTRES CURSOS"
		url_6_2 = "1otros_cursos.php"
		td_6_3 = "CENTRE DOCUMENT."
		url_6_3 = "1centro_doc.php"
		td_6_4 = "ARTICLES"
		url_6_4 = "1articulos.php"
		td_6_5 = "LLIBRES"
		url_6_5 = "1libros.php"
		//td_6_5 = "PRENSA"
		//url_6_5 = "prensa.php"
		td_6_6 = "LLOCS D'INTERÈS"
		url_6_6 = "1enlaces.php"
		//td_6_7 = "EVENTOS"
		//url_6_7 = "eventos.php"
		//td_6_5 = "AMICS DE L'AIGUA"
		//url_6_5 = "1amigos.php"
		
		
//7  h2o point
td_7 =" . . . . .  . . . . . . . . . . . . . . "
//url_7 = "index.php"

		
		
var md=250;
var ti=-1;
var oTd=new Object;
oTd=null;

function doMenu(td){
	clearTimeout(ti);
	td.style.backgroundColor=hlBgColor;
	td.style.color=hlColor;
	var i;
	var sT="";
	var tda=new Array();
	tda=td.id.split("_");
	if(oTd!=null){
		var tdo=new Array();
		tdo=oTd.id.split("_");
		for(i=1;i<tdo.length;i++){
			sT+="_"+tdo[i];
			if(tdo[i]!=tda[i]){
				document.getElementById("td"+sT).style.backgroundColor=tdBgColor;
				document.getElementById("td"+sT).style.color=tdColor;
				if(document.getElementById("tbl"+sT)!=null)
					document.getElementById("tbl"+sT).style.visibility="hidden";
			}
		}			
	}
	oTd=td;
	sT="tbl";
	for(i=1;i<tda.length;i++)
		sT+="_"+tda[i];
	if(document.getElementById(sT)!=null)
		document.getElementById(sT).style.visibility="visible";

}

function clearMenu(){
	if(oTd!=null){
		var tdo=new Array();
		tdo=oTd.id.split("_");
		var sT="";
		for(var i=1;i<tdo.length;i++){
			sT+="_"+tdo[i];
			document.getElementById("td"+sT).style.backgroundColor=tdBgColor;
			document.getElementById("td"+sT).style.color=tdColor;
			if(document.getElementById("tbl"+sT)!=null)
				document.getElementById("tbl"+sT).style.visibility="hidden";
		}
		oTd=null;			
	}
}

function runMenu(strURL){
	location.href=strURL;
}

var tt="";
var sT="";
var pT=new Array();
var tA=new Array();

function getCoord(st){
	tA=st.split("_");
	if(tA.length>2){
		tA=tA.slice(0,-1);
		tt=tA.join("_");
		return (document.getElementById("tbl"+tt).offsetTop+document.getElementById("td"+st).offsetTop+4)+"px;left:"+
			(document.getElementById("tbl"+tt).offsetLeft+document.getElementById("td"+st).offsetWidth-2)+"px\">";
	}
	return (document.getElementById("mainmenu").offsetTop+document.getElementById("td"+st).offsetHeight-2)+"px;left:"+
		  (document.getElementById("mainmenu").offsetLeft+document.getElementById("td"+st).offsetLeft+5)+"px\">";
}