function SSRSJS_scrollBar(objName, trgtId, barDir, fixDim, scrlBy, animate)
{
	var currMgn = 0;
	var actDim = fixDim;
	var trgt = document.getElementById(trgtId);
	var somethingRunning = false;
	animate = (animate == true)?animate:false;
	var obj = null;
	
	if(barDir == 'ver')
	{	actDim = trgt.offsetHeight;	}
	else if(barDir == 'hor')
	{	actDim = trgt.offsetWidth;	}
	
	this.myInit = function()
		{
			this.hookMouseWheel();
			obj = this;
		};
	
	this.scrollUpLeft = function()
		{
			if(somethingRunning == true)
			{	return false;	}
			
			if(animate == false)
			{	this.scrollUpLeftByPixels(scrlBy);	}
			else
			{
				for(i = 0; i < scrlBy; i++)
				{
					window.setTimeout(objName + '.scrollUpLeftByPixels(1);', i*10);
				}
			}
		};
	
	this.scrollDownRight = function()
		{
			if(somethingRunning == true)
			{	return false;	}
			
			if(animate == false)
			{	this.scrollDownRightByPixels(scrlBy);	}
			else
			{
				for(i = 0; i < scrlBy; i++)
				{
					window.setTimeout(objName + '.scrollDownRightByPixels(1);', i*10);
				}
			}
		};
	
	this.scrollUpLeftByPixels = function(pxs)
		{
			if((currMgn * -1) < (actDim - fixDim))
			{
				currMgn = currMgn - pxs;
				if(barDir == 'ver')
				{	trgt.style.marginTop = currMgn + 'px';	}
				else if(barDir == 'hor')
				{	trgt.style.marginLeft = currMgn + 'px';	}
			}
		};
	
	this.scrollDownRightByPixels = function(pxs)
		{
			if(currMgn < 0)
			{
				currMgn = parseInt(currMgn) + parseInt(pxs);
				if(barDir == 'ver')
				{	trgt.style.marginTop = currMgn + 'px';	}
				else if(barDir == 'hor')
				{	trgt.style.marginLeft = currMgn + 'px';	}
			}
		};
	
	this.hookMouseWheel = function()
		{
			if(trgt.addEventListener)
			{
				trgt.addEventListener('DOMMouseScroll', this.mouseScrolled, false);  
				trgt.addEventListener('mousewheel', this.mouseScrolled, false);
			}
			else if(trgt.attachEvent)
			{	trgt.attachEvent('onmousewheel', this.mouseScrolled);	}
		};
	
	this.mouseScrolled = function(evnt)
		{
			evnt = evnt ? evnt : window.event;
			var raw = evnt.detail ? evnt.detail : evnt.wheelDelta;
			var normal = evnt.detail ? evnt.detail * -1 : evnt.wheelDelta / 40;
			
			if(normal < 0)
			{	obj.scrollUpLeft();	}
			else if(normal > 0)
			{	obj.scrollDownRight();	}
			
			return obj.cancelWindowScroll(evnt);
		};
	
	this.cancelWindowScroll = function(evnt)
		{
			evnt = evnt ? evnt : window.event;
			if(evnt.stopPropagation)
				evnt.stopPropagation();
			if(evnt.preventDefault)
				evnt.preventDefault();
			
			evnt.cancelBubble = true;
			evnt.cancel = true;
			evnt.returnValue = false;
			return false;
		};
	
	this.myInit();
}
