add:  var enumerator = windowManagerInterface.getEnumerator( aType ); var firstWindow = windowManagerInterface.convertISupportsToDOMWindow(enumerator.getNext()); var iWindow = firstWindow; while (iWindow != topWindow && enumerator.hasMoreElements()) iWindow = windowManagerInterface.convertISupportsToDOMWindow(enumerator.getNext());  if (enumerator.hasMoreElements()) { iWindow = windowManagerInterface.convertISupportsToDOMWindow(enumerator.getNext()); iWindow.focus(); return iWindow; }  if (firstWindow == topWindow) return null;  firstWindow.focus(); return firstWindow; 
context: function CycleWindow( aType, aChromeURL ){  var windowManager = Components.classes['@mozilla.org/rdf/datasource;1?name=window-mediator'].getService();  var windowManagerInterface = windowManager.QueryInterface( Components.interfaces.nsIWindowMediator);  var topWindowOfType = windowManagerInterface.getMostRecentWindow( aType );  var topWindow = windowManagerInterface.getMostRecentWindow( null );  if ( topWindowOfType == null )    newWindowOfType( aType );  else if ( topWindowOfType != topWindow )    topWindowOfType.focus();  else {    var enumerator = windowManagerInterface.getEnumerator( aType );    var firstWindow = windowManagerInterface.convertISupportsToDOMWindow ( enumerator.getNext() );    var iWindow = firstWindow; // ;-)    while ( iWindow != topWindow && enumerator.hasMoreElements() )      iWindow = windowManagerInterface.convertISupportsToDOMWindow ( enumerator.getNext() );      var desiredWindow = firstWindow;    if ( enumerator.hasMoreElements() )      desiredWindow = windowManagerInterface.convertISupportsToDOMWindow ( enumerator.getNext() );    if ( desiredWindow == topWindow ) // Only one window, open a new one       newWindowOfType( aType );    else      desiredWindow.focus();  }}
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/3cdbcdf6e80c81e3186d4acac61e1f032e21f513/tasksOverlay.js/clean/xpfe/communicator/resources/content/tasksOverlay.js