// JavaScript Document

function change(id, newClass) {
identity=document.getElementById(id);
identity.className=newClass;
}

var da = (document.all) ? 1 : 0;
var pr = (window.print) ? 1 : 0;
var mac = (navigator.userAgent.indexOf("Mac") != -1); 

function printPage() {
  if (pr) // NS4, IE5
    window.print()
  else if (da && !mac) // IE4 (Windows)
    vbPrintPage()
  else // other browsers
    alert("Sorry, your browser doesn't support this feature.");
  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('  OLECMDID_PRINT = 6');
  writeln('  OLECMDEXECOPT_DONTPROMPTUSER = 2');
  writeln('  OLECMDEXECOPT_PROMPTUSER = 1');
  writeln('  On Error Resume Next');
  writeln('  WB.ExecWB OLECMDID_PRINT, OLECMDEXECOPT_DONTPROMPTUSER');
  writeln('End Sub');
  writeln('<' + '/SCRIPT>');
}
/* popup auto sized */

var _PAGE="";
	_PAGE=""; /* Specify an actual page if you don't want to use the popup code. */

 

var _CONTENT=""; /* this holds the data to write if no external html file is used */

 

function openImageWindow(imageSrc, caption) {

/*

 * if you use the name "_PAGE" for the page

 * you will have no problems at all

 * however if you change the name to something else

 * remember to change the reference to it in the following line of code

 * to reference your own filename..

 *

 * No _PAGE specified uses the javascript code embedded on this page.

 *

 */
_CONTENT="";
_CONTENT+="<HTML>\n";
_CONTENT+="<head>\n";
_CONTENT+="<"+"SCRIPT>\n";
_CONTENT+="function specialInit()\n";
_CONTENT+="{\n";
_CONTENT+="if (document.all || document.layers)\n";
_CONTENT+="window.resizeTo(document.images[0].width + 10,document.images[0].height + 90);\n";
_CONTENT+="}\n";
_CONTENT+="</"+"SCRIPT>\n";
_CONTENT+="</head>\n";
_CONTENT+="<BODY onLoad='specialInit();' style='margin:0;'>\n";
_CONTENT+="<"+"SCRIPT>\n";
_CONTENT+="document.write('<center>');\n";
_CONTENT+="document.write('<IMG SRC=\\'"+ imageSrc +"\\'>');\n";
_CONTENT+="document.write('<p style=\\'font-family:Arial, Helvetica, sans-serif; font-size:12px \\'>"+ caption +"</p>');\n";
_CONTENT+="document.write('<P><FORM><INPUT TYPE=button VALUE=Close onClick=window.close()></FORM></p>');\n";
_CONTENT+="document.write('</center>')\n";
_CONTENT+="</"+"SCRIPT>\n";
_CONTENT+="</BODY>\n";
_CONTENT+="</HTML>\n";
  var _parms = 'directories=no,location=no,menubar=no,scrollbars=no,status=no,toolbar=no,resizable=yes';
  var _windowName = "PicViewer";
  if(_PAGE) {
    fileName = 'popup.htm?' + escape(imageSrc) + '&amp;' + escape(imageTitle);
    myWindowHandle = window.open(fileName,_windowName,_parms);
  }  else  {
    myWindowHandle=window.open("",_windowName,_parms);
    myWindowHandle.document.open();
    myWindowHandle.document.write(_CONTENT);
    myWindowHandle.document.close();
  }
  myWindowHandle.focus();
}

/* end of popup auto sized */
