// Funciones para mostrar la Fecha con el formato indicado
function muestraFecha()
{
	mesarray=new Array("Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio","Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre");
	diaarray=new Array( "Domingo","Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado");
	hoy = new Date();
	dias = hoy.getDate();
	dia = hoy.getDay();
	mes = hoy.getMonth();
	mes=mesarray[mes];
	dia =diaarray[dia];
	anno = hoy.getYear();
	if (anno <200)
	  anno = anno+1900;
	  document.write('<TABLE WIDTH="130" height="60" BORDER="0"><CENTER><TR><TD><CENTER>');
	  document.write('<FONT SIZE="2" COLOR="#000000"><B>'+mes+ ' </B></FONT>');
	  document.write('<FONT SIZE="1" COLOR="#000000">'+anno+'</FONT><br>');
	  document.write('<FONT SIZE="1" COLOR="#000000">'+dia+'</FONT><br>');
	  document.write('<FONT SIZE="4" COLOR="#000000" FACE="Arial"><B>'+dias+'</B></FONT><br>');
	  document.write('</CENTER></TR></TD></TABLE>');            
}

//Funcion para mostrar Reloj Digital en la Página con formato HH:MM:SS		
function muestraReloj()
{
	// Comprueba si se puede ejecutar el script en el navegador del usuario
	if (!document.layers && !document.all && !document.getElementById) return;
	// Obtención de la hora actual y se divide en Horas, Minutos y Segundos
	var fechacompleta = new Date();
	var horas = fechacompleta.getHours();
	var minutos = fechacompleta.getMinutes();
	var segundos = fechacompleta.getSeconds();
	var mt = "AM";
	// Cambiar el formato 12 horas
	if (horas > 12) 
	{
		mt = "PM";
		horas = horas - 12;
	}
	if (horas == 0) horas = 12;
	// Cambiar minutos y segundos con dos dígitos
	if (minutos <= 9) minutos = "0" + minutos;
	if (segundos <= 9) segundos = "0" + segundos;
	// En la variable 'cadenareloj' se puede cambiar los colores y el tipo de fuente
	cadenareloj = "<font size='1' face=Tw Cen MT' ><b>" + horas + ":" + minutos + ":" + segundos + " " + mt + "</b></font>";
	// Escribe el reloj de una manera u otra, según el navegador del usuario
	if (document.layers) 
	{
		document.layers.spanreloj.document.write(cadenareloj);
		document.layers.spanreloj.document.close();
	}
	else if (document.all) spanreloj.innerHTML = cadenareloj;
	else if (document.getElementById) document.getElementById("spanreloj").innerHTML = cadenareloj;
	// Ejecuta la función con un intervalo de un segundo
	setTimeout("muestraReloj()", 1000);
}
