//Proyecto: Implementación de formularios compatibles en navegadores usuales para la sección de Noticias de Canaljuridico.com.
//©2001 Equipo de desarrollo de Calidad y Mantenimiento.
//
var tabla_formulario,naranja,celda_formulario,estilo_option,azultabla
tabla_formulario="border-width: 2;border-style: outset; border-color: #f9d593";
azul="#00344e"
naranja="#e4980d";
azultabla="#2E556E"
celda_formulario="color: #00344E; font-weight: bold; font-family: Verdana; text-align: center; border-width:2; border-style: inset; border-color: #f9d593";
celda_banner="border-width: 3; border-style:inset; border-color: #2E556E";
estilo_option="font-family: Verdana; color: #00344E; font-weight: bold";
//
function sizetexto()
{
	if (esNS6)
		return 24;
	if (esIE4)
		return 45;
	if (esNS4)
		return 41;
	return 45;
}
//
function Trim(sDato)
	{
	for (i=0;i<sDato.length;i++)
	{
		if (sDato.charAt(i)==" ")
			{sDato=sDato.substring(i+1,sDato.length);i--;}
 		else
 			break;
	}
	for (i=sDato.length-1;i>=0;i--)
	{
		if (sDato.charAt(i)==" ")
 			sDato=sDato.substring(0,i);
		else
			break;
	}
	return sDato;
	}
//
function Validar(theForm)
{
	if(Trim(theForm.busqueda.value)=="")
	{
		alert("Escriba un valor para el campo \"Texto Libre\".");
		theForm.busqueda.focus();
		return (false);
	}
	if(esNS4) theForm.submit();
	return (true);
}
//
var tabula,crea_submit,crea_tabla,crea_textolibre,crea_select,inicio_capa,final_capa,crea_tabla_ultimas
//
tabula="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
if(esIE4||esNS6)
	crea_textolibre="<INPUT type=\"text\" style=\""+celda_formulario+"\" size=\""+sizetexto()+"\" name=\"busqueda\">";
else
	crea_textolibre="<INPUT type=\"text\" size=\""+sizetexto()+"\" name=\"busqueda\">";
//
if(esIE4||esNS6)
	crea_select="<SELECT size=\"1\" name=\"seccion\" style=\""+estilo_option+"\">";
else
	crea_select="<SELECT size=\"1\" name=\"seccion\">";
//
if (esNS4)
	crea_submit="<A href=\"#\" onClick=\"Validar(document.forms[0]);\"><IMG src=\"/imagenes/iconos/buscarnaranja.gif\" border=\"0\" width=\"91\" height=\"23\" alt=\"Buscar\"></A>";
else
	crea_submit="<INPUT type=\"image\" src=\"/imagenes/iconos/buscarnaranja.gif\" border=\"0\" width=\"91\" height=\"23\" alt=\"Buscar\">";
//
if(esIE4||esNS6)
	crea_tabla="<TABLE border=\"0\" style=\""+tabla_formulario+"\" width=\"460\" bgcolor=\""+naranja+"\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">";
else
	crea_tabla="<TABLE border=\"0\" width=\"460\" bgcolor=\""+naranja+"\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">";
//
if(esIE4||esNS6)
	crea_tabla_ultimas="<TABLE border=\"0\" style=\""+celda_banner+"\" width=\"650\" bgcolor=\""+azultabla+"\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">";
else
	crea_tabla_ultimas="<TABLE border=\"1\" width=\"650\" bgcolor=\""+azultabla+"\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\">";
//
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>";
//
