function checktime(){
	var thisday=new Date();
	var hour=thisday.getHours();
	if (hour < 12 && hour >= 6){text = document.createTextNode("Good Morning!");}
	if(hour >= 12 && hour < 18){text = document.createTextNode("Good Afternoon!");}
	if(hour >= 18 && hour < 22){text = document.createTextNode("Good Evening! We trust you have had a good day.");}
	if (hour >= 22 || hour < 4){text = document.createTextNode("It's late, you really ought to get to bed.");}
	if (hour >= 4 && hour < 6){text = document.createTextNode("It's early, you shouldn't be up yet.");}
	document.getElementById("greet").appendChild(text);
}

function doPopups(){
  if (!document.getElementsByTagName) return false;
  var links = document.getElementsByTagName("a");
  for (var i=0; i < links.length; i++) {
    if (links[i].className.match("newpage")) {
      links[i].onclick = function() {
        window.open(this.href);
        return false;
      }
    }
  }
}
window.onload=function(){
doPopups();
checktime();
}
