Index: branches/2.3/expressoMail1_2/js/main.js
===================================================================
--- branches/2.3/expressoMail1_2/js/main.js	(revision 4916)
+++ branches/2.3/expressoMail1_2/js/main.js	(revision 4923)
@@ -1869,38 +1869,61 @@
 		// Replace the embedded images for new uids
 		var mainField = document.getElementById('body_'+border_id).contentWindow;
-		var content_body =  mainField.document.getElementsByTagName('body').item(0).innerHTML;
-		var body_images = content_body.match(/msg_num=\d*/g);
-		var images_part = content_body.match(/msg_part=\d*/g);
-		if (body_images)
-		{
-                    for (var i=0; i<body_images.length; i++){
-                        content_body = content_body.replace(body_images[i],"msg_num="+openTab.imapUid[border_id]);
-                    }
-
-                    var allImgs = new Array (images_part.length);
-                    var j=-1;
-                    for (var i in images_part){
-
-                        if (is_ie)
+		var bodyChildNodes =  mainField.document.body.childNodes;
+
+                if (is_ie)
+                {
+                    var content_body =  mainField.document.getElementsByTagName('body').item(0).innerHTML;
+                    var body_images = content_body.match(/msg_num=\d*/g);
+                    var images_part = content_body.match(/msg_part=\d*/g);
+                    if (body_images)
+                    {
+                        for (var i=0; i<body_images.length; i++){
+                            content_body = content_body.replace(body_images[i],"msg_num="+openTab.imapUid[border_id]);
+                        }
+
+                        var allImgs = new Array (images_part.length);
+                        //var j=-1;
+                        for (var i in images_part){
+
                             if (i == 0)
                                 var image_number = parseInt(images_part[i].substr(9));
                             else
                                 image_number = "null";
-                        else
-                            var image_number = parseInt(images_part[i].substr(9));
-
-                        if (! isNaN(image_number))
-                        {
-                            if (! allImgs[image_number])
+                            
+                            if (! isNaN(image_number))
                             {
-                                allImgs[image_number] = true;
-                                j--;
+                                if (! allImgs[image_number])
+                                {
+                                    allImgs[image_number] = true;
+                                    //j--;
+                                }
+                                //content_body = content_body.replace(images_part[i],'msg_part='+j);
                             }
-                            content_body = content_body.replace(images_part[i],'msg_part='+j);
+                            //content_body = content_body.replace(/msg_part=-/g,'msg_part=');
                         }
-                        content_body = content_body.replace(/msg_part=-/g,'msg_part=');
+                        mainField.document.getElementsByTagName('body').item(0).innerHTML = content_body;
                     }
-                    mainField.document.getElementsByTagName('body').item(0).innerHTML = content_body;
                 }
+                else
+                    {
+                        for (var i = 0; i < bodyChildNodes.length; i++){
+                            if (typeof(bodyChildNodes[i].tagName) != 'undefined' && bodyChildNodes[i].tagName.search(/img/i) != -1)
+                            {
+                                bodyChildNodes[i].src =  bodyChildNodes[i].src.replace(/msg_num=\d*/g, "msg_num="+openTab.imapUid[border_id]);
+
+                                var allImgs = new Array();
+                                var image_number = parseInt(bodyChildNodes[i].src.match(/msg_part=\d*/g)[0].substr(9));
+                                if (! allImgs[image_number])
+                                {
+                                    allImgs[image_number] = true;
+                                }
+                            }
+                            else
+                                {
+                                    continue;
+                                }
+
+                        }
+                    }
 
 		//Replace all files to new files
