// openPopup - tests for existance of window; if exists, brought to front. if doesn't, window is created and brought to front.
function openPopup(theURL,mywidth,myheight) {
	var newWindow = null;
/*	if (mywidth == 0 && myheight == 0) {
		features = 'toolbar=yes,status=yes,width=800,height=600,directories=no,scrollbars=yes,location=yes,resizable=yes,menubar=yes';
		newWindow = window.open(theURL,winName,features);
		newWindow.focus();
	} else {
		if (mywidth == "" || mywidth == 0) {
			mywidth = 350;
		}
		if (myheight == "" || myheight == 0) {
			myheight = 250;
		}
		features = 'toolbar=no,status=no,width='+mywidth+',height='+myheight+',directories=no,scrollbars=yes,location=no,resizable=yes,menubar=no';
*/
		if (mywidth == "" || mywidth == 0) {
			mywidth = 350;
		}
		if (myheight == "" || myheight == 0) {
			myheight = 250;
		}
		features = 	'toolbar=no,status=no,width='+mywidth+',height='+myheight+',directories=no,scrollbars=yes,location=no,resizable=yes,menubar=no';
		if (!newWindow || newWindow.closed) {
			newWindow = window.open(theURL,"popup",features);
			newWindow.focus();
		} else {
			newWindow.focus();
		}
//	}
}

function launch(theURL, theFeatures) {
	var popup;
	var myFeaturesString
	myFeaturesString = "resizable=yes,scrollbars=yes,screenx=100,screeny=100,top=100,left=100," + theFeatures
	popup = window.open(theURL, "popup", myFeaturesString);
	popup.focus()
}
