var windowobj = null;
var newWindow = null;

function MakeNewDateWindow(objStr,theURL,winName)
{ 
	var w = 250;
	var h = 190;
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	
	windowobj = document.all[objStr];
	features = 'status=no toolbar=no height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars=no'
	//test to see if window aleady exists
	
	//showModalDialog should work for MSIE 4 or greater
	if ((navigator.appName == 'Microsoft Internet Explorer') && parseInt(navigator.appVersion) >= 4) {
		var value = window.windowobj.value;
		if (value == "") {
			value = "Empty";
		}
		var returnValue = window.showModalDialog(theURL,value,"dialogHeight: " + h + "px; dialogWidth: " + w + "px; " + 
			"dialogTop: px; dialogLeft: px; edge: Raised; center: Yes; help: No; resizable: No; scroll: No; status: No;");
		if (returnValue) {
			window.windowobj.value = returnValue;
		}
	}
	else {
		if (!newWindow || newWindow.closed) {
			newWindow = window.open(theURL,winName,features);
		}
		else
		{
			//window exists, so load the proper page and bring it forward
			newWindow = window.open(theURL,winName,features);
			newWindow.location = theURL;
			
			if (parseInt(navigator.appVersion) >= 4) {
				newWindow.focus();
			}
		}
	}
}