// Tratamiento de Fechas

function getYear() {
   date = new Date();
   var year = date.getYear()   
   if (year<200)
   		year+=1900;
   return year;
}   

// Apertura de ventana copyright
function WinOpen()
{
        open("/copyright.html","Password","toolbar=no,directories=no,menubar=no,width=500,height=300,scrollbars=yes")
}


function display_title() {
  var hours = date.getHours();
  var message = '';

  if (hours >= 6) { time_of_day = 'Buenos Días'; message='Morning Message';}
  if ((hours >= 14) && (hours < 21)) { time_of_day = 'Buenas Tardes'; message='Afternoon Message'}
  if (hours >= 21) { time_of_day = 'Buenas Noches'; message='Evening Message';}
  if ((hours >= 0) && (hours < 6)){ time_of_day = 'Buenas Noches'; message='Night Message';}

  document.write('<left>' + time_of_day + ' </left>');
}

function display_date() {

   date = new Date();

   var day_of_week_number = date.getDay();
   var day_of_month = date.getDate();
   var month_number = date.getMonth();
   var year = getYear();
   var day_of_week = '';
   var month = '' 

   if(month_number == 0){month = 'Enero';}
   if(month_number == 1){month = 'Febrero';}
   if(month_number == 2){month = 'Marzo';}
   if(month_number == 3){month = 'Abril';}
   if(month_number == 4){month = 'Mayo';}
   if(month_number == 5){month = 'Junio';}
   if(month_number == 6){month = 'Julio';}
   if(month_number == 7){month = 'Agosto';}
   if(month_number == 8){month = 'Septiembre';}
   if(month_number == 9){month = 'Octubre';}
   if(month_number == 10){month = 'Noviembre';}
   if(month_number == 11){month ='Diciembre';}


   if(day_of_week_number == 0){day_of_week = 'Domingo';}
   if(day_of_week_number == 1){day_of_week = 'Lunes';}
   if(day_of_week_number == 2){day_of_week = 'Martes';}
   if(day_of_week_number == 3){day_of_week = 'Miercoles';}
   if(day_of_week_number == 4){day_of_week = 'Jueves';}
   if(day_of_week_number == 5){day_of_week = 'Viernes';}
   if(day_of_week_number == 6){day_of_week = 'Sábado';} 

   var date_to_show = day_of_week + ',  ' + day_of_month + '  ' + month +  '  ' + year + ' ';

   document.write('<left>' + date_to_show.fontcolor("black") + '</left>');

}


function getDirectory(requestURI)
{
  return (requestURI.substring(1,requestURI.indexOf("/",1)));
}

function getPath(requestURI)
{
  return (requestURI); 
}


 
