var path_alt = '';
var path_alt_w = 0;
var path_alt_h = 0;

function delete_file(object_nr) {
	check = confirm (unescape("Die Datei wirklich l%F6schen?"));
	
	if (check == true) {
		var img_id 		= $('input[id=single_file_img_id_' + object_nr + ']').val();
		var config 		= $('input[id=single_file_config_' + object_nr + ']').val();
		
		/* alert ("img_id: " + img_id + "\nconfig: " + config); */
		
		$.ajax({
			url: "/_actions/delete_file.php",
			type: "POST",
			data: "ajax=1&config=" + config + "&img_id=" + img_id,
			
			success: function(response) {
				/* alert (response); */
				var values = response.split('#####');
				
				path_alt = values[0];
				path_alt_w = values[1];
				path_alt_h = values[2];
				
				
			},
			
			complete: function(){
				/* message(path_alt); */
				
				$('#deleter_' + object_nr).fadeOut('slow');
				
				$("#info").html("<div>Die Datei wurde entfernt!</div>");
				showInfo("info", 2500);
				
				object = 'img_object_' + object_nr;
				var path_w = $('#' + object).width();
				var path_h = $('#' + object).height();
				
				/* message('path_alt: ' + path_alt + '\npath_alt_w: ' + path_alt_w + '\npath_alt_h: ' + path_alt_h + '\npath_w: ' + path_w + '\npath_h: ' + path_h); */
				window.location.reload()
				
				/* setSRC(object, path_alt, object_nr); */
			}
		});
	}
}
