function ch(elem) {
	var id = jQuery(elem).attr('id').replace('news_change_category_', '');
	if (jQuery(elem).attr('checked')) {
		jQuery('select#new_category_' + id).removeAttr("disabled");
	} else {
		jQuery('select#new_category_' + id).attr('disabled', 'disabled');
	}
}

jQuery(function() {
	jQuery(window).scroll(function() {
		if(jQuery(this).scrollTop() != 0)
			jQuery('#toTop').fadeIn();	
		else
			jQuery('#toTop').fadeOut();
	});
	jQuery('#toTop').click(function() {
		jQuery('body,html').animate({scrollTop:0},50);
	});
	jQuery('input.cat_checkbox').change(function() {
		ch(this);
	});
	jQuery(document).ready(function() {
		jQuery('input.cat_checkbox').each(function() {
			ch(this);
		});
	});
});


