﻿// JScript File

DW.Print = 
{
    getArgs : function(aSettingWinId)
    {
        var w = MR.getId(aSettingWinId);
        var out = "";
        var inps =w.getElementsByTagName('input');
        for(i=0;i<inps.length; i++)
        {
            var n = inps[i];
            if(n.type == "checkbox")
            {
                out +="&"+ n.id.split('-')[0]+"="+n.checked;
            }
        }
       return out;
    },
    
    singleTilt: function(aTiltId, aSettingWinId)
    {
        var win = window.open('Print/Tiltag.aspx?id='+aTiltId+DW.Print.getArgs(aSettingWinId),'pet','width=1,height=1,toolbar=no,location=no,directories=no,menubar=no,copyhistory=no');
        MR.DHTMLfx.window.close(aSettingWinId);
//        var w = window.open('Print/Tiltag.aspx?id='+aTiltId +DW.Print.getArgs(aSettingWinId),'pet','width=1000,height=700');
    },
    singleHenv : function(aHenvId, aSettingWinId)
    {
//    var w = window.open('Print/Henvendelse.aspx?id='+aHenvId,'peh','width=1000,height=700');
        var win = window.open('Print/Henvendelse.aspx?id='+aHenvId + DW.Print.getArgs(aSettingWinId),'peh','width=1,height=1,toolbar=no,location=no,directories=no,menubar=no');
        MR.DHTMLfx.window.close(aSettingWinId);
    },
    batchTiltag : function()
    {
        alert('batchTiltag');
    },
    batchHenvendelse : function()
    {
        alert('batchHenvendelse');
    },
    singleDiv : function(div)
    {
	    var a = window.open('','','width=600,height=600');
	    a.document.open("text/html");
        a.document.write('<html>');
        a.document.write('<head>');   
        a.document.write('</head>');
        a.document.write('<body>');
	    a.document.write(document.getElementById(div).innerHTML);
	    a.document.write('</body>');
        a.document.write('</html>');	    
	    a.document.close();
	    a.print();
	    a.close();
    }    
}

//   1. width=300
//      Use this to define the width of the new window.

//   2. height=200
//      Use this to define the height of the new window.

//   3. resizable=yes or no
//      Use this to control whether or not you want the user to be able to resize the window.

//   4. scrollbars=yes or no
//      This lets you decide whether or not to have scrollbars on the window.

//   5. toolbar=yes or no
//      Whether or not the new window should have the browser navigation bar at the top (The back, foward, stop buttons..etc.).

//   6. location=yes or no
//      Whether or not you wish to show the location box with the current url (The place to type http://address).

//   7. directories=yes or no
//      Whether or not the window should show the extra buttons. (what's cool, personal buttons, etc...).

//   8. status=yes or no
//      Whether or not to show the window status bar at the bottom of the window.

//   9. menubar=yes or no
//      Whether or not to show the menus at the top of the window (File, Edit, etc...).

//  10. copyhistory=yes or no
//      Whether or not to copy the old browser window's history list to the new window. 