/*	gsNewWindow Usage: * *	< html >< head > *		< script src="path/to/gs_new_window.js" >< /script > *		< script > * *			gContactUs = new gsNewWindow( 'contact_window' ); // unique name * *			with ( gContactUs ) { * *				//		Specify an Optional Default Path *				path = '../path/to/default/page.html'; * *				copyhistory = false; *				directories = false; *				location    = false; *				menubar     = false; *				resizable   = false; *				scrollbars  = false; *				status      = false; *				toolbar     = false; * *				// if centered is true then left and top are ignored *				centered = false; // NN4++/IE4++ *				left     = 0;     //   ""    "" *				top      = 0;     //   ""    "" * *				height = 100; *				width  = 100; *			} *		< /script > *	< /head > *	< body > * *	<!-- go to default path... --> *		<a href="javascript:gContactUs.Splash()">Contact Us</a> * *	<!-- or specify a path...  --> *		<a href="javascript:gContactUs.Splash('contact.html')">Contact Us</a> * * */function gsNewWindow( sName, _sDefaultPath_ ) { // constructor	/*	API	 *		Attr()       //> 'copyhistory,etc...'	 *		Splash(sURL) // sURL optional, open if not open,	 *		             // bring forward if not frontmost,	 *		             // go to sURL if sURL, or go to default.	 *		Close()      // window.close	 *		Focus()      // !!! implement IE5 workaround !!!	 */	this.name = sName	this.wind = null;		if ( ! (this.path = _sDefaultPath_) )	        this.path = '';	this.copyhistory = false;	this.directories = false;	this.location    = false;	this.menubar     = false;	this.resizable   = false;	this.scrollbars  = false;	this.status      = false;	this.toolbar     = false;	this.left = 0;  this.height = 100;	this.top  = 0;  this.width  = 100;	this.centered = false;	this.Attr = function () {		var atr = '';		if ( this.copyhistory ) atr += ',copyhistory';		if ( this.directories ) atr += ',directories';		if ( this.location    ) atr += ',location'   ;		if ( this.menubar     ) atr += ',menubar'    ;		if ( this.resizable   ) atr += ',resizable'  ;		if ( this.scrollbars  ) atr += ',scrollbars' ;		if ( this.status      ) atr += ',status'     ;		if ( this.toolbar     ) atr += ',toolbar'    ;		if ( this.height ) atr += ',height=' + this.height;		if ( this.width  ) atr += ',width='  + this.width ;		if ( this.centered ) {			var delta = 60 // titlebar offset, seems to center better			var x = (screen.width  - this.width         ) / 2 ;			var y = (screen.height - this.height - delta) / 2 ;			atr += ',left=' + x + ',screenX=' + x;			atr += ',top='  + y + ',screenY=' + y;		} else {			if ( this.left )				atr += ',left=' + this.left + ',screenX=' + this.left;			if ( this.top )				atr += ',top='  + this.top  + ',screenY=' + this.top;		}		return atr.substring( 1 ); // chop off initial ','	}	this.Splash = function ( _sURL_ ) {		var path = _sURL_ || this.path;		if ( this.wind && !this.wind.closed ) {			this.wind.location = path;		} else {			this.wind = window.open( path, this.name, this.Attr() );		}		this.Focus();	}	this.Close = function () {		if ( this.wind && !this.wind.closed ) this.wind.close();	}		this.Focus = function () {		if ( this.wind && !this.wind.closed && window.focus )			this.wind.focus();	}}