ACMS.Dispatch.Postinclude._postinclude=function(elm,method,effect,effectSpeed){var form=elm;if("undefined"!=typeof form.returnValue){if(!form.returnValue){return false}}var target=form;if(form.target){var $target=$(form.target);if(!$target.size()){return false}target=$target[0];if($target.length>1){var $temp=$(form).parent().find(form.target);if($temp.size()){target=$temp[0]}}}var data=ACMS.Library.getPostData(form);var reset="function"==typeof form.onreset?form.onreset:new Function;var url=form.action?form.action:window.location.href;function fin(dom){$(".js-post-include-disabled",form).removeAttr("disabled").removeClass("js-post-include-disabled");reset.apply(form);ACMS.dispatchEvent("acmsAfterPostInclude",document,{include:dom})}$(":input",form).attr("disabled","disabled").addClass("js-post-include-disabled");$.ajax({type:"POST",url:url,data:data,dataType:"html",error:function(XMLHttpRequest,textStatus,errorThrown){form.isLastAjaxSuccess=false;fin(document)},success:function(html,status){form.isLastAjaxSuccess=true;if("replace"==method){switch(effect){case"fade":var $wrapper=$($.parseHTML("<div>"+html+"</div>"));$(target).fadeOut(effectSpeed,function(){$wrapper.hide();$(target).replaceWith($wrapper);ACMS.Dispatch($wrapper);$wrapper.fadeIn(effectSpeed,function(){var $contents=$wrapper.children().first().unwrap();fin($contents.parent().get(0))})});break;case"slide":var $wrapper=$($.parseHTML("<div>"+html+"</div>"));$(target).slideUp(effectSpeed,function(){$wrapper.hide();$(target).replaceWith($wrapper);ACMS.Dispatch($wrapper);$wrapper.slideDown(effectSpeed,function(){var $contents=$wrapper.children().first().unwrap();fin($contents.parent().get(0))})});break;default:var $wrapper=$($.parseHTML("<div>"+html+"</div>"));$(target).replaceWith($wrapper);ACMS.Dispatch($wrapper);var $contents=$wrapper.children().first().unwrap();fin($contents.parent().get(0))}}else{switch(effect){case"fade":$(target).fadeOut(effectSpeed,function(){$(this).empty();$(this).append(html);ACMS.Dispatch(this);$(this).fadeIn(effectSpeed,function(){fin($(target).get(0))})});break;case"slide":$(target).slideUp(effectSpeed,function(){$(this).empty();$(this).append(html);ACMS.Dispatch(this);$(this).slideDown(effectSpeed,function(){fin($(target).get(0))})});break;default:$(target).empty();$(target).append(html);ACMS.Dispatch(target);fin($(target).get(0))}}}})};