TargetDate = "02/5/2008 12:00 AM";
DisplayFormat = "%%D%% %%H%% %%M%%";
var _CountDownString = '';
var _SecondsRemaining = Math.floor(new Date(new Date(TargetDate)-new Date()).valueOf()/1000);

function calcage(secs, num1, num2) {
   var s = ((Math.floor(secs/num1))%num2).toString();
   if (s.length < 2){ s = "0" + s; };
   return  s;
}

function CountBack(secs,str) {
   if (secs < 0) { return ''; }
   str = DisplayFormat.replace(/%%D%%/g, calcage(secs,86400,100000));
   str = str.replace(/%%H%%/g, calcage(secs,3600,24));
   str = str.replace(/%%M%%/g, calcage(secs,60,60));
   return str;
}

function drawCountDown(obj){
   setTimeout( function(){ _CountDownString = CountBack(_SecondsRemaining--,DisplayFormat); TickTock(obj); },1000); 
   setInterval( function(){ TickTock(obj); },60000);
}

function TickTock(obj){
   var _HTMLStringDate = '';
	var _newDate = _CountDownString;
	for(var i=0; i<_newDate.length; i++){
		if(_newDate.charAt(i)==' '){
		   _HTMLStringDate+='<img src="/images/counter-.gif"  width="14" height="20">';
		}else{
		   _HTMLStringDate+='<img src="/images/counter' + _newDate.charAt(i) + '.gif"  width="14" height="20">';
		}
	}
	obj.innerHTML = _HTMLStringDate;
}

setInterval( function(){ _CountDownString = CountBack(_SecondsRemaining--,DisplayFormat); },990)