//////////////////////////////////////////////////////
//////////   Funciones de precarga de imágenes
//////////////////////////////////////////////////////


function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



///////////////////////////////////////////////////////
//////  Funciones para representar menú y encabezado
///////////////////////////////////////////////////////

function Dibuja_Menu() {
	document.writeln('<table width="1002" border="0" cellpadding="0" cellspacing="0">\n  <tr> \n    <td width="100%" height="44" background="images\/topbg1.gif">\n	<table width="100%" border="0" cellspacing="0" cellpadding="0">\n        <tr>\n          <td><a href=".\/index.htm" onMouseOver="MM_swapImage(\'btn_inicio\',\'\',\'images\/btn_inicio_on.gif\',1)" onMouseOut="MM_swapImgRestore()" ><img src="images\/btn_inicio.gif" name="btn_inicio" width="69" height="44" border="0" id="btn_inicio"><\/a><\/td>\n		  <td width="3" valign="top" background="images\/pixi_white.gif"><img src="images\/pixi_white.gif" width="3" height="44"><\/td>\n		  <td><img src="images\/topbg1.gif" width="5" height="44"><\/td>\n<td width="3" valign="top" background="images\/pixi_white.gif"><img src="images\/pixi_white.gif" width="8" height="44"><\/td>\n<td><img src="images\/topbg1.gif" width="187" height="44"><\/td>\n<td width="100%"><img src="images\/navspacer.gif" width="3" height="44"><a href=".\/quienes.htm" onMouseOver="MM_swapImage(\'btn_quienes\',\'\',\'images\/btn_quienes_on.gif\',1)" onMouseOut="MM_swapImgRestore()" ><img src="images\/btn_quienes.gif" name="btn_quienes" width="74" height="44" border="0" id="btn_quienes"><\/a><img src="images\/navspacer.gif" width="3" height="44"><a href=".\/soluciones.htm" onMouseOver="MM_swapImage(\'btn_soluciones\',\'\',\'images\/btn_soluciones_on.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images\/btn_soluciones.gif" name="btn_soluciones" width="90" height="44" border="0" id="btn_about"><\/a><img src="images\/navspacer.gif" width="3" height="44"><a href=".\/servicios.htm" onMouseOver="MM_swapImage(\'btn_servicios\',\'\',\'images\/btn_servicios_on.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images\/btn_servicios.gif" name="btn_servicios" width="90" height="44" border="0" id="btn_servicios"><\/a><img src="images\/navspacer.gif" width="3" height="44"><a href=".\/clientes.htm" onMouseOver="MM_swapImage(\'btn_clientes\',\'\',\'images\/btn_clientes_on.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images\/btn_clientes.gif" name="btn_clientes" width="72" height="44" border="0" id="btn_clientes"><\/a><img src="images\/navspacer.gif" width="3" height="44"><a href=".\/empleo.htm" onMouseOver="MM_swapImage(\'btn_empleo\',\'\',\'images\/btn_empleo_on.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images\/btn_empleo.gif" name="btn_empleo" width="72" height="44" border="0" id="btn_empleo"><\/a><img src="images\/navspacer.gif" width="3" height="44"><a href=".\/contacto.htm" onMouseOver="MM_swapImage(\'btn_contacto\',\'\',\'images\/btn_contacto_on.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images\/btn_contacto.gif" name="btn_contacto" width="72" height="44" border="0" id="btn_contacto"><\/a><img src="images\/navspacer.gif" width="3" height="44"><a href=".\/intranet.htm" onMouseOver="MM_swapImage(\'btn_intranet\',\'\',\'images\/btn_intranet_on.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images\/btn_intranet.gif" name="btn_intranet" width="74" height="44" border="0" id="btn_intranet"><\/a><img src="images\/navspacer.gif" width="3" height="44"><\/td>\n        <\/tr>\n      <\/table>\n<\/td>\n  <\/tr>\n<\/table>');
}

