Index: trunk/expressoMail1_2/js/search.js
===================================================================
--- trunk/expressoMail1_2/js/search.js	(revision 156)
+++ trunk/expressoMail1_2/js/search.js	(revision 163)
@@ -152,11 +152,4 @@
 	}
 	
-	// Monta Resultado no Box
-	searchE.prototype.mount_result_box = function(data){
-		draw_box(new Array(), "_search");
-		draw_paging(0);
-//		alternate_border(0);
-
-	}
 	//This func returns the most recent date
 	function date_comp(a,b)
@@ -271,19 +264,11 @@
 		var border_id = create_border(get_lang("Search Results"), "search_" + search_tabs);
 		var table = document.createElement("TABLE");
-		table.id    = "table_result_" + search_tabs;
+		table.id    = "table_resultsearch_" + search_tabs;
 		table.width = "100%";
 
-/*		if(is_ie){
-		 	table.cellPadding  = '0';
-		 	table.cellSpacing = '0';
-	 		table.setAttribute("border","1");
-		}else{
-			table.setAttribute( "cellspacing", "0");
-			table.setAttribute( "cellpadding", "0");
-			table.setAttribute( "border", "1");
-		}*/
 		var tbody = document.createElement("TBODY");
+		tbody.id    = "tbody_resultsearch_" + search_tabs;
 		if(nw_array.length > 0){
-			write_msg(nw_array.length + get_lang(' search results'));			
+			write_msg(nw_array.length + " "+ get_lang('results found'));			
 		}
 
@@ -313,4 +298,5 @@
 					var mailbox = aux[0];
 					var uid_msg = aux[5];
+					tr.id = mailbox + ";" + uid_msg;
 					var td = document.createElement("TD");					
 					
@@ -319,12 +305,14 @@
 						td.style.width = "1%";					
 						var subject_encode = url_encode(aux[2]);
