$(document).ready(function(){
/*// Remove image button on widge editor
$('.widgContainer ul li').each(function (i) {
		if(i == 5) {
			alert($(this).attr('class'));
			$(this).css('display','none');
		}
});*/

$("#feature_box").slideDown();

	$('#carousel').galleryView({
		panel_width: 316,
		panel_height: 212,
		frame_width: 50,
		frame_height: 50,
		transition_speed: 350,
		pause_on_hover: true,
		gallery_padding: 0,
		filmstrip_margin: 10,
		theme_path: '/assets/js/themes/dark/',
		show_filmstrip: 1
	});

$("#feature_box").accessibleTabs({
	tabhead:'h2',
	fx:"fadeIn",
	wrapperClass: 'fb-content',	
	currentInfoText: ''
});
$("#feature_box h2").css('display','none');

$(".reply_to_button").css('display','block');
$('.reply_to_button a').click(function() {
	$('#reply_to').val(this.rel);
});

	// Deleting of images from image tables in forms
	$('.image-delete-submit').click(function() {
		var agree = confirm('Are you sure you want to delete this image?\nThere is no undo!');
		if(agree) {
			var data = this.rel;
			var target = $(this).parent();
			var t = $(target).parent();
			var url = '/ajax/image-list?'+data;
			// Send the request;
				$.ajax({
					type: "POST",
					url: url,
					data: data,
					error: function(obj, msg){
						alert('Image not Removed');
					},
					success: function(msg){
						var foo = 'item_'+msg;
						$(t).fadeOut("slow", function() {
							$(t).remove();
						});
					}
				});
		}
		return false;
	});


});