var cd_seconds = 400208;
function ud(x) { return ( x < 10 ? "0"+x : x ); }  
function cd_upd(secs)
{	
	if( secs < 1 ){document.getElementById('sc_cd').innerHTML = "Now!";return;}
	hh = parseInt(secs/3600);	
	mmt = secs - (hh * 3600);	
	mm = parseInt(mmt/60);	
	ss = mmt - (mm * 60);	
	if (hh > 23) {dd = hh / 24;dd = parseInt(dd);hh = hh - (dd * 24);} else { dd = 0; }
	document.getElementById('sc_cd_dd').innerHTML = ud(dd);
	document.getElementById('sc_cd_hh').innerHTML = ud(hh);
	document.getElementById('sc_cd_mm').innerHTML = ud(mm);
	document.getElementById('sc_cd_ss').innerHTML = ud(ss);
}
function sc_countdown()
{
  cd_upd(parseInt(cd_seconds));  
  cd_seconds = cd_seconds - 1;
  setTimeout('sc_countdown()', 1000);
}
var css ="<style type=\"text/css\">";
css += "#sc_cd_w a {display: block; height: 150px; width: 175px; background:url(http://static.studiocalico.com/images/widgets/countdown2/sneak_bg.jpg?1264677247) no-repeat; text-align: center; text-decoration: none; padding-top: 6px; position: relative;}";
css += "#sc_cd_w a span#sc_cd {background: #ffffff; color: #000; font: 17px Georgia, Arial; text-decoration: none;}";
css += "#sc_cd_w span#sc_cd span {position: absolute;}";
css +="#sc_cd_w #sc_cd_dd {left: 40px;}";
css +="#sc_cd_w #sc_cd_hh {left: 69px;}";
css +="#sc_cd_w #sc_cd_mm {left: 96px;}";
css +="#sc_cd_w #sc_cd_ss {left: 123px;}";
css += "</style>";
var html = "<div id=\"sc_cd_w\"><a href=\"http://www.studiocalico.com\" target=\"_new\"><span id=\"sc_cd\"><span id=\"sc_cd_dd\">_</span><span id=\"sc_cd_hh\">_</span><span id=\"sc_cd_mm\">_</span><span id=\"sc_cd_ss\">_</span></span></a></div>";
document.write(css);
document.write(html);
sc_countdown();
