starting_date='October 17, 2009 13:00 GMT';
 ending_date='October 18, 2009 13:00 GMT';
 amount='150312';

// Sarcastic Gamer - Extra Life

// CONFIGURE HERE
// YES, HERE
//starting_date = &quot;October 13, 2009 13:40 GMT&quot;; // keep in mind it's GMT! GT = CST + 5
//ending_date = "October 14, 2009 13:40 GMT"; // and it's 24-hour clock
//amount = "120000"; // USD
// and don't even dare touch anything below

window.onload = function() {
  execute(); // start the preliminary function
}

 function countdown() // the actual countdown
 {
 var output = document.getElementById('extralifeoutput');
  
 d = new Date();
  offset = d.getTime() + d.getTimezoneOffset();
  d = new Date(offset);

count = new Date(ending_date);
count = count.getTime();
  
  echo = '$';
  tamount = "" + amount;
  
  // two possibilites: the countdown has finished, or not
  
  if (raised >= amount || count <=0) {
  // if finished: show amount
    if (tamount.length > 3) {
    for (i = 0; i < tamount.length; i++) {
      echo += tamount.substring (i, i+1);
      if (i == (tamount.length - 4)) {
      echo += ','; }
    }
    } else {
    for (i = 0; i < tamount.length; i++) {
      echo += tamount.substring (i, i+1);
    }
    }
    output.innerHTML = '<span id="extralife1">We have raised <span id="extralife2">'+echo+'</span></span>';

  } else {
  // if not: show the 'raised' variable
  tamount = "" + raised;
  if (tamount.length > 3) {
    for (i = 0; i < tamount.length; i++) {
      echo += tamount.substring (i, i+1);
      if (i == (tamount.length - 4)) {
      echo += ','; }
    }
    } else {
    for (i = 0; i < tamount.length; i++) {
      echo += tamount.substring (i, i+1);
    }
    }
  output.innerHTML = '<span id="extralife1">We have raised <span id="extralife2">'+echo+'</span></span>';
  raised = Math.round(raised + part);
  setTimeout("countdown()", 1000);
  }
  
}
 
 function execute() { // the preliminary function
 
d = new Date();
offset = d.getTime() + d.getTimezoneOffset();
d = new Date(offset);

begin = new Date(starting_date);
end = new Date(ending_date);

// increases every second: 1 sec = 1000 miliseconds
tobegin = ((d.getTime()-begin.getTime())/1000);
toend = ((end.getTime()-d.getTime())/1000);

// 24 hours * 3600 seconds = 86400
difference = 86400;

part = (amount / difference);

raised = Math.round(tobegin * part);

countdown();
}

// have a nice day!