function offersScroller(osId)
{
	this.id = osId;
	this.divObj = $(this.id);
	this.currentPos = 0;
	if(document.getElementById("hot_offers_window") == null){
		return;	
	}
	else{
		this.blockWidth = this.divObj.getElement("div.hot_offers_block").getSize().size.x;
		this.blockCount = this.divObj.getElements("div.hot_offers_block").length;
		$("hot_offers").addClass("enabled"); // Need to add the class using parentNode, but that is currently breaking in IE
		$(this.id).style.width = this.blockWidth*(this.blockCount+2)+"px";
	}
		
	this.showControl = function(control, state)
	{
		var scrollHeight = 10; //Top Height difference between the Scroller icons and Hot offers window
		hotOfferWindow = document.getElementById("hot_offers_window").scrollHeight;
		currTop = document.getElementById("hot_offers").offsetTop-scrollHeight;
		newTop =  (currTop + (hotOfferWindow/2))+'px';
		document.getElementById("offersControlRight").style.top = newTop;
		document.getElementById("offersControlLeft").style.top = newTop;

		if ( state==true )
		{
			$(control).style.visibility = "visible";
			var hideArrow =($(control).id)+"Disabled";
			document.getElementById(hideArrow).style.visibility = "hidden";
		} else {
			$(control).style.visibility = "hidden";
			var hideArrow =($(control).id)+"Disabled";
			document.getElementById(hideArrow).style.visibility = "visible";
			document.getElementById(hideArrow).style.top = newTop;
//			document.getElementById(hideArrow).style.top = (currTop + (hotOfferWindow/2))+'px';
//			offersControlRight
			//alert("currTop"+currTop+"....hotOfferWindow: "+hotOfferWindow);
		}
	}
	this.moveLeft = function()
	{
		if (this.currentPos>0 )
		{
			var targBlock = this.currentPos-2;
			this.scrollToBlock(targBlock);
		}
	}
	this.moveRight = function()
	{
		if ( this.currentPos<this.blockCount-2)
		{
			var targBlock = this.currentPos+2;
			this.scrollToBlock(targBlock);
		}
	}
	this.setButtonStates = function()
	{
		if ( this.currentPos==0 )
		{
			this.showControl("offersControlLeft", false);
		} else {
			this.showControl("offersControlLeft", true);
		}
		if ( this.currentPos==(this.blockCount-2))
		{
			this.showControl("offersControlRight", false);
		} else {
			this.showControl("offersControlRight", true);
		}
	}
	this.scrollToBlock = function (blockNum)
	{
		var xPosCurrent = this.currentPos * this.blockWidth;
		xPosCurrent = xPosCurrent-(xPosCurrent*2.062);
		this.currentPos = blockNum;
		var xPosNew =  this.currentPos * this.blockWidth;
		xPosNew = xPosNew-(xPosNew*2.062);
		this.divObj.effect('left',{
			duration: 1000,
			transition: Fx.Transitions.quartInOut
		}).start(xPosCurrent, xPosNew);
		this.setButtonStates();
	}
	this.setButtonStates();
}

var offersScroller;
window.addEvent("domready", function() {
	offersScroller = new offersScroller("hot_offers_inner");
});
