var finalDate = "June 26, 2008 9:00 AM CST";

var end = new Date(finalDate);
var endOffset = end.getTime() / 100;

window.onload = function() {
   //calcTime();
   //setInterval("calcTime()", 100);
}

function calcTime() {
   
   var now = new Date();
   var startOffset = now.getTime() / 100;

   var length = Math.floor(endOffset - startOffset);

   days = Math.floor(length / 864000);
   length = length % 864000;

   hours = Math.floor(length / 36000);
   length = length % 36000;

   minutes = Math.floor(length / 600);
   length = length % 600;

   seconds = length / 10;

   // Add trailing zero for seconds, i.e. 5 becomes 5.0
   if (length % 10 == 0) seconds += ".0";

   // If the deadline has been passed, set everything to zero
   if (endOffset < startOffset) {
      days = hours = minutes = seconds = 0;
	  window.location="http://www.virtualinvestingseminar.com";
	  
	  
   }

   var finalString = "The Next VIS Starts in  " + days + " Days, " + hours + " Hours, " + minutes + " Minutes, " + seconds ;

   getObject("countDown").innerHTML = finalString;
}

function getObject(name) {
   var ns4 = (document.layers) ? true : false;
   var w3c = (document.getElementById) ? true : false;
   var ie4 = (document.all) ? true : false;

   if (ns4) return eval('document.' + name);
   if (w3c) return document.getElementById(name);
   if (ie4) return eval('document.all.' + name);
   return false;
}


