Index: trunk/expressoMail1_2/js/common_functions.js
===================================================================
--- trunk/expressoMail1_2/js/common_functions.js	(revision 325)
+++ trunk/expressoMail1_2/js/common_functions.js	(revision 341)
@@ -35,6 +35,6 @@
 	var bar = Element("toolbar");
 	var offset = 0;
-	if(bar.style.visibility != 'hidden')
-		offset = (bar.offsetHeight ? bar.offsetHeight :  bar.clientHeight);
+	if(bar.style.visibility != 'hidden') 
+		offset = (bar.offsetHeight ? bar.offsetHeight :  bar.clientHeight);	
 
 	var screenHeight = document.body.clientHeight ? document.body.clientHeight : document.body.offsetHeight;
@@ -77,27 +77,27 @@
 function get_lang(_key,_arg1,_arg2,_arg3,_arg4) {
 
-	if(!array_lang[0]){
+	if(!array_lang[0]){		
 		return _key+"*";
 	}
-	_value = "";
+	_value = "";	
 	for(i = 0; i < array_lang[0].length;i++){
 		if(array_lang[0][i] == _key.toLowerCase()) {
-			_value = array_lang[1][i];
+			_value = array_lang[1][i];					
 			break;
 		}
-	}
-
+	}	
+	
 	if(!_value)
 		return _key+"*";
-
+			
 	if(_arg1 || _arg2 ||_arg3 || _arg4) {
 		for(j = 1; j <= 4; j++){
 			if(eval("_arg"+j)) {
-				var regExp = new RegExp("%"+j+"");
+				var regExp = new RegExp("%"+j+"");		
 				_value = _value.replace(regExp,eval("_arg"+j));
 			}
 		}
 	}
-
+	
 	return _value;
 }
@@ -110,5 +110,5 @@
 
 // Change the class of message.
-// In refresh, the flags UnRead and UnSeen don't exist anymore.
+// In refresh, the flags UnRead and UnSeen don't exist anymore. 
 function set_msg_as_read(msg_number, selected){
 	tr_message = Element(msg_number);
@@ -168,8 +168,8 @@
 	//Get element tBody.
 	main = document.getElementById("tbody_box");
-
+		
 	// Get all TR (messages) in tBody.
 	main_list = main.childNodes;
-
+	
 	return main_list.length;
 }
@@ -178,5 +178,5 @@
 	div_attachment = document.getElementById("id_div_attachment");
 	var params = '';
