/*
	NOTE: jQuery's native '$' selector is disabled because it conflicts with the '$' selector
	used by both Prototype and Scriptaculous on this site. 

	All selectors/functions that begin with '$' should use 'jQuery' instead
*/

jQuery(document).ready(function(){

	// Select frist level menu items
	jQuery("#nav > li").each(function(){
		
		if( jQuery("ul",jQuery(this)).length ){
			var firstLevelItem = jQuery('a span', jQuery(this) ).html();
			var firstLevelItemLink = jQuery('a', jQuery(this) ).attr("href");
			var firstLevelItemClasses = jQuery(this).attr("class").split(' ');
			var firstLevelItemClass = "";
			
			// Disable frist level menu
			//jQuery('>a',jQuery(this)).css("cursor","default");
			jQuery('>a',jQuery(this)).click(function(e){
				e.preventDefault();
			})
			
			if(firstLevelItemClasses.length > 1){
				var firstLevelItemClass = firstLevelItemClasses[1];
			}

			//jQuery("ul",jQuery(this)).prepend('<li class="level0 '+ firstLevelItemClass +'" ><a href="'+ firstLevelItemLink +'">'+ firstLevelItem +'</a></li>');

		}
	});
	
	
	// Hide Qty col on product detail page
	jQuery(".grouped-items thead .a-center").remove();
	jQuery(".grouped-items tbody tr").each(function(){
		jQuery(".a-center", jQuery(this)).remove();
	});

	// Hide category from sitemap page

	jQuery('.sitemap li:nth-child(3) a').removeAttr("href");
	jQuery('.sitemap li:nth-child(7) a').removeAttr("href");
	jQuery('.sitemap li:nth-child(11) a').removeAttr("href");
	jQuery('.sitemap li:nth-child(13) a').removeAttr("href");
});


