Index: trunk/phpgwapi/inc/class.common.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.common.inc.php	(revision 2677)
+++ trunk/phpgwapi/inc/class.common.inc.php	(revision 2703)
@@ -392,11 +392,16 @@
 						$webserver_url .= '/';
 
+					$expressolivre = CreateObject( 'phpgwapi.expressolivre' );
+
 					$GLOBALS['phpgw_info']['flags']['java_script_thirst'] .= '<script type="text/javascript">'
 						. 'var URL_SERVER = window.location.protocol + "//" + window.location.host + "' . $webserver_url . '";'
-						. 'var template = "' . $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'template_set' ] . '";</script>';
+						. 'var template = "' . $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'template_set' ] . '";'
+						. 'var ExpressoLivre = function ExpressoLivre( ) { return String( \'' . $expressolivre -> configuration( ) . '\' ); };'
+						. '</script>';
 
 					$GLOBALS[ 'phpgw' ] -> js -> validate_file( 'wz_dragdrop', 'wz_dragdrop', NULL, true );
 					$GLOBALS[ 'phpgw' ] -> js -> validate_file( 'expressoAjax', 'expressoAjax', NULL, true );
 					$GLOBALS[ 'phpgw' ] -> js -> validate_file( 'expressoAjax', 'dom', NULL, true );
+					$GLOBALS[ 'phpgw' ] -> js -> validate_file( 'expressolivre','expressolivre', NULL, true );
 					$GLOBALS[ 'phpgw' ] -> js -> validate_file( 'tools','xlink', NULL, true );
 					$GLOBALS[ 'phpgw' ] -> js -> validate_file( 'tools','xscript', NULL, true );
Index: trunk/phpgwapi/js/tools/xlink.js
===================================================================
--- trunk/phpgwapi/js/tools/xlink.js	(revision 2700)
+++ trunk/phpgwapi/js/tools/xlink.js	(revision 2703)
@@ -1,19 +1,14 @@
 ( function( )
 {
-	if ( window.location.protocol + '//' + window.location.host + window.location.pathname != URL_SERVER )
-		window.location.href = URL_SERVER + (
-			( window.location.hash ) ?
-				window.location.hash : '#' + String( window.location.protocol + '//' + window.location.host + window.location.pathname ).substr( URL_SERVER.length )
-		);
+	var _path = null;
+	var _last_request = null;
 
-	var _connector = new XConnector;
-	var _script = null;
+	var _connector = null;
+	var _script = new XScript;
 
 	var _container = null;
 	var _divAppboxHeader = null;
+
 	var _loading = new Image( );
-	_loading.src = URL_SERVER + 'phpgwapi/images/loading.gif';
-
-	var _last_request = null;
 
 	function _click( _action, _cache )
@@ -47,6 +42,6 @@
 
 		window.location = '#' + (
-			( _action.indexOf( URL_SERVER ) < 0 ) ?
-				_action : _action.substr( _action.indexOf( URL_SERVER ) + URL_SERVER.length )
+			( _action.indexOf( _path ) < 0 ) ?
+				_action : _action.substr( _action.indexOf( _path ) + URL_SERVER.length )
 		);
 	}
@@ -116,6 +111,6 @@
 				_script.add(
 					_new_scripts[ _count ][ 2 ].substr(
-						URL_SERVER.length - 1,
-						_new_scripts[ _count ][ 2 ].length - URL_SERVER.length + 1 - (
+						_path.length - 1,
+						_new_scripts[ _count ][ 2 ].length - _path.length + 1 - (
 							( _new_scripts[ _count ][ 2 ].indexOf( '?' ) < 0 ) ?
 								0 : ( _new_scripts[ _count ][ 2 ].length - _new_scripts[ _count ][ 2 ].indexOf( '?' ) )
@@ -137,4 +132,18 @@
 	function Link( )
 	{
+		_path = ( arguments.length && arguments[ 0 ].constructor == String ) ? arguments[ 0 ] : '/';
+
+		if ( window.location.protocol + '//' + window.location.host + window.location.pathname != _path )
+			window.location.href = _path + (
+				( window.location.hash ) ?
+					window.location.hash : '#' + String( window.location.protocol + '//' + window.location.host + window.location.pathname + window.location.search ).substr( _path.length )
+			);
+
+		_loading.src = _path + 'phpgwapi/images/loading.gif';
+		_connector = new XConnector;
+	}
+
+	Link.prototype.click = function( )
+	{
 		_click( arguments[ 0 ],
 			(
@@ -143,5 +152,6 @@
 			)
 		);
-	}
+	};
+	Link.prototype.intercept = _intercept;
 
 	window.XLink = Link;
@@ -149,26 +159,8 @@
 	XEvents.add( window, 'onload', function( )
 	{
-		var _scripts = document.getElementsByTagName( 'head' ).item( 0 ).getElementsByTagName( 'script' );
-		var _loaded = [ ];
-
-		for ( var i = 0; i < _scripts.length; i++ )
-			if ( _scripts.item( i ).getAttribute( 'src' ) != null )
-				_loaded[ _loaded.length ] = _scripts.item( i ).getAttribute( 'src' ).substr(
-					URL_SERVER.length - 1,
-					_scripts.item( i ).getAttribute( 'src' ).indexOf( '?' ) - URL_SERVER.length + 1
-				);
-
-		_script = new XScript( _loaded );
-
 		_divAppboxHeader = document.getElementById( 'divAppboxHeader' );
 		_divAppboxHeader.innerHTML = '';
 
 		_container = document.getElementById( 'divAppbox' );
-
-		document.getElementsByTagName( 'body' ).item( 0 ).style.overflowY = 'scroll';
-
-		var _links = document.getElementsByTagName( 'a' );
-		for ( var i = 0; i < _links.length; i++ )
-			_intercept( _links.item( i ) );
 	} );
 } )( );
Index: trunk/phpgwapi/js/tools/xscript.js
===================================================================
--- trunk/phpgwapi/js/tools/xscript.js	(revision 2642)
+++ trunk/phpgwapi/js/tools/xscript.js	(revision 2703)
@@ -1,5 +1,5 @@
 ( function( )
 {
-	var _connector = null;
+	var _connector = new XConnector;
 	var _loaded = [ ];
 	var _new = [ ];
@@ -65,8 +65,3 @@
 
 	window.XScript = Script;
-
-	XEvents.add( window, 'onload', function( )
-	{
-		_connector = new XConnector;
-	} );
 } )( );
