// Copyright Petar Vrzic
//
// The following function is used from all
// galleries. It will open a new windows with
// the picture in it. This function can open 
// new window that can display the picture in 
// one of the two orientations: Vertical and 
// Horozontal.
//
// The parameters are as follows:
//
//
// imageName		This represents the name of the image to display
//			in the following format "OldHouse1-BIG.jpg"
//
// pageTitle		This represents the title of the page that
//			will be displayed. In the case of framing, word "Frame"
//			is sent.
//
// imageOrientation	This represents the orientation of the target image.
//			"V" for vertical and "H" for horizontal.


function showImage( theImage, pageTitle, imageOrientation ) 
{

  var wHeight = 0;
  var wWidth = 0;

  if (imageOrientation == "V") {
    if (pageTitle == "Frame") {
      wHeight = 626;
      wWidth = 468;
    } else {
      wHeight = 620;
      wWidth = 415;
    }
  } else {
    if (pageTitle == "Frame") {
      wHeight = 475;
      wWidth = 617;
    } else {
      wHeight = 420;
      wWidth = 617;
    }
  }

  var theoptions = "height="+wHeight+", width="+wWidth+", toolbar=no,location=no,menubar=no,scrollbars=no,directories=no,resizable=no,status=no";

  var ah = screen.availHeight - 20;
  var aw = screen.availWidth - 10;

  var xc = (aw - wWidth) / 2;
  var yc = (ah - wHeight) / 2;

  theoptions += ",left=" + xc + ",screenX=" + xc;
  theoptions += ",top=" + yc + ",screenY=" + yc;

  theurl= "http://www.software66.com/Photography/" + theImage;

  var win = window.open("", "", theoptions, "true");
  win.document.open("text/html", "replace");
  if (pageTitle != "Frame") {
     win.document.write("<HTML><HEAD><TITLE>" + pageTitle + " by Petar Vrzic</TITLE></HEAD>");
  } else {
     win.document.write("<HTML><HEAD><TITLE> sample of the frame</TITLE></HEAD>");
  }
  win.document.write("<img src="+ theurl + ">");
  win.document.close();
  
}