var watchlist={followImagePath:"/assets/btn-follow.gif",unfollowImagePath:"/assets/btn-ignore.gif"};var WatchlistBehaviours={".watchlist-button":function(a){a.onclick=function(){elid=a.id.split("-");id=elid[1];entity=elid[0];params=entity+"Id="+id;if($(a).hasClass("in-watchlist")){imagePath=watchlist.followImagePath;if($(a).hasClass("button-small")){imagePath="/assets/btn_follow_small.gif"}$(a).removeClass("in-watchlist");action="remove";$("#watchlist-"+entity+"-button-"+id).attr("title","Add to watchlist");if($("#watchlistActionText").length){$("#watchlistActionText").html($("#watchlistActionText").html().replace("Remove from","Add to"))}}else{imagePath=watchlist.unfollowImagePath;if($(a).hasClass("button-small")){imagePath="/assets/btn_ignore_small.gif"}$(a).addClass("in-watchlist");action="add";$("#watchlist-"+entity+"-button-"+id).attr("title","Remove from watchlist");if($("#watchlistActionText").length){$("#watchlistActionText").html($("#watchlistActionText").html().replace("Add to","Remove from"))}}$("#watchlist-"+entity+"-button-"+id).attr("src",imagePath);$.get("/watchlist/"+action,params);return false}}};Behaviour.register(WatchlistBehaviours);
