Index: branches/2.2.0.1/expressoMail1_2/js/draw_api.js
===================================================================
--- branches/2.2.0.1/expressoMail1_2/js/draw_api.js	(revision 4062)
+++ branches/2.2.0.1/expressoMail1_2/js/draw_api.js	(revision 4072)
@@ -640,4 +640,5 @@
 var tblWidth=0;
 var bodyWidth=0;
+var cssForResizing=false;
 
 function changeCursorState(ev) {
@@ -649,4 +650,6 @@
 	el.style.cursor ="hand";
 	el.style.cursor ="pointer";
+	if (!cssForResizing)
+		return;
 	var cellMouseX = (ev.clientX-parseInt(getColumnPosition(el, ev)));
 	var cellWidth = el.offsetWidth;
@@ -663,4 +666,14 @@
 		el.style.cursor ="pointer";
 	}
+}
+
+function getStyle(el,styleProp)
+{
+	var x = document.getElementById(el);
+	if (x.currentStyle)
+		var y = x.currentStyle[styleProp];
+	else if (window.getComputedStyle)
+		var y = document.defaultView.getComputedStyle(x,null).getPropertyValue(styleProp);
+	return y;
 }
 
@@ -785,5 +798,4 @@
 	var adjIndex = adjCell.cellIndex;
 	document.getElementById("table_message_ruler").style.display = "none";
-	syncColumns();
 	maxWidth = 0;
 	objCell.onclick = cellClick;
@@ -791,4 +803,6 @@
 	adjCell = null;
 	cellResized = true;
+	setColSizesCookie();
+	syncColumns();
 }
 
@@ -843,8 +857,11 @@
 			trM[r].cells[c].setAttribute("width",colSizes[tbl][c]);
 			if (is_mozilla && !is_webkit) {
-				document.getElementById("colgroup_head_"+numBox).childNodes[c].setAttribute("width",colSizes[tbl][c]);
-				trM[r].cells[c].innerHTML = trM[r].cells[c].innerHTML;
-			}
-			else {
+				if (r==0) {
+				    document.getElementById("colgroup_head_"+numBox).childNodes[c].setAttribute("width",colSizes[tbl][c]);
+					tbH.rows[0].cells[c].innerHTML = tbH.rows[0].cells[c].innerHTML; // stupid FF fix to refresh column content
+			}
+				trM[r].cells[c].innerHTML = trM[r].cells[c].innerHTML; // stupid FF fix to refresh column content
+			}
+			else if(r==0) {
 				tbH.rows[0].cells[c].setAttribute("width",trM[r].cells[c].offsetWidth);
 			}
@@ -874,5 +891,4 @@
 	for (i=0;i<colSizes[tbl].length;i++) {
 		col_element = document.createElement("COL");
-		//col_element.setAttribute("width", colSizes[0][i]);
 		col_element.setAttribute("align", colAligns[tbl][i]);
 		colgr_element.appendChild(col_element);
@@ -890,4 +906,36 @@
 }
 
+function prepareColSizesArray() {
+	var colSizesCookie = getColSizesCookie();
+	if (colSizesCookie) {
+		try {
+			var colSizesA = colSizesCookie.split(":");
+			colSizes = [colSizesA[0].split(","),colSizesA[1].split(",")];
+		}
+		catch(e) {}
+	}
+}
+function setColSizesCookie() {
+	var str = "maillist_colsizes=" + colSizes[0].join() + ":" + colSizes[1].join();
+	var date = new Date();
+	date.setTime(date.getTime()+(365*24*60*60*1000));
+	str += ("; expires="+date.toGMTString());
+	document.cookie = str;
+}
+function getColSizesCookie() {
+	var search = "maillist_colsizes=";
+	if (document.cookie.length > 0) {
+		var offset = document.cookie.indexOf(search);
+		if (offset != -1) {
+			offset += search.length;
+			var end = document.cookie.indexOf(";", offset);
+			if (end == -1)
+				end = document.cookie.length;
+			return document.cookie.substring(offset, end);
+		}
+	}
+	return null;
+}
+
 // Draw the inbox and another folders
 function draw_box(headers_msgs, msg_folder, alternate){
@@ -904,5 +952,5 @@
 
 	table_message_header_box = document.getElementById("table_message_header_box_"+numBox);
-	if (table_message_header_box == null){
+	if (table_message_header_box == null) {
 		var table_element = document.createElement("TABLE");
 		var colgr_element = buildColGroup();
@@ -1004,5 +1052,5 @@
 			_divScroll = document.createElement("DIV");
 			_divScroll.id = "divScrollHead_"+numBox;
-	}
+		}
 
 		_divScroll.style.overflowY = "hidden";
@@ -1017,4 +1065,8 @@
 		openTab.content_id[numBox].appendChild(_divScroll);
 
+		var table_layout = (getStyle("table_message_header_box_"+numBox,"table-layout") || getStyle("table_message_header_box_"+numBox,"tableLayout"))
+		cssForResizing = (table_layout=="fixed");
+		if (cssForResizing)
+			prepareColSizesArray();
 	}
 	draw_header_box();
@@ -1280,5 +1332,5 @@
 
 
-		td_element3 = createTDElement(0,7,"td_resizable","left","td_who_"+ headers_msgs.msg_number);
+		td_element3 = createTDElement(0,7,"td_msg td_resizable","left","td_who_"+ headers_msgs.msg_number);
 		var _onclick = function(){InfoContact.hide();proxy_mensagens.get_msg(headers_msgs.msg_number, msg_folder,true, show_msg);};
 		td_element3.onclick = _onclick;
