$(function() {
	$('nav#header ul li:nth-child(1)').addClass('home');
	$('nav#header ul li:nth-child(2)').addClass('shop-online');
	$('nav#header ul li:nth-child(3)').addClass('checkout');
	$('nav#header ul li:nth-child(4)').addClass('delivery-info');
	$('nav#header ul li:nth-child(5)').addClass('catalogues');
	$('nav#header ul li:nth-child(6)').addClass('about-us');
	$('nav#header ul li:nth-child(7)').addClass('contact-us');
	$('nav#header ul li:nth-child(8)').addClass('find-us');
	
	$('#ribbon a:nth-child(2)').addClass('first');
	$('#ribbon a:last-child').addClass('last');
	
	$('#testimonials .upload form div:nth-child(2)').addClass('message');

	$("span.tooltips img[title]").tooltip({ position: "bottom right", effect: "fade", offset: [10, -30], fadeInSpeed:100, fadeOutSpeed:100 });
});

//Javascript for variations: bounce the variation box when nothing is selected and return false for add to cart button.
jQuery(document).ready(function(){
	jQuery('.wpsc_buy_button', this).click(function(){
		var dropdowns = jQuery(this).closest('form').find('.wpsc_select_variation');
		var not_selected = false;
		dropdowns.each(function(){
			var t = jQuery(this);
			if(t.val() <= 0){
				not_selected = true;
				t.css('position','relative');
				t.animate({ backgroundColor: "#eb7e7e" }, 100);
				t.animate({'left': '-=5px'}, 50, function(){
					t.animate({'left': '+=8px'}, 80, function(){
						t.animate({'left': '-=8px'}, 80, function(){
							t.animate({'left': '+=8px'}, 80, function(){
								t.animate({'left': '-=8px'}, 80, function(){
									t.animate({'left': '+=5px'}, 50);
									t.animate({ backgroundColor: "white" }, 800);
								});
							});
						});
					});
				});
			}
		});
		if (not_selected)
			return false;
	});
});

