//  -------- Header Dominio -------
//var header_dominio = "www.terra.com.ec";
var header_dominio = "10.253.116.25:96";

var dominio_tail="com.ec";

function _buscar(f) {
 f.action="http://buscador.terra." + dominio_tail + "/default.asp";
 if (f.query.value.length == 0) { alert('Ingrese el texto que desea buscar.'); f.query.focus(); return false; }
 else return true;
}


// -------- Header Servicios --------
var header_servicios = '';
for (i=0; i<arrayservicios.length; i+=3) {
	if (arrayservicios[i+1] == "") { 
		if (i == 0) { header_servicios += '<option value="0" selected>'; } 
		else { header_servicios += '<option value="0">'; }
	}
	else { header_servicios += '<option value=' + arrayservicios[i+1] + '>'; }
	header_servicios += arrayservicios[i] + '</option>'; 
}
if (header_servicios == "") {
	header_servicios = '<option value="0" selected>SERVICIOS  </option>';
}


// -------- Header Canales --------
var header_canales = '';
for (i=0; i<arraycanales.length; i+=3) {
	if (arraycanales[i+1] == "") { 
		if (i == 0) { header_canales += '<option value="0" selected>'; } 
		else { header_canales += '<option value="0">'; }
	}
	else { header_canales += '<option value=' + arraycanales[i+1] + '>'; }
	header_canales += arraycanales[i] + '</option>'; 
}
if (header_canales == "") {
	header_canales = '<option value="0" selected>CANALES  </option>';
}


// -------- Header Especiales --------
var header_especiales = '';
for (i=0; i<arrayespeciales.length; i+=3) {
	if (arrayespeciales[i+1] == "") { 
		if (i == 0) { header_especiales += '<option value="0" selected>'; } 
		else { header_especiales += '<option value="0">'; }
	}
	else { header_especiales += '<option value=' + arrayespeciales[i+1] + '>'; }
	header_especiales += arrayespeciales[i] + '</option>'; 
}
if (header_especiales == "") {
	header_especiales = '<option value="0" selected>ESPECIALES  </option>';
}


// -------- Header Buscardor --------
var header_buscador = '';
for (i=0; i<arraybuscador.length; i+=2) {
	header_buscador += '<option value='  + arraybuscador[i] + '>';
	header_buscador += arraybuscador[i+1] + '</option>';
}


// -------- Header Fecha --------
var header_fecha = obtenerFecha();


// -------- Header Contador de Paginas --------
var header_contador = '';
// PONIENDO PARAMETROS (NO AMBIENTE)
var contSERVER = "http://64.152.41.166";     /******    *****/
var contFOLDER = "/";
var contPROGRAMA = "hit.asp";
// OBTENIENDO PARAMETROS DEL AMBIENTE
// obteniendo el URL actual
var contURL = window.location.href;
contURL = 'URL=' + contURL;
// introducieron la pagina logica
var pagina_log;
if (pagina_log != null) {
	contURL = 'PAGE=' + pagina_log + '&' + contURL;
}
// introducieron el dominio logico
var dominio_log;
if (dominio_log != null) {
	contURL = 'SITE=' + dominio_log + '&' + contURL;
}
contURL = '?' + contURL;
// TRABAJANDO CON LOS PARAMETROS
var contORIGEN = contSERVER + contFOLDER + contPROGRAMA + contURL;
contORIGEN = '<img src="' + contORIGEN + '" border="0" height="1" width="1">';
header_contador = contORIGEN;


