//Proyecto: Implementación de formularios compatibles en navegadores usuales para la sección de Consultas Legales de Canaljuridico.com.
//©2001 Equipo de desarrollo de Calidad y Mantenimiento.
//
azul="#00344e";
naranja="#e4980d";
azultabla="#2E556E";
celda_banner="border-width: 3; border-style:inset; border-color: #2E556E";
celda_banner1="border-width: 5; border-style: outset; border-color: #2E556E;";
text_estilo="font-family:	Verdana; color:	#00344E; font-weight:	bold";
select_estilo="font-family: Verdana; color: #00344E; font-weight: bold";
button_estilo="font-family: Verdana; font-size: 11 px; color: #E4980D; background-color: #003E5B; font-weight: bold; border: 3 outset #006697; margin-left: 1; margin-right: 1";
borde_naranja="border-style: inset; border-color: #f9d593";
borde_exterior="border-style: outset; border-color: #00344e";
celda_formulario="color: #00344E; font-style: bold; font-family: Verdana; font-style: bold; text-align: center; border-style: inset; border-color: #f9d593";
boton_formulario="font-family: Verdana; font-size: 12 px; color: #E4980D; background-color: #003E5B; font-weight: bold; border: 3 outset #006697; margin-left: 1; margin-right: 1";
tabla_formulario="border-style: outset; border-color: #f9d593";
input_estilo="font-family: Verdana; font-size: 11 px; color: #E4980D; background-color: #003E5B; font-weight: bold; border: 3 outset #006697; margin-left: 1; margin-right: 1";
tabla_formulario1="border-width: 2; border-style: outset; border-color: #3f7ca5";
celda_banner3="border-width: 2; border-style:: outset; border-color: #3F7Ca5";
celda_banner2="border-width: 4; border-style: outset; border-color: #2e556e";
estilo2="font-family: verdana; font-size: 13 px; color: #e4980d; background-color: #003E5B; font-weight: bold; border: 3 outset #006697; margin-left: 1; margin-right: 1";
celda_banner4="border-width: 1; border-style: outset; border-color: #2e556e";
celda_banner5="border-width: 1; border-style: inset; border-color: #3f7ca5";
hr_estilo="border-width: 1; border-style: inset; border-color: #3f7ca5";

//CONSTRUCCIÓN DE TABLAS Y CAPAS.
if (esIE4 && !esIE5)
	inicio_capa="<SPAN id=\"capa1\" style=\"position: relative\">";
else
	inicio_capa="<DIV id=\"capa1\" style=\"position: relative\">";
//
if (esIE4 && !esIE5)
	final_capa="</SPAN>";
else
	final_capa="</DIV>";
//
if(esIE4||esNS6)
	crea_tabla1="<table border=\"0\" style=\""+celda_banner+"\" cellpadding=\"8\" align=\"center\" cellspacing=\"0\" width=\"700\">";
else
	crea_tabla1="<TABLE border=\"1\" bgcolor=\""+azul+"\" width=\"700\" cellspacing=\"0\" cellpadding=\"8\">";
//
if(esIE4||esNS6)
	crea_tabla2="<table border=\"0\" style=\""+celda_banner2+"\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
else
	crea_tabla2="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
//
if(esIE4||esNS6)
	crea_celda2="<td border=\"0\" style=\""+celda_banner2+"\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
else
	crea_celda2="<td border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
//
if(esIE4||esNS6)
	crea_celda_titulo1="<td width=\"100%\" style=\""+tabla_formulario+"\" bgcolor=\""+naranja+"\" cellpadding=\"0\">";
else
	crea_celda_titulo1="<td width=\"100%\" bgcolor=\""+naranja+"\" cellpadding=\"0\">";
//
if(esIE4||esNS6)
	crea_tabla_sorteos1="<table style=\""+celda_banner1+"\" bgcolor=\""+azul+"\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