@@ -1297,5 +1349,5 @@
 				if(headers_msgs.to.email != null && headers_msgs.to.email.toLowerCase() != Element("user_email").value)
 					td_element24.innerHTML = "<img valign='center' src ='templates/"+template+"/images/sent.gif' title='"+get_lang('Sent')+"'>";
-				
+
 				if (headers_msgs.to) {
 					if (headers_msgs.to.name != null)
@@ -1329,5 +1381,5 @@
 		}
 
-		td_element4 = createTDElement(0,8,"td_resizable","left");
+		td_element4 = createTDElement(0,8,"td_msg td_resizable","left");
 		td_element4.onclick = _onclick;
 		td_element4.innerHTML = !is_ie ? "<a nowrap id='a_message_"+tr_element.id+"'>&nbsp;" : "&nbsp;";
@@ -1353,5 +1405,5 @@
 
 
-		td_element5 = createTDElement(0,9,"td_resizable","center");
+		td_element5 = createTDElement(0,9,"td_msg td_resizable","center");
 		td_element5.onclick = _onclick;
 
@@ -1397,5 +1449,5 @@
 		td_element5.alt = td_element5.title;
 
-		td_element6 = createTDElement(0,10,"td_resizable","center");
+		td_element6 = createTDElement(0,10,"td_msg td_resizable","center");
 		td_element6.onclick = _onclick;
 		td_element6.setAttribute("noWrap","true");
@@ -1627,5 +1679,5 @@
 			td.innerHTML += "&nbsp;<img style='cursor:pointer' onclick='alert(\""+get_lang("This message is signed, but it is invalid. You should not trust on it.")+"\");' title='"+get_lang("Voided message")+"' src='templates/"+template+"/images/invalid.gif'>";
 	}
-	
+
 	if (info_msg.DispositionNotificationTo)
 	{
@@ -1680,5 +1732,5 @@
 
 	if (info_msg.Flagged == "F"){
-		option_mark_important.onclick = function() { 
+		option_mark_important.onclick = function() {
 			var _this = this;
 			proxy_mensagens.proxy_set_message_flag(folder_id,'unflagged', function(success){
@@ -1688,5 +1740,5 @@
 				}
 			} );
-			
+
 		};
 		option_mark_important.innerHTML = get_lang("Normal");
@@ -1926,5 +1978,5 @@
 		tr0.appendChild(td0);
 		tbody_message.appendChild(tr0);
-		
+
 		var important_message = document.createElement("INPUT");
 		important_message.id = "is_important_"+ID;
@@ -1932,5 +1984,5 @@
 		important_message.type = "HIDDEN";
 		important_message.value = (info_msg.Importance == "" || info_msg.Importance == "Normal") ? "0": "1";
-		
+
 		options.appendChild(important_message);
 	}
@@ -2042,5 +2094,5 @@
 	{
 		toaddress_array[ID] = info_msg.toaddress2.split(",");
-		
+
 		if (toaddress_array[ID].length > 1)
 		{
@@ -2051,5 +2103,5 @@
 			div_toaddress.innerHTML += " (<a STYLE='color: RED;' onclick=javascript:show_div_address_full('"+ID+"','to');>"+get_lang('more')+"</a>)";
 			to.appendChild(div_toaddress);
-		} 
+		}
 		else
 		{
@@ -2060,8 +2112,8 @@
 				toAdd = get_lang("without destination");
 			}
-			
+
 			to.innerHTML += draw_plugin_cc(ID,toAdd);
 		}
-	
+
 		to.className = "header_message_field";
 		tr2.appendChild(td2);
@@ -2069,5 +2121,5 @@
 		tr2.appendChild(to_values);
 	}
-	
+
 	tbody_message_others_options.appendChild(tr2);
 
@@ -2218,5 +2270,5 @@
 			link_attachment.innerHTML = url_decode(info_msg.attachments[i].name);
 			link_attachment.innerHTML += " ("+borkb(info_msg.attachments[i].fsize)+")";
-			
+
 			if((url_decode(info_msg.attachments[i].name).indexOf(".ics")!=-1) ||
 					(url_decode(info_msg.attachments[i].name).indexOf(".vcard")!=-1))
@@ -2232,5 +2284,5 @@
 				link_attachment.appendChild(link_import_attachment);
 			}
-			
+
 			link_attachment.innerHTML += '<br/>';
 			attachments.appendChild(link_attachment);
@@ -2338,7 +2390,7 @@
 			}
 			else{
-				var anchor_pattern = "http://"+location.host+location.pathname+"#"; 
-				
-				if ( ( links.item( i ).href.indexOf( 'javascript:' ) !== 0 ) && 
+				var anchor_pattern = "http://"+location.host+location.pathname+"#";
+
+				if ( ( links.item( i ).href.indexOf( 'javascript:' ) !== 0 ) &&
 					(links.item( i ).href.indexOf(anchor_pattern) !== 0) ) //se não for âncora
 						links.item( i ).setAttribute( 'target', '_blank' );
@@ -2423,5 +2475,5 @@
 		case 'normal':
 			{
-				el.onclick = function(){ 
+				el.onclick = function(){
 					var _this = this;
 					proxy_mensagens.proxy_set_message_flag(currentTab.substr(0,currentTab.indexOf("_r")),'unflagged', function(success){
@@ -2973,5 +3025,5 @@
              if (is_ie){
         	input_return_receipt.checked=true;
-             } 
+             }
              else{
                 input_return_receipt.defaultChecked=true;
