﻿function PrintThisPage() {
    var sOption = "scrollbars,resizable";
    var sWinHTMLHeading = "<div id='pageutilities'><a href='javascript:window.print()'><img src='http://isx-morg1/held/ITInventory/Images/printer_icon.gif' alt='Send to printer' width='16' height='13' border='0'></a>&nbsp;<a href='javascript:window.print()'>Send to printer</a>&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;<a href='javascript:window.close()'>Close</a></div>";
    sWinHTMLHeading += "<br>";

    var sWinHTMLBody = document.getElementById('print-content').innerHTML;
    var winprint = window.open("", "", sOption);
    winprint.document.open();
    winprint.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><link href="/nigms.nih.gov/Style/PlainStyle.css" type="text/css" rel="stylesheet" /><link href="../App_Themes/IT/Print.css" rel="stylesheet" type="text/css" media="print" /><body>');
    winprint.document.write('<scr' + 'ipt language="javascript" type="text/javascript">function hyperlinktoggle() { for(i=0; i<document.links.length; i++) { if (document.links[i].innerText != "") { if (document.links[i].href.substring(0,4)!="java" && document.links[i].innerHTML.substring(0,4)!="http") { document.links[i].innerHTML = document.links[i].innerHTML + " &lt;" + document.links[i].href + "&gt;"}}} document.getElementById("hyperlinktoggle").innerHTML = "[<a href=javascript:document.location.reload()>Hide Links</a>]"}</scr' + 'ipt>');
    winprint.document.write(sWinHTMLHeading);
    winprint.document.write(sWinHTMLBody);
    winprint.document.write('</body></html>');
    winprint.document.close();
}

var lastObject;
function showdiv(object) {
    if (lastObject != null) {
        hidediv(lastObject);
    }
    if (document.getElementById) {
        document.getElementById(object).style.visibility = 'visible';
        document.getElementById(object).style.display = '';
    }
    else if (document.layers && document.layers[object]) {
        document.layers[object].visibility = 'visible';
        document.layers[object].display = '';
    }
    else if (document.all) {
        document.all[object].style.visibility = 'visible';
        document.all[object].style.display = '';
    }
    lastObject = object;
}
function hidediv(object) {
    if (document.getElementById) {
        document.getElementById(object).style.visibility = 'hidden';
        document.getElementById(object).style.display = 'none';
    }
    else if (document.layers && document.layers[object]) {
        document.layers[object].visibility = 'hidden';
        document.layers[object].style.display = 'none';
    }
    else if (document.all) {
        document.all[object].style.visibility = 'hidden';
        document.all[object].style.display = 'none';
    }
}

