// GLOBALS
var rightBar = "rightBar"; // Id of the element that hides and shows
var rightBarWrap = "rightBarWrapper"; // Id of element that contains the area that slide in and out
var barHandle = "rightBarHandle"; // Id of element that will be clicked to cause sliding animation
var barSpeed = 750; // Speed of the sliding animation
var barWidth = 200; // Width of the area that slides out

var barShow = false;
var barSlide;
var barHandleSlide;

function createRightBar()
{
	barSlide = new Fx.Morph(rightBarWrap, {duration: barSpeed, link: 'cancel', transition: Fx.Transitions.Sine.easeInOut});
	barHandleSlide = new Fx.Morph(barHandle, {duration: barSpeed, link: 'cancel', transition: Fx.Transitions.Sine.easeInOut});
	$(barHandle).addEvent('click',function(){
		if(barShow)
		{
			barSlide.start({"width":$(barHandle).offsetWidth+"px"}).chain(function(){
				resize();
			});
			barShow = false;
		}
		else
		{
			barSlide.start({"width":barWidth+$(barHandle).offsetWidth+"px"}).chain(function(){
				resize();
			});
			barShow = true;
		}
	});
}
