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,imageTitle)
{
/*
 * 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.
 *
 */

if (!imageTitle) {
imageTitle='<font size="1" color="#c0c0c0" face="arial">(c) Copyright 2007 Pertwoood Organic Farm Limited</font>';
}


_CONTENT="";
_CONTENT+="<HTML>\n";
_CONTENT+="<head>\n";
_CONTENT+='<link href="CSS/interim.css" rel="stylesheet" type="text/css">\n';
_CONTENT+="<"+"SCRIPT>\n";
_CONTENT+="function specialInit()\n";
_CONTENT+="{\n";
_CONTENT+="if (document.all || document.layers)\n";
_CONTENT+="window.resizeTo(document.images[0].width + 50,document.images[0].height + 180);\n";
_CONTENT+="}\n";
_CONTENT+="</"+"SCRIPT>\n";

_CONTENT+="<"+"SCRIPT>\n";
_CONTENT+="function clickIE4(){\n";
_CONTENT+="if (event.button==2){\n";
_CONTENT+="alert(message);\n";
_CONTENT+="return false;\n";
_CONTENT+="}\n";
_CONTENT+="}\n";
_CONTENT+="function clickNS4(e){\n";
_CONTENT+="if (document.layers||document.getElementById&&!document.all){\n";
_CONTENT+="if (e.which==2||e.which==3){\n";
_CONTENT+="alert(message);\n";
_CONTENT+="return false;\n";
_CONTENT+="}\n";
_CONTENT+="}\n";
_CONTENT+="}\n";
_CONTENT+="if (document.layers){\n";
_CONTENT+="document.captureEvents(Event.MOUSEDOWN);\n";
_CONTENT+="document.onmousedown=clickNS4;\n";
_CONTENT+="}\n";
_CONTENT+="else if (document.all&&!document.getElementById){\n";
_CONTENT+="document.onmousedown=clickIE4;\n";
_CONTENT+="}\n";
_CONTENT+="document.oncontextmenu=new Function(\"alert(\'Function Disabled\');return false\")\n";
_CONTENT+="</script>\n";

_CONTENT+="</head>\n";
_CONTENT+="<BODY onLoad='specialInit();'>\n";
_CONTENT+="<"+"SCRIPT>\n";
_CONTENT+="document.write('<center>');\n";
_CONTENT+="document.write('<span class=title>');\n";
_CONTENT+="document.write('<span style=\\'BACKGROUND-COLOR:#ffffff\\'>&nbsp;');\n";
_CONTENT+="document.write('"+imageTitle+"' +' &nbsp;</span></font></b><hr noshade color=\"#E3F0B3\">');\n";
_CONTENT+="document.write('<IMG SRC=\\'"+imageSrc+"\\'>');\n";
_CONTENT+="document.write('<hr noshade color=\"#E3F0B3\"><P><P><P><FORM><INPUT TYPE=button VALUE=Close onClick=window.close()></FORM>');\n";
_CONTENT+="document.write('</center>')\n";
_CONTENT+="</"+"SCRIPT>\n";
_CONTENT+="</BODY>\n";
_CONTENT+="</HTML>\n";

  var _parms = 'directories=no,location=no,menubar=no,scrollbars=yes,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();
}
