mainNav = function() {
	$("#topnav li").bind("mouseenter",function(){
                this.className += "_over over";
	}).bind("mouseleave",function(){
                this.className = this.className.replace("_over over", "");
	});
}
jQuery(document).ready(function() {

	// home top stage
	$('.newsSlider .stgslide').cycle({
        	fx: 'fade',
		timeout: 5000,
		speed: 700,
	        before: function() {
			$('.stghrtxt').html($('.stgslidecontent', this).html());
		},
	        pager: '.stgbtnwrpr .stgbtngrp',
        	pagerAnchorBuilder: function(idx, slide) {
	            idxNUM = idx + 1;
        	    return '<div class="stgbtnoff">' + idxNUM + '</div>';
	        }
	});

	$('.newsSlider .stgbtngrp .stgbtnoff').click(function(){
		$('.newsSlider .stgslide').cycle('pause').delay(2000).cycle('resume');
	});

// home top stage
	$('.newsSliderNew .stgslide').cycle({
        	fx: 'fade',
		timeout: 5000,
		speed: 700,
	        before: function() {
			$('.stghrtxt').html($('.stgslidecontent', this).html());
		},
	        pager: '.stgbtnwrpr .stgbtngrp',
        	pagerAnchorBuilder: function(idx, slide) {
	            idxNUM = idx + 1;
        	    return '<div class="stgbtnoff">' + idxNUM + '</div>';
	        }
	});

	$('.newsSliderNew .stgbtngrp .stgbtnoff').click(function(){
		$('.newsSliderNew .stgslide').cycle('pause').delay(2000).cycle('resume');
	});



    $(".latestWidget").jcarousel({
        scroll: 3,
        visible: 3,
        buttonNextHTML: '<div class="next">Next &raquo;</div>',
        buttonPrevHTML: '<div class="prev">&laquo; Prev</div>'
    }); 

	

$.fn.cycle.updateActivePagerLink = function(pager, currSlideIndex) {
    $(pager).find('div').removeClass('stgbtnon')
        .filter('div:eq(' + currSlideIndex + ')').addClass('stgbtnon');
};

function gallery_initCallback(carousel) {
	var listTotal = jQuery('#gallery li').length;

	jQuery('.mod-gallery954 #main_image').bind('img_change', function() {
	    var num = parseInt((jQuery('.mod-gallery954 .caption').text()).split(";", 1)[0]) - 3;
	    var location = parseInt(jQuery('.mod-gallery954 .caption').text().split(";", 2)[0]) + 1;

	    jQuery('.mod-gallery954 .caption').html(jQuery('.caption').text().split(";", 2)[1]);
	    jQuery('.mod-gallery954 .tracker').html(location + " of " + listTotal);

	    carousel.scroll(num);
	    return false;
	});
};

jQuery(function($) {

	//tabs
	$('.tabWidget > ul').tabs();

});});
