jQuery(document).ready(function($) {
	$('li.menu-item').addClass(function() {
		var title = $(this).find('a').text().replace(/\s+/g,'-').replace(/[^a-zA-Z0-9\-]/g,'').toLowerCase();
		return title;
	}).append(function(index, html) {
		var text = $(this).find('a').text().replace(/\s+/g,'-').replace(/[^a-zA-Z0-9\-]/g,'').toLowerCase();
		var ico = '<img height="38" border="0" width="89" alt="'+text+'" src="http://ynotcycle.com/wp-content/uploads/2010/10/icon-'+text+'.jpg">';
		var href = $(this).find('a').attr('href');
		var anchor = '<a id="menu_img" class="'+text+'" href="'+href+'" title="'+text+'">'+ico+'</a>';
		return anchor;
	}).hover( 
		function () {
			$(this).toggleClass("active");
		}
	);
	$('#ynot_shoppingcart li').hover( 
		function () {
			$(this).toggleClass("active");
		}
	);
	if ($('#container').hasClass('product_page')) {
		$('li.menu-item.products ').addClass('current_page_item');
	}
	$('.page-template-product-summary-php .product').hover( 
		function () {
			$(this).toggleClass("active");
		}
	);
	if($('ul#product_colours').length) {
		$('ul#product_colours').after('<div id="colour_swatch">product_colours</div>');
		$('ul#product_colours li').hover( 
			function () {
				$(this).css("cursor","pointer"); 
				var swatch_src = '<img src="'+$(this).find('img').attr('src')+'" />';
				$('div#colour_swatch').html(swatch_src.replace('_th', '')).toggleClass('active');
			}
		);
	}
	$('form#PHPurchaseCartForm table#viewCartTable tbody').append('<tr id="disclamer"><td class="noBorder" style="text-align: left;" colspan="5">Disclaimer: YNOT Cycle is not responsible for lost mail. For International orders, please verify your mailing address is correct. For orders shipped to Malaysia, we will not refund or resend lost orders.</td></tr>');
});
