/**
 * @author Vinicius Becker
 * @e-mail viniciusbecker@ymail.com
 */
now = new Date()
hour = now.getHours()
day = now.getDate()
year = now.getFullYear()

weekday = new Array(7)
weekday[0] = 'domingo'
weekday[1] = 'segunda-feira'
weekday[2] = 'terça-feira'
weekday[3] = 'quarta-feira'
weekday[4] = 'quinta-feira'
weekday[5] = 'sexta-feira'
weekday[6] = 'sábado'

month = new Array(12)
month[0] = 'janeiro'
month[1] = 'fevereiro'
month[2] = 'março'
month[3] = 'abril'
month[4] = 'maio'
month[5] = 'junho'
month[6] = 'julho'
month[7] = 'agosto'
month[8] = 'setembro'
month[9] = 'outubro'
month[10] = 'novembro'
month[11] = 'dezembro'

switch (true) {
    case hour >= 6 && hour < 12:
        document.write('Bom dia, hoje é ' + weekday[now.getDay()] + ', ' + day + ' de ' + month[now.getMonth()] + ' de ' + year)
        break
    case hour >= 12 && hour < 18:
        document.write('Boa tarde, hoje é ' + weekday[now.getDay()] + ', ' + day + ' de ' + month[now.getMonth()] + ' de ' + year)
        break
    default:
        document.write('Boa noite, hoje é ' + weekday[now.getDay()] + ', ' + day + ' de ' + month[now.getMonth()] + ' de ' + year)
}

