Index: /branches/2.2/filemanager/tp/expressowindow/xsl/view.xsl
===================================================================
--- /branches/2.2/filemanager/tp/expressowindow/xsl/view.xsl	(revision 3569)
+++ /branches/2.2/filemanager/tp/expressowindow/xsl/view.xsl	(revision 3569)
@@ -0,0 +1,122 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+	<xsl:output method="html" omit-xml-declaration="yes"/>
+	
+	<xsl:param name="checkList" />	
+	<xsl:param name="checkIcons" />
+	<xsl:param name="check_created" />
+	<xsl:param name="check_createdby_id" />
+	<xsl:param name="check_comment" />
+	<xsl:param name="check_mime_type" />
+	<xsl:param name="check_modified" />
+	<xsl:param name="check_modifiedby_id" />
+	<xsl:param name="check_owner" />
+	<xsl:param name="check_size" />
+	<xsl:param name="check_version" />
+	<xsl:param name="lang_cancel" />
+	<xsl:param name="lang_created_by" />			
+	<xsl:param name="lang_created" />
+	<xsl:param name="lang_comment" />
+	<xsl:param name="lang_modified_by" />
+	<xsl:param name="lang_modified" />
+	<xsl:param name="lang_owner" />
+	<xsl:param name="lang_save" />			
+	<xsl:param name="lang_size" />
+	<xsl:param name="lang_type" />
+	<xsl:param name="lang_version" />
+	<xsl:param name="lang_view_as_list" />
+	<xsl:param name="lang_view_as_icons" />
+	<xsl:param name="onclickCancel" />
+	<xsl:param name="onclickSave" />
+	
+	<xsl:template match="view_config">
+
+		<div id="menu_col_pref">
+		
+			<input name="prefView" value="viewList" type="radio">
+				<xsl:if test="$checkList = 1">
+					<xsl:attribute name="checked">checked</xsl:attribute>
+				</xsl:if>
+			</input>
+			<xsl:value-of select="$lang_view_as_list"/>
+			
+			<input name="prefView" value="viewIcons" type="radio">
+				<xsl:if test="$checkIcons = 1">
+					<xsl:attribute name="checked">checked</xsl:attribute>
+				</xsl:if>
+			</input>
+			<xsl:value-of select="$lang_view_as_icons"/><br/>
+			
+			<input name="prefView" value="mime_type" type="checkbox">
+				<xsl:if test="$check_mime_type = 1">
+					<xsl:attribute name="checked">checked</xsl:attribute>
+				</xsl:if>
+			</input>
+			<xsl:value-of select="$lang_type"/><br/>
+			
+			<input name="prefView" value="size" type="checkbox">
+				<xsl:if test="$check_size = 1">
+					<xsl:attribute name="checked">checked</xsl:attribute>
+				</xsl:if>
+			</input>
+			<xsl:value-of select="$lang_size"/><br/>
+			
+			<input name="prefView" value="created" type="checkbox">
+				<xsl:if test="$check_created = 1">
+					<xsl:attribute name="checked">checked</xsl:attribute>
+				</xsl:if>
+			</input>
+			<xsl:value-of select="$lang_created"/><br/>
+			
+			<input name="prefView" value="modified" type="checkbox">
+				<xsl:if test="$check_modified = 1">
+					<xsl:attribute name="checked">checked</xsl:attribute>
+				</xsl:if>
+			</input>
+			<xsl:value-of select="$lang_modified"/><br/>
+			
+			<input name="prefView" value="owner" type="checkbox">
+				<xsl:if test="$check_owner = 1">
+					<xsl:attribute name="checked">checked</xsl:attribute>
+				</xsl:if>
+			</input>
+			<xsl:value-of select="$lang_owner"/><br/>
+			
+			<input name="prefView" value="createdby_id" type="checkbox">
+				<xsl:if test="$check_createdby_id = 1">
+					<xsl:attribute name="checked">checked</xsl:attribute>
+				</xsl:if>
+			</input>
+			<xsl:value-of select="$lang_created_by"/><br/>
+			
+			<input name="prefView" value="modifiedby_id" type="checkbox">
+				<xsl:if test="$check_modifiedby_id = 1">
+					<xsl:attribute name="checked">checked</xsl:attribute>
+				</xsl:if>
+			</input>
+			<xsl:value-of select="$lang_modified_by"/><br/>
+			
+			<input name="prefView" value="comment" type="checkbox">
+				<xsl:if test="$check_comment = 1">
+					<xsl:attribute name="checked">checked</xsl:attribute>
+				</xsl:if>
+			</input>
+			<xsl:value-of select="$lang_comment"/><br/>
+			
+			<input name="prefView" value="version" type="checkbox">
+				<xsl:if test="$check_version = 1">
+					<xsl:attribute name="checked">checked</xsl:attribute>
+				</xsl:if>
+			</input>
+			<xsl:value-of select="$lang_version"/><br/>
+			 
+		</div>
+		
+		<div style="margin-top:15px;">
+			<input style="margin-left:5px;" value="{$lang_save}" onclick="{$onclickSave}" type="button" />
+			<input style="margin-left:5px;" value="{$lang_cancel}" onclick="{$onclickCancel}" type="button" />
+		</div>
+		
+	</xsl:template>
+	
+</xsl:stylesheet>
Index: /branches/2.2/filemanager/tp/expressowindow/css/window_escritorio.css
===================================================================
--- /branches/2.2/filemanager/tp/expressowindow/css/window_escritorio.css	(revision 3436)
+++ /branches/2.2/filemanager/tp/expressowindow/css/window_escritorio.css	(revision 3569)
@@ -6,6 +6,4 @@
 	border		: 1px solid #1e4098;
 	color		: #fff !important;
