//<SCRIPT LANGUAGE='JavaScript'><!--
var w = null;
var w1 = null;
var wname = null;
var wname1 = null;

function InitVars() {
  if(!wname) wname = GetUnique('urlWin');
  if(!wname1) wname1 = GetUnique('pdfWin');
}

function GetUnique(txt) {
 var d1 = new Date;
 var d = d1.getDate();
 var m = d1.getMonth() + 1;
 if(txt) wname =txt+d+m+d1.getFullYear()+d1.getMilliseconds();
 if(!txt) wname ='w'+d+m+d1.getFullYear()+d1.getMilliseconds();
}

function Void() { ; }

function custWindow(url) {
  window.status=url;
  w1 = window.open(url,wname1,"toolbar=yes,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600");
  w1.opener = self;
  w1.focus();
  return true;
}

function PDFWindow(url) {
  checkBrowser(6.0,0,0,5.0,0,0,0,'','');
  if(!document.MM_returnValue) {
    custWindow(url);
  } else {
    w = window.open('',wname,"toolbar=yes,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=800,height=600");
    w.opener = self;
    var bl = getBaseLocation(url);
    if(w) {
      w.document.open();
      w.document.write('');
      w.document.writeln('<html><head>');
      w.document.write('<title>');
      w.document.write(bl+url);
      w.document.writeln('</title>');
      w.document.writeln('<link href="'+bl+'../renderx.css" rel="stylesheet" type="text/css">');
      w.document.writeln('<BASE HREF="'+bl+'">');
      w.document.writeln('</head><body onLoad="window.focus()" style="margin-top:0; margin-left:0;">');
      w.document.writeln('<p><a id="red" href="'+bl+url+'">Document Location</a>&nbsp;('+bl+url+')</p>');
      w.document.writeln('<EMBED name="fr1" SRC="'+url+'" HREF="'+url+'" type="application/pdf" WIDTH="100%" HEIGHT="100%"/>');
      w.document.writeln('</body>');
      w.document.writeln('</html>');
      w.document.close();
      w.fr1.focus();
      w.scroll(0,0);
    };
    return true;
  };
}

function getBaseLocation(url) {
  var bl = '';
  if(url.search(/^[http|ftp]\:/) == -1) bl = self.location.href;
  var re = new RegExp('^(.*)[\\|\/](.*)\.(.*)$');
  return bl.replace(re,'$1/');
}

function CloseWins() {
  if(w) w.close();
  if(w1) w1.close();
}

//checkBrowser(4.0,0,0,5.0,0,0,0,'','');return document.MM_returnValue

function checkBrowser(NSvers,NSpass,NSnoPass,IEvers,IEpass,IEnoPass,OBpass,URL,altURL) { //v4.0
  var newURL='', verStr=navigator.appVersion, app=navigator.appName, version = parseFloat(verStr);
  if (app.indexOf('Netscape') != -1) {
    if (version >= NSvers) {if (NSpass>0) newURL=(NSpass==1)?URL:altURL;}
    else {if (NSnoPass>0) newURL=(NSnoPass==1)?URL:altURL;}
    if (version == NSvers) { document.MM_returnValue=true; }
  } else if (app.indexOf('Microsoft') != -1) {
    if (version >= IEvers || verStr.indexOf(IEvers) != -1)
     {if (IEpass>0) newURL=(IEpass==1)?URL:altURL;}
    else {if (IEnoPass>0) newURL=(IEnoPass==1)?URL:altURL;}
    if (version == IEvers || verStr.indexOf(IEvers) != -1) { document.MM_returnValue=true; }
  } else if (OBpass>0) newURL=(OBpass==1)?URL:altURL;
  if (newURL) { window.location=unescape(newURL); document.MM_returnValue=false; }
}

//--></SCRIPT>