function Dibuja_Cabecera_Completa() {
	document.writeln('<table width="1002" border="0" cellpadding="0" cellspacing="0">\n  <tr> \n    <td width="100%" height="44" background="images\/topbg1.gif">\n	<table width="100%" border="0" cellspacing="0" cellpadding="0">\n        <tr>\n          <td><a href=".\/index.htm" onMouseOver="MM_swapImage(\'btn_inicio\',\'\',\'images\/btn_inicio_on.gif\',1)" onMouseOut="MM_swapImgRestore()" ><img src="images\/btn_inicio.gif" name="btn_inicio" width="69" height="44" border="0" id="btn_inicio"><\/a><\/td>\n		  <td width="3" valign="top" background="images\/pixi_white.gif"><img src="images\/pixi_white.gif" width="3" height="44"><\/td>\n		  <td><img src="images\/topbg1.gif" width="5" height="44"><\/td>\n<td width="3" valign="top" background="images\/pixi_white.gif"><img src="images\/pixi_white.gif" width="8" height="44"><\/td>\n<td><img src="images\/topbg1.gif" width="187" height="44"><\/td>\n<td width="100%"><img src="images\/navspacer.gif" width="3" height="44"><a href=".\/quienes.htm" onMouseOver="MM_swapImage(\'btn_quienes\',\'\',\'images\/btn_quienes_on.gif\',1)" onMouseOut="MM_swapImgRestore()" ><img src="images\/btn_quienes.gif" name="btn_quienes" width="74" height="44" border="0" id="btn_quienes"><\/a><img src="images\/navspacer.gif" width="3" height="44"><a href=".\/soluciones.htm" onMouseOver="MM_swapImage(\'btn_soluciones\',\'\',\'images\/btn_soluciones_on.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images\/btn_soluciones.gif" name="btn_soluciones" width="90" height="44" border="0" id="btn_about"><\/a><img src="images\/navspacer.gif" width="3" height="44"><a href=".\/servicios.htm" onMouseOver="MM_swapImage(\'btn_servicios\',\'\',\'images\/btn_servicios_on.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images\/btn_servicios.gif" name="btn_servicios" width="90" height="44" border="0" id="btn_servicios"><\/a><img src="images\/navspacer.gif" width="3" height="44"><a href=".\/clientes.htm" onMouseOver="MM_swapImage(\'btn_clientes\',\'\',\'images\/btn_clientes_on.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images\/btn_clientes.gif" name="btn_clientes" width="72" height="44" border="0" id="btn_clientes"><\/a><img src="images\/navspacer.gif" width="3" height="44"><a href=".\/empleo.htm" onMouseOver="MM_swapImage(\'btn_empleo\',\'\',\'images\/btn_empleo_on.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images\/btn_empleo.gif" name="btn_empleo" width="72" height="44" border="0" id="btn_empleo"><\/a><img src="images\/navspacer.gif" width="3" height="44"><a href=".\/contacto.htm" onMouseOver="MM_swapImage(\'btn_contacto\',\'\',\'images\/btn_contacto_on.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images\/btn_contacto.gif" name="btn_contacto" width="72" height="44" border="0" id="btn_contacto"><\/a><img src="images\/navspacer.gif" width="3" height="44"><a href=".\/intranet.htm" onMouseOver="MM_swapImage(\'btn_intranet\',\'\',\'images\/btn_intranet_on.gif\',1)" onMouseOut="MM_swapImgRestore()"><img src="images\/btn_intranet.gif" name="btn_intranet" width="74" height="44" border="0" id="btn_intranet"><\/a><img src="images\/navspacer.gif" width="3" height="44"><\/td>\n        <\/tr>\n      <\/table>\n<\/td>\n  <\/tr>\n\n  <tr> \n    <td width="1002" height="91" background="images\/redbg1.gif">\n      <table width="1002" border="3" cellpadding="0" cellspacing="0">\n        <tr>\n <td width="256" ><img src="images\/Imagen1.jpg" width="256" height="92"><\/td>\n  <td width="3" bgcolor="#C3C2C2"><\/td>\n  <td width="586"><img src="images\/Logo_COTLAN.jpg" title="Soluciones de Comunicación" width="586" height="92"><\/td>\n <td width="2" bgcolor="#C3C2C2"><\/td>\n 	<td width="140"><img src="images\/Imagen2.jpg" width="140" height="92"><\/td>\n        <\/tr>\n       <\/table>\n     <\/td>\n  <\/tr>\n<\/table>');
}


