function frmSubmit(){jQuery("#ff input[name=content]").val(jQuery("#editor").html());var a=document.getElementById("ff");procFilter(a,insert);jQuery("#frmSubmit").attr("disabled","disabled")}function insert_file(b){var d=jQuery("#file_"+b);var e=d.find("button").attr("data-type");if(e=="img"){var c='<p><img src="'+d.find("button").attr("data-file")+'" alt="'+d.find("button").attr("title")+'" /></p>'}else{if(e=="music"){var c='<p><audio src="'+d.find("button").attr("data-file")+'" controls="controls">Your browser does not support this file type. You can download <a href="'+d.find("button").attr("data-dnld")+'" style="text-decoration:underline">'+d.find("small").text()+"</a> and play it!</audio></p>"}else{if(e=="media"){var c='<p><video src="'+d.find("button").attr("data-file")+'" controls="controls">Your browser does not support this file type. You can download <a href="'+d.find("button").attr("data-dnld")+'" style="text-decoration:underline">'+d.find("small").text()+"</a> and play it!</video></p>"}else{var c='<p><a href="'+d.find("button").attr("data-dnld")+'" style="text-decoration:underline">'+d.find("small").text()+"</a></p>"}}}jQuery("#inserthtml").val(c).change()}jQuery(function(b){var c=b("#editor");var a=c.parents("form").find("input[name=content]").val();if(a){c.html(a)}c.wysiwyg();b("#mEditorSelect").click(function(){var d=b(this);if(d.hasClass("on")){b("#files>.success").removeClass("select")}else{b("#files>.success").addClass("select")}d.toggleClass("on")});b("#mEditorInsert").click(function(){b("#files>.select .insert_file").each(function(){b(this).click()})});b("#mEditorDelete").click(function(){var d=window.confirm(lang_confirm_delete);if(!d){return false}b("#files>.select").each(function(){delete_file(b(this).attr("id").split("file_")[1],"N")})})});