//BILLBOARD
function formatText(index, panel) {
  return index + "";
}
$(function () {
	$('.anythingSlider').anythingSlider({
		easing: "easeInOutExpo",        // Anything other than "linear" or "swing" requires the easing plugin
		autoPlay: true,                 // This turns off the entire FUNCTIONALY, not just if it starts running or not.
		delay: 4000,                    // How long between slide transitions in AutoPlay mode
		startStopped: false,            // If autoPlay is on, this can force it to start stopped
		animationTime: 1000,             // How long the slide transition takes
		hashTags: true,                 // Should links change the hashtag in the URL?
		buildNavigation: true,          // If true, builds and list of anchor links to link to each slide
		pauseOnHover: true,             // If true, and autoPlay is enabled, the show will pause on hover
		startText: "Go",             // Start text
		stopText: "Stop",               // Stop text
		navigationFormatter: formatText       // Details at the top of the file on this use (advanced use)
	});
	
	$("#slide-jump").click(function(){
		$('.anythingSlider').anythingSlider(6);
	});
});





//BONE SHAKE
function load() {
	$('#bone img').effect('shake', { times:2 }, 1200);
}
$(document).ready(function() {
	//$('#shaker').hide().css('display','').fadeIn(600);
	var shake = setInterval(load, 1000);
	
	/* updated: click clear */
	$('#bone img').click(function() {
		clearInterval(shake);
	})	
});





//FROG BOUNCE
function periodical() {
	$('#shaker').effect('bounce', { times:2 }, 200);
}
$(document).ready(function() {
	//$('#shaker').hide().css('display','').fadeIn(600);
	var bounce = setInterval(periodical, 1000);
	
	/* updated: click clear */
	$('#shaker').click(function() {
		clearInterval(bounce);
	})	
});





//SCROLL
$(function()
	{
		// this initialises the demo scollpanes on the page.
		$('#pane1').jScrollPane();
		//$('#pane2').jScrollPane({showArrows:true});
		//$('#pane3, #pane4').jScrollPane({scrollbarWidth:20, scrollbarMargin:10});
		
		// this allows you to click a link to add content to #pane4 and shows how to 
		// reinitialise the scrollbars when you have done this.
		/*$('#add-content').bind(
			'click',
			function()
			{
				$('#pane4').append($('<p></p>').html($('#intro').html())).jScrollPane({scrollbarWidth:20, scrollbarMargin:10});
			}
		);*/
		// and this allows you to click the link to reduce the amount of content in
		// #pane4 and reinitialise the scrollbars.
		/*$('#remove-content').bind(
			'click',
			function()
			{
				$('#pane4').empty().append($('<p></p>').html($('#intro').html())).jScrollPane({scrollbarWidth:20, scrollbarMargin:10});
			}
		);*/
	});