var tagBox,commentsBox,editPermalink,makeSlugeditClickable,WPSetThumbnailHTML,WPSetThumbnailID,WPRemoveThumbnail,wptitlehint;function array_unique_noempty(t){var s=[];return jQuery.each(t,function(t,e){(e=jQuery.trim(e))&&-1==jQuery.inArray(e,s)&&s.push(e)}),s}!function(l){tagBox={clean:function(t){var e=postL10n.comma;return t=(t=","!==e?t.replace(new RegExp(e,"g"),","):t).replace(/\s*,\s*/g,",").replace(/,+/g,",").replace(/[,\s]+$/,"").replace(/^[,\s]+/,""),t=","!==e?t.replace(/,/g,e):t},parseTags:function(t){var e=t.id.split("-check-num-")[1],s=l(t).closest(".tagsdiv"),i=s.find(".the-tags"),n=postL10n.comma,t=i.val().split(n),a=[];return delete t[e],l.each(t,function(t,e){(e=l.trim(e))&&a.push(e)}),i.val(this.clean(a.join(n))),this.quickClicks(s),!1},quickClicks:function(t){var s,e=l(".the-tags",t),i=l(".tagchecklist",t),n=l(t).attr("id");e.length&&(s=e.prop("disabled"),e=e.val().split(postL10n.comma),i.empty(),l.each(e,function(t,e){(e=l.trim(e))&&(e=l("").text(e),s||((t=l('X')).click(function(){tagBox.parseTags(this)}),e.prepend(" ").prepend(t)),i.append(e))}))},flushTags:function(t,e,s){e=e||!1;var i=l(".the-tags",t),n=l("input.newtag",t),a=postL10n.comma,o=e?l(e).text():n.val();return tagsval=i.val(),o=tagsval?tagsval+a+o:o,o=array_unique_noempty((o=this.clean(o)).split(a)).join(a),i.val(o),this.quickClicks(t),e||n.val(""),void 0===s&&n.focus(),!1},get:function(s){var i=s.substr(s.indexOf("-")+1);l.post(ajaxurl,{action:"get-tagcloud",tax:i},function(t,e){0!=t&&"success"==e||(t=wpAjax.broken),t=l('

'+t+"

"),l("a",t).click(function(){return tagBox.flushTags(l(this).closest(".inside").children(".tagsdiv"),this),!1}),l("#"+s).after(t)})},init:function(){var t=this,e=l("div.ajaxtag");l(".tagsdiv").each(function(){tagBox.quickClicks(this)}),l("input.tagadd",e).click(function(){t.flushTags(l(this).closest(".tagsdiv"))}),l("div.taghint",e).click(function(){l(this).css("visibility","hidden").parent().siblings(".newtag").focus()}),l("input.newtag",e).blur(function(){""==this.value&&l(this).parent().siblings(".taghint").css("visibility","")}).focus(function(){l(this).parent().siblings(".taghint").css("visibility","hidden")}).keyup(function(t){if(13==t.which)return tagBox.flushTags(l(this).closest(".tagsdiv")),!1}).keypress(function(t){if(13==t.which)return t.preventDefault(),!1}).each(function(){var t=l(this).closest("div.tagsdiv").attr("id");l(this).suggest(ajaxurl+"?action=ajax-tag-search&tax="+t,{delay:500,minchars:2,multiple:!0,multipleSep:postL10n.comma+" "})}),l("#post").submit(function(){l("div.tagsdiv").each(function(){tagBox.flushTags(this,!1,1)})}),l("a.tagcloud-link").click(function(){return tagBox.get(l(this).attr("id")),l(this).unbind().click(function(){return l(this).siblings(".the-tagcloud").toggle(),!1}),!1})}},commentsBox={st:0,get:function(t,e){var s=this.st;return e=e||20,this.st+=e,this.total=t,l("#commentsdiv .spinner").show(),e={action:"get-comments",mode:"single",_ajax_nonce:l("#add_comment_nonce").val(),p:l("#post_ID").val(),start:s,number:e},l.post(ajaxurl,e,function(t){return t=wpAjax.parseAjaxResponse(t),l("#commentsdiv .widefat").show(),l("#commentsdiv .spinner").hide(),"object"==typeof t&&t.responses[0]?(l("#the-comment-list").append(t.responses[0].data),theList=theExtraList=null,l("a[className*=':']").unbind(),void(commentsBox.st>commentsBox.total?l("#show-comments").hide():l("#show-comments").show().children("a").html(postL10n.showcomm))):void(1!=t?l("#the-comment-list").append(''+wpAjax.broken+""):l("#show-comments").html(postL10n.endcomm))}),!1}},WPSetThumbnailHTML=function(t){l(".inside","#postimagediv").html(t)},WPSetThumbnailID=function(t){var e=l('input[value="_thumbnail_id"]',"#list-table");0').attr("src",s.lock_error.avatar_src.replace(/&/g,"&")),i.find("div.post-locked-avatar").empty().append(e)),i.show().find(".currently-editing").text(s.lock_error.text),i.find(".wp-tab-first").focus()):s.new_lock&&l("#active_post_lock").val(s.new_lock))})}(jQuery),function(n){var a,t;function s(){a=!1,window.clearTimeout(t),t=window.setTimeout(function(){a=!0},3e5)}n(document).on("heartbeat-send.wp-refresh-nonces",function(t,e){var s,i;a&&(i=n("#post_ID").val())&&(s=n("#_wpnonce").val())&&(e["wp-refresh-post-nonces"]={post_id:i,post_nonce:s})}).on("heartbeat-tick.wp-refresh-nonces",function(t,e){e=e["wp-refresh-post-nonces"];e&&(s(),e.replace&&n.each(e.replace,function(t,e){n("#"+t).val(e)}),e.heartbeatNonce&&(window.heartbeatSettings.nonce=e.heartbeatNonce))}).ready(function(){s()})}(jQuery),jQuery(document).ready(function(d){var u,t,e,s,i,n="",a=0,o=d("#content");function l(){var t=d("#post-visibility-select");"public"!=d("input:radio:checked",t).val()?(d("#sticky").prop("checked",!1),d("#sticky-span").hide()):d("#sticky-span").show(),"password"!=d("input:radio:checked",t).val()?d("#password-span").hide():d("#password-span").show()}function c(){if(!d("#timestampdiv").length)return 1;var t,e=d("#post_status"),s=d('option[value="publish"]',e),i=d("#aa").val(),n=d("#mm").val(),a=d("#jj").val(),o=d("#hh").val(),l=d("#mn").val(),c=new Date(i,n-1,a,o,l),r=new Date(d("#hidden_aa").val(),d("#hidden_mm").val()-1,d("#hidden_jj").val(),d("#hidden_hh").val(),d("#hidden_mn").val()),p=new Date(d("#cur_aa").val(),d("#cur_mm").val()-1,d("#cur_jj").val(),d("#cur_hh").val(),d("#cur_mn").val());if(c.getFullYear()==i&&1+c.getMonth()==n&&c.getDate()==a&&c.getMinutes()==l)return d(".timestamp-wrap","#timestampdiv").removeClass("form-invalid"),p"+postL10n.dateFormat.replace("%1$s",d('option[value="'+d("#mm").val()+'"]',"#mm").text()).replace("%2$s",a).replace("%3$s",i).replace("%4$s",o).replace("%5$s",l)+" "),"private"==d("input:radio:checked","#post-visibility-select").val()?(d("#publish").val(postL10n.update),0==s.length?e.append('"):s.html(postL10n.privatelyPublished),d('option[value="publish"]',e).prop("selected",!0),d(".edit-post-status","#misc-publishing-actions").hide()):("future"==d("#original_post_status").val()||"draft"==d("#original_post_status").val()?s.length&&(s.remove(),e.val(d("#hidden_post_status").val())):s.html(postL10n.published),e.is(":hidden")&&d(".edit-post-status","#misc-publishing-actions").show()),d("#post-status-display").html(d("option:selected",e).text()),"private"==d("option:selected",e).val()||"publish"==d("option:selected",e).val()?d("#save-post").hide():(d("#save-post").show(),"pending"==d("option:selected",e).val()?d("#save-post").show().val(postL10n.savePending):d("#save-post").show().val(postL10n.saveDraft)),1;d(".timestamp-wrap","#timestampdiv").addClass("form-invalid")}function r(t){return s.height(Math.max(50,i+t.pageY)+"px"),!1}function p(t){var e;s.focus(),d(document).unbind("mousemove",r).unbind("mouseup",p),(e=parseInt(s.css("height"),10))&&50 label input[type="checkbox"]',function(){var t=d(this),e=t.is(":checked"),s=t.val();s&&t.parents("#taxonomy-"+n).length&&d("#in-"+n+"-"+s+", #in-popular-"+n+"-"+s).prop("checked",e)})}),d("#postcustom").length&&d("#the-list").wpList({addAfter:function(t,e){d("table#list-table").show()},addBefore:function(t){return t.data+="&post_id="+d("#post_ID").val(),t}}),d("#submitdiv").length&&(u=d("#timestamp").html(),t=d("#post-visibility-display").html(),d(".edit-visibility","#visibility").click(function(){return d("#post-visibility-select").is(":hidden")&&(l(),d("#post-visibility-select").slideDown("fast"),d(this).hide()),!1}),d(".cancel-post-visibility","#post-visibility-select").click(function(){return d("#post-visibility-select").slideUp("fast"),d("#visibility-radio-"+d("#hidden-post-visibility").val()).prop("checked",!0),d("#post_password").val(d("#hidden-post-password").val()),d("#sticky").prop("checked",d("#hidden-post-sticky").prop("checked")),d("#post-visibility-display").html(t),d(".edit-visibility","#visibility").show(),c(),!1}),d(".save-post-visibility","#post-visibility-select").click(function(){var t=d("#post-visibility-select");return t.slideUp("fast"),d(".edit-visibility","#visibility").show(),c(),"public"!=d("input:radio:checked",t).val()&&d("#sticky").prop("checked",!1),n=1==d("#sticky").prop("checked")?"Sticky":"",d("#post-visibility-display").html(postL10n[d("input:radio:checked",t).val()+n]),!1}),d("input:radio","#post-visibility-select").change(function(){l()}),d("#timestampdiv").siblings("a.edit-timestamp").click(function(){return d("#timestampdiv").is(":hidden")&&(d("#timestampdiv").slideDown("fast"),d("#mm").focus(),d(this).hide()),!1}),d(".cancel-timestamp","#timestampdiv").click(function(){return d("#timestampdiv").slideUp("fast"),d("#mm").val(d("#hidden_mm").val()),d("#jj").val(d("#hidden_jj").val()),d("#aa").val(d("#hidden_aa").val()),d("#hh").val(d("#hidden_hh").val()),d("#mn").val(d("#hidden_mn").val()),d("#timestampdiv").siblings("a.edit-timestamp").show(),c(),!1}),d(".save-timestamp","#timestampdiv").click(function(){return c()&&(d("#timestampdiv").slideUp("fast"),d("#timestampdiv").siblings("a.edit-timestamp").show()),!1}),d("#post").on("submit",function(t){if(!c())return t.preventDefault(),d("#timestampdiv").show(),d("#publishing-action .spinner").hide(),d("#publish").prop("disabled",!1).removeClass("button-primary-disabled"),!1}),d("#post-status-select").siblings("a.edit-post-status").click(function(){return d("#post-status-select").is(":hidden")&&(d("#post-status-select").slideDown("fast"),d(this).hide()),!1}),d(".save-post-status","#post-status-select").click(function(){return d("#post-status-select").slideUp("fast"),d("#post-status-select").siblings("a.edit-post-status").show(),c(),!1}),d(".cancel-post-status","#post-status-select").click(function(){return d("#post-status-select").slideUp("fast"),d("#post_status").val(d("#hidden_post_status").val()),d("#post-status-select").siblings("a.edit-post-status").show(),c(),!1})),d("#edit-slug-box").length&&(editPermalink=function(t){var e,s=0,i=d("#editable-post-name"),n=i.html(),a=d("#post_name"),o=a.val(),l=d("#edit-slug-buttons"),c=l.html(),r=d("#editable-post-name-full").html();for(d("#view-post-btn").hide(),l.html(''+postL10n.ok+' '+postL10n.cancel+""),l.children(".save").click(function(){var s=i.children("input").val();return s==d("#editable-post-name-full").text()?d(".cancel","#edit-slug-buttons").click():(d.post(ajaxurl,{action:"sample-permalink",post_id:t,new_slug:s,new_title:d("#title").val(),samplepermalinknonce:d("#samplepermalinknonce").val()},function(t){var e=d("#edit-slug-box");e.html(t),e.hasClass("hidden")&&e.fadeIn("fast",function(){e.removeClass("hidden")}),l.html(c),a.val(s),makeSlugeditClickable(),d("#view-post-btn").show()}),!1)}),d(".cancel","#edit-slug-buttons").click(function(){return d("#view-post-btn").show(),i.html(n),l.html(c),a.val(o),!1}),e=0;er.length/4?"":r,i.html('').children("input").keypress(function(t){t=t.keyCode||0;return 13==t?(l.children(".save").click(),!1):27==t?(l.children(".cancel").click(),!1):void 0}).keyup(function(t){a.val(this.value)}).focus()},(makeSlugeditClickable=function(){d("#editable-post-name").click(function(){d("#edit-slug-buttons").children(".edit-slug").click()})})()),"undefined"!=typeof wpWordCount&&(d(document).triggerHandler("wpcountwords",[o.val()]),o.keyup(function(t){t=t.keyCode||t.charCode;return t==a||(13!=t&&8!=a&&46!=a||d(document).triggerHandler("wpcountwords",[o.val()]),a=t),!0})),(wptitlehint=function(t){var e=d("#"+(t=t||"title")),s=d("#"+t+"-prompt-text");""==e.val()&&s.removeClass("screen-reader-text"),s.click(function(){d(this).addClass("screen-reader-text"),e.focus()}),e.blur(function(){""==this.value&&s.removeClass("screen-reader-text")}).focus(function(){s.addClass("screen-reader-text")}).keydown(function(t){s.addClass("screen-reader-text"),d(this).unbind(t)})})(),s=d("textarea#content"),i=null,!s.length||"ontouchstart"in window||(s.css("resize","none"),e=d('

'),d("#wp-content-wrap").append(e),e.on("mousedown",function(t){return i=s.height()-t.pageY,s.blur(),d(document).mousemove(r).mouseup(p),!1})),"undefined"!=typeof tinymce&&(tinymce.onAddEditor.add(function(t,e){function i(){var t=document.getElementById("content_ifr"),e=t?parseInt(t.style.height,10):0,t=d("#content_tbl tr.mceFirst").height();return!(!e||!t)&&(t=e+t+21,t-=33)}"content"!=e.id||tinymce.isIOS5||(e.onLoadContent.add(function(t,e){var s=document.getElementById("content"),i=s?parseInt(s.style.height,10):0,s=d("#content_tbl tr.mceFirst").height()||33;(!i||i<50||5e3