

/********************************************************
This function fabricates a new virtual page in which to display the requested product photo.
Pass parameter definitions:
  Photo - String containing the filename (including directory) of the picture that you want to display.
    Note that the string does not contain any context specifiers such as "../../".  These are implemented
	in the code below.
  High - Height of the photo in pixels
  Wide - Width of the photo in pixels
Calculations are performed in order to center the new window on the viewer's screen.  The new window is then created, 
and the picture is loaded into the document of this window along with a "close" button. 
********************************************************/


function BigPic(Photo,High,Wide)
{

//  Preload the picture we want to display in the new page

var image1 = new Image();
image1.src = Photo;

//  Construct the content of the virtual page, with table to hold the picture & "close window" button.

var Content ="<html><head>";
Content +="<title>Product Photo page</title><link rel='shortcut icon' href='/images/BICicon.ico'></head>";
Content +="<body><div align='center'><center>";
Content +="<table border='0' width='100%' cellspacing='0' cellpadding='0'>";
Content +="<tr><td height='20' width='100%' align='center' valign='top'>";
Content +="<img border='0' name='image1' src=' "+ Photo +" '>";
Content +="</td></tr><tr><td width='100%' height='45' align='center' valign='middle'>";
Content +="<a href='#' onClick= 'window.close()'; ";
Content +="onMouseOver=\"document.Xbutton.src='/images/BtnX2.jpg';\"";  //Note use of escape character '\' to assist with syntax
Content +="onMouseOut=\"document.Xbutton.src='/images/BtnX.jpg';\">" ;
Content +="<img border='0' name='Xbutton' src='/images/BtnX.jpg'>";
Content +="</a></td></tr></table></center></div></body></html>";

//  We're going to open a new window in a moment but first we have to figure out if our customer is using a 
//  recent browser or an old one.  If the version is new enough, our code below will work.  If it is too old, the
//  customer is out of luck and we'll just give them a dialog box indicating they cannot use this function.

var Version=parseInt(navigator.appVersion);
var Recent = "No";

if(Version >= 4)
{
  if(document.getElementById)
   {Recent="Yes";}
  else if(document.layers)
   {Recent="SortOf";}
  else
   {Recent="No";}
}

//  If they have a fairly recent browser, we open a new window called PhotoWin (without unneeded scollbars, etc.) and 
//  write the content.   If their browser is too old, we just give them a message and tell them that they can't access this 
//  function.

if ((Recent=="Yes") || (Recent=="SortOf"))
   {
   High=High+65;
   Wide=Wide+50;
   var WindowTop= parseInt((window.screen.availHeight-(High))/2);
   var WindowLeft= parseInt((window.screen.availWidth-(Wide))/2);
   
   WinProps="height="+High+",width="+Wide+",top="+WindowTop+",left="+WindowLeft+",menubar=no,toolbar=no,status=no,scrollbars=no,resizable=no";
   var PhotoWin=window.open("","",WinProps);
   PhotoWin.document.open();
   PhotoWin.document.write(Content);
   PhotoWin.document.close();
   }
else
   {
   alert("Sorry, your browser does not support this function.");
   }

}
// END function BigPic

// -->