-	display		: none;
-	margin		: 20px 5px 0px -15px;
 	position	: absolute;
 }
Index: /branches/2.2/filemanager/tp/expressowindow/css/window_cataratas.css
===================================================================
--- /branches/2.2/filemanager/tp/expressowindow/css/window_cataratas.css	(revision 3436)
+++ /branches/2.2/filemanager/tp/expressowindow/css/window_cataratas.css	(revision 3569)
@@ -4,6 +4,4 @@
 	border		: 1px solid #7bc64e;
 	color		: #ffffed !important;
-	display		: none;
-	margin		: 20px 5px 0px -15px;
 	position	: absolute;
 }
Index: /branches/2.2/filemanager/tp/expressowindow/css/window_default.css
===================================================================
--- /branches/2.2/filemanager/tp/expressowindow/css/window_default.css	(revision 3436)
+++ /branches/2.2/filemanager/tp/expressowindow/css/window_default.css	(revision 3569)
@@ -6,6 +6,4 @@
 	border		: 1px solid #918b8b;
 	color:		: #585656 !important;
-	display		: none;
-	margin		: 20px 5px 0px -15px;
 	position	: absolute;
 }
Index: /branches/2.2/filemanager/tp/expressowindow/css/window_metropole.css
===================================================================
--- /branches/2.2/filemanager/tp/expressowindow/css/window_metropole.css	(revision 3436)
+++ /branches/2.2/filemanager/tp/expressowindow/css/window_metropole.css	(revision 3569)
@@ -6,6 +6,4 @@
 	border		: 1px solid #000;
 	color		: #fffcdf !important;
-	display		: none;
-	margin		: 20px 5px 0px -15px;
 	position	: absolute;
 }
Index: /branches/2.2/filemanager/tp/expressowindow/css/window_azul.css
===================================================================
--- /branches/2.2/filemanager/tp/expressowindow/css/window_azul.css	(revision 3436)
+++ /branches/2.2/filemanager/tp/expressowindow/css/window_azul.css	(revision 3569)
@@ -4,6 +4,4 @@
 	border		: 1px solid #8ea4c1;
 	color		: #15428b !important;
-	display		: none;
-	margin		: 20px 5px 0px -15px;
 	position	: absolute;
 }
Index: /branches/2.2/filemanager/tp/expressowindow/css/window_celepar.css
===================================================================
--- /branches/2.2/filemanager/tp/expressowindow/css/window_celepar.css	(revision 3436)
+++ /branches/2.2/filemanager/tp/expressowindow/css/window_celepar.css	(revision 3569)
@@ -6,6 +6,4 @@
 	border		: 1px solid #918b8b;
 	color:		: #585656 !important;
-	display		: none;
-	margin		: 20px 5px 0px -15px;
 	position	: absolute;
 }
Index: /branches/2.2/filemanager/tp/expressowindow/css/window_comics.css
===================================================================
--- /branches/2.2/filemanager/tp/expressowindow/css/window_comics.css	(revision 3436)
+++ /branches/2.2/filemanager/tp/expressowindow/css/window_comics.css	(revision 3569)
@@ -6,6 +6,4 @@
 	border		: 1px solid #000;
 	color		: #000 !important;
-	display		: none;
-	margin		: 20px 5px 0px -15px;
 	position	: absolute;
 }
Index: /branches/2.2/filemanager/tp/expressowindow/css/window_rochas.css
===================================================================
--- /branches/2.2/filemanager/tp/expressowindow/css/window_rochas.css	(revision 3436)
+++ /branches/2.2/filemanager/tp/expressowindow/css/window_rochas.css	(revision 3569)
@@ -6,6 +6,4 @@
 	border		: 1px solid #bd8d5d;
 	color		: #000 !important;
-	display		: none;
-	margin		: 20px 5px 0px -15px;
 	position	: absolute;
 }
Index: /branches/2.2/filemanager/tp/expressowindow/js/makeW.js
===================================================================
--- /branches/2.2/filemanager/tp/expressowindow/js/makeW.js	(revision 3568)
+++ /branches/2.2/filemanager/tp/expressowindow/js/makeW.js	(revision 3569)
@@ -4,4 +4,6 @@
 	var dragDrop	= null;
 	var path		= path_filemanager + "tp/expressowindow/";
+		
+	var _dialogs = [ ];
 	
 	function build(pObj)
@@ -30,7 +32,15 @@
 				_window.setAttribute("leftOld", pObj.left + "px" );
 			
+			if( pObj.leftOld )
+				_window.setAttribute("leftOld", pObj.leftOld + "px" );
+			
 			window.document.body.insertBefore( _window, document.body.lastChild );
 			
