/*

 $Name  : winpdf.js, 20040311 © 2000-2007 serraolaser & pf;
 $Date  : Thu, 11 Mar 2004 12:00:00 GMT;
 $Exp   : Mon, 31 Dec 2007 23:59:59 GMT;
 $Lang  : javascript;
 $Target: none;
 $Type  : text/javascript;
 $Desc  : Starting winpdf (winpdf).

 Programming and graphics by pf  -  All Rights Unreserved.  You may use, copy,
 modify, distribute, or transmit this code for  any purpose.   At yet time, is
 not possible to contact us on a back end server.    Please send any questions
 to: info@serraolaser.it or pjoef@tiscali.it

*/

//  Startwinpdf - Start window for PDF documents.
//  src: pdf document path and name.
//  ttl: HTML page title.
function Startwinpdf(src, ttl)
{ var winpdf_title = 'serraolaser - ' + ttl;
  var winpdf_width = parseInt(screen.width * 3 / 4);
  var winpdf_height = parseInt(screen.height * 3 / 4);

  if (parseInt(navigator.appVersion) <= 3)
  { winpdf_width -= 12;
    winpdf_height -= 34;
  }

  var winpdfString = '';

  if (parseInt(navigator.appVersion) <= 3)
    winpdfString += 'height=' + winpdf_height.toString() + ',width=' +
      winpdf_width.toString()
  else
    winpdfString += 'outerHeight=' + winpdf_height.toString() + ',outerWidt' +
      'h=' + winpdf_width.toString() + ',titlebar=yes,status=yes,resizable=' +
      'yes,screenX=' + parseInt((screen.width - winpdf_width) / 2) + ',scre' +
      'enY=24';


  if (navigator.appName == 'Microsoft Internet Explorer')
  { winpdf = window.open('', 'winpdf', winpdfString);
    winpdf.moveTo(parseInt((screen.width - winpdf_width) / 2), 24);
    winpdf.resizeTo(winpdf_width, winpdf_height);
    winpdf.document.writeln('<html>');
    winpdf.document.writeln('<head>');
    winpdf.document.writeln('<meta http-equiv="Content-Type"  content="text' +
      '\/html; charset=iso-8859-1">');
    winpdf.document.write('<title>serraolaser - ' + ttl + '<\/title>');
    winpdf.document.writeln('<\/head>');
    winpdf.document.writeln('<body style="margin: 0">');
    winpdf.document.writeln('<embed src="' + src  + '" type="application\/p' +
      'df" width="100%" height="100%"><\/embed>');
    winpdf.document.writeln('<\/body>');
    winpdf.document.writeln('<\/html>')
  }
  else if (navigator.appName == 'Netscape')
    winpdf = window.open(src, 'winpdf', winpdfString);

  winpdf.document.title = winpdf_title;
  winpdf.focus();
}

//  End of winpdf.js javascript.
