$(document).ready(function(){

	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");	
	
	$("#Menu li:last-child").addClass("last");
	$(".Left #SideProductRecentlyViewed .ProductList li:gt(2)").css("display","none");
	
	$(".category #HomeSaleProducts .ProductList li:nth-child(2n+2)").addClass("sale-product-middle");
	
	$('#slider1').anythingSlider({
			width						: 950,
			easing					: 'easeInOutExpo',
			enableStartStop	: true,
			startText				: "Play",
	    stopText				: "Pause"
	});

//Change Shipping cost display per category	
	function changeShippingDisplay(){
		var url = window.location.pathname;
		url = url.toLowerCase();
		//violins
		if (url.indexOf('/rentals/violins/') >= 0) {
			$('div.Value:contains("Calculated at checkout")').replaceWith('<div class="Value"> UPS Ground $14.50. (more options at checkout) </div>');
		};
		if (url.indexOf('/violins/') >= 0) {
			$('div.Value:contains("Calculated at checkout")').replaceWith('<div class="Value"> UPS Ground Included (more options at checkout) </div>');
		};

		//violas
		if (url.indexOf('/rentals/violas/') >= 0) {
			$('div.Value:contains("Calculated at checkout")').replaceWith('<div class="Value"> UPS Ground $14.50. (more options at checkout) </div>');
		};
		if (url.indexOf('/violas/') >= 0) {
			$('div.Value:contains("Calculated at checkout")').replaceWith('<div class="Value"> UPS Ground Included (more options at checkout) </div>');
		};
		//cellos
		if (url.indexOf('/rentals/cellos/') >= 0) {
			$('div.Value:contains("Calculated at checkout")').replaceWith('<div class="Value"> UPS Ground $56.45. (more options at checkout) </div>');
		};
		if (url.indexOf('/cellos/') >= 0) {
			$('div.Value:contains("Calculated at checkout")').replaceWith('<div class="Value"> UPS Ground $56.45. (more options at checkout) </div>');
		};
	}
	changeShippingDisplay();
//	jCarouselLite example -- you will need to add a <div class="ProductListContainer"> around the <ul>
//	in the HomeFeaturedProducts Panel

//	$("#HomeFeaturedProducts .ProductListContainer").jCarouselLite({
//        btnNext: "#featured-next",
//        btnPrev: "#featured-prev",
//	      visible: 5,
//	 	  scroll: 5,
//		  speed: 800
//   });
	
//	$("a.fancybox").fancybox();


	
	

	
	
	
});
