$(document).ready(function() {

	var originalSizes = new Array();
	$('#product-category').jScrollHorizontalPane({scrollbarHeight:13, scrollbarMargin:100, showArrows:true});
	// this initialises the demo scollpanes on the page.

	$(".add-to-basket").click(function(){
		tb_remove();
		$("#cart").animate({opacity: 100}, 1000);
		$("#cart").slideDown();
		$("#cart").animate({opacity: 1.0}, 5000);
		$("#cart").fadeOut();				
	})

	var popH=$("#product-popup").height();
	var popW=$("#product-popup").width();	
	
	$("a.thickbox").attr({
		href:"#TB_inline?inlineId=dialog&width="+popW+"&height="+popH					 
	})
	
	$("#dialog").hide();
	
	$("a.relatedproduct").click(function(){
		$("ul.relatedproduct-list").hide();
		$("#"+$(this).attr('id')+"-panel").show();
		$("a.relatedproduct").removeClass("active");
		$(this).addClass("active");
		return false;
	})
	
	
	var bw=1024;
	
	if($.browser.msie){
		bw=1070;
	}else{
		bw=1024;
	}
	

	if($(window).width() <= bw){
		$(".product #content .inside").css({
			overflow:"hidden"									   
		})	
	}

	$(window).resize(function(){
		if($(window).width() <= bw){
			$(".product #content .inside").css({
				overflow:"hidden"									   
			})	
		}else{
			$(".product #content .inside").css({
				overflow:"visible"									   
			})	
		}
	})
	
});