$(document).ready(function(){
	
	// Enable facebox for gallery
	$('a[rel*=facebox]').facebox({
        loadingImage : 'include/images/loading.gif',
        closeImage   : 'include/images/closelabel.png'
	});

	// Change opacity when removing images
	$('.admin_news_image_label :checkbox').bind('click', function() {

		// Select the nearest image
		var image	= $(this).parent().next();
		
		if ($(this).prop('checked') == true) {
			$(this).parent().parent().addClass('admin_news_image_delete');
			$(image).css('opacity', '0.4');
		}
		else {
			$(this).parent().parent().removeClass('admin_news_image_delete');
			$(image).css('opacity', '1');
		}
	});	
	
});


function add_upload() {
	$('#add_form').append("<input type='file' name='upload[]'/><br />");	 
}
