<!--

// Check whether browser object model supports print() command
var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1);
var safari = (navigator.userAgent.indexOf("Mac") != -1) && (navigator.userAgent.indexOf("Safari") != -1);

function pausecomp(Amount)
{
    d = new Date() //today's date
    while (1)
    {
        mill=new Date() // Date Now
        diff = mill-d //difference in milliseconds
        if( diff > Amount )
        {
            break;
        }
    }
}

// Send copy of parents content frame to printer (opens standard print dialog)
function printFrame(frame, goBackTo,unsupportedAlert) 
{
  returnLocation = goBackTo;
  if (pr && da && !mac)
  { // IE5 - Set focus to frame to be printed and then print
    frame.focus();
    window.print();
  } 
  else if (pr && !safari)
  { // NS4 - No need to change focus
    pausecomp(100);
    frame.focus();
    pausecomp(100);
    frame.print();
    pausecomp(500);
    //alert('Please press continue once the document has been printed!');
    //pausecomp(2000);
  }
  else if (da && !mac)
  { // IE4 (Windows) - Set focus to frame to be printed, wait 100 
    // milliseconds and call VBScript routine to print page
    frame.focus();
    setTimeout("vbPrintPage();", 100);
  } 
  else 
  { // other browsers & any browser running on a Macintosh
    alert(unsupportedAlert);
  }
  // Only go back if IE
  if (goBackTo && da && !mac) // && pr && da)
  {
      ws_topFrame.location = goBackTo;
  }
  return false;
}

if (da && !pr && !mac) with (document) 
{
  writeln('<OBJECT ID="WB" WIDTH="0" HEIGHT="0" CLASSID="clsid:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>');
  writeln('<' + 'SCRIPT LANGUAGE="VBScript">');
  writeln('Sub window_onunload');
  writeln('  On Error Resume Next');
  writeln('  Set WB = nothing');
  writeln('End Sub');
  writeln('Sub vbPrintPage');
  writeln('  On Error Resume Next');
  writeln('  WB.ExecWB 6, 1');
  writeln('End Sub');
  writeln('<' + '/SCRIPT>');
}

// -->

