// JavaScript Document


  var timerID = null
  var timerRunning = false
  function MakeArray(size) 
  {
  this.length = size;
  for(var i = 1; i <= size; i++)
  {
  this[i] = "";
  }
  return this;
  }
  function stopclock (){
  if(timerRunning)
  clearTimeout(timerID);
  timerRunning = false
  }
  function showtime () {
  var now = new Date();
  year = new String(now.getYear())
//  alert(year);
//  yearLen = year.length
 // year = year.split("")
  //year = year[yearLen - 2] + year[yearLen - 1]
  var month = now.getMonth() + 1;
  var date = now.getDate();
  var hours = now.getHours();
  var minutes = now.getMinutes();
  var seconds = now.getSeconds();
  var day = now.getDay();
  Day = new MakeArray(7);
  Day[0]="Domingo";
  Day[1]="Lunes";
  Day[2]="Martes";
  Day[3]="Miércoles";  // Conjunto de nombres de días de la semana.
  Day[4]="Jueves";
  Day[5]="Viernes";
  Day[6]="Sábado";
  var timeValue = "";
  
  if(Day[day] > 9)
  timeValue+=" "+ Day[day];
 
//  timeValue += (Day[day]);
  
  timeValue += date

  if(month=='8'){
  timeValue+=" de Agosto" 
  }else if(month=='1'){
  timeValue+=" de Enero" }
  else if(month=='2'){
  timeValue+=" de Febrero"}
  else if(month=='3'){
  timeValue+=" de Marzo"}
  else if(month=='4'){
  timeValue+=" de Abril"}
   else if(month=='5'){
  timeValue+=" de Mayo"}
    else if(month=='6'){
  timeValue+=" de Junio"}
    else if(month=='7'){
  timeValue+=" de Julio"}
  else if(month=='8'){
  timeValue+=" de Agosto"}
    else if(month=='9'){
  timeValue+=" de Septiembre"}
    else if(month=='10'){
  timeValue+=" de Octubre"}
    else if(month=='11'){
  timeValue+=" de Noviembre"}
    else if(month=='12'){
  timeValue+=" de Diciembre"}
    
  timeValue +=" de " + year + " ";// ((month < 10) ? " 0" : " ") + month + "/";
  //timeValue += date + "-" + year + "    ";                  // Creación del formato de la hora (y día).
  timeValue += ((hours <= 12) ? hours : hours - 12);
  timeValue += ((minutes < 10) ? ":0" : ":") + minutes;
  timeValue += ((seconds < 10) ? ":0" : ":") + seconds;
  timeValue += (hours < 12) ? " AM" : " PM";
  document.jsfrm.face.value = timeValue;
  timerID = setTimeout("showtime()",1000);     // Llamada a la función mostrar hora cada segundo.
  timerRunning = true
  }
  function startclock () {
  stopclock();
  showtime()
  }
