// JavaScript Document
//######################################################################################
// Copyright (c) 2010 - Ken Drysdale - www.kendrysdale.net - Unauthorised use prohibited
//######################################################################################

PositionX = 100;
PositionY = 200;

// approx 20 pixels greater than largest image to be used (needed for Netscape)
defaultWidth  = 560;
defaultHeight = 400;

// Chrome need more height but shows below in IE and Safari - figures are compromise
extraHeight = 70;
extraWidth = 30;

//text-align is IE workaround but also need <center> for IE
//calls copy.js

function popImage(imageURL,imageTitle) {
var params='scrollbars=no,resizable=no,width='+defaultWidth+',height='+
defaultHeight+',left='+PositionX+',top='+PositionY;
html_code = "<html><head><title>" + imageTitle + "</title>" + 
"<script type=text/javascript src=scripts/copy.js></script>" +
"<style>body{margin:0; padding:0; text-align:centre; background-color:#FFFFFF;}" +
"#mainImage {margin:0 auto; padding:0; text-align:centre; display:block;}</style></head>" + 
"<body onBlur='top.close()' scroll='no' onload='self.focus(); init(); trap()'>" +
"<div id='loading'><img src='graphics/loading.gif' border=0></div>" +
"<script>" +
"var ld=(document.all);" +
"var ns4=document.layers;" +
"var ns6=document.getElementById&&!document.all;" +
"var ie4=document.all;" +
"if (ns4) {ld=document.loading;}" +
"else if (ns6) {ld=document.getElementById('loading').style;}" +
"else if (ie4) {ld=document.all.loading.style;}" +
"function init(){if(ns4){ld.visibility='hidden';}" +
"else if (ns6||ie4) {ld.display='none';}}" +
"</script>" +
"<center><img src='"+ imageURL +"' border=0 name=mainImage id=mainImage " + 
"onload='window.resizeTo(document.mainImage.width+" + extraWidth + "," +
"document.mainImage.height+" + extraHeight + ")'" +
"onclick='self.close()' onblur='self.close()'></center></body></html>";
popup_win=window.open('about:blank','',params);
popup_win.document.open();
popup_win.document.write(html_code);
popup_win.document.close();
popup_win.focus();
}