// -------- Header Contenido --------
var header_cont = '' +
'<style type="text/css">.buscadorGoogle { font-family:Verdana, Arial, Helvetica, sans-serif; width:122; font-size:9; background-color: #FFFFFF; border: 1px solid #333333;color: #000000; text-decoration: none;</style>' +
'<table width="780" border="0" cellspacing="0" cellpadding="0">\n' +
'<tr bgcolor="#FF7F00">\n' +
'	<td rowspan="2" width="136"><a href="http://' + header_dominio + '/" target="_top"><img src="http://' + header_dominio + '/objetos/img/logomayor.gif" width="136" height="32" border="0" alt="Bienvenido a Terra"></a></td>\n' +
'	<td width="18" align="right" valign="middle"><img src="http://' + header_dominio + '/objetos/img/au.gif" width="18" height="10" border="0"></td>\n' +
'	<form name="menus">\n' +
'	<td align="left" valign="middle" width="348">\n' +
'		<font style="COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 7.5pt"><select name="canales" onChange="if (this.form.canales.options[this.form.canales.selectedIndex].value != \'0\') top.location.href=this.form.canales.options[this.form.canales.selectedIndex].value" style="COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 7.5pt">\n' +
'			' + header_canales + '\n' +
'		</select></font><img src="http://' + header_dominio + '/objetos/img/au.gif" width="3">\n' +
'		<font style="COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 7.5pt"><select name="servicios" onChange="if (this.form.servicios.options[this.form.servicios.selectedIndex].value != \'0\') top.location.href=this.form.servicios.options[this.form.servicios.selectedIndex].value" style="COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 7.5pt">\n' +
'			' + header_servicios + '\n' +
'		</select></font><img src="http://' + header_dominio + '/objetos/img/au.gif" width="3">\n' +
/*'		<font style="COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 7.5pt"><select name="especiales" onChange="if (this.form.especiales.options[this.form.especiales.selectedIndex].value != \'0\') top.location.href=this.form.especiales.options[this.form.especiales.selectedIndex].value" style="COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 7.5pt">\n' +
'			' + header_especiales + '\n' +
'		</select></font>\n' +
*/
'	</td>\n' +
'	</form>\n' +

'	<td>' +
'<table width="273" height="26" border="0" cellpadding="2" cellspacing="1" bgcolor="824204">' +
'<form name="form_buscar" action="http://buscador.terra.' + dominio_tail + '/default.asp" method="get" onsubmit="return _buscar(this)"><tr>' +
'  <td bgcolor="#FFFFFF">' +
'	  <table width="100%" border="0" cellspacing="0" cellpadding="0">' +
'      <tr>' +
'        <td width="132"><input type="text" name="query" class="buscadorGoogle"></td>' +
'        <td><input type="image" src="http://' + header_dominio + '/img/bt_buscar2.gif" width="18" height="15"></td>' +
'        <td align="right"><img src="http://' + header_dominio + '/img/logo-google2.gif" width="109" height="18"></td>' +
'      </tr>' +
'    </table>' +
'	</td>' +
' </tr>' +
'</form>' +
'</table>' +
'	</td>' +

'	<td height="34" valign="middle" align="right"><font style="COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 7.5pt">\n' +
/*'   &nbsp;&nbsp;<img src="http://' + header_dominio + '/img/tln.gif" width="94" height="34">\n' +*/
'	</font></td>\n' +
'</tr>\n' +
'<tr>\n' +
'	<td colspan="3" align="right" bgcolor="#FF7F00">\n' +
'		<table width="100%" border="0" cellspacing="0" cellpadding="0">\n' +
'		<tr>\n' +
'			<td rowspan="2" width="16" align="right"><img src="http://' + header_dominio + '/objetos/img/esq_gris.gif" width="16" height="16"></td>\n' +
'			<td colspan="3" bgcolor="#FFFFFF" height="1"><img src="http://' + header_dominio + '/objetos/img/au.gif" width="1" height="1"></td>\n' +
'		</tr>\n' +
'		<tr bgcolor="#5f5f7f">\n' +
'			<td align="left" width="89%"><font style="COLOR: #ffffff; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 7.5pt; TEXT-DECORATION: none">\n' +
'				' + header_fecha + '\n' +
'			</font></td>\n' +
'			<td width="3%"><img src="http://' + header_dominio + '/objetos/img/inclinada.gif" width="15" height="15" align="absmiddle"></td>\n' +
'			<td align="center" width="8%"><a style="COLOR: #ffffff; FONT-FAMILY: Arial, Helvetica, sans-serif; FONT-SIZE: 7.5pt; TEXT-DECORATION: none" href="http://' + header_dominio + '/" target="_top">Portada</a></td>\n' +
'		</tr>\n' +
'		</table>\n' +
'	</td>\n' +
'</tr>\n' +
'<tr bgcolor="#FFFFFF"><td colspan="4" height="1">\n' +
' ' + header_contador + 
'</td></tr>' +
'</table>';
document.write(header_cont);




