

function addPrintLink() {
    var sTargetEl = "top-nav";
    var sLinkText = "Tulosta";

    if (!document.getElementById || !document.createTextNode) {return;} // Check for DOM support
    if (!document.getElementById(sTargetEl)) {return;} // Check that the target element actually exists
    if (!window.print) {return;} // Make sure the browser supports window.print

    var x = document.getElementsByTagName("html")[0];
    if (x.attributes[0].value == 'sv') {sLinkText = "Skriv ut";}

    var oTarget = document.getElementById(sTargetEl);

    var liElement = document.createElement('li');
    liElement.id = 'print';

    var oLink = document.createElement('a');
    oLink.href = '#'; // Make the link focusable for keyboard users
    oLink.appendChild(document.createTextNode(sLinkText));
    oLink.onclick = function() {window.print(); return false;}
    liElement.appendChild(oLink);

    var position = oTarget.childNodes[4];
    oTarget.insertBefore(liElement, position);
}

OnloadScheduler.schedule(addPrintLink);








