// http://www.gmarwaha.com/jquery/jcarousellite
jQuery(function() {
	// initialize carousel
	var maxShowItems = 5;
	var items = jQuery(".prodCarousselNavHo li").size();
	var showItems = Math.min(maxShowItems,items);
	var liWidth = 860;

	if (showItems > 0) {
		liWidth = Math.round(liWidth/showItems);
	}
	jQuery(".prodCarousselNavHo li").css("width",liWidth+"px");
	
	
	if (items <= maxShowItems) {
		// no buttons
	    jQuery(".prodCarousselNavHo").jCarouselLite({
	        visible: showItems,
	        circular: false
	    });
		// button transparency
		jQuery(".prodCarousselHo .cNav img").each(function() {
			jQuery(this).attr({
				src: (jQuery(this).attr("src")).replace("_on", "_off")
			});
		});
	    
		jQuery(".prodCarousselHo .cNav img").css("cursor","default");
	} 
	else {
	    jQuery(".prodCarousselNavHo").jCarouselLite({
	        btnNext: ".prodCarousselHo .cNext img",
	        btnPrev: ".prodCarousselHo .cPrev img",
	        visible: showItems,
	        circular: true
	    });
	}
	
	// hover, ausser im IE6
//	if (!is_ie6) {
//		jQuery(".prodCarousselNavHo li div").hover(
//				function () {
//					if (jQuery(this).css("backgroundImage") != "none") {
//						var src = jQuery(this).css("backgroundImage").split(".png)")[0]+"_over.png)";
//						jQuery(this).css("backgroundImage", src);
//					}
//				}, 
//				function () {
//					if (jQuery(this).css("backgroundImage") != "none") {
//						var src = jQuery(this).css("backgroundImage").split("_over.png)")[0]+".png)";
//						jQuery(this).css("backgroundImage", src);
//					}
//				}
//		);
//	}
});
