$(document).ready(function(){
	$(".noutate").mouseover(function () {
		$(".data-noutate",this).css("color","#fff");
		$(".data-noutate",this).css("font-weight","bold");
    });
	$(".noutate").mouseout(function () {
		$(".data-noutate",this).css("color","#199DDA");
		$(".data-noutate",this).css("font-weight","normal");
    });
	
	jQuery("#mycarousel").jcarousel({
        scroll: 1,
        auto: 4,
        wrap:'last',
        initCallback: mycarousel_initCallback,
        itemVisibleInCallback: {onBeforeAnimation: mycarousel_itemVisibleInCallback},
        buttonNextHTML: null,
        buttonPrevHTML: null
    });

});

function mycarousel_initCallback(carousel) {
    jQuery('.jcarousel-control a').bind('click', function() {
        carousel.scroll(jQuery.jcarousel.intval(jQuery(this).attr("title")));
        return false;
    });

    jQuery('#mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });

    jQuery('#mycarousel-next').bind('click', function() {
        carousel.next();
        return false;
    });

    jQuery('#mycarousel-prev').bind('click', function() {
        carousel.prev();
        return false;
    });

}

function mycarousel_itemVisibleInCallback(carousel, item, i, state, evt)
{
	$('.casuta_nr_sel').removeClass('casuta_nr_sel');

	$("#d"+i).removeClass('casuta_nr');
	$("#d"+i).addClass('casuta_nr_sel');
}
