/***************************************************************************************
* Function:	CenterHTMLView
*
* Compatibility Tested: Win-Netscape 3, 4
*                       Win-IE 3, 5
*						MAC-Netscape 4
*
* Usage: CenterImageView(ImageURL, ImageWidth, ImageHeight);
*
* Purpose:	This javascript function will pop open a new window to display an image
*		It will format this window as best as posible to display this image
*
* Input:	FileURL -> the URL to the graphic file in question
*		Width -> the width of your IMAGE
*		Height -> the height of your IMAGE
*
* Returns:	n/a
*
****************************************************************************************/
function CenterHTMLView(FileURL, Width, Height)
{
    var WindowReference;
	var WindowName = "popup";

	leftOffset = parseInt((windowWidth() - Width)/2);
	topOffset = parseInt((windowHeight() - Height)/2);
	
    if (parseInt(navigator.appVersion) < 4) {
    // if this is a pre 4.0 version browser you need to add some padding to those images
		//add tem for the specific browser name
		if (navigator.appName == "Netscape") {
			// Netscape 3.0 - Wintel
			Height = Height + 14;
			Width = Width + 10;
			
			// to pad white space on both sides of image
			Height = Height + 14;
			Width = Width + 10;
		} else {
			// IE 3.0 - Wintel
			Height = Height + 3;
			Width = Width + 10;
			
			// to pad white space on both sides of image
			Height = Height + 3;
			Width = Width + 10;
		}	
    }

    //If this isn't Netscape or IE 5 then display the image by URL, else display it by a dynamic document
    WindowReference = window.open(FileURL, WindowName, "left=" + leftOffset + ",top=" + topOffset + "toolbar=no,directories=no,"
     + "status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + Width + ","
     + "height=" + Height);
    WindowReference.focus();
}

/***************************************************************************************
* Function:	CenterImageView
*
* Compatibility Tested: Win-Netscape 3, 4
*                       Win-IE 3, 5
*						MAC-Netscape 4
*
* Usage: CenterImageView(ImageURL, ImageWidth, ImageHeight);
*
* Purpose:	This javascript function will pop open a new window to display an image
*		It will format this window as best as posible to display this image
*
* Input:	FileURL -> the URL to the graphic file in question
*		Width -> the width of your IMAGE
*		Height -> the height of your IMAGE
*
* Returns:	n/a
*
****************************************************************************************/
function CenterImageView(FileURL, Width, Height)
{
    var WindowReference;
	var WindowName = "popup";

	leftOffset = parseInt((windowWidth() - Width)/2);
	topOffset = parseInt((windowHeight() - Height)/2);
	
    if (parseInt(navigator.appVersion) < 4) {
    // if this is a pre 4.0 version browser you need to add some padding to those images
		//add tem for the specific browser name
		if (navigator.appName == "Netscape") {
			// Netscape 3.0 - Wintel
			Height = Height + 14;
			Width = Width + 10;
			
			// to pad white space on both sides of image
			Height = Height + 14;
			Width = Width + 10;
		} else {
			// IE 3.0 - Wintel
			Height = Height + 3;
			Width = Width + 10;
			
			// to pad white space on both sides of image
			Height = Height + 3;
			Width = Width + 10;
		}	
    }

    //If this isn't Netscape or IE 5 then display the image by URL, else display it by a dynamic document
    if (navigator.appName != "Netscape" && parseInt(navigator.appVersion) < 4) {
      WindowReference = window.open(FileURL, WindowName, "left=" + leftOffset + ",top=" + topOffset + "toolbar=no,directories=no,"
      + "status=no,menubar=no,scrollbars=no,resizable=yes,width=" + Width + ","
      + "height=" + Height);
    } else {
      WindowReference = window.open('', WindowName, "left=" + leftOffset + ",top=" + topOffset + "toolbar=no,directories=no,"
      + "status=no,menubar=no,scrollbars=no,resizable=yes,width=" + Width + ","
      + "height=" + Height);
      
      WindowReference.document.open();
      WindowReference.document.write('<HTML>');
      WindowReference.document.write('<BODY marginwidth=0 marginheight=0 LEFTMARGIN=0 TOPMARGIN=0 onblur="window.close()"><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH="100%" HEIGHT="100%"><TR><TD VALIGN=MIDDLE ALIGN=CENTER>');
      WindowReference.document.write('<IMG SRC="../' + FileURL + '">');
	  WindowReference.document.write('</TD></TR></TABLE></BODY>');
      WindowReference.document.write('</HTML>');
      WindowReference.document.close();
      WindowReference.focus();
    }
}




function windowWidth () {
	return screen.width;
}

function windowHeight () {
	return screen.height;
}


