theDate = new Date();
theHours = theDate.getHours();
if (theHours >= 0) theText = "Доброй ночи";
if (theHours >= 6) theText = "Доброе утро";
if (theHours >= 11) theText = "Добрый день";
if (theHours >= 18) theText = "Добрый вечер";
document.writeln (theText);