function ver(id) {
nombre_id1=id+"_1";
nombre_id2=id+"_2";
nombre_id3=id+"_3";
  document.getElementById(nombre_id1).style.backgroundImage="url(img/menuvertical_botonover_1.png)";
  document.getElementById(nombre_id2).style.backgroundImage="url(img/menuvertical_botonover_2.png)";
  document.getElementById(nombre_id3).style.backgroundImage="url(img/menuvertical_botonover_3.png)";
  history.reload();
  
}
function no_ver(id) {
nombre_id1=id+"_1";
nombre_id2=id+"_2";
nombre_id3=id+"_3";
  document.getElementById(nombre_id1).style.backgroundImage="url(img/menuvertical_boton_1.png)";
  document.getElementById(nombre_id2).style.backgroundImage="url(img/menuvertical_boton_2.png)";
  document.getElementById(nombre_id3).style.backgroundImage="url(img/menuvertical_boton_3.png)";
}



function check_contacto(form1){
	if (document.form1.name.value=="" || document.form1.email.value=="" || document.form1.message.value==""){
		alert('Por favor rellene al menos Nombre, Email y Mensaje');	
	}else{		
		form1.action="envio_contacto.php"
		document.form1.submit();
	}	
}
function mod_color(color,graduacion){
	rgb = new Array(3);
	rgb[0] = hexadec(color.substr(0, 2));
	rgb[1] = hexadec(color.substr(2, 2));
	rgb[2] = hexadec(color.substr(4, 2));
	//alert(rgb[0]+" "+rgb[1]+" "+rgb[2]);
	if(rgb[0]>=rgb[1] && rgb[0]>=rgb[2]){
		rgb[0]=(rgb[0]+graduacion);
		if(rgb[0]>255){rgb[0]=255;}
		if(rgb[0]<0){rgb[0]=0;}
		//alert("0 "+rgb[0]);
	}else if (rgb[1]>=rgb[0] && rgb[1]>=rgb[2]){
		rgb[1]=(rgb[1]+graduacion);
		if(rgb[1]>255){rgb[1]=255;}
		if(rgb[1]<0){rgb[1]=0;}
		//alert("1 "+rgb[1]);
	}else{
		rgb[2]=(rgb[2]+graduacion);
		if(rgb[2]>255){rgb[2]=255;}
		if(rgb[2]<0){rgb[2]=0;}
		//alert("2 "+rgb[2]);
	}
	rgb[0]=decahex(rgb[0]);
	rgb[1]=decahex(rgb[1]);
	rgb[2]=decahex(rgb[2]);
	
	//alert("#"+rgb[0]+" "+rgb[1]+" "+rgb[2]);
	return rgb[0]+rgb[1]+rgb[2];
}

function ini(colorphp)    { 
    var colores = transitar(colorphp, "ffffff", 64);
    var elFondo = document.getElementById("fondo").style; 
    var ancho = document.body.clientWidth; 
    var alto =  document.body.clientHeight; 
    elFondo.width = ancho; 
    elFondo.height = alto; 
    var altoCelda = alto / 256; 
    var tabla = "<table cellpadding=0 cellspacing=0 width=100% height=100%>"; 
    for (var i = 0; i < colores.length; i ++) 
        tabla += "<tr><td width=100% height=" + altoCelda + " style='background-color: " + colores[i] + "' ></td></tr>" 
    tabla += "</table>"; 
    document.getElementById("fondo").innerHTML = tabla; 
} 

function decahex(n) {
	return hexa.charAt(n / 16) + hexa.charAt(n % 16);
}

function colorHexa(c) {
	return "#" + decahex(c[0]) + decahex(c[1]) + decahex(c[2]);
}

function transitar(ini, fin, pasos) {
	var dato = desglose(ini);
	var rIni = dato[0];
	var gIni = dato[1];
	var bIni = dato[2];

	var intermedios = new Array(pasos);
	intermedios[0] = dato;

	var dato = desglose(fin);

	intermedios[pasos - 1] = dato;

	var rFin = dato[0];
	var gFin = dato[1];
	var bFin = dato[2];

	var rMed = (rFin - rIni) / (pasos - 1);
	var gMed = (gFin - gIni) / (pasos - 1);
	var bMed = (bFin - bIni) / (pasos - 1);

	for (var i = 1; i < pasos - 1; i ++)	{
		var rgb = new Array(3);
		rgb[0] = parseInt(rIni + (rMed * i));
		rgb[1] = parseInt(gIni + (gMed * i));
		rgb[2] = parseInt(bIni + (bMed * i));
		intermedios[i] = rgb;
	}
	for (i = 0; i < intermedios.length; i ++)
		intermedios[i] = colorHexa(intermedios[i]);

	return intermedios;
}

function desglose(color) {
	if (color.length != 6)
		return "poblema";
	else	{
		devolver = new Array(3);
		devolver[0] = hexadec(color.substr(0, 2));
		devolver[1] = hexadec(color.substr(2, 2));
		devolver[2] = hexadec(color.substr(4, 2));
	}
	return devolver;
}
var hexa = "0123456789abcdef";

function hexadec(x) {
	x = x.toLowerCase();
	return parseInt(hexa.indexOf(x.charAt(0))) * 16 + parseInt(hexa.indexOf(x.charAt(1)))
}
