jQuery(function(){
	// bind the onclick to the more link
	jQuery(".expandable .more").bind("click", function(){
		// show/hide the div containing the text
		if ( jQuery(this).next("div").is(":hidden") ) {
			jQuery(this).next("div").slideDown();
		} else {
			jQuery(this).next("div").hide();
		}
	});
});


jQuery('ul#superLinkbar div li').toggle(function() {
	//jQuery(this).find('span#arrow').text("&#9650;");
	jQuery(this).find('span#arrow-down').hide();
	jQuery(this).find('span#arrow-up').show();
	
}, function() {
	//jQuery(this).find('span#arrow').text("&#9660;");
	jQuery(this).find('span#arrow-up').hide();
	jQuery(this).find('span#arrow-down').show();
});


jQuery(document).ready(function(){
	jQuery('#cycle').cycle({
		fx:         'fade',
		timeout:     3000,
		pager:      '#cycle_nav',
		//pagerEvent: 'mouseover',
		fastOnEvent: true,
		before:      onBefore  // transition callback (scope set to element that was shown):  function(currSlideElement, nextSlideElement, options, forwardFlag) 
	});
});

// Render the titles for the images
//	2009-12-05 MFC
function onBefore(curr, next, opts){
	// Get the ID for the current photo
	// Get the ID number after the ":", and build the jquery statement
	var idFld = jQuery(next).attr("id");
	var currNum = idFld.slice(idFld.indexOf(":") + 1, idFld.length);
	var pIDTag = "div.cycle_title div#" + currNum;
	
	// Hide all the titles
	jQuery(".carouselOverlay").hide();
	//console.log(currNum);
	
	// Show this p tag id
	jQuery(pIDTag).show();
}

//jCarousel
jQuery(document).ready(function() {
			jQuery('#mycarousel').jcarousel({
				wrap: 'first',
				scroll:3
			});
		});
