// JavaScript Document

var window_width_allowance   = 0;
var window_height_allowance  = 16;
var caption_height_allowance = 30;

var default_width = 600;
var default_height = 360;

function newPop(theImage,w,h,caption)
{
  var hgt = (h==undefined) ? default_height : h;
  var wdt = (w==undefined) ? default_width : w;
  var cpt           = ((caption==undefined) || (caption == "")) ? "" : caption;
  var cpt_allowance = ((caption==undefined) || (caption == "")) ? 0  : caption_height_allowance;

  var generator=window.open('','name','height=' + (hgt + window_height_allowance +  cpt_allowance) 
                                     + ',width='+ (wdt + window_width_allowance ) );
  
  generator.document.write('<html><head><title>Adelaide Sevens</title>'); // *** Set the TITLE ***
  generator.document.write('<link rel="stylesheet" href="css/image_popup.css">');


  generator.document.write('</head><body>');
if (theImage !=null) {

// fix the image size...
  generator.document.write('<img src="' + theImage + '" width="' + wdt + '" height="' + hgt + '" >');
}

if (cpt !="") {
  generator.document.write("<div class='caption'>" + cpt + "</div>");
}

//  explicit close link ...
//  generator.document.write('<p><a href="javascript:self.close()"> Close</a> the popup.</p>');
  
  generator.document.write('</body></html>');
  generator.document.close();
  }