// JavaScript Document

// Snapshot panels on homepage 

jQuery(document).ready(function($) {
    // $() will work as an alias for jQuery() inside of this function


	// EXPANDABLE BOXES


	$('.section-heading span').click( function() {		
		var id = $(this).attr('id');		
		var content_panel = id.replace(/-btn/,'');
		$('#'+content_panel).slideToggle();
		$(this).parent('div').parent('div').toggleClass('contracted');
		
						
		if ($(this).parent('div').parent('div').hasClass('contracted')) {
			$(this).text('click to expand');	
		} else {
			$(this).text('click to contract');
		}		
	
	});
	
	
	// TOOLTIP
	// Used on sidebar posters
	
	$('#left-col a.tooltip').tooltip({ 
		track: true, 
		opacity: 1,
		delay: 200, 
		showURL: false, 
		positionLeft: false, 
		bodyHandler: function() { 
			return $("<img/>").attr("src", this.rel); 
		} 
	});
	
	$('#right-col a.tooltip').tooltip({ 
		track: true, 
		opacity: 1,
		delay: 200, 
		showURL: false, 
		positionLeft: true, 
		bodyHandler: function() { 
			return $("<img/>").attr("src", this.rel); 
		} 
	});
	
	
	// FANCY BOX 
	
	/*
	
	$("a.fancy-box").fancybox({
		'zoomSpeedIn': 300,
		'zoomSpeedOut': 300,
		'zoomOpacity': true,
		'hideOnContentClick' : false,
		'overlayShow' : false
	});
	
	*/	
	
	
});
