// Slideshow Settings
$(function() {
    $('#SlideshowContainer').hover(
        function() { $('#PlayPauseControls').fadeIn(); },
        function() { $('#PlayPauseControls').fadeOut(); }
    );

	$('#PlayPauseControls div').toggle(
	  function () {
		$(this).addClass('play');
		$(this).removeClass('pause');
		$('#Slideshow').cycle('pause'); 
	  },
	  function () {
		$(this).removeClass('play');
		$(this).addClass('pause');
		$('#Slideshow').cycle('resume'); 
	  }
	);
     
    $('#Slideshow').cycle({
        fx: 'fade',
        timeout: 1000,
	    speed: 1000,
		cleartype: 1,
		cleartypeNoBg: true
    });
});

// Table Settings
$(document).ready(function() {	
	$('table.calendar tbody tr:even').addClass('even');
});

// Expand Collapse Settings
$(document).ready(function() {
	$('.newsletter').slideUp('slow');					   
	$('.heading, .expandCollapse').click(function() {
		//REMOVE THE ON CLASS FROM ALL BUTTONS
		$(this).addClass('on');
		//NO MATTER WHAT WE CLOSE ALL OPEN SLIDES
		$(this).next().slideUp('normal');
		//IF THE NEXT SLIDE WASN'T OPEN THEN OPEN IT
		if($(this).next().is(':hidden') == true) {
			//ADD THE ON CLASS TO THE BUTTON
			$(this).removeClass('on');
			//OPEN THE SLIDE
			$(this).next().slideDown('normal');
		} 
	});
});

$(document).ready(function() {
	$('.trophyList').slideUp('slow');					   
	$('.viewRecipients').click(function() {
		//REMOVE THE ON CLASS FROM ALL BUTTONS
		$(this).addClass('on');
		//NO MATTER WHAT WE CLOSE ALL OPEN SLIDES
		$(this).next().slideUp('normal');
		//IF THE NEXT SLIDE WASN'T OPEN THEN OPEN IT
		if($(this).next().is(':hidden') == true) {
			//ADD THE ON CLASS TO THE BUTTON
			$(this).removeClass('on');
			//OPEN THE SLIDE
			$(this).next().slideDown('normal');
		} 
	});
});