else
	crea_tabla_sorteos1="<table bgcolor=\""+azul+"\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
//
if(esIE4||esNS6)
	crea_celda_sorteos2="<td bgcolor=\""+naranja+"\" style=\""+celda_banner4+"\" height=\"20\">";
else
	crea_celda_sorteos2="<td bgcolor=\""+naranja+"\" style=\""+celda_banner4+"\" height=\"20\">";
//
if(esIE4||esNS6)
	crea_celda_fondo="<td align=\"justify\" width=\"500\" style=\""+celda_banner1+"\">";
else
	crea_celda_fondo="<td align=\"justify\" border=\"2\" width=\"500\">";
//
if(esIE4||esNS6)
	crea_tabla_sorteos4="<table style=\""+celda_banner1+"\" border=\"0\" bgcolor=\""+azul+"\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" valign=\"top\">";
else
	crea_tabla_sorteos4="<table border=\"0\" bgcolor=\""+azul+"\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" valign=\"top\">";
//
if(esIE4||esNS6)
	crea_celda_sorteos5="<td width=\"56%\" style=\""+celda_banner4+"\" bgcolor=\""+naranja+"\">";
else
	crea_celda_sorteos5="<td width=\"56%\" bgcolor=\""+naranja+"\">";
//
if(esIE4||esNS6)
	crea_celda_sorteos6="<td width=\"56%\" style=\""+celda_banner+"\" bgcolor=\""+azultabla+"\">";
else
	crea_celda_sorteos6="<td width=\"56%\" bgcolor=\""+azultabla+"\">";
//
if(esIE4||esNS6)
	crea_tabla_sorteos7="<table style=\""+celda_banner1+"\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
else
	crea_tabla_sorteos7="<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">";
//
if(esIE4||esNS6)
	crea_celda_texto="<td width=\"100%\" style=\""+celda_banner5+"\" bgcolor=\""+azultabla+"\">";
else
	crea_celda_texto="<td width=\"100%\" bgcolor=\""+azultabla+"\">";
//
if(esIE4||esNS6)
	crea_celda_temas="<td width=\"64%\" valign=\"middle\" height=\"44\" style=\""+celda_banner5+"\" bgcolor=\""+azultabla+"\">";
else
	crea_celda_temas="<td width=\"64%\" valign=\"middle\" height=\"44\" bgcolor=\""+azultabla+"\">";
//
if(esIE4||esNS6)
	crea_celda_mes="<td width=\"36%\" height=\"44\" valign=\"top\" style=\""+tabla_formulario1+"\">";
else
	crea_celda_mes="<td width=\"36%\" height=\"44\" valign=\"top\">";
//
if(esIE4||esNS6)
	crea_celda_mes1="<td width=\"100%\" style=\""+tabla_formulario1+"\">";
else
	crea_celda_mes1="<td width=\"100%\">";
//
if(esIE4||esNS6)
	crea_tabla_temas="<table border=\"0\" cellpadding=\"2\" style=\""+tabla_formulario1+"\" cellspacing=\"0\" width=\"100%\" height=\"233\">";
else
	crea_tabla_temas="<table border=\"0\" cellpadding=\"2\" style=\""+tabla_formulario1+"\" cellspacing=\"0\" width=\"100%\" height=\"233\">";
//
if(esIE4||esNS6)
	crea_tabla_II="<table style=\""+celda_banner+"\" bgcolor=\""+azultabla+"\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"319\">";
else
	crea_tabla_II="<table bgcolor=\""+azultabla+"\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" height=\"319\">";
//
if(esIE4||esNS6)
	hr_estilo="<hr style=\""+hr_estilo+"\" width=\"100%\">";
else
	hr_estilo="<hr width=\"100%\">";
//













