function mycarousel_initCallback(carousel) {
//	jQuery('.jcarousel-control a').bind('click', function() {
//		carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
//		return false;
//	});
//	
//	jQuery('.jcarousel-scroll select').bind('change', function() {
//		carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
//		return false;
//	});
	
	jQuery('#mycarousel-next').bind('click', function() {
		carousel.next();
		return false;
	});
	
	jQuery('#mycarousel-prev').bind('click', function() {
		carousel.prev();
		return false;
	});
	
	jQuery('#mycarousel-play').bind('click', function() {
		carousel.options.auto = 9;
		carousel.next();
		return false;
	});
	
	jQuery('#mycarousel-pause').bind('click', function() {
		carousel.options.auto = 0;
		
		return false;
	});
	
	carousel.scroll(1);
};

function mycarousel_itemVisibleIn(carousel, li, index, state) {

	$("div.slider_box_selected").attr("class","slider_box");	
	var pos = index;	
	if(document.getElementById("slider_box_"+(pos-1)) != null){
	  document.getElementById("slider_box_"+(pos-1)).className = "slider_box_selected";
	}
	try {
		var newHeight = $(li).get(0).offsetHeight;
		/*if(jQuery("#index") != null && jQuery("#index").get(0) != undefined){
		  jQuery("#index").get(0).innerHTML = index;
		}
		jQuery("#newsitems").get(0).style.height = newHeight + "px";
		jQuery("#mycarousel").parent().parent().get(0).style.height = newHeight
				+ 30 + "px";*/
	} catch (e) {
		
	}
	return false;
}

function initNewsScroll() {
	jQuery(document).ready(function() {
		jQuery("#mycarousel").jcarousel({
			scroll: 1,
			visible: 1,
			auto: 9,
			animation: 300,
			wrap: "last",
			initCallback: mycarousel_initCallback,
			itemVisibleInCallback: mycarousel_itemVisibleIn,
			buttonNextHTML: null,
			buttonPrevHTML: null
		});
	});
}