jQuery.fn.labelify=function(a){a=jQuery.extend({text:"title",labelledClass:""},a);var b={title:function(e){return $(e).attr("title")},label:function(e){return $("label[for="+e.id+"]").text()}};var d;var c=$(this);return $(this).each(function(){if(typeof a.text==="string"){d=b[a.text]}else{d=a.text}if(typeof d!=="function"){return}var f=d(this);if(!f){return}$(this).data("label",d(this).replace(/\n/g,""));$(this).focus(function(){if(this.value===$(this).data("label")){this.value=this.defaultValue;$(this).removeClass(a.labelledClass)}}).blur(function(){if(this.value===""){this.value=$(this).data("label");$(this).addClass(a.labelledClass)}});var e=function(){c.each(function(){if(this.value===$(this).data("label")){this.value=this.defaultValue;$(this).removeClass(a.labelledClass)}})};$(this).parents("form").submit(e);$(window).unload(e);if(this.value!==""){return}this.value=$(this).data("label");$(this).addClass(a.labelledClass)})};(function(a){a.fn.comments=function(){a(this).each(function(){var b=a(this);if(!b.hasClass("full")&&!b.find("ul.comments li").size()){b.find("form.post-comment").css("display","none")}if(b.find("form.post-comment").size()){a("form.post-comment [name=contents]").bind("change keyup",function(){var c=a(this);var d=a("form.post-comment input.submit");if(!a.trim(c.attr("value"))){d.attr("disabled","disabled")}else{d.removeAttr("disabled")}}).change();b.find("a.comment").click(function(c){if(c.button==0){c.preventDefault();c.stopPropagation();b.find("form.post-comment").slideDown().find("textarea").focus()}});b.find("div.comments-info a").click(function(c){if(c.button==0){c.preventDefault();c.stopPropagation();a.get(b.find("a.comment").attr("href"),function(d){a(d).find("ul.comments li").each(function(){var e=a(this);if(!a("#"+e.attr("id")).size()){e.css("display","none").addClass("imported").insertBefore(b.find("ul.comments li:not(.imported):first")).slideDown()}});b.find("div.comments-info").slideUp(function(){a(this).remove()})})}})}})}})(jQuery);jQuery(function(a){a("#post-news-media h3").click(function(c){if(!c.button){c.preventDefault();c.stopPropagation();var b=a(this);a("#post-news-media .open-tab").hide().remove();b.siblings("h3").removeClass("open");if(!b.hasClass("open")){b.next(".tab").clone().removeClass("tab").addClass("open-tab").appendTo("#post-news-media")}b.toggleClass("open")}})});jQuery(function(a){a("ul.news li, div.news, div.page-comments").comments();a("#home-search-q, #nbh-search-q, #news-search-q").labelify({text:"label",labelledClass:"label"})});var FileBrowserDialog={init:function(){var a=document.getElementsByTagName("link");a[a.length-1].parentNode.removeChild(a[a.length-1])},fileSubmit:function(b){var a=b;var c=tinyMCEPopup.getWindowArg("window");c.document.getElementById(tinyMCEPopup.getWindowArg("input")).value=a;if(c.ImageDialog){if(c.ImageDialog.getImageData){c.ImageDialog.getImageData()}if(c.ImageDialog.showPreviewImage){c.ImageDialog.showPreviewImage(a)}}tinyMCEPopup.close()}};jQuery(function(a){a("a.select-file").click(function(b){if(!b.button&&window.FileBrowserDialog!==undefined){b.preventDefault();b.stopPropagation();FileBrowserDialog.fileSubmit(a(this).attr("href"))}});if(window.tinyMCEPopup!==undefined&&tinyMCEPopup.onInit!==undefined){tinyMCEPopup.onInit.add(FileBrowserDialog.init,FileBrowserDialog)}a("a.open-browser").click(function(b){if(!b.button){b.preventDefault();window.open(a(this).attr("href"),"openbrowser","menubar=1,resizable=1,width=800,height=450")}})});jQuery(function(a){a("#post-news [name=contents]").bind("change keyup",function(){var b=a(this);var c=a("#post-news input.submit");if(!a.trim(b.attr("value"))){c.attr("disabled","disabled")}else{c.removeAttr("disabled")}}).change()});