//ELEMENTOS DEL FORMULARIO
//Estilos:
estilo_text="background-color: #ffffff; color:#00344e; font-weight: bold; font-family: Verdana; border-width: 4; border-style: inset; border-color:#2E556E";
estilo_text_tema="background-color: #ffffff; color:#00344e; text-align: center; font-weight: bold; font-family: Verdana; border-width: 4; border-style: inset; border-color:#2E556E";
estilo_select="background-color: #ffffff; color:#00344e; font-family: Verdana; font-weight: bold; border-width: 3; border-style:inset; border-color:#2E556E";
estilo_textarea="background-color: #ffffff; color:#00344e; font-family: Verdana; font-weight: bold; border-width: 3;border-style: inset; border-color:#2E556E";
//Cálculo de tamaños
function size_campo(campo)
{
	if (campo=="tema")
	{
		if (esNS6)
			return 25;
		if (esIE4)
			return 40;
		if (esNS4)
			return 35;
		return 35;
	}		
	else
	{
		if (esNS6)
			return 14;
		if (esIE4)
			return 30;
		if (esNS4)
			return 25;
		return 25;
	}
}
function rows_textarea(campo)
{
	if (esNS6)
		return 9;
	if (esIE4)
		return 12;
	if (esNS4)
		return 9;
	return 9;
}		
function cols_textarea(campo)
{
	if (esNS6)
		return 21;
	if (esIE4)
		return 45;
	if (esNS4)
		return 40;
	return 40;
}		
//Generación de campos INPUT TEXT
function crear_text(campo)
{
	tam=size_campo(campo);
	if (campo!="tema"){
		if(esIE4||esNS6)
			return "<INPUT type=\"text\" style=\""+estilo_text+"\" size=\""+tam+"\" name=\""+campo+"\">";
		else
			return "<INPUT type=\"text\" size=\""+tam+"\" name=\""+campo+"\">";
	}else{
		if(esIE4||esNS6)
			return "<INPUT type=\"text\" style=\""+estilo_text_tema+"\" size=\""+tam+"\" name=\""+campo+"\">";
		else
			return "<INPUT type=\"text\" size=\""+tam+"\" name=\""+campo+"\">";	
	}
}
//Generación de campos SELECT
function crear_select(campo)
{
	if(esIE4||esNS6)
		return "<SELECT style=\""+estilo_select+"\" size=\"1\" name=\""+campo+"\">";
	else
		return "<SELECT size=\"1\" name=\""+campo+"\">";
}
//Generación de campos TEXTAREA
function crear_textarea(campo)
{
	filas=rows_textarea(campo);
	columnas=cols_textarea(campo);
	if(esIE4||esNS6)
		return "<TEXTAREA name=\""+campo+"\" wrap=\"hard\" rows="+filas+" cols="+columnas+" style=\""+estilo_textarea+"\"></TEXTAREA>";
	else
		return "<TEXTAREA name=\""+campo+"\" wrap=\"hard\" rows="+filas+" cols="+columnas+"></TEXTAREA>";
}
//Botones SUBMIT y RESET
if (esNS4)
	crea_submit="<A href=\"#\" onClick=\"Validar_func(document.forms[0]);\"><IMG src=\"imagenes/enviarconsulta.gif\" border=\"0\" width=\"99\" height=\"23\" alt=\"Enviar Consulta\"></A>";
else
	crea_submit="<INPUT type=\"image\" src=\"imagenes/enviarconsulta.gif\" border=\"0\" width=\"99\" height=\"23\" alt=\"Enviar Consulta\">";
//
if (esNS4)
	crea_reset="<A href=\"#\" onClick=\"document.forms[0].reset();\"><IMG src=\"/imagenes/iconos/borrar_azulclaro.gif\" border=\"0\" width=\"99\" height=\"23\" alt=\"Borrar\"></A>";
else
	crea_reset="<A href=\"#\" onClick=\"document.forms[0].reset();\"><IMG src=\"/imagenes/iconos/borrar_azulclaro.gif\" border=\"0\" width=\"99\" height=\"23\" alt=\"Borrar\"></A>";
//
