


 
// DOM Loaded 
$(function(){ 
     
    //init js styles 
    $('body').addClass('hasJS'); 
     
    // homepage cycles 
  
 	$('#feature_gallery .bigimg').wrapAll('<div class="bigimgs">').parents('#feature_gallery').after('<ul class="menu" id="feature_gallery_pager">').cycle({ 
 		fx: 'fade',
 		easing: 'linear',
        delay:    -2000, 
        drop:       40, 
        timeout:    4000, 
        pause:      1,
		pauseOnPagerHover: 1,
//		pagerClick: function(idx,slide) {
//			window.location = "http://204.14.165.177/" + slide.id;  	
//		},
		startingSlide: 0,
//		autostop: 9,
//		before:  onBefore,
        slideExpr: '.bigimg', 
        pager:      '#feature_gallery_pager',
        pagerAnchorBuilder: function(idx, slide) { 
            return '<li><a href="#"><img src="'+slide.title+'.jpg" class="thumb" border="0"><span></span></a></li>';
		//	return '<li><a href="'+slide.id+'" title="'+slide.title+'_thumb_on.jpg"><img src="spacer.gif" class="thumb"><span></span></a></li>';

        } 
		
    });
	
$(function() {
    jQuery('#feature_gallery_pager').jcarousel({
		scroll: 1,
		auto: 3,
        initCallback: mycarousel_initCallback    });
});

function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};
//$(function() {
//  $('ul#feature_gallery_pager li a.activeSlide').active(function() {
//    $("ul#feature_gallery_pager li a.activeSlide img").attr("src", $(this).attr("title"));
//  });
//});

	
function onBefore() { 
    $('#output').html("Scrolling image:<br>" + this.id); 
//   if (this.title=="images/CCCEWD_compete") {
//		$("ul#feature_gallery_pager li a.activeSlide img").attr("src", this.title+'_thumb_on.jpg');  
//   }
} 	
     
}); 


/* Window load event (things that need to wait for images to finish loading) */ 
//equal heights 

 

