function showAvailableSizes(elem) {
	closeAll();
	$('~ .availability', elem).show();
	
	return false;
}

function closeAll() {
	$('.list .articles .article .sizes .availability').hide();
}

$(document).ready(function() {

	$('.filters .filter p.head').toggle(
		function() {
			if($('~ .list', this).css("display") == "none") {
				$('.filter .list').fadeOut();
				$('~ .list', this).fadeIn();
			} else if ($('~ .list', this).css("display") == "block") {
				$('~ .list', this).fadeOut();
			}
		},
		
		function() {
			if($('~ .list', this).css("display") == "none") {
				$('.filter .list').fadeOut();
				$('~ .list', this).fadeIn();
			} else if ($('~ .list', this).css("display") == "block") {
				$('~ .list', this).fadeOut();
			}
		}
	);
	
	$('.filter select').change(function() {
		if($(this).val() != '0') {
			$('#filter').submit();
		}
	});
});

function clearFilter() {
	$('.filter select option[value="0"]').attr('selected', 'selected');
	$('#filter').submit();
}
