$(document).ready(function(){$("a.comments_count").click(function(){var a=$("#"+this.id.replace("empty","comment"));if(a.attr("open")=="true"){a.attr("open","false")}else{var b=$("#commentForm").get(0);$("#placeid").val(this.id);a.append(b);a.attr("open","true")}a.slideToggle("fast");return false});$("a.comment_leave").click(function(){var b=$("#commentForm").get(0);$("#placeid").val(this.id);var a=$("#"+this.id.replace("comment_leave","comment"));a.append(b);return false});$("#newcommentform").submit(function(){var b=this.action;var a=$("#"+this.id);$.post(b,a.serialize(),function(f){var h=$("#commentAnchor");var g=f.indexOf(";");var d=$("#comment"+f.substring(0,g));var c=$("#commentForm").get(0);var e=$("#comment");e.val("");h.append(c);d.html(f.substring(g+1));d.append(c)});return false});$("#h0").val(c1);$("#h1").val(c1)});function reloadTagsImages(){$("#currenttags > span.tag").each(function(c,d){$(d).append("<div style='display: inline; width:8px;'><img id='"+d.id+"u' class='tagimage tagimageplus' src='/images/plus.png'/><img id='"+d.id+"m' class='tagimage tagimageminus' src='/images/minus.png'/></div>")});$(".tagimage").click(function(b){var c="/article/changetagbalance/"+this.id;var d="pageid="+pageID;$.ajax({type:"POST",url:c,data:d,success:function(a){$("#currenttags").html(a);reloadTagsImages()},error:function(e,f,g){reloadTagsImages()}})})}function sendNewTags(){if($("#suggest4").val().length<3){return}var b="/article/settags/"+pageID;currentTagsStringValue=$("#suggest4").val();if(oldTagsStringValue==currentTagsStringValue){return}oldTagsStringValue=currentTagsStringValue;$("#suggest4").addClass("settags_loading");var a="tags="+escape(oldTagsStringValue);$.ajax({type:"POST",url:b,data:a,success:function(c){$("#suggest4").removeClass("settags_loading");$("#currenttags").html(c);reloadTagsImages()},error:function(d,e,f){$("#suggest4").removeClass("settags_loading");reloadTagsImages()}})}$(function(){reloadTagsImages();$("#dialog").dialog({bgiframe:true,autoOpen:false,height:200,width:300,modal:true,buttons:{},Close:function(){$(this).dialog("close")}});$(".abuse").click(function(){var a=this.id.replace("comment","");var b="/article/abuse/"+a+"/";$.post(b,"",function(c){});$("#dialog").dialog("open")});$("#suggest4").autocomplete("/article/tags/"+pageID,{width:300,multiple:true,matchContains:true,minChars:3,}).blur(function(){setTimeout("sendNewTags()",300)})});