	win=null;

	function openWindow(theURL,winName,features) {
	  window.open(theURL,winName,features);
	}

	function openWindowMiddle(theURL,winName,features,topVal,leftVal) {
	  var posX = (screen.width - leftVal)/2;
	  var posY = (screen.height - topVal)/2;
	  var midFeatures = features + ',left='+posX+',top='+posY;
	  window.open(theURL,winName,midFeatures);
	}

	function openModalWindow(theURL,winName,features) {
		window.showModalDialog(theURL,window,"dialogWidth:350px;dialogHeight:170px;center:yes;help:no;status:no;scroll:yes;");
	}

	function getDate(name,ctx){
	     var showx = event.screenX - event.offsetX - 4 - 210 ;
	     var showy = event.screenY - event.offsetY + 18;
	     var newWINwidth = 210 + 4 + 18;

	     var win = window.showModalDialog("/"+ctx+"/js/date.html","","dialogWidth:197px;dialogHeight:210px; dialogLeft:"+showx+"px;dialogTop:"+showy+"px;status:no; directories:yes;scrollbars:no;Resizable:no;");
	     if( win != null ){
	         document.getElementById(name).value = win;
	     }
	}

	function getDateTime(name,ctx){
	     var showx = event.screenX - event.offsetX - 4 - 210 ;
	     var showy = event.screenY - event.offsetY + 18;
	     var newWINwidth = 210 + 4 + 18;

	     var win = window.showModalDialog("/"+ctx+"/js/dateTime.html","","dialogWidth:197px;dialogHeight:240px; dialogLeft:"+showx+"px;dialogTop:"+showy+"px;status:no; directories:yes;scrollbars:no;Resizable:no;");
	     if( win != null ){
	         document.getElementById(name).value = win;
	     }
	}

	function resizeWindowAll(){
		window.resizeTo(screen.width,screen.height);
		window.moveTo(0,0);
	}

	function resizeWindow(width,height){
		window.resizeTo(width, height);
		var win_left = (screen.width - width) / 2;
		var win_top = (screen.height - height) / 2;
		window.moveTo(win_left,win_top);
	}