function NewWindow(mypage, myname, w, h, scroll)
{
   var winl = (screen.width - w) / 2;
   var wint = (screen.height - h) / 2;
   winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable=no';
   win = window.open(mypage, myname, winprops);
   if (parseInt(navigator.appVersion) >= 4) 
   {
      win.window.focus();
   }
}

function timeOfDay(){
   now = new Date();
   if (now.getHours()<2)
   {
   document.write("Good morning! Yes, it's way past midnight.");
   }
   else if (now.getHours()<8)
   {
   document.write("Good morning! Up bright and early!");
   }
   else if (now.getHours()<12)
   {
   document.write("Good morning.");
   }
   else if (now.getHours()<17)
   {
   document.write("Good Afternoon.");
   }
   else if (now.getHours()<18)
   {
   document.write("I hope you are finishing work soon...");
   }
   else if (now.getHours()<23)
   {
   document.write("Good Evening, kick back and relax.");
   }
   else
   {
   document.write("A late good evening! Not much left of it now.");
   }
}

function trainingDay(){
   var Today=new Date();
   var ThisDay=Today.getDay();
   function DayTxt (DayNumber) {
   var Day=new Array();
   Day[0]="Sunday";
   Day[1]="Monday";
   Day[2]="Tuesday";
   Day[3]="Wednesday";
   Day[4]="Thursday";
   Day[5]="Friday";
   Day[6]="Saturday";
   return Day[DayNumber];
   }
   var DayName=DayTxt(ThisDay);
   if ( DayName == "Wednesday" || DayName == "Friday"){
      document.write("Training Day, don't forget.");
   }
}

function externalLinks(){ 
   if (!document.getElementsByTagName){
      return;
   }
    
   var forms = document.getElementsByTagName("form"); 
   for(var i = 0; i < forms.length; i++) 
   { 
      var form = forms[i];
      if(form.getAttribute("action").substring(0, 4) == "http"){ 
         form.target = "_blank"; 
      }
      
   } 
} 

