text: /** 
   * Copyright (c) 2009, M. Andrés Pagella <andres.pagella@gmail.com>
   * All rights reserved.
   * 
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions are met:
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in the
   *    documentation and/or other materials provided with the distribution.
   * 3. All advertising materials mentioning features or use of this software
   *    must display the following acknowledgement:
   *    This product includes software developed by the <organization>.
   * 4. Neither the name of the <organization> nor the
   *    names of its contributors may be used to endorse or promote products
   *    derived from this software without specific prior written permission.
   * 
   * THIS SOFTWARE IS PROVIDED BY M. ANDRES PAGELLA ''AS IS'' AND ANY
   * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
   * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED. IN NO EVENT SHALL M. ANDRES PAGELLA BE LIABLE FOR ANY
   * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
   * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
   * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   */
  
  /**
   * @summary TM.CORE Popups and Helpers
   * @author Andres Pagella (andres.pagella@gmail.com)
   */
  
  if (!TM.core.open) TM.core.open = {};
  
  TM.core.open.profile = function(screen_name) {
  	try {
  		var options = new air.NativeWindowInitOptions();
  		options.transparent = true;
  
  		options.systemChrome = air.NativeWindowSystemChrome.NONE;
  		var visibleBounds = air.Screen.mainScreen.visibleBounds;
  		var windowBounds = new air.Rectangle(200,250,520,310);
  		var htmlLoader = air.HTMLLoader.createRootWindow(true, options, true, windowBounds);
  
  		htmlLoader.paintsDefaultBackground = false;
  		htmlLoader.load( new air.URLRequest('app:/html/' + TM.settings.current.locale + '/profile.html?id=' + screen_name) );
  		htmlLoader.window.opener = window;
  	} catch(e) { }
  }
  
  TM.core.open.settings = function()
  {
  	var settingsWindow = window.open('app:/html/' + TM.settings.current.locale + '/settings.html', 'Settings', "height=520, width=500, resizable=false");
  	settingsWindow.focus();
  }
  
  TM.core.open.new_group = function()
  {
  	var groupWindow = window.open('app:/html/' + TM.settings.current.locale + '/groups.html', 'Groups', "height=460, width=400, resizable=false");
  	groupWindow.focus();
  }
  
  TM.core.open.IM = function(contactID)
  {
  	var imWindow = window.open('app:/html/' + TM.settings.current.locale + '/conversation.html?screen_name=' + contactID, contactID, "height=500, width=400");
  	imWindow.focus();
  }
  
  