function cambiaImg(esto, accion, activo, imagen){
//activo = 1 - noactivo = 0 o cualquier cosa
	if(activo==1){
		if(accion=='entrar'){
			esto.src = 'images/' + imagen + 'sel.gif';
			esto.style.cursor = 'hand'
		}else{
			if(accion=='salir'){
				esto.style.cursor = 'default'
				esto.src = 'images/' + imagen + '.gif';
			}
		}
	}
}

function ventanaMax(titulo, txt, imagen){
	titulo = titulo + "Max"
	v=window.open("", "", "toolbar=no, location=no, directories=no, status=no, scrollbars=no, fullscreen=yes, resizable=no, titlebar=no, menubar=no");
	v.opener = self;

	v.document.write("<html>"); 
	v.document.write("<head>");
	v.document.write("<title>Detalle</title>");

	v.document.write("</head>");

	v.document.write("<LINK REL='stylesheet' TYPE='text/css' HREF='css/anavarro.css'>");

	v.document.write("<style type='text/css'>")
	v.document.write("	body {font-family: Tahoma;}");
	v.document.write("</style>");

	v.document.write("<script src='js/mix.js' language='javascript'>");
	v.document.write("</script>");
	
	v.document.write("<body class='fondoverde' bottomMargin='0' leftMargin='0' rightMargin='0' topMargin='0'>");
	v.document.write("<table border='0' cellpadding='0' cellspacing='0' height='100%' width='100%'>");
	v.document.write("  <tr>");
	v.document.write("  	<td colspan='2' align='center'><img border='1' src='images/" + imagen + ".jpg'></td>");
	v.document.write("  </tr>");
	v.document.write("  <tr>");
	v.document.write("  <td colspan='2'align='center' height='4'><img src='images/linea2.gif' width='97' height='1'></td>");
	v.document.write("  </tr>");
	v.document.write("  <tr>");
	v.document.write("  <td colspan='2' align='center'>");
	v.document.write("");
	v.document.write("  </td>");
	v.document.write("  </tr>");
	v.document.write("  <tr>");
	v.document.write("  <td colspan='2' align='center' height='4'><img src='images/linea2.gif' width='97' height='1'></td>");
	v.document.write("  </tr>");
	v.document.write("  <tr>");
	v.document.write("<td align='right' width='100%' height='30'><font onclick='window.close(); return false; ' onmouseover='simularEnlace(this, \"entrar\", \"#ffffff\"); return false;' onmouseout='simularEnlace(this, \"salir\", \"#000000\"); return false;'>Cerrar Ventana</font>&nbsp;&nbsp;&nbsp;</td>");
	v.document.write("<td align='center' width='30' height='30'><img onclick='window.close(); return false; ' onmouseover='cambiarCursor(this, \"hand\"); return false;' onmouseout='cambiarCursor(this, \"default\"); return false;' src='images/close.gif' width='22' height='22'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>");
	v.document.write("  </tr>");
	v.document.write("</table>");
	v.document.write("</body>");
	v.document.write("</html>");
}

function cambiaColor(esto, accion, activo){
//activo = 1 - noactivo = 0 o cualquier cosa
	if(activo==1){
		if(accion=='entrar'){
			esto.style.color = '#ffffff'
			esto.style.cursor = 'hand'
			esto.style.backgroundColor = '#059773'
		}else{
			if(accion=='salir'){
				esto.style.color = '#ffffff'
				esto.style.cursor = 'default'
				esto.style.backgroundColor = '#000000'
			}
		}
	}
}

function abrirVentana(ventana, titulo){

	window.open(ventana, titulo, "toolbar=no, width=300, height=400, location=no, directories=no, status=no, scrollbars=no, resizable=no, menubar=no");

}

function cambiarCursor(esto, tipo){
	esto.style.cursor = tipo;
}

function llenarTxt(obj, valor){
	document.getElementById(obj).value = valor;
}

function simularEnlace(esto, accion, color){
	if(accion=='entrar'){
		esto.style.color = color
		esto.style.cursor = 'hand'
		esto.style.textDecoration = 'underline'
	}else{
		if(accion=='salir'){
			esto.style.color = color
			esto.style.cursor = 'default'
			esto.style.textDecoration = 'none'
		}
	}
}

function simularEnlaceFoto(esto, accion){
	if(accion=='entrar'){
		esto.style.cursor = 'hand'
	}else{
		if(accion=='salir'){
			esto.style.cursor = 'default'
		}
	}
}

function imprimirVentana(ventana){
	ventana.print();
}

