


function data_hora() {
	var d = new Date;
	var dh=(saudacao(d)+" "+diasemana(d)+", "+dia(d)+" de "+mes(d)+" de "+ano(d)+".");
	return dh;
}	

function diasemana(d){
	var ds = "";
	var diasemana = d.getDay();
	
	
	switch(diasemana){
	case 0: this.ds ="Domingo";
	break;
	case 1: this.ds ="Segunda-feira";
	break;
	case 2: this.ds ="Ter&ccedil;a-feira";
	break;
	case 3: this.ds ="Quarta-feira";
	break;
	case 4: this.ds ="Quinta-feira";
	break;
	case 5: this.ds ="Sexta-feira";
	break;
	case 6: this.ds ="S&aacute;bado";
	}

	return this.ds;
}


function mes(d){
	var mes = d.getMonth();
	var m= "";
	
	switch(mes){

	case 0: this.m ="Janeiro";
	break;
	case 1: this.m ="Fevereiro";
	break;
	case 2: this.m ="Mar&ccedil;o";
	break;
	case 3: this.m ="Abril";
	break;
	case 4: this.m ="Maio";
	break;
	case 5: this.m ="Junho";
	break;
	case 6: this.m ="Julho";
	break;
	case 7: this.m ="Agosto";
	break;
	case 8: this.m ="Setembro";
	break;
	case 9: this.m ="Outubro";
	break;
	case 10: this.m ="Novembro";
	break;
	case 11: this.m ="Dezembro";
	break;
	
	}

	return this.m;
}





function dia(d){
	var dia = d.getDate();
	return dia;
}


function ano(d){
	var ano = d.getFullYear();
	return ano;
}

  function saudacao(d){
	  	
	  	var saudacao= "";
	  	
		if (d.getHours()< 12){
				this.saudacao=("Bom dia!");
		}

		else if(d.getHours()>= 12 && d.getHours()<=17){
				this.saudacao=("Boa tarde!");
		}
		else if (d.getHours()>= 18){
				this.saudacao=("Boa noite!");
		}
		return this.saudacao;		
  }
  

