Index: trunk/jabberit_messenger/jmessenger/inc/class.ContactsIm.inc.php
===================================================================
--- trunk/jabberit_messenger/jmessenger/inc/class.ContactsIm.inc.php	(revision 7655)
+++ trunk/jabberit_messenger/jmessenger/inc/class.ContactsIm.inc.php	(revision 7673)
@@ -69,6 +69,7 @@
 		
 		if( is_array($users) )
-		{	
-			for($i = 0; $i < count($users); ++$i)
+		{
+            $users_count = count($users);
+			for($i = 0; $i < $users_count; ++$i)
 			{
 				if( is_array($hostsJabber) )
@@ -203,8 +204,10 @@
 
 			$_restrict = array();
-			
-			for( $i = 0 ; $i < count($orgs) ; ++$i )
-			{
-				for( $j = 0 ; $j < count($array_uids) ; ++$j )
+
+            $orgs_count = count($orgs);
+			for( $i = 0 ; $i < $orgs_count; ++$i )
+			{
+                $array_uids_count = count($array_uids);
+				for( $j = 0 ; $j < $array_uids_count; ++$j )
 				{
 					if( trim($array_uids[$j]['ou']) === trim($orgs[$i]) )
@@ -331,6 +334,7 @@
 						$posAll = $this->strallpos($ou_User, "OU=" );
 						$orgs = array();
-				
-						for( $i = 0 ; $i < count($posAll); ++$i )
+
+                        $posAll_count = count($posAll);
+						for( $i = 0 ; $i < $posAll_count; ++$i )
 						{
 							$pos = strpos($ou_User, ",");
@@ -369,6 +373,7 @@
 							$posAll = $this->strallpos($ou_User, "OU=" );
 							$orgs = array();
-					
-							for( $i = 0 ; $i < count($posAll); ++$i )
+
+                            $posAll_count = count($posAll);
+							for( $i = 0 ; $i < $posAll_count; ++$i )
 							{
 								$pos = strpos($ou_User, ",");
Index: trunk/jabberit_messenger/jmessenger/inc/class.LdapIM.inc.php
===================================================================
--- trunk/jabberit_messenger/jmessenger/inc/class.LdapIM.inc.php	(revision 7655)
+++ trunk/jabberit_messenger/jmessenger/inc/class.LdapIM.inc.php	(revision 7673)
@@ -124,6 +124,7 @@
 		{
 			$confHosts	= $this->hostsJabber;
-			
-			for($i = 0; $i < count($confHosts); ++$i )
+
+            $confHosts_count = count($confHosts);
+			for($i = 0; $i < $confHosts_count; ++$i )
 			{
 				if( $pData['serverLdap'] == $confHosts[$i]['serverLdap'] )
@@ -209,6 +210,7 @@
 			{
 				$confHosts	= $this->hostsJabber;
-			
-				for($i = 0; $i < count($confHosts); ++$i )
+
+                $confHosts_count = count($confHosts);
+				for($i = 0; $i < $confHosts_count; ++$i )
 				{
 					if( $this->ldap )
@@ -278,6 +280,7 @@
 		{
 			$confHosts	= $this->hostsJabber;
-		
-			for($i = 0; $i < count($confHosts); ++$i )
+
+            $confHosts_count = count($confHosts);
+			for($i = 0; $i < $confHosts_count; ++$i )
 			{
 				if( $this->ldap )
@@ -321,6 +324,7 @@
 		{
 			$confHosts	= $this->hostsJabber;
-			
-			for($i = 0; $i < count($confHosts); ++$i )
+
+            $confHosts_count = count($confHosts);
+			for($i = 0; $i < $confHosts_count; ++$i )
 			{
 				if( $pLdap_host == $confHosts[$i]['serverLdap'] )
@@ -399,5 +403,6 @@
 			$confHosts	= $this->hostsJabber;	
 
-			for( $i = 0; $i < count($confHosts); ++$i )
+            $confHosts_count = count($confHosts);
+			for( $i = 0; $i < $confHosts_count; ++$i )
 			{
 				if( trim($host) === trim($confHosts[$i]['jabberName']) )
@@ -452,7 +457,8 @@
 		$result = array();
 		$return	= array();
-		$conn	= "";		
-
-		for( $i = 0; $i < count($confHosts); ++$i )
+		$conn	= "";
+
+        $confHosts_count = count($confHosts);
+		for( $i = 0; $i < $confHosts_count; ++$i )
 		{
 			if( $pLdap && $pLdap == $confHosts[$i]['serverLdap'] )
Index: trunk/jabberit_messenger/jmessenger/inc/class.DataBaseIM.inc.php
===================================================================
--- trunk/jabberit_messenger/jmessenger/inc/class.DataBaseIM.inc.php	(revision 7655)
+++ trunk/jabberit_messenger/jmessenger/inc/class.DataBaseIM.inc.php	(revision 7673)
@@ -57,7 +57,8 @@
 		$hostsJabber = unserialize($this->getHostsJabber());
 		$findHosts	= explode(":", $pItem['item']);
-		$return = "";	
-		
-		for( $i = 0 ; $i < count($hostsJabber); ++$i )
+		$return = "";
+
+        $hostsJabber_count = count($hostsJabber);
+		for( $i = 0 ; $i < $hostsJabber_count; ++$i )
 			if( $hostsJabber[$i]['org'] == $findHosts[0] && $hostsJabber[$i]['jabberName'] == $findHosts[1] )
 			{
@@ -490,5 +491,6 @@
 		$orgs = array();
 
-		for( $i = 0 ; $i < count($posAll); ++$i )
+        $posAll_count = count($posAll);
+		for( $i = 0 ; $i < $posAll_count; ++$i )
 		{
 			$pos = strpos($organization, ",");
@@ -628,5 +630,6 @@
 					if( count($confHostsOrgs) > 0 )
 					{
-						for( $i = 0; $i < count($confHostsOrgs); ++$i)
+                        $confHostsOrgs_count = count($confHostsOrgs);
+						for( $i = 0; $i < $confHostsOrgs_count; ++$i)
 							if( $confHostsOrgs[$i]['org'] == $hosts[0] && $confHostsOrgs[$i]['jabberName'] == $hosts[1])
 								$key = $i;	
Index: trunk/jabberit_messenger/inc/login.php
===================================================================
--- trunk/jabberit_messenger/inc/login.php	(revision 7655)
+++ trunk/jabberit_messenger/inc/login.php	(revision 7673)
@@ -86,7 +86,8 @@
 		
 		if( $voip_enabled )
-			$pluginsJava[] = "callVoip.jar";		
-		
-		for( $i = 0; $i < count($pluginsJava); ++$i )
+			$pluginsJava[] = "callVoip.jar";
+
+        $pluginsJava_count = count($pluginsJava);
+		for( $i = 0; $i < $pluginsJava_count; ++$i )
 		{
 			$javaFiles	 .= $path . "plugins/" . $pluginsJava[$i] . ",";
Index: trunk/jabberit_messenger/inc/class.contacts_im.inc.php
===================================================================
--- trunk/jabberit_messenger/inc/class.contacts_im.inc.php	(revision 7655)
+++ trunk/jabberit_messenger/inc/class.contacts_im.inc.php	(revision 7673)
@@ -92,6 +92,7 @@
 
 		if( is_array($users) )
-		{	
-			for($i = 0; $i < count($users); ++$i)
+		{
+            $users_count = count($users);
+			for($i = 0; $i < $users_count; ++$i)
 			{
 				if( is_array($hostsJabber) )
@@ -225,8 +226,10 @@
 
 			$_restrict = array();
-			
-			for( $i = 0 ; $i < count($orgs) ; ++$i )
-			{
-				for( $j = 0 ; $j < count($array_uids) ; ++$j )
+
+            $orgs_count = count($orgs);
+			for( $i = 0 ; $i < $orgs_count; ++$i )
+			{
+                $array_uids_count = count($array_uids);
+				for( $j = 0 ; $j < $array_uids_count; ++$j )
 				{
 					if( trim($array_uids[$j]['ou']) === trim($orgs[$i]) )
@@ -331,6 +334,7 @@
 						$posAll = $this->strallpos($ou_User, "OU=" );
 						$orgs = array();
-				
-						for( $i = 0 ; $i < count($posAll); ++$i )
+
+                        $posAll_count = count($posAll);
+						for( $i = 0 ; $i < $posAll_count; ++$i )
 						{
 							$pos = strpos($ou_User, ",");
@@ -369,6 +373,7 @@
 							$posAll = $this->strallpos($ou_User, "OU=" );
 							$orgs = array();
-					
-							for( $i = 0 ; $i < count($posAll); ++$i )
+
+                            $posAll_count = count($posAll);
+							for( $i = 0 ; $i < $posAll_count; ++$i )
 							{
 								$pos = strpos($ou_User, ",");
Index: trunk/jabberit_messenger/inc/class.ldap_im.inc.php
===================================================================
--- trunk/jabberit_messenger/inc/class.ldap_im.inc.php	(revision 7655)
+++ trunk/jabberit_messenger/inc/class.ldap_im.inc.php	(revision 7673)
@@ -125,6 +125,7 @@
 		{
 			$confHosts	= $this->hostsJabber;
-			
-			for($i = 0; $i < count($confHosts); ++$i )
+
+            $confHosts_count = count($confHosts);
+			for($i = 0; $i < $confHosts_count; ++$i )
 			{
 				if( $pData['serverLdap'] == $confHosts[$i]['serverLdap'] )
@@ -210,6 +211,7 @@
 			{
 				$confHosts	= $this->hostsJabber;
-			
-				for($i = 0; $i < count($confHosts); ++$i )
+
+                $confHosts_count = count($confHosts);
+				for($i = 0; $i < $confHosts_count; ++$i )
 				{
 					if( $this->ldap )
@@ -279,6 +281,7 @@
 		{
 			$confHosts	= $this->hostsJabber;
-		
-			for($i = 0; $i < count($confHosts); ++$i )
+
+            $confHosts_count = count($confHosts);
+			for($i = 0; $i < $confHosts_count; ++$i )
 			{
 				if( $this->ldap )
@@ -322,6 +325,7 @@
 		{
 			$confHosts	= $this->hostsJabber;
-			
-			for($i = 0; $i < count($confHosts); ++$i )
+
+            $confHosts_count = count($confHosts);
+			for($i = 0; $i < $confHosts_count; ++$i )
 			{
 				if( $pLdap_host == $confHosts[$i]['serverLdap'] )
@@ -396,7 +400,8 @@
 		$result = array();
 		$return	= array();
-		$conn	= "";		
-
-		for( $i = 0; $i < count($confHosts); ++$i )
+		$conn	= "";
+
+        $confHosts_count = count($confHosts);
+		for( $i = 0; $i < $confHosts_count; ++$i )
 		{
 			if( $pLdap && $pLdap == $confHosts[$i]['serverLdap'] )
Index: trunk/jabberit_messenger/inc/class.db_im.inc.php
===================================================================
--- trunk/jabberit_messenger/inc/class.db_im.inc.php	(revision 7655)
+++ trunk/jabberit_messenger/inc/class.db_im.inc.php	(revision 7673)
@@ -58,7 +58,8 @@
 		$hostsJabber = unserialize($this->getHostsJabber());
 		$findHosts	= explode(":", $pItem['item']);
-		$return = "";	
-		
-		for( $i = 0 ; $i < count($hostsJabber); ++$i )
+		$return = "";
+
+        $hostsJabber_count = count($hostsJabber);
+		for( $i = 0 ; $i < $hostsJabber_count; ++$i )
 			if( $hostsJabber[$i]['org'] == $findHosts[0] && $hostsJabber[$i]['jabberName'] == $findHosts[1] )
 			{
@@ -517,5 +518,6 @@
 		$orgs = array();
 
-		for( $i = 0 ; $i < count($posAll); ++$i )
+        $posAll_count = count($posAll);
+		for( $i = 0 ; $i < $posAll_count; ++$i )
 		{
 			$pos = strpos($organization, ",");
@@ -655,5 +657,6 @@
 					if( count($confHostsOrgs) > 0 )
 					{
-						for( $i = 0; $i < count($confHostsOrgs); ++$i)
+                        $confHostsOrgs_count = count($confHostsOrgs);
+						for( $i = 0; $i < $confHostsOrgs_count; ++$i)
 							if( $confHostsOrgs[$i]['org'] == $hosts[0] && $confHostsOrgs[$i]['jabberName'] == $hosts[1])
 								$key = $i;	