function abrirVentana(titulo, txt, ancho, alto, imagen){

	var izquierda = (screen.width-ancho)/2;
	var arriba = (screen.height-alto-100)/2;
	
	v = window.open("", titulo, "toolbar=no, width=" + ancho + ", height=" + alto + ", location=no, directories=no, status=no, scrollbars=auto, resizable=no, titlebar=no, menubar=no, left=" + izquierda + ", top=" + arriba);

	v.opener = self;	
	texto = v.opener.document.getElementById(txt).value;

	v.document.write("<html>"); 
	v.document.write("<head>");
	v.document.write("<title>Detalle</title>");

	v.document.write("</head>");

	v.document.write("<script src='js/mix.js' language='javascript'>");
	v.document.write("</script>");

	v.document.write("<LINK REL='stylesheet' TYPE='text/css' HREF='css/belmonte.css'>");

	v.document.write("<style type='text/css'>")
	v.document.write("	body {font-family: Tahoma;}");
	v.document.write("</style>");
	
	v.document.write("<body class='fondonegro' bottomMargin='0' leftMargin='0' rightMargin='0' topMargin='0'>");
	v.document.write("<table border='0' cellpadding='0' cellspacing='0' height='100%' width='100%'>");
	v.document.write("  <tr>");
	v.document.write("  	<td colspan='4' align='center'><img border='1' src='images/" + imagen + "det.jpg' style='border-color: #FFFFFF; '></td>");
	v.document.write("  </tr>");
	v.document.write("  <tr>");
	v.document.write("  <td colspan='4'align='center' height='4'><img src='images/linsep.gif'></td>");
	v.document.write("  </tr>");
	v.document.write("  <tr>");
	v.document.write("  <td colspan='4' align='center' class='letrablanca + letra10'>");
	v.document.write(texto);
	v.document.write("  </td>");
	v.document.write("  </tr>");
	v.document.write("  <tr>");
	v.document.write("  <td colspan='4' align='center' height='15'><img src='images/linsep.gif'></td>");
	v.document.write("  </tr>");
	v.document.write("  <tr>");
	v.document.write("  <td colspan='4' width='100%' align='right'>");
	v.document.write("  <table border='0' cellpadding='5' cellspacing='0' height='100%' width='100%'>");
	v.document.write("  <tr>");
	v.document.write("<td align='right' width='100%'><font class='letraverde + letra10' onclick='window.print(); return false; ' onmouseover='simularEnlace(this, \"entrar\", \"#FF6600\"); return false;' onmouseout='simularEnlace(this, \"salir\", \"#d3ff33\"); return false;'>Imprimir</font></td>");
	v.document.write("<td align='center'><img onclick='window.print(); return false; ' onmouseover='cambiarCursor(this, \"hand\"); return false;' onmouseout='cambiarCursor(this, \"default\"); return false;' src='images/imprimir.gif'></td>");
	v.document.write("<td align='right'><font class='letraverde + letra10' onclick='window.close(); return false; ' onmouseover='simularEnlace(this, \"entrar\", \"#ff6600\"); return false;' onmouseout='simularEnlace(this, \"salir\", \"#d3ff33\"); return false;'>Cerrar</font></td>");
	v.document.write("<td align='center'><img onclick='window.close(); return false; ' onmouseover='cambiarCursor(this, \"hand\"); return false;' onmouseout='cambiarCursor(this, \"default\"); return false;' src='images/close.gif' width='22' height='22'></td>");
	v.document.write("  </tr>");
	v.document.write("  </table>");
	v.document.write("  </td>");
	v.document.write("  </tr>");

//	v.document.write("  <tr>");
//	v.document.write("<td align='right' width='100%'><font class='letraverde + letra10' onclick='window.print(); return false; ' onmouseover='simularEnlace(this, \"entrar\", \"#FF6600\"); return false;' onmouseout='simularEnlace(this, \"salir\", \"#d3ff33\"); return false;'>Imprimir</font></td>");
//	v.document.write("<td align='center'><img onclick='window.print(); return false; ' onmouseover='cambiarCursor(this, \"hand\"); return false;' onmouseout='cambiarCursor(this, \"default\"); return false;' src='images/imprimir.gif'></td>");
//	v.document.write("<td align='right' width='" + (ancho - 30)+ "' height='30'><font onclick='ventanaMax(\"" + titulo + "\", \"" + txt + "\", \"" + imagen + "\"); return false;' onmouseover='simularEnlace(this, \"entrar\", \"#ffffff\"); return false;' onmouseout='simularEnlace(this, \"salir\", \"#000000\"); return false;'>Calidad</font>&nbsp;&nbsp;</td>");
//	v.document.write("<td align='center' width='30' height='30'><img onclick='ventanaMax(\"" + titulo + "\", \"" + txt + "\", \"" + imagen + "\"); return false; ' onmouseover='cambiarCursor(this, \"hand\"); return false;' onmouseout='cambiarCursor(this, \"default\"); return false;' src='images/max.gif' width='22' height='22'></td>");
//	v.document.write("<td align='right'><font class='letraverde + letra10' onclick='window.close(); return false; ' onmouseover='simularEnlace(this, \"entrar\", \"#ff6600\"); return false;' onmouseout='simularEnlace(this, \"salir\", \"#d3ff33\"); return false;'>Cerrar</font></td>");
//	v.document.write("<td align='center'><img onclick='window.close(); return false; ' onmouseover='cambiarCursor(this, \"hand\"); return false;' onmouseout='cambiarCursor(this, \"default\"); return false;' src='images/close.gif' width='22' height='22'></td>");
//	v.document.write("  </tr>");
	v.document.write("</table>");
	v.document.write("</body>");
	v.document.write("</html>");
}

function irA(enlace){
	document.location.href = enlace;
}

