// JavaScript Document

// used on home page with cycle gallery - nb. accordion is for fade in on news column (left)

// ----------------------------
// cycle slideshow script -----
// ----------------------------
$(document).ready(function() { 

	var cycleoptns = { // NB. set attributes for cycle in variable 
		fx: 'scrollRight',
		timeout: 3000,
		speed: 500,
		delay: -2000,
		pager: '#pager',
		next: '#next',
		prev: '#prev'	
	}													 

	$('#gallery').cycle(cycleoptns); // end cycle()
	
	$('#playControl').toggle(
			function() {
				$('#gallery').cycle('pause');
				$(this).text('Play');
			},
			function() {
				$('#gallery').cycle('resume');
				$(this).text('Pause');
			});	

});

// ----------------------------
// fade in --------------------
// ----------------------------

$(document).ready(function() {

	function makeVisible(elem) {
 		
		  var cssObj = {
			'visibility' : 'visible'
		  }
		  
		  $(elem).css(cssObj);
		  $(elem).hide();
		  $(elem).fadeIn(500);
	  
	 } 
	 
	 // call function 	
	 makeVisible("#gallery"); 
	 makeVisible("#accordion");  
});
