/**
 * Builds the javascript necessary for the page layout
 * functionality on FAQ/News/Gallery
 */
window.addEvent('domready', function(){

		//Hide the right-side content panel
		//$('right').fade('hide');
		$('right').setStyle('opacity', 0);
		
		var toggler = false;		
				
		//Set thumbnails box to be off screen
		$('left').setStyle('margin-left',-200);
		//var fx3 = new Fx.Style('left', 'margin-left').set(-200);
		
		//Turn on the close button
		$('close').setStyle('display', 'block');
		//var fx4 = new Fx.Style('close', 'display').set('block');
		
		//Setup the slide event
	//	var fx_slide = new Fx.Tween($('left'), {duration:1000, wait:false});
		var fx_slide = new Fx.Style('left', 'margin-left', {duration:1000, wait:false});
		
		//Slide the thumbnail box open
		fx_slide.start(0);
		
		//Add open/close behavior
		$('close').addEvent('click', function(e){
			
			e = new Event(e).stop();
		
			if(toggler == false){
				
			
				$('right').effect('opacity', {duration: 700}).custom(1, 0);
				$('close').setProperty('class', 'opener');
				fx_slide.start(-180);
				toggler = true;
			}else{
				
				
				$('right').effect('opacity', {duration: 700}).custom(0, 1);
				$('close').setProperty('class', 'closer');
				fx_slide.start(0);
				toggler = false;
			}
			
			
		});	
		
		
		
		/**
		 * Attach a scrollbar to each element w/ the scrollable class
		 */			
	//	$$('.scrollable').each(function(element) {
	//		element.scr = new ScrollBar(element);
	//	});
	
		//Fade in the right content panel
		$('right').effect('opacity', {duration: 700}).custom(0, 1);	
		
	
});	

	