function dealsShiftyApeOpen ()
{
	$('#dealsShiftyApe').attr('src', '/images/daily-deals/title-ape-open.png');
}
function dealsShiftyApeClose ()
{
	$('#dealsShiftyApe').attr('src', '/images/daily-deals/title-ape.png');
}

function DailyDealsTimer (id, secondsRemaining) {
	this.id = id;
	this.secondsRemaining = secondsRemaining;

	this.timer;

	this.start = function() {
		this.renderDisplay();
		this.timer = window.setInterval(this.id+".tick()", 1000);

		window.setTimeout(this.id+".finish()", this.secondsRemaining * 1000);
	};

	this.tick = function() {
		this.secondsRemaining -= 1;
		this.renderDisplay();
	};

	this.renderDisplay = function() {
		var t = this.secondsRemaining;
		var hours = Math.floor(t / 3600); t -= hours * 3600;
		var minutes = Math.floor(t / 60); t -= minutes * 60;
		var seconds = Math.floor(t);

		$("#timer_hours").html(hours);
		$("#timer_minutes").html(padZero(minutes));
		$("#timer_seconds").html(padZero(seconds));
	};

	this.finish = function() {
		window.clearInterval(this.timer);
		window.setTimeout('window.location.reload()', 2000);
	};
}