/////////////////////////////////////////////////////////////////////////////
////// Código para sacar un mensaje en la barra de estado
/////////////////////////////////////////////////////////////////////////////

function BarraEstado(texto) {
	var frase = "<<---------- "+ texto + " ---------->>";
	var buffer1="                    ";
	var buffer2="                    ";
	var mensaje=buffer1+frase+buffer2;
	window.status=mensaje;
}


//////////////////////////////////////////////////////
///////// Código para inserción de fecha
//////////////////////////////////////////////////////

function makeArray(len) 
{
	for (var i = 0; i < len; i++) this[i] = null;
	this.length = len;
}

function MuestraReloj(){
if (!document.layers&&!document.all&&!document.getElementById)
return;

 var Digital=new Date()
 var hours=Digital.getHours()
 var minutes=Digital.getMinutes()
 var seconds=Digital.getSeconds()


 // Array de los meses
var monthNames = new makeArray(12);
monthNames[0] = "Enero";
monthNames[1] = "Febrero";
monthNames[2] = "Marzo";
monthNames[3] = "Abril";
monthNames[4] = "Mayo";
monthNames[5] = "Junio";
monthNames[6] = "Julio";
monthNames[7] = "Agosto";
monthNames[8] = "Sept";
monthNames[9] = "Octubre";
monthNames[10] = "Noviemb";
monthNames[11] = "Diciemb";

// Array de los días

var dayNames = new makeArray(7);
dayNames[0] = "Domingo";
dayNames[1] = "Lunes";
dayNames[2] = "Martes";
dayNames[3] = "Mi&eacute;rcoles";
dayNames[4] = "Jueves";
dayNames[5] = "Viernes";
dayNames[6] = "S&aacute;bado";

var now = new Date();
var year = now.getYear();

var dia = now.getDate();
var mes = now.getMonth() + 1;


if (year < 2000) year = year + 1900;

var dn="PM"
if (hours<12)
dn="AM"
if (hours>12)
hours=hours-12
if (hours==0)
hours=12

if (minutes<=9)
	minutes="0"+minutes
if (seconds<=9)
	seconds="0"+seconds
if (dia<=9)
	dia="0"+dia
if (mes<=9)
	mes="0"+mes


myclock="<font size='2' face='Arial' >"+dayNames[now.getDay()] + ", " + dia + "-" + mes + "-"+year+"</br><div align='center'><font size='3'><b>"+hours+":"+minutes+":"+seconds+" "+dn+"</b></font></div></font>"

if (document.layers){
document.layers.reloj.document.write(myclock)
document.layers.reloj.document.close()
}
else if (document.all)
	reloj.innerHTML=myclock
else if (document.getElementById)
	document.getElementById('reloj').innerHTML=myclock

setTimeout("MuestraReloj();",1000)
}



///////////////////////////////////////////////////
//////////  Funciones para jugar con las capas
///////////////////////////////////////////////////

function muestraCapa(capa)
{
	if (document.all)
	{
		document.all[capa].style.visibility="visible";
	}
	else
	{
		document.getElementById(capa).style.visibility = "visible";
	}
	
}

function ocultaCapa(capa)
{
	if (document.all)
	{
		document.all[capa].style.visibility="hidden";
	}
	else
	{
		document.getElementById(capa).style.visibility = "hidden"; 
	}
}

function ocultarTodo()
{
	for (i=0; ele=document.getElementsByTagName('div')[i]; i++)
		ele.style.visibility = 'hidden';
}
