// JavaScript Document

status = '';

function change(src,classe) { src.className = classe; }
function op(url) { window.open(url,'_self'); } 
function openw(theURL,winName,features) { window.open(theURL,winName,features); }
function redir(url) {window.open(url,'_self');}
function fechar(url) { window.close();}
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

// When the page loads: 
window.onload = function(){ 
if (document.getElementsByTagName) { 
// Get all the tags of type object in the page. 
var objs = document.getElementsByTagName("object"); 
for (i=0; i<objs.length; i++) { 
// Get the HTML content of each object tag 
// and replace it with itself. 
objs[i].outerHTML = objs[i].outerHTML; 
} 
} 
} 
// When the page unloads: 
window.onunload = function() { 
if (document.getElementsByTagName) { 
//Get all the tags of type object in the page. 
var objs = document.getElementsByTagName("object"); 
for (i=0; i<objs.length; i++) { 
// Clear out the HTML content of each object tag 
// to prevent an IE memory leak issue. 
objs[i].outerHTML = ""; 
} 
} 
} 

// ----------------------------- //

function writeDate(){
	var Today=new Date();
	var ThisDay=Today.getDay();
	var ThisDate=Today.getDate();
	var ThisMonth=Today.getMonth()+1;
	var ThisYear=Today.getFullYear(); //included if you wish to insert the year
	var DayName=DayTxt(ThisDay);
	var MonthName=MonthTxt(ThisMonth);
	var d = new Date();
	document.write(DayName+", "+ThisDate+" de "+MonthName+" de "+ThisYear+". ");
	var h = d.getHours();
	if (h < 12) document.write("Bom dia! ");
	else if (h < 18) document.write("Boa Tarde! ");
	else if (h < 24) document.write("Boa Noite! ");
}

function DayTxt (DayNumber) {
	var Day=new Array();
	Day[0]="Domingo";
	Day[1]="Segunda-Feira";
	Day[2]="Terça-Feira";
	Day[3]="Quarta-Feira";
	Day[4]="Quinta-Feira";
	Day[5]="Sexta-Feira";
	Day[6]="Sábado";
	return Day[DayNumber];
}

function MonthTxt (MonthNumber) {
	var Month=new Array();
	Month[1]="Janeiro";
	Month[2]="Fevereiro";
	Month[3]="Março";
	Month[4]="Abril";
	Month[5]="Maio";
	Month[6]="Junho";
	Month[7]="Julho";
	Month[8]="Agosto";
	Month[9]="Setembro";
	Month[10]="Outubro";
	Month[11]="Novembro";
	Month[12]="Dezembro";
	return Month[MonthNumber];
}

// ----------------- //