-			getElement(pObj.id_window + '__content').innerHTML = pObj.content; 
+			if ( pObj.content.constructor == String )
+				getElement(pObj.id_window + '__content').innerHTML = pObj.content;
+			else
+				getElement(pObj.id_window + '__content').appendChild( pObj.content );
+			
+			_dialogs[ pObj.id_window ] = getElement(pObj.id_window + '__content').firstChild;
 			
 			if( pObj.draggable )
@@ -42,5 +52,8 @@
 		else
 		{
-			load(pObj.id_window, "display");
+	    	if ( pObj.barejid && loadscript.windowPOPUP( pObj.barejid ) )
+	    		return false;
+
+	    	load(pObj.id_window, "display");
 		}
 	}
@@ -59,5 +72,6 @@
 			if ( pVisible == "display" )
 			{
-				_window.style.left = _window.getAttribute("leftOld");
+				if( _window.style.left == "-1500px" )
+					_window.style.left = _window.getAttribute("leftOld");
 			}
 			
@@ -79,18 +93,28 @@
 		if( arguments.length > 0 )
 		{
+			var pId = null;
 			if( arguments.length == 1 )
 			{
-				JSLoader.load([path + "css/" + theme_filemanager]);
-				
 				var obj = arguments[0];
-				
-				setTimeout(function(){ build(obj);}, 200);
+				pId = obj.id_window
+				build(obj);
 			}
 			
 			if( arguments.length == 2 )
 			{
-				load(arguments[0], arguments[1]);
+				load( ( pId = arguments[0] ), arguments[1]);
 			}	
 		}
+
+		return ( new function( )
+		{
+			this.content = function( )
+			{
+				if ( arguments.length )
+					getElement( pId + '__content').appendChild( _dialogs[ pId ] );
+
+				return _dialogs[ obj.id_window ];
+			};
+		} );
 	}
 
@@ -104,8 +128,9 @@
 	{	
 		if( arguments.length == 1 )
-			_win = new bWindow( arguments[0] );
+			return bWindow( arguments[0] );
 		
 		if( arguments.length == 2 )
-			_win = new bWindow( arguments[0], arguments[1]);	
+			return bWindow( arguments[0], arguments[1]);	
 	}
+	return false;
 }
Index: /branches/2.2/filemanager/tp/expressowindow/js/xtools.js
===================================================================
--- /branches/2.2/filemanager/tp/expressowindow/js/xtools.js	(revision 3436)
+++ /branches/2.2/filemanager/tp/expressowindow/js/xtools.js	(revision 3569)
@@ -90,5 +90,6 @@
 				var params = arguments[2];
 				for (var i in params )
-					 xslProc.setParameter(null, i, params[i]);
+					if ( params[ i ] && params[ i ].constructor != Function )
+						xslProc.setParameter(null, String( i ), String( params[i] ) );
 			}
 
@@ -112,5 +113,8 @@
 				var params = arguments[2];
 				for (var i in params )
-					 xslProc.addParameter(i, params[i], '');
+					if ( params[ i ] && params[ i ].constructor != Function )
+					{
+						xslProc.addParameter( String( i ), String( params[i] ), '');
+					}
 			}
 
Index: /branches/2.2/filemanager/tp/expressowindow/js/show_hidden.js
===================================================================
--- /branches/2.2/filemanager/tp/expressowindow/js/show_hidden.js	(revision 3569)
+++ /branches/2.2/filemanager/tp/expressowindow/js/show_hidden.js	(revision 3569)
@@ -0,0 +1,112 @@
+(function()
+{
+	
+	var _delay;
+	var _event_show 	= false;
+	var _event_hidden	= false;
+
+	var _last_displayed;
+	var _timeout 		= false;
+
+	function _config(pObj, pEvent, pHandler)
+	{
+		if ( typeof pObj == 'object' )
+		{
+			if ( pEvent.substring(0, 2) == 'on' )
+				pEvent = pEvent.substring(2, pEvent.length);
+
+			if ( pObj.addEventListener )
+				pObj.addEventListener(pEvent, pHandler, false);
+			else if ( pObj.attachEvent )
+				pObj.attachEvent('on' + pEvent, pHandler);
+		}
+	}
+
+	function hdObject()
+	{
+		if( _last_displayed )
+		{
+			_last_displayed.style.display = 'none';
+			_last_displayed = false;
+		}
+	}
+
+	function _hidden()
+	{
+		if( arguments.length > 0 )
+		{
+			if( arguments[0] )
+				clearTimeout( _timeout );
+			else
+			{
+				_timeout = setTimeout( hdObject, _delay);
+			}
+		}
+	}
+
+	function _show(_element)
+	{
+		if( !(_last_displayed && ( _last_displayed.id == _element.id )))
+		{
+			_element.style.display = 'block';
+			_last_displayed = _element;
+		}
+	}
+
+	function _view()
+	{
+		if ( arguments.length == 3 )
+		{
+			var _event = [
+				'onclick',
+				'onmousedown',
+				'onmouseout',
+				'onmouseover',
+				'onmouseup'
+			];
+
+			_event_show = false;
+			_event_hidden = false;
+
+			for ( var i in _event )
+			{
+				if ( _event[i] == arguments[0] )
+					_event_show = arguments[0];
+
+				if ( _event[i] == arguments[1] )
+					_event_hidden = arguments[1];
+			}
+
+			if ( _event_show && _event_hidden )
+			{
+				var _element = false;
+				
+				switch ( typeof arguments[2] )
+				{
+					case 'object' :
+						_element = arguments[2];
+					break;
+					
+					case 'string' :
+						_element = document.getElementById(arguments[2]);
+					break;
+				}
+
+				if ( _element )
+					_show(_element);
+			}
+		}
+	}
+
+	function ShowHidden()
+	{
+		_delay = ( (arguments.length > 0) && !isNaN(arguments[0]) ) ? arguments[0] : 3000;
+	}
+
+	
+	ShowHidden.prototype.action  		= _view;
+	ShowHidden.prototype.hiddenObject	= _hidden;
+    
+	window.ShowHidden					= ShowHidden;
+    
+})();
Index: /branches/2.2/filemanager/tp/expressowindow/js/dragdrop.js
===================================================================
--- /branches/2.2/filemanager/tp/expressowindow/js/dragdrop.js	(revision 3436)
+++ /branches/2.2/filemanager/tp/expressowindow/js/dragdrop.js	(revision 3569)
@@ -6,7 +6,7 @@
 	var _parent		= null;
 
