var SL={".markSource":function(a){a.onclick=function(){$this=$(this);var b=($(this).attr("rel")&&$(this).attr("rel").split("-")[1])||$(this).parent().parent().attr("id").split("-")[1];var c=($(this).attr("rel")&&$(this).attr("rel").split("-")[0])||$(this).parent().parent().attr("class");if(b&&c){$this.addClass("processing");$.post("/data/source/mark",({uid:b,type:c}),function(d){$this.removeClass("processing");if(typeof(d)==="string"&&d!==""){d=$.parseJSON(d)}if(d!==""&&d.message!=="success"){$.post("/data/source/unmark",({uid:b,type:c}),function(f){$this.removeClass("processing");if(typeof(f)==="string"&&f!==""){f=$.parseJSON(f)}if(f!==""&&f.message!=="success"){alert(f.message)}if(f){var e=c.charAt(0).toUpperCase()+c.substr(1)+" source";$this.text(e);$this.removeClass("unmarkSource").addClass("markSource");Behaviour.apply($this.parent().parent())}else{}});return}if(d){if(c=="blacklist"){$this.text("Reinstate source")}else{$this.text("Remove from "+c)}$this.removeClass("markSource").addClass("unmarkSource");Behaviour.apply($this.parent().parent())}else{alert("Operation unsuccesfull")}})}else{$this.text("Error occurred attemping to "+c)}return false}},".unmarkSource":function(a){a.onclick=function(){$this=$(this);var b=($(this).attr("rel")&&$(this).attr("rel").split("-")[1])||$(this).parent().parent().attr("id").split("-")[1];var c=($(this).attr("rel")&&$(this).attr("rel").split("-")[0])||$(this).parent().parent().attr("class");if(b&&c){$this.addClass("processing");$.post("/data/source/unmark",({uid:b,type:c}),function(e){$this.removeClass("processing");if(typeof(e)==="string"&&e!==""){e=$.parseJSON(e)}if(e!==""&&e.message!=="success"){alert(e.message)}if(e){var d=c.charAt(0).toUpperCase()+c.substr(1)+" source";$this.text(d);$this.removeClass("unmarkSource").addClass("markSource");Behaviour.apply($this.parent().parent())}else{}})}else{$this.text("Error occurred attemping to remove "+c)}return false}},".eventinfo":function(a){$(a).click(SEEventInfo)}};var SEEventInfo=function(e){var d=this;e.preventDefault();var a=null;if(!$("#eventInfoPanel")[0]){a=$("<div />",{id:"eventInfoPanel"}).appendTo("body");var g=$("<div />",{id:"eventInfoHeader"}).appendTo(a);var c=$("<a/>",{id:"eipClose",href:"#",text:"Close"}).appendTo(g);c.click(function(h){h.preventDefault();$("#eventInfoPanel").removeClass("show")});var f=$("<h4/>",{id:"eipTitle",text:"Admin: article associations"}).appendTo(g);$("<div/>",{id:"eipContent"}).appendTo(a)}a=$("#eventInfoPanel");$("#eipContent").first().empty().html('<div id="eipLoading"><img src="/images/ajax-snake.gif" alt="loading..." /></div>');var b=$(this).children("img").first();a.css("left",e.pageX+5);a.css("top",b.position().top+3);a.addClass("show");$.get("/event/info",{id:$(this).attr("rel")},updatePanel);return false};var updatePanel=function(a){$("#eipContent").first().empty().html(a)};Behaviour.register(SL);
