/*=============================================================================
Project Name:     enode

Source Filename:  dialog.js

Firm:							itheca Solutions

Programmer:       Tim Herrmann

Date:             19.07.2001

Modification Log:

Description:			DLG functions
=============================================================================*/



/*=============================================================================
	Local functions
=============================================================================*/

// Browser Detection
isMac = (navigator.appVersion.indexOf("Mac")!=-1) ? true : false;
NS4 = (document.layers) ? true : false;
IEmac = ((document.all)&&(isMac)) ? true : false;
IE4plus = (document.all) ? true : false;
IE4 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 4.")!=-1)) ? true : false;
IE5 = ((document.all)&&(navigator.appVersion.indexOf("MSIE 5.")!=-1)) ? true : false;
ver4 = (NS4 || IE4plus) ? true : false;
NS6 = (!document.layers) && (navigator.userAgent.indexOf('Netscape')!=-1)?true:false;


/*=============================================================================
	Name: 		openDialog
	Input:    href	  - window src document
						name	  - optional window name (default = 'DIALOG')
						options	- optional window features
	Return:		None
	Desc:			Dialog
=============================================================================*/
var infoWindow = null ;
function openDialog( href, name, options )
{
	if ( ! href ) return null ;
	var defName = 'DIALOG' ;
	var defOptions = 'resizable=no,scrollbars=no,width=420,height=320,screenX=200,screenY=200' ;	
	// set up defaults
	if ( ! options ) options = defOptions ;
	if ( ! name ) 	 name 	 = defName ;

	window.onerror = null;	
	if (infoWindow != null){
		infoWindow.close();
	}
	infoWindow = window.open( href, name, options );

	if ( infoWindow )
		infoWindow.focus();
	return infoWindow;
}


/*=============================================================================
	Name: 		launchDLG
	Input:    fileName - window src document
						options  - optional window features
	Return:		None
	Desc:			Opens external content in seperate window
=============================================================================*/
var DLGWinOptions = 'toolbar=no, status=no, scrollbars=yes, resizable=yes, menubar=yes, width=480, height=480, dependent';
function launchDLG( fileName, options )
{
	openDialog( fileName, "eNode", options ? options : DLGWinOptions );
}