-
+	
 	if (div_attachment == null){
 		var div_attachment = document.createElement("DIV");
@@ -193,5 +193,5 @@
 
 function download_all_attachments(msg_folder, msg_number){
-	var handler_source = function(data){
+	var handler_source = function(data){		
 		download_attachments(null, null, data, null,null,'anexos.zip');
 	}
@@ -203,5 +203,5 @@
 	if (! divFiles)
 		return false;
-
+	
 	if (divFiles.lastChild)
 		var countDivFiles = parseInt(divFiles.lastChild.id.split('_')[2]) + 1;
@@ -209,12 +209,12 @@
 	if (! countDivFiles)
 		var countDivFiles = 1;
-
+	
 	divFile = document.createElement('DIV');
-
+	
 	var inputFile = document.createElement("INPUT");
-
+	
 	var tmp_id_border = document.createAttribute('id_border');
 	tmp_id_border.value = id_border;
-
+	
 	inputFile.setAttributeNode(tmp_id_border);
 	inputFile.id = "inputFile_"+id_border+"_"+countDivFiles;
@@ -224,15 +224,15 @@
 	inputFile.maxLength = 255;
 	inputFile.name='file_'+countDivFiles;
-
+	
 	divFile.appendChild(inputFile);
-
+	
 	var linkFile = document.createElement("A");
 	linkFile.id = "linkFile_"+id_border+"_"+countDivFiles;
 	linkFile.href='javascript:void(0)';
 	linkFile.onclick=function () {removeFile(this.id.replace("link","div")); return false;};
-	linkFile.innerHTML=get_lang("Remove");
+	linkFile.innerHTML=get_lang("Remove");	
 	//divFile.innerHTML += "&nbsp;&nbsp;";
 	divFile.appendChild(linkFile);
-	divFile.id = "divFile_"+id_border+"_"+countDivFiles;
+	divFile.id = "divFile_"+id_border+"_"+countDivFiles;	
 	divFiles.appendChild(divFile);
 }
@@ -287,9 +287,9 @@
 // Funcao usada para escrever mensagem
 // notimeout = True : mensagem nao apaga
-function write_msg(msg, notimeout){
-
+function write_msg(msg, notimeout){	
+	
 	if (setTimeout_write_msg)
 		clearTimeout(setTimeout_write_msg);
-
+	
 	var msg_div = Element('em_div_write_msg');
 	var old_divStatusBar = Element("divStatusBar");
@@ -302,8 +302,8 @@
 		msg_div.style.display = 'none';
 		old_divStatusBar.parentNode.insertBefore(msg_div,old_divStatusBar);
-	}
+	}	
 	msg_div.innerHTML = '<table bgcolor="#f7f8fa" width=100% cellspacing="0" cellpadding="0" border="0"><tbody><tr><th width="40%"></th><th noWrap class="action_info_th">'+msg+'</th><th width="40%"></th></tr></tbody></table>';
 	old_divStatusBar.style.display = 'none';
-	msg_div.style.display = '';
+	msg_div.style.display = '';	
 	// Nao ponha var na frente!! jakjr
 	handle_write_msg = function(){
@@ -312,5 +312,5 @@
 				clean_msg();
 			else
-				write_msg(old_msg, true);
+				write_msg(old_msg, true);			
 		}
 		catch(e){}
@@ -328,5 +328,5 @@
 	if(msg_div)
 		msg_div.style.display = 'none';
-	old_divStatusBar.style.display = '';
+	old_divStatusBar.style.display = '';	
 }
 
@@ -371,5 +371,5 @@
 	var quickSearchKeyBegin;
 	var quickSearchKeyEnd;
-
+	
 	var handler_emQuickSearch = function(data)
 	{
@@ -378,10 +378,10 @@
 			window_DropDownContacts.style.visibility = 'hidden';
 		}
-
+		
 		if ((!data.status) && (data.error == "many results")){
 			alert(get_lang('More than %1 results. Please, try to refine your search.',200));
 			return false;
 		}
-
+			
 		if (data.length > 0){
 			if ((field != 'null') && (ID != 'null'))
@@ -400,8 +400,8 @@
 		return true;
 	}
-
+	
 	if ((field != 'null') && (ID != 'null'))
 	{
-		Element(field +'_'+ ID).focus(); //necessï¿œrio para o IE.
+		Element(field +'_'+ ID).focus(); //It requires for IE.
 		var i = getPosition(Element(field +'_'+ ID)); //inputBox.selectionStart;
 		var j = --i;
@@ -420,10 +420,10 @@
 	else
 		var search_for = emailList;
-
+	
 	if (search_for.length < 4){
 		alert(get_lang('Your search argument must be longer than 4 characters.'));
 		return false;
 	}
-
+	
 	cExecute ("$this.ldap_functions.quicksearch&search_for="+search_for+"&field="+field+"&ID="+ID, handler_emQuickSearch);
 }
@@ -473,35 +473,35 @@
 
 function url_encode(str){
-    var hex_chars = "0123456789ABCDEF";
-    var noEncode = /^([a-zA-Z0-9\_\-\.])$/;
-    var n, strCode, hex1, hex2, strEncode = "";
-
-    for(n = 0; n < str.length; n++) {
-        if (noEncode.test(str.charAt(n))) {
-            strEncode += str.charAt(n);
-        } else {
-            strCode = str.charCodeAt(n);
-            hex1 = hex_chars.charAt(Math.floor(strCode / 16));
-            hex2 = hex_chars.charAt(strCode % 16);
-            strEncode += "%" + (hex1 + hex2);
-        }
-    }
-    return strEncode;
-}
-
-function url_decode(str) {
-
-	var n, strCode, strDecode = "";
-	for (n = 0; n < str.length; n++) {
-	    if (str.charAt(n) == "%") {
-	        strCode = str.charAt(n + 1) + str.charAt(n + 2);
-	        strDecode += String.fromCharCode(parseInt(strCode, 16));
-	        n += 2;
-	    } else {
-	        strDecode += str.charAt(n);
-	    }
-	}
-	return strDecode;
-}
+    var hex_chars = "0123456789ABCDEF"; 
+    var noEncode = /^([a-zA-Z0-9\_\-\.])$/; 
+    var n, strCode, hex1, hex2, strEncode = ""; 
+
+    for(n = 0; n < str.length; n++) { 
+        if (noEncode.test(str.charAt(n))) { 
+            strEncode += str.charAt(n); 
+        } else { 
+            strCode = str.charCodeAt(n); 
+            hex1 = hex_chars.charAt(Math.floor(strCode / 16)); 
+            hex2 = hex_chars.charAt(strCode % 16); 
+            strEncode += "%" + (hex1 + hex2); 
+        } 
+    } 
+    return strEncode; 
+}  
+
+function url_decode(str) { 
+
+	var n, strCode, strDecode = ""; 
+	for (n = 0; n < str.length; n++) { 
+	    if (str.charAt(n) == "%") { 
+	        strCode = str.charAt(n + 1) + str.charAt(n + 2); 
+	        strDecode += String.fromCharCode(parseInt(strCode, 16)); 
+	        n += 2; 
+	    } else { 
+	        strDecode += str.charAt(n); 
+	    } 
+	} 
+	return strDecode; 
+}  
 
 
@@ -528,8 +528,8 @@
 			var Lp=obj.createTextRange();
 		}
