Index: trunk/instant_messenger/inc/im_acl.inc.php
===================================================================
--- trunk/instant_messenger/inc/im_acl.inc.php	(revision 75)
+++ trunk/instant_messenger/inc/im_acl.inc.php	(revision 151)
@@ -4,72 +4,44 @@
       if ( $GLOBALS['phpgw_info']['user']['acl'][$i]['appname'] == 'instant_messenger')
       {
-			require_once("im_sessions.inc.php");
-         
+		   session_start();
          $webserver_url = $GLOBALS['phpgw_info']['server']['webserver_url'];
-         $wz_dragdrop = $webserver_url."/phpgwapi/js/wz_dragdrop/";
          $webserver_url = ( !empty($webserver_url) ) ? $webserver_url : '/';
-
          if ( strrpos($webserver_url, '/') === false || strrpos($webserver_url, '/') != (strlen($webserver_url)-1) )
-            $webserver_url .= '/';
+				$webserver_url .= '/';
 
          $webserver_url = $webserver_url . 'instant_messenger/';
 
-         require_once("IMConfigure.php");
+			require_once PHPGW_SERVER_ROOT . '/instant_messenger/inc/im_sessions.inc.php';
+			require_once PHPGW_SERVER_ROOT . '/instant_messenger/inc/load_lang.php';
+			
+			$DOCUMENT_ROOT = PHPGW_SERVER_ROOT .'/instant_messenger/';
+         
+         $js = array(
+							'js/connector.js',
+							'js/xtools.js',
+							'js/jabber.js',
+							'js/client.js',
+							'js/images.js',
+							'js/dragdrop.js',
+							'js/build_win.js',
+							'js/templates.js',
+							'js/fcommon.js',
+							'js/menu_action.js',
+							'js/functions.js',
+							'js/images.js',
+							'js/cookies_im.js',
+							'js/load.js',							
+                    );
 
-         $_transport = TRANSPORT_NON_SECURITY;
-         $_port = PORT_NON_SECURITY;
+			print '<script type="text/javascript">var path_im = "'.$webserver_url.'";</script>';
+			foreach ( $js as $key => $val )
+				print '<script src="' . $webserver_url . $val . '?' . filemtime($DOCUMENT_ROOT . $val) . '"></script>';
+			
+			print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/window.css">';
+			print	'<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/chat.css">';
+			print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'templates/default/css/common.css">';
+			print '<script type="text/javascript">setTimeout("client()",1000);</script>'; 
 
-			$SERVER = "127.0.0.1";
-
-			$fp  = "";
-			@$fp = stream_socket_client($_transport . "://" . $SERVER . ":" . $_port, $errno, $errstr, 10);
-
-         if ( $fp )
-         {
-            fwrite($fp, "GET /" . CONNECT . ";" . session_id() . " HTTP/1.1\r\nHost: " . $SERVER . ":" . $_port . "\r\nAccept: */*\r\n\r\n");
-
-            $js = array(
-                        $webserver_url . 'js/XMLTools.js',
-                        $webserver_url . 'js/im_functions.js',
-                        $webserver_url . 'js/im_fcommon.js',
-                        $webserver_url . 'js/im_var_globals.js',
-                        $webserver_url . 'js/im_images.js',
-                        $webserver_url . 'js/im_smiles.js',
-                        $webserver_url . 'js/im_templates.js',
-                        $webserver_url . 'js/im_win.js',
-                        $webserver_url . 'js/im_menu_action.js',
-                        $webserver_url . 'js/im_conf_font.js',
-                        $webserver_url . 'js/im_preferences.js',
-                        $webserver_url . 'js/im_init.js',
-						      $webserver_url . 'js/im_subscription.js',
-                       );
-
-            require_once('load_lang.php');
-
-         	print '
-               <link rel="stylesheet" href="' . $webserver_url . 'templates/default/css.css" />
-               <link rel="stylesheet" href="' . $webserver_url . 'templates/default/messenger.css" />
-               <script>
-                  var im_path="' . $webserver_url . '";
-                  var ini_wzdd = false;
-                  if ( !window.dd )
-                  {
-                     ini_wzdd = true;
-                     document.write(\'\<script src="' . $wz_dragdrop . 'wz_dragdrop.js"\>\<\/script\>\');
-                     var im_path="' . $webserver_url . '";
-                  }
-               </script>';
-         
-          print '
-               <script>
-                  if ( ini_wzdd )
-                     SET_DHTML("backFantom"+NO_DRAG);
-               </script>';
-
-          foreach ( $js as $key => $val )
-             print '<script src="' . $val . '?' . filemtime($_SERVER['DOCUMENT_ROOT'] . '/' . $val) . '"></script>';
-          
-         }
-         break;
+			session_write_close();
       }
    }
