function getCookieVal (offset) 
  {
    var endstr = document.cookie.indexOf (";", offset);
    if (endstr == -1)
      endstr = document.cookie.length;
    return unescape(document.cookie.substring(offset, endstr));
  }

function GetCookie (name) 
  {
    var arg = name + "=";
    var alen = arg.length;
    var clen = document.cookie.length;
    var i = 0;
    while (i < clen) 
	  {
        var j = i + alen;
        if (document.cookie.substring(i, j) == arg)
          return getCookieVal (j);
        i = document.cookie.indexOf(" ", i) + 1;
        if (i == 0) break; 
      }
   return null;
  }  

function auto_show_name() 
  {
    if(GetCookie("lbc") != null)
	  return GetCookie('lbc');
    else 
	  {
        //document.write("<FORM>Please enter your name: <INPUT TYPE = \"text\" NAME = \"nameinput\">" + "<BR><BR><INPUT TYPE = \"button\" VALUE = \"Save to Cookie\" onClick = \"set_name(this.form)\"></FORM>");
        //document.write("Please enter your first name in the input" + " box and press the \"Save to Cookie\" button, then the page will automatically reload. ");
		//window.open("welcome.html",'welcome','width=450,height=200,left=200,top=200');
      }
  }

  //**************************************************************************************
  // Personalization 
  //**************************************************************************************
  visitorsname=auto_show_name(); 
  if (visitorsname==null || visitorsname=="undefined")
     visitorsname='<a href="#"  onclick="window.open(\'initwelcome.html\',\'welcome\',\'width=450,height=300,left=200,top=200\')">Your name here</a>';
  else if (visitorsname=="none")
     visitorsname="";
  else
     visitorsname='<a href="#" class="subs" onclick="window.open(\'initwelcome.html\',\'welcome\',\'width=450,height=300,left=200,top=200\')"><font color=red>'+visitorsname+'</font></a>';	 	 
  		  	      
 // for all date displays
 //by Bill Sanders. billsanders@yahoo.com
 //submitted and displayed at www.a1javascripts.com
 today = new Date();
 year = (today.getFullYear) ? today.getFullYear() : today.getYear();
 month = today.getMonth();
 switch (month) 
	 {
	   case 0 : month = "Jan"; break;
	   case 1 : month = "Feb"; break;
	   case 2 : month = "Mar"; break;
       case 3 : month = "Apr"; break;
       case 4 : month = "May"; break;
       case 5 : month = "June"; break;
	   case 6 : month = "July"; break;
	   case 7 : month = "Aug"; break;
	   case 8 : month = "Sep"; break;
  	   case 9 : month = "Oct"; break;
	   case 10 : month = "Nov"; break;
   	   case 11 : month = "Dec"; break;
	 }
   date = today.getDate();
   day = today.getDay();
   switch (day) 
	 {
			 case 0 : day = "Sunday"; break;
			 case 1 : day = "Monday"; break;
			 case 2 : day = "Tuesday"; break;
			 case 3 : day = "Wednesday"; break;
			 case 4 : day = "Thursday"; break;
			 case 5 : day = "Friday"; break;
			 case 6 : day = "Saturday"; break;
	 }
   hours = today.getHours();
   if (hours<12)  greeting = 'Good Morning ' + visitorsname + "!";
   if (hours<18 && hours>11)  greeting = 'Good Afternoon '+ visitorsname + "!";
   if (hours<20 && hours>17)  greeting = 'Good Evening ' + visitorsname + "!";
   if (hours>19)  greeting = 'Good Evening ' + visitorsname + "!";
   hour = (hours>12) ? (hours-12) : hours;
   halfDay = (hours>11 && hours<24) ? 'PM' : 'AM';
   minutes = today.getMinutes();
// dayStr =  day+ ', ' +date+ '&nbsp;' +month+ ',&nbsp;' +year;
// dayStr =  date+ '&nbsp;' +month+ ',&nbsp;' +year;	
   dayStr =  month+ '&nbsp;' +date+ ',&nbsp;' +year;	
   timeStr = (minutes<10) ? hour+ ':0' +minutes+ ' ' +halfDay : hour+ ':' +minutes+ ' ' +halfDay;

    //document.write('<font size=1 face=arial> ' + dayStr + '&nbsp;' + timeStr+ '</font><font size=2 color=red face=arial> &nbsp ' +   greeting + '</font>');
    document.write('<font size=1 face=arial color="red"><b> ' + dayStr + '&nbsp;' + timeStr+ '</b></font>');
   
//   document.write('<font size=1 face="Arial"><center> ' + dayStr + '&nbsp;' + timeStr+ '</center></font>');
   //document.write('<font size=2 color=red face="Arial"><center>' +   greeting + '</center></font>');
   