var isExtended = 0;
var height = 450;
var width = 200;
var slideDuration = 100;
var opacityDuration = 0;

function extendContract(){
	
	if(isExtended == 0){
		
		sideBarSlide(0, height, 0, width);
		isExtended = 1;
		// make expand tab arrow image face left (inwards)
	}
	else{
		sideBarSlide(height, 0, width, 0);
		isExtended = 0;
	}

}

function sideBarSlide(fromHeight, toHeight, fromWidth, toWidth){
		
		
		if(toWidth == 0)
		   $('#sideBarContents').hide("fast");
		else
		{
           $('#sideBarContents').width(toWidth).height(toHeight);
		   $('#sideBarContents').show("normal");
		   
		   if(jQuery.browser.mozilla)
		    jQuery('#sideBarContents').css("float", "right");
		   
		}
}

function initSideBar(){
	$('#sideBarTab').bind('click', function(){extendContract()});
}

$(window).bind('load', function(){initSideBar()});