Index: trunk/expressoMail1_2/js/jscode/draw_api_folders.js
===================================================================
--- trunk/expressoMail1_2/js/jscode/draw_api_folders.js	(revision 2796)
+++ trunk/expressoMail1_2/js/jscode/draw_api_folders.js	(revision 2798)
@@ -1236,16 +1236,8 @@
 
 	if (is_mozilla){
-		_divScroll.style.overflow = "-moz-scrollbars-vertical";
+		_divScroll.style.overflow = "-moz-scrollbars-vertical";		
 		_divScroll.style.width	="99.3%";
 	}
-	var bar = Element("toolbar");
-	var offset = 0;
-	if(bar.style.visibility != 'hidden')
-		offset = (bar.offsetHeight ? bar.offsetHeight :  bar.clientHeight);
-
-	var screenHeight = document.body.clientHeight ? document.body.clientHeight : document.body.offsetHeight;
-	var defaultHeight = screenHeight - offset;
-	Element('content_folders').style.height = defaultHeight - (is_ie ? 165 : 150);
-	_divScroll.style.height 	= defaultHeight - 110;
+
 	var _t_element = createAndSet("TABLE",['id','class','borderColorDark','frame','rules','cellPadding','cellSpacing'],["table_box","table_box","#bbbbbb","void","rows","0","0"]);
 	_t_element.onkeydown = function (e){
@@ -1318,4 +1310,8 @@
 	draw_footer_box(this.headers_msgs.num_msgs);
 	Element('main_table').style.display = '';
+	if(is_ie6)	// Stupid Fixing on IE6.
+		setTimeout("resizeWindow()",1);
+	else
+		resizeWindow();	
 	if(debug) {
 		var _eTime = new Date();
Index: trunk/expressoMail1_2/js/jscode/abas.js
===================================================================
--- trunk/expressoMail1_2/js/jscode/abas.js	(revision 2714)
+++ trunk/expressoMail1_2/js/jscode/abas.js	(revision 2798)
@@ -144,6 +144,6 @@
 		td.setAttribute("width", "200px");
 
-	td.setAttribute("align", "right");
-	td.onclick = function(){alternate_border(ID);};
+	td.setAttribute("align", "right");	
+	td.onclick = function(){alternate_border(ID);resizeWindow()}; 
 	td.setAttribute("noWrap","true");
         td.alt = borderTitle;
@@ -173,15 +173,9 @@
 	div.style.display='';
 
-	var bar = document.getElementById("toolbar");
-	var offset = 0;
-	if(bar.style.visibility != 'hidden')
-		offset = bar.offsetHeight ? bar.offsetHeight :  bar.clientHeight;
-
-	div.style.height = document.body.clientHeight - offset - (is_ie ? 76 : 86);
 	div.style.overflow = "hidden";
 
 	if(!is_ie) {
 		var menuHidden = Element("folderscol").style.display == 'none' ? true : false;
-		var defaultWidth = document.body.clientWidth - 27;
+		var defaultWidth = document.body.clientWidth - 31;
 		if(!menuHidden)
 			defaultWidth -= Element("folderscol").offsetWidth;
@@ -294,4 +288,5 @@
 	content = Element('content_id_' + ID);
 	content.parentNode.removeChild(content);
+	resizeWindow();
 	return true;
 };
Index: trunk/expressoMail1_2/js/jscode/common_functions.js
===================================================================
--- trunk/expressoMail1_2/js/jscode/common_functions.js	(revision 2752)
+++ trunk/expressoMail1_2/js/jscode/common_functions.js	(revision 2798)
@@ -1,3 +1,2 @@
-// BEGIN: FUNCTION RESIZE WINDOW
 if (!expresso_offline) {
 	var _showBar = showBar;
@@ -18,14 +17,15 @@
 
 XEvents.add( window, 'onresize', resizeWindow );
-
+// BEGIN: FUNCTION RESIZE WINDOW 
 function resizeWindow(){
 
-	var bar = Element("toolbar");
-	var offset = 0;
-	if(bar.style.visibility != 'hidden') 
-		offset = (bar.offsetHeight ? bar.offsetHeight :  bar.clientHeight);	
-
-	var screenHeight = document.body.clientHeight ? document.body.clientHeight : document.body.offsetHeight;
-	var defaultHeight = screenHeight - offset;
+	var divScrollMain = Element("divScrollMain_"+numBox);
+	var table_message = Element("table_message");
+	var content_folders = Element("content_folders");
+	var clientHeight = ((window.innerHeight ? window.innerHeight : document.body.offsetHeight) - 8);
+  
+	if(divScrollMain){ 
+		divScrollMain.style.height = (clientHeight - (findPosY(divScrollMain) + (table_message.clientHeight ? table_message.clientHeight : table_message.offsetHeight))) + "px"; 
+	}
 
 	if(typeof(BordersArray) != 'undefined') {
@@ -35,14 +35,15 @@
 
 			if(div)
-				div.style.height = ( defaultHeight - 90 ) + 'px';
+			 	div.style.height = (clientHeight - (findPosY(div) + (table_message.clientHeight ? table_message.clientHeight : table_message.offsetHeight)+2)) + "px";
 			if(div_scroll)
-				div_scroll.style.height = ( defaultHeight - 130 ) + 'px';
-		}
-	}
-
-	if(Element('content_folders'))
-		Element('content_folders').style.height = defaultHeight - (is_ie ? 165 : 150);
-	if(Element("divScrollMain_"+numBox))
-		Element("divScrollMain_"+numBox).style.height 	= defaultHeight - (is_ie ? 111 : 110);
+				div_scroll.style.height = (clientHeight - (findPosY(div_scroll) + (table_message.clientHeight ? table_message.clientHeight : table_message.offsetHeight))) + "px";
+		} 
+	} 
+			 		 
+ 	if(content_folders){ 
+ 		var search_div = Element("search_div");
+ 		var contentFoldersY = findPosY(content_folders);
+ 		content_folders.style.height = (clientHeight - (contentFoldersY + (contentFoldersY > findPosY(search_div) ? 0 : (search_div.clientHeight ? search_div.clientHeight : search_div.offsetHeight) + 5))) + "px";
+ 	} 
 }
 // END: FUNCTION RESIZE WINDOW
