jQuery(document).ready(function() {

  
// home top stage
    $('.home-slider .stgslide').cycle({
        fx: 'fade',
		timeout: 5000,
		speed: 100,
		sync: true,
        before: onBefore,
        pager: ' .stgbtngrp',
        pagerAnchorBuilder: function(idx, slide) {
            idxNUM = idx + 1;
            return '<div class="stgbtnoff"><img src="images/window_thmb' + idxNUM + '.jpg"/></div>';
        }
    });

	$('.home-slider .stgbtngrp .stgbtnoff').click(function(){
		$('.home-slider .stgslide').cycle('stop');
	});

	// media slideshow base	
//	$('#media_cat .categoryList').cycle({ 
//		fx: 'scrollVert', 
//		timeout: 0,
//		next: '#media_cat .next', 
//		prev: '#media_cat .previous'
//	});	
//	


	$('#goto1').click(function() { 
        $('.home-slider .stgslide').cycle(0); 
        return false; 
    });
    $('#goto2').click(function() { 
        $('.home-slider .stgslide').cycle(1); 
        return false; 
    });
    
    	$('#goto3').click(function() { 
        $('.home-slider .stgslide').cycle(2); 
        return false; 
    });
    $('#goto4').click(function() { 
        $('.home-slider .stgslide').cycle(3); 
        return false; 
    });

	
 
$.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) {
    $(pager).find('div').removeClass('stgbtnon')
        .filter('div:eq(' + currSlideIndex + ')').addClass('stgbtnoff');
};


function onBefore() {
	$('.stghrimg').html($('.stgslideheading', this).html());
	$('.stghrtxt').html($('.stgslidecontent', this).html());

}



});