/*
Customized jQuery actions
*/

$(function() {
	
//--// Checkbox submit //
	$(".perfCheckbox").click(function() {
		$("form#performances").submit();
	});
//--// end checkbox submit //
	

//**// Mouse over change text //
	$('a.tool-hover').mouseover(function() {
		$('#tool-text').html(this.id);
	});
	$('a.tool-hover').mouseout(function() {
		$('#tool-text').html('&nbsp;');
	});
//**// end mouse over change text //


//^^// Hide Submit Button for those who have javascript enabled //^^//
	$("#submitter").hide();
//^^// end hide Submit Button //^^//

//^^// Hide and unhide some random stuff for those who have javascript enabled //^^//
	$(".inlineContent").hide();
	$(".showblock").show();
	$(".showblock-links").show();
//^^// end hide Submit Button //^^//
	
	
//##// Hide and move between photo sets //##//	
	$('#content-photos>ul').hide();
	$('#content-photos>ul:first-child').show();
	$('#photo-prev').click(
		function() {
			$('#content-photos>ul:visible').fadeOut(100).prev('#content-photos>ul').fadeIn(600);
			if ($('#content-photos>ul:visible').length < 2) {
				$('#content-photos>ul:last').fadeIn(600);
			}
		}
	);
	$('#photo-next').click(
		function() {
			$('#content-photos>ul:visible').fadeOut(100).next('#content-photos>ul').fadeIn(600);
			if ($('#content-photos>ul:visible').length < 2) {
				$('#content-photos>ul:first').fadeIn(600);
			}
		}
	);
//##// END Hide and move between photo sets //##//	
	
	
	
	
	
	
//------------------------------old stuff below
	

	// // Slide in and out sections of information wihin the body of a page // //
	// http://andylangton.co.uk/articles/javascript/jquery-show-hide-multiple-elements/
	
		// choose text for the show/hide link - can contain HTML (e.g. an image)
		var showText="MORE >>";
		var hideText="<< LESS";
		
		// append show/hide links to the element directly preceding the element with a class of "toggle"
		$(".toggle").prev().append(' <a href="#" class="toggleLink">'+showText+'</a>');
		
		// hide all of the elements with a class of 'toggle'
		$('.toggle').hide();
		
		// capture clicks on the toggle links
		$('a.toggleLink').click(function() {
		
			// change the link depending on whether the element is shown or hidden
			if ($(this).text()==showText) {
				$(this).text(hideText);
			} else {
				$(this).text(showText);
			}
			
			// toggle the display
			$(this).parent().next('.toggle').slideToggle();
			
			// return false so any link destination is not followed
			return false;
		});



	

});
