function printPage(w, h)
{
    try{
        var winPrintSite = null;
        var links = document.getElementsByTagName("link");
        var printBody = null;
        var pTitle = null;
        var printTitle = null;
        try{printBody = document.getElementById('printVersionBody');}catch(e){}
        try{printTitle = document.getElementById('printVersionTitle');}catch(e){}
        try{pTitle = document.getElementById('printTitleH1');}catch(e){}
        var bodyText = "<html><head><title>"+pTitle.innerHTML+"</title>\n";
        for(var i = 0; i <links.length; i++)
        {
            try{
                bodyText += "<link href=\"" + links[i].href + "\" rel=\"stylesheet\" type=\"text/css\">\n";
            }
            catch(e){}
        }
        bodyText +="</head>\n<body>\n";
        bodyText += "<table border=0 cellpadding=2 cellspacing=2 width='100%'>";
        if(printTitle != null)
            bodyText += "<tr><td>" + printTitle.innerHTML + "</td></tr>";
        bodyText += "<tr><td>" + printBody.innerHTML + "</td></tr>";
        bodyText += "</table>\n";
        bodyText += "\n<script>\nfunction doPrint(){\n";
        bodyText += "\twindow.print();\n";
        bodyText += "}\n";
        bodyText += "setTimeout(\"doPrint()\", 1200);\n";
        bodyText += "</script>";
        bodyText += "</body>";
        bodyText += "</html>";

	    if((w == "")||(w == null)||(w == 0))
		    w = 800;
	    if((h == "")||(h == null)||(h == 0))
		    h = 600;
	    var scrL, srcT;
	    srcL = Math.round((screen.width/2) - (w/2));
	    srcT = Math.round((screen.height/2) - (h/2));    
        winPrintSite = window.open("", "PRINTSITE", "left="+srcL+",top="+srcT+",width="+w+",height="+h+",toolbar=0,location=0,directories=0,status=1,menuBar=0,scrollBars=1,resizable=1");
        winPrintSite.focus();
        winPrintSite.document.open();
        winPrintSite.document.write(bodyText);
        winPrintSite.document.close();
     }
     catch(e){}
}

function bookmarkPage(){
    var url = window.location;
    var title = document.title;
    
    if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4)) {
        window.external.AddFavorite(url, title);
    } else if (navigator.appName == "Netscape") {
        window.sidebar.addPanel(title, url,"");
    } else {
        alert("Press CTRL-D (Netscape) or CTRL-T (Opera) to bookmark");
    }
}

