$(document).ready(function() {
	
	
	/* Equal height boxes.. */
	
	$(".section_wrap").each(function() {
	
		var divheight = 0;
		
		$(this).children(".section").children(".section_text").each(function() {
	
			if($(this).height() > divheight) { divheight = $(this).height(); }
	
		});
		
		$(this).children(".section").children(".section_text").each(function() {
												   
			$(this).height(divheight);
		
		});
	
	});
	
	
	/* Product tabs. */
	
	$("#product_tabs a").click(function() {

		$(".showhide").hide();
		
		$("#product_tabs a").removeClass("active");
		
		$("#"+ $(this).attr("rel")).fadeIn();
		
		$(this).addClass("active");
		
		return false;

	});
	
	
	
	/* Checkout Continue button. 
	
	$("input[name=update_cart], input[name=checkout_continue]").click(function() {
													  
		var message = "";
	
		$("input[name^=quantity]").each(function() {
		
			if(parseFloat($(this).val()) > parseFloat($("input[rel=s"+$(this).attr("rel")+"]").val())) {
			
				message += "Sorry, you have requested  "+ $(this).val() +"  of "+  ($(this).parent("td").siblings(".cart_text").text() ? " item '"+ $(this).parent("td").siblings(".cart_text").text() +"'  " : "this item")  +", but we only have  "+ $("input[rel=s"+$(this).attr("rel")+"]").val() +"  available. Please check your cart and try again.";
				
			}
		
		});
		
		if(message) { alert(message); return false; } else { return true; }
	
	});*/
	
	
	
	/* Add to Cart Continue Button. 
	
	$("input[name=addtocart]").click(function() {
													  
		var message = "";
	
		$("input[name^=chkQty]").each(function() {
		
			if(parseFloat($(this).val()) > parseFloat($("input[name^=chkStock]").val())) {
			
				message += "Sorry, you have requested  "+ $(this).val() +"  of this item, but we only have  "+ $("input[name^=chkStock]").val() +"  available. Please check your cart and try again.";
				
			}
		
		});
		
		if(message) { alert(message); return false; } else { return true; }
	
	});*/

});
