// Popup Win Options 
var base_path = "/help/"; // Must have preceeding and trailing slashs
//var base_path = ""; // For debugging purposes

//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
function onlineHelpWin(file, name){
/*
(section [file, name])
name = optionally overide the name of the name used for the help window
file = Help file to display 
*/
var winName = null;
var w = 350;
var h = 600;
var defaultWinName = "helpWin";
	var fudge = 25;
	//  Deal with people with small screens and/or bad eyes
	if(w >= (screen.availWidth - fudge)){
		w = screen.availWidth - fudge;
	}
	if(h >= (screen.availHeight - fudge)){
		h = screen.availHeight - fudge;
	}

	//Window name issues
	if(typeof(name) == "string"){
		winName = name;
	}
	else{
		winName = defaultWinName;
	}

	// Deal with the baseURI var
	var base = "http://" + window.location.host + base_path;
	var refWinHelp = 
	window.open(base + file, winName, 'resizable=yes,menubar=no,toolbar=no,scrollbars=yes,width=' + w + ',height=' + h);

	//refWinHelp.location.replace(base + file);
	//###HERE Requires signed javascript
	//	if(!flagUsedWin){
			//screen.availRight // x coord
	//		refWinHelp.window.screenX(screen.availRight - w);
	//		parent.window.screenX(0);
			//screen.availTop  // y coord
	//		refWinHelp.window.screenY(0);
	//		parent.window.screenY(0);

			// Parent Screen width
	//		parent.window.height = h;
	//		parent.window.width = screen.availRight - w;
	//	}
	refWinHelp.focus();
}

//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
function openImage(image){
var w = 630;
var h = 630;
	var fudge = 25;
	//  Deal with people with small screens and/or bad eyes
	if(w >= (screen.availWidth - fudge)){
		w = screen.availWidth - fudge;
	}
	if(h >= (screen.availHeight - fudge)){
		h = screen.availHeight - fudge;
	}
	var strHTML;
	// Don't use null as a windows name. IE barfs on it
	refWin = window.open('', 'imageHelp', 'resizable=yes,menubar=no,toolbar=no,scrollbars=yes,width=' + w + ',height=' + h);
	//Clears the contents of the window in IE 
	// all of the time and Mozilla half of the time
	refWin.location.reload(); 
	strHTML = '<HTML><head><title>PTS Help Image Popup</title>' +
	'<link rel="stylesheet" href="'+ base_path + 'support/helpstyle.css" type="text/css">'+
	'<script language="JavaScript1.2" type="text/javascript" src="'+ base_path + 'support/help.js"></script></head>'+
	'<body><img src="'+ base_path + image +'">'+
	'<p align="center"><a href="JavaScript:closeImage()"><font size="+4" align="center">Close</font></a>'+
	'</body>';
	refWin.document.write(strHTML);
}

function closeImage(){
this.window.close();
}

