
//conten y contenedor estilos

var presentar;
var presentador;
document.write("<div class='contenedor' style='left:137px;' name'diva' id='diva' onmouseover='presentar=1;' onmouseout='presentar = 0;presentador = setTimeout(mostrar, 100);'></div>");


function menu(pasado){

	var pulsa;
	var valor;
	var con;
	var tope = 110;
	var todo = new Array();
	var dentro = new Array();
	
	todo = pasado.split("+");

	//alert(todo[1]);

	for (con=1 ; todo[con] ; con++ , tope += 25){
		
		dentro = todo[con].split("-");
		
		if (dentro[0].indexOf("(",0) == -1){
			valor = dentro[0];
			pulsa = "";
		}else{
			valor = dentro[0].substring(0,dentro[0].indexOf("(",0));
			pulsa = "onclick='location.href=\"" + dentro[0].substring(dentro[0].indexOf("(",0) + 1,dentro[0].indexOf(")",0)) + "\";'";
		}
			
		
		//alert(dentro);
		document.write("<div class='contenedor' style='top:" + tope + "px;left:0px;'>");
			document.write("<table width='139' cellspacing='0' cellpadding='0'>");
				document.write("<tr><td type='button' class='conten' " + 
									pulsa + " " +
									"onmouseover='pasa(this,\"" + dentro + "\"," + tope + ");' " +
									"onmouseout='vete(this);'>" +
									 valor + "</td></tr>");
			document.write("</table>");
		document.write("</div>");
	}
	
}

function pasa(obj,muestra,alto){
	
	muestra = muestra.split(",");
	
	var codigo = "<table style='background-color:#cccc33' cellspacing='0' cellpadding='2'>";
	
	obj.style.backgroundColor = "#000000";
	
	for (var con=1 ; muestra[con] ; con++){
		//alert(muestra[con]);
		codigo = codigo +
					"<tr>" +
						"<td style='border:#000000 1px solid;cursor:default;color:#008000;font-size:18px;' " +
							"onmouseover='this.style.backgroundColor=\"#eeeeee\";' " +
							"onmouseout='this.style.backgroundColor=\"#cccc33\";' " +
							"onclick='location.href=\"" + muestra[con].substring(muestra[con].indexOf("(",0) + 1,muestra[con].indexOf(")",0)) + "\";'" +
							"align='center'>" +
								muestra[con].substring(0,muestra[con].indexOf("(",0)) +
							"</td>" +
					"</tr>";

	}
	codigo = codigo + "</table>";
	document.getElementById("diva").innerHTML = codigo;
	
	document.getElementById("diva").style.top = alto;
	
	document.getElementById("diva").style.display = "inline";
	
	presentar=1;
			
}

function vete(obj){
	obj.style.backgroundColor = "#008000";
	
	presentar = 0;
	presentador = setTimeout(mostrar, 1000);
}

function mostrar(){
	//alert("hola");
	if (presentar == 0){
		document.getElementById("diva").style.display = "none";
	}
	clearTimeout(presentador);	
}