function monthArray() {

	this[0] = "Janeiro";	this[1] = "Fevereiro";	this[2] = "Março";

	this[3] = "Abril";	this[4] = "Maio";	this[5] = "Junho";

	this[6] = "Julho";	this[7] = "Agosto";	this[8] = "Setembro";

	this[9] = "Outubro";	this[10] = "Novembro";	this[11] = "Dezembro";

    return (this);

}



function dayArray() {

	this[0] = "Domingo";	this[1] = "Segunda-feira";	this[2] = "Terça-feira";

	this[3] = "Quarta-feira";	this[4] = "Quinta-feira";	this[5] = "Sexta-feira";

	this[6] = "Sábado";

        return (this);

}





function formatYear(year)

{

  if (year > 1900) return year

  return year+1900;

}



function writeDate()

{

   days = new dayArray();

   months = new monthArray();

   d = new Date();

   day = d.getDate();

   month = d.getMonth();

   year = d.getYear();

   str = days[d.getDay()] + " " + day + " " + months[month] +" "+formatYear(year);

  document.writeln(str);

}



function writeTime()

{

   d = new Date();

   hour=d.getHours();

   min=d.getMinutes();

   sec=d.getSeconds();

   if (hour < 10) hour = "0"+hour;

   if (min < 10) min = "0"+min;

   if (sec < 10) sec = "0"+sec;

   str = hour+"h"+min;

   document.writeln(str);

}


