var Promotions = {
	tCount: null,
	tCurrent: 0,

	run: function() {
		this.tCount = $("div#promotions_element div.promotion_element").length;
		setInterval(Promotions.rotate, 3000)
	},
	
	rotate: function() {
		oldT = Promotions.tCurrent;
		Promotions.tCurrent++;
		if (Promotions.tCurrent == Promotions.tCount) {
			Promotions.tCurrent = 0;
		}
	
		newT = Promotions.tCurrent;
		
		$("div#promotions_element div.promotion_element").eq(oldT).fadeOut("slow", function() {
			$("div#promotions_element div.promotion_element").eq(newT).fadeIn("slow");
		});
	}
}

$(document).ready(function() {
 Promotions.run();
})
