<% selector = ".#{watcher_css(watched)}" %>
<% id_selector = "#{watcher_css(watched)}" %>
if($("<%= selector %>").get(0) == undefined)
{
    $("#<%= id_selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link_for_project(watched, user) %>")});
}
else
{
   $("<%= selector %>").each(function(){$(this).replaceWith("<%= escape_javascript watcher_link(watched, user) %>")});
}

