rem: function CycleWindow( inType, inChromeURL ) 
add: function CycleWindow( aType, aChromeURL ) 
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;    	var topWindowOfType = windowManagerInterface.getMostRecentWindow( inType );	var topWindow = windowManagerInterface.getMostRecentWindow( null );	dump( "got windows \n");		dump( "topWindowOfType = " + topWindowOfType + "\n");	if ( topWindowOfType == null )	{	  if ( inType == "navigator:browser" )      OpenBrowserWindow();    else if ( inType == "composer:html" ) /* open editor window */      NewEditorWindow();    else    {        /* what to do here? */    }    		return;	}		if ( topWindowOfType != topWindow )	{		dump( "first not top so give focus \n");		topWindowOfType.focus();		return;	}		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");	  if ( inType == "navigator:browser" )      window.OpenBrowserWindow();    else if ( inType == "composer:html" ) /* open editor window */      NewEditorWindow();    else    {        /* what to do here? */    }	}}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/f9072d1d38dcff6ec3bfe6f18ff03931617351ac/tasksOverlay.js/buggy/suite/common/tasksOverlay.js