//--------------------------------------------------------------------------
// Created by:	Pascal Parent and Abu Abrahams
// Version:		1.0
// Date			19/03/2004
//--------------------------------------------------------------------------

//--------------------------------------------------------------------------
// Print a DIV 
//--------------------------------------------------------------------------
var gAutoPrint = true; // Flag for whether or not to automatically call the print function
 
function printSpecial(Title)
{
 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<BODY>\n';
  
  var printReadyElem = document.getElementById("printReady");
  
  if (printReadyElem != null)
  {
    html += printReadyElem.innerHTML;
  }
  else
  {
   alert("Could not find the printReady section in the HTML");
   return;
  }
   
  html += '\n</BO' + 'DY>\n</HT' + 'ML>';
  var myObject = new Object();
  
  myObject.Title = Title
  myObject.PrintHTML = html
  myObject.AutoPrint = gAutoPrint
 
  var printWin = window.showModalDialog("Print.htm", myObject,"dialogHeight: 500px; dialogWidth: 618px; edge: Raised; center: Yes; help: Yes; scroll: No; resizable: No; status: No;");
 }
 else
 {
  alert("Sorry, the print ready feature is only available in modern browsers.");
 }
}
