/* Copyright (C) YOOtheme GmbH, YOOtheme Proprietary Use License (http://www.yootheme.com/license) */

jQuery(function($){var form=$("#gallery form");$('input[type="submit"]',form).bind("click",function(e){e.preventDefault();var input=$(this);input.attr("disabled",true).parent().addClass("saving");$.post(form.attr("action"),form.serialize(),function(data){input.attr("disabled",false).parent().removeClass("saving")})});$("#gallery").delegate("a.action.delete","click",function(e){e.preventDefault();if(!confirm("Are you Sure?"))return;var button=$(this);$.post(widgetkitajax+"&task=delete_gallery",{id:$(this).attr("data-id")},function(data){if(data&&data.id){button.parents("tr:first").fadeOut(function(){$(this).remove()})}else{alert("Delete action failed.")}},"json")})});