Index: trunk/expressoMail1_2/js/draw_api.js
===================================================================
--- trunk/expressoMail1_2/js/draw_api.js	(revision 999)
+++ trunk/expressoMail1_2/js/draw_api.js	(revision 1000)
@@ -916,5 +916,4 @@
 
 	proxy_mensagens.messages_list(current_folder,1,preferences.max_email_per_page,sort,search,sort_box_reverse,handler_draw_box);
-	cExecute ("$this.imap_functions.get_range_msgs2&folder="+current_folder+"&msg_range_begin=1&msg_range_end="+preferences.max_email_per_page+"&sort_box_type="+sort+"&search_box_type="+search+"&sort_box_reverse="+sort_box_reverse+"", handler_draw_box);
 	current_page = 1;
 	//Comentado para nao sobrepor o numero de msgs nao lidas ao utilizar os filtros
@@ -978,5 +977,6 @@
 			currentTab = ID;
 			openTab.type[ID] = 2;
-			cExecute("$this.imap_functions.get_info_msg&msg_number="+folder.nextSibling.id+"&msg_folder="+nextMsgBox, show_msg);
+                        proxy_mensagens.get_msg(parseInt(folder.nextSibling.id),nextMsgBox,true,show_msg);
+			//cExecute("$this.imap_functions.get_info_msg&msg_number="+folder.nextSibling.id+"&msg_folder="+nextMsgBox, show_msg);
 		};
 	}
@@ -1014,5 +1014,6 @@
 			currentTab = ID;
 			openTab.type[ID] = 2;
-			cExecute("$this.imap_functions.get_info_msg&msg_number="+folder.previousSibling.id+"&msg_folder=" + previousMsgBox, show_msg);
+			//cExecute("$this.imap_functions.get_info_msg&msg_number="+folder.previousSibling.id+"&msg_folder=" + previousMsgBox, show_msg);
+                        proxy_mensagens.get_msg(parseInt(folder.previousSibling.id),previousMsgBox,true,show_msg);
 		};
 	}
@@ -1500,5 +1501,8 @@
 			if(info_msg.attachments.length > 1) {
 				var link_attachment     = document.createElement("A");
-				link_attachment.setAttribute("href", "javascript:download_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')");
+                 if(proxy_mensagens.is_local_folder(current_folder))
+                    link_attachment.setAttribute("href", "javascript:expresso_local_messages.download_all_local_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')");
+                else
+                    link_attachment.setAttribute("href", "javascript:download_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')");
 				link_attachment.innerHTML = " "+info_msg.attachments.length+' '+get_lang('files')+' :: '+get_lang('Download all atachments');
 				link_attachment.innerHTML += '<BR>';
@@ -1603,5 +1607,5 @@
 			var showImgLink = document.createElement('DIV');
 			showImgLink.id="show_img_link";
-			showImgLink.onclick = function () { cExecute('$this.imap_functions.get_info_msg&msg_number='+info_msg.msg_number+'&msg_folder='+info_msg.msg_folder,show_msg_img); };
+			showImgLink.onclick = function(){show_msg_img(info_msg.msg_number,info_msg.msg_folder)};
 			showImgLink.className="show_img_link";
 			showImgLink.innerHTML = get_lang("Show images from")+": "+info_msg.from.email;
@@ -1642,5 +1646,8 @@
 			_link_attachments 	= document.createElement("A");
 			_link_attachments.className = "message_options";
-			_link_attachments.setAttribute("href", "javascript:download_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')");
+             if(proxy_mensagens.is_local_folder(current_folder))
+                _link_attachments.setAttribute("href", "javascript:expresso_local_messages.download_all_local_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')");
+            else
+                _link_attachments.setAttribute("href", "javascript:download_all_attachments('"+info_msg.msg_folder+"','"+info_msg.msg_number+"')");
 			_link_attachments.innerHTML = get_lang('Download all atachments');
 		}
@@ -2617,8 +2624,11 @@
 		'<span class="message_options_move"><span ' + change_font_color + ' title="'+get_lang("Move")+'" class="message_options" onclick=wfolders.makeWindow(\"\",\"move_to\")>'+get_lang("Move")+'</span></span>'+
    		'<span class="message_options_print"><span ' + change_font_color + ' title="'+get_lang("Print")+'" class="message_options" onclick=print_all()>'+get_lang("Print")+'</span></span>'+
-		'<span class="message_options_export"><span ' + change_font_color + ' title="'+get_lang("Export")+'" class="message_options" onclick="export_all_selected_msgs()">'+get_lang("Export")+'</span></span>' +
+        '<span class="message_options_export"><span ' + change_font_color + ' title="'+get_lang("Export")+'" class="message_options" onclick="proxy_mensagens.export_all_messages()">'+get_lang("Export")+'</span></span>' +
 		'<span class="message_options_import"><span ' + change_font_color + ' title="'+get_lang("Import")+'" class="message_options" onclick="import_window()">'+get_lang("Import")+'</span></span>';
-	if(preferences.use_local_messages==1)
-		span_options.innerHTML += '&nbsp;<span ' + change_font_color + ' title="'+get_lang("Archive")+'" class="message_options" onclick="archive_msgs(\''+folder+'\',null)">'+get_lang("Archive")+'</span>';
+    if(preferences.use_local_messages==1)
+		if(proxy_mensagens.is_local_folder(current_folder))
+			span_options.innerHTML += '&nbsp; <span title="'+get_lang("Unarchive")+'" class="message_options" onclick="expresso_local_messages.unarchive_msgs(\''+folder+'\',null)">'+get_lang("Unarchive")+'</span>';
+		else
+			span_options.innerHTML += '&nbsp; <span title="'+get_lang("Archive")+'" class="message_options" onclick="archive_msgs(\''+folder+'\',null)">'+get_lang("Archive")+'</span>';
 	if (use_spam_filter) {
 		if ( current_folder == 'INBOX'+cyrus_delimiter+'Spam' )	{
