Index: /trunk/phpgwapi/inc/class.common.inc.php
===================================================================
--- /trunk/phpgwapi/inc/class.common.inc.php	(revision 2648)
+++ /trunk/phpgwapi/inc/class.common.inc.php	(revision 2677)
@@ -393,5 +393,5 @@
 
 					$GLOBALS['phpgw_info']['flags']['java_script_thirst'] .= '<script type="text/javascript">'
-						. 'var URL_SERVER = "' . $webserver_url . '";'
+						. 'var URL_SERVER = window.location.protocol + "//" + window.location.host + "' . $webserver_url . '";'
 						. 'var template = "' . $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'template_set' ] . '";</script>';
 
@@ -402,4 +402,5 @@
 					$GLOBALS[ 'phpgw' ] -> js -> validate_file( 'tools','xscript', NULL, true );
 					$GLOBALS[ 'phpgw' ] -> js -> validate_file( 'tools','xconnector', NULL, true );
+					$GLOBALS[ 'phpgw' ] -> js -> validate_file( 'tools','xml', NULL, true );
 					$GLOBALS[ 'phpgw' ] -> js -> validate_file( 'tools','xevent', NULL, true );
 					$GLOBALS[ 'phpgw' ] -> js -> validate_file( 'tools','xobject', NULL, true );
Index: /trunk/phpgwapi/js/tools/xlink.js
===================================================================
--- /trunk/phpgwapi/js/tools/xlink.js	(revision 2674)
+++ /trunk/phpgwapi/js/tools/xlink.js	(revision 2677)
@@ -8,4 +8,53 @@
 	var _loading = new Image( );
 	_loading.src = URL_SERVER + 'phpgwapi/images/loading.gif';
+
+	function _click( _action, _cache )
+	{
+
+		if ( _action.indexOf( window.location.host ) < 0 )
+			_action = window.location.protocol + '//' + window.location.host + _action;
+
+		_divAppboxHeader.innerHTML = '';
+
+		var _center = document.createElement( 'center' );
+		_center.appendChild( _loading );
+
+		_container.innerHTML = '';
+		_container.appendChild( _center );
+
+		_connector.go(
+		{
+			'access' : _action,
+			'cache' : _cache,
+			'handler' : _handler
+		} );
+
+		window.location = '#' + (
+			( _action.indexOf( URL_SERVER ) < 0 ) ?
+				_action : _action.substr( _action.indexOf( URL_SERVER ) + URL_SERVER.length )
+		);
+	}
+
+	function _intercept( pLink )
+	{
+		var action = pLink.href;
+		if ( action == '' )
+			return false;
+
+		var a = ( action.indexOf( 'javascript:' ) === 0 );
+		a = ( a || ( action.indexOf( '#' ) === 0 ) );
+		a = ( a || ( action.indexOf( window.location + '#' ) === 0 ) );
+		a = ( a || ! ( action.indexOf( 'workflow' ) < 0 ) );
+
+		if ( ! a )
+			pLink.onclick = function( )
+			{
+				var _cacheit = false;//( ( pLink.hasAttribute( 'cacheit' ) && pLink.getAttribute( 'cacheit' ) === 'true' ) ? true : false );
+
+				_click( action, _cacheit );
+
+				return false;
+			};
+	}
 
 	function _handler( data )
@@ -29,5 +78,5 @@
 		var _links = el.getElementsByTagName( 'a' );
 		for ( var i = 0; i < _links.length; i++ )
-			handler( _links.item( i ) );
+			_intercept( _links.item( i ) );
 
 		_container.innerHTML = '';
@@ -67,56 +116,12 @@
 	}
 
-	function handler( pLink )
-	{
-		var action = pLink.href;
-		if ( action == '' )
-			return false;
-
-		var a = ( action.indexOf( 'javascript:' ) === 0 );
-		a = ( a || ( action.indexOf( '#' ) === 0 ) );
-		a = ( a || ( action.indexOf( window.location + '#' ) === 0 ) );
-		a = ( a || ! ( action.indexOf( 'workflow' ) < 0 ) );
-
-		if ( ! a )
-			pLink.onclick = function( )
-			{
-				_divAppboxHeader.innerHTML = '';
-
-				var _center = document.createElement( 'center' );
-				_center.appendChild( _loading );
-
-				_container.innerHTML = '';
-				_container.appendChild( _center );
-
-				var _cacheit = false;//( ( pLink.hasAttribute( 'cacheit' ) && pLink.getAttribute( 'cacheit' ) === 'true' ) ? true : false );
-
-				_connector.go(
-				{
-					'access' : action,
-					'cache' : _cacheit,
-					'handler' : _handler
-				} );
-
-				window.location = '#' + (
-					( action.indexOf( URL_SERVER ) < 0 ) ?
-						action : action.substr( action.indexOf( URL_SERVER ) + URL_SERVER.length )
-				);
-
-				return false;
-			};
-	}
-
 	function Link( )
 	{
-		var _cacheit = false;
-		if ( arguments.length > 1 && arguments[ 1 ].constructor == Boolean )
-			_cacheit = arguments[ 1 ];
-
-		_connector.go(
-		{
-			"access" : arguments[ 0 ],
-			"cache" : _cacheit,
-			"handler" : _handler
-		} );
+		_click( arguments[ 0 ],
+			(
+				( arguments.length > 1 && arguments[ 1 ].constructor == Boolean ) ?
+					arguments[ 1 ] : false
+			)
+		);
 	}
 
@@ -146,5 +151,5 @@
 		var _links = document.getElementsByTagName( 'a' );
 		for ( var i = 0; i < _links.length; i++ )
-			handler( _links.item( i ) );
+			_intercept( _links.item( i ) );
 	} );
 } )( );
