$(document).ready(function() {
	//Homepage carousel
	$('#carousel_alternative').hide();
	$('#carousel').show();
	
	function mycarousel_initCallback(carousel) {
		jQuery('.jcarousel-control a').bind('click', function() {
			carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
			return false;
		});
	};
	function highlight(carousel, obejctli,liindex,listate){
		 jQuery('.jcarousel-control li:nth-child('+ liindex +') a').attr("class","selected");
	};
	function removehighlight(carousel, obejctli,liindex,listate){
		 jQuery('.jcarousel-control li:nth-child('+ liindex +') a').removeAttr("class","selected");
	};
	jQuery(document).ready(function() {
		jQuery("#home_carousel").jcarousel({
			scroll: 1,
			auto: 5,
			initCallback: mycarousel_initCallback,
			itemVisibleInCallback:  highlight,
			itemVisibleOutCallback: removehighlight,
			buttonNextHTML: null,
			buttonPrevHTML: null,
			wrap:"last",
			visible:1
		});
	});
});


