// create print page link on the fly if key items are supported var hasPrintFeature = (window.print) ? true : false; var supportsW3CDOM = ((document.createElementNS || document.createElement) && document.createTextNode && document.insertBefore && document.appendChild); if (hasPrintFeature && supportsW3CDOM) { if (typeof PRINT_PAGE_TEXT == 'string') { var li = (document.createElementNS) ? document.createElementNS(XHTML_NS_URI, 'li') : document.createElement('li'); li.setAttribute('id', 'navFunctionsPrint'); var a = (document.createElementNS) ? document.createElementNS(XHTML_NS_URI, 'a') : document.createElement('a'); a.setAttribute('href', '#'); if (typeof PRINT_TOOLTIP == 'string') { a.setAttribute('title', PRINT_TOOLTIP); } a.onclick = function() { window.print(); return false; } a.appendChild(document.createTextNode(PRINT_PAGE_TEXT)); li.appendChild(a); var refNode = document.getElementById('navFunctionsRecommend'); if (refNode) { refNode.parentNode.insertBefore(li, refNode); } else { var parentRefNode = document.getElementById('siteInfo'); if (parentRefNode) { var ul = (document.createElementNS) ? document.createElementNS(XHTML_NS_URI, 'ul') : document.createElement('ul'); ul.appendChild(li); refNode = (parentRefNode.getElementsByTagName('p').length > 0) ? parentRefNode.getElementsByTagName('p')[0] : null; if (refNode) { refNode.parentNode.insertBefore(ul, refNode); } } } } }