// JavaScript Document
function montharray(m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11)
{
   this[0] = m0;
   this[1] = m1;
   this[2] = m2;
   this[3] = m3;
   this[4] = m4;
   this[5] = m5;
   this[6] = m6;
   this[7] = m7;
   this[8] = m8;
   this[9] = m9;
   this[10] = m10;
   this[11] = m11;
}
 
function MakeArray(n) {this.length = n; return this;}
  var Days = new MakeArray(7);
  var Months = new MakeArray(12);
  Days[1]=""; Days[2]=""; Days[3]="";   Days[4]="";
  Days[5]=""; Days[6]=""; Days[7]="";
  Months[1]="ENERO"; Months[2]="FEBRERO"; Months[3]="MARZO";   Months[4]="ABRIL"; 
  Months[5]="MAYO"; Months[6]="JUNIO"; Months[7]="JULIO";   Months[8]="AGOSTO"; 
  Months[9]="SEPTIEMBRE"; Months[10]="OCTUBRE"; Months[11]="NOVIEMBRE"; 
  Months[12]="DICIEMBRE";
 
  function getNiceDate(theDate) {
  return Days[theDate.getDay()] + " " + theDate.getDate() + " " +
  Months[theDate.getMonth()+1] + " " + theDate.getYear(); }
 
 
function calendar()
{
   today = new Date();
   var thisDay;
   var monthNames = "JanFebMarAprMayJunJulAugSepOctNovDec";
   var monthNames2 = " 1 2 3 4 5 6 7 8 9101112";
   var monthDays = new montharray(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
   year = today.getFullYear();
   if(year<2000)year+=1900;
   thisDay = today.getDate();
   if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0))
      monthDays[1] = 29;
   nDays = monthDays[today.getMonth()];
   firstDay = today;
   firstDay.setDate(7);
   var lastMod = new Date();
   startDay = firstDay.getDay();
   document.write("<TABLE width=\"100%\" heigh=\"100%\" BORDER=\"1\" CELLPADDING=\"0\" cellspacing=\"1\" bordercolor=\"#e0e0e0\">");
   document.write("<TR><TH COLSPAN=7><font COLOR=\"#0099cc\" SIZE=\"-5\">");
   document.write(getNiceDate(lastMod));
   document.write("<TR><TH><font SIZE=\"-5\">L<TH><font SIZE=\"-5\">M<TH><font SIZE=\"-5\">Mi<TH><font SIZE=\"-5\">J<TH><font SIZE=\"-5\">V<TH><font SIZE=\"-5\">S<TH><font SIZE=\"-5\">D");
   document.write("<TR>");
   column = 0;
   for (i=0; i<startDay; i++)
   {
      document.write("<TD>");
      document.write("<CENTER>");
      document.write("&nbsp");
      column++;
   }
   for (i=1; i<=nDays; i++)
   {
      document.write("<TD><font SIZE=\"-5\">");
      if (column == 6) 
         document.write("<FONT COLOR=\"#cc0000\" SIZE=\"-5\">");
      if (column == 5) 
         document.write("<FONT COLOR=\"#cc0000\" SIZE=\"-5\">");               
      if (i == thisDay)
         document.write("<FONT COLOR=\"#0099cc\" SIZE=\"-5\"><b>");
      document.write("<CENTER>");
      document.write(i);
      document.write("</CENTER>");
      if (i == thisDay)
         document.write("</b>")
      if (column == 7||column == 0||i == thisDay) 
         document.write("</FONT>")
      column++;
      if (column == 7)
      {
         document.write("<TR>");
         column = 0;
      }
   }
   document.write("</TABLE>");
};