Index: trunk/expressoMail1_2/inc/class.db_functions.inc.php
===================================================================
--- trunk/expressoMail1_2/inc/class.db_functions.inc.php	(revision 7655)
+++ trunk/expressoMail1_2/inc/class.db_functions.inc.php	(revision 7673)
@@ -181,7 +181,8 @@
 
 	function getAddrs($array_addrs) {
-		$array_addrs_final = array();				
-
-		for($i = 0; $i < count($array_addrs); ++$i){
+		$array_addrs_final = array();
+
+        $array_addrs_count = count($array_addrs);
+		for($i = 0; $i < $array_addrs_count; ++$i){
 			$j = count($array_addrs_final);
 
Index: trunk/expressoMail1_2/inc/class.imap_functions.inc.php
===================================================================
--- trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 7655)
+++ trunk/expressoMail1_2/inc/class.imap_functions.inc.php	(revision 7673)
@@ -245,5 +245,6 @@
 								array('filter' => $filter, 'criteria' => array('deepness' => '2'))
 							);
-							for($i=0; $i<count($sort_array_msg); ++$i){
+                            $sort_array_msg_count = count($sort_array_msg);
+							for($i=0; $i<$sort_array_msg_count; ++$i){
 								if(!isset($return[$i]['msg_number']))
 									continue;
@@ -518,5 +519,6 @@
 			$elements = imap_mime_header_decode($string);
 
-  			for($i = 0;$i < count($elements);++$i)
+            $elements_count = count($elements);
+  			for($i = 0;$i < $elements_count;++$i)
   			{
    				$charset = strtolower($elements[$i]->charset);
@@ -785,6 +787,7 @@
 			$return = array();
 			$array_names_keys = array_keys($sorted_msgs);
-			
-			for($i = 0; $i < count($sorted_msgs); ++$i){
+
+            $sorted_msgs_count = count($sorted_msgs);
+			for($i = 0; $i < $sorted_msgs_count; ++$i){
 			
 				$new_params = array();
@@ -2559,5 +2562,6 @@
 		}else{
 			$child = $base_path.$this->imap_delimiter;
-			for($i =0; $i < count($test); ++$i){
+            $test_count = count($test);
+			for($i =0; $i < $test_count; ++$i){
 				$child .= ($test[$i] ? $test[$i] : $this->functions->getLang("New Folder"));
 				$namebox =  mb_convert_encoding($child, "UTF7-IMAP", "UTF-8");
@@ -3654,5 +3658,6 @@
 			return $returns;
 		}else{
-			for($i = 0; $i < count($array_names_keys); ++$i){
+            $array_names_keys_count = count($array_names_keys);
+			for($i = 0; $i < $array_names_keys_count; ++$i){
 				$param['folder'] = $array_names_keys[$i];
 				$param['msgs_to_set'] = $sorted_msgs[$array_names_keys[$i]];
Index: trunk/expressoMail1_2/inc/class.exporteml.inc.php
===================================================================
--- trunk/expressoMail1_2/inc/class.exporteml.inc.php	(revision 7655)
+++ trunk/expressoMail1_2/inc/class.exporteml.inc.php	(revision 7673)
@@ -123,5 +123,6 @@
                     if (is_array($files))
                     {
-                        for ($i=0; $i < count($files); ++$i)
+                        $files_count = count($files);
+                        for ($i=0; $i < $files_count; ++$i)
                         {
                             $files[$i] = escapeshellarg($files[$i]);
@@ -315,5 +316,6 @@
 			
 			//cria um .zip com as mensagens selecionadas
-			for($i = 0; $i < count($msg_number); ++$i)
+            $msg_number_count = count($msg_number);
+			for($i = 0; $i < $msg_number_count; ++$i)
 			{
 				$header         = $this-> getHeader($msg_number[$i]);                                                                                   
@@ -353,12 +355,14 @@
 		}else{
 			$array_names_keys = array_keys($sorted_msgs);
-			
-			for($i = 0; $i < count($array_names_keys); ++$i){
+
+            $array_names_keys_count = count($array_names_keys);
+			for($i = 0; $i < $array_names_keys_count; ++$i){
 				$this->folder = mb_convert_encoding($array_names_keys[$i], "UTF7-IMAP","UTF-8, ISO-8859-1, UTF7-IMAP");
 				$msg_number = explode(',', $sorted_msgs[$array_names_keys[$i]]);
 				$tempDir = $this->tempDir;
 				$this->connectImap();
-				
-				for($j = 0; $j < count($msg_number); ++$j)
+
+                $msg_number_count = count($msg_number);
+				for($j = 0; $j < $msg_number_count; ++$j)
 				{
 					$header         = $this-> getHeader($msg_number[$j]);                                                                                   
@@ -474,5 +478,6 @@
 			}
 
-			for($i = 0; $i < count($array_ids); ++$i)
+            $array_ids_count = count($array_ids);
+			for($i = 0; $i < $array_ids_count; ++$i)
 			{
 				$header         = $this-> getHeader($array_ids[$i]);                                                                                   
@@ -796,6 +801,6 @@
 		
 		$fileNames = Array();
-			
-		for ($i = 0; $i < count($attachments); ++$i)
+		$attachments_count = count($attachments);
+		for ($i = 0; $i < $attachments_count; ++$i)
                 {
                    $attachments[$i]['name'] = $this->remove_accents($attachments[$i]['name']);
@@ -803,5 +808,6 @@
                 }
 
-                for ($i = 0; $i < count($attachments); ++$i)
+                $attachments_count = count($attachments);
+                for ($i = 0; $i < $attachments_count; ++$i)
                 {
                         $fileName = $attachments[$i]['name'];
@@ -811,5 +817,6 @@
                         if (count($result) > 1)
                         {
-                            for ($j = 1; $j < count($result); ++$j)
+                            $result_count = count($result);
+                            for ($j = 1; $j < $result_count; ++$j)
                             {
                                 $replacement = '('.$j.')$0';
Index: trunk/expressoMail1_2/inc/class.message_components.inc.php
===================================================================
--- trunk/expressoMail1_2/inc/class.message_components.inc.php	(revision 7655)
+++ trunk/expressoMail1_2/inc/class.message_components.inc.php	(revision 7673)
@@ -107,5 +107,6 @@
                 }
 
-                for($p = 0, $i = 1; $p < count($parts); ++$n, ++$p, ++$i)
+                $parts_count = count($parts);
+                for($p = 0, $i = 1; $p < $parts_count; ++$n, ++$p, ++$i)
                 {
                     // Skip the following...
Index: trunk/expressoMail1_2/inc/class.functions.inc.php
===================================================================
--- trunk/expressoMail1_2/inc/class.functions.inc.php	(revision 7655)
+++ trunk/expressoMail1_2/inc/class.functions.inc.php	(revision 7673)
@@ -126,6 +126,7 @@
 				$includeFiles[0] = null;
 				// End Bug fixed.
-			}														
-			for($i = 0; $i < count($files); ++$i) {
+			}
+            $files_count = count($files);
+			for($i = 0; $i < $files_count; ++$i) {
 				if(count(explode('.js',$files[$i])) > 1) {
 					if($includeFiles  && array_search(trim($files[$i]),$includeFiles)){	
Index: trunk/expressoMail1_2/inc/class.phpmailer.php
===================================================================
--- trunk/expressoMail1_2/inc/class.phpmailer.php	(revision 7655)
+++ trunk/expressoMail1_2/inc/class.phpmailer.php	(revision 7673)
@@ -472,5 +472,6 @@
     function MailSend($header, $body) {
         $to = "";
-        for($i = 0; $i < count($this->to); ++$i)
+        $to_count = count($this->to);
+        for($i = 0; $i < $to_count; ++$i)
         {
             if($i != 0) { $to .= ", "; }
@@ -533,15 +534,18 @@
 
         // Attempt to send attach all recipients
-        for($i = 0; $i < count($this->to); ++$i)
+        $to_count = count($this->to);
+        for($i = 0; $i < $to_count; ++$i)
         {
 		if(!$this->smtp->Recipient($this->to[$i][0]))
 			$bad_rcpt[] = $this->to[$i][0];
         }
-        for($i = 0; $i < count($this->cc); ++$i)
+        $cc_count = count($this->cc);
+        for($i = 0; $i < $cc_count; ++$i)
         {
 		if(!$this->smtp->Recipient($this->cc[$i][0]))
 			$bad_rcpt[] = $this->cc[$i][0];
         }
-        for($i = 0; $i < count($this->bcc); ++$i)
+        $bcc_count = count($this->bcc);
+        for($i = 0; $i < $bcc_count; ++$i)
         {
                 if(!$this->smtp->Recipient($this->bcc[$i][0]))
@@ -563,6 +567,7 @@
             //Postfix version 2.1.5-9
             $array_error = explode(":", $this->smtp->error['smtp_msg']);
-            
-            for($i = 0; $i < count($bad_rcpt); ++$i)
+
+            $bad_rcpt_count = count($bad_rcpt);
+            for($i = 0; $i < $bad_rcpt_count; ++$i)
             {
                 if($i != 0) { $error .= ", "; }
@@ -826,5 +831,6 @@
         if(count($addr) > 1)
         {
-            for($i = 1; $i < count($addr); ++$i)
+            $addr_count = count($addr);
+            for($i = 1; $i < $addr_count; ++$i)
                 $addr_str .= ", " . $this->AddrFormat($addr[$i]);
         }
@@ -867,9 +873,11 @@
         $line = explode($this->LE, $message);
         $message = "";
-        for ($i=0 ;$i < count($line); ++$i)
+        $line_count = count($line);
+        for ($i=0 ;$i < $line_count; ++$i)
         {
           $line_part = explode(" ", $line[$i]);
           $buf = "";
-          for ($e = 0; $e<count($line_part); $e++)
+          $line_part_count = count($line_part);
+          for ($e = 0; $e<$line_part_count; $e++)
           {
               $word = $line_part[$e];
@@ -1031,5 +1039,6 @@
 
         // Add custom headers
-        for($index = 0; $index < count($this->CustomHeader); ++$index)
+        $CustomHeader_count = count($this->CustomHeader);
+        for($index = 0; $index < $CustomHeader_count; ++$index)
         {
             $result .= $this->HeaderLine(trim($this->CustomHeader[$index][0]), 
@@ -1265,5 +1274,6 @@
 
         // Add all attachments
-        for($i = 0; $i < count($this->attachment); ++$i)
+        $attachment_count = count($this->attachment);
+        for($i = 0; $i < $attachment_count; ++$i)
         {
             // Check for string attachment
@@ -1540,5 +1550,6 @@
     function InlineImageExists() {
         $result = false;
-        for($i = 0; $i < count($this->attachment); ++$i)
+        $attachment_count = count($this->attachment);
+        for($i = 0; $i < $attachment_count; ++$i)
         {
             if($this->attachment[$i][6] == "inline")
