// Copyright 1999 - 2002 by Ray Stott, Pop-up Images Script ver 2.0
// OK to use if this copyright is included
// Script is available at http://www.crays.com/jsc
// javascript 1.0

/*
** File: PopImg.js
** ID: $Id: PopImg.js,v 1.1 2002/07/05 16:37:52 hutch Exp $
** Version: $Revision: 1.1 $
** CVS Author: $Author: hutch $
** Last Revised: $Date: 2002/07/05 16:37:52 $
**************************
** $Log: PopImg.js,v $
** Revision 1.1  2002/07/05 16:37:52  hutch
** adding to cvs
**
**
**
*/


var pic        = null
var popImg     = null  // use this when referring to pop-up image
var picTitle   = null
var imgCount   = 0
var imgWinName = "popImg"
var marginh    = 25
var marginw    = 20

// these 2 might not work
var posleft    = 20
var postop     = 200

/* ------------------------------------------------------------- */
function openPopImg(picName, windowWidth, windowHeight)
{
	closePopImg()
	imgWinName = "popImg" + imgCount++ //unique name for each pop-up window
	popImg = window.open(
		picName,
		imgWinName,
		"toolbar=no,scrollbars=no,resizable=no,width="
		+ (parseInt(windowWidth)+marginw)  + ",height="
		+ (parseInt(windowHeight)+marginh) + ",left="
		+ posleft + ",top=" + postop + ""
		)
}

/* ------------------------------------------------------------- */
// close pop-up window if it is open
function closePopImg()
{
	if (navigator.appName != "Microsoft Internet Explorer"
		|| parseInt(navigator.appVersion) >=4) //do not close if early IE
	if(popImg != null) if(!popImg.closed) popImg.close()
}

/* ------------------------------------------------------------- */
function setStatus(msg){
	status = msg
	return true
}
