!function(a){a(document).bind("DOMNodeInserted",function(t){var e=a(t.target);if("inline-edit"==e.attr("id")){var n=e.prev().attr("id").replace("tag-","");if(n>0){var i=e.find(':input[name="inline_lang_choice"]'),l=a("#lang_"+n).html();i.val(l);var s=a("#default_cat_"+n).html();n==s&&i.prop("disabled",!0)}}})}(jQuery),function(a){a(document).ajaxSuccess(function(t,e,n){function i(t){var e=new Array;a(".translation_"+t).each(function(){e.push(a(this).parent().parent().attr("id").substring(4))});var n={action:"pll_update_term_rows",term_id:t,translations:e.join(","),taxonomy:a("input[name='taxonomy']").val(),post_type:a("input[name='post_type']").val(),screen:a("input[name='screen']").val(),_pll_nonce:a("#_pll_nonce").val()};a.post(ajaxurl,n,function(t){if(t){var e=wpAjax.parseAjaxResponse(t,"ajax-response");a.each(e.responses,function(){"row"==this.what&&a("#tag-"+this.supplemental.term_id).replaceWith(this.data)})}})}var l=wpAjax.unserialize(n.data);if("undefined"!=typeof l.action)switch(l.action){case"add-tag":res=wpAjax.parseAjaxResponse(e.responseXML,"ajax-response"),a.each(res.responses,function(){"term"==this.what&&i(this.supplemental.term_id)}),a(".htr_lang").val(0);break;case"delete-tag":i(l.tag_ID);break;case"inline-save-tax":i(l.tax_ID)}})}(jQuery),jQuery(document).ready(function(a){function t(){a(".tr_lang").each(function(){var t=a(this).attr("id").substring(8),e=a(this).parent().siblings(".pll-edit-column");a(this).autocomplete({minLength:0,source:ajaxurl+"?action=pll_terms_not_translated&term_language="+a("#term_lang_choice").val()+"&term_id="+a("input[name='tag_ID']").val()+"&taxonomy="+a("input[name='taxonomy']").val()+"&translation_language="+t+"&post_type="+typenow+"&_pll_nonce="+a("#_pll_nonce").val(),select:function(n,i){a("#htr_lang_"+t).val(i.item.id),e.html(i.item.link)}}),a(this).blur(function(){a(this).val()||(a("#htr_lang_"+t).val(0),e.html(e.siblings(".hidden").children().clone()))})})}t(),a("#term_lang_choice").change(function(){var e={action:"term_lang_choice",lang:a(this).val(),from_tag:a("input[name='from_tag']").val(),term_id:a("input[name='tag_ID']").val(),taxonomy:a("input[name='taxonomy']").val(),post_type:typenow,_pll_nonce:a("#_pll_nonce").val()};a.post(ajaxurl,e,function(e){var n=wpAjax.parseAjaxResponse(e,"ajax-response");a.each(n.responses,function(){switch(this.what){case"translations":a("#term-translations").html(this.data),t();break;case"parent":a("#parent").replaceWith(this.data);break;case"tag_cloud":a(".tagcloud").replaceWith(this.data);break;case"flag":a(".pll-select-flag").html(this.data)}})})})});