$(document).ready(function(){

	// initalize the promo slider
	$('#promos').cycle({ 
		fx:     'fade', 
		speed:  'slow', 
		timeout: 4500, 
		next:   '.promo-next', 
		prev:   '.promo-prev',
		pause: 1
	});
	
	$('#sponsors').cycle({
		fx:     'fade', 
		speed:  'slow', 
		timeout: 3000, 
		pause: 1				 
	});
	
	 // used to initalize the gallery or galleries on a page
	$(function() {
		//$('a.enlarge').lightBox();
		$('div.gallery a').lightBox();
	});
	
	
	// submenu
	$(".showmore").click(function(){
		$(".more").slideToggle("slow");
		$(".showmore .choices").toggle();
	});
	
	// hide all side menu items on load
	$("#submenu UL LI A").find("+ ul").hide(); 
	
	// span heading clicked, expand item, collapse others
	$("#submenu UL LI A").click(function() {
		$("#submenu UL LI UL LI").find("+ ul").slideUp("fast");
		$(this).find("+ ul").slideToggle("slow");
	});
	
	$(".expand-default").slideToggle("slow");
	
	//Static thermometer presentation based on value in custom field of home page
	//$("#campaign-progress-current").height(parseInt($("#campaign-progress-current span").text()));
	
	$("#campaign-progress-current").height(100);
	$("#campaign-progress-current").animate({height:"350px"},500).animate({height:"100px"},500).animate({height:"300px"},250).animate({height:"150px"},250).animate({height:"250px"},250).animate({height:"200px"},250).animate({height:parseInt($("#campaign-progress-current span").text())});


	
	//Debug thermometer version.
	//$("#campaign-progress-current").height(.20 * 480);
	
	
});
