/***********************************************
* Utskrift av nettside 
* Denne funksjonen kaller også funksjon i "print.vb.js" filen
***********************************************/

var nIE4Win;    
var nCanPrint;
var printed;
function init() {
        printed = "no";
        if (window.print) {
                nCanPrint = "yes";
        } else {
                nCanPrint = "no";
        }
    var agt=navigator.userAgent.toLowerCase()
    nVersion = parseInt(navigator.appVersion);
    nIE  = (agt.indexOf("msie") != -1);
    nWin   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
        nMac = (agt.indexOf("mac") != -1);
        nIE4Win  = (nIE && (nVersion == 4) && nWin);
        doPrint();
}

function doPrint() {
        if (nCanPrint == "yes") {
                printed="yes";
                window.print();
        } else if (nIE4Win) {
                printed="yes";
                IEPrint();
        }
        else if (nWin)
        {
        alert("To print this page, click your browser's Print button.");               
        }
}

function myFocus() {
        if (printed == "yes") {
                //window.close()
        }
}