$(document).ready(function() {
	
	/****** CUSTOMER SCRIPTS ******/
	$(".widget-left-content ul.shopp_categories li:contains('Systemowe')").remove();
	
	
	/****** EXPRESSO SCRIPTS ******/
	
	/* Curved corners & CSS3*/
	
	$("#main-menu-bar ul li ul").addClass("smallshadow");
	
	$("#main-frame, #main-frame-content, #main-frame-content-container").addClass("topradius");
	$("#main-menu-bar").addClass("bottomradius");
	$("#main-menu-bar li:first, #main-menu-bar li:first a:first").addClass("bottomleftradius");
	$("#main-menu-bar ul li ul, #main-menu-bar ul li ul li:last-child, #main-menu-bar ul li ul li:last-child a").addClass("bottomradius");
	$(".widget-left-container h3").addClass("rightradius");
	$(".widget-right-container h3").addClass("leftradius");
	$(".widget-left-container:has('ul.shopp_categories') h3").removeClass("rightradius").addClass("toprightradius");
	$(".widget-left-content:has('ul.shopp_categories')").css("margin-top","-27px");
	$(".widget-left-content ul.shopp_categories, .widget-left-content ul.shopp_categories > li:last-child").addClass("bottomradius");
	
	$(".widget-left-content ul.shopp_categories ul").addClass("rightradius").addClass("smallshadow");
	$(".widget-left-content ul.shopp_categories ul li:first-child, .widget-left-content ul.shopp_categories ul li:first-child a").addClass("toprightradius");
	$(".widget-left-content ul.shopp_categories ul li:last-child, .widget-left-content ul.shopp_categories ul li:last-child a").addClass("bottomrightradius");
	
	
	/* Menu animations */
	
	
	$("#main-menu-bar ul li").hover(
		function() {
			$(this).children("ul").stop(true,true).slideDown(300);
		},
		function() {
			$(this).children("ul").stop(true,true).slideUp(100);
		}
	);
	



	/****** SHOPP SCRIPTS ******/
	
	/* category images hover */
	$("a.expresso-category-cover-image").hover(
		function() {
			$(this).stop(true,true).animate({
				opacity: 0.65
			},200);
		},
		function() {
			$(this).stop(true,true).animate({
				opacity: 1.0
			},100);
		}
	);
	
	/* category menu selection */
	$(".widget-left-content ul.shopp_categories li:first").css("border-top","0px");
	$(".widget-left-content ul.shopp_categories li").hover(
		function() {
			$(this).children("ul").stop(true,true).show(300);
		},
		function() {
			$(this).children("ul").stop(true,true).hide(150);
		}
	);
	$(".widget-left-content ul.shopp_categories li:has('ul') > a").append(" »");
	
	
	
	
	/* Product gallery animations */
	$("ul.thumbnails li").hover(
		function() {
			$(this).stop(true,true).animate({
				opacity: 0.7
			});
		},
		function() {
			$(this).stop(true,true).animate({
				opacity: 1.0
			});
		}
	);
	
	/* Get current shipping value */

	
	$("ul#shipping-methods li").click(function() {
		var shipping_method = $(this).children("span").children("label").children("input:checked").val();
		$("select[name=paymethod] option").removeAttr("selected");
		$("select[name=paymethod] option:contains('Karta')");
		$("select[name=paymethod] option:contains('"+shipping_method+"')").attr("selected","selected");
	});
	
	$("select[name=paymethod]").change(function() {
		var payment_method = $(this).children("option:selected").text();
		$("ul#shipping-methods li span label input").removeAttr("checked");
		$("ul#shipping-methods li span label:contains("+payment_method+") input").attr("checked","checked").click();
	});
	
	
	
});
