<!-- 
 /* 
                     Countdown to Year 2000 Plus
 This script will show the time left until the Year 2000 and 
 then to each succeeding year until the year 2101.

 You may use the JavaScript source code on your own personal web page 
 provided that the copyright information remains in the source code. 

 Insert the script where the countdown is to appear.
 Add  onLoad="startCD()" to the BODY tag.

 Copyright (c) by: Robert N Bovara All Rights Reserved.
 */
var agnt=navigator.userAgent.toLowerCase()
var opera=(agnt.indexOf("opera") != -1)
var webTV=(agnt.indexOf("webtv") != -1)
var hotjava=(agnt.indexOf("hotjava") != -1)
var layersok=(document.layers&&!hotjava)
var doc_all=(document.all&&!webTV)
var itsa4=(layersok||doc_all)
var itsa5=(document.getElementById&&parseInt(navigator.appVersion)>=5) ? true : false;
var Lvl=(opera?0:(doc_all?2:(itsa5?3:(layersok?1:0))));

var classfntsize="10"		// font-size for scripted text	
var classfntfam="arial,helvetica,sans-serif"	//font-family
var classfntwgt=600		// font-weight
var classbldcolor="#000099"	// bold font-color

var id4css="jsid4CntDown"
var id4layer="CntDownId"
var id4class="CntDown"
var sTag="<DIV id='"+id4layer+"'>"
var eTag="<\/DIV>"
var strtWidth=544

var cntTo=2000
var BegYr=1996
var today
var thisYear
var thisMon
var thisDay
var thisHour
var thisMinute
var thisSecond
var DispMsg=""
var ap=""
var blank=" "
function AraVob() {
 for(i=0;i<AraVob.arguments.length; i++)
  this[i] = AraVob.arguments[i];
}
var daytab = new AraVob(0,31,28,31,30,31,30,31,31,30,31,30,31)
var Montab=new AraVob("","Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec");

function Do_Date() {
 today = new Date()
 thisYear = today.getYear();
 if (thisYear < 1000)  thisYear+=1900;
 thisMon = today.getMonth()
 thisDay = today.getDate()
 thisHour = today.getHours()
 thisMinute = today.getMinutes()
 thisSecond = today.getSeconds()
  //  getMonth returns a value from 0 to 11 (as you might expect) but
  //  getDate returns a value from 1 to 31!  Go Figure! (rnb)
 thisMon += 1
 cntTo=2000
 if (1999<thisYear){
  cntTo=thisYear+1
 }
}

Do_Date()

function DisplayTime(){
 Do_Date() 
 // The following crude leap year check should work through 2199. 
 // (if and when browsers and systems are century and year compliant)
 // years prior to 1996, when I wrote the original script, will be invalid.
 // 2000 is a leap year. 2100 and 2200 are not.
 var lpYr=BegYr
 while (lpYr<thisYear){
  lpYr +=4
  if (lpYr==2100){
   lpYr +=4
  }
 }
 if (thisYear==lpYr){
  daytab[2] = 29
 }
 else{
  daytab[2] = 28
 }
 var Yearleft = cntTo-1-thisYear
 var Monleft = 12 - thisMon
 var DaysLeft = daytab[thisMon] - thisDay
 var Hourleft = 23 - thisHour
 var Minuteleft = 59 - thisMinute
 var Secondleft = 59 - thisSecond
 if (Yearleft==0) sYearleft=""
 else {
  sYearleft=Yearleft+" years, "}

 if (Monleft==0&&sYearleft=="") sMonleft=""
 else {
  sMonleft=Monleft+" months, "}

 if (DaysLeft==0&&sMonleft=="") sDaysLeft=""
 else {
  sDaysLeft=DaysLeft+" days, "}
 if (Hourleft==0&&sDaysLeft=="") sHourleft=""
 else {
  sHourleft=Hourleft+" hours, "}
 if (Minuteleft==0&&sHourleft=="") sMinuteleft=""
 else {
  sMinuteleft=Minuteleft+" minutes, "}
 sSecondleft=Secondleft+" seconds."
 if (thisYear<BegYr){
  DispMsg="Either your system date is incorrect or your browser should be upgraded."
 }
 else if (2100<thisYear){
  DispMsg="Script must be updated to process years after 2100."
 }
 else{
  DispMsg=""+sYearleft+sMonleft+sDaysLeft+sHourleft+sMinuteleft+sSecondleft
 }
 if (thisHour<12)  ap=" am"
 else ap=" pm"
 if (thisHour==0) thisHour=12
 if (12<thisHour) thisHour -=12
 if (thisMinute<10){
  thisMinute="0"+thisMinute
 }
 if (thisSecond<10){
  thisSecond="0"+thisSecond
 }
 var AsOf="As of "+Montab[thisMon]+" "+thisDay+", "+thisYear
     +" at " +thisHour+":"+thisMinute+":" +thisSecond+ap
     +", the time remaining to year "+cntTo+" is:"
 var timeInner="<p class='"+id4class+"'>"+AsOf+"<br>"
     +"<b class='"+id4class+"'>"+DispMsg+"</b></p>"

 if (Lvl>2){
  layur1.firstChild.replaceData(0,(AsOf.length+1),AsOf)  
  layur2.firstChild.replaceData(0,(DispMsg.length+5),DispMsg)  
 }
 else if (Lvl==2) {
  ieSet()
  layur.innerHTML=timeInner;
 }
 else if (Lvl==0){
  document.forms[0].elements[0].value=" "+AsOf
  document.forms[0].elements[1].value=" "+DispMsg
 }
 else {
  if (self.innerWidth != strtWidth) {
   window.location.reload()
  }
  else {
  layur.document.write(timeInner)
  layur.document.close()
  }
 }
 setTimeout("DisplayTime()",900)
}

