public function waitForCondition($jsCondition, $timeout = 60)
	{
		$i = 0;
		do
		{
			sleep(1);
		} while (
			!($result = $this->execute(array('script' => 'return ' . $jsCondition, 'args' => array())))
			&& $i++ < $timeout
		);
		return $result;
	}
public function waitForCondition($jsCondition, $timeout = 60)
	{
		$i = 0;
		do
		{
			sleep(1);
		} while (
			!($result = $this->execute(array('script' => 'return ' . $jsCondition, 'args' => array())))
			&& $i++ < $timeout
		);
		return $result;
	}
public function waitForCondition ( $ jsCondition , $ timeout = 60 ) { $ i = 0 ; do { sleep ( 1 ) ; } while ( ! ( $ result = $ this -> execute ( array ( 'script' => 'return ' . $ jsCondition , 'args' => array ( ) ) ) ) && $ i ++ < $ timeout ) ; return $ result ; }
Wait for fulfilment of some javascript condition.

@param string $jsCondition Javascript code.
@param int $timeout Amount of patience in seconds.
@return bool Whether the condition was fulfilled.
Wait for fulfilment of some javascript condition .