-	function _configEvent(pObj, pEvent, pHandler)
-	{
-		if ( typeof pObj == 'object' )
+	function _configEvent( pObj, pEvent, pHandler )
+	{
+		if ( pObj && typeof pObj == 'object' )
 		{
 			if ( pEvent.substring(0, 2) == 'on' )
@@ -22,8 +22,12 @@
 			else if ( arguments.length == 4 )
 			{
-				if ( pObj.removeEventListener && pObj.removeEventListener != 'undefined')
-					pObj.removeEventListener(pEvent, pHandler, false);
+				if ( pObj.removeEventListener )
+				{
+					pObj.removeEventListener( pEvent, pHandler, false );
+				}
 				else if ( pObj.detachEvent )
-					pObj.detachEvent('on' + pEvent, pHandler);
+				{
+					pObj.detachEvent( 'on' + pEvent, pHandler );
+				}
 			}
 		}
@@ -148,6 +152,4 @@
 		if ( _element )
 		{
-			_mouseUpShadow();
-			
 			_configEvent(_element, 'onmousemove', _mouseMove, 'remove');
 			_configEvent(top.document, 'onmousemove', _mouseMove, 'remove');
@@ -157,5 +159,5 @@
 
 			_element.mouseOffset = null;
-			_element = null;
+			_mouseUpShadow();
 		}
 	}
Index: anches/2.2/filemanager/tp/expressowindow/expresso.html
===================================================================
--- /branches/2.2/filemanager/tp/expressowindow/expresso.html	(revision 3436)
+++ 	(revision )
@@ -1,76 +1,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
-<html>
-	<head>
-	<script type="text/javascript" src="js/xtools.js"></script>
-	<script type="text/javascript" src="js/jsloader.js"></script>
-	<script type="text/javascript" src="js/makeW.js"></script>
-	<script type="text/javascript" src="js/dragdrop.js"></script>
-
-	<script>
-	
-		zIndex = 9001;
-
-		function teste1()
-		{
-			var _janela = {
-							 id_window	 : "contatos",
-							 width		 : 500,
-							 height		 : 300,
-							 top		 : 30,
-							 left		 : 300,
-							 draggable	 : true,
-							 visible	 : "display",
-							 resizable	 : true,
-							 zindex		 : zIndex++, //9001,
-							 title		 : "Expresso Messenger",
-							 closeAction : "hidden",
- 							 content	 : "<span><i> - JANELA 0 - Somente HTML  - hidden </i></span>"
-						 };
-			 
-			_winBuild( _janela );
-			 
-		}
-
-		function teste2()
-		{
-			var _janela = {
-							 id_window	 : "contatos_1",
-							 width		 : 200,
-							 height		 : 300,
-							 top		 : 30,
-							 left		 : 550,
-							 draggable	 : true,
-							 visible	 : "display",
-							 resizable	 : true,
-							 zindex		 : zIndex++, //9001,
-							 title		 : "Expresso Messenger 1",
-							 closeAction : "remove",
-							 content	 : " - JANELA 1 - Somente Texto - remove"
-						 };
-			 
-			_winBuild( _janela );
-		}
-		
-	</script>
-</head>
-<body>
-	<pre>Protótipo : 3 </pre>
-	<br/>
-	<br/>
-	<a href="javascript:void(0)" onclick="teste1();" style="cursor:pointer;">Janelinha 1</a>
-	<br/>
-	<a href="javascript:void(0)" onclick="teste2();" style="cursor:pointer;">Janelinha 2</a>
-	<br/>
-	<pre>
-		adfadsf asdf asdf asdfasdf asdf adf asdf ad adsf asdf asdfasdfasdf ad
-		asdfasdf asdf asdf asdf adfasdfasdfa dsfasdfasdfads adsf asdf asdfasdf	
-	
-		adfadsf asdf asdf asdfasdf asdf adf asdf ad adsf asdf asdfasdfasdf ad
-		asdfasdf asdf asdf asdf adfasdfasdfa dsfasdfasdfads adsf asdf asdfasdf	
-	
-		adfadsf asdf asdf asdfasdf asdf adf asdf ad adsf asdf asdfasdfasdf ad
-		asdfasdf asdf asdf asdf adfasdfasdfa dsfasdfasdfads adsf asdf asdfasdf	
-	</pre>
-	
-</body>
-</html>
Index: /branches/2.2/filemanager/inc/class.uifilemanager.inc.php
===================================================================
--- /branches/2.2/filemanager/inc/class.uifilemanager.inc.php	(revision 3568)
+++ /branches/2.2/filemanager/inc/class.uifilemanager.inc.php	(revision 3569)
@@ -350,13 +350,16 @@
 			
 			$js  = "var path_filemanager	= '".$webserver_url."';";
-			$js .= "var theme_filemanager	= '".$theme."';";
 			
 			echo "<script type='text/javascript'>".$js."</script>";
 
-			/*Expresso Window*/
+			// Expresso Window - CSS
+			print '<link rel="stylesheet" type="text/css" href="' . $webserver_url . 'tp/expressowindow/css/'.$theme.'" >';
+
+			// Expresso Window - JS 
 			echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/tp/expressowindow/js/xtools.js'></script>";
 			echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/tp/expressowindow/js/jsloader.js'></script>";
 			echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/tp/expressowindow/js/makeW.js'></script>";
 			echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/tp/expressowindow/js/dragdrop.js'></script>";
+			echo "<script src='".$GLOBALS['phpgw_info']['flags']['currentapp']."/tp/expressowindow/js/show_hidden.js'></script>";
 
 			echo "<script src='./phpgwapi/js/dftree/dftree.js'></script>";
@@ -1354,5 +1357,5 @@
 			if($img)
 			{
-				return '<span name="'.$link.'" class="toolButton" onclick="toolbar.control(\''.$link.'\');" title="'.$description.'"><img src="'.$image.'" alt="'.$description.'"/></a><small>'.$description.'</small></span>';
+				return '<span name="'.$link.'" class="toolButton" onclick="toolbar.control(\''.$link.'\',this);" title="'.$description.'"><img src="'.$image.'" alt="'.$description.'"/></a><small>'.$description.'</small></span>';
 			}
 		}
