<!--
// This JavaScript is copyright (c) Dooman Productions Pty. Ltd. 2002-2003
// **== Magpies Rule ==**

// FUNCTION popupWindow
//=====================
function popupWindow(pmImageName,pmTitleBar) {

var initWindowWidth = 520;
var initWindowHeight = 520;
var initImageWidth = 520;
var initImageHeight = 520;

var maxWindowWidth  = 600;
var maxWindowHeight = 600;
var maxImageWidth  = 600;
var maxImageHeight = 600;

var windowWidth;
var windowHeight;
var windowTop;
var windowLeft;

var windowHandle = 'magnorWindow';
var htmlText;
var dummyWindow;

// Set the window name to open.  For Netscape, this must be a null string
//                               For other browsers, this is 'product_window.html'
//--------------------------------------------------------------------------------
dummyWindow = (navigator.appName.toUpperCase() == 'NETSCAPE') ? '' : 'product_window.html';


// Check the screen size.  Can we display the full size picture?
//--------------------------------------------------------------
if (screen.availHeight > maxWindowHeight && screen.availWidth > maxWindowWidth) {
   windowHeight = maxWindowHeight;
   windowWidth  = maxWindowWidth;
   windowTop    = (screen.availHeight-maxWindowHeight) / 2;
   windowLeft   = (screen.availWidth-maxWindowWidth) / 2;
   imageHeight  = maxImageHeight;
   imageWidth   = maxImageWidth;
}
else {
   windowHeight = initWindowHeight;
   windowWidth  = initWindowWidth;
   windowTop    = 0;
   windowLeft   = 0;
   imageHeight  = initImageHeight;
   imageWidth   = initImageWidth;
}

var prodWindow = window.open(dummyWindow,
            windowHandle,
            'toolbar=no,location=no,directories=no,menubar=no,resizable=no,scrollbars=no,'+
            'top='+windowTop+',left='+windowLeft+',width='+windowWidth+',height='+windowHeight
           );

htmlText =  '<html><head><title>'+stripDelimeters(pmTitleBar)+'<\/title><\/head>';
htmlText += '<body marginwidth=\"0\" marginheight=\"0\" topmargin=\"0\" leftmargin=\"0\" rightmargin=\"0\" bottommargin=\"0\">';
htmlText += '<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\" valign=\"middle\">';
htmlText += '<tr><td><img src=\"../images\/'+stripDelimeters(pmImageName)+'\" width=\"'+imageWidth+'\" height=\"'+imageHeight+'\" alt=\"\" />';
htmlText += '<\/td><\/tr><\/table><\/body><\/html>';

prodWindow.document.write(htmlText);

} // end of function PopupWindow


// FUNCTION stripDelimeters
//=========================
function stripDelimeters(pmStripText) {

var retval = '';
var delimChar = '/';

pmStripText += '';

for (i=0;i < pmStripText.length;i++) {
   if (pmStripText.charAt(i) != delimChar) {
      retval += pmStripText.charAt(i);
   }
}

return retval;

} // end of function stripDelimeters

// -->
