Index: trunk/filemanager/js/jscode/main.js
===================================================================
--- trunk/filemanager/js/jscode/main.js	(revision 2610)
+++ trunk/filemanager/js/jscode/main.js	(revision 2610)
@@ -0,0 +1,2 @@
+
+
Index: trunk/filemanager/js/jscode/config.js
===================================================================
--- trunk/filemanager/js/jscode/config.js	(revision 2610)
+++ trunk/filemanager/js/jscode/config.js	(revision 2610)
@@ -0,0 +1,95 @@
+
+function loadq_handler(data){
+	document.getElementById('quota_size').value = data;
+}
+function load_quota(el){
+	cExecute_('index.php?menuaction=filemanager.uiconfig.load_quota&name='+base64_encode(el.value),loadq_handler);
+}
+
+function set_owner(){
+	var dirName = document.getElementById('search1').value;
+	var ownerName = document.getElementById('search2').value;
+	cExecute_('index.php?menuaction=filemanager.uiconfig.set_owner&dir='+base64_encode(dirName)+'&owner='+ownerName,alert);
+}
+
+function set_permission(){
+	var dirName = document.getElementById('search1').value;
+	var ownerName = document.getElementById('search2').value;
+	var perms=new Array("egw_private","egw_delete","egw_edit","egw_add","egw_read");
+	permission = 0;
+	for (val in perms)
+	{
+		permission = permission*2;
+		if(document.getElementById(perms[val]).checked)
+			permission += 1;
+	}
+
+	cExecute_('index.php?menuaction=filemanager.uiconfig.set_permission&dir='+base64_encode(dirName)+'&perms='+permission+'&owner='+ownerName,alert);
+}
+function save_quota(){
+	var dirName = document.getElementById('search1').value;
+	var Qsize = document.getElementById('quota_size').value;
+	cExecute_('index.php?menuaction=filemanager.uiconfig.update_quota&dir='+base64_encode(dirName)+'&val='+Qsize,alert);
+}
+function dir_handler(data){
+	document.getElementById('search1').innerHTML = data;
+}
+
+function user_handler(data){
+	document.getElementById('search2').innerHTML = data;
+}
+var timeO;
+function search_dir(el){
+	if (el.value.length < 4){
+		document.getElementById('span_searching1').innerHTML = get_lang('Type at least 4 chars');
+	}
+	else
+	{
+		document.getElementById('span_searching1').innerHTML = '';
+		if (timeO)
+			clearTimeout(timeO);
+		timeO = setTimeout('cExecute_(\'index.php?menuaction=filemanager.uiconfig.search_dir&name='+el.value+'\',dir_handler)',700);
+	}
+}
+function search_user(el){
+	if (el.value.length < 4){
+		document.getElementById('span_searching1').innerHTML = get_lang('Type at least 4 chars');
+	}
+	else
+	{
+		document.getElementById('span_searching1').innerHTML = '';
+		if (timeO)
+			clearTimeout(timeO);
+		timeO = setTimeout('cExecute_(\'index.php?menuaction=filemanager.uiconfig.search_user&name='+el.value+'\',user_handler)',700);
+	}
+}
+function delete_folder(){
+	var dirName = document.getElementById('search1').value;
+	var okToDel = confirm(get_lang('Are you sure you want to delete')+' '+dirName+'?');
+	if (okToDel){
+		var randNum = parseInt((Math.random()*100));
+		var okToDel = prompt(get_lang('Please type the text "%1" to delete',randNum)+': '+dirName);
+		if (okToDel == randNum)
+			cExecute_('index.php?menuaction=filemanager.uiconfig.removeFolder&dir='+base64_encode(dirName),alert);
+	}
+}
+
+function rename_folder(){
+	var dirName = document.getElementById('search1').value;
+	var toName = prompt(get_lang('Enter the name you want to move %1 to:',dirName),dirName);
+	if (toName.length > 1){
+			cExecute_('index.php?menuaction=filemanager.uiconfig.renameFolder&dir='+base64_encode(dirName)+'&to='+base64_encode(toName),alert);
+	}
+}
+
+function create_folder(){
+	var toName = prompt(get_lang('Enter the name of folder you want to create:'),'/home/');
+	if (toName.length > 1){
+		cExecute_('index.php?menuaction=filemanager.uiconfig.createFolder&name='+base64_encode(toName),alert);
+	}
+}
+
+function reconstruct_folder(){
+	var dirName = document.getElementById('search1').value;
+	cExecute_('index.php?menuaction=filemanager.uiconfig.reconstructFolder&dir='+base64_encode(dirName),alert);
+}
Index: trunk/filemanager/js/jscode/drag_area.js
===================================================================
--- trunk/filemanager/js/jscode/drag_area.js	(revision 2610)
+++ trunk/filemanager/js/jscode/drag_area.js	(revision 2610)
@@ -0,0 +1,70 @@
+var agt=navigator.userAgent.toLowerCase();
+var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
+
+function DragArea(){
+	this.pressed = 0;
+	this.resizing = 0;
+	this.dragEl;
+	this.endEvent;
+	this.operation;
+}
+
+document.onmousemove = function(event) {
+	getPointer(event);
+	if (_dragArea.operation == 'drag')
+		_dragArea.dragObj(event);
+	else
+		_dragArea.moveWindow(event);
+}
+document.onmousedown = function(event) {_dragArea.pressed = 1; };
+document.onmouseup = function(event) { _dragArea.pressed = 0 };
+
+counter = 0;
+DragArea.prototype.moveWindow = function(e) {
+	if (this.pressed){
+		var elem =  document.getElementById('dwindow'); // FIXME do not use getElement here
+		if (elem != null){
+		        var _event  = is_ie ? window.event : e;
+			elem.style.left = _event.clientX - 80 + "px";
+			elem.style.top = _event.clientY + "px";
+		}
+	}
+}
+
+DragArea.prototype.dragObj = function(e){
+        var _event  = is_ie ? window.event : e;
+	var _target = is_ie ? _event.srcElement : _event.target;
+
+	if (this.pressed)
+	{
+		var sign = document.getElementById('dragSign');
+		if (sign == null)
+		{
+			check(this.dragEl);
+			sign = document.createElement('SPAN');
+			sign.className = 'dragSign';
+			sign.id = 'dragSign';
+			document.body.appendChild(sign);
+		}
+		sign.innerHTML = get_lang("Drag and drop to move");
+		sign.style.left = (_event.clientX + 2) + "px";
+		sign.style.top = (_event.clientY + 2) + "px";
+		sign.style.position = 'absolute';
+	}
+	else{
+		this.operation = "";
+		var sign = document.getElementById('dragSign');
+		if (sign == null)
+			return;
+		sign.parentNode.removeChild(sign);
+		if(_target.tagName == 'SPAN'){
+			var filesUrl = toolbar.getCheckedFiles();
+			var path = _target.id.replace(/main$/g,'').substr(1);
+			if (filesUrl.length > 1 && path.length > 1)
+				move_to(path,filesUrl);
+		}
+	}
+}
+
+
+var _dragArea = new DragArea();
Index: trunk/filemanager/js/jscode/draw_api.js
===================================================================
--- trunk/filemanager/js/jscode/draw_api.js	(revision 2610)
+++ trunk/filemanager/js/jscode/draw_api.js	(revision 2610)
@@ -0,0 +1,779 @@
+var offset;
+
+function getPointer(e) {
+	if (is_ie) {
+		DocX = event.clientX + document.body.scrollLeft;
+		DocY = event.clientY + document.body.scrollTop;
+	} else {
+		DocX = e.pageX;
+		DocY = e.pageY;
+	}
+}
+
+function loadHistory(filename){
+	cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.history&file='+base64_encode(filename)+"&path="+base64_encode(currentPath),draw_window);
+}
+
+function loadPermissions(data){
+	var permission = parseInt(data);
+	var ACL_READ = 1;
+	var ACL_ADD = 2;
+	var ACL_EDIT = 4;
+	var ACL_DELETE = 8;
+	var ACL_PRIVATE = 16;
+
+	permissions['read']=(permission & ACL_READ);
+	permissions['add']=(permission & ACL_ADD);
+	permissions['edit']=(permission & ACL_EDIT);
+	permissions['delete']=(permission & ACL_DELETE);
+	permissions['private']=(permission & ACL_PRIVATE);
+	toolbar.load();
+}
+function close_window(){
+	var menu =  document.getElementById('dwindow');
+	if (menu != null)
+		menu.style.visibility = 'hidden'
+}
+function draw_window(htmlData){
+	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('tdAppbox').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 resizeDiv(){
+	defaultHeight = document.body.clientHeight ? document.body.clientHeight : document.body.offsetHeight;
+	document.getElementById('fmFileWindow').style.height = defaultHeight-170;
+	document.getElementById('content_folders').style.height = defaultHeight - (is_ie ? 230 : 215);
+
+}
+var headerMsgLock = false;
+var labelBefore = "";
+function write_msg (message){
+	connector.hideProgressBar();
+	if (headerMsgLock){
+		setTimeout('write_msg("'+message+'");', 300);
+		return;
+	}
+	headerMsgLock = true;
+        headerDiv = document.getElementById("main_title");
+        labelBefore = headerDiv.innerHTML;
+        headerDiv.innerHTML = '<table width=100% cellspacing="0" cellpadding="0" border="0"><tbody><tr><th width="40%"></th><th noWrap class="action_info_th">'+message+'</th><th width="40%"></th></tr></tbody></table>';
+        setTimeout('headerMsgLock = false; document.getElementById("main_title").innerHTML = labelBefore;', 3000);
+}
+
+function write_error (message){
+	connector.hideProgressBar();
+	if (headerMsgLock){
+		setTimeout('write_error("'+message+'");', 300);
+		return;
+	}
+	headerMsgLock = true;
+	headerDiv = document.getElementById("main_title");
+	labelBefore = headerDiv.innerHTML;
+	headerDiv.innerHTML = '<table width=100% cellspacing="0" cellpadding="0" border="0"><tbody><tr><th width="40%"></th><th noWrap class="action_error_th">'+message+'</th><th width="40%"></th></tr></tbody></table>';
+	setTimeout('headerMsgLock = false; document.getElementById("main_title").innerHTML = labelBefore;', 3000);
+}
+
+function displayMessages(){
+	var messages = document.getElementById("allMessages");
+
+	for (i=0; i < messages.childNodes.length; i++){
+		if (messages.childNodes[i].innerHTML.indexOf(get_lang('Error:')) == 0)
+			write_error(messages.childNodes[i].innerHTML);
+		else
+			write_msg(messages.childNodes[i].innerHTML);
+	}
+}
+
+function loadPreferences(){
+	preferencesEl = document.getElementById('userPreferences');
+	preferences = unserialize(preferencesEl.value);
+	preferencesEl.parentNode.removeChild(preferencesEl);
+}
+function reloadFiles(newCriteria){
+	if (newCriteria == criteria)
+		order_type = (order_type=='1'?'0':'1')
+	else
+		criteria = newCriteria;
+	toolbar.control('reload');
+}
+
+function initDrawApi(){
+	SecEl = document.getElementById('userKey');
+	crypt = new crypt(SecEl.value);
+	SecEl.parentNode.removeChild(SecEl);
+
+	loadPreferences();
+	preferences.files_per_page = (preferences.files_per_page != undefined) ? preferences.files_per_page : 10;
+	offset = (current_page-1)*preferences.files_per_page;
+
+	currentPath = document.getElementById('currentPath').value;
+	document.getElementById('divAppboxHeader').innerHTML = title_app;
+	displayMessages();
+	resizeDiv();
+	window.onresize = resizeDiv;
+	document.body.style.overflow = "hidden";
+	cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.get_folders_list',handler.draw_folders_list);
+}
+
+function folderList(){
+	this.td = '<td style="padding-left: 2px; padding-right: 2px;" valign="middle">';
+}
+folderList.prototype.init = function(){
+	this.element = document.getElementById('fmFileWindow');
+}
+folderList.prototype.clear = function(){
+	this.element.innerHTML = "";
+}
+
+folderList.prototype.drawSearch = function(data){
+	var fl = folderList;
+	var files = unserialize(data);
+	if (files == null)
+	{
+		alert(get_lang('No results found'));
+		return
+	}
+	toolbar.clear();
+	fl.init();
+	fl.clear();
+	var newpage;
+	var sp_hd = '<span name="head" style="cursor: pointer; cursor: hand;"';
+	var sp_tl = '</span></td>';
+	newpage = '<table cellspacing="0" cellpadding="2" width="100%"><tbody><tr class="message_header">';
+	newpage += fl.td+'<input onclick="selectAll(this)" type="checkbox"></td><td></td><td></td>';
+	newpage += fl.td+sp_hd+' id="name">'+get_lang('file name')+sp_tl;
+	newpage += fl.td+sp_hd+' id="folder">'+get_lang('folder')+sp_tl;
+    	if (preferences.mime_type =='1')
+		newpage += fl.td+sp_hd+' id="mime_type">'+get_lang('mime type')+sp_tl;
+	if (preferences.size =='1')
+		newpage += fl.td+sp_hd+' id="size">'+get_lang('size')+'</a>'+sp_tl;
+	if (preferences.created =='1')
+		newpage += fl.td+sp_hd+' id="created">'+get_lang('created')+'</a>'+sp_tl;
+	if (preferences.modified =='1')
+		newpage += fl.td+sp_hd+' id="modified">'+get_lang('modified')+'</a>'+sp_tl;
+	if (preferences.createdby_id =='1')
+		newpage += fl.td+sp_hd+' id="createdby_id">'+get_lang('created by')+'</a>'+sp_tl;
+	if (preferences.modifiedby_id =='1')
+		newpage += fl.td+sp_hd+' id="modifiedby_id">'+get_lang('modified by')+'</a>'+sp_tl;
+	if (preferences.comment =='1')
+		newpage += fl.td+sp_hd+' id="comment">'+get_lang('comment')+'</a>'+sp_tl;
+	if (preferences.version =='1') newpage += fl.td+sp_hd+' id="version">'+get_lang('version')+'</a>'+sp_tl+'</tr>';
+
+	for (var i=0; i < files.length; i++)
+	{
+		newpage += '<tr>'+fl.td;
+		newpage += '<input name="fileman" value="'+files[i].name+'" type="checkbox"></td>';
+		newpage += '<td></td><td></td>';
+		newpage += fl.td+'<img src="'+files[i].icon+'">';
+		newpage += '<a id="name_'+files[i].name+'" href="' + URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.view&file='+base64_encode(files[i].name)+'&path='+base64_encode(files[i].directory)+'" target="_blank">'+files[i].name+'</a>&nbsp;</td>';
+		newpage += fl.td+files[i].directory+'</td>';
+		if (preferences.mime_type =='1') newpage += fl.td+files[i].mime_type+'</td>';
+		if (preferences.size =='1') newpage += fl.td+borkb(files[i].size)+'</td>';
+		if (preferences.created =='1') newpage += fl.td+files[i].created+'</td>';
+		if (preferences.modified =='1') newpage += fl.td+files[i].modified+'</td>';
+		if (preferences.createdby_id =='1') newpage += fl.td+files[i].createdby_id+'</td>';
+		if (preferences.modifiedby_id =='1') newpage += fl.td+files[i].modifiedby_id+'</td>';
+		if (preferences.comment =='1') newpage += fl.td+'<span id="'+files[i].name+'">'+files[i].comment+'</span></td>';
+		if (preferences.version =='1') newpage += fl.td+'<span>'+files[i].version+'</span></td></tr>';
+
+	}
+	fl.element.innerHTML = newpage;
+	fl.drawStripes();
+}
+folderList.prototype.createLine = function(file){
+		var fl = folderList;
+		retBuff = '<tr id="line_'+file.name+'" onmouseout="clearTimeout(menuTimeout)" onmousedown="_dragArea.dragEl=this;_dragArea.operation=\'drag\'">';
+		retBuff += fl.td;
+		retBuff += '<input name="fileman" value="'+file.name+'" type="checkbox"></td>';
+		if (permissions['private']) {
+			retBuff += '<td><div id="restrict_'+file.name+'" onclick="setRestricted(\''+file.name+'\')" ';
+                        retBuff += 'style="background-image:url('+templatePath+'images/button_'+(file.pub == '1'?'lock':'unlock')+'.png);background-repeat: repeat-none;width:15px;height:12px;"></div></td>';
+		}
+		else
+			retBuff += '<td></td>';
+
+		switch (file.mime_type)
+		{
+			case 'text/html':
+				retBuff += '<td><a href="' + URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.export&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'"><div class="exportButton" alt="'+get_lang('export')+'" title="'+get_lang('export')+'"></div></a></td>';
+				break;
+			case 'application/zip':
+				retBuff += '<td><div class="exportButton" onclick="unarchive(\''+file.name+'\')" alt="'+get_lang('unarchive')+'" title="'+get_lang('unarchive')+'"></a></td>'
+				break;
+			default:
+				retBuff += '<td></td>';
+		}
+		retBuff += fl.td+'<div style="background-image:url('+(file.icon)+'); background-repeat: no-repeat; height:16px; padding-left: 18px; overflow: hidden;">';
+		if((file.mime_type).toUpperCase().indexOf('IMAGE') == 0)
+			var mousefunc = 'draw_card(\'preview\',\''+file.name+'\')'
+		else
+			var mousefunc = 'hide_card()';
+		retBuff += '<a onmouseover="'+mousefunc+'" id="name_'+file.name+'" href="' + URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.view&file='+base64_encode(file.name)+'&path='+base64_encode(currentPath)+'" target="_blank">'+file.name+'</a></div></td>';
+		if (preferences.mime_type =='1') retBuff += fl.td+file.mime_type+'</td>';
+		if (preferences.size =='1') retBuff += fl.td+borkb(file.size)+'</td>';
+		var now = new Date();
+		var midnight = Date.parse(now.toDateString());
+		var dtString = "";
+		if (preferences.created =='1') {
+			var created = new Date();
+			created.setTime(file.created*1000);
+			if (created.getTime() > midnight)
+				if (created.getMinutes() < 10 )
+					dtString = created.getHours()+":0"+created.getMinutes();
+				else
+					dtString = created.getHours()+":"+created.getMinutes();
+			else {
+				dtString = (created.getDate() < 10) ? "0"+created.getDate()+"/" : created.getDate()+"/";
+				dtString += (created.getMonth() < 9) ? "0" : "";
+				dtString += (created.getMonth()+1)+"/"+created.getFullYear();
+			}
+			retBuff += fl.td+dtString+'</td>';
+		}
+		if (preferences.modified =='1'){
+			var modified = new Date();
+			modified.setTime(file.modified*1000);
+			if (file.modified != "")
+				if (modified.getTime() > midnight)
+	                                if (modified.getMinutes() < 10)
+        	                                dtString = modified.getHours()+":0"+modified.getMinutes();
+                	                else
+						dtString = modified.getHours()+":"+modified.getMinutes();
+				else {
+	                                dtString = (modified.getDate() < 10) ? "0"+modified.getDate()+"/" : modified.getDate()+"/";
+        	                        dtString += (modified.getMonth() < 9) ? "0" : "";
+                	                dtString += (modified.getMonth()+1)+"/"+modified.getFullYear();
+				}
+			else
+				dtString = "";
+			retBuff += fl.td+dtString+'</td>';
+		}
+		if (preferences.owner =='1'){
+			retBuff += fl.td;
+			retBuff += '<div onmouseover="draw_card(\'user\',\''+file.owner+'\')">'+file.owner+'</div></td>';
+		}
+		if (preferences.createdby_id =='1'){
+			retBuff += fl.td;
+			retBuff += '<div onmouseover="draw_card(\'user\',\''+file.createdby_id+'\')">'+file.createdby_id+'</div></td>';
+		}
+		if (preferences.modifiedby_id =='1'){
+			retBuff += fl.td;
+			retBuff += '<div onmouseover="draw_card(\'user\',\''+file.modifiedby_id+'\')">'+file.modifiedby_id+'</div></td>';
+		}
+		if (preferences.comment =='1') retBuff += fl.td+'<input id="'+file.name+'" class="inputComment" onkeydown="enterComments(event,this)" onclick="presetComments(this)" onblur="setComments(this)" value="'+(file.comment==null?'':file.comment)+'" alt="'+get_lang('Click to change comments')+'" title="'+get_lang('Click to change comments')+'"></input></td>';
+		if (preferences.version =='1') retBuff += fl.td+'<span onclick="loadHistory(\''+file.name+'\')">'+file.version+'</span></td>';
+		retBuff += "</tr>";
+		return retBuff;
+}
+folderList.prototype.updateQuota = function(quotaSize,usedSpace){
+	if (parseInt(quotaSize) != 0){
+		var contentQuota = document.getElementById('content_quota');
+		if (contentQuota != null)
+			contentQuota.innerHTML = '<table width="102" cellspacing="0" cellpadding="0" border="0" id="table_quota"><tbody><tr><td width="102" nowrap="true" height="15" background="' + URL_SERVER + '/phpgwapi/templates/default/images/dsunused.gif"><table cellspacing="0" cellpadding="0" border="0" style="width: '+parseInt((usedSpace/quotaSize)*100)+'%;"><tbody><tr><td height="15" class="dsused"/></tr></tbody></table></td><td nowrap="true" align="center"><span class="boxHeaderText">'+parseInt(usedSpace/quotaSize*100)+'% ('+borkb(usedSpace)+'/'+borkb(quotaSize)+')</span></td></tr></tbody></table></td></tr></table>';
+	}
+}
+folderList.prototype.drawFiles = function(data){
+	var fl = folderList;
+	var returnData = unserialize(data);
+	loadPermissions(returnData.permissions);
+	var files = returnData.files;
+	draw_paging(returnData.files_count,data);
+	fl.init();
+	fl.clear();
+	var newpage = '';
+	if (preferences.viewIcons == 1){
+		for (var i = 0; i < files.length; i++)
+		{
+			newicon = '<div class="icon">';
+			newicon += '<a href="' + URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.view&file='+base64_encode(files[i].name)+'&path='+base64_encode(currentPath)+'" target="_blank">';
+			newicon += '<div style="width:64; height:64; background-image:url('+files[i].icon+'); background-repeat: no-repeat;"></div>';
+			newicon += '<span class="iconCaption">'+files[i].name+'</span>';
+			newicon += '</a></div>';
+			newpage += newicon;
+		}
+
+		fl.element.innerHTML = newpage;
+	}
+	else
+	{
+		var sp_hd = '<span name="head" style="cursor: pointer; cursor: hand;" onclick="reloadFiles(\'';
+		var sp_tl = '</span></td>';
+		newpage = '<table cellspacing="0" cellpadding="2" width="100%"><tbody><tr class="message_header">';
+		newpage += fl.td+'<input onclick="selectAll(this)" type="checkbox"></td><td></td><td></td>';
+		newpage += fl.td+sp_hd+'name\')" id="name">'+get_lang('file name')+sp_tl;
+		if (preferences.mime_type =='1')
+			newpage += fl.td+sp_hd+'mime_type\')" id="mime_type">'+get_lang('mime type')+sp_tl;
+		if (preferences.size =='1')
+			newpage += fl.td+sp_hd+'size\')" id="size">'+get_lang('size')+'</a>'+sp_tl;
+		if (preferences.created =='1')
+			newpage += fl.td+sp_hd+'created\')" id="created">'+get_lang('created')+'</a>'+sp_tl;
+		if (preferences.modified =='1')
+			newpage += fl.td+sp_hd+'modified\')" id="modified">'+get_lang('modified')+'</a>'+sp_tl;
+		if (preferences.owner =='1')
+			newpage += fl.td+sp_hd+'owner\')" id="owner">'+get_lang('owner')+'</a>'+sp_tl;
+		if (preferences.createdby_id =='1')
+			newpage += fl.td+sp_hd+'createdby_id\')" id="createdby_id">'+get_lang('created by')+'</a>'+sp_tl;
+		if (preferences.modifiedby_id =='1')
+			newpage += fl.td+sp_hd+'modifiedby_id\')" id="modifiedby_id">'+get_lang('modified by')+'</a>'+sp_tl;
+		if (preferences.comment =='1')
+			newpage += fl.td+sp_hd+'comment\')" id="comment">'+get_lang('comment')+'</a>'+sp_tl;
+		if (preferences.version =='1') newpage += fl.td+sp_hd+'version\')" id="version">'+get_lang('version')+'</a>'+sp_tl+'</tr>';
+		if (files != null)
+			for (var i = 0; i < files.length; i++)
+			{
+				newpage += fl.createLine(files[i]);
+			}
+		else
+			newpage = "<b>"+get_lang('no files in this directory.')+"</b>";
+		fl.element.innerHTML = newpage;
+		header = document.getElementsByName('head');
+		for (var i=0; i < header.length; i++)
+		{
+			if (header[i].id == criteria){
+				header[i].style.fontWeight = 'bold';
+				arrow = document.createElement('IMG');
+				if (order_type == '1')
+					arrow.src = templatePath+'images/arrow_ascendant.gif';
+				else
+					arrow.src = templatePath+'images/arrow_descendant.gif';
+				header[i].appendChild(arrow);
+			}
+		}
+		fl.drawStripes();
+	}
+	folderList.updateQuota(returnData.quota.quotaSize,returnData.quota.usedSpace);
+}
+folderList.prototype.drawStripes = function(){
+	var classTr = "tr_msg_read";
+	folderList.init();
+	var elements = folderList.element.firstChild.firstChild.childNodes;
+	for (var i = 1; i < elements.length; i++){
+		elements[i].className = classTr;
+		classTr = (classTr == "tr_msg_read"?"tr_msg_read2":"tr_msg_read");
+	}
+}
+var folderList = new folderList();
+
+function toolbar()
+{
+	var element;
+}
+toolbar.prototype.clear = function (){
+	this.element.innerHTML = "";
+}
+toolbar.prototype.load = function (){
+	this.element = document.getElementById('fmMenu');
+	if (permissions['read'] == 0){
+		this.element.innerHTML = "";
+		return;
+	}
+	var pageContent = '<table><tbody><tr>';
+	var createButton = function(name) { return '<td name="'+name+'" class="toolButton" onclick="toolbar.control(\''+name+'\');" title="'+name+'"><img src="'+templatePath+'images/button_'+name+'.png" alt="'+name+'"><small>'+get_lang(name.replace('_',' '))+'</small></td>'; }
+
+	if (permissions['edit'] != 0){
+		pageContent += createButton('edit');
+		pageContent += createButton('rename');
+	}
+	if (permissions['delete'] != 0){
+		pageContent += createButton('delete');
+		pageContent += createButton('move_to');
+	}
+	pageContent += createButton('copy_to');
+
+	this.element.innerHTML = pageContent+'</tr></tbody></table>';
+
+}
+toolbar.prototype.getCheckedFiles = function () {
+	filesUrl = "";
+	var one_checked = false;
+	files=document.getElementsByName('fileman');
+	var j=0;
+	for (i = 0; i <  files.length; i++)
+		if (files[i].checked){
+			one_checked = true;
+			filesUrl += "&fileman["+j+"]="+base64_encode(files[i].value);
+			j++;
+		}
+	if (!one_checked)
+	{
+		write_msg(get_lang('Please select a file'));
+		return;
+	}
+	return filesUrl;
+}
+toolbar.prototype.control = function (arg)
+{
+	//Used to get button position
+	var button = document.getElementsByName(arg);
+	button = button[0];
+	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;
+		case 'rename':
+			var one_checked = false;
+			files=document.getElementsByName('fileman');
+			for (i = 0; i <  files.length; i++)
+				if (files[i].checked){
+					one_checked = true;
+					files[i].checked = false;
+					var nameLink = document.getElementById('name_'+files[i].value);
+					var inputName = document.createElement('INPUT');
+					inputName.id = 'input_'+files[i].value;
+					var filename = nameLink.innerHTML;
+					inputName.value = filename;
+					inputName.onclick = function () { oldValue = inputName.value; }
+					inputName.onblur = function () { if (inputName.value == oldValue) handler.rename(); else cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.rename&file='+base64_encode(this.id.substr(6))+'&to='+base64_encode(this.value)+"&path="+base64_encode(currentPath),handler.rename) };
+					inputName.onkeydown=function (event) {if (event.keyCode == KEY_ENTER) this.blur(); };
+					nameLink.parentNode.appendChild(inputName);
+					nameLink.parentNode.removeChild(nameLink);
+				}
+			if (!one_checked)
+				write_msg(get_lang('Please select a file'));
+			break;
+		case 'edit':
+			var one_checked = false;
+			files=document.getElementsByName('fileman');
+			for (i = 0; i <  files.length; i++)
+				if (files[i].checked){
+					one_checked = true;
+					var filename=files[i].value;
+				}
+			if (one_checked){
+				address = document.location.toString();
+				address = address.split("&");
+				document.location = URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.index&'+arg+".x=1&filename="+base64_encode(filename)+".&path="+base64_encode(currentPath);
+			}
+			else
+			{
+				write_msg(get_lang('Please select a file'));
+				return;
+			}
+			break;
+		case 'delete':
+			var filesUrl = this.getCheckedFiles();
+			cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.delete&path='+
+					base64_encode(currentPath)+filesUrl,handler.del);
+			break;
+		case 'archive':
+			var filesUrl = this.getCheckedFiles();
+			password = prompt(get_lang('Please, type a strong password (suggestion: at least 8 characters, letters and numbers) or leave it empty to archive only'));
+			if (password == null)
+				return;
+			if (password.length > 0)
+			{
+				password2 = prompt(get_lang('Please, retype your password'));
+				if (password != password2)
+				{
+					alert(get_lang('Error:')+get_lang('passwords are differents'));
+					return;
+				}
+			}
+			var pswd = crypt.encode(password);
+			cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.archive&pswd='+base64_encode(pswd.toString())+'&path='+base64_encode(currentPath)+filesUrl,handler.archive);
+			break;
+		case 'move_to':
+		case 'copy_to':
+			 var filesUrl = this.getCheckedFiles();
+			 var elements = new Array();
+			for(i=0; i< folders.length; i++)
+			{
+				elements[i] = new Array();
+				elements[i]['text']=folders[i];
+				address = document.location.toString();
+				address = address.split("&");
+				elements[i]['url'] = "javascript:"+escape(arg)+"('"+folders[i]+"','"+filesUrl+"')";
+			}
+			draw_menu(arg,elements);
+			break;
+		case 'reload':
+			last_folder = last_folder ? last_folder : currentPath;
+			current_folder = current_folder ? current_folder : currentPath;
+			cExecute_( URL_SERVER  + '/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' : URL_SERVER + '/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' : URL_SERVER + "/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);
+			break;
+		default:
+			return;
+	}
+}
+var toolbar = new toolbar();
+
+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)
+		return;
+	cExecute_( URL_SERVER + '/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){
+	cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.moveto&from='+base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl,handler.moveto);
+}
+function copy_to(to,filesUrl){
+	cExecute_(URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.copyto&from='+base64_encode(currentPath)+'&to='+base64_encode(to)+filesUrl,handler.copyto);
+}
+
+function draw_card(type,name){
+	clearTimeout(menuTimeout);
+	switch(type){
+		case 'preview':
+			var url = URL_SERVER + '/index.php?menuaction=filemanager.vfs_functions.summary&file='+base64_encode(name)+"&path="+base64_encode(currentPath);
+			var htmlData = '<img src=\"'+url+'\">';
+			menuTimeout = setTimeout("draw_window_card(\'"+htmlData+"\')",500);
+			break;
+		case 'user':
+			var url = URL_SERVER + '/index.php?menuaction=filemanager.user.card&lid='+base64_encode(name);
+			menuTimeout = setTimeout("cExecute_('"+url+"',draw_window_card)",500);
+			break;
+		default:
+			break;
+	}
+
+}
+function editFolders(operation){
+	if (operation == 'new'){
+		var name = prompt(get_lang('Enter with the name of new file/directory'), '');
+		if (name != null && name != '')
+		{
+			var parentDir = document.getElementById('folders_box').value;
+			cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.createdir&path='+base64_encode(parentDir)+'&filename='+base64_encode(name),handler.refreshDir);
+			currentPath = parentDir+'/'+name;
+			close_window();
+		}
+	}
+	else
+		if (operation == 'remove'){
+			var Dfolder = document.getElementById('folders_box').value;
+			if (confirm(get_lang('Do you really want to remove folder: %1?',Dfolder), ''))
+			{
+				cExecute_( URL_SERVER + '/index.php?menuaction=filemanager.uifilemanager.removedir&path='+base64_encode(crypt.encode(Dfolder)),handler.refreshDir);
+				var lastIndex = Dfolder.lastIndexOf('/');
+				currentPath = Dfolder.substr(0,lastIndex);
+				close_window();
+			}
+		}
+		else{
+			var buf = "<select id='folders_box'>";
+			for (var i=0; i < folders.length; i++)
+				buf += "<option value='"+folders[i]+"'>"+folders[i]+"</option>";
+			buf += "</select>";
+			code = "<table><tbody><tr><td>"+buf+"</td></tr><tr><td><input type='button' onclick='editFolders(\"new\")' value='"+get_lang('new folder')+"'></td><td><input type='button' onclick='editFolders(\"remove\")' value='"+get_lang('remove folder')+"'></td></tr></tbody></table>";
+			draw_window(code);
+		}
+}
+
+function draw_window_card(content){
+	var menu = document.getElementById('menu_newFile');
+	if (menu == null){
+		menu = document.createElement('DIV');
+		menu.className = 'menubox';
+		menu.id = "menu_newFile";
+		menu.style.left = DocX;
+		menu.style.top = (DocY+20)+"px";
+		menu.width = "100%";
+		menu.onmouseout = function () { menuTimeout = setTimeout("hide_card()",50);}
+		menu.onmouseover = function () { clearTimeout(menuTimeout); };
+		menu.style.zIndex='1';
+		document.getElementById('tdAppbox').appendChild(menu);
+	}
+	else
+	{
+		menu.style.left = DocX;
+		menu.style.top = (DocY+20)+"px";
+	}
+	menu.innerHTML = content;
+
+	menu.style.visibility = 'visible';
+	clearTimeout(menuTimeout);
+	menuTimeout = setTimeout("hide_card()",4000);
+}
+function hide_card(){
+	var e=document.getElementById('menu_newFile');
+	if (e!=null)
+		e.style.visibility = 'hidden';
+}
+
+function draw_paging(num_files,data){
+        num_files = parseInt(num_files);
+        total_pages = 1;
+
+        if(last_folder != current_folder){
+                lastPage = 1;
+                current_page = 1;
+                last_folder = current_folder;
+        }
+
+        if(num_files > parseInt(preferences.files_per_page)) {
+                total_pages = parseInt(num_files/preferences.files_per_page);
+                if((num_files/preferences.files_per_page) > total_pages)
+                        total_pages++;
+        }
+
+        if(total_pages == 1) {
+                if(span_paging = document.getElementById("span_paging")) {
+                        span_paging.parentNode.removeChild(span_paging);
+                }
+                return;
+        }
+
+        span_paging = document.getElementById("span_paging");
+        if(!span_paging){
+                span_paging = document.createElement("DIV");
+                span_paging.id = "span_paging";
+                span_paging.className = "boxHeaderText";
+                span_paging.align="right";
+                document.getElementById("div_menu_c3").appendChild(span_paging);
+        }
+        span_paging.style.width="100%";
+        span_paging.innerHTML="";
+        files_range_begin = 1;
+        files_range_end = preferences.files_per_page;
+        if(current_page != 1) {
+                lnk_page = document.createElement("A");
+                lnk_page.setAttribute("href", "javascript:current_page=1;offset=0;toolbar.control('reload');");
+        }
+        else {
+                lnk_page = document.createElement("SPAN");
+        }
+        span_paging.appendChild(lnk_page);
+
+        lnk_page.innerHTML = "&lt;&lt;";
+        lnk_page.title = get_lang("First");
+        span_paging.innerHTML += "&nbsp;";
+
+        if(current_page == lastPage + numPages)
+                lastPage = current_page - 1;
+        else if((lastPage != 1 && lastPage == current_page) || current_page == total_pages)
+                lastPage = current_page - (numPages - 1);
+        else if(current_page == 1)
+                lastPage = 1;
+
+        if(lastPage < 1)
+                lastPage = 1;
+        else if(lastPage > 1 && (lastPage > (total_pages -(numPages - 1))))
+                lastPage = total_pages -(numPages - 1);
+
+        var     hasMarked = false;
+
+        for(i = lastPage; i <= total_pages; i++) {
+
+                if(current_page == i || (i == total_pages && !hasMarked)) {
+                        lnk_page = document.createElement("SPAN");
+                        span_paging.appendChild(lnk_page);
+                        lnk_page.innerHTML = "&nbsp;<b>"+i+"</b>&nbsp;";
+                        hasMarked = true;
+                        continue;
+                }
+                else{
+                        lnk_page = document.createElement("A");
+                        span_paging.appendChild(lnk_page);
+                        files_range_begin = ((i*preferences.files_per_page)-(preferences.files_per_page-1));
+                        files_range_end = (i*preferences.files_per_page);
+                        lnk_page.setAttribute("href", "javascript:current_page="+i+";offset=((current_page-1)*preferences.files_per_page);toolbar.control('reload');");
+               }
+
+                lnk_page.innerHTML = "&nbsp;...&nbsp;";
+
+                if(i == (lastPage + numPages))
+                                break;
+                else if(lastPage == 1 || i != lastPage)
+                        lnk_page.innerHTML = "&nbsp;"+i+"&nbsp;";
+
+                span_paging.innerHTML += "&nbsp;";                                                                            
+        }
+
+        if(current_page != total_pages) {
+                lnk_page = document.createElement("A");
+                files_range_begin = ((total_pages*preferences.files_per_page)-(preferences.files_per_page-1));
+                files_range_end = (total_pages*preferences.files_per_page);
+                lnk_page.setAttribute("href", "javascript:current_page="+total_pages+";offset=((current_page-1)*preferences.files_per_page);toolbar.control('reload');");
+	}
+        else {
+                lnk_page = document.createElement("SPAN");
+        }
+        span_paging.innerHTML += "&nbsp;";
+        span_paging.appendChild(lnk_page);
+
+        lnk_page.title = get_lang("Last");
+        lnk_page.innerHTML = "&gt;&gt;";
+}
+
Index: trunk/filemanager/js/jscode/connector.js
===================================================================
--- trunk/filemanager/js/jscode/connector.js	(revision 2610)
+++ trunk/filemanager/js/jscode/connector.js	(revision 2610)
@@ -0,0 +1,338 @@
+var progressBar;
+
+if (document.all)
+{
+	navigator.userAgent.toLowerCase().indexOf('msie 5') != -1 ? is_ie5 = true : is_ie5 = false;
+	is_ie = true;
+	is_moz1_6 = false;
+	is_mozilla = false;
+	is_ns4 = false;
+}
+else if (document.getElementById)
+{
+	navigator.userAgent.toLowerCase().match('mozilla.*rv[:]1\.6.*gecko') ? is_moz1_6 = true : is_moz1_6 = false;
+	is_ie = false;
+	is_ie5 = false;
+	is_mozilla = true;
+	is_ns4 = false;
+}
+else if (document.layers)
+{
+	is_ie = false;
+	is_ie5 = false
+	is_moz1_6 = false;
+	is_mozilla = false;
+	is_ns4 = true;
+}
+
+/****************************************** Connector Class *************************************************/
+// Constructor
+function cConnector()
+{
+	this.requests = new Array();
+	this.oxmlhttp = null;
+	this.isVisibleBar = false;
+	this.tid = 0;
+	this.progressBar = null;
+	this.oldX = 0;
+	this.oldY = 0;
+	this.updateVersion = "";
+}
+cConnector.prototype.buildBar = function()
+{
+	var div = document.getElementById('divProgressBar');
+
+	if(! div) {
+		div = document.createElement("DIV");
+		//div.style.visibility	= "hidden";
+		div.style.width = "103px";
+		div.id = 'divProgressBar';
+		div.align = "center";
+		div.innerHTML = '&nbsp;&nbsp;<font face="Verdana" size="2" color="WHITE">'+get_lang('loading')+'...</font>&nbsp;';
+		div.style.background = "#cc4444";
+		div.style.position = 'fixed';
+		div.style.top = '0px';
+		div.style.right = '0px';
+		document.getElementById('divAppboxHeader').appendChild(div);
+
+		if(is_ie) {
+			var elem = document.all[div.id];
+			elem.style.position="absolute";
+			var root = document.body;
+			var posX = elem.offsetLeft-root.scrollLeft;
+			var posY = elem.offsetTop-root.scrollTop;
+			root.onscroll = function() {
+				elem.style.right = '0px';
+				elem.style.top = (posY + root.scrollTop) + "px";
+			};
+		}
+	}
+}
+
+cConnector.prototype.hideProgressBar = function ()
+{
+	var div = document.getElementById('divProgressBar');
+	if (div != null)
+		div.style.visibility = 'hidden';
+	else
+		setTimeout('connector.hideProgressBar()',100);
+	this.isVisibleBar = false;
+}
+
+cConnector.prototype.showProgressBar = function(){
+	var div = document.getElementById('divProgressBar');
+	if (! div){
+		connector.buildBar();
+		return;
+	}
+
+	div.style.visibility = 'visible';
+
+	this.isVisibleBar = true;
+}
+
+	function XMLTools()
+	{
+		this.path = "";
+	}
+var connector = new cConnector();
+
+function cExecuteForm_(form, handler){
+	connector.showProgressBar();
+	if(! (divUpload = document.getElementById('divUpload'))) {
+		divUpload               = document.createElement('DIV');                
+		divUpload.id    = 'divUpload';
+		document.body.appendChild(divUpload);
+	}
+
+	handlerExecuteForm = handler;
+	var form_handler = function (data){
+		handlerExecuteForm(data);
+		handlerExecuteForm = null;
+	}
+	divUpload.innerHTML= "<iframe onload=\"connector.hideProgressBar();cExecute_('./index.php/index.php?menuaction=filemanager.uifilemanager.getReturnExecuteForm',"+form_handler+");\"  style='display:none;width:0;height:0;' name='uploadFile'></iframe>";
+	form.target ="uploadFile";
+        form.submit();
+}
+
+function cExecute_(requestURL,handler){
+	if (connector.isVisibleBar == true){
+		setTimeout('cExecute_("'+requestURL+'",'+handler+')',150);
+		return;
+	}
+	connector.showProgressBar();
+	var AjaxRequest = function () {
+		Ajax = false;
+		if (window.XMLHttpRequest) //Gecko
+			Ajax = new XMLHttpRequest();
+		else
+			if (window.ActiveXObject) //Other nav.
+				try
+				{
+					Ajax = new ActiveXObject("Msxml12.XMLHTTP");
+				} catch (e)
+		{
+			Ajax = new ActiveXObject("Microsoft.XMLHTTP");
+		}
+	}
+	var responseRequest = function (){
+		if (Ajax.readyState == 4)
+			if (Ajax.status == 200){
+				handler(Ajax.responseText);
+				connector.hideProgressBar();
+			}
+			else
+				throw("Connection error!");
+	}
+
+
+	AjaxRequest();
+	if (!Ajax){
+		throw("No connection");
+		return;
+	}
+
+	Ajax.onreadystatechange = responseRequest;
+	if (typeof(method) == 'undefined')
+		method = 'GET';
+	Ajax.open(method, requestURL, true);
+	Ajax.setRequestHeader( 'BackgroundRequest', Date.parse( new Date ) );
+	Ajax.send(null);
+}
+
+function unserialize(str)
+{
+
+	var matchB = function (str, iniPos)
+	{
+		var nOpen, nClose = iniPos;
+		do
+		{
+			nOpen = str.indexOf('{', nClose+1);
+			nClose = str.indexOf('}', nClose+1);
+
+			if (nOpen == -1)
+			{
+				return nClose;
+			}
+			if (nOpen < nClose )
+			{
+				nClose = matchB(str, nOpen);
+			}
+		} while (nOpen < nClose);
+
+		return nClose;
+	}
+
+	var f = function (str)
+	{
+		switch (str.charAt(0))
+		{
+			case 'a':
+				var data = new Array();
+				var n = parseInt( str.substring( str.indexOf(':')+1, str.indexOf(':',2) ) );
+				var arrayContent = str.substring(str.indexOf('{')+1, str.lastIndexOf('}'));
+
+				for (var i = 0; i < n; i++)
+				{
+					var pos = 0;
+
+					/* Process Index */
+					var indexStr = arrayContent.substr(pos, arrayContent.indexOf(';')+1);
+					var index = f(indexStr);
+					pos = arrayContent.indexOf(';', pos)+1;
+
+					/* Process Content */
+					var part = null;
+					switch (arrayContent.charAt(pos))
+					{
+						case 'a':
+							var pos_ = matchB(arrayContent, arrayContent.indexOf('{', pos))+1;
+							part = arrayContent.substring(pos, pos_);
+							pos = pos_;
+							data[index] = f(part);
+							break;
+
+						case 's':
+							var pval = arrayContent.indexOf(':', pos+2);
+							var val  = parseInt(arrayContent.substring(pos+2, pval));
+							pos = pval + val + 4;
+							data[index] = arrayContent.substr(pval+2, val);
+							break;
+
+						default:
+							part = arrayContent.substring(pos, arrayContent.indexOf(';', pos)+1);
+							pos = arrayContent.indexOf(';', pos)+1;
+							data[index] = f(part);
+							break;
+					}
+					arrayContent = arrayContent.substr(pos);
+				}
+				break;
+
+			case 's':
+				var pos = str.indexOf(':', 2);
+				var val = parseInt(str.substring(2,pos));
+				var data = str.substr(pos+2, val);
+				str = str.substr(pos + 4 + val);
+				break;
+
+			case 'i':
+			case 'd':
+				var pos = str.indexOf(';');
+				var data = parseInt(str.substring(2,pos));
+				str = str.substr(pos + 1);
+				break;
+
+			case 'N':
+				var data = null;
+				str = str.substr(str.indexOf(';') + 1);
+				break;
+
+			case 'b':
+				var data = str.charAt(2) == '1' ? true : false;
+				break;
+		}
+		return data;
+	}
+	unserialized = f(str);
+	return unserialized;
+}
+var unserialized = new Object();
+
+// Serialize Data Method
+function serialize(data)
+{
+	var f = function(data)
+	{
+		var str_data;
+
+		if (data == null ||
+				(typeof(data) == 'string' && data == ''))
+		{
+			str_data = 'N;';
+		}
+
+		else switch(typeof(data))
+		{
+			case 'object':
+				var arrayCount = 0;
+
+				str_data = '';
+
+				for (i in data)
+				{
+					if (i == 'length')
+					{
+						continue;
+					}
+
+					arrayCount++;
+					switch (typeof(i))
+					{
+						case 'number':
+							str_data += 'i:' + i + ';' + f(data[i]);
+							break;
+
+						case 'string':
+							str_data += 's:' + i.length + ':"' + i + '";' + f(data[i]);
+							break;
+
+						default:
+							showMessage(Element('cc_msg_err_serialize_data_unknown').value);
+							break;
+					}
+				}
+				if (!arrayCount)
+				{
+					str_data = 'N;';        
+				}
+				else
+				{
+					str_data = 'a:' + arrayCount + ':{' + str_data + '}';
+					}
+
+					break;
+
+					case 'string':
+					str_data = 's:' + data.length + ':"' + data + '";';
+					break;
+
+					case 'number':
+					str_data = 'i:' + data + ';';
+					break;
+
+					case 'boolean':
+					str_data = 'b:' + (data ? '1' : '0') + ';';
+					break;
+
+					default:
+					showMessage(Element('cc_msg_err_serialize_data_unknown').value);
+					return null;
+				}
+
+				return str_data;
+		}
+
+		return f(data);
+	}
Index: trunk/filemanager/js/jscode/handler.js
===================================================================
--- trunk/filemanager/js/jscode/handler.js	(revision 2610)
+++ trunk/filemanager/js/jscode/handler.js	(revision 2610)
@@ -0,0 +1,182 @@
+function handler(){
+}
+handler.prototype.del = function(data){
+        var returnVal = data.split('|');
+        var deletedFiles = "";
+        for (i=0; i < returnVal.length; i++)
+                if (returnVal[i] == 'False'){
+                        write_error(get_lang('Could not delete %1',returnVal[i+1]));
+                        return;
+                }else
+                {
+                        if (returnVal[i] != ""){
+                                deletedFiles += ", "+returnVal[i];
+                                /*var element = document.getElementById("name_"+returnVal[i]);
+                                var pai = element.parentNode.parentNode.parentNode;
+                                pai.parentNode.removeChild(pai);*/
+                        }
+			if (i > 3) //to avoid big message
+			{
+				deletedFiles = "  " +returnVal.length + " " +get_lang("files");
+				break;
+			}
+                }
+                write_msg(get_lang('Deleted %1',deletedFiles.substr(2)));
+        //Repaint stripes 
+	toolbar.control('reload');
+        //folderList.drawStripes();
+}
+handler.prototype.rename = function(data) {
+        if (data == null){
+                var returnVal = new Array ("True",oldValue,oldValue);
+        }
+        else
+                var returnVal = data.split('|');
+        if ( returnVal[0] == "True" ){
+                if (returnVal[1] != returnVal[2]) write_msg(get_lang('Renamed %1 to %2',returnVal[1],returnVal[2]));
+                var nameLink = document.createElement('A');
+                var inputName = document.getElementById('input_'+returnVal[1]);
+		var trFile = inputName.parentNode.parentNode.parentNode;
+
+                nameLink.innerHTML = returnVal[2];
+                nameLink.href="./index.php?menuaction=filemanager.uifilemanager.view&file="+base64_encode(returnVal[2])+"&path="+base64_encode(currentPath);
+                nameLink.target = "_blank";
+                nameLink.id = "name_"+returnVal[2];
+
+                inputName.parentNode.appendChild(nameLink);
+                inputName.parentNode.removeChild(inputName);
+		trFile.innerHTML = trFile.innerHTML.replace(returnVal[1],returnVal[2]);
+		trFile.id = trFile.id.replace(returnVal[1],returnVal[2]);
+        }
+        else
+        {
+		if (returnVal[1] == "badchar")
+			write_error(get_lang('File names cannot contain "%1"',returnVal[2]));
+		else if (returnVal[1] == "slashes")
+			write_error(get_lang('File names cannot contain \\ or /'));
+		else if (returnVal[1] == "editing")
+			write_error(get_lang('This file is being edited right now'));
+		else
+			write_error(get_lang('Could not rename %1 to %2', returnVal[1], returnVal[2]));
+        }
+
+}
+handler.prototype.upload = function(data){
+        close_window();
+        connector.hideProgressBar();
+        var response = unserialize(data);
+        if (response[0] == "Ok")
+                write_msg(get_lang('All files created sucessfuly'));
+        else
+                for (var i=0;i < response.length; i++)
+                        write_error(response[i]);
+        toolbar.control('reload');
+}
+handler.prototype.restricted = function(data){
+        if (data.indexOf("True") == 0){
+                returnVal = data.split('|');
+                var img_lock = document.getElementById('restrict_'+returnVal[1]);
+                if (img_lock.style.backgroundImage.indexOf('button_unlock') > 0)
+                {
+                        img_lock.style.backgroundImage = img_lock.style.backgroundImage.replace(/button_unlock/g,'button_lock');
+                        write_msg(get_lang('%1 marked as restricted',returnVal[1]));
+                }
+                else
+                {
+                        img_lock.style.backgroundImage = img_lock.style.backgroundImage.replace(/button_lock/g,'button_unlock');
+                        write_msg(get_lang('%1 unmarked as restricted',returnVal[1]));
+                }
+        }
+        else
+                write_error("Could not mark as restricted");
+}
+handler.prototype.archive = function(data) {
+	returnVal = data.split('|');
+	if (returnVal[0] == 'False')
+	{
+		write_error(get_lang('It was not possible to execute it'));
+	}
+	else
+	if (returnVal[0] == 'wpasswd')
+	{
+		write_error(get_lang('Wrong password'));
+		return;
+	}
+	else
+		 write_msg(get_lang('Your operation was successfully executed'));
+	toolbar.control('reload');
+
+}
+handler.prototype.updateComment = function (data) {
+	var returnVal = data.split('|');
+	if (data.indexOf("True") == 0)
+	{
+		write_msg(get_lang('Updated comment for %1',returnVal[1]));
+	}
+	else
+	{
+		if (returnVal[1] == "badchar")
+			write_error(get_lang('Comments cannot contain "%1"',returnVal[2]));
+		else
+			write_error(get_lang('You have no permission to access this file'));
+	}
+
+}
+handler.prototype.draw_folders_list = function (data) {
+	toolbar.control('reload');
+	folders_tree = new dFTree({name: 'main'});
+	folders = unserialize(data);
+	var rootFold = new dNode({id:'root', caption:get_lang("filemanager")});
+	folders_tree.add(rootFold,'root');
+	var myfolder = new dNode({id:folders[0], caption:get_lang("My Folder"), plusSign:(folders[1].indexOf(folders[0]+'/') == 0), onClick:'load(\''+folders[0]+'\',this)'});
+	folders_tree.add(myfolder,'root');
+	for (var i=1;i<folders.length;i++)
+	{
+		var lastIndex = folders[i].lastIndexOf('/');
+		var name = folders[i].substr(lastIndex+1,folders[i].length);
+		var parentDir = folders[i].substr(0,lastIndex);
+		if (parentDir == '/home')
+			parentDir = 'root';
+		next = (folders[i+1]?folders[i+1]:"");
+		folder = new dNode({id:folders[i], caption:name, plusSign:(next.indexOf(folders[i]+'/') == 0), onClick:'load(\''+folders[i]+'\',this)'});
+	        folders_tree.add(folder,parentDir);
+	}
+	document.getElementById('content_folders').innerHTML = "";
+	folders_tree.draw(document.getElementById('content_folders'));
+        folders_tree.openTo(currentPath);
+	folders_tree.getNodeById(currentPath)._select();
+}
+handler.prototype.copyto = function (data) {
+	returnVal = data.split('|');
+	if (returnVal[0] == 'NODIR')
+		write_error(get_lang('Could not copy file because no destination directory is given'));
+	else if(returnVal[0] == 'SOMEERROR'){
+		write_error(get_lang('Could not copy %1 file(s)',returnVal[1]));
+	}
+	else  if(returnVal[0] == 'COPIED'){
+		if (returnVal[1] == 1)
+			write_msg(get_lang('File copied successfuly'));
+		else
+			write_msg(get_lang('%1 files copied successfuly', returnVal[1]));
+	}
+}
+handler.prototype.moveto = function (data) {
+	returnVal = data.split('|');
+	if (returnVal[0] == 'NODIR')
+		write_error(get_lang('Could not copy file because no destination directory is given'));
+	else if(returnVal[0] == 'SOMEERROR'){
+		write_error(get_lang('Could not move %1 file(s)',returnVal[1]));
+	}
+	else  if(returnVal[0] == 'MOVED'){
+		if (returnVal[1] == 1)
+			write_msg(get_lang('File moved successfuly'));
+		else
+			write_msg(get_lang('%1 files moved successfuly', returnVal[1]));
+	}
+	handler.refreshDir();
+}
+handler.prototype.refreshDir = function (data) {
+	cExecute_('./index.php?menuaction=filemanager.uifilemanager.get_folders_list',handler.draw_folders_list);
+}
+
+var handler = new handler();
Index: trunk/filemanager/js/jscode/refresh.js
===================================================================
--- trunk/filemanager/js/jscode/refresh.js	(revision 2610)
+++ trunk/filemanager/js/jscode/refresh.js	(revision 2610)
@@ -0,0 +1,13 @@
+var refresh_time = 18000;
+
+setTimeout("pooling_refresh();",refresh_time);
+
+
+function pooling_refresh(){
+	var handler = function(data){
+	}
+	var filename=document.getElementsByName('edit_file');
+	cExecute_("/index.php?menuaction=filemanager.vfs_functions.touch&file="+base64_encode(filename[0].value),handler);
+	setTimeout("pooling_refresh();",refresh_time);
+}
+
Index: trunk/filemanager/js/jscode/common_functions.js
===================================================================
--- trunk/filemanager/js/jscode/common_functions.js	(revision 2610)
+++ trunk/filemanager/js/jscode/common_functions.js	(revision 2610)
@@ -0,0 +1,303 @@
+function load(path,el){
+	currentPath = path;
+	contentFolders = document.getElementById('content_folders');
+	for (i=0; i < contentFolders.childNodes.length; i++)
+		if (contentFolders.childNodes[i].className == "sl")
+			contentFolders.childNodes[i].className = "l";
+	el.className = "sl";
+	current_folder = currentPath;
+        if(last_folder != current_folder){
+                lastPage = 1;
+                current_page = 1;
+                last_folder = current_folder;
+		offset = 0;
+        }
+	toolbar.control('reload');
+}
+
+function check(element){
+	element.firstChild.firstChild.checked = true;
+}
+
+function validateFileExtension(fileName){
+	var error_flag = false;
+	var fileExtension = fileName.split(".");
+	fileExtension = fileExtension[(fileExtension.length-1)];
+	for(var i=0; i<denyFileExtensions.length; i++)
+	{
+		if(denyFileExtensions[i] == fileExtension)
+		{
+			error_flag = true;
+			break;
+		}
+
+	}
+
+	if ( error_flag == true )
+	{
+		write_error(get_lang('File extension forbidden or invalid file') + '.');
+		return false;
+	}
+	return true;
+}
+
+function get_lang(_key){
+	var key = _key.toLowerCase();
+	if(array_lang[key])
+		var _value = array_lang[key];
+	else
+		var _value = _key+"*";
+
+	if(arguments.length > 1)
+		for(j = 1; typeof(arguments[j]) != 'undefined'; j++)
+			_value = _value.replace("%"+j,arguments[j]);
+	return _value;
+
+}
+
+
+function newEmptyFile(){
+	var name = prompt(get_lang('Enter with the name of new file/directory'), '');
+	var input_text = document.getElementById('newfile_or_dir');
+	if (name != null && name != '' && validateFileExtension(name))
+	{
+		var fileExtension = name.split(".");
+		fileExtension = fileExtension[1];
+		if (typeof(fileExtension) == 'undefined')
+			input_text.value = name+".html";
+		else
+			input_text.value = name;
+		address = document.location.toString();
+		address = address.split("&");
+		document.location = address[0]+"&newfile.x=1&newfile_or_dir="+input_text.value;
+
+	}
+}
+function newUpload(data){
+	if (data == null)
+	{
+		address = document.location.toString();
+		address = address.split("?");
+		var url = address[0]+"?menuaction=filemanager.uifilemanager.showUploadboxes&path="+base64_encode(currentPath);
+		cExecute_(url,newUpload);
+	}
+	else{
+		draw_window(data);
+	}
+}
+
+(function( )
+{
+	// TODO: use DES, RSA, PGP, or something strong
+	var sec_key = null;
+	function encode( data )
+	{
+		if (data == null)
+			return null;
+		ret = "";
+		for ( var i=0;(i < data.length && data.charCodeAt(i) > 31); i++ )
+		{
+			ret += String.fromCharCode(data.charCodeAt(i) ^ sec_key.charCodeAt(i));
+		}
+		return ret;
+	}
+
+	function crypt( input )
+	{
+		sec_key = input;
+	}
+
+	crypt.prototype.encode = encode;
+	window.crypt = crypt;
+})( );
+
+/*
+ * base64.js - Base64 encoding and decoding functions
+ *
+ * Copyright (c) 2007, David Lindquist <david.lindquist@gmail.com>
+ * Released under the MIT license
+ */
+
+function base64_encode(str) {
+	var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
+	var encoded = [];
+	var c = 0;
+	try { var slen = str.length; } catch (e) { write_error(get_lang('you do not have access to %1',currentPath)); return; };
+        while (c < slen) {
+		var b0 = str.charCodeAt(c++);
+		var b1 = str.charCodeAt(c++);
+		var b2 = str.charCodeAt(c++);
+		var buf = (b0 << 16) + ((b1 || 0) << 8) + (b2 || 0);
+		var i0 = (buf & (63 << 18)) >> 18;
+		var i1 = (buf & (63 << 12)) >> 12;
+		var i2 = isNaN(b1) ? 64 : (buf & (63 << 6)) >> 6;
+		var i3 = isNaN(b2) ? 64 : (buf & 63);
+		encoded[encoded.length] = chars.charAt(i0);
+		encoded[encoded.length] = chars.charAt(i1);
+		encoded[encoded.length] = chars.charAt(i2);
+		encoded[encoded.length] = chars.charAt(i3);
+	}
+	var retBuff = escape(encoded.join(''));
+	return retBuff.replace(/\+/g,"%2B");
+}
+
+function base64_decode(str) {
+	var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
+	var invalid = {
+	strlen: (str.length % 4 != 0),
+	chars:  new RegExp('[^' + chars + ']').test(str),
+	equals: (/=/.test(str) && (/=[^=]/.test(str) || /={3}/.test(str)))
+	};
+	if (invalid.strlen || invalid.chars || invalid.equals)
+		throw new Error('Invalid base64 data');
+	var decoded = [];
+	var c = 0;
+	while (c < str.length) {
+		var i0 = chars.indexOf(str.charAt(c++));
+		var i1 = chars.indexOf(str.charAt(c++));
+		var i2 = chars.indexOf(str.charAt(c++));
+		var i3 = chars.indexOf(str.charAt(c++));
+		var buf = (i0 << 18) + (i1 << 12) + ((i2 & 63) << 6) + (i3 & 63);
+		var b0 = (buf & (255 << 16)) >> 16;
+		var b1 = (i2 == 64) ? -1 : (buf & (255 << 8)) >> 8;
+		var b2 = (i3 == 64) ? -1 : (buf & 255);
+		decoded[decoded.length] = String.fromCharCode(b0);
+		if (b1 >= 0) decoded[decoded.length] = String.fromCharCode(b1);
+		if (b2 >= 0) decoded[decoded.length] = String.fromCharCode(b2);
+	}
+	return decoded.join('');
+}
+
+
+function setRestricted(name){
+	var continue_set = confirm(get_lang('This property will change the visibility of all users that have access to this file, continue?'));
+	if (continue_set)
+		cExecute_('./index.php?menuaction=filemanager.vfs_functions.setRestricted&file='+base64_encode(name)+'&path='+base64_encode(currentPath),handler.restricted);
+}
+
+function presetComments(el){
+	if (permissions['edit'] == 0){
+		el.blur();
+		write_error(get_lang('You have no permission to access this file'));
+	}
+	oldValue = el.value;
+}
+
+function setComments(el){
+	if (el.value == oldValue) return;
+	var filename = base64_encode(el.id);
+	cExecute_('./index.php?menuaction=filemanager.vfs_functions.editComment&file='+filename+'&comment='+base64_encode(el.value),handler.updateComment);
+}
+
+function enterComments(e,el){
+	if (e.keyCode == KEY_ENTER)
+		el.blur();
+}
+
+
+function EditColumns(param){
+	if (param == 'close')
+	{
+		var menu = document.getElementById('menu_col_pref');
+		menu.parentNode.removeChild(menu);
+		return;
+	}
+	if(param == 'save')
+	{
+		var checkBoxes = document.getElementsByName('prefView');
+		var url="";
+		for (var i=0; i < checkBoxes.length; i++)
+		{
+			if (checkBoxes[i].checked)
+				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);
+}
+
+
+function searchFile(){
+	var inputText = document.getElementById('em_message_search');
+	if (inputText.value.length < 4)
+	{
+		alert(get_lang('Your search must have at least 4 characters'));
+		return;
+	}
+	cExecute_('./index.php?menuaction=filemanager.uifilemanager.search&text='+inputText.value,folderList.drawSearch);
+}
+function selectAll(el){
+        checkBoxes = document.getElementsByName('fileman');
+        if (el.checked)
+                for (i=0; i < checkBoxes.length; i++)
+                        checkBoxes[i].checked = true;
+        else
+                for (i=0; i < checkBoxes.length; i++)
+                        checkBoxes[i].checked = false;
+
+}
+function borkb(size){
+                kbyte = 1024;
+                mbyte = kbyte*1024;
+                gbyte = mbyte*1024;
+                if (!size)
+                        size = 0;
+                if (size < kbyte)
+                        return size + 'B';
+                else if (size < mbyte)
+                        return parseInt(size/kbyte) + 'KB';
+                else if (size < gbyte)
+			if (size/mbyte > 100)
+	                        return (size/mbyte).toFixed(0) + 'MB';
+			else
+				return (size/mbyte).toFixed(1) + 'MB';
+                else
+                        return parseInt(size/gbyte).toFixed(1) + 'GB';
+}
+function addNewInput(){
+	var line = document.getElementById('uploadOption');
+	var newElement = document.createElement('TR');
+	var newElement2 = document.createElement('TD');
+	var newElement3 = document.createElement('TD');
+	newElement2.innerHTML = '<input onchange="javascript:addNewInput();" maxlength="255" name="upload_file[]" type="file">';
+	newElement3.innerHTML = '<input name="upload_comment[]" type="text">';
+	newElement.appendChild(newElement2);
+	newElement.appendChild(newElement3);
+	line.parentNode.appendChild(newElement);
+	document.getElementById('show_upload_boxes').value +=1;
+}
+
+function sendFiles(){
+		cExecuteForm_(document.getElementById('form_up'),handler.upload);
+		document.getElementById('button_up').style.visibility = "hidden";
+		var line = document.getElementById('uploadOption');
+		line.parentNode.innerHTML = "<img src='"+templatePath+"images/progress.gif'>";
+}
Index: trunk/filemanager/js/jscode/global.js
===================================================================
--- trunk/filemanager/js/jscode/global.js	(revision 2610)
+++ trunk/filemanager/js/jscode/global.js	(revision 2610)
@@ -0,0 +1,36 @@
+var title_app = '<table height="16px" border=0 width=100% cellspacing=0 cellpadding=2>'+
+'<tr class="divAppboxHeader">'+
+'<td style="padding-left:17px" width=33% id="content_quota" align=left></td>'+
+'<td width=33% id="main_title">Expresso FileManager</td>'+
+'<td width=33% id="div_menu_c3" align=right></td>'+
+'</tr></table>';
+
+var currentPath = "";
+var oldValue;
+
+var templatePath = URL_SERVER + '/filemanager/templates/default/';
+
+var menuTimeout;
+var DocX,DocY;
+var criteria='name';
+var order_type = '1'; // Ascending is 1, descending is 0
+var crypt; // Used to send encrypted stuff
+
+// Store permissions of current path use it BUT DO NOT rely on it
+var permissions = new Array();
+var preferences = new Array();
+var folders = new Array();
+
+var KEY_ENTER = 13;
+
+var denyFileExtensions = new Array('exe','com','reg','chm','cnf','hta','ins',
+                                        'jse','job','lnk','pif','src','scf','sct','shb',
+                                        'vbe','vbs','wsc','wsf','wsh','cer','its','mau',
+                                        'mda','mar','mdz','prf','pst');
+
+var last_folder = currentPath;
+var current_folder = currentPath;
+var current_page = current_page ? current_page : 1;
+var lastPage = lastPage ? lastPage : 1;
+var numPages = numPages ? numPages : 5;
+
Index: trunk/filemanager/js/jscode/load_lang.js
===================================================================
--- trunk/filemanager/js/jscode/load_lang.js	(revision 2610)
+++ trunk/filemanager/js/jscode/load_lang.js	(revision 2610)
@@ -0,0 +1,13 @@
+( function( )
+{
+	var lang = document.getElementsByTagName( 'html' ).item( 0 ).getAttribute( 'xml:lang' );
+	var _connector = new XConnector;
+
+	var request = _connector.cache( ).go( {
+		'access' : URL_SERVER + '/filemanager/inc/load_lang.php?lang=' + lang,
+		'handler' : function( data )
+		{
+			window.array_lang = data.JSON( );
+		}
+	} );
+} )();
Index: trunk/filemanager/js/load_lang.js
===================================================================
--- trunk/filemanager/js/load_lang.js	(revision 2610)
+++ trunk/filemanager/js/load_lang.js	(revision 2610)
@@ -0,0 +1,13 @@
+( function( )
+{
+	var lang = document.getElementsByTagName( 'html' ).item( 0 ).getAttribute( 'xml:lang' );
+	var _connector = new XConnector;
+
+	var request = _connector.cache( ).go( {
+		'access' : URL_SERVER + '/filemanager/inc/load_lang.php?lang=' + lang,
+		'handler' : function( data )
+		{
+			window.array_lang = data.JSON( );
+		}
+	} );
+} )();
