jQuery(document).ready(function($) {
	
	// CYCLE
	$('#cycle').cycle({timeout:6000});
	
	// BC NAV
	$('#SideCategoryList').bcNav();
	
	// Featured Slider
	$("#HomeFeaturedProducts .ProductListContainer").jCarouselLite({
		 btnNext: "#featured-next",
		 btnPrev: "#featured-prev",
		 visible: 5,
		 scroll: 4,
		 speed: 800
	 }); 
	 
	// Featured Slider hover effect for arrows
	$("#HomeFeaturedProducts").mouseenter(function(){
		$("#featured-prev, #featured-next").fadeIn(500);
    }).mouseleave(function(){
        $("#featured-prev, #featured-next").fadeOut(100);
    });

	// Replace text in form fields
	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"));
	
	// Replace the ( ) in the top menu cart items with [ ]
	$cartitems = $('#cart-items').html().replace('(','[').replace(')',']');
	$('#cart-items').html($cartitems);
	
		
	$('.HasSubMenu a').append('<img src="/templates/__custom/images/submenu.png" alt="" style="margin-left:3px;" />');
	$('.HasSubMenu ul li a img').hide();
		
	$('.ui-state-active').append('<img src="/templates/__custom/images/submenu.png" alt="" style="margin-left:3px;" />');
	
	$('#Wrapper').after('<div class="ContentLower"></div>');
	$('#Wrapper').before('<div class="ContentUpper"></div>');
	
	$('#rss').before('<div class="rssHeader"><span>News</span></div>');
	
	 $("#rssFeed").PaRSS(
      "http://store-311fb.mybigcommerce.com/rss.php?action=newblogs&type=rss",  // rss feed url (required)
      10,                                   // number of items (optional)
      "M/d/Y",                        // date format (optional)
      "image"                                 // descriptions? (optional)
      );
	  
	  $("#rssFeaturedProducts").PaRSS(
      "http://store-311fb.mybigcommerce.com/rss.php?action=featuredproducts&type=rss",  // rss feed url (required)
      4,                                   // number of items (optional)
      "m/d/Y",                        // date format (optional)
      "featured"                                 // descriptions? (optional)
      );
	
	$('.SideCategoryListClassic > ul ').addClass('accordion');
	$('.accordion').accordion({
		autoHeight: false, collapsible: true,active: false,navigation: false
	});
	   
	$('.product h2 .ProductBreadcrumb ul li:nth-child(1)').remove();
	$('.product h2 .ProductBreadcrumb ul li:nth-child(2)').remove();
	$('.product h2 .ProductBreadcrumb ul li:nth-child(3)').remove();
	$('.product h2 .ProductBreadcrumb ul li:nth-child(4)').remove();
	$('.product h2 .ProductBreadcrumb ul li:nth-child(5)').remove();
	$('.product h2 .ProductBreadcrumb ul li:nth-child(6)').remove();
	$('.product h2 .ProductBreadcrumb ul li:nth-child(7)').remove();
	
	$('#BreadcrumbProduct ul:nth-child(2)').remove();
	$('#BreadcrumbProduct ul:nth-child(3)').remove();
	$('#BreadcrumbProduct ul:nth-child(4)').remove();
	$('#BreadcrumbProduct ul:nth-child(5)').remove();
	$('#BreadcrumbProduct ul:nth-child(6)').remove();
	$('#BreadcrumbProduct ul:nth-child(7)').remove();

	
	$('.CompareButton').remove();
	$('.SubCategoryList').remove();
	

	
});
