<script type="text/javascript" src="<$MTLink template="JavaScript"$>"></script>
<div class="widget">
    <h3 class="widget-header">Sign In</h3>
    <div class="widget-content">
<script type="text/javascript">
<!--
var name, id, url, blog_ids;
if (typeof(commenter_name) != 'undefined')
    name = commenter_name
if (typeof(commenter_id) != 'undefined')
    id = commenter_id;
if (typeof(commenter_url) != 'undefined')
    url = commenter_url;
if (typeof(commenter_blog_ids) != 'undefined')
    blog_ids = commenter_blog_ids;

if (!name && !id) {
    if ('<$MTCGIHost exclude_port="1"$>' != '<$MTBlogHost exclude_port="1"$>') {
        document.write('<scr' + 'ipt src="<$MTCGIPath$><$MTCommentScript$>?__mode=cmtr_name_js">');
        document.write("</scr" + "ipt>");
    } else {
        name = getCookie('commenter_name');
        ids = getCookie('commenter_id').split(':');
        id = ids[0];
        blog_ids = ids[1];
        url = getCookie('commenter_url');
    }
}
showMessage(name, id, url);

function showMessage(commenter_name, commenter_id, commenter_url) {
    static = location.href;
    if ( commenter_name &&
         ( !commenter_id 
        || commenter_blog_ids.indexOf("'<$MTBlogID$>'") > -1))
    {
        var url;
        if (commenter_id) {
            url = '<$MTCGIPath$><$MTCommentScript$>?__mode=edit_profile&commenter=' + commenter_id + '&blog_id=<$MTBlogID$>';
            url += '&static=' + static;
        } else if (commenter_url) {
            url = commenter_url;
        } else {
            url = null;
        }
        var content = 'You are signed in as ';
        if (url) {
            content += '<a href="' + url + '">' + commenter_name + '</a>';
        } else {
            content += commenter_name;
        }
        content += '.  (<a href="<$MTRemoteSignOutLink no_static="1"$>&static=' + static + '">sign out</a>)';
        document.write(content);
    } else if (commenter_name) {
        document.write('You do not have permission to sign in to this blog. (<a href="<$MTRemoteSignOutLink no_static="1"$>&static=' + static + '">sign out</a>)');
    } else {
    <MTIfRegistrationAllowed>
        document.write('<a href="<$MTCGIPath$><$MTCommentScript$>?__mode=login&blog_id=<$MTBlogID$>&static=' + static + '">Sign In</a>');
    </MTIfRegistrationAllowed>
    }
}
//-->
</script>
    </div>
<div>
