$(document).ready(function(){
	$(".scrollable").scrollable({circular: true, mousewheel: true}).navigator();
	$('.basket a.up').click(function(){ // increase quantity in basket
		$(this).parent().find('input').val(parseInt($(this).parent().find('input').val())+1);
		return false;
	})
	$('.basket a.down').click(function(){ // decrease quantity in basket
		val = $(this).parent().find('input');
		if (val.val()>0) { val.val(val.val()-1);}
		return false;
	})
	$(".menu_left a.flv").click(function(){	// menu accordion
	 	$(".menu_left ul:visible").slideUp("slow");
		if (!$(this).hasClass('active')) {
			$(this).next("ul").slideToggle("slow");
			$(this).addClass("active");
		}
		else {$(this).parent().parent().parent().parent().find("a").removeClass("active");}
		return false;
	});
	$(".checkout p").click(function(){ // checkout accordion
		$(this).next("div").slideToggle("slow")
		.siblings("div:visible").slideUp("slow");		
		$(this).toggleClass("active");
		$(this).siblings("p").removeClass("active");
	});
	$('.tabs a').click(function(){ // tabs clicks
		$(this).parent().children('a').removeClass('active');
		$(this).addClass('active');
		num = $(this).parent().children('a').index($(this));
		$(this).parent().parent().children('.tab_item').hide();
		$(this).parent().parent().children('.tab_item').eq(num).show();
		return false;
	});
	$('.manufacturers label').click(function(){ // filter manufacturer clicks
		$(this).parent().parent().find('label').addClass('noact');
		$(this).removeClass('noact');
		num = $(this).parent().parent().children('b').index($(this).parent());
		$(this).parent().parent().children('div').hide();
		$(this).parent().parent().children('div').eq(num).show();
		return false;
	});
	$(".features p").click(function(){ // filter features
		if ($(this).next("div").css('display') == 'none') { $(this).next("div").slideToggle("slow")}
		else {$(this).next("div").slideUp("slow")}
	});
});

function popap($id) {
	$($id).find('.popup_bgr').css({'height':$('#super').height()});
	$($id).fadeIn('slow');
	$($id).find('.popup_cont').height($($id).find('.popup_cont').find('.popup_window').height());
	return false;
}
