Index: sandbox/filemanager/js/draw_api.js
===================================================================
--- sandbox/filemanager/js/draw_api.js	(revision 1719)
+++ sandbox/filemanager/js/draw_api.js	(revision 1726)
@@ -11,4 +11,28 @@
 document.onmousemove = getPointer;
 
+function close_window(){
+	var menu =  document.getElementById('dwindow');
+	menu.style.visibility = 'hidden'
+}
+function draw_window(htmlData){
+	var menu =  document.getElementById('dwindow');
+	buttonClose = '<input value="'+get_lang('close')+'" onclick="close_window()" type="button">';
+	if (!menu){
+		menu = document.createElement('DIV');
+		menu.id = "dwindow";
+		menu.style.left = DocX - 500;
+		menu.style.width = "auto";
+		menu.style.top = DocY;
+		menu.className = 'menubox';
+		menu.style.zIndex='1';
+		menu.innerHTML = htmlData+buttonClose;
+		document.getElementById('divAppboxHeader').appendChild(menu);
+	}
+	else{
+		menu.innerHTML = htmlData+buttonClose;
+		menu.style.visibility = 'visible';
+	}
+
+}
 
 function draw_menu(id,elements){
@@ -125,4 +149,64 @@
 			return parseInt(size/gbyte).toFixed(1) + 'GB';
 }
+function drawSearch(data){
+	var fmFileWindow = document.getElementById('fmFileWindow');
+	var files = unserialize(data);
+	if (files == null)
+	{
+		alert(get_lang('No results found'));
+		return
+	}
+	var toolbar = document.getElementById('fmMenu');
+	toolbar.innerHTML = "";
+	fmFileWindow.innerHTML = "";
+	var newpage;
+	var td_hd = '<td style="padding-left: 2px; padding-right: 2px;" valign="middle">';
+	var sp_hd = '<span name="head" style="cursor: pointer; cursor: hand;"';
+	var sp_tl = '</span></td>';
+	newpage = '<table cellspacing="0" cellpadding="2"><tbody><tr class="message_header">';
+	newpage += td_hd+'<input onclick="selectAll(this)" type="checkbox"></td><td></td><td></td>';
+	newpage += td_hd+sp_hd+' id="name">'+get_lang('file name')+sp_tl;
+	newpage += td_hd+sp_hd+' id="folder">'+get_lang('folder')+sp_tl;
+    	if (preferences.mime_type =='1')
+		newpage += td_hd+sp_hd+' id="mime">'+get_lang('mime type')+sp_tl;
+	if (preferences.size =='1')
+		newpage += td_hd+sp_hd+' id="size">'+get_lang('size')+'</a>'+sp_tl;
+	if (preferences.created =='1')
+		newpage += td_hd+sp_hd+' id="created">'+get_lang('created')+'</a>'+sp_tl;
+	if (preferences.modified =='1')
+		newpage += td_hd+sp_hd+' id="modified">'+get_lang('modified')+'</a>'+sp_tl;
+	if (preferences.createdby_id =='1')
+		newpage += td_hd+sp_hd+' id="creatdby">'+get_lang('created by')+'</a>'+sp_tl;
+	if (preferences.modifiedby_id =='1')
+		newpage += td_hd+sp_hd+' id="modifdby">'+get_lang('modified by')+'</a>'+sp_tl;
+	if (preferences.comment =='1')
+		newpage += td_hd+sp_hd+' id="comm">'+get_lang('comment')+'</a>'+sp_tl;
+	if (preferences.version =='1') newpage += td_hd+sp_hd+' id="vers">'+get_lang('version')+'</a>'+sp_tl+'</tr>';
+	
+	var classTr = "tr_msg_read";
+	for (var i=0; i < files.length; i++)
+	{
+		newpage += '<tr class="'+classTr+'">'+td_hd;
+		newpage += '<input name="fileman" value="'+files[i].name+'" type="checkbox"></td>';
+		newpage += '<td></td><td></td>';
+		newpage += td_hd+'<img src="'+templatePath+'images/mime16_unknown.png">';
+		newpage += '<a id="name_'+files[i].name+'" href="/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 += td_hd+files[i].directory+'</td>';
+		if (preferences.mime_type =='1') newpage += td_hd+files[i].mime_type+'</td>';
+		if (preferences.size =='1') newpage += td_hd+borkb(files[i].size)+'</td>';
+		if (preferences.created =='1') newpage += td_hd+files[i].created+'</td>';
+		if (preferences.modified =='1') newpage += td_hd+files[i].modified+'</td>';
+		if (preferences.createdby_id =='1') newpage += td_hd+files[i].createdby_id+'</td>';
+		if (preferences.modifiedby_id =='1') newpage += td_hd+files[i].modifiedby_id+'</td>';
+		if (files[i].comment == null || files[i].comment.length == 0)
+			files[i].comment = "&lt;"+get_lang("no comments")+"&gt;";
+		if (preferences.comment =='1') newpage += td_hd+'<span id="'+files[i].name+'">'+files[i].comment+'</span></td>';
+		if (preferences.version =='1') newpage += td_hd+'<span>'+files[i].version+'</span></td></tr>';
+		classTr = (classTr == "tr_msg_read"?"tr_msg_read2":"tr_msg_read");
+
+	}
+	fmFileWindow.innerHTML = newpage;
+}
+
 
 function drawFiles(data){
@@ -184,5 +268,4 @@
 		if (preferences.comment =='1') newpage += td_hd+'<span id="'+files[i].name+'" onclick="setComments(this)">'+files[i].comm+'</span></td>';
 		if (preferences.version =='1') newpage += td_hd+'<span onclick="loadHistory(\''+files[i].name+'\')">'+files[i].vers+'</span></td></tr>';
-		// /index.php?menuaction=filemanager.uifilemanager.history&amp;file=MDAxMC5lbWw%253D&amp;path=L2hvbWUvem9yZWlh 
 		classTr = (classTr == "tr_msg_read"?"tr_msg_read2":"tr_msg_read");
 
@@ -227,4 +310,8 @@
 }
 
+function loadHistory(filename){
+	cExecute('/index.php?menuaction=filemanager.uifilemanager.history&file='+base64_encode(filename)+"&path="+base64_encode(currentPath),draw_window);
+}
+
 function loadPermissions(data){
 	var permission = parseInt(data);