Index: /branches/2.2/filemanager/js/draw_api.js
===================================================================
--- /branches/2.2/filemanager/js/draw_api.js	(revision 3439)
+++ /branches/2.2/filemanager/js/draw_api.js	(revision 3569)
@@ -1,3 +1,7 @@
+
 var offset;
+var showHidden 	= null;
+var Xtools		= null;
+var zIndex		= 1000;
 
 function getPointer(e) {
@@ -34,11 +38,14 @@
 }
 
-var zIndex=0;
-function draw_window(htmlData, sizeW, sizeH){
-	if (sizeW == undefined)
+function draw_window(htmlData, sizeW, sizeH)
+{
+	if ( sizeW == undefined )
 		var sizeW = 420;
-	if (sizeH == undefined)
+	
+	if ( sizeH == undefined )
 		var sizeH = 200;
-	var _janela = {
+	
+	var _janela = 
+	{
 		id_window       : "dwindow"+zIndex,
 		width           : sizeW,
@@ -51,62 +58,47 @@
 		zindex          : ++zIndex,
 		title           : get_lang("filemanager"),
-		closeAction : "hidden",
+		closeAction 	: "hidden",
 		content         : htmlData
 	};
 
 	_winBuild( _janela );
-
-/*	var menu =  document.getElementById('dwindow');
-	headerWin = '<div class="message_header" style="width: 100%; heigth: 22px;"'+
-		' onselectstart="return false">'+
-		'<img align="right" alt="'+get_lang('close')+'" title="'+get_lang('close')+'" '+
-		'onclick="close_window()" src="'+templatePath+'/images/close.png">'+
-		get_lang('filemanager')+'</div>';
-	if (!menu){
-		menu = document.createElement('DIV');
-		menu.id = "dwindow";
-		menu.style.left = 200;
-		menu.style.width = "400px";
-		menu.style.top = DocY;
-		menu.className = 'menubox';
-		menu.style.zIndex='1';
-		menu.innerHTML = headerWin+htmlData;
-		document.getElementById('divAppbox').appendChild(menu);
-	}
-	else{
-		menu.innerHTML = headerWin+htmlData;
-		menu.style.visibility = 'visible';
-	}*/
-
-}
-
-function draw_menu(id,elements){
-	var menu = document.getElementById('menu_newFile'+id);
-	if (menu == null){
-		menu = document.createElement('DIV');
-		menu.id = "menu_newFile"+id;
-		menu.style.left = DocX;
-		menu.style.top = DocY;
-		for(j in elements)
-		{
-			var link = document.createElement( 'A' );
-			if (typeof(elements[j]['img']) != 'undefined'){
-				var img = document.createElement( 'IMG' );
-				img.src = elements[j]['img'];
-				link.appendChild(img);
-			}
-			link.href = elements[j]['url'];
-			link.appendChild( document.createTextNode( elements[j]['text'] ) );
-			menu.appendChild(link);
-			menu.appendChild(document.createElement( 'BR' ));
-		}
-
-		menu.onmouseout = function () { menuTimeout = setTimeout("document.getElementById('menu_newFile"+id+"').style.visibility = 'hidden'",50);}
-		menu.onmouseover = function () { clearTimeout(menuTimeout); };
-		menu.className = 'menubox';
-		menu.style.zIndex='1';
-		document.getElementById('divAppboxHeader').appendChild(menu);
-	}
-	menu.style.visibility = 'visible';
+	
+}
+
+function draw_menu()
+{
+	var _options	= arguments[0];
+	var _parent		= arguments[1];
+	var dt			= new Date();	
+	
+	if( showHidden == null )
+		showHidden = new ShowHidden( 200 );
+	
+	var _itens = "";
+		
+	for( var i in _options )
+	{
+		if( _options[i].constructor == Function )
+			continue;
+			
+		_itens += '<img src="' + _options[i][2] + '" '+ _options[i][3] +'/>';
+		_itens += '<a href='+_options[i][1]+' style="cursor:pointer; margin:3px;">' + _options[i][0] + '</a><br/>'
+	}
+
+	var _optionsItens 				= document.createElement("div");
+		_optionsItens.id			= "fastMenuFileManager" + dt.getTime();
+		_optionsItens.style.top		= _parent.style.top + "px";
+		_optionsItens.style.left	= ( _parent.style.left + 40 ) + "px";	
+		_optionsItens.className		= "x-menu";
+		_optionsItens.style.zIndex	= zIndex++;
+		_optionsItens.innerHTML		= _itens;
+		_optionsItens.onclick		= function(){ showHidden.hiddenObject(false); };
+		_optionsItens.onmouseout	= function(){ showHidden.hiddenObject(false); };
+		_optionsItens.onmouseover	= function(){ showHidden.hiddenObject(true); };	
+							  
+		showHidden.action('onmouseover', 'onmouseout', _optionsItens);
+
+	_parent.parentNode.appendChild( _optionsItens );
+	
 }
 
@@ -472,23 +464,26 @@
 	return filesUrl;
 }
-toolbar.prototype.control = function (arg)
+toolbar.prototype.control = function ()
 {
-	//Used to get button position
-	var button = document.getElementsByName(arg);
-	button = button[0];
-	switch (arg) {
+	var arg 	= arguments[0];
+	var _parent	= ( arguments[1] ) ? arguments[1] : null ; 
+	
+	switch ( arg )
+	{
 		case 'new':
-			elements = new Array();
-			elements[0] = { 'text': get_lang('empty file'),
-					'url': 'javascript:newEmptyFile()'};
-			elements[1] = new Array();
-			elements[1]['text'] = get_lang('File from model');
+			
 			address = document.location.toString();
 			address = address.split("?");
-			elements[1]['url'] = address[0]+"?menuaction=filemanager.uifilemanager.fileModels";
-			elements[2] = { 'text' : get_lang('Upload'),
-					'url': 'javascript:newUpload()'};
-			draw_menu(arg,elements);
-			break;
+			
+			var itens = [
+			             	[ get_lang('empty file'),'javascript:newEmptyFile()',templatePath+'images/group_close.gif', '' ],
+			             	[ get_lang('File from model'), address[0]+"?menuaction=filemanager.uifilemanager.fileModels", templatePath+'images/group_close.gif', '' ],
+			             	[ get_lang('Upload'), 'javascript:newUpload()', templatePath+'images/group_close.gif', '' ]
+			            ];
+			
+			draw_menu( itens, _parent );
+			
+			break;
+			
 		case 'rename':
 			var one_checked = false;
@@ -564,38 +559,31 @@
 				address = address.split("&");
 				code += "<a href=\"javascript:"+escape(arg)+"('"+folders[i]+"','"+filesUrl+"'); close_window();\">";
-				code+=folders[i]+"</a><br>";
+				code += folders[i]+"</a><br>";
 
 			}
 			DocY -= (folders.length*30);
 			draw_window(code);
-//			draw_menu(arg,elements);
-			break;
+
+			break;
+		
 		case 'reload':
+			
 			last_folder = last_folder ? last_folder : currentPath;
 			current_folder = current_folder ? current_folder : currentPath;
 			cExecute_('./index.php?menuaction=filemanager.uifilemanager.dir_ls&path='+base64_encode(currentPath)+'&criteria='+criteria+'&otype='+order_type+'&limit='+preferences.files_per_page+'&offset='+offset,folderList.drawFiles);
 			return;
+
 		case 'tools':
-			elements = new Array();
-			elements[0] = { 'text' : get_lang('Preferences'),
-					'url' : 'preferences/preferences.php?appname=filemanager',
-					'img' : templatePath+'images/preferences.png'};
-			elements[1] = { 'text' : get_lang('Search'),
-					'url' : 'javascript:document.getElementById("menu_newFiletools").style.visibility="hidden";\
-						document.getElementById("em_message_search").focus();',
-					'img' : templatePath+'images/search.gif'};
-			elements[2] = { 'text' : get_lang('Edit Folders'),
-					'url' : 'javascript:editFolders()',
-					'img' : templatePath+'images/button_createdir.png'};
-			elements[3] = { 'text' : get_lang('Share Folders'),
-					'url' : "./index.php?menuaction=preferences.uiaclprefs.index&acl_app=filemanager",
-					'img' : templatePath+'images/mime16_directory.png'};
-			elements[4] = { 'text' : get_lang('View'),
-					'url' : "javascript:EditColumns()",
-					'img' : templatePath+'images/editpaste.png'};
-			elements[5] = {'text' : get_lang('Archive'),
-					'url' : "javascript:toolbar.control('archive')",
-					'img' : templatePath+'images/button_zip.png'};
-			draw_menu(arg,elements);
+			
+			var itens = [
+			             	[ get_lang('Preferences'), 'preferences/preferences.php?appname=filemanager', templatePath+'images/preferences.png', 'width="16px" height="16px"' ],
+			             	[ get_lang('Edit Folders'), 'javascript:editFolders()', templatePath+'images/button_createdir.png', 'width="16px" height="16px"'],
+			             	[ get_lang('Share Folders'), './index.php?menuaction=preferences.uiaclprefs.index&acl_app=filemanager', templatePath+'images/mime16_directory.png', 'width="16px" height="16px"'],
+			             	[ get_lang('View'), 'javascript:EditColumns()', templatePath+'images/editpaste.png', 'width="16px" height="16px"' ],
+			             	[ get_lang('Archive'), 'javascript:toolbar.control("archive")', templatePath+'images/button_zip.png', 'width="16px" height="16px"' ]
+			            ];
+						
+			draw_menu( itens, _parent );
+			
 			break;
 		default:
@@ -603,7 +591,9 @@
 	}
 }
+
 var toolbar = new toolbar();
 
-function unarchive(filename){
+function unarchive(filename)
+{
 	password = crypt.encode(prompt(get_lang('Please, type archive password or leave it empty if it is not encrypted')));
 	if (password == null)
@@ -611,12 +601,17 @@
 	cExecute_('./index.php?menuaction=filemanager.vfs_functions.unarchive&pswd='+base64_encode(password)+'&path='+base64_encode(currentPath)+'&file='+base64_encode(filename),handler.archive);
 }
-function move_to(to,filesUrl){
+
+function move_to(to,filesUrl)
+{
 	cExecute_('./index.php?menuaction=filemanager.vfs_functions.moveto&from='+base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl,handler.moveto);
 }
-function copy_to(to,filesUrl){
+
+function copy_to(to,filesUrl)
+{
 	cExecute_('./index.php?menuaction=filemanager.vfs_functions.copyto&from='+base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl,handler.copyto);
 }
 
-function draw_card(type,name){
+function draw_card(type,name)
+{
 	clearTimeout(menuTimeout);
 	switch(type){
Index: /branches/2.2/filemanager/js/common_functions.js
===================================================================
--- /branches/2.2/filemanager/js/common_functions.js	(revision 3436)
+++ /branches/2.2/filemanager/js/common_functions.js	(revision 3569)
@@ -1,3 +1,7 @@
-function load(path,el){
+
+var Xtools	= null;
+
+function load(path,el)
+{
 	currentPath = path;
 	contentFolders = document.getElementById('content_folders');
@@ -16,9 +20,11 @@
 }
 
-function check(element){
+function check(element)
+{
 	element.firstChild.firstChild.checked = true;
 }
 
-function validateFileExtension(fileName){
+function validateFileExtension(fileName)
+{
 	var error_flag = false;
 	var fileExtension = fileName.split(".");
@@ -42,5 +48,6 @@
 }
 
-function get_lang(_key){
+function get_lang(_key)
+{
 	var key = _key.toLowerCase();
 	if(array_lang[key])
@@ -57,5 +64,6 @@
 
 
-function newEmptyFile(){
+function newEmptyFile()
+{
 	var name = prompt(get_lang('Enter with the name of new file/directory'), '');
 	var input_text = document.getElementById('newfile_or_dir');
@@ -74,5 +82,7 @@
 	}
 }
-function newUpload(data){
+
+function newUpload(data)
+{
 	if (data == null)
 	{
@@ -86,11 +96,17 @@
 	}
 }
-function newAdvancedUpload(){
+
+function newAdvancedUpload()
+{
 	for (i=0; i < navigator.plugins.length; i++)
-		if (navigator.plugins[i].name.match('Java')){
+	{
+		if (navigator.plugins[i].name.match('Java'))
+		{
 			close_window();
 			draw_window("<iframe width=\"515\" height=\"320\" src='/filemanager/inc/uploadApp.php?id="+parseInt(Math.random()*Math.pow(10,15))+"'></iframe>",530,345);
 			return;
 		}
+	}
+	
 	alert(get_lang("You do not have Java installed, plugin not loaded"));
 }
@@ -205,52 +221,77 @@
 }
 
-
-function EditColumns(param){
-	if (param == 'close')
-	{
-		var menu = document.getElementById('menu_col_pref');
-		menu.parentNode.removeChild(menu);
-		return;
-	}
-	if(param == 'save')
+function EditColumns( args )
+{
+	if( args == 'close' )
+	{
+		_winBuild("window_tools_view","remove");
+	}
+	else if( args == 'save')
 	{
 		var checkBoxes = document.getElementsByName('prefView');
-		var url="";
-		for (var i=0; i < checkBoxes.length; i++)
-		{
-			if (checkBoxes[i].checked)
+		
+		for ( var i = 0 ; i < checkBoxes.length; i++)
+		{
+			if( checkBoxes[i].checked === true )
 				preferences[checkBoxes[i].value] = '1';
 			else
 				preferences[checkBoxes[i].value] = '0';
 		}
+
 		cExecute_('./index.php?menuaction=filemanager.user.save_preferences&preferences='+base64_encode(serialize(preferences)),function () { toolbar.control('reload'); EditColumns('close'); });
-		return;
-	}
-	var checkList = (preferences['viewList'] == '1' ? 'checked="checked"': '');
-	var checkIcons = (preferences['viewIcons'] == '1' ? 'checked="checked"': '');
-	var typeHTML = '<input name="prefView" value="viewList" '+checkList+' type="radio">'+get_lang('view as list')+'<input name="prefView" '+checkIcons+' value="viewIcons" type="radio">'+get_lang('view as icons')+'<br>';
-	var check = function(type) { if (preferences[type] =='1') return 'checked'; else return '';};
-	var inputHTML = '<input name="prefView" type="checkbox" value="';
-	form = typeHTML+inputHTML+'mime_type" '+check('mime_type')+'>'+get_lang('type')+'<br>'+
-		inputHTML+'size" '+check('size')+'>'+get_lang('size')+'<br>'+
-		inputHTML+'created" '+check('created')+'>'+get_lang('created')+'<br>'+
-		inputHTML+'modified" '+check('modified')+'>'+get_lang('modified')+'<br>'+
-		inputHTML+'owner" '+check('owner')+'>'+get_lang('owner')+'<br>'+
-		inputHTML+'createdby_id" '+check('createdby_id')+'>'+get_lang('created by')+'<br>'+
-		inputHTML+'modifiedby_id" '+check('modifiedby_id')+'>'+get_lang('modified by')+'<br>'+
-	//	inputHTML+'application" '+check('application')+'>'+get_lang('application')+'<br>'+
-		inputHTML+'comment" '+check('comment')+'>'+get_lang('comment')+'<br>'+
-		inputHTML+'version" '+check('version')+'>'+get_lang('version')+'<br>'+
-		'<input value="'+get_lang('save')+'" onclick="EditColumns(\'save\')" type="button">&nbsp;'+
-		'<input value="'+get_lang('cancel')+'" onclick="EditColumns(\'close\')" type="button">';
-
-		menu = document.createElement('DIV');
-		menu.id = "menu_col_pref";
-		menu.style.left = "100px";
-		menu.style.top = "200px";
-		menu.className = 'menubox';
-		menu.style.zIndex='1';
-		menu.innerHTML = form;
-		document.getElementById('divAppboxHeader').appendChild(menu);
+	}
+	else
+	{
+		if( Xtools == null )
+			Xtools = new xtools( path_filemanager + "tp/expressowindow/" );
+	
+		var pTools = 
+		{
+			'checkList'	:	preferences['viewList'],	
+			'checkIcons':	preferences['viewIcons'],
+			'check_created'			: preferences['created'],
+			'check_createdby_id'	: preferences['createdby_id'],
+			'check_comment'			: preferences['comment'],
+			'check_mime_type'		: preferences['mime_type'],
+			'check_modified'		: preferences['modified'],
+			'check_modifiedby_id'	: preferences['modifiedby_id'],
+			'check_owner'			: preferences['owner'],
+			'check_size'			: preferences['size'],
+			'check_version'			: preferences['version'],
+			'lang_cancel'			: get_lang('cancel'),
+			'lang_created_by'		: get_lang('created by'),			
+			'lang_created'			: get_lang('created'),
+			'lang_comment'			: get_lang('comment'),
+			'lang_modified_by'		: get_lang('modified by'),
+			'lang_modified'			: get_lang('modified'),
+			'lang_owner'			: get_lang('owner'),
+			'lang_save'				: get_lang('save'),
+			'lang_size'				: get_lang('size'),
+			'lang_type'				: get_lang('type'),
+			'lang_version'			: get_lang('version'),
+			'lang_view_as_list'		: get_lang('view as list'),
+			'lang_view_as_icons'	: get_lang('view as icons'),
+			'onclickCancel'			: "EditColumns(\'close\')",
+			'onclickSave'			: "EditColumns(\'save\')"
+		}
+		
+		var winTools =
+		{	
+			 id_window		: "window_tools_view",
+			 width			: 250,
+			 height			: 290,
+			 top			: 100,
+			 left			: 400,
+			 draggable		: true,
+			 visible		: "display",
+			 resizable		: true,
+			 zindex			: zIndex++,
+			 title			: "Expresso FileManager - " + get_lang('View'),
+			 closeAction	: "remove",
+			 content		: Xtools.parse(Xtools.xml("view_config"), "view.xsl", pTools)	
+		};
+	
+		_winBuild( winTools );
+	}
 }
 