function NNlode(){
 if (self.innerWidth!= strtWidth) {
  window.location.reload()
 }
}

function ieSet(){
 if (document.body.clientWidth!= strtWidth) {
  strtWidth=document.body.clientWidth
  layur.style.width=strtWidth
 }
}

if (Lvl>0) {
 var Style="."+id4class
 +"{font-family:"+classfntfam
 +"; font-weight:"+classfntwgt
 +"; font-size:"+classfntsize+"pt"
 +"; text-align:center"
 +"; color:black;}"
 document.writeln("<STYLE ID='"+id4css+"' TYPE='text/css'>"+Style+"</style>")
 if (Lvl==1) {
  var Hgt=classfntsize*4
  var Wdth=innerWidth
  sTag="<ilayer id='"+id4layer+"'><layer id='"+id4class+"' left=0 top=0 width="+Wdth+" height="+Hgt+">"
  eTag="<\/layer><\/ilayer>"
  eval("document.classes."+id4class+".b.color=classbldcolor;")
 }
 else if (Lvl==2){
  eval("document.styleSheets['"+id4css+"'].addRule ('#'+id4layer, 'position:relative;')")
  eval("document.styleSheets['"+id4css+"'].addRule ('b.'+id4class, 'color:'+classbldcolor)")
  eval("document.styleSheets['"+id4css+"'].addRule ('#'+id4layer, 'left:0')")
 }
 document.writeln(sTag+eTag)
 eval("layur =(Lvl==2?document.all."+id4layer+":(Lvl==3?document.getElementById('"+id4class+"'):(Lvl==1?document."+id4layer+".document."+id4class+":'')));")
 for (var x = 1; x<3; x++) {
  if (Lvl>2) document.write("<center><span id='"+id4class+x+"' class='"+id4class+"'>&nbsp;<br><\/span><\/center>")
 }
}
else{
var formtxt=""
formtxt="<p><center><form name= 'msgform' action=' '>"
formtxt+="<input type='text' size=76 name='messag1'"
formtxt+=" value=\"Time flies when you're having fun.\""
formtxt+=" usestyle bgcolor='#fffff0' readonly>"
formtxt+="<input type='text' size=76 name='messag2'"
formtxt+=" value='Are you having fun yet?.'"
formtxt+=" usestyle bgcolor='#fffff0' readonly>"
formtxt+="</form></center></p>"
document.write(formtxt)
}

function startCD(){
 if (Lvl>2) {
  layur1 = document.getElementById(id4class+'1')
  layur2 = document.getElementById(id4class+'2')
  layur2.style.color=classbldcolor
 }
 if (Lvl==1){
  strtWidth = self.innerWidth;
  self.onresize=NNlode
 }  
 if (Lvl==2){ ieSet() }
 DisplayTime()
}
// -->