Index: trunk/phpgwapi/inc/functions.inc.php
===================================================================
--- trunk/phpgwapi/inc/functions.inc.php	(revision 2549)
+++ trunk/phpgwapi/inc/functions.inc.php	(revision 2645)
@@ -235,4 +235,6 @@
 	$GLOBALS['phpgw']->applications = CreateObject('phpgwapi.applications');
 	$GLOBALS['phpgw']->js           = CreateObject('phpgwapi.javascript');
+	$GLOBALS['phpgw']->css		= CreateObject('phpgwapi.css');
+
 	print_debug('main class loaded', 'messageonly','api');
 	if (! isset($GLOBALS['phpgw_info']['flags']['included_classes']['error']) ||
Index: trunk/phpgwapi/inc/class.common.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.common.inc.php	(revision 2644)
+++ trunk/phpgwapi/inc/class.common.inc.php	(revision 2645)
@@ -1327,15 +1327,18 @@
 			if ( @ isset( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ] ) )
 			{		
-				require_once('class.css.inc.php');
-				$cssObj = new css();
+				$path = ( ! empty( $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'webserver_url' ] ) ) ? 
+					$GLOBALS[ 'phpgw_info' ][ 'server' ][ 'webserver_url' ] : '/'; 
+
+				if ( strpos( $path, '/' ) != ( strlen( $path ) - 1 ) ) 
+					$path .= '/'; 
 
 				$template = $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'template_set' ];
 
-				$cssObj->validate_file( "phpgwapi/templates/".$template."/css/base.css");
-				$cssObj->validate_file( "phpgwapi/templates/".$template."/css/".$GLOBALS[ 'phpgw_info' ][ 'user' ][ 'preferences' ][ 'common' ][ 'theme' ].".css");
-				$cssObj->validate_file( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ]."/templates/".$template."/css/".$GLOBALS[ 'phpgw_info' ][ 'user' ][ 'preferences' ][ 'common' ][ 'theme' ].".css");
-				$cssObj->validate_file( $GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ]."/templates/".$template."/css/app.css");
+				$GLOBALS['phpgw']->css->validate_file( $path."phpgwapi/templates/".$template."/css/base.css");
+				$GLOBALS['phpgw']->css->validate_file( $path."phpgwapi/templates/".$template."/css/".$GLOBALS[ 'phpgw_info' ][ 'user' ][ 'preferences' ][ 'common' ][ 'theme' ].".css");
+				$GLOBALS['phpgw']->css->validate_file( $path.$GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ]."/templates/".$template."/css/".$GLOBALS[ 'phpgw_info' ][ 'user' ][ 'preferences' ][ 'common' ][ 'theme' ].".css");
+				$GLOBALS['phpgw']->css->validate_file( $path.$GLOBALS[ 'phpgw_info' ][ 'flags' ][ 'currentapp' ]."/templates/".$template."/css/app.css");
 				
-				$tpl -> set_var( 'css_file',  $cssObj->get_css() );
+				$tpl -> set_var( 'css_file',  $GLOBALS['phpgw']->css->get_css() );
 			}
 
Index: trunk/phpgwapi/inc/class.css.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.css.inc.php	(revision 2644)
+++ trunk/phpgwapi/inc/class.css.inc.php	(revision 2645)
@@ -41,10 +41,4 @@
 		function get_css()
 		{
-			$path = ( ! empty( $GLOBALS[ 'phpgw_info' ][ 'server' ][ 'webserver_url' ] ) ) ?
-				$GLOBALS[ 'phpgw_info' ][ 'server' ][ 'webserver_url' ] : '/';
-
-			if ( strpos( $path, '/' ) != ( strlen( $path ) - 1 ) )
-				$path .= '/';
-
 			if ($GLOBALS['phpgw_info']['server']['csspacker'] == "True")
 				  foreach($this->files as $cssFile)
@@ -52,10 +46,10 @@
 					  if (!file_exists(PHPGW_SERVER_ROOT.SEP.$cssFile."pack.css"))
 						$this->create_pack($cssFile);
-					  $out .= "\n\t\t<link href='".$path.$cssFile."pack.css' type='text/css' rel='StyleSheet'>";
+					  $out .= "\n\t\t<link href='".$cssFile."pack.css' type='text/css' rel='StyleSheet'>";
 					  
 				  }
 			  else
 				  foreach($this->files as $cssFile)
-					  $out .= "\n\t\t<link href='".$path.$cssFile."' type='text/css' rel='StyleSheet'>";
+					  $out .= "\n\t\t<link href='".$cssFile."' type='text/css' rel='StyleSheet'>";
 			  return $out;
 		}
@@ -63,5 +57,5 @@
 		function validate_file($file, $stack = false )
 		{
-			if (file_exists(PHPGW_SERVER_ROOT . '/' . $file))
+			if (file_exists(PHPGW_SERVER_ROOT . SEP . $file))
 				$this->files[] = $file;
 		}
