$(document).ready(function(){

	$("#Menu li:last-child").addClass("last");

	$("#cycle").cycle({
		fx: "scrollLeft",
		timeout: 5000
	});

	function textReplacement(input) {
		var originalvalue = input.val();
		input.focus(function() {
			if($.trim(input.val()) == originalvalue){ input.val(""); }
		});
		input.blur(function() {
			if($.trim(input.val()) == ""){ input.val(originalvalue); }
		});
	}

	textReplacement($("#search_query"));
	textReplacement($("#nl_first_name"));
	textReplacement($("#nl_email"));
	
	$("#ProductReviews a[onclick*=show_product_review_form]").addClass("button");
	$("#ProductReviews a[onclick*=show_product_review_form] img").replaceWith("Write a Review");	

//	jCarouselLite example -- you will need to add a <div class="ProductListContainer"> around the <ul>
//	in the HomeFeaturedProducts Panel

	$(".home #HomeFeaturedProducts .ProductListContainer").jCarouselLite({
       btnNext: ".featured-next",
       btnPrev: ".featured-prev",
	      visible: 4,
	 	  scroll: 4,
		  speed: 800
	});
	
	$(".home #HomeNewProducts .ProductListContainer").jCarouselLite({
       btnNext: ".new-next",
       btnPrev: ".new-prev",
	      visible: 4,
	 	  scroll: 4,
		  speed: 800
	});
	
	$('.custom .Content .ProductList li:nth-child(4n+4)').addClass('fourth');
	$('.product .Content .SideRelatedProducts li:nth-child(2n+2)').addClass('second');
	$('.product .Content .SideRelatedProducts li:last-child').addClass('last');
	$('body.new #HomeNewProducts ul').removeClass('homeProductList').addClass('ProductList');
	
//	$("a.fancybox").fancybox();

});
