var printWin;

function printSpecial()
{
  var gAutoPrint = (window.print != null)?true:false;

  if (document.getElementById != null)
  {
    var html = '<HTML>\n<HEAD>\n';

    if (document.getElementsByTagName != null)
    {
      var headTags = document.getElementsByTagName("head");
      if (headTags.length > 0)
        html += headTags[0].innerHTML;
    }

    html += '\n</HE' + 'AD>\n<STY' + 'LE>.printlogo {display:block;}</ST' + 'YLE><BODY style="background-color:#FFFFFF;">\n';

    var printReadyElem = document.getElementById("print");

    if (printReadyElem != null)
    {
        html += printReadyElem.innerHTML;
    }
    else
    {
      alert("Er is geen tekst gevonden om te printen.");
      return;
    }

    html += '\n</BO' + 'DY>\n</HT' + 'ML>';

    printWin = window.open("","printSpecial", "height=400,width=650,status=no,toolbar=no,menubar=no,location=no");
    printWin.document.open();
    printWin.document.write("<title>" + (document.title) + "</title>");
    printWin.document.write(html);
    printWin.document.close();
    if (gAutoPrint) {
      printWin.print();
      setTimeout('printWin.close()',3000);
    }
  }
  else
  {
    alert("Fout: browser ondersteunt geen print functie.");
  }
}
