function getNumberImages (intNumIn) {

  var strOut = new String ();
  var strNumIn = new String (intNumIn);

  if (strNumIn.length == 2) {

    var strTens = strNumIn.substring(0, 1);
    var strOnes = strNumIn.substring(1, 2);

    strOut = '<img src="images/count/' + strTens + '.png" vspace="0" hspace="0"><img src="images/count/' + strOnes + '.png" vspace="0" hspace="0">';

  } else if (strNumIn.length == 1) {
    strOut = '<img src="images/count/0.png" vspace="0" hspace="0"><img src="images/count/' + strNumIn + '.png" vspace="0" hspace="0">';
  } else {
    strOut = '<img src="images/count/0.png" vspace="0" hspace="0"><img src="images/count/0.png" vspace="0" hspace="0">';
  }

  return strOut;

}

function calcage(secs, num1, num2) {
  s = ((Math.floor(secs/num1))%num2).toString();
  return s;
}

function countdown() {

var currentDate = new Date(); // Today's Date

var targetDate = new Date(); // Date we are counting down to
targetDate.setDate(18);
targetDate.setMonth(3); // (from 0-11; month), (from 1-31; date)
targetDate.setFullYear(2011);
targetDate.setHours(10);
targetDate.setMinutes(0);
targetDate.setSeconds(0);
targetDate.setMilliseconds(0);

var dthen = new Date("3/18/2011 10:00");
var dnow = new Date();

var ddif = dthen - dnow; // The time left in milliseconds
var msec = Math.floor(ddif.valueOf()/1000);

days = calcage(msec,86400,100000);
hours = calcage(msec,3600,24);
mins = calcage(msec,60,60);
sec = calcage(msec,1,60);

/* Add Leading Zeros to Hours, Min, Sec */
if (sec < 10) {
    sec = '0'+sec;
}
if (mins < 10) {
    mins = '0'+mins;
}
if (hours < 10) {
    hours = '0'+hours;
}
if (days < 10) {
  days = '0' + days;
}

var intWidth = screen.availWidth;

intWidth = intWidth - 300;
intWidth = intWidth / 2;

strHTMLCountDown = '<div style="position: absolute; top: 40px; left: ' + intWidth + 'px; font-weight: bold; font-size: 18px; color: #000000; width: 300px; text-align: center; z-index: 1000;">'
  + days + ' days, '
  + hours + ' hours<br>'
  + mins + ' minutes, '
  + sec
  + ' seconds<br>to New NBC Website Launch</div>';

document.getElementById('countdown_days').innerHTML = strHTMLCountDown;
var t = setTimeout('countdown();',1000);
}