-						var td1 = '<input type="checkbox" id="check_box_message_'+aux[5]+'" name="teste"></input>';
+						var td1 = '<input type="checkbox" id="check_box_search_message_'+tr.id+'"></input>';
 					}
 					if( j == 1){
-						td.style.width = "19%";					
+						td.style.width = "20%";					
 						var nm_box = aux[0].split(cyrus_delimiter);
 						var td1 = nm_box.pop();
 						td.setAttribute("NoWrap","true");
 						td.style.overflow = "hidden";
+						td.style.color = "#42795b";
+						td.style.fontWeight = "bold";
 						if(td1 == "INBOX"){
 							var td1  = get_lang("Inbox");
@@ -338,15 +326,15 @@
 					if( j == 3){
 						var subject_encode = url_encode(aux[2]);
-						td.width = "40%";					
+						td.width = "30%";					
 						var td1  = '<div style="width:100%;overflow:hidden"><a href=javascript:void(0) onclick=EsearchE.open_msg(\"' + url_encode(mailbox) + '\",\"' + uid_msg + '\",\"' + subject_encode + '\")>' + aux[2] +'</a></div>';
 
 					}
 					if( j == 4){
-						td.width = "10%";					
+						td.width = "14%";					
 						td.align = "center";
 						var td1  = aux[3];
 					}
 					if( j == 5){
-						td.width = "10%";
+						td.width = "15%";
 						td.align = "center";
 						var td1  = aux[4];
@@ -362,5 +350,24 @@
 		table.appendChild(tbody);
 		
-		var content = document.getElementById('content_id_' + "search_" + search_tabs);	
+	var content_search =  Element('content_id_' + "search_" + search_tabs);	
+	// BEGIN MAKE THE SCROLL HEIGHT		
+	var defaultWidth = document.body.offsetWidth - 31;	
+	var menuHidden = Element("folderscol").style.display == 'none' ? true : false;
+	if(!menuHidden)
+		defaultWidth -= Element("folderscol").offsetWidth;			
+	var bar = Element("toolbar");
+	var offset = 0;
+	if(bar.style.visibility != 'hidden') 
+		offset = bar.offsetHeight ? bar.offsetHeight :  bar.clientHeight;		
+	var div_scroll_result = document.createElement("DIV");
+	div_scroll_result.id = "div_result_scroll_"+search_tabs;
+	div_scroll_result.style.background = 'WHITE';
+	div_scroll_result.style.height = document.body.clientHeight - offset - 120;
+	content_search.style.height = document.body.clientHeight - offset - 80;
+	div_scroll_result.style.overflow = "auto";
+	div_scroll_result.style.width = defaultWidth - (is_ie ? 7 : 0);
+	// END MAKE THE SCROLL HEIGHT		
+		
+	
 		if(is_ie)
 			Element("border_table").width = "99.5%";
@@ -380,5 +387,5 @@
 		chk_box_element.setAttribute("type", "checkbox");
 		chk_box_element.className = "checkbox";
-		chk_box_element.onclick = function(){select_all_search_messages(this.checked,content);};
+		chk_box_element.onclick = function(){select_all_search_messages(this.checked,content_search.id);};
 		chk_box_element.onmouseover = function () {this.title=get_lang('Select all messages.')};
 		chk_box_element.onkeydown = function (e){
@@ -397,5 +404,5 @@
 		td_element0.appendChild(chk_box_element);
 		td_element1 = document.createElement("TD");
-		td_element1.setAttribute("width", "19%");
+		td_element1.setAttribute("width", "20%");
 		td_element1.align = "left";
 		td_element1.onclick = function () { EsearchE.mount_result(data,'SORTBOX'); delete_border(border_id,false);};
@@ -407,15 +414,15 @@
 		td_element2.innerHTML = get_lang("Who");
 		td_element3 = document.createElement("TD");
-		td_element3.setAttribute("width", "40%");
+		td_element3.setAttribute("width", "30%");
 		td_element3.align = "left";
 		td_element3.onclick = function () { EsearchE.mount_result(data,'SORTSUBJECT'); delete_border(border_id,false);};
 		td_element3.innerHTML = get_lang("Subject");
 		td_element4 = document.createElement("TD");
-		td_element4.setAttribute("width", "10%");
+		td_element4.setAttribute("width", "14%");
 		td_element4.align = "center";
 		td_element4.onclick = function () { EsearchE.mount_result(data,'SORTDATE'); delete_border(border_id,false);};
 		td_element4.innerHTML = get_lang("Date");
 		td_element5 = document.createElement("TD");
-		td_element5.setAttribute("width", "10%");
+		td_element5.setAttribute("width", "15%");
 		td_element5.align = "center";
 		td_element5.onclick = function () { EsearchE.mount_result(data,'SORTSIZE'); delete_border(border_id,false);};
@@ -430,12 +437,15 @@
 		tbody_element.appendChild(tr_element);
 		table_element.appendChild(tbody_element);
-		content.appendChild(table_element);
+		content_search.appendChild(table_element);
 		/*end of "put header"*/
 
-		var span_options = document.getElementById("span_options");
+		var span_options = document.createElement("SPAN");		
 		if (span_options)
-			span_options.innerHTML = '<span title="'+get_lang("Delete")+'" style="margin-left:8px" class="message_options" onclick=delete_search_msgs('+content.id+')>'+get_lang("Delete")+'</span>';
-		content.appendChild(table);
-		content.parentNode.appendChild(span_options);	
+			span_options.innerHTML = '<span title="'+get_lang("Delete")+'" style="margin-top:3px;margin-left:8px" class="message_options" onclick="javascript:move_search_msgs(\''+content_search.id+'\');">'+get_lang("Delete")+'</span> | '+
+				'<span title="'+get_lang("Move")+'" class="message_options" onclick=wfolders.makeWindow(\"'+content_search.id+'\",\"move_to\")>'+get_lang("Move")+'</span>';
+		div_scroll_result.appendChild(table);
+		content_search.appendChild(div_scroll_result);	
+		if (span_options)
+			content_search.appendChild(span_options);	
 	}
 