Index: trunk/expressoMail1_2/js/jscode/main.js
===================================================================
--- trunk/expressoMail1_2/js/jscode/main.js	(revision 2770)
+++ trunk/expressoMail1_2/js/jscode/main.js	(revision 2798)
@@ -394,4 +394,5 @@
 		}
 	}
+	resizeWindow();
 }
 
Index: trunk/expressoMail1_2/js/jscode/search.js
===================================================================
--- trunk/expressoMail1_2/js/jscode/search.js	(revision 2761)
+++ trunk/expressoMail1_2/js/jscode/search.js	(revision 2798)
@@ -432,21 +432,13 @@
 		table.appendChild(tbody);
 
-	var content_search =  Element('content_id_search_' + numBox);
-	// BEGIN MAKE THE SCROLL HEIGHT		
+	var content_search =  Element('content_id_search_' + numBox);			
 	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;		
+		defaultWidth -= Element("folderscol").offsetWidth;
 	var div_scroll_result = document.createElement("DIV");
 	div_scroll_result.id = "divScrollMain_"+numBox;
-	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		
+	div_scroll_result.style.width = defaultWidth - (is_ie ? 7 : 0);	
 		
 	
@@ -594,4 +586,5 @@
 			content_search.appendChild(div_scroll_result);
 		}
+		resizeWindow();
 	}
 
Index: trunk/expressoMail1_2/js/jscode/draw_api_messages.js
===================================================================
--- trunk/expressoMail1_2/js/jscode/draw_api_messages.js	(revision 2743)
+++ trunk/expressoMail1_2/js/jscode/draw_api_messages.js	(revision 2798)
@@ -628,14 +628,7 @@
 	tr5.appendChild(td_body);
 	tbody_message.appendChild(tr5);
-	// BEGIN MAKE THE SCROLL HEIGHT
-	var defaultWidth = document.body.clientWidth - (is_ie ? 200 : 195);
-	var _bar = document.getElementById("toolbar");
-	var _offset = 0;
-	if(_bar.style.visibility != 'hidden') 
-		_offset = _bar.offsetHeight ? _bar.offsetHeight :  _bar.clientHeight;		
+	var defaultWidth = document.body.clientWidth - 200;
 	var _div = document.createElement("DIV");
 	_div.id = "div_message_scroll_"+ID;
-	_div.style.height = document.body.clientHeight - _offset - 105;
-	content.style.height = document.body.clientHeight - _offset - 80;
 	_div.style.overflow = "auto";
 	_div.style.width = defaultWidth;
@@ -652,9 +645,11 @@
 	_div.appendChild(form);
 	content.appendChild(_div);
-	table_message.appendChild(tbody_message);
+	table_message.appendChild(tbody_message);	
 	form.appendChild(table_message);
 	expresso.connector.loadScript("jscode/rich_text_editor");
-	RichTextEditor.loadEditor(ID);
+	RichTextEditor.loadEditor(ID);	
+	resizeWindow();
 	//////////////////////////////////////////////////////////////////////////////////////////////////////
+	
 	return ID;
 }
Index: trunk/expressoMail1_2/js/jscode/draw_messages.js
===================================================================
--- trunk/expressoMail1_2/js/jscode/draw_messages.js	(revision 2793)
+++ trunk/expressoMail1_2/js/jscode/draw_messages.js	(revision 2798)
@@ -201,17 +201,9 @@
 	}
 
-
-	// BEGIN MAKE THE SCROLL HEIGHT
-	var bar = document.getElementById("toolbar");
-	var offset = 0;
-	if(bar.style.visibility != 'hidden')
-		offset = bar.offsetHeight ? bar.offsetHeight :  bar.clientHeight;
 	var div = document.createElement("DIV");
 	div.id = "div_message_scroll_"+this.id;
 	div.style.background = 'WHITE';
-	div.style.height = document.body.clientHeight - offset - 125;
 	div.style.overflow = "auto";
 	div.style.width = defaultWidth - (is_ie ? 5 : 0);
-	// END MAKE THE SCROLL HEIGHT
 
 	var table_msg_details = createAndSet("TABLE",['id','width','class'],['table_msg_details_' + this.id,defaultWidth - 30,'table_message']);
@@ -272,5 +264,4 @@
 		loading_img = content.removeChild( loading_img );
 	}catch(e){};
-	content.style.height = document.body.clientHeight - offset - 90;
 	content.appendChild(msg_number);
 	//////////////////////////////////////////////////////////////////////////////////////////////////////