-
+		
 		Lp.setEndPoint("EndToStart",M);
 		var rb=Lp.text.length;
-
+		
 		if(rb > obj.value.length)
 		{
@@ -541,27 +541,27 @@
 
 function trim(inputString) {
-   if (typeof inputString != "string")
+   if (typeof inputString != "string") 
    	return inputString;
-
+      
    var retValue = inputString;
    var ch = retValue.substring(0, 1);
-   while (ch == " ") {
+   while (ch == " ") { 
 	  retValue = retValue.substring(1, retValue.length);
 	  ch = retValue.substring(0, 1);
    }
    ch = retValue.substring(retValue.length-1, retValue.length);
-   while (ch == " ") {
+   while (ch == " ") { 
 	  retValue = retValue.substring(0, retValue.length-1);
 	  ch = retValue.substring(retValue.length-1, retValue.length);
    }
-   while (retValue.indexOf("  ") != -1) {
-	  retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length);
+   while (retValue.indexOf("  ") != -1) { 
+	  retValue = retValue.substring(0, retValue.indexOf("  ")) + retValue.substring(retValue.indexOf("  ")+1, retValue.length); 
    }
-   return retValue;
+   return retValue; 
 }
 
 function increment_folder_unseen(){
 	var folder_id = get_current_folder();
-
+	
 	var folder_unseen = Element('dftree_'+folder_id+'_unseen');
 	if (folder_unseen)
@@ -579,5 +579,5 @@
 function decrement_folder_unseen(){
 	var folder_id = get_current_folder();
-
+	
 	var folder_unseen = Element('dftree_'+folder_id+'_unseen');
 	if(!folder_unseen)
@@ -603,10 +603,10 @@
 	var strTemp = "";
 	var iTemp = 0;
-
+	
 	if(v_length < 1)
 		return "";
 
 	var v_length = value ? value.length : 0;
-
+	
 	while(iTemp < v_length){
 		if(value && value.charAt(iTemp) != w_space){
@@ -615,5 +615,5 @@
 		}
 		iTemp++;
-	}
+	}	
 	return strTemp;
 }
@@ -671,5 +671,5 @@
 	var main_list = main.childNodes;
 	var len_main_list = main_list.length;
-
+	
 	if (select)
 	{
