rem: if ( topWindowOfType == null ) { dump( " no windows of this type so create a new one \n"); window.open( inChromeURL, "","chrome,menubar" ); } 
context: function CycleWindow( inType, inChromeURL ){	var windowManager = Components.classes['component://netscape/rdf/datasource?name=window-mediator'].getService();	dump("got window Manager \n");	var	windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);    dump("got interface \n");        var desiredWindow = null;    	topWindowOfType = windowManagerInterface.GetMostRecentWindow( inType );	topWindow = windowManagerInterface.GetMostRecentWindow( null );	dump( "got windows \n");	if ( topWindowOfType != topWindow )	{		dump( "first not top so give focus \n");		topWindowOfType.focus();		return;	}		if ( topWindowOfType == null )	{		dump( " no windows of this type so create a new one \n");		window.open( inChromeURL, "","chrome,menubar" );	}	var enumerator = windowManagerInterface.GetEnumerator( inType );	firstWindow = windowManagerInterface.ConvertISupportsToDOMWindow ( enumerator.GetNext() );	if ( firstWindow == topWindowOfType )	{		dump( "top most window is first window \n");		firstWindow = null;	}	else	{		dump("find topmost window \n");		while ( enumerator.HasMoreElements() )		{			var nextWindow = windowManagerInterface.ConvertISupportsToDOMWindow ( enumerator.GetNext() );			if ( nextWindow == topWindowOfType )				break;		}		}	desiredWindow = firstWindow;	if ( enumerator.HasMoreElements() )	{		dump( "Give focus to next window in the list \n");		desiredWindow = windowManagerInterface.ConvertISupportsToDOMWindow ( enumerator.GetNext() );			}		if ( desiredWindow )	{		desiredWindow.focus();		dump("focusing window \n");	}	else	{		dump("open window \n");		window.open( inChromeURL, "","chrome,menubar" );	}}
meta: 5872	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/5872/38c8fca1daf6e8a0bc2b852b8acb20e90f1f8ee5/tasksOverlay.js/buggy/xpfe/global/resources/content/tasksOverlay.js