$(document).ready(function(){
	if (jQuery.browser.msie && parseInt(jQuery.browser.version) <= 7) {
		//do nothing
	}
	else {
		// hide the non-js enabled browser product information 
		$("#feature-bar table tr:last").hide();
		
		// show product information for js enabled browsers
		$("#feature-bar table th").each(function(i) {
			$(this).children("div.product-info-pane:first").show();
			$(this).children("h3").show();
			$(this).children("p.product-info-button").show();
			$(this).children("div.colour-well").show();
		});
		
		// change product icon when user picks a different colour
		$("div.colour-well p a").bind("mouseenter",function(){
			var th = $(this).parent("p").parent("div").parent("th");
			th.children("div.product-info-pane").hide();
			th.children("div#" + $(this).attr("id") + "-icon").show();
		});
		
		// action when user click on a colour in the colour well
		$("div.colour-well p a").click(function() {
			var request_url =  $(this).attr("href");
			get_product_from_style_page(request_url);
			return false;
		});
		
		// action when user clicks on a product information button
	   	$("p.product-info-button a").click(function(){
	   		var request_url =  $(this).attr("href");
	   		
	   		get_product_from_style_page(request_url);
	   		return false;
	   	});
   	}
});
