﻿function printpackingslip() {
  var printWindow = window.open();
  printWindow.document.writeln('<HTML><HEAD><title>Plocklista</title>');
  printWindow.document.writeln('<style TYPE="text/css">');
  printWindow.document.writeln('h1 { font-family: Arial, Helvetica neue; font-size: 16px; color: #0161c1; }');
  printWindow.document.writeln('h2 { font-family: Arial, Helvetica neue; font-size: 14px; color: #0161c1; }');
  printWindow.document.writeln('TABLE { font-family: Arial, Helvetica neue; }');
  printWindow.document.writeln('caption { font-weight: bold; }');
  printWindow.document.writeln('caption TH { padding: 10px 0 0 10px; }');
  printWindow.document.writeln('.MSTr { background-color: #ffffff; }');
  printWindow.document.writeln('.MSTr TD { padding: 10px 0 0 10px; }');
  printWindow.document.writeln('.MSTrAlternate { background-color: #81c7f1; }');
  printWindow.document.writeln('.MSTrAlternate TD { padding: 10px 0 0 10px; }');
  printWindow.document.writeln('</style>');
  printWindow.document.writeln('</HEAD>');
  printWindow.document.writeln('<body MS_POSITIONING="GridLayout" bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0">');
  printWindow.document.writeln('<form  method="post">');
  printWindow.document.writeln('<TABLE width=80%><TR><TD></TD></TR><TR><TD align=right><INPUT ID="PRINT" type="button" value=" Skriv ut " onclick="javascript:location.reload(true);window.print();"><INPUT ID="CLOSE" type="button" value="  Stäng  " onclick="window.close();"></TD></TR><TR><TD></TD></TR></TABLE>');
  printWindow.document.writeln('<h1>MARINSHOPEN RM AB</h1>');
  printWindow.document.writeln('<br /><h2>Plocklista</h2>');
  var packingslipDataGrid = document.getElementById(GetClientId('packingSlipGridView'));
  printWindow.document.writeln('<br /><TABLE>'); 
  printWindow.document.write(packingslipDataGrid.innerHTML);
  printWindow.document.writeln('</TABLE></form></body></HTML>');
  printWindow.document.close();
  printWindow.focus();
}

function getPrint(print_area) {
  //Creating new page
  var pp = window.open();
  //Adding HTML opening tag with <HEAD> … </HEAD> portion 
  pp.document.writeln('<HTML><HEAD><title>Plocklista</title><LINK href=nmprint.css  type="text/css" rel="stylesheet">')
  pp.document.writeln('<LINK href=nmprint.css  type="text/css" rel="stylesheet" media="print"><base target="_self"></HEAD>')
  //Adding Body Tag
  pp.document.writeln('<body MS_POSITIONING="GridLayout" bottomMargin="0" leftMargin="0" topMargin="0" rightMargin="0">');
  //Adding form Tag
  pp.document.writeln('<form  method="post">');
  //Creating two buttons Print and Close within a table
  pp.document.writeln('<TABLE width=100%><TR><TD></TD></TR><TR><TD align=right><INPUT ID="PRINT" type="button" value="Print" onclick="javascript:location.reload(true);window.print();"><INPUT ID="CLOSE" type="button" value="Close" onclick="window.close();"></TD></TR><TR><TD></TD></TR></TABLE>');
  //Writing print area of the calling page
  pp.document.writeln(document.getElementById(print_area).innerHTML);
  //Ending Tag of </form>, </body> and </HTML>
  pp.document.writeln('</form></body></HTML>');
}		
