$(document).ready(function(){
	
	$("#navigation li").hover(function(){
		$(".dd", this).show();
		$("a:eq(0)", this).addClass("hover");
	}, function(){
		$(".dd", this).hide();
		$("a:eq(0)", this).removeClass("hover");
	}).each(function(){
		if($(this).find(".dd").size()) $(this).addClass("withDD");
	});

});

$(window).load(function(){
	
	var oldHtml = $("#slider .holder ul").html();
	var liWidth = 0;
	$("#slider .holder ul li").each(function(){	liWidth += $(this).outerWidth(); });
	if($("#slider .holder").width()>liWidth-2)
	{
		$(".slider-arrow").hide();
	}
	
	

	$("#slider .holder ul").jcarousel({
	    wrap: "both",
	    start: 1,
	    initCallback: function(carousel) {
		    $("#slider .slider-prev").click(function(){
		    	carousel.prev();
		    	return false;
		    });  
		    $("#slider .slider-next").click(function(){
		    	carousel.next();
		    	return false;
		    });    
		},
	    // This tells jCarousel NOT to autobuild prev/next buttons
	    buttonNextHTML: null,
	    buttonPrevHTML: null
	});

});
