jQuery(document).ready(function($) {
 
    $('#slide-container').cycle({
        fx:    'fade',
        speed:  1500,
        timeout: 5000
    });
 
    $('#slide-container-links').cycle({
        fx:    'fade',
        speed:  2500,
        timeout: 5000
    });
    
	while(($children = $(':not(.parent)>.ngg-gallery-thumbnail-box:lt(4)')).length) {
    	$children.wrapAll($('<div class="parent"></div>'));
	}

	while(($children = $(':not(.parent)>.course-select-box:lt(4)')).length) {
    	$children.wrapAll($('<div class="parent"></div>'));
	} 
 


	$(".color-photo").hover(
		function() {
			$(this).stop().animate({"opacity": "0"}, "slow");
		},
		function() {
			$(this).stop().animate({"opacity": "1"}, "slow");
		});
 
	$(".course-select-box, .team-member-select-container").hover(function() {  
    		$(this).stop().animate({ backgroundColor: "#35CFCC"}, "slow");  
    	},function() {  
         	$(this).stop().animate({ backgroundColor: "#CACACA" }, "slow");  
    });  

	$('#course-slide-container').cycle({ 
    	fx:     'fade', 
    	speed:  0, 
    	timeout: 0, 
    	pager:  '#course-select-navigation', 
    	pagerAnchorBuilder: function(idx, slide) { 
        // return selector string for existing anchor 
        return '#course-select-navigation li:eq(' + idx + ') a'; 
    	} 
	});

	$('#team-slide-container').cycle({ 
    	fx:     'fade', 
    	speed:  0, 
    	timeout: 0, 
    	pager:  '#team-nav', 
    	pagerAnchorBuilder: function(idx, slide) { 
        // return selector string for existing anchor 
        return '#team-nav li:eq(' + idx + ') a'; 
    	} 
	});
});
