// Copyright 2002-2007 Artific Consulting LLC
// Licensed under the GPL v2.0
// but really, it's mostly crap code, wouldn't you rather write some
// yourself?

function  SelectedIndexRedirect (s) {window.location.href = s.options[s.selectedIndex].value;return;}

function DOMwriteTypeKeyGreeting(commenter_name, entry_id, DOMid) {
    // by epc based on the original 6a code.

var oInsertionPoint = document.getElementById(DOMid);

if (commenter_name) {
var tMessage='Thanks for signing in, ' + commenter_name + '. Now you can comment. ';
var oMessage = document.createElement('p');
oMessage.setAttribute('class','pc');
var oSignoutLink = document.createElement('a');

var MTRemoteSignOutLink = 'http://artific.com/scripts/mt/mt-comments.cgi?__mode=handle_sign_in&amp;static=1&amp;logout=1&amp;entry_id=' + entry_id;
oSignoutLink.setAttribute('href',MTRemoteSignOutLink);
oSignoutLink.setAttribute('title','Sign out of typekey');
oSignoutLink.appendChild(document.createTextNode('sign out of Typekey'));

oMessage.appendChild(document.createTextNode(tMessage));
oMessage.appendChild(oSignoutLink);
oMessage.appendChild(document.createTextNode(')'));

oInsertionPoint.appendChild(oMessage);
    } else {
var oSigninLink = document.createElement('a');
var oMessage = document.createElement('p');
oMessage.setAttribute('class','pc');


var MTRemoteSignInLink = 'https://www.typekey.com/t/typekey/login?&amp;need_email=1&amp;lang=en&amp;t=MhhjajSlnJ9i6G0xtksP&amp;v=1.1&amp;_return=http://artific.com/scripts/mt/mt-comments.cgi%3f__mode=handle_sign_in%26static=1%26entry_id='+entry_id;

oSigninLink.setAttribute('href',MTRemoteSignInLink);
oSigninLink.setAttribute('title','Sign in to Typekey');
oSigninLink.appendChild(document.createTextNode('Sign in to Typekey'));

var tMessage = document.createTextNode('If you have a TypeKey identity, you can ');
oMessage.appendChild(tMessage);
oMessage.appendChild(oSigninLink);
oMessage.appendChild(document.createTextNode(' to use it here.'));
oInsertionPoint.appendChild(oMessage);

delete oMessage,tMessage,oSigninLink,oSignoutLink,oInsertionPoint;
    }

}
