function Countdown(str_bgcolor){
	this.yr=2010; this.mo=2; this.dy=19; this.hr=17; this.mn=1; this.sc=0;
	document.getElementById("beerbox").style.backgroundColor = str_bgcolor;
	this.countTime();
}

Countdown.prototype.timeBetween = function(yr, mo, dy, hr, mn, sc) {
	  this.nDate = new Date(); // current date (local)
	  this.nTime = this.nDate.getTime(); // current time (UTC)
	  this.dTime = Date.UTC(yr, mo - 1, dy, hr, mn, sc); // specified time (UTC)
	  this.bTime = (this.dTime - this.nTime)  // time difference
	  if(this.bTime/1000<0){this.bTime=(this.bTime+604800000);
	  }else{this.bTime=this.bTime;}//RS
	  return (this.bTime/1000); //return seconds not milliseconds
}

Countdown.prototype.countTime=function()
{
	var MINUTE = 60; // the number of seconds in a minute
	var HOUR = MINUTE * 60; // the number of seconds in an hour
	var DAY = HOUR * 24; // the number of seconds in a day

	var totalSecs=this.timeBetween(this.yr,this.mo,this.dy,this.hr,this.mn,this.sc);

	var daysUntil=Math.floor(totalSecs/DAY);
	var hrsUntil= Math.floor(totalSecs/HOUR)-(daysUntil*24);
	var minsUntil=Math.floor(totalSecs/MINUTE)-((daysUntil*24*60)+(hrsUntil*60));
	var secsUntil=totalSecs-((daysUntil*24*60*60)+(hrsUntil*60*60)+(minsUntil*60));

	this.dayStr=String(daysUntil);

	if(hrsUntil<10){ this.hrStr="0"+String(hrsUntil);
	}else{this.hrStr=String(hrsUntil);}

	if(minsUntil<10){ this.minStr="0"+String(minsUntil);
	}else{this.minStr=String(minsUntil);}

	if(secsUntil<10){ this.secStr="0"+String(secsUntil);
	}else{this.secStr=String(secsUntil);}

	var d=(this.dayStr >1||this.dayStr==0)?" days ":" day ";
	var h=(this.hrStr >1||this.hrStr==0)?" hours ":" hour ";
	var m=(this.minStr >1||this.minStr==0)?" minutes ":" minutes ";
	if(this.dayStr >-1){var b=" until ";
	}else{var b=" since";}//RS

	if(this.bTime/1000<406800){if(this.bTime/1000>0){this.displayString="<a href='beer-countdown.html' class='whitel'><b>"+this.dayStr+"</b>"+d+"<b>"+this.hrStr+"</b>"+h+"<b>"+this.minStr+"</b>"+m+b+" beer time....</a>";
	}else{this.displayString="<a href='beer-countdown.html' class='whitel'><b>Even if it's not beer time, have a beer.</b></a>";}//RS
	}else{this.displayString="<a href='beer-countdown.html' class='whitel'><b>Beer Time!!</b></a>";}//RS
	this.displayNums();
	setTimeout('thisCountdown.countTime()',60000);
}

Countdown.prototype.displayNums=function()
{
	document.getElementById("beertext").innerHTML=this.displayString;
}