/*
'**************************************************************************************************
'File Name:		_Window.js
'Object Type:	Javascript file
'
'Author Name:	Mark E. Watkins - Daugherty Systems, Inc.
'Creation Date:	11/06/2003
'
'Purpose:		Used as a library of functions pertaining to opening windows.  The file is included 
'				in any pages needing access to its functions.
'
'
'Include Dependencies:
'None.
'
'
'Date Changed		Changed By		Reason
'--------------------------------------------------------------------------------------------------
'
'
'**************************************************************************************************
*/

//
//Variable declarations.

///////////////////////////////////////////////////////
//
// FUNCTIONS
//
///////////////////////////////////////////////////////
function openNewWindow( psType, psURL, psArgArray, psWinAttribs ) { 
	//
	//Purpose:
	//Opens a new window using the parameters.
	//
	//Owner: Mark E. Watkins
	//
	//Arguments:
	//psType - denotes whether the window is Modal or Modeless.
	//
	//psURL - denotes the url of the window to open.
	//
	//psArgArray - denotes the argument array to be used.
	//
	//psWinAttribs - denotes the attributes for the window.  Size, resizable, etc.
	//
	
	if ( psType == undefined || psURL == undefined || psArgArray == undefined || psWinAttribs == undefined ) return false;
	
	if ( psType == "Modal" ) { 
		//
		window.showModalDialog(psURL, psArgArray, psWinAttribs);
	}
	else if ( psType == "Modeless" ) { 
		//
		window.showModelessDialog(psURL, psArgArray, psWinAttribs);
	}
}
function displayCalendar( poControlToUpdate, pbAllowFutureDateSel ) { 
	//
	//Purpose:
	//Opens a calendar in a popup window.
	//
	//Owner: Mark E. Watkins
	//
	//Arguments:
	//poControlToUpdate - control on the window that represents the date control.
	//
	//pbAllowFutureDateSel - denotes whether or not to allow the selection of future dates.
	//
	var oArgArray = new Array();
	
	if ( pbAllowFutureDateSel == undefined ) pbAllowFutureDateSel = false;
	oArgArray[0] = poControlToUpdate;
	oArgArray[1] = pbAllowFutureDateSel;
	
	window.showModalDialog("include/Calendar.htm", 
		oArgArray, 
		"DIALOGHEIGHT:236px; DIALOGWIDTH:197px; " + 
		"EDGE:raised; CENTER:yes; HELP:no; RESIZABLE:no; STATUS:no");
}
function openMessage( psMessage ) { 
	//
	//Purpose:
	//Opens a html window to display a message in.
	//
	//Owner: Mark E. Watkins
	//
	//Arguments:
	//psMessage - the message to display in the html window.
	//

	if (!waitWindow || waitWindow.closed) {
		//
		//Window is not already open.
		var asParameters = 'dialogWidth:400px; dialogHeight:175px; center:yes; scroll:no; status:no'
		//
		waitWindow = window.showModelessDialog('/MoverStudio/include/DisplayMessage.htm', psMessage, asParameters);
		return waitWindow;
	}	
	else { 
		//
		//Window is already open.
		waitWindow.focus();
	}
}

//eof: Mark E. Watkins