var slidePanel = '#slidePanel';
var slideContent = '#slideContent';
var slideButton = '#slideButton';
var slideClose = '#slideClose';

$(function(){

	var slidePanelTimeout = setTimeout("hideSlidePanel()", 5000);

	$(slideButton).click(function(){
		if($(slideButton).hasClass("active")){
			clearTimeout(slidePanelTimeout);
			hideSlidePanel();
		}else{
			clearTimeout(slidePanelTimeout);
			showSlidePanel();
		}
	});
	
	$(slideClose).click(function(){
		clearTimeout(slidePanelTimeout);
		hideSlidePanel();
	});
});
	
function hideSlidePanel(){
	$(slideClose).hide();
	$(slidePanel).animate({width: 30});
	$(slideButton).removeClass("active");	
}
function showSlidePanel(){
	$(slidePanel).animate({width: 275}, function () { $(slideClose).show(); });
	$(slideButton).addClass("active");
}
