diff -aruN --binary 22/administrator/components/com_content/controller.php 23/administrator/components/com_content/controller.php
--- 22/administrator/components/com_content/controller.php	2010-07-18 04:15:44.000000000 +0200
+++ 23/administrator/components/com_content/controller.php	2011-04-04 00:16:32.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: controller.php 18162 2010-07-16 07:00:47Z ian $
+ * @version		$Id: controller.php 21065 2011-04-03 22:16:32Z dextercowley $
  * @package		Joomla
  * @subpackage	Content
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -187,8 +187,8 @@
 				' LEFT JOIN #__users AS u ON u.id = c.created_by' .
 				' WHERE c.state <> -1' .
 				' AND c.state <> -2' .
-				' GROUP BY u.name' .
-				' ORDER BY u.name';
+				' GROUP BY u.id' .
+				' ORDER BY u.name, u.id';
 		$authors[] = JHTML::_('select.option', '0', '- '.JText::_('Select Author').' -', 'created_by', 'name');
 		$db->setQuery($query);
 		$authors = array_merge($authors, $db->loadObjectList());
diff -aruN --binary 22/administrator/components/com_menus/classes/ilink.php 23/administrator/components/com_menus/classes/ilink.php
--- 22/administrator/components/com_menus/classes/ilink.php	2010-07-18 04:15:44.000000000 +0200
+++ 23/administrator/components/com_menus/classes/ilink.php	2011-04-04 00:21:04.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: ilink.php 18162 2010-07-16 07:00:47Z ian $
+ * @version		$Id: ilink.php 21067 2011-04-03 22:21:04Z dextercowley $
  * @package		Joomla
  * @subpackage	Menus
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -221,9 +221,7 @@
 					if ($data) {
 						if ($data->attributes('hidden') != 'true') {
 							$m = $data->getElementByPath('message');
-							if ($m) {
-								$message = $m->data();
-							}
+							$message = ($m) ? $m->data() : '';
 							unset($node);
 							$node = new iLinkNode($data->attributes('title'), $url, $message);
 							$this->addChild($node);
diff -aruN --binary 22/administrator/components/com_templates/controller.php 23/administrator/components/com_templates/controller.php
--- 22/administrator/components/com_templates/controller.php	2010-10-29 19:57:44.000000000 +0200
+++ 23/administrator/components/com_templates/controller.php	2011-03-31 17:58:18.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: controller.php 14401 2010-01-26 14:10:00Z louis $
+ * @version		$Id: controller.php 21042 2011-03-31 15:58:17Z dextercowley $
  * @package		Joomla
  * @subpackage	Templates
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -224,7 +224,7 @@
 			$return = JFile::write($file, $txt);
 
 			// Try to make the params file unwriteable
-			if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0555')) {
+			if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0644')) {
 				JError::raiseNotice('SOME_ERROR_CODE', JText::_('Could not make the template parameter file unwritable'));
 			}
 
@@ -352,7 +352,7 @@
 		$return = JFile::write($file, $filecontent);
 
 		// Try to make the template file unwriteable
-		if (!$ftp['enabled'] && !JPath::setPermissions($file, '0555')) {
+		if (!$ftp['enabled'] && !JPath::setPermissions($file, '0644')) {
 			JError::raiseNotice('SOME_ERROR_CODE', JText::_('Could not make the template file unwritable'));
 		}
 
@@ -474,7 +474,7 @@
 		$return = JFile::write($file, $filecontent);
 
 		// Try to make the css file unwriteable
-		if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0555')) {
+		if (!$ftp['enabled'] && JPath::isOwner($file) && !JPath::setPermissions($file, '0644')) {
 			JError::raiseNotice('SOME_ERROR_CODE', JText::_('Could not make the css file unwritable'));
 		}
 
diff -aruN --binary 22/CHANGELOG.php 23/CHANGELOG.php
--- 22/CHANGELOG.php	2010-11-03 16:00:56.000000000 +0100
+++ 23/CHANGELOG.php	2011-04-05 00:01:18.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: CHANGELOG.php 19340 2010-11-03 15:00:55Z ian $
+* @version		$Id: CHANGELOG.php 21080 2011-04-04 22:01:17Z dextercowley $
 * @package		Joomla
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
 * @license		GNU/GPL, see LICENSE.php
@@ -36,6 +36,30 @@
 - -> Removed
 ! -> Note
 
+-------------------- 1.5.23 Stable Release [04-March-2011] ------------------
+
+04-Apr-2011 Mark Dexter
+ # [#25450] Mootools 1.2.4 Squeezebox Problems in MSIE 9
+ # [#24289] com_mailto Spam Email Relay
+ # [#22629] Joomla! broken on CGI web servers
+
+03-Apr-2011 Mark Dexter
+ # [#20234] security string missing on file toolbar.php
+ # [#23746] Add a system plugin event called onBeforeCompileHead
+ # [#25090] Improve .htaccess rewrite efficency
+ # [#21676] Article Manager - Select Author
+ # [#20423] Warning: realpath() [function.realpath]: Unable to access .../path.php 
+ # [#16605] PHP notice when selecting a menu type
+ # [#20536] Category Blog Layout - View Article - Editing Article - Click Images - 500 Layout "blog" not found
+
+31-Mar-2011 Mark Dexter
+ # [#22520] Articles archive years are HARDCODED!!!
+ # [#25162] *SQL installation issue with TYPE
+ # [#23053] 1.5.21 admin template params.ini error
+ # [#23135] Section blog ordering changed in 1.5.22
+ # [#16149] **PDFs not showing when icon clicked in IE...
+ # [#25024] Upgrade Geshi to 1.0.8.10
+ # [#21252] Password reset invalid token
 
 -------------------- 1.5.22 Stable Release [03-November-2010] ------------------
 
diff -aruN --binary 22/components/com_content/helpers/icon.php 23/components/com_content/helpers/icon.php
--- 22/components/com_content/helpers/icon.php	2010-04-23 12:40:12.000000000 +0200
+++ 23/components/com_content/helpers/icon.php	2011-04-04 22:52:24.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: icon.php 14401 2010-01-26 14:10:00Z louis $
+ * @version		$Id: icon.php 21078 2011-04-04 20:52:23Z dextercowley $
  * @package		Joomla
  * @subpackage	Content
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -65,12 +65,13 @@
 	}
 
 	function email($article, $params, $access, $attribs = array())
-	{
+        {
+                require_once(JPATH_SITE.DS.'components'.DS.'com_mailto'.DS.'helpers'.DS.'mailto.php');
 		$uri	=& JURI::getInstance();
 		$base	= $uri->toString( array('scheme', 'host', 'port'));
-		$link	= $base.JRoute::_( ContentHelperRoute::getArticleRoute($article->slug, $article->catslug, $article->sectionid) , false );
-		$url	= 'index.php?option=com_mailto&tmpl=component&link='.base64_encode( $link );
+                $link	= $base.JRoute::_( ContentHelperRoute::getArticleRoute($article->slug, $article->catslug, $article->sectionid) , false );
 
+                $url    = 'index.php?option=com_mailto&tmpl=component&link='.MailToHelper::addLink($link);
 		$status = 'width=400,height=350,menubar=yes,resizable=yes';
 
 		if ($params->get('show_icons')) 	{
diff -aruN --binary 22/components/com_content/models/section.php 23/components/com_content/models/section.php
--- 22/components/com_content/models/section.php	2010-11-03 19:12:02.000000000 +0100
+++ 23/components/com_content/models/section.php	2011-03-31 18:01:14.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: section.php 19343 2010-11-03 18:12:02Z ian $
+ * @version		$Id: section.php 21043 2011-03-31 16:01:13Z dextercowley $
  * @package		Joomla
  * @subpackage	Content
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -347,7 +347,7 @@
 				JError::raiseError(500, $this->_db->stderror());
 				return false;
 			}
-			
+
 
 			// special handling required as Uncategorized content does not have a section / category id linkage
 			$i = $limitstart;
@@ -436,22 +436,30 @@
 		return $query;
 	}
 
+	/**
+	 * Build the SQL ORDER BY for the section listing.
+	 *
+	 * @param	int		$state	The published state of the articles being listed.
+	 *
+	 * @return	string	The full ORDER BY clause.
+	 * @since	1.5
+	 */
 	function _buildContentOrderBy($state = 1)
 	{
 		$filter_order		= JRequest::getCmd('filter_order');
 		$filter_order_Dir	= JRequest::getWord('filter_order_Dir');
+		$orderby			= '';
 
-		if (!in_array($filter_order, array('a.id', 'a.title', 'a.alias', 'a.title_alias', 'a.introtext', 'a.fulltext', 'a.sectionid', 'a.state',
+		if (!in_array($filter_order, array('a.id', 'a.title', 'a.alias', 'a.title_alias', 'a.sectionid', 'a.state',
 			'a.catid', 'a.created', 'a.created_by', 'a.created_by_alias', 'a.modified', 'a.modified_by', 'a.checked_out', 'a.checked_out_time',
-			'a.hits', 'a.ordering', 'a.metakey', 'a.access'))) {
-			$filter_order = 'a.ordering';
+			'a.hits', 'a.ordering', 'a.access'))) {
+			$filter_order = null;
 		}
 
 		if (!in_array(trim(strtoupper($filter_order_Dir)), array('ASC', 'DESC'))) {
 			$filter_order_Dir = 'ASC';
 		}
 
-		$orderby = ' ORDER BY ';
 		if ($filter_order) {
 			$orderby .= $filter_order .' '. $filter_order_Dir.', ';
 		}
@@ -480,7 +488,7 @@
 		}
 		$orderby .= "$primary $secondary";
 
-		return $orderby;
+		return trim($orderby) ? ' ORDER BY '.$orderby : null;
 	}
 
 	function _buildContentWhere($state = 1)
diff -aruN --binary 22/components/com_content/views/archive/view.html.php 23/components/com_content/views/archive/view.html.php
--- 22/components/com_content/views/archive/view.html.php	2010-04-23 12:40:12.000000000 +0200
+++ 23/components/com_content/views/archive/view.html.php	2011-03-31 17:54:16.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: view.html.php 14401 2010-01-26 14:10:00Z louis $
+ * @version		$Id: view.html.php 21040 2011-03-31 15:54:16Z dextercowley $
  * @package		Joomla
  * @subpackage	Content
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -104,7 +104,7 @@
 		// Year Field
 		$years = array();
 		$years[] = JHTML::_('select.option',  null, JText::_( 'Year' ) );
-		for ($i=2000; $i <= 2010; $i++) {
+		for ($l = date('Y'), $i = $l - 10; $i <= $l; $i++) {
 			$years[] = JHTML::_('select.option',  $i, $i );
 		}
 		$form->yearField	= JHTML::_('select.genericlist',   $years, 'year', 'size="1" class="inputbox"', 'value', 'text', $year );
diff -aruN --binary 22/components/com_mailto/controller.php 23/components/com_mailto/controller.php
--- 22/components/com_mailto/controller.php	2010-04-23 12:40:12.000000000 +0200
+++ 23/components/com_mailto/controller.php	2011-04-04 22:52:24.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: controller.php 14401 2010-01-26 14:10:00Z louis $
+ * @version		$Id: controller.php 21078 2011-04-04 20:52:23Z dextercowley $
  * @package		Joomla
  * @subpackage	MailTo
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -70,10 +70,10 @@
 		$MailFrom 	= $mainframe->getCfg('mailfrom');
 		$FromName 	= $mainframe->getCfg('fromname');
 
-		$link 		= base64_decode( JRequest::getVar( 'link', '', 'post', 'base64' ) );
+                $link           = MailtoHelper::validateHash(JRequest::getString('link', '', 'post'));
 
 		// Verify that this is a local link
-		if(!JURI::isInternal($link)) {
+		if((!$link) || (!JURI::isInternal($link))) {
 			//Non-local url...  
 			JError::raiseNotice( 500, JText:: _ ('EMAIL_NOT_SENT' ));
 			return $this->mailto();
diff -aruN --binary 22/components/com_mailto/helpers/index.html 23/components/com_mailto/helpers/index.html
--- 22/components/com_mailto/helpers/index.html	1970-01-01 01:00:00.000000000 +0100
+++ 23/components/com_mailto/helpers/index.html	2011-04-04 22:52:24.000000000 +0200
@@ -0,0 +1 @@
+<html><body bgcolor="#FFFFFF"></body></html>
\ No hay ningún carácter de nueva línea al final del fichero
diff -aruN --binary 22/components/com_mailto/helpers/mailto.php 23/components/com_mailto/helpers/mailto.php
--- 22/components/com_mailto/helpers/mailto.php	1970-01-01 01:00:00.000000000 +0100
+++ 23/components/com_mailto/helpers/mailto.php	2011-04-04 22:52:24.000000000 +0200
@@ -0,0 +1,84 @@
+<?php
+/**
+ * @version		$Id: mailto.php 21078 2011-04-04 20:52:23Z dextercowley $
+ * @package		Joomla.Site
+ * @subpackage	com_mailto
+ * @copyright	Copyright (C) 2005 - 2011 Open Source Matters, Inc. All rights reserved.
+ * @license		GNU General Public License version 2 or later; see LICENSE.txt
+ */
+
+/**
+ * @package		Joomla.Site
+ * @subpackage	com_mailto
+ */
+class MailtoHelper
+{
+	/**
+	 * Adds a URL to the mailto system and returns the hash 
+	 *
+	 * @param string url
+	 * @return URL hash
+	 */
+	function addLink($url)
+	{
+		$hash = sha1($url);
+		MailtoHelper::cleanHashes();
+		$session =& JFactory::getSession();
+		$mailto_links = $session->get('com_mailto.links', Array());
+		if(!isset($mailto_links[$hash]))
+		{
+			$mailto_links[$hash] = new stdClass();
+		}
+		$mailto_links[$hash]->link = $url;
+		$mailto_links[$hash]->expiry = time();
+		$session->set('com_mailto.links', $mailto_links);
+		return $hash;
+	}
+
+	/**
+	 * Checks if a URL is a Flash file
+	 *
+	 * @param string
+	 * @return URL
+	 */
+	function validateHash($hash)
+	{
+		$retval = false;
+		$session =& JFactory::getSession();
+		MailtoHelper::cleanHashes();
+		$mailto_links = $session->get('com_mailto.links', Array());
+		if(isset($mailto_links[$hash]))
+		{
+			$retval = $mailto_links[$hash]->link;
+		}
+		return $retval;
+	}
+
+	/**
+	 * Cleans out old hashes
+	 *
+	 * @since 1.5.23
+	 */
+	function cleanHashes($lifetime = 1440)
+	{
+		// flag for if we've cleaned on this cycle
+		static $cleaned = false;
+		if(!$cleaned)
+		{
+			$past = time() - $lifetime;
+			$session =& JFactory::getSession();
+			$mailto_links = $session->get('com_mailto.links', Array());
+			foreach($mailto_links as $index=>$link)
+			{
+				if($link->expiry < $past)
+				{
+					unset($mailto_links[$index]);
+				}
+			}
+			$cleaned = true;
+		}
+		
+		
+	}
+}
+
diff -aruN --binary 22/components/com_mailto/mailto.php 23/components/com_mailto/mailto.php
--- 22/components/com_mailto/mailto.php	2010-04-23 12:40:12.000000000 +0200
+++ 23/components/com_mailto/mailto.php	2011-04-04 22:52:24.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: mailto.php 14401 2010-01-26 14:10:00Z louis $
+ * @version		$Id: mailto.php 21078 2011-04-04 20:52:23Z dextercowley $
  * @package		Joomla
  * @subpackage	MailTo
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -17,10 +17,11 @@
 
 jimport('joomla.application.component.helper');
 
+require_once( JPATH_COMPONENT.DS.'helpers'.DS.'mailto.php');
 require_once( JPATH_COMPONENT.DS.'controller.php' );
 
 $controller	= new MailtoController( );
 $controller->registerDefaultTask('mailto');
 $controller->execute(JRequest::getCmd('task'));
 
-//$controller->redirect();
\ No hay ningún carácter de nueva línea al final del fichero
+//$controller->redirect();
diff -aruN --binary 22/components/com_user/models/reset.php 23/components/com_user/models/reset.php
--- 22/components/com_user/models/reset.php	2010-04-23 12:40:14.000000000 +0200
+++ 23/components/com_user/models/reset.php	2011-03-31 18:11:40.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: reset.php 16385 2010-04-23 10:44:15Z ian $
+ * @version		$Id: reset.php 21046 2011-03-31 16:11:40Z dextercowley $
  * @package		Joomla
  * @subpackage	User
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -126,7 +126,7 @@
 		$row = $db->loadObject();
 
 		// Verify the token
-		if (!($row = $db->loadObject()))
+		if (!$row)
 		{
 			$this->setError(JText::_('INVALID_TOKEN'));
 			return false;
diff -aruN --binary 22/htaccess.txt 23/htaccess.txt
--- 22/htaccess.txt	2010-04-23 12:40:14.000000000 +0200
+++ 23/htaccess.txt	2011-04-04 00:12:20.000000000 +0200
@@ -1,5 +1,5 @@
 ##
-# @version $Id: htaccess.txt 14401 2010-01-26 14:10:00Z louis $
+# @version $Id: htaccess.txt 21064 2011-04-03 22:12:19Z dextercowley $
 # @package Joomla
 # @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
 # @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
@@ -38,20 +38,31 @@
 #Satisfy all
 #</Files>
 ## End of deny access to extension xml files
+# Block out any script trying to set a mosConfig value through the URL
 RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
-# Block out any script trying to base64_encode crap to send via URL
-RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
+# Block out any script trying to base64_encode data within the URL
+RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
 # Block out any script that includes a <script> tag in URL
-RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
+RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
 # Block out any script trying to set a PHP GLOBALS variable via URL
 RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
 # Block out any script trying to modify a _REQUEST variable via URL
 RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
-# Send all blocked request to homepage with 403 Forbidden error!
-RewriteRule ^(.*)$ index.php [F,L]
+# Return 403 Forbidden header and show the content of the root homepage
+RewriteRule .* index.php [F]
 #
 ########## End - Rewrite rules to block out some common exploits
 
+
+########## Begin - Custom redirects
+#
+# If you need to redirect some pages, or set a canonical non-www to
+# www redirect (or vice versa), place that code here. Ensure those
+# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
+#
+########## End - Custom redirects
+
+
 #  Uncomment following line if your webserver's URL
 #  is not directly related to physical file paths.
 #  Update Your Joomla! Directory (just / for root)
@@ -61,11 +72,19 @@
 
 ########## Begin - Joomla! core SEF Section
 #
+RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
+#
+# If the requested path and file is not /index.php and the request
+# has not already been internally rewritten to the index.php script
+RewriteCond %{REQUEST_URI} !^/index\.php
+# and the request is for root, or for an extensionless URL, or the
+# requested URL ends with one of the listed extensions
+RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|raw))$ [NC]
+# and the requested path and file doesn't directly match a physical file
 RewriteCond %{REQUEST_FILENAME} !-f
+# and the requested path and file doesn't directly match a physical folder
 RewriteCond %{REQUEST_FILENAME} !-d
-RewriteCond %{REQUEST_URI} !^/index.php
-RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$  [NC]
-RewriteRule (.*) index.php
-RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
+# internally rewrite the request to the index.php script
+RewriteRule .* index.php [L]
 #
 ########## End - Joomla! core SEF Section
diff -aruN --binary 22/libraries/geshi/geshi/css.php 23/libraries/geshi/geshi/css.php
--- 22/libraries/geshi/geshi/css.php	2009-05-29 13:54:38.000000000 +0200
+++ 23/libraries/geshi/geshi/css.php	2011-03-31 18:09:16.000000000 +0200
@@ -1,16 +1,21 @@
 <?php
+// no direct access
+defined('_JEXEC') or die;
+
 /*************************************************************************************
  * css.php
  * -------
  * Author: Nigel McNie (nigel@geshi.org)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.19
+ * Release Version: 1.0.8.10
  * Date Started: 2004/06/18
  *
  * CSS language file for GeSHi.
  *
  * CHANGES
  * -------
+ * 2008/05/23 (1.0.7.22)
+ *  -  Added description of extra language features (SF#1970248)
  * 2004/11/27 (1.0.3)
  *  -  Added support for multiple object splitters
  * 2004/10/27 (1.0.2)
@@ -47,17 +52,26 @@
  *
  ************************************************************************************/
 
-defined('GESHI_CAPS_NO_CHANGE') or die();
-
 $language_data = array (
-	'LANG_NAME' => 'CSS',
-	'COMMENT_SINGLE' => array(1 => '@'),
-	'COMMENT_MULTI' => array('/*' => '*/'),
-	'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
-	'QUOTEMARKS' => array('"', "'"),
-	'ESCAPE_CHAR' => '\\',
-	'KEYWORDS' => array(
-		1 => array(
+    'LANG_NAME' => 'CSS',
+    'COMMENT_SINGLE' => array(1 => '@'),
+    'COMMENT_MULTI' => array('/*' => '*/'),
+    'COMMENT_REGEXP' => array(
+        2 => "/(?<=\\()\\s*(?:(?:[a-z0-9]+?:\\/\\/)?[a-z0-9_\\-\\.\\/:]+?)?[a-z]+?\\.[a-z]+?(\\?[^\)]+?)?\\s*?(?=\\))/i"
+        ),
+    'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
+    'QUOTEMARKS' => array('"', "'"),
+    'ESCAPE_CHAR' => '',
+    'ESCAPE_REGEXP' => array(
+        //Simple Single Char Escapes
+        //1 => "#\\\\[nfrtv\$\"\n\\\\]#i",
+        //Hexadecimal Char Specs
+        2 => "#\\\\[\da-fA-F]{1,6}\s?#i",
+        //Unicode Char Specs
+        //3 => "#\\\\u[\da-fA-F]{1,8}#i",
+        ),
+    'KEYWORDS' => array(
+        1 => array(
             'aqua', 'azimuth', 'background-attachment', 'background-color',
             'background-image', 'background-position', 'background-repeat',
             'background', 'black', 'blue', 'border-bottom-color',
@@ -89,120 +103,124 @@
             'vertical-align', 'visibility', 'voice-family', 'volume',
             'white-space', 'widows', 'width', 'word-spacing', 'z-index',
             'bottom', 'left', 'height'
+            ),
+        2 => array(
+            'above', 'absolute', 'always', 'armenian', 'aural', 'auto',
+            'avoid', 'baseline', 'behind', 'below', 'bidi-override', 'blink',
+            'block', 'bold', 'bolder', 'both', 'capitalize', 'center-left',
+            'center-right', 'center', 'circle', 'cjk-ideographic',
+            'close-quote', 'collapse', 'condensed', 'continuous', 'crop',
+            'crosshair', 'cross', 'cursive', 'dashed', 'decimal-leading-zero',
+            'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
+            'e-resize', 'embed', 'extra-condensed', 'extra-expanded',
+            'expanded', 'fantasy', 'far-left', 'far-right', 'faster', 'fast',
+            'fixed', 'fuchsia', 'georgian', 'gray', 'green', 'groove',
+            'hebrew', 'help', 'hidden', 'hide', 'higher', 'high',
+            'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table',
+            'inline', 'inset', 'inside', 'invert', 'italic', 'justify',
+            'katakana-iroha', 'katakana', 'landscape', 'larger', 'large',
+            'left-side', 'leftwards', 'level', 'lighter', 'lime',
+            'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek',
+            'lower-roman', 'lowercase', 'ltr', 'lower', 'low', 'maroon',
+            'medium', 'message-box', 'middle', 'mix', 'monospace', 'n-resize',
+            'narrower', 'navy', 'ne-resize', 'no-close-quote',
+            'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap',
+            'nw-resize', 'oblique', 'olive', 'once', 'open-quote', 'outset',
+            'outside', 'overline', 'pointer', 'portrait', 'purple', 'px',
+            'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb',
+            'ridge', 'right-side', 'rightwards', 's-resize', 'sans-serif',
+            'scroll', 'se-resize', 'semi-condensed', 'semi-expanded',
+            'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower',
+            'small-caps', 'small-caption', 'smaller', 'soft', 'solid',
+            'spell-out', 'square', 'static', 'status-bar', 'super',
+            'sw-resize', 'table-caption', 'table-cell', 'table-column',
+            'table-column-group', 'table-footer-group', 'table-header-group',
+            'table-row', 'table-row-group', 'teal', 'text', 'text-bottom',
+            'text-top', 'thick', 'thin', 'transparent', 'ultra-condensed',
+            'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin',
+            'upper-roman', 'uppercase', 'url', 'visible', 'w-resize', 'wait',
+            'white', 'wider', 'x-fast', 'x-high', 'x-large', 'x-loud',
+            'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small', 'yellow',
+            'yes'
+            )
+        ),
+    'SYMBOLS' => array(
+        '(', ')', '{', '}', ':', ';',
+        '>', '+', '*', ',', '^', '='
+        ),
+    'CASE_SENSITIVE' => array(
+        GESHI_COMMENTS => false,
+        1 => true,
+        2 => true
         ),
-		2 => array(
-             'above', 'absolute', 'always', 'armenian', 'aural', 'auto',
-             'avoid', 'baseline', 'behind', 'below', 'bidi-override', 'blink',
-             'block', 'bold', 'bolder', 'both', 'capitalize', 'center-left',
-             'center-right', 'center', 'circle', 'cjk-ideographic',
-             'close-quote', 'collapse', 'condensed', 'continuous', 'crop',
-             'crosshair', 'cross', 'cursive', 'dashed', 'decimal-leading-zero',
-             'decimal', 'default', 'digits', 'disc', 'dotted', 'double',
-             'e-resize', 'embed', 'extra-condensed', 'extra-expanded',
-             'expanded', 'fantasy', 'far-left', 'far-right', 'faster', 'fast',
-             'fixed', 'fuchsia', 'georgian', 'gray', 'green', 'groove',
-             'hebrew', 'help', 'hidden', 'hide', 'higher', 'high',
-             'hiragana-iroha', 'hiragana', 'icon', 'inherit', 'inline-table',
-             'inline', 'inset', 'inside', 'invert', 'italic', 'justify',
-             'katakana-iroha', 'katakana', 'landscape', 'larger', 'large',
-             'left-side', 'leftwards', 'level', 'lighter', 'lime',
-             'line-through', 'list-item', 'loud', 'lower-alpha', 'lower-greek',
-             'lower-roman', 'lowercase', 'ltr', 'lower', 'low', 'maroon',
-             'medium', 'message-box', 'middle', 'mix', 'monospace', 'n-resize',
-             'narrower', 'navy', 'ne-resize', 'no-close-quote',
-             'no-open-quote', 'no-repeat', 'none', 'normal', 'nowrap',
-             'nw-resize', 'oblique', 'olive', 'once', 'open-quote', 'outset',
-             'outside', 'overline', 'pointer', 'portrait', 'purple', 'px',
-             'red', 'relative', 'repeat-x', 'repeat-y', 'repeat', 'rgb',
-             'ridge', 'right-side', 'rightwards', 's-resize', 'sans-serif',
-             'scroll', 'se-resize', 'semi-condensed', 'semi-expanded',
-             'separate', 'serif', 'show', 'silent', 'silver', 'slow', 'slower',
-             'small-caps', 'small-caption', 'smaller', 'soft', 'solid',
-             'spell-out', 'square', 'static', 'status-bar', 'super',
-             'sw-resize', 'table-caption', 'table-cell', 'table-column',
-             'table-column-group', 'table-footer-group', 'table-header-group',
-             'table-row', 'table-row-group', 'teal', 'text', 'text-bottom',
-             'text-top', 'thick', 'thin', 'transparent', 'ultra-condensed',
-             'ultra-expanded', 'underline', 'upper-alpha', 'upper-latin',
-             'upper-roman', 'uppercase', 'url', 'visible', 'w-resize', 'wait',
-             'white', 'wider', 'x-fast', 'x-high', 'x-large', 'x-loud',
-             'x-low', 'x-small', 'x-soft', 'xx-large', 'xx-small', 'yellow',
-             'yes'
+    'STYLES' => array(
+        'KEYWORDS' => array(
+            1 => 'color: #000000; font-weight: bold;',
+            2 => 'color: #993333;'
+            ),
+        'COMMENTS' => array(
+            1 => 'color: #a1a100;',
+            2 => 'color: #ff0000; font-style: italic;',
+            'MULTI' => 'color: #808080; font-style: italic;'
+            ),
+        'ESCAPE_CHAR' => array(
+            0 => 'color: #000099; font-weight: bold;',
+            //1 => 'color: #000099; font-weight: bold;',
+            2 => 'color: #000099; font-weight: bold;'
+            //3 => 'color: #000099; font-weight: bold;'
+            ),
+        'BRACKETS' => array(
+            0 => 'color: #00AA00;'
+            ),
+        'STRINGS' => array(
+            0 => 'color: #ff0000;'
+            ),
+        'NUMBERS' => array(
+            0 => 'color: #cc66cc;'
+            ),
+        'METHODS' => array(
+            ),
+        'SYMBOLS' => array(
+            0 => 'color: #00AA00;'
+            ),
+        'SCRIPT' => array(
+            ),
+        'REGEXPS' => array(
+            0 => 'color: #cc00cc;',
+            1 => 'color: #6666ff;',
+            2 => 'color: #3333ff;',
+            3 => 'color: #933;'
             )
         ),
-	'SYMBOLS' => array(
-		'(', ')', '{', '}', ':', ';'
-		),
-	'CASE_SENSITIVE' => array(
-		GESHI_COMMENTS => false,
-		1 => true,
-		2 => true
-		),
-	'STYLES' => array(
-		'KEYWORDS' => array(
-			1 => 'color: #000000; font-weight: bold;',
-			2 => 'color: #993333;'
-			),
-		'COMMENTS' => array(
-			1 => 'color: #a1a100;',
-			'MULTI' => 'color: #808080; font-style: italic;'
-			),
-		'ESCAPE_CHAR' => array(
-			0 => 'color: #000099; font-weight: bold;'
-			),
-		'BRACKETS' => array(
-			0 => 'color: #66cc66;'
-			),
-		'STRINGS' => array(
-			0 => 'color: #ff0000;'
-			),
-		'NUMBERS' => array(
-			0 => 'color: #cc66cc;'
-			),
-		'METHODS' => array(
-			),
-		'SYMBOLS' => array(
-			0 => 'color: #66cc66;'
-			),
-		'SCRIPT' => array(
-			),
-		'REGEXPS' => array(
-			0 => 'color: #cc00cc;',
-			1 => 'color: #6666ff;',
-			2 => 'color: #3333ff;',
-            3 => 'color: #933;',
-            4 => 'color: #933;',
-			)
-		),
-	'URLS' => array(
-		1 => '',
-		2 => ''
-		),
-	'OOLANG' => false,
-	'OBJECT_SPLITTERS' => array(
-		),
-	'REGEXPS' => array(
-		0 => '\#[a-zA-Z0-9\-_]+',
-		1 => '\.[a-zA-Z0-9\-_]+',
-        2 => ':[a-zA-Z0-9\-]+',
-        3 => '(\d+|(\d*\.\d+))(em|ex|pt|px|cm|in|%)',
-        4 => array(
-            GESHI_SEARCH    => '(url\()([^)]+)(\))',
-            GESHI_REPLACE   => '\\2',
-            GESHI_BEFORE    => '\\1',
-            GESHI_AFTER     => '\\3',
-            GESHI_MODIFIERS => 'si'
+    'URLS' => array(
+        1 => '',
+        2 => ''
+        ),
+    'OOLANG' => false,
+    'OBJECT_SPLITTERS' => array(
+        ),
+    'REGEXPS' => array(
+        //DOM Node ID
+        0 => '\#[a-zA-Z0-9\-_]+(?:\\\\:[a-zA-Z0-9\-_]+)*',
+        //CSS classname
+        1 => '\.(?!\d)[a-zA-Z0-9\-_]+(?:\\\\:[a-zA-Z0-9\-_]+)*\b(?=[\{\.#\s,:].|<\|)',
+        //CSS Pseudo classes
+        //note: & is needed for &gt; (i.e. > )
+        2 => '(?<!\\\\):(?!\d)[a-zA-Z0-9\-]+\b(?:\s*(?=[\{\.#a-zA-Z,:+*&](.|\n)|<\|))',
+        //Measurements
+        3 => '[+\-]?(\d+|(\d*\.\d+))(em|ex|pt|px|cm|in|%)',
+        ),
+    'STRICT_MODE_APPLIES' => GESHI_NEVER,
+    'SCRIPT_DELIMITERS' => array(
+        ),
+    'HIGHLIGHT_STRICT_BLOCK' => array(
+        ),
+    'TAB_WIDTH' => 4,
+    'PARSER_CONTROL' => array(
+        'KEYWORDS' => array(
+            'DISALLOWED_AFTER' => '(?![a-zA-Z0-9_\|%\\-&\.])'
         )
-		),
-	'STRICT_MODE_APPLIES' => GESHI_NEVER,
-	'SCRIPT_DELIMITERS' => array(
-		),
-	'HIGHLIGHT_STRICT_BLOCK' => array(
-		)
+    )
 );
 
-if (isset($this) && is_a($this, 'GeSHi')) {
-    $language_data['STYLES']['NUMBERS'][0] = $language_data['STYLES']['REGEXPS'][3];
-}
-
-?>
+?>
\ No hay ningún carácter de nueva línea al final del fichero
diff -aruN --binary 22/libraries/geshi/geshi/diff.php 23/libraries/geshi/geshi/diff.php
--- 22/libraries/geshi/geshi/diff.php	2009-05-29 13:54:38.000000000 +0200
+++ 23/libraries/geshi/geshi/diff.php	2011-03-31 18:09:16.000000000 +0200
@@ -1,19 +1,23 @@
 <?php
+// no direct access
+defined('_JEXEC') or die;
+
 /*************************************************************************************
  * diff.php
  * --------
  * Author: Conny Brunnkvist (conny@fuchsia.se), W. Tasin (tasin@fhm.edu)
  * Copyright: (c) 2004 Fuchsia Open Source Solutions (http://www.fuchsia.se/)
- * Release Version: 1.0.7.19
+ * Release Version: 1.0.8.10
  * Date Started: 2004/12/29
  *
  * Diff-output language file for GeSHi.
  *
  * CHANGES
  * -------
+ * 2008/05/23 (1.0.7.22)
+ *  -  Added description of extra language features (SF#1970248)
  * 2006/02/27
  *  -  changing language file to use matching of start (^) and end ($) (wt)
- *
  * 2004/12/29 (1.0.0)
  *  -  First Release
  *
@@ -41,145 +45,155 @@
  *
  ************************************************************************************/
 
-defined('GESHI_CAPS_NO_CHANGE') or die();
 
 $language_data = array (
-	'LANG_NAME' => 'Diff',
-	'COMMENT_SINGLE' => array(),
-	'COMMENT_MULTI' => array(),
-	'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
-	'QUOTEMARKS' => array(),
-	'ESCAPE_CHAR' => ' ',
-	'KEYWORDS' => array(
-			1 => array(
-				'\ No newline at end of file'
-			),
-			2 => array(
-				'***************' /* This only seems to works in some cases? */
-			),
-		),
-	'SYMBOLS' => array(
-		),
-	'CASE_SENSITIVE' => array(
+    'LANG_NAME' => 'Diff',
+    'COMMENT_SINGLE' => array(),
+    'COMMENT_MULTI' => array(),
+    'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
+    'QUOTEMARKS' => array(),
+    'ESCAPE_CHAR' => ' ',
+    'KEYWORDS' => array(
+            1 => array(
+                '\ No newline at end of file'
+            ),
+//            2 => array(
+//                '***************' /* This only seems to works in some cases? */
+//            ),
+        ),
+    'SYMBOLS' => array(
+        ),
+    'CASE_SENSITIVE' => array(
         1 => false,
-        2 => false
-		),
-	'STYLES' => array(
-		'KEYWORDS' => array(
-			1 => 'color: #aaaaaa; font-style: italic;',
-			2 => 'color: #dd6611;',
-			),
-		'COMMENTS' => array(
+//        2 => false
+        ),
+    'STYLES' => array(
+        'KEYWORDS' => array(
+            1 => 'color: #aaaaaa; font-style: italic;',
+//            2 => 'color: #dd6611;',
             ),
-		'ESCAPE_CHAR' => array(
+        'COMMENTS' => array(
+            ),
+        'ESCAPE_CHAR' => array(
             0 => ''
-			),
-		'BRACKETS' => array(
+            ),
+        'BRACKETS' => array(
             0 => ''
-			),
-		'STRINGS' => array(
+            ),
+        'STRINGS' => array(
             0 => ''
-			),
-		'NUMBERS' => array(
+            ),
+        'NUMBERS' => array(
             0 => ''
-			),
-		'METHODS' => array(
+            ),
+        'METHODS' => array(
             0 => ''
-			),
-		'SYMBOLS' => array(
+            ),
+        'SYMBOLS' => array(
             0 => ''
-			),
-		'SCRIPT' => array(
+            ),
+        'SCRIPT' => array(
             0 => ''
-			),
+            ),
         'REGEXPS' => array(
-			0 => 'color: #440088;',
-			1 => 'color: #991111;',
-			2 => 'color: #00b000;',
+            0 => 'color: #440088;',
+            1 => 'color: #991111;',
+            2 => 'color: #00b000;',
             3 => 'color: #888822;',
             4 => 'color: #888822;',
             5 => 'color: #0011dd;',
             6 => 'color: #440088;',
-			7 => 'color: #991111;',
+            7 => 'color: #991111;',
             8 => 'color: #00b000;',
-			9 => 'color: #888822;',
-                        ),
-		),
-	'URLS' => array(
-		),
-	'OOLANG' => false,
-	'OBJECT_SPLITTER' => '',
-	'REGEXPS' => array(
-			0 => "[0-9,]+[acd][0-9,]+",
-			1 => array(
-			GESHI_SEARCH => '^\\&lt;.*$',
-			GESHI_REPLACE => '\\0',
-			GESHI_MODIFIERS => 'm',
-			GESHI_BEFORE => '',
-			GESHI_AFTER => ''
-			),
-			2 => array(
-			GESHI_SEARCH => '^\\&gt;.*$',
-			GESHI_REPLACE => '\\0',
-			GESHI_MODIFIERS => 'm',
-			GESHI_BEFORE => '',
-			GESHI_AFTER => ''
-			),
-			3 => array(
-			GESHI_SEARCH => '^[\\-]{3}\\s.*$',
-			GESHI_REPLACE => '\\0',
-			GESHI_MODIFIERS => 'm',
-			GESHI_BEFORE => '',
-			GESHI_AFTER => ''
-			),
-			4 => array(
-			GESHI_SEARCH => '^(\\+){3}\\s.*$',
-			GESHI_REPLACE => '\\0',
-			GESHI_MODIFIERS => 'm',
-			GESHI_BEFORE => '',
-			GESHI_AFTER => ''
-			),
-			5 => array(
-			GESHI_SEARCH => '^\\!.*$',
-			GESHI_REPLACE => '\\0',
-			GESHI_MODIFIERS => 'm',
-			GESHI_BEFORE => '',
-			GESHI_AFTER => ''
-			),
-			6 => array(
-			GESHI_SEARCH => '^[\\@]{2}.*$',
-			GESHI_REPLACE => '\\0',
-			GESHI_MODIFIERS => 'm',
-			GESHI_BEFORE => '',
-			GESHI_AFTER => ''
-			),
-			7 => array(
-			GESHI_SEARCH => '^\\-.*$',
-			GESHI_REPLACE => '\\0',
-			GESHI_MODIFIERS => 'm',
-			GESHI_BEFORE => '',
-			GESHI_AFTER => ''
-			),
-			8 => array(
-			GESHI_SEARCH => '^\\+.*$',
-			GESHI_REPLACE => '\\0',
-			GESHI_MODIFIERS => 'm',
-			GESHI_BEFORE => '',
-			GESHI_AFTER => ''
-			),
-			9 => array(
-			GESHI_SEARCH => '^(\\*){3}\\s.*$',
-			GESHI_REPLACE => '\\0',
-			GESHI_MODIFIERS => 'm',
-			GESHI_BEFORE => '',
-			GESHI_AFTER => ''
-			),
-	),
-	'STRICT_MODE_APPLIES' => GESHI_NEVER,
-	'SCRIPT_DELIMITERS' => array(
-		),
-	'HIGHLIGHT_STRICT_BLOCK' => array(
-		)
+            9 => 'color: #888822;',
+            ),
+        ),
+    'URLS' => array(
+        1 => '',
+//        2 => ''
+        ),
+    'OOLANG' => false,
+    'OBJECT_SPLITTERS' => array(),
+    'REGEXPS' => array(
+        0 => "[0-9,]+[acd][0-9,]+",
+        //Removed lines
+        1 => array(
+            GESHI_SEARCH => '(^|(?<=\A\s))\\&lt;.*$',
+            GESHI_REPLACE => '\\0',
+            GESHI_MODIFIERS => 'm',
+            GESHI_BEFORE => '',
+            GESHI_AFTER => ''
+            ),
+        //Inserted lines
+        2 => array(
+            GESHI_SEARCH => '(^|(?<=\A\s))\\&gt;.*$',
+            GESHI_REPLACE => '\\0',
+            GESHI_MODIFIERS => 'm',
+            GESHI_BEFORE => '',
+            GESHI_AFTER => ''
+            ),
+        //Location line
+        3 => array(
+            GESHI_SEARCH => '(^|(?<=\A\s))-{3}\\s.*$',
+            GESHI_REPLACE => '\\0',
+            GESHI_MODIFIERS => 'm',
+            GESHI_BEFORE => '',
+            GESHI_AFTER => ''
+            ),
+        //Inserted line
+        4 => array(
+            GESHI_SEARCH => '(^|(?<=\A\s))(\\+){3}\\s.*$',
+            GESHI_REPLACE => '\\0',
+            GESHI_MODIFIERS => 'm',
+            GESHI_BEFORE => '',
+            GESHI_AFTER => ''
+            ),
+        //Modified line
+        5 => array(
+            GESHI_SEARCH => '(^|(?<=\A\s))\\!.*$',
+            GESHI_REPLACE => '\\0',
+            GESHI_MODIFIERS => 'm',
+            GESHI_BEFORE => '',
+            GESHI_AFTER => ''
+            ),
+        //File specification
+        6 => array(
+            GESHI_SEARCH => '(^|(?<=\A\s))[\\@]{2}.*$',
+            GESHI_REPLACE => '\\0',
+            GESHI_MODIFIERS => 'm',
+            GESHI_BEFORE => '',
+            GESHI_AFTER => ''
+            ),
+        //Removed line
+        7 => array(
+            GESHI_SEARCH => '(^|(?<=\A\s))\\-.*$',
+            GESHI_REPLACE => '\\0',
+            GESHI_MODIFIERS => 'm',
+            GESHI_BEFORE => '',
+            GESHI_AFTER => ''
+            ),
+        //Inserted line
+        8 => array(
+            GESHI_SEARCH => '(^|(?<=\A\s))\\+.*$',
+            GESHI_REPLACE => '\\0',
+            GESHI_MODIFIERS => 'm',
+            GESHI_BEFORE => '',
+            GESHI_AFTER => ''
+            ),
+        //File specification
+        9 => array(
+            GESHI_SEARCH => '(^|(?<=\A\s))(\\*){3}\\s.*$',
+            GESHI_REPLACE => '\\0',
+            GESHI_MODIFIERS => 'm',
+            GESHI_BEFORE => '',
+            GESHI_AFTER => ''
+            ),
+        ),
+    'STRICT_MODE_APPLIES' => GESHI_NEVER,
+    'SCRIPT_DELIMITERS' => array(
+        ),
+    'HIGHLIGHT_STRICT_BLOCK' => array(
+        )
 );
 
-?>
+?>
\ No hay ningún carácter de nueva línea al final del fichero
diff -aruN --binary 22/libraries/geshi/geshi/html4strict.php 23/libraries/geshi/geshi/html4strict.php
--- 22/libraries/geshi/geshi/html4strict.php	2009-05-29 13:54:38.000000000 +0200
+++ 23/libraries/geshi/geshi/html4strict.php	2011-03-31 18:09:16.000000000 +0200
@@ -1,10 +1,13 @@
 <?php
+// no direct access
+defined('_JEXEC') or die;
+
 /*************************************************************************************
  * html4strict.php
  * ---------------
  * Author: Nigel McNie (nigel@geshi.org)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.19
+ * Release Version: 1.0.8.10
  * Date Started: 2004/07/10
  *
  * HTML 4.01 strict language file for GeSHi.
@@ -49,208 +52,142 @@
  *
  ************************************************************************************/
 
-defined('GESHI_CAPS_NO_CHANGE') or die();
-
 $language_data = array (
-	'LANG_NAME' => 'HTML',
-	'COMMENT_SINGLE' => array(),
-	'COMMENT_MULTI' => array('<!--' => '-->'),
-	'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
-	'QUOTEMARKS' => array("'", '"'),
-	'ESCAPE_CHAR' => '',
-	'KEYWORDS' => array(
-		1 => array(
-			),
-		2 => array(
-			'&lt;a&gt;', '&lt;abbr&gt;', '&lt;acronym&gt;', '&lt;address&gt;', '&lt;applet&gt;',
-			'&lt;a', '&lt;abbr', '&lt;acronym', '&lt;address', '&lt;applet',
-			'&lt;/a&gt;', '&lt;/abbr&gt;', '&lt;/acronym&gt;', '&lt;/address&gt;', '&lt;/applet&gt;',
-			'&lt;/a', '&lt;/abbr', '&lt;/acronym', '&lt;/address', '&lt;/applet',
-
-			'&lt;base&gt;', '&lt;basefont&gt;', '&lt;bdo&gt;', '&lt;big&gt;', '&lt;blockquote&gt;', '&lt;body&gt;', '&lt;br&gt;', '&lt;button&gt;', '&lt;b&gt;',
-			'&lt;base', '&lt;basefont', '&lt;bdo', '&lt;big', '&lt;blockquote', '&lt;body', '&lt;br', '&lt;button', '&lt;b',
-			'&lt;/base&gt;', '&lt;/basefont&gt;', '&lt;/bdo&gt;', '&lt;/big&gt;', '&lt;/blockquote&gt;', '&lt;/body&gt;', '&lt;/br&gt;', '&lt;/button&gt;', '&lt;/b&gt;',
-			'&lt;/base', '&lt;/basefont', '&lt;/bdo', '&lt;/big', '&lt;/blockquote', '&lt;/body', '&lt;/br', '&lt;/button', '&lt;/b',
-
-			'&lt;caption&gt;', '&lt;center&gt;', '&lt;cite&gt;', '&lt;code&gt;', '&lt;colgroup&gt;', '&lt;col&gt;',
-			'&lt;caption', '&lt;center', '&lt;cite', '&lt;code', '&lt;colgroup', '&lt;col',
-			'&lt;/caption&gt;', '&lt;/center&gt;', '&lt;/cite&gt;', '&lt;/code&gt;', '&lt;/colgroup&gt;', '&lt;/col&gt;',
-			'&lt;/caption', '&lt;/center', '&lt;/cite', '&lt;/code', '&lt;/colgroup', '&lt;/col',
-
-			'&lt;dd&gt;', '&lt;del&gt;', '&lt;dfn&gt;', '&lt;dir&gt;', '&lt;div&gt;', '&lt;dl&gt;', '&lt;dt&gt;',
-			'&lt;dd', '&lt;del', '&lt;dfn', '&lt;dir', '&lt;div', '&lt;dl', '&lt;dt',
-			'&lt;/dd&gt;', '&lt;/del&gt;', '&lt;/dfn&gt;', '&lt;/dir&gt;', '&lt;/div&gt;', '&lt;/dl&gt;', '&lt;/dt&gt;',
-			'&lt;/dd', '&lt;/del', '&lt;/dfn', '&lt;/dir', '&lt;/div', '&lt;/dl', '&lt;/dt',
-
-			'&lt;em&gt;',
-			'&lt;em',
-			'&lt;/em&gt;',
-			'&lt;/em',
-
-			'&lt;fieldset&gt;', '&lt;font&gt;', '&lt;form&gt;', '&lt;frame&gt;', '&lt;frameset&gt;',
-			'&lt;fieldset', '&lt;font', '&lt;form', '&lt;frame', '&lt;frameset',
-			'&lt;/fieldset&gt;', '&lt;/font&gt;', '&lt;/form&gt;', '&lt;/frame&gt;', '&lt;/frameset&gt;',
-			'&lt;/fieldset', '&lt;/font', '&lt;/form', '&lt;/frame', '&lt;/frameset',
-
-			'&lt;h1&gt;', '&lt;h2&gt;', '&lt;h3&gt;', '&lt;h4&gt;', '&lt;h5&gt;', '&lt;h6&gt;', '&lt;head&gt;', '&lt;hr&gt;', '&lt;html&gt;',
-			'&lt;h1', '&lt;h2', '&lt;h3', '&lt;h4', '&lt;h5', '&lt;h6', '&lt;head', '&lt;hr', '&lt;html',
-			'&lt;/h1&gt;', '&lt;/h2&gt;', '&lt;/h3&gt;', '&lt;/h4&gt;', '&lt;/h5&gt;', '&lt;/h6&gt;', '&lt;/head&gt;', '&lt;/hr&gt;', '&lt;/html&gt;',
-			'&lt;/h1', '&lt;/h2', '&lt;/h3', '&lt;/h4', '&lt;/h5', '&lt;/h6', '&lt;/head', '&lt;/hr', '&lt;/html',
-
-			'&lt;iframe&gt;', '&lt;ilayer&gt;', '&lt;img&gt;', '&lt;input&gt;', '&lt;ins&gt;', '&lt;isindex&gt;', '&lt;i&gt;',
-			'&lt;iframe', '&lt;ilayer', '&lt;img', '&lt;input', '&lt;ins', '&lt;isindex', '&lt;i',
-			'&lt;/iframe&gt;', '&lt;/ilayer&gt;', '&lt;/img&gt;', '&lt;/input&gt;', '&lt;/ins&gt;', '&lt;/isindex&gt;', '&lt;/i&gt;',
-			'&lt;/iframe', '&lt;/ilayer', '&lt;/img', '&lt;/input', '&lt;/ins', '&lt;/isindex', '&lt;/i',
-
-			'&lt;kbd&gt;',
-			'&lt;kbd',
-			'&t;/kbd&gt;',
-			'&lt;/kbd',
-
-			'&lt;label&gt;', '&lt;legend&gt;', '&lt;link&gt;', '&lt;li&gt;',
-			'&lt;label', '&lt;legend', '&lt;link', '&lt;li',
-			'&lt;/label&gt;', '&lt;/legend&gt;', '&lt;/link&gt;', '&lt;/li&gt;',
-			'&lt;/label', '&lt;/legend', '&lt;/link', '&lt;/li',
-
-			'&lt;map&gt;', '&lt;meta&gt;',
-			'&lt;map', '&lt;meta',
-			'&lt;/map&gt;', '&lt;/meta&gt;',
-			'&lt;/map', '&lt;/meta',
-
-			'&lt;noframes&gt;', '&lt;noscript&gt;',
-			'&lt;noframes', '&lt;noscript',
-			'&lt;/noframes&gt;', '&lt;/noscript&gt;',
-			'&lt;/noframes', '&lt;/noscript',
-
-			'&lt;object&gt;', '&lt;ol&gt;', '&lt;optgroup&gt;', '&lt;option&gt;',
-			'&lt;object', '&lt;ol', '&lt;optgroup', '&lt;option',
-			'&lt;/object&gt;', '&lt;/ol&gt;', '&lt;/optgroup&gt;', '&lt;/option&gt;',
-			'&lt;/object', '&lt;/ol', '&lt;/optgroup', '&lt;/option',
-
-			'&lt;param&gt;', '&lt;pre&gt;', '&lt;p&gt;',
-			'&lt;param', '&lt;pre', '&lt;p',
-			'&lt;/param&gt;', '&lt;/pre&gt;', '&lt;/p&gt;',
-			'&lt;/param', '&lt;/pre', '&lt;/p',
-
-			'&lt;q&gt;',
-			'&lt;q',
-			'&lt;/q&gt;',
-			'&lt;/q',
-
-			'&lt;samp&gt;', '&lt;script&gt;', '&lt;select&gt;', '&lt;small&gt;', '&lt;span&gt;', '&lt;strike&gt;', '&lt;strong&gt;', '&lt;style&gt;', '&lt;sub&gt;', '&lt;sup&gt;', '&lt;s&gt;',
-			'&lt;samp', '&lt;script', '&lt;select', '&lt;small', '&lt;span', '&lt;strike', '&lt;strong', '&lt;style', '&lt;sub', '&lt;sup', '&lt;s',
-			'&lt;/samp&gt;', '&lt;/script&gt;', '&lt;/select&gt;', '&lt;/small&gt;', '&lt;/span&gt;', '&lt;/strike&gt;', '&lt;/strong&gt;', '&lt;/style&gt;', '&lt;/sub&gt;', '&lt;/sup&gt;', '&lt;/s&gt;',
-			'&lt;/samp', '&lt;/script', '&lt;/select', '&lt;/small', '&lt;/span', '&lt;/strike', '&lt;/strong', '&lt;/style', '&lt;/sub', '&lt;/sup', '&lt;/s',
-
-			'&lt;table&gt;', '&lt;tbody&gt;', '&lt;td&gt;', '&lt;textarea&gt;', '&lt;text&gt;', '&lt;tfoot&gt;', '&lt;thead&gt;', '&lt;th&gt;', '&lt;title&gt;', '&lt;tr&gt;', '&lt;tt&gt;',
-			'&lt;table', '&lt;tbody', '&lt;td', '&lt;textarea', '&lt;text', '&lt;tfoot', '&lt;tfoot', '&lt;thead', '&lt;th', '&lt;title', '&lt;tr', '&lt;tt',
-			'&lt;/table&gt;', '&lt;/tbody&gt;', '&lt;/td&gt;', '&lt;/textarea&gt;', '&lt;/text&gt;', '&lt;/tfoot&gt;', '&lt;/thead', '&lt;/tfoot', '&lt;/th&gt;', '&lt;/title&gt;', '&lt;/tr&gt;', '&lt;/tt&gt;',
-			'&lt;/table', '&lt;/tbody', '&lt;/td', '&lt;/textarea', '&lt;/text', '&lt;/tfoot', '&lt;/tfoot', '&lt;/thead', '&lt;/th', '&lt;/title', '&lt;/tr', '&lt;/tt',
-
-			'&lt;ul&gt;', '&lt;u&gt;',
-			'&lt;ul', '&lt;u',
-			'&lt;/ul&gt;', '&lt;/ul&gt;',
-			'&lt;/ul', '&lt;/u',
-
-			'&lt;var&gt;',
-			'&lt;var',
-			'&lt;/var&gt;',
-			'&lt;/var',
-
-			'&gt;', '&lt;'
-			),
-		3 => array(
-			'abbr', 'accept-charset', 'accept', 'accesskey', 'action', 'align', 'alink', 'alt', 'archive', 'axis',
-			'background', 'bgcolor', 'border',
-			'cellpadding', 'cellspacing', 'char', 'char', 'charoff', 'charset', 'checked', 'cite', 'class', 'classid', 'clear', 'code', 'codebase', 'codetype', 'color', 'cols', 'colspan', 'compact', 'content', 'coords',
-			'data', 'datetime', 'declare', 'defer', 'dir', 'disabled',
-			'enctype',
-			'face', 'for', 'frame', 'frameborder',
-			'headers', 'height', 'href', 'hreflang', 'hspace', 'http-equiv',
-			'id', 'ismap',
-			'label', 'lang', 'language', 'link', 'longdesc',
-			'marginheight', 'marginwidth', 'maxlength', 'media', 'method', 'multiple',
-			'name', 'nohref', 'noresize', 'noshade', 'nowrap',
-			'object', 'onblur', 'onchange', 'onclick', 'ondblclick', 'onfocus', 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onreset', 'onselect', 'onsubmit', 'onunload',
-			'profile', 'prompt',
-			'readonly', 'rel', 'rev', 'rowspan', 'rows', 'rules',
-			'scheme', 'scope', 'scrolling', 'selected', 'shape', 'size', 'span', 'src', 'standby', 'start', 'style', 'summary',
-			'tabindex', 'target', 'text', 'title', 'type',
-			'usemap',
-			'valign', 'value', 'valuetype', 'version', 'vlink', 'vspace',
-			'width'
-			)
-		),
-	'SYMBOLS' => array(
-		'/', '='
-		),
-	'CASE_SENSITIVE' => array(
-		GESHI_COMMENTS => false,
-		1 => false,
-		2 => false,
-		3 => false,
-		),
-	'STYLES' => array(
-		'KEYWORDS' => array(
-			1 => 'color: #b1b100;',
-			2 => 'color: #000000; font-weight: bold;',
-			3 => 'color: #000066;'
-			),
-		'COMMENTS' => array(
-			'MULTI' => 'color: #808080; font-style: italic;'
-			),
-		'ESCAPE_CHAR' => array(
-			0 => 'color: #000099; font-weight: bold;'
-			),
-		'BRACKETS' => array(
-			0 => 'color: #66cc66;'
-			),
-		'STRINGS' => array(
-			0 => 'color: #ff0000;'
-			),
-		'NUMBERS' => array(
-			0 => 'color: #cc66cc;'
-			),
-		'METHODS' => array(
-			),
-		'SYMBOLS' => array(
-			0 => 'color: #66cc66;'
-			),
-		'SCRIPT' => array(
-			0 => 'color: #00bbdd;',
-			1 => 'color: #ddbb00;',
-			2 => 'color: #009900;'
-			),
-		'REGEXPS' => array(
-			)
-		),
-	'URLS' => array(
-		1 => '',
-		2 => 'http://december.com/html/4/element/{FNAME}.html',
-		3 => ''
-		),
-	'OOLANG' => false,
-	'OBJECT_SPLITTERS' => array(
-		),
-	'REGEXPS' => array(
-		),
-	'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
-	'SCRIPT_DELIMITERS' => array(
-		0 => array(
-			'<!DOCTYPE' => '>'
-			),
-		1 => array(
-			'&' => ';'
-			),
-		2 => array(
-			'<' => '>'
-			)
-	),
-	'HIGHLIGHT_STRICT_BLOCK' => array(
-		0 => false,
-		1 => false,
-		2 => true
-		)
+    'LANG_NAME' => 'HTML',
+    'COMMENT_SINGLE' => array(),
+    'COMMENT_MULTI' => array(),
+    'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
+    'QUOTEMARKS' => array("'", '"'),
+    'ESCAPE_CHAR' => '',
+    'KEYWORDS' => array(
+        2 => array(
+            'a', 'abbr', 'acronym', 'address', 'applet',
+            'base', 'basefont', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'b',
+            'caption', 'center', 'cite', 'code', 'colgroup', 'col',
+            'dd', 'del', 'dfn', 'dir', 'div', 'dl', 'dt',
+            'em',
+            'fieldset', 'font', 'form', 'frame', 'frameset',
+            'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'hr', 'html',
+            'iframe', 'ilayer', 'img', 'input', 'ins', 'isindex', 'i',
+            'kbd',
+            'label', 'legend', 'link', 'li',
+            'map', 'meta',
+            'noframes', 'noscript',
+            'object', 'ol', 'optgroup', 'option',
+            'param', 'pre', 'p',
+            'q',
+            'samp', 'script', 'select', 'small', 'span', 'strike', 'strong', 'style', 'sub', 'sup', 's',
+            'table', 'tbody', 'td', 'textarea', 'text', 'tfoot', 'thead', 'th', 'title', 'tr', 'tt',
+            'ul', 'u',
+            'var',
+            ),
+        3 => array(
+            'abbr', 'accept-charset', 'accept', 'accesskey', 'action', 'align', 'alink', 'alt', 'archive', 'axis',
+            'background', 'bgcolor', 'border',
+            'cellpadding', 'cellspacing', 'char', 'charoff', 'charset', 'checked', 'cite', 'class', 'classid', 'clear', 'code', 'codebase', 'codetype', 'color', 'cols', 'colspan', 'compact', 'content', 'coords',
+            'data', 'datetime', 'declare', 'defer', 'dir', 'disabled',
+            'enctype',
+            'face', 'for', 'frame', 'frameborder',
+            'headers', 'height', 'href', 'hreflang', 'hspace', 'http-equiv',
+            'id', 'ismap',
+            'label', 'lang', 'language', 'link', 'longdesc',
+            'marginheight', 'marginwidth', 'maxlength', 'media', 'method', 'multiple',
+            'name', 'nohref', 'noresize', 'noshade', 'nowrap',
+            'object', 'onblur', 'onchange', 'onclick', 'ondblclick', 'onfocus', 'onkeydown', 'onkeypress', 'onkeyup', 'onload', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', 'onreset', 'onselect', 'onsubmit', 'onunload',
+            'profile', 'prompt',
+            'readonly', 'rel', 'rev', 'rowspan', 'rows', 'rules',
+            'scheme', 'scope', 'scrolling', 'selected', 'shape', 'size', 'span', 'src', 'standby', 'start', 'style', 'summary',
+            'tabindex', 'target', 'text', 'title', 'type',
+            'usemap',
+            'valign', 'value', 'valuetype', 'version', 'vlink', 'vspace',
+            'width'
+            )
+        ),
+    'SYMBOLS' => array(
+        '/', '='
+        ),
+    'CASE_SENSITIVE' => array(
+        GESHI_COMMENTS => false,
+        2 => false,
+        3 => false,
+        ),
+    'STYLES' => array(
+        'KEYWORDS' => array(
+            2 => 'color: #000000; font-weight: bold;',
+            3 => 'color: #000066;'
+            ),
+        'COMMENTS' => array(
+            ),
+        'ESCAPE_CHAR' => array(
+            0 => 'color: #000099; font-weight: bold;'
+            ),
+        'BRACKETS' => array(
+            0 => 'color: #66cc66;'
+            ),
+        'STRINGS' => array(
+            0 => 'color: #ff0000;'
+            ),
+        'NUMBERS' => array(
+            0 => 'color: #cc66cc;'
+            ),
+        'METHODS' => array(
+            ),
+        'SYMBOLS' => array(
+            0 => 'color: #66cc66;'
+            ),
+        'SCRIPT' => array(
+            -2 => 'color: #404040;', // CDATA
+            -1 => 'color: #808080; font-style: italic;', // comments
+            0 => 'color: #00bbdd;',
+            1 => 'color: #ddbb00;',
+            2 => 'color: #009900;'
+            ),
+        'REGEXPS' => array(
+            )
+        ),
+    'URLS' => array(
+        2 => 'http://december.com/html/4/element/{FNAMEL}.html',
+        3 => ''
+        ),
+    'OOLANG' => false,
+    'OBJECT_SPLITTERS' => array(
+        ),
+    'REGEXPS' => array(
+        ),
+    'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
+    'SCRIPT_DELIMITERS' => array(
+        -2 => array(
+            '<![CDATA[' => ']]>'
+            ),
+        -1 => array(
+            '<!--' => '-->'
+            ),
+        0 => array(
+            '<!DOCTYPE' => '>'
+            ),
+        1 => array(
+            '&' => ';'
+            ),
+        2 => array(
+            '<' => '>'
+            )
+    ),
+    'HIGHLIGHT_STRICT_BLOCK' => array(
+        -2 => false,
+        -1 => false,
+        0 => false,
+        1 => false,
+        2 => true
+        ),
+    'TAB_WIDTH' => 4,
+    'PARSER_CONTROL' => array(
+        'KEYWORDS' => array(
+            2 => array(
+                'DISALLOWED_BEFORE' => '(?<=&lt;|&lt;\/)',
+                'DISALLOWED_AFTER' => '(?=\s|\/|&gt;)',
+            )
+        )
+    )
 );
 
-?>
+?>
\ No hay ningún carácter de nueva línea al final del fichero
diff -aruN --binary 22/libraries/geshi/geshi/ini.php 23/libraries/geshi/geshi/ini.php
--- 22/libraries/geshi/geshi/ini.php	2009-05-29 13:54:38.000000000 +0200
+++ 23/libraries/geshi/geshi/ini.php	2011-03-31 18:09:16.000000000 +0200
@@ -1,16 +1,21 @@
 <?php
+// no direct access
+defined('_JEXEC') or die;
+
 /*************************************************************************************
  * ini.php
  * --------
  * Author: deguix (cevo_deguix@yahoo.com.br)
  * Copyright: (c) 2005 deguix
- * Release Version: 1.0.7.19
+ * Release Version: 1.0.8.10
  * Date Started: 2005/03/27
  *
  * INI language file for GeSHi.
  *
  * CHANGES
  * -------
+ * 2008/05/23 (1.0.7.22)
+ *   -  Added description of extra language features (SF#1970248)
  * 2005/12/28 (1.0.1)
  *   -  Removed unnecessary keyword style index
  *   -  Added support for " strings
@@ -40,86 +45,87 @@
  *
  ************************************************************************************/
 
-defined('GESHI_CAPS_NO_CHANGE') or die();
-
 $language_data = array (
-	'LANG_NAME' => 'INI',
-	'COMMENT_SINGLE' => array(0 => ';'),
-	'COMMENT_MULTI' => array(),
-	'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
-	'QUOTEMARKS' => array('"'),
-	'ESCAPE_CHAR' => '',
-	'KEYWORDS' => array(
-		),
-	'SYMBOLS' => array(
-		'[', ']', '='
-		),
-	'CASE_SENSITIVE' => array(
-		GESHI_COMMENTS => false
-		),
-	'STYLES' => array(
-		'KEYWORDS' => array(
-			),
-		'COMMENTS' => array(
-			0 => 'color: #666666; font-style: italic;'
-			),
-		'ESCAPE_CHAR' => array(
-		    0 => ''
-			),
-		'BRACKETS' => array(
-		    0 => ''
-			),
-		'STRINGS' => array(
-		    0 => 'color: #933;'
-			),
-		'NUMBERS' => array(
-		    0 => ''
-			),
-		'METHODS' => array(
-		    0 => ''
-			),
-		'SYMBOLS' => array(
-			0 => 'color: #000066; font-weight:bold;'
-			),
-		'REGEXPS' => array(
-			0 => 'color: #000066; font-weight:bold;',
-			1 => 'color: #000099;',
-			2 => 'color: #660066;'
-			),
-		'SCRIPT' => array(
-		    0 => ''
-			)
-		),
-	'URLS' => array(
-		),
-	'OOLANG' => false,
-	'OBJECT_SPLITTERS' => array(
-		),
-	'REGEXPS' => array(
-		0 => '\[.+\]',
-		1 => array(
-			GESHI_SEARCH => '([a-zA-Z0-9_]+\s*)=(.+)',
-			GESHI_REPLACE => '\\1',
-			GESHI_MODIFIERS => '',
-			GESHI_BEFORE => '',
-			GESHI_AFTER => '=\\2'
-			),
-		2 => array(
+    'LANG_NAME' => 'INI',
+    'COMMENT_SINGLE' => array(0 => ';'),
+    'COMMENT_MULTI' => array(),
+    'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
+    'QUOTEMARKS' => array('"'),
+    'ESCAPE_CHAR' => '',
+    'KEYWORDS' => array(
+        ),
+    'SYMBOLS' => array(
+        '[', ']', '='
+        ),
+    'CASE_SENSITIVE' => array(
+        GESHI_COMMENTS => false
+        ),
+    'STYLES' => array(
+        'KEYWORDS' => array(
+            ),
+        'COMMENTS' => array(
+            0 => 'color: #666666; font-style: italic;'
+            ),
+        'ESCAPE_CHAR' => array(
+            0 => ''
+            ),
+        'BRACKETS' => array(
+            0 => ''
+            ),
+        'STRINGS' => array(
+            0 => 'color: #933;'
+            ),
+        'NUMBERS' => array(
+            0 => ''
+            ),
+        'METHODS' => array(
+            0 => ''
+            ),
+        'SYMBOLS' => array(
+            0 => 'color: #000066; font-weight:bold;'
+            ),
+        'REGEXPS' => array(
+            0 => 'color: #000066; font-weight:bold;',
+            1 => 'color: #000099;',
+            2 => 'color: #660066;'
+            ),
+        'SCRIPT' => array(
+            0 => ''
+            )
+        ),
+    'URLS' => array(
+        ),
+    'OOLANG' => false,
+    'OBJECT_SPLITTERS' => array(
+        ),
+    'REGEXPS' => array(
+        //Section names
+        0 => '\[.+\]',
+        //Entry names
+        1 => array(
+            GESHI_SEARCH => '^(\s*)([a-zA-Z0-9_\-]+)(\s*=)',
+            GESHI_REPLACE => '\\2',
+            GESHI_MODIFIERS => 'm',
+            GESHI_BEFORE => '\\1',
+            GESHI_AFTER => '\\3'
+            ),
+        //Entry values
+        2 => array(
             // Evil hackery to get around GeSHi bug: <>" and ; are added so <span>s can be matched
             // Explicit match on variable names because if a comment is before the first < of the span
             // gets chewed up...
-			GESHI_SEARCH => '([<>";a-zA-Z0-9_]+\s*)=(.+)',
-			GESHI_REPLACE => '\\2',
-			GESHI_MODIFIERS => '',
-			GESHI_BEFORE => '\\1=',
-			GESHI_AFTER => ''
-			)
-		),
-	'STRICT_MODE_APPLIES' => GESHI_NEVER,
-	'SCRIPT_DELIMITERS' => array(
-		),
-	'HIGHLIGHT_STRICT_BLOCK' => array(
-		)
+            GESHI_SEARCH => '([<>";a-zA-Z0-9_]+\s*)=(.*)',
+            GESHI_REPLACE => '\\2',
+            GESHI_MODIFIERS => '',
+            GESHI_BEFORE => '\\1=',
+            GESHI_AFTER => ''
+            )
+        ),
+    'STRICT_MODE_APPLIES' => GESHI_NEVER,
+    'SCRIPT_DELIMITERS' => array(
+        ),
+    'HIGHLIGHT_STRICT_BLOCK' => array(
+        )
 );
 
 ?>
diff -aruN --binary 22/libraries/geshi/geshi/javascript.php 23/libraries/geshi/geshi/javascript.php
--- 22/libraries/geshi/geshi/javascript.php	2009-05-29 13:54:38.000000000 +0200
+++ 23/libraries/geshi/geshi/javascript.php	2011-03-31 18:09:16.000000000 +0200
@@ -1,16 +1,21 @@
 <?php
+// no direct access
+defined('_JEXEC') or die;
+
 /*************************************************************************************
  * javascript.php
  * --------------
  * Author: Ben Keen (ben.keen@gmail.com)
  * Copyright: (c) 2004 Ben Keen (ben.keen@gmail.com), Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.19
+ * Release Version: 1.0.8.10
  * Date Started: 2004/06/20
  *
  * JavaScript language file for GeSHi.
  *
  * CHANGES
  * -------
+ * 2008/05/23 (1.0.7.22)
+ *  -  Added description of extra language features (SF#1970248)
  * 2004/11/27 (1.0.1)
  *  -  Added support for multiple object splitters
  * 2004/10/27 (1.0.0)
@@ -39,108 +44,112 @@
  *
  ************************************************************************************/
 
-defined('GESHI_CAPS_NO_CHANGE') or die();
-
 $language_data = array (
-  'LANG_NAME' => 'Javascript',
-  'COMMENT_SINGLE' => array(1 => '//'),
-  'COMMENT_MULTI' => array('/*' => '*/'),
-  'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
-  'QUOTEMARKS' => array("'", '"'),
-  'ESCAPE_CHAR' => '\\',
-  'KEYWORDS' => array(
-    1 => array(
-      'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
-      'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
-      'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
-      'while', 'write', 'with'
-      ),
-    2 => array(
-      'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
-      'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
-      'protected', 'public', 'super', 'true', 'use', 'var'
-      ),
-    3 => array(
-
-      // common functions for Window object
-      'alert', 'back', 'blur', 'close', 'confirm', 'focus', 'forward', 'home',
-      'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
-      'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'status',
-      'stop',
-      )
-    ),
-  'SYMBOLS' => array(
-    '(', ')', '[', ']', '{', '}', '!', '@', '%', '&', '*', '|', '/', '<', '>'
-    ),
-  'CASE_SENSITIVE' => array(
-    GESHI_COMMENTS => false,
-    1 => false,
-    2 => false,
-    3 => false
-    ),
-  'STYLES' => array(
+    'LANG_NAME' => 'Javascript',
+    'COMMENT_SINGLE' => array(1 => '//'),
+    'COMMENT_MULTI' => array('/*' => '*/'),
+    'COMMENT_REGEXP' => array(
+        //Regular Expressions
+        2 => "/(?<=[\\s^])(s|tr|y)\\/(?!\*)(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])+(?<!\s)\\/(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])*(?<!\s)\\/[msixpogcde]*(?=[\\s$\\.\\;])|(?<=[\\s^(=])(m|q[qrwx]?)?\\/(?!\*)(?!\s)(?:\\\\.|(?!\n)[^\\/\\\\])+(?<!\s)\\/[msixpogc]*(?=[\\s$\\.\\,\\;\\)])/iU"
+        ),
+    'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
+    'QUOTEMARKS' => array("'", '"'),
+    'ESCAPE_CHAR' => '\\',
     'KEYWORDS' => array(
-      1 => 'color: #000066; font-weight: bold;',
-      2 => 'color: #003366; font-weight: bold;',
-      3 => 'color: #000066;'
-      ),
-    'COMMENTS' => array(
-      1 => 'color: #009900; font-style: italic;',
-      'MULTI' => 'color: #009900; font-style: italic;'
-      ),
-    'ESCAPE_CHAR' => array(
-      0 => 'color: #000099; font-weight: bold;'
-      ),
-    'BRACKETS' => array(
-      0 => 'color: #66cc66;'
-      ),
-    'STRINGS' => array(
-      0 => 'color: #3366CC;'
-      ),
-    'NUMBERS' => array(
-      0 => 'color: #CC0000;'
-      ),
-    'METHODS' => array(
-      1 => 'color: #006600;'
-      ),
+        1 => array(
+            'as', 'break', 'case', 'catch', 'continue', 'decodeURI', 'delete', 'do',
+            'else', 'encodeURI', 'eval', 'finally', 'for', 'if', 'in', 'is', 'item',
+            'instanceof', 'return', 'switch', 'this', 'throw', 'try', 'typeof', 'void',
+            'while', 'write', 'with'
+            ),
+        2 => array(
+            'class', 'const', 'default', 'debugger', 'export', 'extends', 'false',
+            'function', 'import', 'namespace', 'new', 'null', 'package', 'private',
+            'protected', 'public', 'super', 'true', 'use', 'var'
+            ),
+        3 => array(
+            // common functions for Window object
+            'alert', 'back', 'blur', 'close', 'confirm', 'focus', 'forward', 'home',
+            'name', 'navigate', 'onblur', 'onerror', 'onfocus', 'onload', 'onmove',
+            'onresize', 'onunload', 'open', 'print', 'prompt', 'scroll', 'status',
+            'stop',
+            )
+        ),
     'SYMBOLS' => array(
-      0 => 'color: #66cc66;'
-      ),
+        '(', ')', '[', ']', '{', '}',
+        '+', '-', '*', '/', '%',
+        '!', '@', '&', '|', '^',
+        '<', '>', '=',
+        ',', ';', '?', ':'
+        ),
+    'CASE_SENSITIVE' => array(
+        GESHI_COMMENTS => false,
+        1 => false,
+        2 => false,
+        3 => false
+        ),
+    'STYLES' => array(
+        'KEYWORDS' => array(
+            1 => 'color: #000066; font-weight: bold;',
+            2 => 'color: #003366; font-weight: bold;',
+            3 => 'color: #000066;'
+            ),
+        'COMMENTS' => array(
+            1 => 'color: #006600; font-style: italic;',
+            2 => 'color: #009966; font-style: italic;',
+            'MULTI' => 'color: #006600; font-style: italic;'
+            ),
+        'ESCAPE_CHAR' => array(
+            0 => 'color: #000099; font-weight: bold;'
+            ),
+        'BRACKETS' => array(
+            0 => 'color: #009900;'
+            ),
+        'STRINGS' => array(
+            0 => 'color: #3366CC;'
+            ),
+        'NUMBERS' => array(
+            0 => 'color: #CC0000;'
+            ),
+        'METHODS' => array(
+            1 => 'color: #660066;'
+            ),
+        'SYMBOLS' => array(
+            0 => 'color: #339933;'
+            ),
+        'REGEXPS' => array(
+            ),
+        'SCRIPT' => array(
+            0 => '',
+            1 => '',
+            2 => '',
+            3 => ''
+            )
+        ),
+    'URLS' => array(
+        1 => '',
+        2 => '',
+        3 => ''
+        ),
+    'OOLANG' => true,
+    'OBJECT_SPLITTERS' => array(
+        1 => '.'
+        ),
     'REGEXPS' => array(
-      0 => 'color: #0066FF;'
-      ),
-    'SCRIPT' => array(
-      0 => '',
-      1 => '',
-      2 => '',
-      3 => ''
-      )
-    ),
-  'URLS' => array(
-		1 => '',
-		2 => '',
-		3 => ''
-  	),
-  'OOLANG' => true,
-  'OBJECT_SPLITTERS' => array(
-  	1 => '.'
-	),
-  'REGEXPS' => array(
-    0 => "/.*/([igm]*)?"         // matches js reg exps
-    ),
-  'STRICT_MODE_APPLIES' => GESHI_MAYBE,
-  'SCRIPT_DELIMITERS' => array(
-    0 => array(
-      '<script type="text/javascript">' => '</script>'
-      ),
-    1 => array(
-      '<script language="javascript">' => '</script>'
-      )
-    ),
-  'HIGHLIGHT_STRICT_BLOCK' => array(
-    0 => true,
-    1 => true
-  )
+        ),
+    'STRICT_MODE_APPLIES' => GESHI_MAYBE,
+    'SCRIPT_DELIMITERS' => array(
+        0 => array(
+            '<script type="text/javascript">' => '</script>'
+            ),
+        1 => array(
+            '<script language="javascript">' => '</script>'
+            )
+        ),
+    'HIGHLIGHT_STRICT_BLOCK' => array(
+        0 => true,
+        1 => true
+        )
 );
 
-?>
+?>
\ No hay ningún carácter de nueva línea al final del fichero
diff -aruN --binary 22/libraries/geshi/geshi/mysql.php 23/libraries/geshi/geshi/mysql.php
--- 22/libraries/geshi/geshi/mysql.php	2009-05-29 13:54:38.000000000 +0200
+++ 23/libraries/geshi/geshi/mysql.php	2011-03-31 18:09:16.000000000 +0200
@@ -1,14 +1,31 @@
 <?php
- /*************************************************************************************
+// no direct access
+defined('_JEXEC') or die;
+
+/*************************************************************************************
  * mysql.php
  * ---------
- * Author: Carl F�rstenberg (azatoth@gmail.com)
- * Copyright: (c) 2005 Carl F�rstenberg, Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.19
- * Date Started: 2004/06/04
+ * Author: Marjolein Katsma (marjolein.is.back@gmail.com)
+ * Copyright: (c) 2008 Marjolein Katsma (http://blog.marjoleinkatsma.com/)
+ * Release Version: 1.0.8.10
+ * Date Started: 2008-12-12
  *
  * MySQL language file for GeSHi.
  *
+ * Based on original MySQL language file by Carl FÃ¼rstenberg (2004); brought
+ * up-to-date for current MySQL versions, and with more classes for different
+ * types of keywords; several minor errors were corrected as well.
+ *
+ * Some "classes" have two groups here: this is to allow for the fact that some
+ * keywords in MySQL have a double function: many of those are either a function
+ * (must be immediately followed by an opening bracket) or some other keyword:
+ * so they can be distinguished by the presence (or not) of that opening bracket.
+ * (An immediately following opening bracket is a default rule for functions in
+ * MySQL, though this may be overridden; because it's only a default, we use a
+ * regex lookahead only where necessary to distinguish homonyms, not generally
+ * to match any function.)
+ * Other keywords with double usage cannot be distinguished and are classified
+ * in the "Mix" category.
  *
  *************************************************************************************
  *
@@ -30,154 +47,432 @@
  *
  ************************************************************************************/
 
-defined('GESHI_COMMENTS') or die();
-
 $language_data = array (
-  'LANG_NAME' => 'MySQL',
-  'COMMENT_SINGLE' => array(1 =>'--', 2 => '#'),
-  'COMMENT_MULTI' => array('/*' => '*/'),
-  'CASE_KEYWORDS' => 1,
-  'QUOTEMARKS' => array("'", '"', ''),
-  'ESCAPE_CHAR' => '\\',
-  'KEYWORDS' => array(
-  1 => array(
-  /* Mix */
-  'ALTER DATABASE', 'ALTER TABLE', 'CREATE DATABASE', 'CREATE INDEX', 'CREATE TABLE', 'DROP DATABASE',
-  'DROP INDEX', 'DROP TABLE', 'RENAME TABLE', 'DELETE', 'DO', 'HANDLER', 'INSERT', 'LOAD DATA INFILE',
-  'REPLACE', 'SELECT', 'TRUNCATE', 'UPDATE', 'DESCRIBE', 'USE', 'START TRANSACTION', 'COMMIT', 'ROLLBACK',
-  'SAVEPOINT', 'ROLLBACK TO SAVEPOINT', 'LOCK TABLES', 'UNLOCK_TABLES', 'SET TRANACTIONS', 'SET', 'SHOW',
-  'CREATE PROCEDURE', 'CREATE FUNCTION', 'ALTER PROCEDURE', 'ALTER FUNCTION', 'DROP PROCEDURE', 'DROP FUNCTION',
-  'SHOW CREATE PROCEDURE', 'SHOW CREATE FUNCTION', 'SHOW PROCEDURE STATUS', 'SHOW FUNCTION STATUS',
-  'CALL', 'BEGIN', 'END', 'DECLARE', 'CREATE ROUTINE', 'ALTER ROUTINE', 'CREATE', 'ALTER', 'DROP',
-  'PRIMARY KEY', 'VALUES', 'INTO', 'FROM',
-  'ANALYZE', 'BDB', 'BERKELEYDB', 'BTREE', 'BY', 'CASCADE', 'CHECK', 'COLUMN', 'COLUMNS', 'CONSTRAINT',
-  'CROSS', 'DATABASES', 'DELAYED', 'DISTINCT', 'DISTINCTROW', 'ENCLOSED', 'ERRORS', 'ESCAPED', 'EXISTS',
-  'EXPLAIN', 'FALSE', 'FIELDS', 'FORCE', 'FOREIGN', 'FULLTEXT', 'GEOMETRY', 'GRANT', 'GROUP', 'HASH',
-  'HAVING', 'HELP', 'HIGH_PRIORITY', 'IGNORE', 'INNER', 'INNODB', 'INTERVAL', 'JOIN', 'KEYS', 'KILL',
-  'LINES', 'LOW_PRIORITY', 'MASTER_SERVER_ID', 'MATCH', 'MIDDLEINT', 'MRG_MYISAM', 'NATURAL', 'OPTIMIZE',
-  'OPTION', 'OPTIONALLY', 'ORDER', 'OUTER', 'OUTFILE', 'PRIVILEGES', 'PURGE', 'READ', 'REFERENCES',
-  'REQUIRE', 'RESTRICT', 'RETURNS', 'REVOKE', 'RLIKE', 'RTREE', 'SOME', 'SONAME', 'SPATIAL', 'SQL_BIG_RESULT',
-  'SQL_CALC_FOUND_ROWS', 'SQL_SMALL_RESULT', 'SSL', 'STARTING', 'STRAIGHT_JOIN', 'STRIPED', 'TERMINATED',
-  'TRUE', 'TYPES', 'UNION', 'USAGE', 'USER_RESOURCES', 'USING', 'VARCHARACTER', 'WARNINGS', 'WHERE', 'WRITE',
-  /* Control Flow Functions */
-  'CASE', 'WHEN', 'THEN', 'ELSE', 'END',
-  /* String Functions */
-  'UNHEX', 'BIN', 'BIT_LENGTH', 'CHAR_LENGTH', 'CHARACTER_LENGTH', 'COMPRESS', 'CONCAT',
-  'CONCAT_WS', 'CONV', 'ELT', 'EXPORT_SET', 'FIELD', 'FIND_IN_SET', 'FORMAT', 'HEX',
-  'INSERT', 'INSTR', 'LCASE', 'LEFT', 'LENGTH', 'LOAD_FILE', 'LOCATE', 'LOWER', 'LPAD',
-  'LTRIM', 'MAKE_SET', 'MID', 'OCT', 'OCTET_LENGTH', 'ORD', 'POSITION', 'QUOTE', 'REPEAT',
-  'REPLACE', 'REVERSE', 'RIGHT', 'RPAD', 'RTRIM', 'SOUNDEX', 'SPACE', 'SUBSTRING',
-  'SUBSTRING_INDEX', 'TRIM', 'UCASE', 'UPPER', 'UNCOMPRESS', 'UNCOMPRESSD_LENGTH',
-  'MD5', 'SHA1',
-  /* Numeric Functions */
-  'ABS', 'ACOS', 'ASIN', 'ATAN', 'ATAN2', 'CEILING', 'CEIL', 'COS', 'COT', 'CRC32', 'DEGREES',
-  'EXP', 'FLOOR', 'LN', 'LOG', 'LOG2', 'LOG10', 'MOD', 'PI', 'POW', 'POWER', 'RADIANS', 'RAND',
-  'ROUND', 'SIGN', 'SIN', 'SQRT', 'TAN', 'TRUNCATE',
-  /* Date and Time Functions */
-  'ADDDATE', 'ADDTIME', 'CONVERT_TZ', 'CURDATE', 'CURRENT_DATE', 'CURTIME', 'CURRENT_TIME',
-  'CURRENT_TIMESTAMP', 'DATEDIFF', 'DATE_ADD', 'DATE_SUB', 'DATE_FORMAT', 'DAY',
-  'DAYNAME', 'DAYOFMONTH', 'DAYOFWEEK', 'DAYOFYEAR', 'EXTRACT', 'FROM_DAYS', 'FROM_UNIXTIME',
-  'GET_FORMAT', 'LAST_DAY', 'LOCALTIME', 'LOCALTIMESTAMP', 'MAKEDATE', 'MAKETIME',
-  'MICROSECOND', 'MONTHNAME', 'NOW', 'PERIOD_ADD', 'PERIOD_DIFF', 'QUARTER',
-  'SECOND', 'SEC_TO_TIME', 'STR_TO_DATE', 'SUBDATE', 'SUBTIME', 'SYSDATE', 'TIME', 'TIMEDIFF',
-  'TIMESTAMP', 'TIMESTAMPADD', 'TIMESTAMPDIFF', 'TIME_FORMAT', 'TIME_TO_SEC', 'TO_DAYS',
-  'UNIX_TIMESTAMP', 'UTC_DATE', 'UTC_TIME', 'UTC_TIMESTAMP', 'WEEKDAY', 'WEEKOFYEAR',
-  'YEARWEEK',
-
-   ),
-   2 => array(
-   'INTEGER', 'SMALLINT', 'DECIMAL', 'NUMERIC', 'FLOAT', 'REAL', 'DOUBLE PRECISION',
-   'DOUBLE', 'INT', 'DEC', 'BIT' ,'TINYINT', 'SMALLINT', 'MEDIUMINT', 'BIGINT',
-   'DATETIME', 'DATE', 'TIMESTAMP', 'TIME', 'YEAR',
-   'CHAR', 'VARCHAR', 'BINARY', 'CHARACTER VARYING', 'VARBINARY', 'TINYBLOB', 'TINYTEXT',
-   'BLOB', 'TEXT','MEDIUMBLOB', 'MEDIUMTEXT', 'LONGBLOB', 'LONGTEXT', 'ENUM', 'SET',
-   'SERIAL DEFAULT VALUE', 'SERIAL', 'FIXED'
-   ),
-   3 => array(
-   'ZEROFILL', 'NOT NULL', 'UNSIGNED', 'AUTO_INCREMENT', 'UNIQUE', 'NOT', 'NULL', 'CHARACTER SET', 'CHARSET',
-   'ASCII', 'UNICODE', 'NATIONAL', 'BOTH', 'LEADING', 'TRAILING','DEFAULT'
-   ),
-   4 => array(
-   'MICROSECOND', 'SECOND', 'MINUTE', 'HOUR', 'DAY', 'WEEK', 'MONTH', 'QUARTER', 'YEAR', 'SECOND_MICROSECOND',
-   'MINUTE_MICROSECOND', 'MINUTE_SECOND', 'HOUR_MICROSECOND', 'HOUR_SECOND', 'HOUR_MINUTE', 'DAY_MICROSECOND',
-   'DAY_SECOND', 'DAY_MINUTE', 'DAY_HOUR', 'YEAR_MONTH'
-   ),
-   5 => array(
-   'OR', 'XOR', 'AND', 'NOT', 'BETWEEN', 'IS', 'LIKE', 'REGEXP', 'IN', 'DIV',
-    'MOD', 'BINARY', 'COLLATE', 'LIMIT', 'OFFSET'
-   ),
-   ),
-   'SYMBOLS' => array(
-   ':=',
-   '||', 'OR', 'XOR',
-   '&&', 'AND',
-   'NOT',
-   'BETWEEN', 'CASE', 'WHEN', 'THEN', 'ELSE',
-   '=', '<=>', '>=', '>', '<=', '<', '<>', '!=', 'IS', 'LIKE', 'REGEXP', 'IN',
-   '|',
-   '&',
-   '<<', '>>',
-   '-', '+',
-   '*', '/', 'DIV', '%', 'MOD',
-   '^',
-   '-', '~',
-   '!',
-   'BINARY', 'COLLATE',
-   '(', ')',
-   ),
-   'CASE_SENSITIVE' => array(
-   GESHI_COMMENTS => false,
-   1 => false,
-   2 => false,
-   3 => false,
-   4 => false,
-   5 => false
-   ),
-   'STYLES' => array(
-   'KEYWORDS' => array(
-   1 => 'color: #993333; font-weight: bold;',
-   2 => 'color: #aa9933; font-weight: bold;',
-   3 => 'color: #aa3399; font-weight: bold;',
-   4 => 'color: #33aa99; font-weight: bold;',
-   5 => 'color: #993333; font-weight: bold;'
-   ),
-   'COMMENTS' => array(
-   'MULTI' => 'color: #808080; font-style: italic;',
-   1 => 'color: #808080; font-style: italic;',
-   2 => 'color: #808080; font-style: italic;'
-   ),
-   'ESCAPE_CHAR' => array(
-   0 => 'color: #000099; font-weight: bold;'
-   ),
-   'BRACKETS' => array(
-   0 => 'color: #66cc66;'
-   ),
-   'STRINGS' => array(
-   0 => 'color: #ff0000;'
-   ),
-   'NUMBERS' => array(
-   0 => 'color: #cc66cc;'
-   ),
-   'METHODS' => array(
-   ),
-   'SYMBOLS' => array(
-   0 => 'color: #66cc66;'
-   ),
-   'SCRIPT' => array(
-   ),
-   'REGEXPS' => array(
-   )
-   ),
-   'OOLANG' => false,
-   'OBJECT_SPLITTERS' => array(
-   ),
-   'REGEXPS' => array(
-   ),
-   'STRICT_MODE_APPLIES' => GESHI_NEVER,
-   'SCRIPT_DELIMITERS' => array(
-   ),
-   'HIGHLIGHT_STRICT_BLOCK' => array(
-   )
+    'LANG_NAME' => 'MySQL',
+    //'COMMENT_SINGLE' => array(1 =>'--', 2 => '#'),    // '--' MUST be folowed by whitespace,not necessarily a space
+    'COMMENT_SINGLE' => array(
+        1 =>'-- ',
+        2 => '#'
+        ),
+    'COMMENT_REGEXP' => array(
+        1 => "/(?:--\s).*?$/",                          // double dash followed by any whitespace
+        ),
+    'COMMENT_MULTI' => array('/*' => '*/'),
+    'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,            // @@@ would be nice if this could be defined per group!
+    'QUOTEMARKS' => array("'", '"', '`'),
+    'ESCAPE_CHAR' => '\\',                              // by default only, can be specified
+    'ESCAPE_REGEXP' => array(
+        1 => "/[_%]/",                                  // search wildcards
+        ),
+    'NUMBERS' =>
+        GESHI_NUMBER_INT_BASIC |
+        GESHI_NUMBER_OCT_PREFIX |
+        GESHI_NUMBER_HEX_PREFIX |
+        GESHI_NUMBER_FLT_NONSCI |
+        GESHI_NUMBER_FLT_SCI_SHORT |
+        GESHI_NUMBER_FLT_SCI_ZERO,
+    'KEYWORDS' => array(
+        1 => array(
+            // Mix: statement keywords and keywords that don't fit in any other
+            // category, or have multiple usage/meanings
+            'ACTION','ADD','AFTER','ALGORITHM','ALL','ALTER','ANALYZE','ANY',
+            'ASC','AS','BDB','BEGIN','BERKELEYDB','BINARY','BTREE','CALL',
+            'CASCADED','CASCADE','CHAIN','CHECK','COLUMNS','COLUMN','COMMENT',
+            'COMMIT','COMMITTED','CONSTRAINT','CONTAINS SQL','CONSISTENT',
+            'CONVERT','CREATE','CROSS','DATA','DATABASES',
+            'DECLARE','DEFINER','DELAYED','DELETE','DESCRIBE','DESC',
+            'DETERMINISTIC','DISABLE','DISCARD','DISTINCTROW','DISTINCT','DO',
+            'DROP','DUMPFILE','DUPLICATE KEY','ENABLE','ENCLOSED BY','ENGINE',
+            'ERRORS','ESCAPED BY','EXISTS','EXPLAIN','EXTENDED','FIELDS',
+            'FIRST','FOR EACH ROW','FORCE','FOREIGN KEY','FROM','FULL',
+            'FUNCTION','GLOBAL','GRANT','GROUP BY','HANDLER','HASH','HAVING',
+            'HELP','HIGH_PRIORITY','IF NOT EXISTS','IGNORE','IMPORT','INDEX',
+            'INFILE','INNER','INNODB','INOUT','INTO','INVOKER',
+            'ISOLATION LEVEL','JOIN','KEYS','KEY','KILL','LANGUAGE SQL','LAST',
+            'LIMIT','LINES','LOAD','LOCAL','LOCK','LOW_PRIORITY',
+            'MASTER_SERVER_ID','MATCH','MERGE','MIDDLEINT','MODIFIES SQL DATA',
+            'MODIFY','MRG_MYISAM','NATURAL','NEXT','NO SQL','NO','ON',
+            'OPTIMIZE','OPTIONALLY','OPTION','ORDER BY','OUTER','OUTFILE','OUT',
+            'PARTIAL','PREV','PRIMARY KEY','PRIVILEGES','PROCEDURE','PURGE',
+            'QUICK','READS SQL DATA','READ','REFERENCES','RELEASE','RENAME',
+            'REPEATABLE','REQUIRE','RESTRICT','RETURNS','REVOKE',
+            'ROLLBACK','ROUTINE','RTREE','SAVEPOINT','SELECT',
+            'SERIALIZABLE','SESSION','SET','SHARE MODE','SHOW','SIMPLE',
+            'SNAPSHOT','SOME','SONAME','SQL SECURITY','SQL_BIG_RESULT',
+            'SQL_BUFFER_RESULT','SQL_CACHE','SQL_CALC_FOUND_ROWS',
+            'SQL_NO_CACHE','SQL_SMALL_RESULT','SSL','START','STARTING BY',
+            'STATUS','STRAIGHT_JOIN','STRIPED','TABLESPACE','TABLES','TABLE',
+            'TEMPORARY','TEMPTABLE','TERMINATED BY','TO','TRANSACTIONS',
+            'TRANSACTION','TRIGGER','TYPES','TYPE','UNCOMMITTED','UNDEFINED',
+            'UNION','UNLOCK_TABLES','UPDATE','USAGE','USE','USER_RESOURCES',
+            'USING','VALUES','VALUE','VIEW','WARNINGS','WHERE','WITH ROLLUP',
+            'WITH','WORK','WRITE',
+            ),
+        2 => array(     //No ( must follow
+            // Mix: statement keywords distinguished from functions by the same name
+            "CURRENT_USER", "DATABASE", "IN", "INSERT", "DEFAULT", "REPLACE", "SCHEMA", "TRUNCATE"
+            ),
+        3 => array(
+            // Values (Constants)
+            'FALSE','NULL','TRUE',
+            ),
+        4 => array(
+            // Column Data Types
+            'BIGINT','BIT','BLOB','BOOLEAN','BOOL','CHARACTER VARYING',
+            'CHAR VARYING','DATETIME','DECIMAL','DEC','DOUBLE PRECISION',
+            'DOUBLE','ENUM','FIXED','FLOAT','GEOMETRYCOLLECTION','GEOMETRY',
+            'INTEGER','INT','LINESTRING','LONGBLOB','LONGTEXT','MEDIUMBLOB',
+            'MEDIUMINT','MEDIUMTEXT','MULTIPOINT','MULTILINESTRING',
+            'MULTIPOLYGON','NATIONAL CHARACTER','NATIONAL CHARACTER VARYING',
+            'NATIONAL CHAR VARYING','NATIONAL VARCHAR','NCHAR VARCHAR','NCHAR',
+            'NUMERIC','POINT','POLYGON','REAL','SERIAL',
+            'SMALLINT','TEXT','TIMESTAMP','TINYBLOB','TINYINT',
+            'TINYTEXT','VARBINARY','VARCHARACTER','VARCHAR',
+            ),
+        5 => array(     //No ( must follow
+            // Column data types distinguished from functions by the same name
+            "CHAR", "DATE", "TIME"
+            ),
+        6 => array(
+            // Table, Column & Index Attributes
+            'AUTO_INCREMENT','AVG_ROW_LENGTH','BOTH','CHECKSUM','CONNECTION',
+            'DATA DIRECTORY','DEFAULT NULL','DELAY_KEY_WRITE','FULLTEXT',
+            'INDEX DIRECTORY','INSERT_METHOD','LEADING','MAX_ROWS','MIN_ROWS',
+            'NOT NULL','PACK_KEYS','ROW_FORMAT','SERIAL DEFAULT VALUE','SIGNED',
+            'SPATIAL','TRAILING','UNIQUE','UNSIGNED','ZEROFILL'
+            ),
+        7 => array(     //No ( must follow
+            // Column attribute distinguished from function by the same name
+            "CHARSET"
+            ),
+        8 => array(
+            // Date and Time Unit Specifiers
+            'DAY_HOUR','DAY_MICROSECOND','DAY_MINUTE','DAY_SECOND',
+            'HOUR_MICROSECOND','HOUR_MINUTE','HOUR_SECOND',
+            'MINUTE_MICROSECOND','MINUTE_SECOND',
+            'SECOND_MICROSECOND','YEAR_MONTH'
+            ),
+        9 => array(     //No ( must follow
+            // Date-time unit specifiers distinguished from functions by the same name
+            "DAY", "HOUR", "MICROSECOND", "MINUTE", "MONTH", "QUARTER", "SECOND", "WEEK", "YEAR"
+            ),
+        10 => array(
+            // Operators (see also Symbols)
+            'AND','BETWEEN','CHARACTER SET','COLLATE','DIV','IS NOT NULL',
+            'IS NOT','IS NULL','IS','LIKE','NOT','OFFSET','OR','REGEXP','RLIKE',
+            'SOUNDS LIKE','XOR'
+            ),
+        11 => array(     //No ( must follow
+            // Operator distinghuished from function by the same name
+            "INTERVAL"
+            ),
+        12 => array(
+            // Control Flow (functions)
+            'CASE','ELSE','END','IFNULL','IF','NULLIF','THEN','WHEN',
+            ),
+        13 => array(
+            // String Functions
+            'ASCII','BIN','BIT_LENGTH','CHAR_LENGTH','CHARACTER_LENGTH',
+            'CONCAT_WS','CONCAT','ELT','EXPORT_SET','FIELD',
+            'FIND_IN_SET','FORMAT','HEX','INSTR','LCASE','LEFT','LENGTH',
+            'LOAD_FILE','LOCATE','LOWER','LPAD','LTRIM','MAKE_SET','MID',
+            'OCTET_LENGTH','ORD','POSITION','QUOTE','REPEAT','REVERSE',
+            'RIGHT','RPAD','RTRIM','SOUNDEX','SPACE','STRCMP','SUBSTRING_INDEX',
+            'SUBSTRING','TRIM','UCASE','UNHEX','UPPER',
+            ),
+        14 => array(     //A ( must follow
+            // String functions distinguished from other keywords by the same name
+            "INSERT", "REPLACE", "CHAR"
+            ),
+        15 => array(
+            // Numeric Functions
+            'ABS','ACOS','ASIN','ATAN2','ATAN','CEILING','CEIL',
+            'CONV','COS','COT','CRC32','DEGREES','EXP','FLOOR','LN','LOG10',
+            'LOG2','LOG','MOD','OCT','PI','POWER','POW','RADIANS','RAND',
+            'ROUND','SIGN','SIN','SQRT','TAN',
+            ),
+        16 => array(     //A ( must follow
+            // Numeric function distinguished from other keyword by the same name
+            "TRUNCATE"
+            ),
+        17 => array(
+            // Date and Time Functions
+            'ADDDATE','ADDTIME','CONVERT_TZ','CURDATE','CURRENT_DATE',
+            'CURRENT_TIME','CURRENT_TIMESTAMP','CURTIME','DATE_ADD',
+            'DATE_FORMAT','DATE_SUB','DATEDIFF','DAYNAME','DAYOFMONTH',
+            'DAYOFWEEK','DAYOFYEAR','EXTRACT','FROM_DAYS','FROM_UNIXTIME',
+            'GET_FORMAT','LAST_DAY','LOCALTIME','LOCALTIMESTAMP','MAKEDATE',
+            'MAKETIME','MONTHNAME','NOW','PERIOD_ADD',
+            'PERIOD_DIFF','SEC_TO_TIME','STR_TO_DATE','SUBDATE','SUBTIME',
+            'SYSDATE','TIME_FORMAT','TIME_TO_SEC',
+            'TIMESTAMPADD','TIMESTAMPDIFF','TO_DAYS',
+            'UNIX_TIMESTAMP','UTC_DATE','UTC_TIME','UTC_TIMESTAMP','WEEKDAY',
+            'WEEKOFYEAR','YEARWEEK',
+            ),
+        18 => array(     //A ( must follow
+            // Date-time functions distinguished from other keywords by the same name
+            "DATE", "DAY", "HOUR", "MICROSECOND", "MINUTE", "MONTH", "QUARTER",
+            "SECOND", "TIME", "WEEK", "YEAR"
+            ),
+        19 => array(
+            // Comparison Functions
+            'COALESCE','GREATEST','ISNULL','LEAST',
+            ),
+        20 => array(     //A ( must follow
+            // Comparison functions distinguished from other keywords by the same name
+            "IN", "INTERVAL"
+            ),
+        21 => array(
+            // Encryption and Compression Functions
+            'AES_DECRYPT','AES_ENCRYPT','COMPRESS','DECODE','DES_DECRYPT',
+            'DES_ENCRYPT','ENCODE','ENCRYPT','MD5','OLD_PASSWORD','PASSWORD',
+            'SHA1','SHA','UNCOMPRESS','UNCOMPRESSED_LENGTH',
+            ),
+        22 => array(
+            // GROUP BY (aggregate) Functions
+            'AVG','BIT_AND','BIT_OR','BIT_XOR','COUNT','GROUP_CONCAT',
+            'MAX','MIN','STDDEV_POP','STDDEV_SAMP','STDDEV','STD','SUM',
+            'VAR_POP','VAR_SAMP','VARIANCE',
+            ),
+        23 => array(
+            // Information Functions
+            'BENCHMARK','COERCIBILITY','COLLATION','CONNECTION_ID',
+            'FOUND_ROWS','LAST_INSERT_ID','ROW_COUNT',
+            'SESSION_USER','SYSTEM_USER','USER','VERSION',
+            ),
+        24 => array(     //A ( must follow
+            // Information functions distinguished from other keywords by the same name
+            "CURRENT_USER", "DATABASE", "SCHEMA", "CHARSET"
+            ),
+        25 => array(
+            // Miscellaneous Functions
+            'ExtractValue','BIT_COUNT','GET_LOCK','INET_ATON','INET_NTOA',
+            'IS_FREE_LOCK','IS_USED_LOCK','MASTER_POS_WAIT','NAME_CONST',
+            'RELEASE_LOCK','SLEEP','UpdateXML','UUID',
+            ),
+        26 => array(     //A ( must follow
+            // Miscellaneous function distinguished from other keyword by the same name
+            "DEFAULT"
+            ),
+        27 => array(
+            // Geometry Functions
+            'Area','AsBinary','AsText','AsWKB','AsWKT','Boundary','Buffer',
+            'Centroid','Contains','ConvexHull','Crosses',
+            'Difference','Dimension','Disjoint','Distance',
+            'EndPoint','Envelope','Equals','ExteriorRing',
+            'GLength','GeomCollFromText','GeomCollFromWKB','GeomFromText',
+            'GeomFromWKB','GeometryCollectionFromText',
+            'GeometryCollectionFromWKB','GeometryFromText','GeometryFromWKB',
+            'GeometryN','GeometryType',
+            'InteriorRingN','Intersection','Intersects','IsClosed','IsEmpty',
+            'IsRing','IsSimple',
+            'LineFromText','LineFromWKB','LineStringFromText',
+            'LineStringFromWKB',
+            'MBRContains','MBRDisjoint','MBREqual','MBRIntersects',
+            'MBROverlaps','MBRTouches','MBRWithin','MLineFromText',
+            'MLineFromWKB','MPointFromText','MPointFromWKB','MPolyFromText',
+            'MPolyFromWKB','MultiLineStringFromText','MultiLineStringFromWKB',
+            'MultiPointFromText','MultiPointFromWKB','MultiPolygonFromText',
+            'MultiPolygonFromWKB',
+            'NumGeometries','NumInteriorRings','NumPoints',
+            'Overlaps',
+            'PointFromText','PointFromWKB','PointN','PointOnSurface',
+            'PolyFromText','PolyFromWKB','PolygonFromText','PolygonFromWKB',
+            'Related','SRID','StartPoint','SymDifference',
+            'Touches',
+            'Union',
+            'Within',
+            'X',
+            'Y',
+            ),
+        ),
+    'SYMBOLS' => array(
+        1 => array(
+            /* Operators */
+            '=', ':=',                                      // assignment operators
+            '||', '&&', '!',                                // locical operators
+            '=', '<=>', '>=', '>', '<=', '<', '<>', '!=',   // comparison operators
+            '|', '&', '^', '~', '<<', '>>',                 // bitwise operators
+            '-', '+', '*', '/', '%',                        // numerical operators
+            ),
+        2 => array(
+            /* Other syntactical symbols */
+            '(', ')',
+            ',', ';',
+            ),
+        ),
+    'CASE_SENSITIVE' => array(
+        GESHI_COMMENTS => false,
+        1 => false,
+        2 => false,
+        3 => false,
+        4 => false,
+        5 => false,
+        6 => false,
+        7 => false,
+        8 => false,
+        9 => false,
+        10 => false,
+        11 => false,
+        12 => false,
+        13 => false,
+        13 => false,
+        14 => false,
+        15 => false,
+        16 => false,
+        17 => false,
+        18 => false,
+        19 => false,
+        20 => false,
+        21 => false,
+        22 => false,
+        23 => false,
+        24 => false,
+        25 => false,
+        26 => false,
+        27 => false,
+        ),
+    'STYLES' => array(
+        'KEYWORDS' => array(
+            1 => 'color: #990099; font-weight: bold;',      // mix
+            2 => 'color: #990099; font-weight: bold;',      // mix
+            3 => 'color: #9900FF; font-weight: bold;',      // constants
+            4 => 'color: #999900; font-weight: bold;',      // column data types
+            5 => 'color: #999900; font-weight: bold;',      // column data types
+            6 => 'color: #FF9900; font-weight: bold;',      // attributes
+            7 => 'color: #FF9900; font-weight: bold;',      // attributes
+            8 => 'color: #9900FF; font-weight: bold;',      // date-time units
+            9 => 'color: #9900FF; font-weight: bold;',      // date-time units
+
+            10 => 'color: #CC0099; font-weight: bold;',      // operators
+            11 => 'color: #CC0099; font-weight: bold;',      // operators
+
+            12 => 'color: #009900;',     // control flow (functions)
+            13 => 'color: #000099;',     // string functions
+            14 => 'color: #000099;',     // string functions
+            15 => 'color: #000099;',     // numeric functions
+            16 => 'color: #000099;',     // numeric functions
+            17 => 'color: #000099;',     // date-time functions
+            18 => 'color: #000099;',     // date-time functions
+            19 => 'color: #000099;',     // comparison functions
+            20 => 'color: #000099;',     // comparison functions
+            21 => 'color: #000099;',     // encryption functions
+            22 => 'color: #000099;',     // aggregate functions
+            23 => 'color: #000099;',     // information functions
+            24 => 'color: #000099;',     // information functions
+            25 => 'color: #000099;',     // miscellaneous functions
+            26 => 'color: #000099;',     // miscellaneous functions
+            27 => 'color: #00CC00;',     // geometry functions
+            ),
+        'COMMENTS' => array(
+            'MULTI' => 'color: #808000; font-style: italic;',
+            1 => 'color: #808080; font-style: italic;',
+            2 => 'color: #808080; font-style: italic;'
+            ),
+        'ESCAPE_CHAR' => array(
+            0 => 'color: #004000; font-weight: bold;',
+            1 => 'color: #008080; font-weight: bold;'       // search wildcards
+            ),
+        'BRACKETS' => array(
+            0 => 'color: #FF00FF;'
+            ),
+        'STRINGS' => array(
+            0 => 'color: #008000;'
+            ),
+        'NUMBERS' => array(
+            0 => 'color: #008080;'
+            ),
+        'METHODS' => array(
+            ),
+        'SYMBOLS' => array(
+            1 => 'color: #CC0099;',         // operators
+            2 => 'color: #000033;',         // syntax
+            ),
+        'SCRIPT' => array(
+            ),
+        'REGEXPS' => array(
+            )
+        ),
+    'URLS' => array(
+        1 => 'http://search.mysql.com/search?site=refman-%35%31&amp;q={FNAME}',
+        2 => 'http://search.mysql.com/search?site=refman-%35%31&amp;q={FNAME}',
+        3 => 'http://search.mysql.com/search?site=refman-%35%31&amp;q={FNAME}',
+        4 => 'http://search.mysql.com/search?site=refman-%35%31&amp;q={FNAME}',
+        5 => 'http://search.mysql.com/search?site=refman-%35%31&amp;q={FNAME}',
+        6 => 'http://search.mysql.com/search?site=refman-%35%31&amp;q={FNAME}',
+        7 => 'http://search.mysql.com/search?site=refman-%35%31&amp;q={FNAME}',
+        8 => 'http://search.mysql.com/search?site=refman-%35%31&amp;q={FNAME}',
+        9 => 'http://search.mysql.com/search?site=refman-%35%31&amp;q={FNAME}',
+
+        10 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/non-typed-operators.html',
+        11 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/non-typed-operators.html',
+
+        12 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/control-flow-functions.html',
+        13 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/string-functions.html',
+        14 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/string-functions.html',
+        15 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/numeric-functions.html',
+        16 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/numeric-functions.html',
+        17 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/date-and-time-functions.html',
+        18 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/date-and-time-functions.html',
+        19 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/comparison-operators.html',
+        20 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/comparison-operators.html',
+        21 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/encryption-functions.html',
+        22 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/group-by-functions-and-modifiers.html',
+        23 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/information-functions.html',
+        24 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/information-functions.html',
+        25 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/func-op-summary-ref.html',
+        26 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/func-op-summary-ref.html',
+        27 => 'http://dev.mysql.com/doc/refman/%35%2E%31/en/analysing-spatial-information.html',
+        ),
+    'OOLANG' => false,
+    'OBJECT_SPLITTERS' => array(
+        ),
+    'REGEXPS' => array(
+        ),
+    'STRICT_MODE_APPLIES' => GESHI_NEVER,
+    'SCRIPT_DELIMITERS' => array(
+        ),
+    'HIGHLIGHT_STRICT_BLOCK' => array(
+        ),
+    'TAB_WIDTH' => 4,
+    'PARSER_CONTROL' => array(
+        'KEYWORDS' => array(
+            2 => array(
+                'DISALLOWED_AFTER' => '(?![\(\w])'
+                ),
+            5 => array(
+                'DISALLOWED_AFTER' => '(?![\(\w])'
+                ),
+            7 => array(
+                'DISALLOWED_AFTER' => '(?![\(\w])'
+                ),
+            9 => array(
+                'DISALLOWED_AFTER' => '(?![\(\w])'
+                ),
+            11 => array(
+                'DISALLOWED_AFTER' => '(?![\(\w])'
+                ),
+
+            14 => array(
+                'DISALLOWED_AFTER' => '(?=\()'
+                ),
+            16 => array(
+                'DISALLOWED_AFTER' => '(?=\()'
+                ),
+            18 => array(
+                'DISALLOWED_AFTER' => '(?=\()'
+                ),
+            20 => array(
+                'DISALLOWED_AFTER' => '(?=\()'
+                ),
+            24 => array(
+                'DISALLOWED_AFTER' => '(?=\()'
+                ),
+            26 => array(
+                'DISALLOWED_AFTER' => '(?=\()'
+                )
+            )
+        )
 );
 
-?>
+?>
\ No hay ningún carácter de nueva línea al final del fichero
diff -aruN --binary 22/libraries/geshi/geshi/php-brief.php 23/libraries/geshi/geshi/php-brief.php
--- 22/libraries/geshi/geshi/php-brief.php	2009-05-29 13:54:38.000000000 +0200
+++ 23/libraries/geshi/geshi/php-brief.php	2011-03-31 18:09:16.000000000 +0200
@@ -1,16 +1,21 @@
 <?php
+// no direct access
+defined('_JEXEC') or die;
+
 /*************************************************************************************
  * php-brief.php
  * -------------
  * Author: Nigel McNie (nigel@geshi.org)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.19
+ * Release Version: 1.0.8.10
  * Date Started: 2004/06/02
  *
- * PHP language file for GeSHi (brief version).
+ * PHP (brief version) language file for GeSHi.
  *
  * CHANGES
  * -------
+ * 2008/05/23 (1.0.7.22)
+ *  -  Added description of extra language features (SF#1970248)
  * 2004/11/27 (1.0.3)
  *  -  Added support for multiple object splitters
  *  -  Fixed &new problem
@@ -45,118 +50,176 @@
  *
  ************************************************************************************/
 
-defined('GESHI_CAPS_NO_CHANGE') or die();
-
 $language_data = array (
-	'LANG_NAME' => 'PHP',
-	'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
-	'COMMENT_MULTI' => array('/*' => '*/'),
-	'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
-	'QUOTEMARKS' => array("'", '"'),
-	'ESCAPE_CHAR' => '\\',
-	'KEYWORDS' => array(
-		1 => array(
-			'include', 'require', 'include_once', 'require_once',
-			'for', 'as', 'foreach', 'if', 'elseif', 'else', 'while', 'do', 'endwhile', 'endif', 'switch', 'case', 'endswitch',
-			'return', 'break'
-			),
-		2 => array(
-			'null', '__LINE__', '__FILE__',
-			'false', '&lt;?php', '?&gt;',
-			'true', 'var', 'default',
-			'function', 'class', 'new', '&amp;new', 'public', 'private', 'interface', 'extends',
-			),
-		3 => array(
-			'func_num_args', 'func_get_arg', 'func_get_args', 'strlen', 'strcmp', 'strncmp', 'strcasecmp', 'strncasecmp', 'each', 'error_reporting', 'define', 'defined',
-			'trigger_error', 'user_error', 'set_error_handler', 'restore_error_handler', 'get_declared_classes', 'get_loaded_extensions',
-			'extension_loaded', 'get_extension_funcs', 'debug_backtrace',
-			'constant', 'bin2hex', 'sleep', 'usleep', 'time', 'mktime', 'gmmktime', 'strftime', 'gmstrftime', 'strtotime', 'date', 'gmdate', 'getdate', 'localtime', 'checkdate', 'flush', 'wordwrap', 'htmlspecialchars', 'htmlentities', 'html_entity_decode', 'md5', 'md5_file', 'crc32', 'getimagesize', 'image_type_to_mime_type', 'phpinfo', 'phpversion', 'phpcredits', 'strnatcmp', 'strnatcasecmp', 'substr_count', 'strspn', 'strcspn', 'strtok', 'strtoupper', 'strtolower', 'strpos', 'strrpos', 'strrev', 'hebrev', 'hebrevc', 'nl2br', 'basename', 'dirname', 'pathinfo', 'stripslashes', 'stripcslashes', 'strstr', 'stristr', 'strrchr', 'str_shuffle', 'str_word_count', 'strcoll', 'substr', 'substr_replace', 'quotemeta', 'ucfirst', 'ucwords', 'strtr', 'addslashes', 'addcslashes', 'rtrim', 'str_replace', 'str_repeat', 'count_chars', 'chunk_split', 'trim', 'ltrim', 'strip_tags', 'similar_text', 'explode', 'implode', 'setlocale', 'localeconv',
-			'parse_str', 'str_pad', 'chop', 'strchr', 'sprintf', 'printf', 'vprintf', 'vsprintf', 'sscanf', 'fscanf', 'parse_url', 'urlencode', 'urldecode', 'rawurlencode', 'rawurldecode', 'readlink', 'linkinfo', 'link', 'unlink', 'exec', 'system', 'escapeshellcmd', 'escapeshellarg', 'passthru', 'shell_exec', 'proc_open', 'proc_close', 'rand', 'srand', 'getrandmax', 'mt_rand', 'mt_srand', 'mt_getrandmax', 'base64_decode', 'base64_encode', 'abs', 'ceil', 'floor', 'round', 'is_finite', 'is_nan', 'is_infinite', 'bindec', 'hexdec', 'octdec', 'decbin', 'decoct', 'dechex', 'base_convert', 'number_format', 'fmod', 'ip2long', 'long2ip', 'getenv', 'putenv', 'getopt', 'microtime', 'gettimeofday', 'getrusage', 'uniqid', 'quoted_printable_decode', 'set_time_limit', 'get_cfg_var', 'magic_quotes_runtime', 'set_magic_quotes_runtime', 'get_magic_quotes_gpc', 'get_magic_quotes_runtime',
-			'import_request_variables', 'error_log', 'serialize', 'unserialize', 'memory_get_usage', 'var_dump', 'var_export', 'debug_zval_dump', 'print_r','highlight_file', 'show_source', 'highlight_string', 'ini_get', 'ini_get_all', 'ini_set', 'ini_alter', 'ini_restore', 'get_include_path', 'set_include_path', 'restore_include_path', 'setcookie', 'header', 'headers_sent', 'connection_aborted', 'connection_status', 'ignore_user_abort', 'parse_ini_file', 'is_uploaded_file', 'move_uploaded_file', 'intval', 'floatval', 'doubleval', 'strval', 'gettype', 'settype', 'is_null', 'is_resource', 'is_bool', 'is_long', 'is_float', 'is_int', 'is_integer', 'is_double', 'is_real', 'is_numeric', 'is_string', 'is_array', 'is_object', 'is_scalar',
-			'ereg', 'ereg_replace', 'eregi', 'eregi_replace', 'split', 'spliti', 'join', 'sql_regcase', 'dl', 'pclose', 'popen', 'readfile', 'rewind', 'rmdir', 'umask', 'fclose', 'feof', 'fgetc', 'fgets', 'fgetss', 'fread', 'fopen', 'fpassthru', 'ftruncate', 'fstat', 'fseek', 'ftell', 'fflush', 'fwrite', 'fputs', 'mkdir', 'rename', 'copy', 'tempnam', 'tmpfile', 'file', 'file_get_contents', 'stream_select', 'stream_context_create', 'stream_context_set_params', 'stream_context_set_option', 'stream_context_get_options', 'stream_filter_prepend', 'stream_filter_append', 'fgetcsv', 'flock', 'get_meta_tags', 'stream_set_write_buffer', 'set_file_buffer', 'set_socket_blocking', 'stream_set_blocking', 'socket_set_blocking', 'stream_get_meta_data', 'stream_register_wrapper', 'stream_wrapper_register', 'stream_set_timeout', 'socket_set_timeout', 'socket_get_status', 'realpath', 'fnmatch', 'fsockopen', 'pfsockopen', 'pack', 'unpack', 'get_browser', 'crypt', 'opendir', 'closedir', 'chdir', 'getcwd', 'rewinddir', 'readdir', 'dir', 'glob', 'fileatime', 'filectime', 'filegroup', 'fileinode', 'filemtime', 'fileowner', 'fileperms', 'filesize', 'filetype', 'file_exists', 'is_writable', 'is_writeable', 'is_readable', 'is_executable', 'is_file', 'is_dir', 'is_link', 'stat', 'lstat', 'chown',
-			'touch', 'clearstatcache', 'mail', 'ob_start', 'ob_flush', 'ob_clean', 'ob_end_flush', 'ob_end_clean', 'ob_get_flush', 'ob_get_clean', 'ob_get_length', 'ob_get_level', 'ob_get_status', 'ob_get_contents', 'ob_implicit_flush', 'ob_list_handlers', 'ksort', 'krsort', 'natsort', 'natcasesort', 'asort', 'arsort', 'sort', 'rsort', 'usort', 'uasort', 'uksort', 'shuffle', 'array_walk', 'count', 'end', 'prev', 'next', 'reset', 'current', 'key', 'min', 'max', 'in_array', 'array_search', 'extract', 'compact', 'array_fill', 'range', 'array_multisort', 'array_push', 'array_pop', 'array_shift', 'array_unshift', 'array_splice', 'array_slice', 'array_merge', 'array_merge_recursive', 'array_keys', 'array_values', 'array_count_values', 'array_reverse', 'array_reduce', 'array_pad', 'array_flip', 'array_change_key_case', 'array_rand', 'array_unique', 'array_intersect', 'array_intersect_assoc', 'array_diff', 'array_diff_assoc', 'array_sum', 'array_filter', 'array_map', 'array_chunk', 'array_key_exists', 'pos', 'sizeof', 'key_exists', 'assert', 'assert_options', 'version_compare', 'ftok', 'str_rot13', 'aggregate',
-			'session_name', 'session_module_name', 'session_save_path', 'session_id', 'session_regenerate_id', 'session_decode', 'session_register', 'session_unregister', 'session_is_registered', 'session_encode',
-			'session_start', 'session_destroy', 'session_unset', 'session_set_save_handler', 'session_cache_limiter', 'session_cache_expire', 'session_set_cookie_params', 'session_get_cookie_params', 'session_write_close', 'preg_match', 'preg_match_all', 'preg_replace', 'preg_replace_callback', 'preg_split', 'preg_quote', 'preg_grep', 'overload', 'ctype_alnum', 'ctype_alpha', 'ctype_cntrl', 'ctype_digit', 'ctype_lower', 'ctype_graph', 'ctype_print', 'ctype_punct', 'ctype_space', 'ctype_upper', 'ctype_xdigit', 'virtual', 'apache_request_headers', 'apache_note', 'apache_lookup_uri', 'apache_child_terminate', 'apache_setenv', 'apache_response_headers', 'apache_get_version', 'getallheaders', 'mysql_connect', 'mysql_pconnect', 'mysql_close', 'mysql_select_db', 'mysql_create_db', 'mysql_drop_db', 'mysql_query', 'mysql_unbuffered_query', 'mysql_db_query', 'mysql_list_dbs', 'mysql_list_tables', 'mysql_list_fields', 'mysql_list_processes', 'mysql_error', 'mysql_errno', 'mysql_affected_rows', 'mysql_insert_id', 'mysql_result', 'mysql_num_rows', 'mysql_num_fields', 'mysql_fetch_row', 'mysql_fetch_array', 'mysql_fetch_assoc', 'mysql_fetch_object', 'mysql_data_seek', 'mysql_fetch_lengths', 'mysql_fetch_field', 'mysql_field_seek', 'mysql_free_result', 'mysql_field_name', 'mysql_field_table', 'mysql_field_len', 'mysql_field_type', 'mysql_field_flags', 'mysql_escape_string', 'mysql_real_escape_string', 'mysql_stat',
-			'mysql_thread_id', 'mysql_client_encoding', 'mysql_get_client_info', 'mysql_get_host_info', 'mysql_get_proto_info', 'mysql_get_server_info', 'mysql_info', 'mysql', 'mysql_fieldname', 'mysql_fieldtable', 'mysql_fieldlen', 'mysql_fieldtype', 'mysql_fieldflags', 'mysql_selectdb', 'mysql_createdb', 'mysql_dropdb', 'mysql_freeresult', 'mysql_numfields', 'mysql_numrows', 'mysql_listdbs', 'mysql_listtables', 'mysql_listfields', 'mysql_db_name', 'mysql_dbname', 'mysql_tablename', 'mysql_table_name', 'pg_connect', 'pg_pconnect', 'pg_close', 'pg_connection_status', 'pg_connection_busy', 'pg_connection_reset', 'pg_host', 'pg_dbname', 'pg_port', 'pg_tty', 'pg_options', 'pg_ping', 'pg_query', 'pg_send_query', 'pg_cancel_query', 'pg_fetch_result', 'pg_fetch_row', 'pg_fetch_assoc', 'pg_fetch_array', 'pg_fetch_object', 'pg_fetch_all', 'pg_affected_rows', 'pg_get_result', 'pg_result_seek', 'pg_result_status', 'pg_free_result', 'pg_last_oid', 'pg_num_rows', 'pg_num_fields', 'pg_field_name', 'pg_field_num', 'pg_field_size', 'pg_field_type', 'pg_field_prtlen', 'pg_field_is_null', 'pg_get_notify', 'pg_get_pid', 'pg_result_error', 'pg_last_error', 'pg_last_notice', 'pg_put_line', 'pg_end_copy', 'pg_copy_to', 'pg_copy_from',
-			'pg_trace', 'pg_untrace', 'pg_lo_create', 'pg_lo_unlink', 'pg_lo_open', 'pg_lo_close', 'pg_lo_read', 'pg_lo_write', 'pg_lo_read_all', 'pg_lo_import', 'pg_lo_export', 'pg_lo_seek', 'pg_lo_tell', 'pg_escape_string', 'pg_escape_bytea', 'pg_unescape_bytea', 'pg_client_encoding', 'pg_set_client_encoding', 'pg_meta_data', 'pg_convert', 'pg_insert', 'pg_update', 'pg_delete', 'pg_select', 'pg_exec', 'pg_getlastoid', 'pg_cmdtuples', 'pg_errormessage', 'pg_numrows', 'pg_numfields', 'pg_fieldname', 'pg_fieldsize', 'pg_fieldtype', 'pg_fieldnum', 'pg_fieldprtlen', 'pg_fieldisnull', 'pg_freeresult', 'pg_result', 'pg_loreadall', 'pg_locreate', 'pg_lounlink', 'pg_loopen', 'pg_loclose', 'pg_loread', 'pg_lowrite', 'pg_loimport', 'pg_loexport',
-			'echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die'
-			)
-		),
-	'SYMBOLS' => array(
-		),
-	'CASE_SENSITIVE' => array(
-		GESHI_COMMENTS => false,
-		1 => false,
-		2 => false,
-		3 => false
-		),
-	'STYLES' => array(
-		'KEYWORDS' => array(
-			1 => 'color: #b1b100;',
-			2 => 'color: #000000; font-weight: bold;',
-			3 => 'color: #000066;'
-			),
-		'COMMENTS' => array(
-			1 => 'color: #808080; font-style: italic;',
-			2 => 'color: #808080; font-style: italic;',
-			'MULTI' => 'color: #808080; font-style: italic;'
-			),
-		'ESCAPE_CHAR' => array(
-			0 => 'color: #000099; font-weight: bold;'
-			),
-		'BRACKETS' => array(
-			0 => 'color: #66cc66;'
-			),
-		'STRINGS' => array(
-			0 => 'color: #ff0000;'
-			),
-		'NUMBERS' => array(
-			0 => 'color: #cc66cc;'
-			),
-		'METHODS' => array(
-			1 => 'color: #006600;',
-			2 => 'color: #006600;'
-			),
-		'SYMBOLS' => array(
-			0 => 'color: #66cc66;'
-			),
-		'REGEXPS' => array(
-			0 => 'color: #0000ff;'
-			),
-		'SCRIPT' => array(
-			0 => '',
-			1 => '',
-			2 => '',
-			3 => ''
-			)
-		),
-	'URLS' => array(
-		1 => '',
-		2 => '',
-		3 => 'http://www.php.net/{FNAME}',
-		4 => ''
-		),
-	'OOLANG' => true,
-	'OBJECT_SPLITTERS' => array(
-		1 => '-&gt;',
-		2 => '::'
-		),
-	'REGEXPS' => array(
-		0 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*"
-		),
-	'STRICT_MODE_APPLIES' => GESHI_MAYBE,
-	'SCRIPT_DELIMITERS' => array(
-		'<?php' => '?>',
-		'<?' => '?>',
-		'<%' => '%>',
-		'<script language="php">' => '</script>'
-		),
-	'HIGHLIGHT_STRICT_BLOCK' => array(
-		0 => true,
-		1 => true,
-		2 => true,
-		3 => true
-		)
+    'LANG_NAME' => 'PHP (brief)',
+    'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
+    'COMMENT_MULTI' => array('/*' => '*/'),
+    //Heredoc and Nowdoc syntax
+    'COMMENT_REGEXP' => array(3 => '/<<<\s*?(\'?)([a-zA-Z0-9]+)\1[^\n]*?\\n.*\\n\\2(?![a-zA-Z0-9])/siU'),
+    'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
+    'QUOTEMARKS' => array("'", '"'),
+    'ESCAPE_CHAR' => '\\',
+    'HARDQUOTE' => array("'", "'"),
+    'HARDESCAPE' => array("\'"),
+    'NUMBERS' =>
+        GESHI_NUMBER_INT_BASIC |  GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX |
+        GESHI_NUMBER_FLT_SCI_ZERO,
+    'KEYWORDS' => array(
+        1 => array(
+            'include', 'require', 'include_once', 'require_once',
+            'for', 'as', 'foreach', 'if', 'elseif', 'else', 'while', 'do', 'endwhile', 'endif', 'switch', 'case', 'endswitch',
+            'return', 'break'
+            ),
+        2 => array(
+            'null', '__LINE__', '__FILE__',
+            'false', '&lt;?php',
+            'true', 'var', 'default',
+            'function', 'class', 'new', '&amp;new', 'public', 'private', 'interface', 'extends',
+            'const', 'self'
+            ),
+        3 => array(
+            'func_num_args', 'func_get_arg', 'func_get_args', 'strlen', 'strcmp', 'strncmp', 'strcasecmp', 'strncasecmp', 'each', 'error_reporting', 'define', 'defined',
+            'trigger_error', 'user_error', 'set_error_handler', 'restore_error_handler', 'get_declared_classes', 'get_loaded_extensions',
+            'extension_loaded', 'get_extension_funcs', 'debug_backtrace',
+            'constant', 'bin2hex', 'sleep', 'usleep', 'time', 'mktime', 'gmmktime', 'strftime', 'gmstrftime', 'strtotime', 'date', 'gmdate', 'getdate', 'localtime', 'checkdate', 'flush', 'wordwrap', 'htmlspecialchars', 'htmlentities', 'html_entity_decode', 'md5', 'md5_file', 'crc32', 'getimagesize', 'image_type_to_mime_type', 'phpinfo', 'phpversion', 'phpcredits', 'strnatcmp', 'strnatcasecmp', 'substr_count', 'strspn', 'strcspn', 'strtok', 'strtoupper', 'strtolower', 'strpos', 'strrpos', 'strrev', 'hebrev', 'hebrevc', 'nl2br', 'basename', 'dirname', 'pathinfo', 'stripslashes', 'stripcslashes', 'strstr', 'stristr', 'strrchr', 'str_shuffle', 'str_word_count', 'strcoll', 'substr', 'substr_replace', 'quotemeta', 'ucfirst', 'ucwords', 'strtr', 'addslashes', 'addcslashes', 'rtrim', 'str_replace', 'str_repeat', 'count_chars', 'chunk_split', 'trim', 'ltrim', 'strip_tags', 'similar_text', 'explode', 'implode', 'setlocale', 'localeconv',
+            'parse_str', 'str_pad', 'chop', 'strchr', 'sprintf', 'printf', 'vprintf', 'vsprintf', 'sscanf', 'fscanf', 'parse_url', 'urlencode', 'urldecode', 'rawurlencode', 'rawurldecode', 'readlink', 'linkinfo', 'link', 'unlink', 'exec', 'system', 'escapeshellcmd', 'escapeshellarg', 'passthru', 'shell_exec', 'proc_open', 'proc_close', 'rand', 'srand', 'getrandmax', 'mt_rand', 'mt_srand', 'mt_getrandmax', 'base64_decode', 'base64_encode', 'abs', 'ceil', 'floor', 'round', 'is_finite', 'is_nan', 'is_infinite', 'bindec', 'hexdec', 'octdec', 'decbin', 'decoct', 'dechex', 'base_convert', 'number_format', 'fmod', 'ip2long', 'long2ip', 'getenv', 'putenv', 'getopt', 'microtime', 'gettimeofday', 'getrusage', 'uniqid', 'quoted_printable_decode', 'set_time_limit', 'get_cfg_var', 'magic_quotes_runtime', 'set_magic_quotes_runtime', 'get_magic_quotes_gpc', 'get_magic_quotes_runtime',
+            'import_request_variables', 'error_log', 'serialize', 'unserialize', 'memory_get_usage', 'var_dump', 'var_export', 'debug_zval_dump', 'print_r','highlight_file', 'show_source', 'highlight_string', 'ini_get', 'ini_get_all', 'ini_set', 'ini_alter', 'ini_restore', 'get_include_path', 'set_include_path', 'restore_include_path', 'setcookie', 'header', 'headers_sent', 'connection_aborted', 'connection_status', 'ignore_user_abort', 'parse_ini_file', 'is_uploaded_file', 'move_uploaded_file', 'intval', 'floatval', 'doubleval', 'strval', 'gettype', 'settype', 'is_null', 'is_resource', 'is_bool', 'is_long', 'is_float', 'is_int', 'is_integer', 'is_double', 'is_real', 'is_numeric', 'is_string', 'is_array', 'is_object', 'is_scalar',
+            'ereg', 'ereg_replace', 'eregi', 'eregi_replace', 'split', 'spliti', 'join', 'sql_regcase', 'dl', 'pclose', 'popen', 'readfile', 'rewind', 'rmdir', 'umask', 'fclose', 'feof', 'fgetc', 'fgets', 'fgetss', 'fread', 'fopen', 'fpassthru', 'ftruncate', 'fstat', 'fseek', 'ftell', 'fflush', 'fwrite', 'fputs', 'mkdir', 'rename', 'copy', 'tempnam', 'tmpfile', 'file', 'file_get_contents', 'stream_select', 'stream_context_create', 'stream_context_set_params', 'stream_context_set_option', 'stream_context_get_options', 'stream_filter_prepend', 'stream_filter_append', 'fgetcsv', 'flock', 'get_meta_tags', 'stream_set_write_buffer', 'set_file_buffer', 'set_socket_blocking', 'stream_set_blocking', 'socket_set_blocking', 'stream_get_meta_data', 'stream_register_wrapper', 'stream_wrapper_register', 'stream_set_timeout', 'socket_set_timeout', 'socket_get_status', 'realpath', 'fnmatch', 'fsockopen', 'pfsockopen', 'pack', 'unpack', 'get_browser', 'crypt', 'opendir', 'closedir', 'chdir', 'getcwd', 'rewinddir', 'readdir', 'dir', 'glob', 'fileatime', 'filectime', 'filegroup', 'fileinode', 'filemtime', 'fileowner', 'fileperms', 'filesize', 'filetype', 'file_exists', 'is_writable', 'is_writeable', 'is_readable', 'is_executable', 'is_file', 'is_dir', 'is_link', 'stat', 'lstat', 'chown',
+            'touch', 'clearstatcache', 'mail', 'ob_start', 'ob_flush', 'ob_clean', 'ob_end_flush', 'ob_end_clean', 'ob_get_flush', 'ob_get_clean', 'ob_get_length', 'ob_get_level', 'ob_get_status', 'ob_get_contents', 'ob_implicit_flush', 'ob_list_handlers', 'ksort', 'krsort', 'natsort', 'natcasesort', 'asort', 'arsort', 'sort', 'rsort', 'usort', 'uasort', 'uksort', 'shuffle', 'array_walk', 'count', 'end', 'prev', 'next', 'reset', 'current', 'key', 'min', 'max', 'in_array', 'array_search', 'extract', 'compact', 'array_fill', 'range', 'array_multisort', 'array_push', 'array_pop', 'array_shift', 'array_unshift', 'array_splice', 'array_slice', 'array_merge', 'array_merge_recursive', 'array_keys', 'array_values', 'array_count_values', 'array_reverse', 'array_reduce', 'array_pad', 'array_flip', 'array_change_key_case', 'array_rand', 'array_unique', 'array_intersect', 'array_intersect_assoc', 'array_diff', 'array_diff_assoc', 'array_sum', 'array_filter', 'array_map', 'array_chunk', 'array_key_exists', 'pos', 'sizeof', 'key_exists', 'assert', 'assert_options', 'version_compare', 'ftok', 'str_rot13', 'aggregate',
+            'session_name', 'session_module_name', 'session_save_path', 'session_id', 'session_regenerate_id', 'session_decode', 'session_register', 'session_unregister', 'session_is_registered', 'session_encode',
+            'session_start', 'session_destroy', 'session_unset', 'session_set_save_handler', 'session_cache_limiter', 'session_cache_expire', 'session_set_cookie_params', 'session_get_cookie_params', 'session_write_close', 'preg_match', 'preg_match_all', 'preg_replace', 'preg_replace_callback', 'preg_split', 'preg_quote', 'preg_grep', 'overload', 'ctype_alnum', 'ctype_alpha', 'ctype_cntrl', 'ctype_digit', 'ctype_lower', 'ctype_graph', 'ctype_print', 'ctype_punct', 'ctype_space', 'ctype_upper', 'ctype_xdigit', 'virtual', 'apache_request_headers', 'apache_note', 'apache_lookup_uri', 'apache_child_terminate', 'apache_setenv', 'apache_response_headers', 'apache_get_version', 'getallheaders', 'mysql_connect', 'mysql_pconnect', 'mysql_close', 'mysql_select_db', 'mysql_create_db', 'mysql_drop_db', 'mysql_query', 'mysql_unbuffered_query', 'mysql_db_query', 'mysql_list_dbs', 'mysql_list_tables', 'mysql_list_fields', 'mysql_list_processes', 'mysql_error', 'mysql_errno', 'mysql_affected_rows', 'mysql_insert_id', 'mysql_result', 'mysql_num_rows', 'mysql_num_fields', 'mysql_fetch_row', 'mysql_fetch_array', 'mysql_fetch_assoc', 'mysql_fetch_object', 'mysql_data_seek', 'mysql_fetch_lengths', 'mysql_fetch_field', 'mysql_field_seek', 'mysql_free_result', 'mysql_field_name', 'mysql_field_table', 'mysql_field_len', 'mysql_field_type', 'mysql_field_flags', 'mysql_escape_string', 'mysql_real_escape_string', 'mysql_stat',
+            'mysql_thread_id', 'mysql_client_encoding', 'mysql_get_client_info', 'mysql_get_host_info', 'mysql_get_proto_info', 'mysql_get_server_info', 'mysql_info', 'mysql', 'mysql_fieldname', 'mysql_fieldtable', 'mysql_fieldlen', 'mysql_fieldtype', 'mysql_fieldflags', 'mysql_selectdb', 'mysql_createdb', 'mysql_dropdb', 'mysql_freeresult', 'mysql_numfields', 'mysql_numrows', 'mysql_listdbs', 'mysql_listtables', 'mysql_listfields', 'mysql_db_name', 'mysql_dbname', 'mysql_tablename', 'mysql_table_name', 'pg_connect', 'pg_pconnect', 'pg_close', 'pg_connection_status', 'pg_connection_busy', 'pg_connection_reset', 'pg_host', 'pg_dbname', 'pg_port', 'pg_tty', 'pg_options', 'pg_ping', 'pg_query', 'pg_send_query', 'pg_cancel_query', 'pg_fetch_result', 'pg_fetch_row', 'pg_fetch_assoc', 'pg_fetch_array', 'pg_fetch_object', 'pg_fetch_all', 'pg_affected_rows', 'pg_get_result', 'pg_result_seek', 'pg_result_status', 'pg_free_result', 'pg_last_oid', 'pg_num_rows', 'pg_num_fields', 'pg_field_name', 'pg_field_num', 'pg_field_size', 'pg_field_type', 'pg_field_prtlen', 'pg_field_is_null', 'pg_get_notify', 'pg_get_pid', 'pg_result_error', 'pg_last_error', 'pg_last_notice', 'pg_put_line', 'pg_end_copy', 'pg_copy_to', 'pg_copy_from',
+            'pg_trace', 'pg_untrace', 'pg_lo_create', 'pg_lo_unlink', 'pg_lo_open', 'pg_lo_close', 'pg_lo_read', 'pg_lo_write', 'pg_lo_read_all', 'pg_lo_import', 'pg_lo_export', 'pg_lo_seek', 'pg_lo_tell', 'pg_escape_string', 'pg_escape_bytea', 'pg_unescape_bytea', 'pg_client_encoding', 'pg_set_client_encoding', 'pg_meta_data', 'pg_convert', 'pg_insert', 'pg_update', 'pg_delete', 'pg_select', 'pg_exec', 'pg_getlastoid', 'pg_cmdtuples', 'pg_errormessage', 'pg_numrows', 'pg_numfields', 'pg_fieldname', 'pg_fieldsize', 'pg_fieldtype', 'pg_fieldnum', 'pg_fieldprtlen', 'pg_fieldisnull', 'pg_freeresult', 'pg_result', 'pg_loreadall', 'pg_locreate', 'pg_lounlink', 'pg_loopen', 'pg_loclose', 'pg_loread', 'pg_lowrite', 'pg_loimport', 'pg_loexport',
+            'echo', 'print', 'global', 'static', 'exit', 'array', 'empty', 'eval', 'isset', 'unset', 'die'
+            )
+        ),
+    'SYMBOLS' => array(
+        1 => array(
+            '<%', '<%=', '%>', '<?', '<?=', '?>'
+            ),
+        0 => array(
+            '(', ')', '[', ']', '{', '}',
+            '!', '@', '%', '&', '|', '/',
+            '<', '>',
+            '=', '-', '+', '*',
+            '.', ':', ',', ';'
+            )
+        ),
+    'CASE_SENSITIVE' => array(
+        GESHI_COMMENTS => false,
+        1 => false,
+        2 => false,
+        3 => false
+        ),
+    'STYLES' => array(
+        'KEYWORDS' => array(
+            1 => 'color: #b1b100;',
+            2 => 'color: #000000; font-weight: bold;',
+            3 => 'color: #990000;'
+            ),
+        'COMMENTS' => array(
+            1 => 'color: #666666; font-style: italic;',
+            2 => 'color: #666666; font-style: italic;',
+            3 => 'color: #0000cc; font-style: italic;',
+            'MULTI' => 'color: #666666; font-style: italic;'
+            ),
+        'ESCAPE_CHAR' => array(
+            0 => 'color: #000099; font-weight: bold;',
+            'HARD' => 'color: #000099; font-weight: bold;'
+            ),
+        'BRACKETS' => array(
+            0 => 'color: #009900;'
+            ),
+        'STRINGS' => array(
+            0 => 'color: #0000ff;',
+            'HARD' => 'color: #0000ff;'
+            ),
+        'NUMBERS' => array(
+            0 => 'color: #cc66cc;',
+            GESHI_NUMBER_OCT_PREFIX => 'color: #208080;',
+            GESHI_NUMBER_HEX_PREFIX => 'color: #208080;',
+            GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;',
+            ),
+        'METHODS' => array(
+            1 => 'color: #004000;',
+            2 => 'color: #004000;'
+            ),
+        'SYMBOLS' => array(
+            0 => 'color: #339933;',
+            1 => 'color: #000000; font-weight: bold;'
+            ),
+        'REGEXPS' => array(
+            0 => 'color: #0000ff;'
+            ),
+        'SCRIPT' => array(
+            0 => '',
+            1 => '',
+            2 => '',
+            3 => '',
+            4 => '',
+            5 => ''
+            )
+        ),
+    'URLS' => array(
+        1 => '',
+        2 => '',
+        3 => 'http://www.php.net/{FNAMEL}'
+        ),
+    'OOLANG' => true,
+    'OBJECT_SPLITTERS' => array(
+        1 => '-&gt;',
+        2 => '::'
+        ),
+    'REGEXPS' => array(
+        //Variables
+        0 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*"
+        ),
+    'STRICT_MODE_APPLIES' => GESHI_MAYBE,
+    'SCRIPT_DELIMITERS' => array(
+        0 => array(
+            '<?php' => '?>'
+            ),
+        1 => array(
+            '<?' => '?>'
+            ),
+        2 => array(
+            '<%' => '%>'
+            ),
+        3 => array(
+            '<script language="php">' => '</script>'
+            ),
+        4 => "/(?P<start><\\?(?>php\b)?)(?:".
+            "(?>[^\"'?\\/<]+)|".
+            "\\?(?!>)|".
+            "(?>'(?>[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|".
+            "(?>\"(?>[^\"\\\\]|\\\\\"|\\\\\\\\|\\\\)*\")|".
+            "(?>\\/\\*(?>[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|".
+            "\\/\\/(?>.*?$)|".
+            "\\/(?=[^*\\/])|".
+            "<(?!<<)|".
+            "<<<(?P<phpdoc>\w+)\s.*?\s\k<phpdoc>".
+            ")*(?P<end>\\?>|\Z)/sm",
+        5 => "/(?P<start><%)(?:".
+            "(?>[^\"'%\\/<]+)|".
+            "%(?!>)|".
+            "(?>'(?>[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|".
+            "(?>\"(?>[^\\\"\\\\]|\\\\\"|\\\\\\\\|\\\\)*\")|".
+            "(?>\\/\\*(?>[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|".
+            "\\/\\/(?>.*?$)|".
+            "\\/(?=[^*\\/])|".
+            "<(?!<<)|".
+            "<<<(?P<phpdoc>\w+)\s.*?\s\k<phpdoc>".
+            ")*(?P<end>%>)/sm"
+        ),
+    'HIGHLIGHT_STRICT_BLOCK' => array(
+        0 => true,
+        1 => true,
+        2 => true,
+        3 => true,
+        4 => true,
+        5 => true
+        ),
+    'TAB_WIDTH' => 4
 );
 
-?>
+?>
\ No hay ningún carácter de nueva línea al final del fichero
diff -aruN --binary 22/libraries/geshi/geshi/php.php 23/libraries/geshi/geshi/php.php
--- 22/libraries/geshi/geshi/php.php	2009-05-29 13:54:38.000000000 +0200
+++ 23/libraries/geshi/geshi/php.php	2011-03-31 18:09:16.000000000 +0200
@@ -1,16 +1,21 @@
 <?php
+// no direct access
+defined('_JEXEC') or die;
+
 /*************************************************************************************
  * php.php
  * --------
  * Author: Nigel McNie (nigel@geshi.org)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.19
+ * Release Version: 1.0.8.10
  * Date Started: 2004/06/20
  *
  * PHP language file for GeSHi.
  *
  * CHANGES
  * -------
+ * 2008/05/23 (1.0.7.22)
+ *  -  Added description of extra language features (SF#1970248)
  * 2004/11/25 (1.0.3)
  *  -  Added support for multiple object splitters
  *  -  Fixed &new problem
@@ -48,271 +53,1008 @@
  *
  ************************************************************************************/
 
-defined('GESHI_CAPS_NO_CHANGE') or die();
-
-$language_data = array (
+$language_data = array(
     'LANG_NAME' => 'PHP',
     'COMMENT_SINGLE' => array(1 => '//', 2 => '#'),
     'COMMENT_MULTI' => array('/*' => '*/'),
+    'COMMENT_REGEXP' => array(
+        //Heredoc and Nowdoc syntax
+        3 => '/<<<\s*?(\'?)([a-zA-Z0-9]+?)\1[^\n]*?\\n.*\\n\\2(?![a-zA-Z0-9])/siU',
+        // phpdoc comments
+        4 => '#/\*\*(?![\*\/]).*\*/#sU',
+        // Advanced # handling
+        2 => "/#.*?(?:(?=\?\>)|^)/smi"
+        ),
     'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
-    'QUOTEMARKS' => array("'", '"'),
-    'ESCAPE_CHAR' => '\\',
+    'QUOTEMARKS' => array('"'),
+    'ESCAPE_CHAR' => '',
+    'ESCAPE_REGEXP' => array(
+        //Simple Single Char Escapes
+        1 => "#\\\\[nfrtv\$\"\n\\\\]#i",
+        //Hexadecimal Char Specs
+        2 => "#\\\\x[\da-fA-F]{1,2}#i",
+        //Octal Char Specs
+        3 => "#\\\\[0-7]{1,3}#",
+        //String Parsing of Variable Names
+        4 => "#\\$[a-z0-9_]+(?:\\[[a-z0-9_]+\\]|->[a-z0-9_]+)?|(?:\\{\\$|\\$\\{)[a-z0-9_]+(?:\\[('?)[a-z0-9_]*\\1\\]|->[a-z0-9_]+)*\\}#i",
+        //Experimental extension supporting cascaded {${$var}} syntax
+        5 => "#\$[a-z0-9_]+(?:\[[a-z0-9_]+\]|->[a-z0-9_]+)?|(?:\{\$|\$\{)[a-z0-9_]+(?:\[('?)[a-z0-9_]*\\1\]|->[a-z0-9_]+)*\}|\{\$(?R)\}#i",
+        //Format String support in ""-Strings
+        6 => "#%(?:%|(?:\d+\\\\\\\$)?\\+?(?:\x20|0|'.)?-?(?:\d+|\\*)?(?:\.\d+)?[bcdefFosuxX])#"
+        ),
+    'HARDQUOTE' => array("'", "'"),
+    'HARDESCAPE' => array("'", "\\"),
+    'HARDCHAR' => "\\",
+    'NUMBERS' =>
+        GESHI_NUMBER_INT_BASIC | GESHI_NUMBER_OCT_PREFIX | GESHI_NUMBER_HEX_PREFIX |
+        GESHI_NUMBER_FLT_SCI_ZERO,
     'KEYWORDS' => array(
         1 => array(
-            'include', 'require', 'include_once', 'require_once',
-            'for', 'foreach', 'as', 'if', 'elseif', 'else', 'while', 'do', 'endwhile',
-            'endif', 'switch', 'case', 'endswitch', 'endfor', 'endforeach',
-            'return', 'break', 'continue'
+            'as','break','case','continue','default','do','else','elseif',
+            'endfor','endforeach','endif','endswitch','endwhile','for',
+            'foreach','if','include','include_once','require','require_once',
+            'return','switch','throw','while',
+
+            'echo','print'
             ),
         2 => array(
-            'null', '__LINE__', '__FILE__',
-            'false', '&lt;?php', '?&gt;', '&lt;?',
-            '&lt;script language', '&lt;/script&gt;',
-            'true', 'var', 'default',
-            'function', 'class', 'new', '&amp;new', 'public', 'private', 'interface', 'extends',
-            '__FUNCTION__', '__CLASS__', '__METHOD__', 'PHP_VERSION',
-            'PHP_OS', 'DEFAULT_INCLUDE_PATH', 'PEAR_INSTALL_DIR', 'PEAR_EXTENSION_DIR',
-            'PHP_EXTENSION_DIR', 'PHP_BINDIR', 'PHP_LIBDIR', 'PHP_DATADIR', 'PHP_SYSCONFDIR',
-            'PHP_LOCALSTATEDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_OUTPUT_HANDLER_START', 'PHP_OUTPUT_HANDLER_CONT',
-            'PHP_OUTPUT_HANDLER_END', 'E_ERROR', 'E_WARNING', 'E_PARSE', 'E_NOTICE',
-            'E_CORE_ERROR', 'E_CORE_WARNING', 'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_USER_ERROR',
-            'E_USER_WARNING', 'E_USER_NOTICE', 'E_ALL'
+            '&amp;new','&lt;/script&gt;','&lt;?php','&lt;script language',
+            'class','const','declare','extends','function','global','interface',
+            'namespace','new','private','protected','public','self','use','var'
             ),
         3 => array(
-            'zlib_get_coding_type','zend_version','zend_logo_guid','yp_order','yp_next',
-            'yp_match','yp_master','yp_get_default_domain','yp_first','yp_errno','yp_err_string',
-            'yp_cat','yp_all','xml_set_unparsed_entity_decl_handler','xml_set_start_namespace_decl_handler','xml_set_processing_instruction_handler','xml_set_object',
-            'xml_set_notation_decl_handler','xml_set_external_entity_ref_handler','xml_set_end_namespace_decl_handler','xml_set_element_handler','xml_set_default_handler','xml_set_character_data_handler',
-            'xml_parser_set_option','xml_parser_get_option','xml_parser_free','xml_parser_create_ns','xml_parser_create','xml_parse_into_struct',
-            'xml_parse','xml_get_error_code','xml_get_current_line_number','xml_get_current_column_number','xml_get_current_byte_index','xml_error_string',
-            'wordwrap','wddx_serialize_vars','wddx_serialize_value','wddx_packet_start','wddx_packet_end','wddx_deserialize',
-            'wddx_add_vars','vsprintf','vprintf','virtual','version_compare','var_export',
-            'var_dump','utf8_encode','utf8_decode','usort','usleep','user_error',
-            'urlencode','urldecode','unserialize','unregister_tick_function','unpack','unlink',
-            'unixtojd','uniqid','umask','uksort','ucwords','ucfirst',
-            'uasort','trim','trigger_error','touch','token_name','token_get_all',
-            'tmpfile','time','textdomain','tempnam','tanh','tan',
-            'system','syslog','symlink','substr_replace','substr_count','substr',
-            'strval','strtr','strtoupper','strtotime','strtolower','strtok',
-            'strstr','strspn','strrpos','strrev','strrchr','strpos',
-            'strncmp','strncasecmp','strnatcmp','strnatcasecmp','strlen','stristr',
-            'stripslashes','stripcslashes','strip_tags','strftime','stream_wrapper_register','stream_set_write_buffer',
-            'stream_set_timeout','stream_set_blocking','stream_select','stream_register_wrapper','stream_get_meta_data','stream_filter_prepend',
-            'stream_filter_append','stream_context_set_params','stream_context_set_option','stream_context_get_options','stream_context_create','strcspn',
-            'strcoll','strcmp','strchr','strcasecmp','str_word_count','str_shuffle',
-            'str_rot13','str_replace','str_repeat','str_pad','stat','sscanf',
-            'srand','sqrt','sql_regcase','sprintf','spliti','split',
-            'soundex','sort','socket_writev','socket_write','socket_strerror','socket_shutdown',
-            'socket_setopt','socket_set_timeout','socket_set_option','socket_set_nonblock','socket_set_blocking','socket_set_block',
-            'socket_sendto','socket_sendmsg','socket_send','socket_select','socket_recvmsg','socket_recvfrom',
-            'socket_recv','socket_readv','socket_read','socket_listen','socket_last_error','socket_iovec_set',
-            'socket_iovec_free','socket_iovec_fetch','socket_iovec_delete','socket_iovec_alloc','socket_iovec_add','socket_getsockname',
-            'socket_getpeername','socket_getopt','socket_get_status','socket_get_option','socket_create_pair','socket_create_listen',
-            'socket_create','socket_connect','socket_close','socket_clear_error','socket_bind','socket_accept',
-            'sleep','sizeof','sinh','sin','similar_text','shuffle',
-            'show_source','shmop_write','shmop_size','shmop_read','shmop_open','shmop_delete',
-            'shmop_close','shm_remove_var','shm_remove','shm_put_var','shm_get_var','shm_detach',
-            'shm_attach','shell_exec','sha1_file','sha1','settype','setlocale',
-            'setcookie','set_time_limit','set_socket_blocking','set_magic_quotes_runtime','set_include_path','set_file_buffer',
-            'set_error_handler','session_write_close','session_unset','session_unregister','session_start','session_set_save_handler',
-            'session_set_cookie_params','session_save_path','session_register','session_regenerate_id','session_name','session_module_name',
-            'session_is_registered','session_id','session_get_cookie_params','session_encode','session_destroy','session_decode',
-            'session_cache_limiter','session_cache_expire','serialize','sem_remove','sem_release','sem_get',
-            'sem_acquire','rtrim','rsort','round','rmdir','rewinddir',
-            'rewind','restore_include_path','restore_error_handler','reset','rename','register_tick_function',
-            'register_shutdown_function','realpath','readlink','readgzfile','readfile','readdir',
-            'read_exif_data','rawurlencode','rawurldecode','range','rand','rad2deg',
-            'quotemeta','quoted_printable_decode','putenv','proc_open','proc_close','printf',
-            'print_r','prev','preg_split','preg_replace_callback','preg_replace','preg_quote',
-            'preg_match_all','preg_match','preg_grep','pow','posix_uname','posix_ttyname',
-            'posix_times','posix_strerror','posix_setuid','posix_setsid','posix_setpgid','posix_setgid',
-            'posix_seteuid','posix_setegid','posix_mkfifo','posix_kill','posix_isatty','posix_getuid',
-            'posix_getsid','posix_getrlimit','posix_getpwuid','posix_getpwnam','posix_getppid','posix_getpid',
-            'posix_getpgrp','posix_getpgid','posix_getlogin','posix_getgroups','posix_getgrnam','posix_getgrgid',
-            'posix_getgid','posix_geteuid','posix_getegid','posix_getcwd','posix_get_last_error','posix_errno',
-            'posix_ctermid','pos','popen','pi','phpversion','phpinfo',
-            'phpcredits','php_uname','php_sapi_name','php_logo_guid','php_ini_scanned_files','pg_update',
-            'pg_untrace','pg_unescape_bytea','pg_tty','pg_trace','pg_setclientencoding','pg_set_client_encoding',
-            'pg_send_query','pg_select','pg_result_status','pg_result_seek','pg_result_error','pg_result',
-            'pg_query','pg_put_line','pg_port','pg_ping','pg_pconnect','pg_options',
-            'pg_numrows','pg_numfields','pg_num_rows','pg_num_fields','pg_meta_data','pg_lowrite',
-            'pg_lounlink','pg_loreadall','pg_loread','pg_loopen','pg_loimport','pg_loexport',
-            'pg_locreate','pg_loclose','pg_lo_write','pg_lo_unlink','pg_lo_tell','pg_lo_seek',
-            'pg_lo_read_all','pg_lo_read','pg_lo_open','pg_lo_import','pg_lo_export','pg_lo_create',
-            'pg_lo_close','pg_last_oid','pg_last_notice','pg_last_error','pg_insert','pg_host',
-            'pg_getlastoid','pg_get_result','pg_get_pid','pg_get_notify','pg_freeresult','pg_free_result',
-            'pg_fieldtype','pg_fieldsize','pg_fieldprtlen','pg_fieldnum','pg_fieldname','pg_fieldisnull',
-            'pg_field_type','pg_field_size','pg_field_prtlen','pg_field_num','pg_field_name','pg_field_is_null',
-            'pg_fetch_row','pg_fetch_result','pg_fetch_object','pg_fetch_assoc','pg_fetch_array','pg_fetch_all',
-            'pg_exec','pg_escape_string','pg_escape_bytea','pg_errormessage','pg_end_copy','pg_delete',
-            'pg_dbname','pg_copy_to','pg_copy_from','pg_convert','pg_connection_status','pg_connection_reset',
-            'pg_connection_busy','pg_connect','pg_cmdtuples','pg_close','pg_clientencoding','pg_client_encoding',
-            'pg_cancel_query','pg_affected_rows','pfsockopen','pclose','pathinfo','passthru',
-            'parse_url','parse_str','parse_ini_file','pack','overload','output_reset_rewrite_vars',
-            'output_add_rewrite_var','ord','openssl_x509_read','openssl_x509_parse','openssl_x509_free','openssl_x509_export_to_file',
-            'openssl_x509_export','openssl_x509_checkpurpose','openssl_x509_check_private_key','openssl_verify','openssl_sign','openssl_seal',
-            'openssl_public_encrypt','openssl_public_decrypt','openssl_private_encrypt','openssl_private_decrypt','openssl_pkey_new','openssl_pkey_get_public',
-            'openssl_pkey_get_private','openssl_pkey_free','openssl_pkey_export_to_file','openssl_pkey_export','openssl_pkcs7_verify','openssl_pkcs7_sign',
-            'openssl_pkcs7_encrypt','openssl_pkcs7_decrypt','openssl_open','openssl_get_publickey','openssl_get_privatekey','openssl_free_key',
-            'openssl_error_string','openssl_csr_sign','openssl_csr_new','openssl_csr_export_to_file','openssl_csr_export','openlog',
-            'opendir','octdec','ob_start','ob_list_handlers','ob_implicit_flush','ob_iconv_handler',
-            'ob_gzhandler','ob_get_status','ob_get_level','ob_get_length','ob_get_flush','ob_get_contents',
-            'ob_get_clean','ob_flush','ob_end_flush','ob_end_clean','ob_clean','number_format',
-            'nl_langinfo','nl2br','ngettext','next','natsort','natcasesort',
-            'mysql_unbuffered_query','mysql_thread_id','mysql_tablename','mysql_table_name','mysql_stat','mysql_selectdb',
-            'mysql_select_db','mysql_result','mysql_real_escape_string','mysql_query','mysql_ping','mysql_pconnect',
-            'mysql_numrows','mysql_numfields','mysql_num_rows','mysql_num_fields','mysql_listtables','mysql_listfields',
-            'mysql_listdbs','mysql_list_tables','mysql_list_processes','mysql_list_fields','mysql_list_dbs','mysql_insert_id',
-            'mysql_info','mysql_get_server_info','mysql_get_proto_info','mysql_get_host_info','mysql_get_client_info','mysql_freeresult',
-            'mysql_free_result','mysql_fieldtype','mysql_fieldtable','mysql_fieldname','mysql_fieldlen','mysql_fieldflags',
-            'mysql_field_type','mysql_field_table','mysql_field_seek','mysql_field_name','mysql_field_len','mysql_field_flags',
-            'mysql_fetch_row','mysql_fetch_object','mysql_fetch_lengths','mysql_fetch_field','mysql_fetch_assoc','mysql_fetch_array',
-            'mysql_escape_string','mysql_error','mysql_errno','mysql_dropdb','mysql_drop_db','mysql_dbname',
-            'mysql_db_query','mysql_db_name','mysql_data_seek','mysql_createdb','mysql_create_db','mysql_connect',
-            'mysql_close','mysql_client_encoding','mysql_affected_rows','mysql','mt_srand','mt_rand',
-            'mt_getrandmax','move_uploaded_file','money_format','mktime','mkdir','min',
-            'microtime','method_exists','metaphone','memory_get_usage','md5_file','md5',
-            'mbsubstr','mbstrrpos','mbstrpos','mbstrlen','mbstrcut','mbsplit',
-            'mbregex_encoding','mberegi_replace','mberegi','mbereg_search_setpos','mbereg_search_regs','mbereg_search_pos',
-            'mbereg_search_init','mbereg_search_getregs','mbereg_search_getpos','mbereg_search','mbereg_replace','mbereg_match',
-            'mbereg','mb_substr_count','mb_substr','mb_substitute_character','mb_strwidth','mb_strtoupper',
-            'mb_strtolower','mb_strrpos','mb_strpos','mb_strlen','mb_strimwidth','mb_strcut',
-            'mb_split','mb_send_mail','mb_regex_set_options','mb_regex_encoding','mb_preferred_mime_name','mb_parse_str',
-            'mb_output_handler','mb_language','mb_internal_encoding','mb_http_output','mb_http_input','mb_get_info',
-            'mb_eregi_replace','mb_eregi','mb_ereg_search_setpos','mb_ereg_search_regs','mb_ereg_search_pos','mb_ereg_search_init',
-            'mb_ereg_search_getregs','mb_ereg_search_getpos','mb_ereg_search','mb_ereg_replace','mb_ereg_match','mb_ereg',
-            'mb_encode_numericentity','mb_encode_mimeheader','mb_detect_order','mb_detect_encoding','mb_decode_numericentity','mb_decode_mimeheader',
-            'mb_convert_variables','mb_convert_kana','mb_convert_encoding','mb_convert_case','max','mail',
-            'magic_quotes_runtime','ltrim','lstat','long2ip','log1p','log10',
-            'log','localtime','localeconv','linkinfo','link','levenshtein',
-            'lcg_value','ksort','krsort','key_exists','key','juliantojd',
-            'join','jewishtojd','jdtounix','jdtojulian','jdtojewish','jdtogregorian',
-            'jdtofrench','jdmonthname','jddayofweek','is_writeable','is_writable','is_uploaded_file',
-            'is_subclass_of','is_string','is_scalar','is_resource','is_real','is_readable',
-            'is_object','is_numeric','is_null','is_nan','is_long','is_link',
-            'is_integer','is_int','is_infinite','is_float','is_finite','is_file',
-            'is_executable','is_double','is_dir','is_callable','is_bool','is_array',
-            'is_a','iptcparse','iptcembed','ip2long','intval','ini_set',
-            'ini_restore','ini_get_all','ini_get','ini_alter','in_array','import_request_variables',
-            'implode','image_type_to_mime_type','ignore_user_abort','iconv_set_encoding','iconv_get_encoding','iconv',
-            'i18n_mime_header_encode','i18n_mime_header_decode','i18n_ja_jp_hantozen','i18n_internal_encoding','i18n_http_output','i18n_http_input',
-            'i18n_discover_encoding','i18n_convert','hypot','htmlspecialchars','htmlentities','html_entity_decode',
-            'highlight_string','highlight_file','hexdec','hebrevc','hebrev','headers_sent',
-            'header','gzwrite','gzuncompress','gztell','gzseek','gzrewind',
-            'gzread','gzputs','gzpassthru','gzopen','gzinflate','gzgetss',
-            'gzgets','gzgetc','gzfile','gzeof','gzencode','gzdeflate',
-            'gzcompress','gzclose','gregoriantojd','gmstrftime','gmmktime','gmdate',
-            'glob','gettype','gettimeofday','gettext','getservbyport','getservbyname',
-            'getrusage','getrandmax','getprotobynumber','getprotobyname','getopt','getmyuid',
-            'getmypid','getmyinode','getmygid','getmxrr','getlastmod','getimagesize',
-            'gethostbynamel','gethostbyname','gethostbyaddr','getenv','getdate','getcwd',
-            'getallheaders','get_resource_type','get_required_files','get_parent_class','get_object_vars','get_meta_tags',
-            'get_magic_quotes_runtime','get_magic_quotes_gpc','get_loaded_extensions','get_included_files','get_include_path','get_html_translation_table',
-            'get_extension_funcs','get_defined_vars','get_defined_functions','get_defined_constants','get_declared_classes','get_current_user',
-            'get_class_vars','get_class_methods','get_class','get_cfg_var','get_browser','fwrite',
-            'function_exists','func_num_args','func_get_args','func_get_arg','ftruncate','ftp_systype',
-            'ftp_ssl_connect','ftp_size','ftp_site','ftp_set_option','ftp_rmdir','ftp_rename',
-            'ftp_rawlist','ftp_quit','ftp_pwd','ftp_put','ftp_pasv','ftp_nlist',
-            'ftp_nb_put','ftp_nb_get','ftp_nb_fput','ftp_nb_fget','ftp_nb_continue','ftp_mkdir',
-            'ftp_mdtm','ftp_login','ftp_get_option','ftp_get','ftp_fput','ftp_fget',
-            'ftp_exec','ftp_delete','ftp_connect','ftp_close','ftp_chdir','ftp_cdup',
-            'ftok','ftell','fstat','fsockopen','fseek','fscanf',
-            'frenchtojd','fread','fputs','fpassthru','fopen','fnmatch',
-            'fmod','flush','floor','flock','floatval','filetype',
-            'filesize','filepro_rowcount','filepro_retrieve','filepro_fieldwidth','filepro_fieldtype','filepro_fieldname',
-            'filepro_fieldcount','filepro','fileperms','fileowner','filemtime','fileinode',
-            'filegroup','filectime','fileatime','file_get_contents','file_exists','file',
-            'fgetss','fgets','fgetcsv','fgetc','fflush','feof',
-            'fclose','ezmlm_hash','extract','extension_loaded','expm1','explode',
-            'exp','exif_thumbnail','exif_tagname','exif_read_data','exif_imagetype','exec',
-            'escapeshellcmd','escapeshellarg','error_reporting','error_log','eregi_replace','eregi',
-            'ereg_replace','ereg','end','easter_days','easter_date','each',
-            'doubleval','dngettext','dl','diskfreespace','disk_total_space','disk_free_space',
-            'dirname','dir','dgettext','deg2rad','defined','define_syslog_variables',
-            'define','decoct','dechex','decbin','debug_zval_dump','debug_backtrace',
-            'deaggregate','dcngettext','dcgettext','dba_sync','dba_replace','dba_popen',
-            'dba_optimize','dba_open','dba_nextkey','dba_list','dba_insert','dba_handlers',
-            'dba_firstkey','dba_fetch','dba_exists','dba_delete','dba_close','date',
-            'current','ctype_xdigit','ctype_upper','ctype_space','ctype_punct','ctype_print',
-            'ctype_lower','ctype_graph','ctype_digit','ctype_cntrl','ctype_alpha','ctype_alnum',
-            'crypt','create_function','crc32','count_chars','count','cosh',
-            'cos','copy','convert_cyr_string','constant','connection_status','connection_aborted',
-            'compact','closelog','closedir','clearstatcache','class_exists','chunk_split',
-            'chr','chown','chop','chmod','chgrp','checkdnsrr',
-            'checkdate','chdir','ceil','call_user_method_array','call_user_method','call_user_func_array',
-            'call_user_func','cal_to_jd','cal_info','cal_from_jd','cal_days_in_month','bzwrite',
-            'bzread','bzopen','bzflush','bzerrstr','bzerror','bzerrno',
-            'bzdecompress','bzcompress','bzclose','bindtextdomain','bindec','bind_textdomain_codeset',
-            'bin2hex','bcsub','bcsqrt','bcscale','bcpow','bcmul',
-            'bcmod','bcdiv','bccomp','bcadd','basename','base_convert',
-            'base64_encode','base64_decode','atanh','atan2','atan','assert_options',
-            'assert','asort','asinh','asin','arsort','array_walk',
-            'array_values','array_unshift','array_unique','array_sum','array_splice','array_slice',
-            'array_shift','array_search','array_reverse','array_reduce','array_rand','array_push',
-            'array_pop','array_pad','array_multisort','array_merge_recursive','array_merge','array_map',
-            'array_keys','array_key_exists','array_intersect_assoc','array_intersect','array_flip','array_filter',
-            'array_fill','array_diff_assoc','array_diff','array_count_values','array_chunk','array_change_key_case',
-            'apache_setenv','apache_response_headers','apache_request_headers','apache_note','apache_lookup_uri','apache_get_version',
-            'apache_child_terminate','aggregation_info','aggregate_properties_by_regexp','aggregate_properties_by_list','aggregate_properties','aggregate_methods_by_regexp',
-            'aggregate_methods_by_list','aggregate_methods','aggregate','addslashes','addcslashes','acosh',
-            'acos','abs','_','echo', 'print', 'global', 'static', 'exit', 'array', 'empty',
-            'eval', 'isset', 'unset', 'die', 'list'
+            'abs','acos','acosh','addcslashes','addslashes','aggregate',
+            'aggregate_methods','aggregate_methods_by_list',
+            'aggregate_methods_by_regexp','aggregate_properties',
+            'aggregate_properties_by_list','aggregate_properties_by_regexp',
+            'aggregation_info','apache_child_terminate','apache_get_modules',
+            'apache_get_version','apache_getenv','apache_lookup_uri',
+            'apache_note','apache_request_headers','apache_response_headers',
+            'apache_setenv','array','array_change_key_case','array_chunk',
+            'array_combine','array_count_values','array_diff',
+            'array_diff_assoc','array_diff_key','array_diff_uassoc',
+            'array_diff_ukey','array_fill','array_fill_keys','array_filter',
+            'array_flip','array_intersect','array_intersect_assoc',
+            'array_intersect_key','array_intersect_uassoc',
+            'array_intersect_ukey','array_key_exists','array_keys','array_map',
+            'array_merge','array_merge_recursive','array_multisort','array_pad',
+            'array_pop','array_product','array_push','array_rand',
+            'array_reduce','array_reverse','array_search','array_shift',
+            'array_slice','array_splice','array_sum','array_udiff',
+            'array_udiff_assoc','array_udiff_uassoc','array_uintersect',
+            'array_uintersect_assoc','array_uintersect_uassoc','array_unique',
+            'array_unshift','array_values','array_walk','array_walk_recursive',
+            'arsort','asin','asinh','asort','assert','assert_options','atan',
+            'atan2','atanh','base_convert','base64_decode','base64_encode',
+            'basename','bcadd','bccomp','bcdiv','bcmod','bcmul',
+            'bcompiler_load','bcompiler_load_exe','bcompiler_parse_class',
+            'bcompiler_read','bcompiler_write_class','bcompiler_write_constant',
+            'bcompiler_write_exe_footer','bcompiler_write_file',
+            'bcompiler_write_footer','bcompiler_write_function',
+            'bcompiler_write_functions_from_file','bcompiler_write_header',
+            'bcompiler_write_included_filename','bcpow','bcpowmod','bcscale',
+            'bcsqrt','bcsub','bin2hex','bindec','bindtextdomain',
+            'bind_textdomain_codeset','bitset_empty','bitset_equal',
+            'bitset_excl','bitset_fill','bitset_from_array','bitset_from_hash',
+            'bitset_from_string','bitset_in','bitset_incl',
+            'bitset_intersection','bitset_invert','bitset_is_empty',
+            'bitset_subset','bitset_to_array','bitset_to_hash',
+            'bitset_to_string','bitset_union','blenc_encrypt','bzclose',
+            'bzcompress','bzdecompress','bzerrno','bzerror','bzerrstr',
+            'bzflush','bzopen','bzread','bzwrite','cal_days_in_month',
+            'cal_from_jd','cal_info','cal_to_jd','call_user_func',
+            'call_user_func_array','call_user_method','call_user_method_array',
+            'ceil','chdir','checkdate','checkdnsrr','chgrp','chmod','chop',
+            'chown','chr','chunk_split','class_exists','class_implements',
+            'class_parents','classkit_aggregate_methods',
+            'classkit_doc_comments','classkit_import','classkit_method_add',
+            'classkit_method_copy','classkit_method_redefine',
+            'classkit_method_remove','classkit_method_rename','clearstatcache',
+            'closedir','closelog','com_create_guid','com_event_sink',
+            'com_get_active_object','com_load_typelib','com_message_pump',
+            'com_print_typeinfo','compact','confirm_phpdoc_compiled',
+            'connection_aborted','connection_status','constant',
+            'convert_cyr_string','convert_uudecode','convert_uuencode','copy',
+            'cos','cosh','count','count_chars','cpdf_add_annotation',
+            'cpdf_add_outline','cpdf_arc','cpdf_begin_text','cpdf_circle',
+            'cpdf_clip','cpdf_close','cpdf_closepath',
+            'cpdf_closepath_fill_stroke','cpdf_closepath_stroke',
+            'cpdf_continue_text','cpdf_curveto','cpdf_end_text','cpdf_fill',
+            'cpdf_fill_stroke','cpdf_finalize','cpdf_finalize_page',
+            'cpdf_global_set_document_limits','cpdf_import_jpeg','cpdf_lineto',
+            'cpdf_moveto','cpdf_newpath','cpdf_open','cpdf_output_buffer',
+            'cpdf_page_init','cpdf_rect','cpdf_restore','cpdf_rlineto',
+            'cpdf_rmoveto','cpdf_rotate','cpdf_rotate_text','cpdf_save',
+            'cpdf_save_to_file','cpdf_scale','cpdf_set_action_url',
+            'cpdf_set_char_spacing','cpdf_set_creator','cpdf_set_current_page',
+            'cpdf_set_font','cpdf_set_font_directories',
+            'cpdf_set_font_map_file','cpdf_set_horiz_scaling',
+            'cpdf_set_keywords','cpdf_set_leading','cpdf_set_page_animation',
+            'cpdf_set_subject','cpdf_set_text_matrix','cpdf_set_text_pos',
+            'cpdf_set_text_rendering','cpdf_set_text_rise','cpdf_set_title',
+            'cpdf_set_viewer_preferences','cpdf_set_word_spacing',
+            'cpdf_setdash','cpdf_setflat','cpdf_setgray','cpdf_setgray_fill',
+            'cpdf_setgray_stroke','cpdf_setlinecap','cpdf_setlinejoin',
+            'cpdf_setlinewidth','cpdf_setmiterlimit','cpdf_setrgbcolor',
+            'cpdf_setrgbcolor_fill','cpdf_setrgbcolor_stroke','cpdf_show',
+            'cpdf_show_xy','cpdf_stringwidth','cpdf_stroke','cpdf_text',
+            'cpdf_translate','crack_check','crack_closedict',
+            'crack_getlastmessage','crack_opendict','crc32','create_function',
+            'crypt','ctype_alnum','ctype_alpha','ctype_cntrl','ctype_digit',
+            'ctype_graph','ctype_lower','ctype_print','ctype_punct',
+            'ctype_space','ctype_upper','ctype_xdigit','curl_close',
+            'curl_copy_handle','curl_errno','curl_error','curl_exec',
+            'curl_getinfo','curl_init','curl_multi_add_handle',
+            'curl_multi_close','curl_multi_exec','curl_multi_getcontent',
+            'curl_multi_info_read','curl_multi_init','curl_multi_remove_handle',
+            'curl_multi_select','curl_setopt','curl_setopt_array',
+            'curl_version','current','cvsclient_connect','cvsclient_log',
+            'cvsclient_login','cvsclient_retrieve','date','date_create',
+            'date_date_set','date_default_timezone_get',
+            'date_default_timezone_set','date_format','date_isodate_set',
+            'date_modify','date_offset_get','date_parse','date_sun_info',
+            'date_sunrise','date_sunset','date_time_set','date_timezone_get',
+            'date_timezone_set','db_id_list','dba_close','dba_delete',
+            'dba_exists','dba_fetch','dba_firstkey','dba_handlers','dba_insert',
+            'dba_key_split','dba_list','dba_nextkey','dba_open','dba_optimize',
+            'dba_popen','dba_replace','dba_sync','dbase_add_record',
+            'dbase_close','dbase_create','dbase_delete_record',
+            'dbase_get_header_info','dbase_get_record',
+            'dbase_get_record_with_names','dbase_numfields','dbase_numrecords',
+            'dbase_open','dbase_pack','dbase_replace_record',
+            'dbg_get_all_contexts','dbg_get_all_module_names',
+            'dbg_get_all_source_lines','dbg_get_context_name',
+            'dbg_get_module_name','dbg_get_profiler_results',
+            'dbg_get_source_context','dblist','dbmclose','dbmdelete',
+            'dbmexists','dbmfetch','dbmfirstkey','dbminsert','dbmnextkey',
+            'dbmopen','dbmreplace','dbx_close','dbx_compare','dbx_connect',
+            'dbx_error','dbx_escape_string','dbx_fetch_row','dbx_query',
+            'dbx_sort','dcgettext','dcngettext','deaggregate','debug_backtrace',
+            'debug_zval_dump','debugbreak','decbin','dechex','decoct','define',
+            'defined','define_syslog_variables','deg2rad','dgettext','die',
+            'dio_close','dio_open','dio_read','dio_seek','dio_stat','dio_write',
+            'dir','dirname','disk_free_space','disk_total_space',
+            'diskfreespace','dl','dngettext','docblock_token_name',
+            'docblock_tokenize','dom_import_simplexml','domxml_add_root',
+            'domxml_attributes','domxml_children','domxml_doc_add_root',
+            'domxml_doc_document_element','domxml_doc_get_element_by_id',
+            'domxml_doc_get_elements_by_tagname','domxml_doc_get_root',
+            'domxml_doc_set_root','domxml_doc_validate','domxml_doc_xinclude',
+            'domxml_dump_mem','domxml_dump_mem_file','domxml_dump_node',
+            'domxml_dumpmem','domxml_elem_get_attribute',
+            'domxml_elem_set_attribute','domxml_get_attribute','domxml_getattr',
+            'domxml_html_dump_mem','domxml_new_child','domxml_new_doc',
+            'domxml_new_xmldoc','domxml_node','domxml_node_add_namespace',
+            'domxml_node_attributes','domxml_node_children',
+            'domxml_node_get_content','domxml_node_has_attributes',
+            'domxml_node_new_child','domxml_node_set_content',
+            'domxml_node_set_namespace','domxml_node_unlink_node',
+            'domxml_open_file','domxml_open_mem','domxml_parser',
+            'domxml_parser_add_chunk','domxml_parser_cdata_section',
+            'domxml_parser_characters','domxml_parser_comment',
+            'domxml_parser_end','domxml_parser_end_document',
+            'domxml_parser_end_element','domxml_parser_entity_reference',
+            'domxml_parser_get_document','domxml_parser_namespace_decl',
+            'domxml_parser_processing_instruction',
+            'domxml_parser_start_document','domxml_parser_start_element',
+            'domxml_root','domxml_set_attribute','domxml_setattr',
+            'domxml_substitute_entities_default','domxml_unlink_node',
+            'domxml_version','domxml_xmltree','doubleval','each','easter_date',
+            'easter_days','empty','end','ereg','ereg_replace','eregi',
+            'eregi_replace','error_get_last','error_log','error_reporting',
+            'escapeshellarg','escapeshellcmd','eval','event_deschedule',
+            'event_dispatch','event_free','event_handle_signal',
+            'event_have_events','event_init','event_new','event_pending',
+            'event_priority_set','event_schedule','event_set','event_timeout',
+            'exec','exif_imagetype','exif_read_data','exif_tagname',
+            'exif_thumbnail','exit','exp','explode','expm1','extension_loaded',
+            'extract','ezmlm_hash','fbird_add_user','fbird_affected_rows',
+            'fbird_backup','fbird_blob_add','fbird_blob_cancel',
+            'fbird_blob_close','fbird_blob_create','fbird_blob_echo',
+            'fbird_blob_get','fbird_blob_import','fbird_blob_info',
+            'fbird_blob_open','fbird_close','fbird_commit','fbird_commit_ret',
+            'fbird_connect','fbird_db_info','fbird_delete_user','fbird_drop_db',
+            'fbird_errcode','fbird_errmsg','fbird_execute','fbird_fetch_assoc',
+            'fbird_fetch_object','fbird_fetch_row','fbird_field_info',
+            'fbird_free_event_handler','fbird_free_query','fbird_free_result',
+            'fbird_gen_id','fbird_maintain_db','fbird_modify_user',
+            'fbird_name_result','fbird_num_fields','fbird_num_params',
+            'fbird_param_info','fbird_pconnect','fbird_prepare','fbird_query',
+            'fbird_restore','fbird_rollback','fbird_rollback_ret',
+            'fbird_server_info','fbird_service_attach','fbird_service_detach',
+            'fbird_set_event_handler','fbird_trans','fbird_wait_event','fclose',
+            'fdf_add_doc_javascript','fdf_add_template','fdf_close',
+            'fdf_create','fdf_enum_values','fdf_errno','fdf_error','fdf_get_ap',
+            'fdf_get_attachment','fdf_get_encoding','fdf_get_file',
+            'fdf_get_flags','fdf_get_opt','fdf_get_status','fdf_get_value',
+            'fdf_get_version','fdf_header','fdf_next_field_name','fdf_open',
+            'fdf_open_string','fdf_remove_item','fdf_save','fdf_save_string',
+            'fdf_set_ap','fdf_set_encoding','fdf_set_file','fdf_set_flags',
+            'fdf_set_javascript_action','fdf_set_on_import_javascript',
+            'fdf_set_opt','fdf_set_status','fdf_set_submit_form_action',
+            'fdf_set_target_frame','fdf_set_value','fdf_set_version','feof',
+            'fflush','fgetc','fgetcsv','fgets','fgetss','file','file_exists',
+            'file_get_contents','file_put_contents','fileatime','filectime',
+            'filegroup','fileinode','filemtime','fileowner','fileperms',
+            'filepro','filepro_fieldcount','filepro_fieldname',
+            'filepro_fieldtype','filepro_fieldwidth','filepro_retrieve',
+            'filepro_rowcount','filesize','filetype','filter_has_var',
+            'filter_id','filter_input','filter_input_array','filter_list',
+            'filter_var','filter_var_array','finfo_buffer','finfo_close',
+            'finfo_file','finfo_open','finfo_set_flags','floatval','flock',
+            'floor','flush','fmod','fnmatch','fopen','fpassthru','fprintf',
+            'fputcsv','fputs','fread','frenchtojd','fribidi_charset_info',
+            'fribidi_get_charsets','fribidi_log2vis','fscanf','fseek',
+            'fsockopen','fstat','ftell','ftok','ftp_alloc','ftp_cdup',
+            'ftp_chdir','ftp_chmod','ftp_close','ftp_connect','ftp_delete',
+            'ftp_exec','ftp_fget','ftp_fput','ftp_get','ftp_get_option',
+            'ftp_login','ftp_mdtm','ftp_mkdir','ftp_nb_continue','ftp_nb_fget',
+            'ftp_nb_fput','ftp_nb_get','ftp_nb_put','ftp_nlist','ftp_pasv',
+            'ftp_put','ftp_pwd','ftp_quit','ftp_raw','ftp_rawlist','ftp_rename',
+            'ftp_rmdir','ftp_set_option','ftp_site','ftp_size',
+            'ftp_ssl_connect','ftp_systype','ftruncate','function_exists',
+            'func_get_arg','func_get_args','func_num_args','fwrite','gd_info',
+            'getallheaders','getcwd','getdate','getenv','gethostbyaddr',
+            'gethostbyname','gethostbynamel','getimagesize','getlastmod',
+            'getmxrr','getmygid','getmyinode','getmypid','getmyuid','getopt',
+            'getprotobyname','getprotobynumber','getrandmax','getrusage',
+            'getservbyname','getservbyport','gettext','gettimeofday','gettype',
+            'get_browser','get_cfg_var','get_class','get_class_methods',
+            'get_class_vars','get_current_user','get_declared_classes',
+            'get_defined_constants','get_defined_functions','get_defined_vars',
+            'get_extension_funcs','get_headers','get_html_translation_table',
+            'get_included_files','get_include_path','get_loaded_extensions',
+            'get_magic_quotes_gpc','get_magic_quotes_runtime','get_meta_tags',
+            'get_object_vars','get_parent_class','get_required_files',
+            'get_resource_type','glob','gmdate','gmmktime','gmp_abs','gmp_add',
+            'gmp_and','gmp_clrbit','gmp_cmp','gmp_com','gmp_div','gmp_div_q',
+            'gmp_div_qr','gmp_div_r','gmp_divexact','gmp_fact','gmp_gcd',
+            'gmp_gcdext','gmp_hamdist','gmp_init','gmp_intval','gmp_invert',
+            'gmp_jacobi','gmp_legendre','gmp_mod','gmp_mul','gmp_neg',
+            'gmp_nextprime','gmp_or','gmp_perfect_square','gmp_popcount',
+            'gmp_pow','gmp_powm','gmp_prob_prime','gmp_random','gmp_scan0',
+            'gmp_scan1','gmp_setbit','gmp_sign','gmp_sqrt','gmp_sqrtrem',
+            'gmp_strval','gmp_sub','gmp_xor','gmstrftime','gopher_parsedir',
+            'gregoriantojd','gzclose','gzcompress','gzdeflate','gzencode',
+            'gzeof','gzfile','gzgetc','gzgets','gzgetss','gzinflate','gzopen',
+            'gzpassthru','gzputs','gzread','gzrewind','gzseek','gztell',
+            'gzuncompress','gzwrite','hash','hash_algos','hash_file',
+            'hash_final','hash_hmac','hash_hmac_file','hash_init','hash_update',
+            'hash_update_file','hash_update_stream','header','headers_list',
+            'headers_sent','hebrev','hebrevc','hexdec','highlight_file',
+            'highlight_string','html_doc','html_doc_file','html_entity_decode',
+            'htmlentities','htmlspecialchars','htmlspecialchars_decode',
+            'http_build_cookie','http_build_query','http_build_str',
+            'http_build_url','http_cache_etag','http_cache_last_modified',
+            'http_chunked_decode','http_date','http_deflate','http_get',
+            'http_get_request_body','http_get_request_body_stream',
+            'http_get_request_headers','http_head','http_inflate',
+            'http_match_etag','http_match_modified','http_match_request_header',
+            'http_negotiate_charset','http_negotiate_content_type',
+            'http_negotiate_language','http_parse_cookie','http_parse_headers',
+            'http_parse_message','http_parse_params',
+            'http_persistent_handles_clean','http_persistent_handles_count',
+            'http_persistent_handles_ident','http_post_data','http_post_fields',
+            'http_put_data','http_put_file','http_put_stream','http_redirect',
+            'http_request','http_request_body_encode',
+            'http_request_method_exists','http_request_method_name',
+            'http_request_method_register','http_request_method_unregister',
+            'http_send_content_disposition','http_send_content_type',
+            'http_send_data','http_send_file','http_send_last_modified',
+            'http_send_status','http_send_stream','http_support',
+            'http_throttle','hypot','i18n_convert','i18n_discover_encoding',
+            'i18n_http_input','i18n_http_output','i18n_internal_encoding',
+            'i18n_ja_jp_hantozen','i18n_mime_header_decode',
+            'i18n_mime_header_encode','ibase_add_user','ibase_affected_rows',
+            'ibase_backup','ibase_blob_add','ibase_blob_cancel',
+            'ibase_blob_close','ibase_blob_create','ibase_blob_echo',
+            'ibase_blob_get','ibase_blob_import','ibase_blob_info',
+            'ibase_blob_open','ibase_close','ibase_commit','ibase_commit_ret',
+            'ibase_connect','ibase_db_info','ibase_delete_user','ibase_drop_db',
+            'ibase_errcode','ibase_errmsg','ibase_execute','ibase_fetch_assoc',
+            'ibase_fetch_object','ibase_fetch_row','ibase_field_info',
+            'ibase_free_event_handler','ibase_free_query','ibase_free_result',
+            'ibase_gen_id','ibase_maintain_db','ibase_modify_user',
+            'ibase_name_result','ibase_num_fields','ibase_num_params',
+            'ibase_param_info','ibase_pconnect','ibase_prepare','ibase_query',
+            'ibase_restore','ibase_rollback','ibase_rollback_ret',
+            'ibase_server_info','ibase_service_attach','ibase_service_detach',
+            'ibase_set_event_handler','ibase_trans','ibase_wait_event','iconv',
+            'iconv_get_encoding','iconv_mime_decode',
+            'iconv_mime_decode_headers','iconv_mime_encode',
+            'iconv_set_encoding','iconv_strlen','iconv_strpos','iconv_strrpos',
+            'iconv_substr','id3_get_frame_long_name','id3_get_frame_short_name',
+            'id3_get_genre_id','id3_get_genre_list','id3_get_genre_name',
+            'id3_get_tag','id3_get_version','id3_remove_tag','id3_set_tag',
+            'idate','ignore_user_abort','image_type_to_extension',
+            'image_type_to_mime_type','image2wbmp','imagealphablending',
+            'imageantialias','imagearc','imagechar','imagecharup',
+            'imagecolorallocate','imagecolorallocatealpha','imagecolorat',
+            'imagecolorclosest','imagecolorclosestalpha','imagecolordeallocate',
+            'imagecolorexact','imagecolorexactalpha','imagecolormatch',
+            'imagecolorresolve','imagecolorresolvealpha','imagecolorset',
+            'imagecolorsforindex','imagecolorstotal','imagecolortransparent',
+            'imageconvolution','imagecopy','imagecopymerge',
+            'imagecopymergegray','imagecopyresampled','imagecopyresized',
+            'imagecreate','imagecreatefromgd','imagecreatefromgd2',
+            'imagecreatefromgd2part','imagecreatefromgif','imagecreatefromjpeg',
+            'imagecreatefrompng','imagecreatefromstring','imagecreatefromwbmp',
+            'imagecreatefromxbm','imagecreatetruecolor','imagedashedline',
+            'imagedestroy','imageellipse','imagefill','imagefilledarc',
+            'imagefilledellipse','imagefilledpolygon','imagefilledrectangle',
+            'imagefilltoborder','imagefilter','imagefontheight',
+            'imagefontwidth','imageftbbox','imagefttext','imagegammacorrect',
+            'imagegd','imagegd2','imagegif','imagegrabscreen','imagegrabwindow',
+            'imageinterlace','imageistruecolor','imagejpeg','imagelayereffect',
+            'imageline','imageloadfont','imagepalettecopy','imagepng',
+            'imagepolygon','imagepsbbox','imagepsencodefont',
+            'imagepsextendfont','imagepsfreefont','imagepsloadfont',
+            'imagepsslantfont','imagepstext','imagerectangle','imagerotate',
+            'imagesavealpha','imagesetbrush','imagesetpixel','imagesetstyle',
+            'imagesetthickness','imagesettile','imagestring','imagestringup',
+            'imagesx','imagesy','imagetruecolortopalette','imagettfbbox',
+            'imagettftext','imagetypes','imagewbmp','imagexbm','imap_8bit',
+            'imap_alerts','imap_append','imap_base64','imap_binary','imap_body',
+            'imap_bodystruct','imap_check','imap_clearflag_full','imap_close',
+            'imap_create','imap_createmailbox','imap_delete',
+            'imap_deletemailbox','imap_errors','imap_expunge',
+            'imap_fetch_overview','imap_fetchbody','imap_fetchheader',
+            'imap_fetchstructure','imap_fetchtext','imap_get_quota',
+            'imap_get_quotaroot','imap_getacl','imap_getmailboxes',
+            'imap_getsubscribed','imap_header','imap_headerinfo','imap_headers',
+            'imap_last_error','imap_list','imap_listmailbox',
+            'imap_listsubscribed','imap_lsub','imap_mail','imap_mail_compose',
+            'imap_mail_copy','imap_mail_move','imap_mailboxmsginfo',
+            'imap_mime_header_decode','imap_msgno','imap_num_msg',
+            'imap_num_recent','imap_open','imap_ping','imap_qprint',
+            'imap_rename','imap_renamemailbox','imap_reopen',
+            'imap_rfc822_parse_adrlist','imap_rfc822_parse_headers',
+            'imap_rfc822_write_address','imap_savebody','imap_scan',
+            'imap_scanmailbox','imap_search','imap_set_quota','imap_setacl',
+            'imap_setflag_full','imap_sort','imap_status','imap_subscribe',
+            'imap_thread','imap_timeout','imap_uid','imap_undelete',
+            'imap_unsubscribe','imap_utf7_decode','imap_utf7_encode',
+            'imap_utf8','implode','import_request_variables','in_array',
+            'ini_alter','ini_get','ini_get_all','ini_restore','ini_set',
+            'intval','ip2long','iptcembed','iptcparse','isset','is_a',
+            'is_array','is_bool','is_callable','is_dir','is_double',
+            'is_executable','is_file','is_finite','is_float','is_infinite',
+            'is_int','is_integer','is_link','is_long','is_nan','is_null',
+            'is_numeric','is_object','is_readable','is_real','is_resource',
+            'is_scalar','is_soap_fault','is_string','is_subclass_of',
+            'is_uploaded_file','is_writable','is_writeable','iterator_apply',
+            'iterator_count','iterator_to_array','java_last_exception_clear',
+            'java_last_exception_get','jddayofweek','jdmonthname','jdtofrench',
+            'jdtogregorian','jdtojewish','jdtojulian','jdtounix','jewishtojd',
+            'join','jpeg2wbmp','json_decode','json_encode','juliantojd','key',
+            'key_exists','krsort','ksort','lcg_value','ldap_add','ldap_bind',
+            'ldap_close','ldap_compare','ldap_connect','ldap_count_entries',
+            'ldap_delete','ldap_dn2ufn','ldap_err2str','ldap_errno',
+            'ldap_error','ldap_explode_dn','ldap_first_attribute',
+            'ldap_first_entry','ldap_first_reference','ldap_free_result',
+            'ldap_get_attributes','ldap_get_dn','ldap_get_entries',
+            'ldap_get_option','ldap_get_values','ldap_get_values_len',
+            'ldap_list','ldap_mod_add','ldap_mod_del','ldap_mod_replace',
+            'ldap_modify','ldap_next_attribute','ldap_next_entry',
+            'ldap_next_reference','ldap_parse_reference','ldap_parse_result',
+            'ldap_read','ldap_rename','ldap_search','ldap_set_option',
+            'ldap_sort','ldap_start_tls','ldap_unbind','levenshtein',
+            'libxml_clear_errors','libxml_get_errors','libxml_get_last_error',
+            'libxml_set_streams_context','libxml_use_internal_errors','link',
+            'linkinfo','list','localeconv','localtime','log','log1p','log10',
+            'long2ip','lstat','ltrim','lzf_compress','lzf_decompress',
+            'lzf_optimized_for','magic_quotes_runtime','mail','max','mbereg',
+            'mberegi','mberegi_replace','mbereg_match','mbereg_replace',
+            'mbereg_search','mbereg_search_getpos','mbereg_search_getregs',
+            'mbereg_search_init','mbereg_search_pos','mbereg_search_regs',
+            'mbereg_search_setpos','mbregex_encoding','mbsplit','mbstrcut',
+            'mbstrlen','mbstrpos','mbstrrpos','mbsubstr','mb_check_encoding',
+            'mb_convert_case','mb_convert_encoding','mb_convert_kana',
+            'mb_convert_variables','mb_decode_mimeheader',
+            'mb_decode_numericentity','mb_detect_encoding','mb_detect_order',
+            'mb_encode_mimeheader','mb_encode_numericentity','mb_ereg',
+            'mb_eregi','mb_eregi_replace','mb_ereg_match','mb_ereg_replace',
+            'mb_ereg_search','mb_ereg_search_getpos','mb_ereg_search_getregs',
+            'mb_ereg_search_init','mb_ereg_search_pos','mb_ereg_search_regs',
+            'mb_ereg_search_setpos','mb_get_info','mb_http_input',
+            'mb_http_output','mb_internal_encoding','mb_language',
+            'mb_list_encodings','mb_output_handler','mb_parse_str',
+            'mb_preferred_mime_name','mb_regex_encoding','mb_regex_set_options',
+            'mb_send_mail','mb_split','mb_strcut','mb_strimwidth','mb_stripos',
+            'mb_stristr','mb_strlen','mb_strpos','mb_strrchr','mb_strrichr',
+            'mb_strripos','mb_strrpos','mb_strstr','mb_strtolower',
+            'mb_strtoupper','mb_strwidth','mb_substitute_character','mb_substr',
+            'mb_substr_count','mcrypt_cbc','mcrypt_cfb','mcrypt_create_iv',
+            'mcrypt_decrypt','mcrypt_ecb','mcrypt_enc_get_algorithms_name',
+            'mcrypt_enc_get_block_size','mcrypt_enc_get_iv_size',
+            'mcrypt_enc_get_key_size','mcrypt_enc_get_modes_name',
+            'mcrypt_enc_get_supported_key_sizes',
+            'mcrypt_enc_is_block_algorithm',
+            'mcrypt_enc_is_block_algorithm_mode','mcrypt_enc_is_block_mode',
+            'mcrypt_enc_self_test','mcrypt_encrypt','mcrypt_generic',
+            'mcrypt_generic_deinit','mcrypt_generic_end','mcrypt_generic_init',
+            'mcrypt_get_block_size','mcrypt_get_cipher_name',
+            'mcrypt_get_iv_size','mcrypt_get_key_size','mcrypt_list_algorithms',
+            'mcrypt_list_modes','mcrypt_module_close',
+            'mcrypt_module_get_algo_block_size',
+            'mcrypt_module_get_algo_key_size',
+            'mcrypt_module_get_supported_key_sizes',
+            'mcrypt_module_is_block_algorithm',
+            'mcrypt_module_is_block_algorithm_mode',
+            'mcrypt_module_is_block_mode','mcrypt_module_open',
+            'mcrypt_module_self_test','mcrypt_ofb','md5','md5_file',
+            'mdecrypt_generic','memcache_add','memcache_add_server',
+            'memcache_close','memcache_connect','memcache_debug',
+            'memcache_decrement','memcache_delete','memcache_flush',
+            'memcache_get','memcache_get_extended_stats',
+            'memcache_get_server_status','memcache_get_stats',
+            'memcache_get_version','memcache_increment','memcache_pconnect',
+            'memcache_replace','memcache_set','memcache_set_compress_threshold',
+            'memcache_set_server_params','memory_get_peak_usage',
+            'memory_get_usage','metaphone','mhash','mhash_count',
+            'mhash_get_block_size','mhash_get_hash_name','mhash_keygen_s2k',
+            'method_exists','microtime','mime_content_type','min',
+            'ming_keypress','ming_setcubicthreshold','ming_setscale',
+            'ming_useconstants','ming_useswfversion','mkdir','mktime',
+            'money_format','move_uploaded_file','msql','msql_affected_rows',
+            'msql_close','msql_connect','msql_create_db','msql_createdb',
+            'msql_data_seek','msql_db_query','msql_dbname','msql_drop_db',
+            'msql_dropdb','msql_error','msql_fetch_array','msql_fetch_field',
+            'msql_fetch_object','msql_fetch_row','msql_field_flags',
+            'msql_field_len','msql_field_name','msql_field_seek',
+            'msql_field_table','msql_field_type','msql_fieldflags',
+            'msql_fieldlen','msql_fieldname','msql_fieldtable','msql_fieldtype',
+            'msql_free_result','msql_freeresult','msql_list_dbs',
+            'msql_list_fields','msql_list_tables','msql_listdbs',
+            'msql_listfields','msql_listtables','msql_num_fields',
+            'msql_num_rows','msql_numfields','msql_numrows','msql_pconnect',
+            'msql_query','msql_regcase','msql_result','msql_select_db',
+            'msql_selectdb','msql_tablename','mssql_bind','mssql_close',
+            'mssql_connect','mssql_data_seek','mssql_execute',
+            'mssql_fetch_array','mssql_fetch_assoc','mssql_fetch_batch',
+            'mssql_fetch_field','mssql_fetch_object','mssql_fetch_row',
+            'mssql_field_length','mssql_field_name','mssql_field_seek',
+            'mssql_field_type','mssql_free_result','mssql_free_statement',
+            'mssql_get_last_message','mssql_guid_string','mssql_init',
+            'mssql_min_error_severity','mssql_min_message_severity',
+            'mssql_next_result','mssql_num_fields','mssql_num_rows',
+            'mssql_pconnect','mssql_query','mssql_result','mssql_rows_affected',
+            'mssql_select_db','mt_getrandmax','mt_rand','mt_srand','mysql',
+            'mysql_affected_rows','mysql_client_encoding','mysql_close',
+            'mysql_connect','mysql_createdb','mysql_create_db',
+            'mysql_data_seek','mysql_dbname','mysql_db_name','mysql_db_query',
+            'mysql_dropdb','mysql_drop_db','mysql_errno','mysql_error',
+            'mysql_escape_string','mysql_fetch_array','mysql_fetch_assoc',
+            'mysql_fetch_field','mysql_fetch_lengths','mysql_fetch_object',
+            'mysql_fetch_row','mysql_fieldflags','mysql_fieldlen',
+            'mysql_fieldname','mysql_fieldtable','mysql_fieldtype',
+            'mysql_field_flags','mysql_field_len','mysql_field_name',
+            'mysql_field_seek','mysql_field_table','mysql_field_type',
+            'mysql_freeresult','mysql_free_result','mysql_get_client_info',
+            'mysql_get_host_info','mysql_get_proto_info',
+            'mysql_get_server_info','mysql_info','mysql_insert_id',
+            'mysql_listdbs','mysql_listfields','mysql_listtables',
+            'mysql_list_dbs','mysql_list_fields','mysql_list_processes',
+            'mysql_list_tables','mysql_numfields','mysql_numrows',
+            'mysql_num_fields','mysql_num_rows','mysql_pconnect','mysql_ping',
+            'mysql_query','mysql_real_escape_string','mysql_result',
+            'mysql_selectdb','mysql_select_db','mysql_set_charset','mysql_stat',
+            'mysql_tablename','mysql_table_name','mysql_thread_id',
+            'mysql_unbuffered_query','mysqli_affected_rows','mysqli_autocommit',
+            'mysqli_bind_param','mysqli_bind_result','mysqli_change_user',
+            'mysqli_character_set_name','mysqli_client_encoding','mysqli_close',
+            'mysqli_commit','mysqli_connect','mysqli_connect_errno',
+            'mysqli_connect_error','mysqli_data_seek','mysqli_debug',
+            'mysqli_disable_reads_from_master','mysqli_disable_rpl_parse',
+            'mysqli_dump_debug_info','mysqli_embedded_server_end',
+            'mysqli_embedded_server_start','mysqli_enable_reads_from_master',
+            'mysqli_enable_rpl_parse','mysqli_errno','mysqli_error',
+            'mysqli_escape_string','mysqli_execute','mysqli_fetch',
+            'mysqli_fetch_array','mysqli_fetch_assoc','mysqli_fetch_field',
+            'mysqli_fetch_field_direct','mysqli_fetch_fields',
+            'mysqli_fetch_lengths','mysqli_fetch_object','mysqli_fetch_row',
+            'mysqli_field_count','mysqli_field_seek','mysqli_field_tell',
+            'mysqli_free_result','mysqli_get_charset','mysqli_get_client_info',
+            'mysqli_get_client_version','mysqli_get_host_info',
+            'mysqli_get_metadata','mysqli_get_proto_info',
+            'mysqli_get_server_info','mysqli_get_server_version',
+            'mysqli_get_warnings','mysqli_info','mysqli_init',
+            'mysqli_insert_id','mysqli_kill','mysqli_master_query',
+            'mysqli_more_results','mysqli_multi_query','mysqli_next_result',
+            'mysqli_num_fields','mysqli_num_rows','mysqli_options',
+            'mysqli_param_count','mysqli_ping','mysqli_prepare','mysqli_query',
+            'mysqli_real_connect','mysqli_real_escape_string',
+            'mysqli_real_query','mysqli_report','mysqli_rollback',
+            'mysqli_rpl_parse_enabled','mysqli_rpl_probe',
+            'mysqli_rpl_query_type','mysqli_select_db','mysqli_send_long_data',
+            'mysqli_send_query','mysqli_set_charset',
+            'mysqli_set_local_infile_default','mysqli_set_local_infile_handler',
+            'mysqli_set_opt','mysqli_slave_query','mysqli_sqlstate',
+            'mysqli_ssl_set','mysqli_stat','mysqli_stmt_affected_rows',
+            'mysqli_stmt_attr_get','mysqli_stmt_attr_set',
+            'mysqli_stmt_bind_param','mysqli_stmt_bind_result',
+            'mysqli_stmt_close','mysqli_stmt_data_seek','mysqli_stmt_errno',
+            'mysqli_stmt_error','mysqli_stmt_execute','mysqli_stmt_fetch',
+            'mysqli_stmt_field_count','mysqli_stmt_free_result',
+            'mysqli_stmt_get_warnings','mysqli_stmt_init',
+            'mysqli_stmt_insert_id','mysqli_stmt_num_rows',
+            'mysqli_stmt_param_count','mysqli_stmt_prepare','mysqli_stmt_reset',
+            'mysqli_stmt_result_metadata','mysqli_stmt_send_long_data',
+            'mysqli_stmt_sqlstate','mysqli_stmt_store_result',
+            'mysqli_store_result','mysqli_thread_id','mysqli_thread_safe',
+            'mysqli_use_result','mysqli_warning_count','natcasesort','natsort',
+            'new_xmldoc','next','ngettext','nl2br','nl_langinfo',
+            'ntuser_getdomaincontroller','ntuser_getusergroups',
+            'ntuser_getuserinfo','ntuser_getuserlist','number_format',
+            'ob_clean','ob_deflatehandler','ob_end_clean','ob_end_flush',
+            'ob_etaghandler','ob_flush','ob_get_clean','ob_get_contents',
+            'ob_get_flush','ob_get_length','ob_get_level','ob_get_status',
+            'ob_gzhandler','ob_iconv_handler','ob_implicit_flush',
+            'ob_inflatehandler','ob_list_handlers','ob_start','ob_tidyhandler',
+            'octdec','odbc_autocommit','odbc_binmode','odbc_close',
+            'odbc_close_all','odbc_columnprivileges','odbc_columns',
+            'odbc_commit','odbc_connect','odbc_cursor','odbc_data_source',
+            'odbc_do','odbc_error','odbc_errormsg','odbc_exec','odbc_execute',
+            'odbc_fetch_array','odbc_fetch_into','odbc_fetch_object',
+            'odbc_fetch_row','odbc_field_len','odbc_field_name',
+            'odbc_field_num','odbc_field_precision','odbc_field_scale',
+            'odbc_field_type','odbc_foreignkeys','odbc_free_result',
+            'odbc_gettypeinfo','odbc_longreadlen','odbc_next_result',
+            'odbc_num_fields','odbc_num_rows','odbc_pconnect','odbc_prepare',
+            'odbc_primarykeys','odbc_procedurecolumns','odbc_procedures',
+            'odbc_result','odbc_result_all','odbc_rollback','odbc_setoption',
+            'odbc_specialcolumns','odbc_statistics','odbc_tableprivileges',
+            'odbc_tables','opendir','openlog','openssl_csr_export',
+            'openssl_csr_export_to_file','openssl_csr_get_public_key',
+            'openssl_csr_get_subject','openssl_csr_new','openssl_csr_sign',
+            'openssl_error_string','openssl_free_key','openssl_get_privatekey',
+            'openssl_get_publickey','openssl_open','openssl_pkcs12_export',
+            'openssl_pkcs12_export_to_file','openssl_pkcs12_read',
+            'openssl_pkcs7_decrypt','openssl_pkcs7_encrypt',
+            'openssl_pkcs7_sign','openssl_pkcs7_verify','openssl_pkey_export',
+            'openssl_pkey_export_to_file','openssl_pkey_free',
+            'openssl_pkey_get_details','openssl_pkey_get_private',
+            'openssl_pkey_get_public','openssl_pkey_new',
+            'openssl_private_decrypt','openssl_private_encrypt',
+            'openssl_public_decrypt','openssl_public_encrypt','openssl_seal',
+            'openssl_sign','openssl_verify','openssl_x509_checkpurpose',
+            'openssl_x509_check_private_key','openssl_x509_export',
+            'openssl_x509_export_to_file','openssl_x509_free',
+            'openssl_x509_parse','openssl_x509_read','ord',
+            'output_add_rewrite_var','output_reset_rewrite_vars','overload',
+            'outputdebugstring','pack','parse_ini_file','parse_str','parse_url',
+            'parsekit_compile_file','parsekit_compile_string',
+            'parsekit_func_arginfo','parsekit_opcode_flags',
+            'parsekit_opcode_name','passthru','pathinfo','pclose',
+            'pdf_add_bookmark','pdf_add_launchlink','pdf_add_locallink',
+            'pdf_add_nameddest','pdf_add_note','pdf_add_pdflink',
+            'pdf_add_thumbnail','pdf_add_weblink','pdf_arc','pdf_arcn',
+            'pdf_attach_file','pdf_begin_font','pdf_begin_glyph',
+            'pdf_begin_page','pdf_begin_pattern','pdf_begin_template',
+            'pdf_circle','pdf_clip','pdf_close','pdf_close_image',
+            'pdf_close_pdi','pdf_close_pdi_page','pdf_closepath',
+            'pdf_closepath_fill_stroke','pdf_closepath_stroke','pdf_concat',
+            'pdf_continue_text','pdf_create_gstate','pdf_create_pvf',
+            'pdf_curveto','pdf_delete','pdf_delete_pvf','pdf_encoding_set_char',
+            'pdf_end_font','pdf_end_glyph','pdf_end_page','pdf_end_pattern',
+            'pdf_end_template','pdf_endpath','pdf_fill','pdf_fill_imageblock',
+            'pdf_fill_pdfblock','pdf_fill_stroke','pdf_fill_textblock',
+            'pdf_findfont','pdf_fit_image','pdf_fit_pdi_page',
+            'pdf_fit_textline','pdf_get_apiname','pdf_get_buffer',
+            'pdf_get_errmsg','pdf_get_errnum','pdf_get_parameter',
+            'pdf_get_pdi_parameter','pdf_get_pdi_value','pdf_get_value',
+            'pdf_initgraphics','pdf_lineto','pdf_load_font',
+            'pdf_load_iccprofile','pdf_load_image','pdf_makespotcolor',
+            'pdf_moveto','pdf_new','pdf_open_ccitt','pdf_open_file',
+            'pdf_open_image','pdf_open_image_file','pdf_open_pdi',
+            'pdf_open_pdi_page','pdf_place_image','pdf_place_pdi_page',
+            'pdf_process_pdi','pdf_rect','pdf_restore','pdf_rotate','pdf_save',
+            'pdf_scale','pdf_set_border_color','pdf_set_border_dash',
+            'pdf_set_border_style','pdf_set_gstate','pdf_set_info',
+            'pdf_set_parameter','pdf_set_text_pos','pdf_set_value',
+            'pdf_setcolor','pdf_setdash','pdf_setdashpattern','pdf_setflat',
+            'pdf_setfont','pdf_setlinecap','pdf_setlinejoin','pdf_setlinewidth',
+            'pdf_setmatrix','pdf_setmiterlimit','pdf_setpolydash','pdf_shading',
+            'pdf_shading_pattern','pdf_shfill','pdf_show','pdf_show_boxed',
+            'pdf_show_xy','pdf_skew','pdf_stringwidth','pdf_stroke',
+            'pdf_translate','pdo_drivers','pfsockopen','pg_affected_rows',
+            'pg_cancel_query','pg_clientencoding','pg_client_encoding',
+            'pg_close','pg_cmdtuples','pg_connect','pg_connection_busy',
+            'pg_connection_reset','pg_connection_status','pg_convert',
+            'pg_copy_from','pg_copy_to','pg_dbname','pg_delete','pg_end_copy',
+            'pg_errormessage','pg_escape_bytea','pg_escape_string','pg_exec',
+            'pg_execute','pg_fetch_all','pg_fetch_all_columns','pg_fetch_array',
+            'pg_fetch_assoc','pg_fetch_object','pg_fetch_result','pg_fetch_row',
+            'pg_fieldisnull','pg_fieldname','pg_fieldnum','pg_fieldprtlen',
+            'pg_fieldsize','pg_fieldtype','pg_field_is_null','pg_field_name',
+            'pg_field_num','pg_field_prtlen','pg_field_size','pg_field_table',
+            'pg_field_type','pg_field_type_oid','pg_free_result',
+            'pg_freeresult','pg_get_notify','pg_get_pid','pg_get_result',
+            'pg_getlastoid','pg_host','pg_insert','pg_last_error',
+            'pg_last_notice','pg_last_oid','pg_loclose','pg_locreate',
+            'pg_loexport','pg_loimport','pg_loopen','pg_loread','pg_loreadall',
+            'pg_lounlink','pg_lowrite','pg_lo_close','pg_lo_create',
+            'pg_lo_export','pg_lo_import','pg_lo_open','pg_lo_read',
+            'pg_lo_read_all','pg_lo_seek','pg_lo_tell','pg_lo_unlink',
+            'pg_lo_write','pg_meta_data','pg_numfields','pg_numrows',
+            'pg_num_fields','pg_num_rows','pg_options','pg_parameter_status',
+            'pg_pconnect','pg_ping','pg_port','pg_prepare','pg_put_line',
+            'pg_query','pg_query_params','pg_result','pg_result_error',
+            'pg_result_error_field','pg_result_seek','pg_result_status',
+            'pg_select','pg_send_execute','pg_send_prepare','pg_send_query',
+            'pg_send_query_params','pg_set_client_encoding',
+            'pg_set_error_verbosity','pg_setclientencoding','pg_trace',
+            'pg_transaction_status','pg_tty','pg_unescape_bytea','pg_untrace',
+            'pg_update','pg_version','php_egg_logo_guid','php_ini_loaded_file',
+            'php_ini_scanned_files','php_logo_guid','php_real_logo_guid',
+            'php_sapi_name','php_strip_whitespace','php_uname','phpcredits',
+            'phpdoc_xml_from_string','phpinfo','phpversion','pi','png2wbmp',
+            'pop3_close','pop3_delete_message','pop3_get_account_size',
+            'pop3_get_message','pop3_get_message_count',
+            'pop3_get_message_header','pop3_get_message_ids',
+            'pop3_get_message_size','pop3_get_message_sizes','pop3_open',
+            'pop3_undelete','popen','pos','posix_ctermid','posix_errno',
+            'posix_getcwd','posix_getegid','posix_geteuid','posix_getgid',
+            'posix_getgrgid','posix_getgrnam','posix_getgroups',
+            'posix_getlogin','posix_getpgid','posix_getpgrp','posix_getpid',
+            'posix_getppid','posix_getpwnam','posix_getpwuid','posix_getrlimit',
+            'posix_getsid','posix_getuid','posix_get_last_error','posix_isatty',
+            'posix_kill','posix_mkfifo','posix_setegid','posix_seteuid',
+            'posix_setgid','posix_setpgid','posix_setsid','posix_setuid',
+            'posix_strerror','posix_times','posix_ttyname','posix_uname','pow',
+            'preg_grep','preg_last_error','preg_match','preg_match_all',
+            'preg_quote','preg_replace','preg_replace_callback','preg_split',
+            'prev','print_r','printf','proc_close','proc_get_status',
+            'proc_open','proc_terminate','putenv','quoted_printable_decode',
+            'quotemeta','rad2deg','radius_acct_open','radius_add_server',
+            'radius_auth_open','radius_close','radius_config',
+            'radius_create_request','radius_cvt_addr','radius_cvt_int',
+            'radius_cvt_string','radius_demangle','radius_demangle_mppe_key',
+            'radius_get_attr','radius_get_vendor_attr','radius_put_addr',
+            'radius_put_attr','radius_put_int','radius_put_string',
+            'radius_put_vendor_addr','radius_put_vendor_attr',
+            'radius_put_vendor_int','radius_put_vendor_string',
+            'radius_request_authenticator','radius_send_request',
+            'radius_server_secret','radius_strerror','rand','range',
+            'rawurldecode','rawurlencode','read_exif_data','readdir','readfile',
+            'readgzfile','readlink','realpath','reg_close_key','reg_create_key',
+            'reg_enum_key','reg_enum_value','reg_get_value','reg_open_key',
+            'reg_set_value','register_shutdown_function',
+            'register_tick_function','rename','res_close','res_get','res_list',
+            'res_list_type','res_open','res_set','reset',
+            'restore_error_handler','restore_include_path','rewind','rewinddir',
+            'rmdir','round','rsort','rtrim','runkit_class_adopt',
+            'runkit_class_emancipate','runkit_constant_add',
+            'runkit_constant_redefine','runkit_constant_remove',
+            'runkit_default_property_add','runkit_function_add',
+            'runkit_function_copy','runkit_function_redefine',
+            'runkit_function_remove','runkit_function_rename','runkit_import',
+            'runkit_lint','runkit_lint_file','runkit_method_add',
+            'runkit_method_copy','runkit_method_redefine',
+            'runkit_method_remove','runkit_method_rename','runkit_object_id',
+            'runkit_return_value_used','runkit_sandbox_output_handler',
+            'runkit_superglobals','runkit_zval_inspect','scandir','sem_acquire',
+            'sem_get','sem_release','sem_remove','serialize',
+            'session_cache_expire','session_cache_limiter','session_commit',
+            'session_decode','session_destroy','session_encode',
+            'session_get_cookie_params','session_id','session_is_registered',
+            'session_module_name','session_name','session_regenerate_id',
+            'session_register','session_save_path','session_set_cookie_params',
+            'session_set_save_handler','session_start','session_unregister',
+            'session_unset','session_write_close','set_content',
+            'set_error_handler','set_file_buffer','set_include_path',
+            'set_magic_quotes_runtime','set_socket_blocking','set_time_limit',
+            'setcookie','setlocale','setrawcookie','settype','sha1','sha1_file',
+            'shell_exec','shmop_close','shmop_delete','shmop_open','shmop_read',
+            'shmop_size','shmop_write','shm_attach','shm_detach','shm_get_var',
+            'shm_put_var','shm_remove','shm_remove_var','show_source','shuffle',
+            'similar_text','simplexml_import_dom','simplexml_load_file',
+            'simplexml_load_string','sin','sinh','sizeof','sleep','smtp_close',
+            'smtp_cmd_data','smtp_cmd_mail','smtp_cmd_rcpt','smtp_connect',
+            'snmp_get_quick_print','snmp_get_valueretrieval','snmp_read_mib',
+            'snmp_set_quick_print','snmp_set_valueretrieval','snmp2_get',
+            'snmp2_getnext','snmp2_real_walk','snmp2_set','snmp2_walk',
+            'snmp3_get','snmp3_getnext','snmp3_real_walk','snmp3_set',
+            'snmp3_walk','snmpget','snmpgetnext','snmprealwalk','snmpset',
+            'snmpwalk','snmpwalkoid','socket_accept','socket_bind',
+            'socket_clear_error','socket_close','socket_connect',
+            'socket_create','socket_create_listen','socket_create_pair',
+            'socket_getopt','socket_getpeername','socket_getsockname',
+            'socket_get_option','socket_get_status','socket_iovec_add',
+            'socket_iovec_alloc','socket_iovec_delete','socket_iovec_fetch',
+            'socket_iovec_free','socket_iovec_set','socket_last_error',
+            'socket_listen','socket_read','socket_readv','socket_recv',
+            'socket_recvfrom','socket_recvmsg','socket_select','socket_send',
+            'socket_sendmsg','socket_sendto','socket_setopt','socket_set_block',
+            'socket_set_blocking','socket_set_nonblock','socket_set_option',
+            'socket_set_timeout','socket_shutdown','socket_strerror',
+            'socket_write','socket_writev','sort','soundex','spl_autoload',
+            'spl_autoload_call','spl_autoload_extensions',
+            'spl_autoload_functions','spl_autoload_register',
+            'spl_autoload_unregister','spl_classes','spl_object_hash','split',
+            'spliti','sprintf','sql_regcase','sqlite_array_query',
+            'sqlite_busy_timeout','sqlite_changes','sqlite_close',
+            'sqlite_column','sqlite_create_aggregate','sqlite_create_function',
+            'sqlite_current','sqlite_error_string','sqlite_escape_string',
+            'sqlite_exec','sqlite_factory','sqlite_fetch_all',
+            'sqlite_fetch_array','sqlite_fetch_column_types',
+            'sqlite_fetch_object','sqlite_fetch_single','sqlite_fetch_string',
+            'sqlite_field_name','sqlite_has_more','sqlite_has_prev',
+            'sqlite_last_error','sqlite_last_insert_rowid','sqlite_libencoding',
+            'sqlite_libversion','sqlite_next','sqlite_num_fields',
+            'sqlite_num_rows','sqlite_open','sqlite_popen','sqlite_prev',
+            'sqlite_query','sqlite_rewind','sqlite_seek','sqlite_single_query',
+            'sqlite_udf_decode_binary','sqlite_udf_encode_binary',
+            'sqlite_unbuffered_query','sqlite_valid','sqrt','srand','sscanf',
+            'ssh2_auth_hostbased_file','ssh2_auth_none','ssh2_auth_password',
+            'ssh2_auth_pubkey_file','ssh2_connect','ssh2_exec',
+            'ssh2_fetch_stream','ssh2_fingerprint','ssh2_forward_accept',
+            'ssh2_forward_listen','ssh2_methods_negotiated','ssh2_poll',
+            'ssh2_publickey_add','ssh2_publickey_init','ssh2_publickey_list',
+            'ssh2_publickey_remove','ssh2_scp_recv','ssh2_scp_send','ssh2_sftp',
+            'ssh2_sftp_lstat','ssh2_sftp_mkdir','ssh2_sftp_readlink',
+            'ssh2_sftp_realpath','ssh2_sftp_rename','ssh2_sftp_rmdir',
+            'ssh2_sftp_stat','ssh2_sftp_symlink','ssh2_sftp_unlink',
+            'ssh2_shell','ssh2_tunnel','stat','stats_absolute_deviation',
+            'stats_cdf_beta','stats_cdf_binomial','stats_cdf_cauchy',
+            'stats_cdf_chisquare','stats_cdf_exponential','stats_cdf_f',
+            'stats_cdf_gamma','stats_cdf_laplace','stats_cdf_logistic',
+            'stats_cdf_negative_binomial','stats_cdf_noncentral_chisquare',
+            'stats_cdf_noncentral_f','stats_cdf_noncentral_t',
+            'stats_cdf_normal','stats_cdf_poisson','stats_cdf_t',
+            'stats_cdf_uniform','stats_cdf_weibull','stats_covariance',
+            'stats_dens_beta','stats_dens_cauchy','stats_dens_chisquare',
+            'stats_dens_exponential','stats_dens_f','stats_dens_gamma',
+            'stats_dens_laplace','stats_dens_logistic','stats_dens_normal',
+            'stats_dens_pmf_binomial','stats_dens_pmf_hypergeometric',
+            'stats_dens_pmf_negative_binomial','stats_dens_pmf_poisson',
+            'stats_dens_t','stats_dens_uniform','stats_dens_weibull',
+            'stats_harmonic_mean','stats_kurtosis','stats_rand_gen_beta',
+            'stats_rand_gen_chisquare','stats_rand_gen_exponential',
+            'stats_rand_gen_f','stats_rand_gen_funiform','stats_rand_gen_gamma',
+            'stats_rand_gen_ipoisson','stats_rand_gen_iuniform',
+            'stats_rand_gen_noncenral_f','stats_rand_gen_noncentral_chisquare',
+            'stats_rand_gen_noncentral_t','stats_rand_gen_normal',
+            'stats_rand_gen_t','stats_rand_getsd','stats_rand_ibinomial',
+            'stats_rand_ibinomial_negative','stats_rand_ignlgi',
+            'stats_rand_phrase_to_seeds','stats_rand_ranf','stats_rand_setall',
+            'stats_skew','stats_standard_deviation','stats_stat_binomial_coef',
+            'stats_stat_correlation','stats_stat_factorial',
+            'stats_stat_independent_t','stats_stat_innerproduct',
+            'stats_stat_paired_t','stats_stat_percentile','stats_stat_powersum',
+            'stats_variance','strcasecmp','strchr','strcmp','strcoll','strcspn',
+            'stream_bucket_append','stream_bucket_make_writeable',
+            'stream_bucket_new','stream_bucket_prepend','stream_context_create',
+            'stream_context_get_default','stream_context_get_options',
+            'stream_context_set_default','stream_context_set_option',
+            'stream_context_set_params','stream_copy_to_stream',
+            'stream_encoding','stream_filter_append','stream_filter_prepend',
+            'stream_filter_register','stream_filter_remove',
+            'stream_get_contents','stream_get_filters','stream_get_line',
+            'stream_get_meta_data','stream_get_transports',
+            'stream_get_wrappers','stream_is_local',
+            'stream_notification_callback','stream_register_wrapper',
+            'stream_resolve_include_path','stream_select','stream_set_blocking',
+            'stream_set_timeout','stream_set_write_buffer',
+            'stream_socket_accept','stream_socket_client',
+            'stream_socket_enable_crypto','stream_socket_get_name',
+            'stream_socket_pair','stream_socket_recvfrom',
+            'stream_socket_sendto','stream_socket_server',
+            'stream_socket_shutdown','stream_supports_lock',
+            'stream_wrapper_register','stream_wrapper_restore',
+            'stream_wrapper_unregister','strftime','stripcslashes','stripos',
+            'stripslashes','strip_tags','stristr','strlen','strnatcasecmp',
+            'strnatcmp','strpbrk','strncasecmp','strncmp','strpos','strrchr',
+            'strrev','strripos','strrpos','strspn','strstr','strtok',
+            'strtolower','strtotime','strtoupper','strtr','strval',
+            'str_ireplace','str_pad','str_repeat','str_replace','str_rot13',
+            'str_split','str_shuffle','str_word_count','substr',
+            'substr_compare','substr_count','substr_replace','svn_add',
+            'svn_auth_get_parameter','svn_auth_set_parameter','svn_cat',
+            'svn_checkout','svn_cleanup','svn_client_version','svn_commit',
+            'svn_diff','svn_export','svn_fs_abort_txn','svn_fs_apply_text',
+            'svn_fs_begin_txn2','svn_fs_change_node_prop','svn_fs_check_path',
+            'svn_fs_contents_changed','svn_fs_copy','svn_fs_delete',
+            'svn_fs_dir_entries','svn_fs_file_contents','svn_fs_file_length',
+            'svn_fs_is_dir','svn_fs_is_file','svn_fs_make_dir',
+            'svn_fs_make_file','svn_fs_node_created_rev','svn_fs_node_prop',
+            'svn_fs_props_changed','svn_fs_revision_prop',
+            'svn_fs_revision_root','svn_fs_txn_root','svn_fs_youngest_rev',
+            'svn_import','svn_info','svn_log','svn_ls','svn_repos_create',
+            'svn_repos_fs','svn_repos_fs_begin_txn_for_commit',
+            'svn_repos_fs_commit_txn','svn_repos_hotcopy','svn_repos_open',
+            'svn_repos_recover','svn_status','svn_update','symlink',
+            'sys_get_temp_dir','syslog','system','tan','tanh','tempnam',
+            'textdomain','thread_get','thread_include','thread_lock',
+            'thread_lock_try','thread_mutex_destroy','thread_mutex_init',
+            'thread_set','thread_start','thread_unlock','tidy_access_count',
+            'tidy_clean_repair','tidy_config_count','tidy_diagnose',
+            'tidy_error_count','tidy_get_body','tidy_get_config',
+            'tidy_get_error_buffer','tidy_get_head','tidy_get_html',
+            'tidy_get_html_ver','tidy_get_output','tidy_get_release',
+            'tidy_get_root','tidy_get_status','tidy_getopt','tidy_is_xhtml',
+            'tidy_is_xml','tidy_parse_file','tidy_parse_string',
+            'tidy_repair_file','tidy_repair_string','tidy_warning_count','time',
+            'timezone_abbreviations_list','timezone_identifiers_list',
+            'timezone_name_from_abbr','timezone_name_get','timezone_offset_get',
+            'timezone_open','timezone_transitions_get','tmpfile',
+            'token_get_all','token_name','touch','trigger_error',
+            'transliterate','transliterate_filters_get','trim','uasort',
+            'ucfirst','ucwords','uksort','umask','uniqid','unixtojd','unlink',
+            'unpack','unregister_tick_function','unserialize','unset',
+            'urldecode','urlencode','user_error','use_soap_error_handler',
+            'usleep','usort','utf8_decode','utf8_encode','var_dump',
+            'var_export','variant_abs','variant_add','variant_and',
+            'variant_cast','variant_cat','variant_cmp',
+            'variant_date_from_timestamp','variant_date_to_timestamp',
+            'variant_div','variant_eqv','variant_fix','variant_get_type',
+            'variant_idiv','variant_imp','variant_int','variant_mod',
+            'variant_mul','variant_neg','variant_not','variant_or',
+            'variant_pow','variant_round','variant_set','variant_set_type',
+            'variant_sub','variant_xor','version_compare','virtual','vfprintf',
+            'vprintf','vsprintf','wddx_add_vars','wddx_deserialize',
+            'wddx_packet_end','wddx_packet_start','wddx_serialize_value',
+            'wddx_serialize_vars','win_beep','win_browse_file',
+            'win_browse_folder','win_create_link','win_message_box',
+            'win_play_wav','win_shell_execute','win32_create_service',
+            'win32_delete_service','win32_get_last_control_message',
+            'win32_ps_list_procs','win32_ps_stat_mem','win32_ps_stat_proc',
+            'win32_query_service_status','win32_scheduler_delete_task',
+            'win32_scheduler_enum_tasks','win32_scheduler_get_task_info',
+            'win32_scheduler_run','win32_scheduler_set_task_info',
+            'win32_set_service_status','win32_start_service',
+            'win32_start_service_ctrl_dispatcher','win32_stop_service',
+            'wordwrap','xml_error_string','xml_get_current_byte_index',
+            'xml_get_current_column_number','xml_get_current_line_number',
+            'xml_get_error_code','xml_parse','xml_parser_create',
+            'xml_parser_create_ns','xml_parser_free','xml_parser_get_option',
+            'xml_parser_set_option','xml_parse_into_struct',
+            'xml_set_character_data_handler','xml_set_default_handler',
+            'xml_set_element_handler','xml_set_end_namespace_decl_handler',
+            'xml_set_external_entity_ref_handler',
+            'xml_set_notation_decl_handler','xml_set_object',
+            'xml_set_processing_instruction_handler',
+            'xml_set_start_namespace_decl_handler',
+            'xml_set_unparsed_entity_decl_handler','xmldoc','xmldocfile',
+            'xmlrpc_decode','xmlrpc_decode_request','xmlrpc_encode',
+            'xmlrpc_encode_request','xmlrpc_get_type','xmlrpc_is_fault',
+            'xmlrpc_parse_method_descriptions',
+            'xmlrpc_server_add_introspection_data','xmlrpc_server_call_method',
+            'xmlrpc_server_create','xmlrpc_server_destroy',
+            'xmlrpc_server_register_introspection_callback',
+            'xmlrpc_server_register_method','xmlrpc_set_type','xmltree',
+            'xmlwriter_end_attribute','xmlwriter_end_cdata',
+            'xmlwriter_end_comment','xmlwriter_end_document',
+            'xmlwriter_end_dtd','xmlwriter_end_dtd_attlist',
+            'xmlwriter_end_dtd_element','xmlwriter_end_dtd_entity',
+            'xmlwriter_end_element','xmlwriter_end_pi','xmlwriter_flush',
+            'xmlwriter_full_end_element','xmlwriter_open_memory',
+            'xmlwriter_open_uri','xmlwriter_output_memory',
+            'xmlwriter_set_indent','xmlwriter_set_indent_string',
+            'xmlwriter_start_attribute','xmlwriter_start_attribute_ns',
+            'xmlwriter_start_cdata','xmlwriter_start_comment',
+            'xmlwriter_start_document','xmlwriter_start_dtd',
+            'xmlwriter_start_dtd_attlist','xmlwriter_start_dtd_element',
+            'xmlwriter_start_dtd_entity','xmlwriter_start_element',
+            'xmlwriter_start_element_ns','xmlwriter_start_pi','xmlwriter_text',
+            'xmlwriter_write_attribute','xmlwriter_write_attribute_ns',
+            'xmlwriter_write_cdata','xmlwriter_write_comment',
+            'xmlwriter_write_dtd','xmlwriter_write_dtd_attlist',
+            'xmlwriter_write_dtd_element','xmlwriter_write_dtd_entity',
+            'xmlwriter_write_element','xmlwriter_write_element_ns',
+            'xmlwriter_write_pi','xmlwriter_write_raw','xpath_eval',
+            'xpath_eval_expression','xpath_new_context','xpath_register_ns',
+            'xpath_register_ns_auto','xptr_eval','xptr_new_context','yp_all',
+            'yp_cat','yp_errno','yp_err_string','yp_first',
+            'yp_get_default_domain','yp_master','yp_match','yp_next','yp_order',
+            'zend_current_obfuscation_level','zend_get_cfg_var','zend_get_id',
+            'zend_loader_current_file','zend_loader_enabled',
+            'zend_loader_file_encoded','zend_loader_file_licensed',
+            'zend_loader_install_license','zend_loader_version',
+            'zend_logo_guid','zend_match_hostmasks','zend_obfuscate_class_name',
+            'zend_obfuscate_function_name','zend_optimizer_version',
+            'zend_runtime_obfuscate','zend_version','zip_close',
+            'zip_entry_close','zip_entry_compressedsize',
+            'zip_entry_compressionmethod','zip_entry_filesize','zip_entry_name',
+            'zip_entry_open','zip_entry_read','zip_open','zip_read',
+            'zlib_get_coding_type'
+            ),
+        4 => array(
+            'DEFAULT_INCLUDE_PATH', 'DIRECTORY_SEPARATOR', 'E_ALL',
+            'E_COMPILE_ERROR', 'E_COMPILE_WARNING', 'E_CORE_ERROR',
+            'E_CORE_WARNING', 'E_ERROR', 'E_NOTICE', 'E_PARSE', 'E_STRICT',
+            'E_USER_ERROR', 'E_USER_NOTICE', 'E_USER_WARNING', 'E_WARNING',
+            'ENT_COMPAT','ENT_QUOTES','ENT_NOQUOTES',
+            'false', 'null', 'PEAR_EXTENSION_DIR', 'PEAR_INSTALL_DIR',
+            'PHP_BINDIR', 'PHP_CONFIG_FILE_PATH', 'PHP_DATADIR',
+            'PHP_EXTENSION_DIR', 'PHP_LIBDIR',
+            'PHP_LOCALSTATEDIR', 'PHP_OS',
+            'PHP_OUTPUT_HANDLER_CONT', 'PHP_OUTPUT_HANDLER_END',
+            'PHP_OUTPUT_HANDLER_START', 'PHP_SYSCONFDIR',
+            'PHP_VERSION', 'true', '__CLASS__', '__FILE__', '__FUNCTION__',
+            '__LINE__', '__METHOD__'
             )
         ),
     'SYMBOLS' => array(
-        '(', ')', '[', ']', '{', '}', '!', '@', '%', '&', '*', '|', '/', '<', '>'
+        1 => array(
+            '<'.'%', '<'.'%=', '%'.'>', '<'.'?', '<'.'?=', '?'.'>'
+            ),
+        0 => array(
+            '(', ')', '[', ']', '{', '}',
+            '!', '@', '%', '&', '|', '/',
+            '<', '>',
+            '=', '-', '+', '*',
+            '.', ':', ',', ';'
+            )
         ),
     'CASE_SENSITIVE' => array(
         GESHI_COMMENTS => false,
         1 => false,
         2 => false,
         3 => false,
+        4 => false
         ),
     'STYLES' => array(
         'KEYWORDS' => array(
             1 => 'color: #b1b100;',
             2 => 'color: #000000; font-weight: bold;',
-            3 => 'color: #000066;'
+            3 => 'color: #990000;',
+            4 => 'color: #009900; font-weight: bold;'
             ),
         'COMMENTS' => array(
-            1 => 'color: #808080; font-style: italic;',
-            2 => 'color: #808080; font-style: italic;',
-            'MULTI' => 'color: #808080; font-style: italic;'
+            1 => 'color: #666666; font-style: italic;',
+            2 => 'color: #666666; font-style: italic;',
+            3 => 'color: #0000cc; font-style: italic;',
+            4 => 'color: #009933; font-style: italic;',
+            'MULTI' => 'color: #666666; font-style: italic;'
             ),
         'ESCAPE_CHAR' => array(
-            0 => 'color: #000099; font-weight: bold;'
+            0 => 'color: #000099; font-weight: bold;',
+            1 => 'color: #000099; font-weight: bold;',
+            2 => 'color: #660099; font-weight: bold;',
+            3 => 'color: #660099; font-weight: bold;',
+            4 => 'color: #006699; font-weight: bold;',
+            5 => 'color: #006699; font-weight: bold; font-style: italic;',
+            6 => 'color: #009933; font-weight: bold;',
+            'HARD' => 'color: #000099; font-weight: bold;'
             ),
         'BRACKETS' => array(
-            0 => 'color: #66cc66;'
+            0 => 'color: #009900;'
             ),
         'STRINGS' => array(
-            0 => 'color: #ff0000;'
+            0 => 'color: #0000ff;',
+            'HARD' => 'color: #0000ff;'
             ),
         'NUMBERS' => array(
-            0 => 'color: #cc66cc;'
+            0 => 'color: #cc66cc;',
+            GESHI_NUMBER_OCT_PREFIX => 'color: #208080;',
+            GESHI_NUMBER_HEX_PREFIX => 'color: #208080;',
+            GESHI_NUMBER_FLT_SCI_ZERO => 'color:#800080;',
             ),
         'METHODS' => array(
-            1 => 'color: #006600;',
-            2 => 'color: #006600;'
+            1 => 'color: #004000;',
+            2 => 'color: #004000;'
             ),
         'SYMBOLS' => array(
-            0 => 'color: #66cc66;'
+            0 => 'color: #339933;',
+            1 => 'color: #000000; font-weight: bold;'
             ),
         'REGEXPS' => array(
-            0 => 'color: #0000ff;',
-            1 => 'color: #ff0000'
+            0 => 'color: #000088;'
             ),
         'SCRIPT' => array(
             0 => '',
             1 => '',
             2 => '',
-            3 => ''
+            3 => '',
+            4 => '',
+            5 => ''
             )
         ),
     'URLS' => array(
         1 => '',
         2 => '',
-        3 => 'http://www.php.net/{FNAME}',
+        3 => 'http://www.php.net/{FNAMEL}',
         4 => ''
         ),
     'OOLANG' => true,
@@ -321,36 +1063,55 @@
         2 => '::'
         ),
     'REGEXPS' => array(
-        0 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*",
-        1 => array(
-            GESHI_SEARCH  => "([a-zA-Z]+)(\n)(.*)(\n)(\\1;?)",
-            GESHI_REPLACE => '\3',
-            GESHI_BEFORE => '\1\2',
-            GESHI_AFTER => '\4\5',
-            GESHI_MODIFIERS => 'siU'
-            )
+        //Variables
+        0 => "[\\$]{1,2}[a-zA-Z_][a-zA-Z0-9_]*"
         ),
     'STRICT_MODE_APPLIES' => GESHI_MAYBE,
     'SCRIPT_DELIMITERS' => array(
         0 => array(
-            '<?php' => '?>'
+            '<'.'?php' => '?'.'>'
             ),
         1 => array(
-            '<?' => '?>'
+            '<'.'?' => '?'.'>'
             ),
         2 => array(
-            '<%' => '%>'
+            '<'.'%' => '%'.'>'
             ),
         3 => array(
             '<script language="php">' => '</script>'
-            )
+            ),
+        4 => "/(?P<start><\\?(?>php\b)?)(?:".
+            "(?>[^\"'?\\/<]+)|".
+            "\\?(?!>)|".
+            "(?>'(?>[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|".
+            "(?>\"(?>[^\"\\\\]|\\\\\"|\\\\\\\\|\\\\)*\")|".
+            "(?>\\/\\*(?>[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|".
+            "\\/\\/(?>.*?$)|".
+            "\\/(?=[^*\\/])|".
+            "<(?!<<)|".
+            "<<<(?P<phpdoc>\w+)\s.*?\s\k<phpdoc>".
+            ")*(?P<end>\\?>|\Z)/sm",
+        5 => "/(?P<start><%)(?:".
+            "(?>[^\"'%\\/<]+)|".
+            "%(?!>)|".
+            "(?>'(?>[^'\\\\]|\\\\'|\\\\\\\|\\\\)*')|".
+            "(?>\"(?>[^\\\"\\\\]|\\\\\"|\\\\\\\\|\\\\)*\")|".
+            "(?>\\/\\*(?>[^\\*]|(?!\\*\\/)\\*)*\\*\\/)|".
+            "\\/\\/(?>.*?$)|".
+            "\\/(?=[^*\\/])|".
+            "<(?!<<)|".
+            "<<<(?P<phpdoc>\w+)\s.*?\s\k<phpdoc>".
+            ")*(?P<end>%>)/sm",
         ),
     'HIGHLIGHT_STRICT_BLOCK' => array(
         0 => true,
         1 => true,
         2 => true,
-        3 => true
-        )
+        3 => true,
+        4 => true,
+        5 => true
+        ),
+    'TAB_WIDTH' => 4
 );
 
-?>
+?>
\ No hay ningún carácter de nueva línea al final del fichero
diff -aruN --binary 22/libraries/geshi/geshi/sql.php 23/libraries/geshi/geshi/sql.php
--- 22/libraries/geshi/geshi/sql.php	2009-05-29 13:54:38.000000000 +0200
+++ 23/libraries/geshi/geshi/sql.php	2011-03-31 18:09:16.000000000 +0200
@@ -1,16 +1,25 @@
 <?php
+// no direct access
+defined('_JEXEC') or die;
+
 /*************************************************************************************
  * sql.php
  * -------
  * Author: Nigel McNie (nigel@geshi.org)
+ * Contributors:
+ *  - JÃ¼rgen Thomas (Juergen.Thomas@vs-polis.de)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter)
- * Release Version: 1.0.7.19
+ * Release Version: 1.0.8.10
  * Date Started: 2004/06/04
  *
  * SQL language file for GeSHi.
  *
  * CHANGES
  * -------
+ * 2010/07/19 (1.0.8.9)
+ *  -  Added many more keywords
+ * 2008/05/23 (1.0.7.22)
+ *  -  Added additional symbols for highlighting
  * 2004/11/27 (1.0.3)
  *  -  Added support for multiple object splitters
  * 2004/10/27 (1.0.2)
@@ -47,91 +56,113 @@
  *
  ************************************************************************************/
 
-defined('GESHI_COMMENTS') or die();
-
 $language_data = array (
-	'LANG_NAME' => 'SQL',
-	'COMMENT_SINGLE' => array(1 =>'--', 2 => '#'),
-	'COMMENT_MULTI' => array('/*' => '*/'),
-	'CASE_KEYWORDS' => 1,
-	'QUOTEMARKS' => array("'", '"', '`'),
-	'ESCAPE_CHAR' => '\\',
-	'KEYWORDS' => array(
-		1 => array(
-			'ALL', 'ASC', 'AS',  'ALTER', 'AND', 'ADD', 'AUTO_INCREMENT',
-			'BETWEEN', 'BINARY', 'BOTH', 'BY', 'BOOLEAN',
-			'CHANGE', 'CHECK', 'COLUMNS', 'COLUMN', 'CROSS','CREATE',
-			'DATABASES', 'DATABASE', 'DATA', 'DELAYED', 'DESCRIBE', 'DESC',  'DISTINCT', 'DELETE', 'DROP', 'DEFAULT',
-			'ENCLOSED', 'ESCAPED', 'EXISTS', 'EXPLAIN',
-			'FIELDS', 'FIELD', 'FLUSH', 'FOR', 'FOREIGN', 'FUNCTION', 'FROM',
-			'GROUP', 'GRANT',
-			'HAVING',
-			'IGNORE', 'INDEX', 'INFILE', 'INSERT', 'INNER', 'INTO', 'IDENTIFIED', 'IN', 'IS', 'IF',
-			'JOIN',
-			'KEYS', 'KILL','KEY',
-			'LEADING', 'LIKE', 'LIMIT', 'LINES', 'LOAD', 'LOCAL', 'LOCK', 'LOW_PRIORITY', 'LEFT', 'LANGUAGE',
-			'MODIFY',
-			'NATURAL', 'NOT', 'NULL', 'NEXTVAL',
-			'OPTIMIZE', 'OPTION', 'OPTIONALLY', 'ORDER', 'OUTFILE', 'OR', 'OUTER', 'ON',
-			'PROCEEDURE','PROCEDURAL', 'PRIMARY',
-			'READ', 'REFERENCES', 'REGEXP', 'RENAME', 'REPLACE', 'RETURN', 'REVOKE', 'RLIKE', 'RIGHT',
-			'SHOW', 'SONAME', 'STATUS', 'STRAIGHT_JOIN', 'SELECT', 'SETVAL', 'SET',
-			'TABLES', 'TEMINATED', 'TO', 'TRAILING','TRUNCATE', 'TABLE', 'TEMPORARY', 'TRIGGER', 'TRUSTED',
-			'UNIQUE', 'UNLOCK', 'USE', 'USING', 'UPDATE', 'UNSIGNED',
-			'VALUES', 'VARIABLES', 'VIEW',
-			'WITH', 'WRITE', 'WHERE',
-			'ZEROFILL',
-			'XOR',
-			)
-		),
-	'SYMBOLS' => array(
-		'(', ')', '=', '<', '>', '|'
-		),
-	'CASE_SENSITIVE' => array(
-		GESHI_COMMENTS => false,
-		1 => false
-		),
-	'STYLES' => array(
-		'KEYWORDS' => array(
-			1 => 'color: #993333; font-weight: bold;'
-			),
-		'COMMENTS' => array(
-			1 => 'color: #808080; font-style: italic;',
-			2 => 'color: #808080; font-style: italic;',
+    'LANG_NAME' => 'SQL',
+    'COMMENT_SINGLE' => array(1 =>'--'),
+    'COMMENT_MULTI' => array('/*' => '*/'),
+    'CASE_KEYWORDS' => 1,
+    'QUOTEMARKS' => array("'", '"', '`'),
+    'ESCAPE_CHAR' => '\\',
+    'KEYWORDS' => array(
+        1 => array(
+            'ADD', 'ALL', 'ALTER', 'AND', 'AS', 'ASC', 'AUTO_INCREMENT',
+            'BEFORE', 'BEGIN', 'BETWEEN', 'BIGINT', 'BINARY', 'BLOB', 'BOOLEAN', 'BOTH', 'BY',
+            'CALL', 'CASE', 'CAST', 'CEIL', 'CEILING', 'CHANGE', 'CHAR', 'CHAR_LENGTH', 'CHARACTER',
+            'CHARACTER_LENGTH', 'CHECK', 'CLOB', 'COALESCE', 'COLLATE', 'COLUMN', 'COLUMNS',
+            'CONNECT', 'CONSTRAINT', 'CONVERT', 'COUNT', 'CREATE', 'CROSS', 'CURRENT',
+            'CURRENT_DATE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP', 'CURRENT_USER',
+            'DATA', 'DATABASE', 'DATABASES', 'DATE', 'DAY', 'DEC', 'DECIMAL', 'DECLARE',
+            'DEFAULT', 'DELAYED', 'DELETE', 'DESC', 'DESCRIBE', 'DISTINCT', 'DOUBLE',
+            'DOMAIN', 'DROP',
+            'ELSE', 'ENCLOSED', 'END', 'ESCAPED', 'EXCEPT', 'EXEC', 'EXECUTE', 'EXISTS', 'EXP',
+            'EXPLAIN', 'EXTRACT',
+            'FALSE', 'FIELD', 'FIELDS', 'FILTER', 'FIRST', 'FLOAT', 'FLOOR', 'FLUSH', 'FOR',
+            'FOREIGN', 'FROM', 'FULL', 'FUNCTION',
+            'GET', 'GROUP', 'GROUPING', 'GO', 'GOTO', 'GRANT', 'GRANTED',
+            'HAVING', 'HOUR',
+            'IDENTIFIED', 'IDENTITY', 'IF', 'IGNORE', 'IN', 'INCREMENT', 'INDEX', 'INFILE', 'INNER',
+            'INOUT', 'INPUT', 'INSERT', 'INT', 'INTEGER', 'INTERSECT', 'INTERSECTION', 'INTERVAL',
+            'INTO', 'IS',
+            'JOIN',
+            'KEY', 'KEYS', 'KILL',
+            'LANGUAGE', 'LARGE', 'LAST', 'LEADING', 'LEFT', 'LENGTH', 'LIKE', 'LIMIT', 'LINES', 'LOAD',
+            'LOCAL', 'LOCK', 'LOW_PRIORITY', 'LOWER',
+            'MATCH', 'MAX', 'MERGE', 'MIN', 'MINUTE', 'MOD', 'MODIFIES', 'MODIFY', 'MONTH',
+            'NATIONAL', 'NATURAL', 'NCHAR', 'NEW', 'NEXT', 'NEXTVAL', 'NONE', 'NOT',
+            'NULL', 'NULLABLE', 'NULLIF', 'NULLS', 'NUMBER', 'NUMERIC',
+            'OF', 'OLD', 'ON', 'ONLY', 'OPEN', 'OPTIMIZE', 'OPTION',
+            'OPTIONALLY', 'OR', 'ORDER', 'OUT', 'OUTER', 'OUTFILE', 'OVER',
+            'POSITION', 'POWER', 'PRECISION', 'PREPARE', 'PRIMARY', 'PROCEDURAL', 'PROCEDURE',
+            'READ', 'REAL', 'REF', 'REFERENCES', 'REFERENCING', 'REGEXP', 'RENAME', 'REPLACE',
+            'RESULT', 'RETURN', 'RETURNS', 'REVOKE', 'RIGHT', 'RLIKE', 'ROLLBACK', 'ROW',
+            'ROW_NUMBER', 'ROWS', 'RESTRICT', 'ROLE', 'ROUTINE', 'ROW_COUNT',
+            'SAVEPOINT', 'SEARCH', 'SECOND', 'SECTION', 'SELECT', 'SELF', 'SEQUENCE',
+            'SESSION', 'SET', 'SETVAL', 'SHOW', 'SIMILAR', 'SIZE', 'SMALLINT', 'SOME',
+            'SONAME', 'SOURCE', 'SPACE', 'SQL', 'SQRT', 'START', 'STATUS',
+            'STRAIGHT_JOIN', 'STRUCTURE', 'STYLE', 'SUBSTRING', 'SUM',
+            'TABLE', 'TABLE_NAME', 'TABLES', 'TERMINATED', 'TEMPORARY', 'THEN', 'TIME',
+            'TIMESTAMP', 'TO', 'TRAILING', 'TRANSACTION', 'TRIGGER', 'TRIM', 'TRUE', 'TRUNCATE',
+            'TRUSTED', 'TYPE',
+            'UNDER', 'UNION', 'UNIQUE', 'UNKNOWN', 'UNLOCK', 'UNSIGNED',
+            'UPDATE', 'UPPER', 'USE', 'USER', 'USING',
+            'VALUE', 'VALUES', 'VARCHAR', 'VARIABLES', 'VARYING', 'VIEW',
+            'WHEN', 'WHERE', 'WITH', 'WITHIN', 'WITHOUT', 'WORK', 'WRITE',
+            'XOR',
+            'YEAR',
+            'ZEROFILL'
+            )
+        ),
+    'SYMBOLS' => array(
+        '(', ')', '=', '<', '>', '|', ',', '.', '+', '-', '*', '/'
+        ),
+    'CASE_SENSITIVE' => array(
+        GESHI_COMMENTS => false,
+        1 => false
+        ),
+    'STYLES' => array(
+        'KEYWORDS' => array(
+            1 => 'color: #993333; font-weight: bold;'
+            ),
+        'COMMENTS' => array(
+            1 => 'color: #808080; font-style: italic;',
+            //2 => 'color: #808080; font-style: italic;',
             'MULTI' => 'color: #808080; font-style: italic;'
-			),
-		'ESCAPE_CHAR' => array(
-			0 => 'color: #000099; font-weight: bold;'
-			),
-		'BRACKETS' => array(
-			0 => 'color: #66cc66;'
-			),
-		'STRINGS' => array(
-			0 => 'color: #ff0000;'
-			),
-		'NUMBERS' => array(
-			0 => 'color: #cc66cc;'
-			),
-		'METHODS' => array(
-			),
-		'SYMBOLS' => array(
-			0 => 'color: #66cc66;'
-			),
-		'SCRIPT' => array(
-			),
-		'REGEXPS' => array(
-			)
-		),
-	'OOLANG' => false,
-	'OBJECT_SPLITTERS' => array(
-		),
-	'REGEXPS' => array(
-		),
-	'STRICT_MODE_APPLIES' => GESHI_NEVER,
-	'SCRIPT_DELIMITERS' => array(
-		),
-	'HIGHLIGHT_STRICT_BLOCK' => array(
-		)
+            ),
+        'ESCAPE_CHAR' => array(
+            0 => 'color: #000099; font-weight: bold;'
+            ),
+        'BRACKETS' => array(
+            0 => 'color: #66cc66;'
+            ),
+        'STRINGS' => array(
+            0 => 'color: #ff0000;'
+            ),
+        'NUMBERS' => array(
+            0 => 'color: #cc66cc;'
+            ),
+        'METHODS' => array(
+            ),
+        'SYMBOLS' => array(
+            0 => 'color: #66cc66;'
+            ),
+        'SCRIPT' => array(
+            ),
+        'REGEXPS' => array(
+            )
+        ),
+    'URLS' => array(
+        1 => ''
+        ),
+    'OOLANG' => false,
+    'OBJECT_SPLITTERS' => array(
+        ),
+    'REGEXPS' => array(
+        ),
+    'STRICT_MODE_APPLIES' => GESHI_NEVER,
+    'SCRIPT_DELIMITERS' => array(
+        ),
+    'HIGHLIGHT_STRICT_BLOCK' => array(
+        )
 );
 
-?>
+?>
\ No hay ningún carácter de nueva línea al final del fichero
diff -aruN --binary 22/libraries/geshi/geshi/xml.php 23/libraries/geshi/geshi/xml.php
--- 22/libraries/geshi/geshi/xml.php	2009-05-29 13:54:38.000000000 +0200
+++ 23/libraries/geshi/geshi/xml.php	2011-03-31 18:09:16.000000000 +0200
@@ -1,16 +1,21 @@
 <?php
+// no direct access
+defined('_JEXEC') or die;
+
 /*************************************************************************************
  * xml.php
  * -------
  * Author: Nigel McNie (nigel@geshi.org)
  * Copyright: (c) 2004 Nigel McNie (http://qbnz.com/highlighter/)
- * Release Version: 1.0.7.19
+ * Release Version: 1.0.8.10
  * Date Started: 2004/09/01
  *
  * XML language file for GeSHi. Based on the idea/file by Christian Weiske
  *
  * CHANGES
  * -------
+ * 2008/05/23 (1.0.7.22)
+ *   -  Added description of extra language features (SF#1970248)
  * 2005/12/28 (1.0.2)
  *   -  Removed escape character for strings
  * 2004/11/27 (1.0.1)
@@ -42,106 +47,114 @@
  *
  ************************************************************************************/
 
-defined('GESHI_CAPS_NO_CHANGE') or die();
-
 $language_data = array (
-	'LANG_NAME' => 'XML',
-	'COMMENT_SINGLE' => array(),
-	'COMMENT_MULTI' => array('<!--' => '-->'),
-	'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
-	'QUOTEMARKS' => array("'", '"'),
-	'ESCAPE_CHAR' => '',
-	'KEYWORDS' => array(
-		),
-	'SYMBOLS' => array(
-		),
-	'CASE_SENSITIVE' => array(
-		GESHI_COMMENTS => false,
-		),
-	'STYLES' => array(
-		'KEYWORDS' => array(
-			),
-		'COMMENTS' => array(
-			'MULTI' => 'color: #808080; font-style: italic;'
-			),
-		'ESCAPE_CHAR' => array(
-			0 => 'color: #000099; font-weight: bold;'
-			),
-		'BRACKETS' => array(
-			0 => 'color: #66cc66;'
-			),
-		'STRINGS' => array(
-			0 => 'color: #ff0000;'
-			),
-		'NUMBERS' => array(
-			0 => 'color: #cc66cc;'
-			),
-		'METHODS' => array(
-			),
-		'SYMBOLS' => array(
-			0 => 'color: #66cc66;'
-			),
-		'SCRIPT' => array(
-			0 => 'color: #00bbdd;',
-			1 => 'color: #ddbb00;',
-			2 => 'color: #339933;',
-			3 => 'color: #009900;'
-			),
-		'REGEXPS' => array(
-			0 => 'color: #000066;',
-			1 => 'font-weight: bold; color: black;',
-			2 => 'font-weight: bold; color: black;',
-			)
-		),
-	'URLS' => array(
-		),
-	'OOLANG' => false,
-	'OBJECT_SPLITTERS' => array(
-		),
-	'REGEXPS' => array(
-		0 => array(
-			GESHI_SEARCH => '([a-z\-:]+)(=)',
-			GESHI_REPLACE => '\\1',
-			GESHI_MODIFIERS => 'i',
-			GESHI_BEFORE => '',
-			GESHI_AFTER => '\\2'
-			),
-		1 => array(
-			GESHI_SEARCH => '(&lt;[/?|(\?xml)]?[a-z0-9_\-:]*(\??&gt;)?)',
-			GESHI_REPLACE => '\\1',
-			GESHI_MODIFIERS => 'i',
-			GESHI_BEFORE => '',
-			GESHI_AFTER => ''
-			),
-		2 => array(
-			GESHI_SEARCH => '(([/|\?])?&gt;)',
-			GESHI_REPLACE => '\\1',
-			GESHI_MODIFIERS => 'i',
-			GESHI_BEFORE => '',
-			GESHI_AFTER => ''
-			)
-		),
-	'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
-	'SCRIPT_DELIMITERS' => array(
-		0 => array(
-			'<!DOCTYPE' => '>'
-			),
-		1 => array(
-			'&' => ';'
-			),
-		2 => array(
-			'<![CDATA[' => ']]>'
-			),
-		3 => array(
-			'<' => '>'
-			)
-	),
-	'HIGHLIGHT_STRICT_BLOCK' => array(
-		0 => false,
-		1 => false,
-		2 => false,
-		3 => true
-		)
+    'LANG_NAME' => 'XML',
+    'COMMENT_SINGLE' => array(),
+    'COMMENT_MULTI' => array(),
+    'CASE_KEYWORDS' => GESHI_CAPS_NO_CHANGE,
+    'QUOTEMARKS' => array("'", '"'),
+    'ESCAPE_CHAR' => '',
+    'KEYWORDS' => array(
+        ),
+    'SYMBOLS' => array(
+        ),
+    'CASE_SENSITIVE' => array(
+        GESHI_COMMENTS => false,
+        ),
+    'STYLES' => array(
+        'KEYWORDS' => array(
+            ),
+        'COMMENTS' => array(
+            ),
+        'ESCAPE_CHAR' => array(
+            0 => 'color: #000099; font-weight: bold;'
+            ),
+        'BRACKETS' => array(
+            0 => 'color: #66cc66;'
+            ),
+        'STRINGS' => array(
+            0 => 'color: #ff0000;'
+            ),
+        'NUMBERS' => array(
+            0 => 'color: #cc66cc;'
+            ),
+        'METHODS' => array(
+            ),
+        'SYMBOLS' => array(
+            0 => 'color: #66cc66;'
+            ),
+        'SCRIPT' => array(
+            -1 => 'color: #808080; font-style: italic;', // comments
+            0 => 'color: #00bbdd;',
+            1 => 'color: #ddbb00;',
+            2 => 'color: #339933;',
+            3 => 'color: #009900;'
+            ),
+        'REGEXPS' => array(
+            0 => 'color: #000066;',
+            1 => 'color: #000000; font-weight: bold;',
+            2 => 'color: #000000; font-weight: bold;'
+            )
+        ),
+    'URLS' => array(
+        ),
+    'OOLANG' => false,
+    'OBJECT_SPLITTERS' => array(
+        ),
+    'REGEXPS' => array(
+        0 => array(//attribute names
+            GESHI_SEARCH => '([a-z_:][\w\-\.:]*)(=)',
+            GESHI_REPLACE => '\\1',
+            GESHI_MODIFIERS => 'i',
+            GESHI_BEFORE => '',
+            GESHI_AFTER => '\\2'
+            ),
+        1 => array(//Initial header line
+            GESHI_SEARCH => '(&lt;[\/?|(\?xml)]?[a-z_:][\w\-\.:]*(\??&gt;)?)',
+            GESHI_REPLACE => '\\1',
+            GESHI_MODIFIERS => 'i',
+            GESHI_BEFORE => '',
+            GESHI_AFTER => ''
+            ),
+        2 => array(//Tag end markers
+            GESHI_SEARCH => '(([\/|\?])?&gt;)',
+            GESHI_REPLACE => '\\1',
+            GESHI_MODIFIERS => 'i',
+            GESHI_BEFORE => '',
+            GESHI_AFTER => ''
+            ),
+        ),
+    'STRICT_MODE_APPLIES' => GESHI_ALWAYS,
+    'SCRIPT_DELIMITERS' => array(
+        -1 => array(
+            '<!--' => '-->'
+            ),
+        0 => array(
+            '<!DOCTYPE' => '>'
+            ),
+        1 => array(
+            '&' => ';'
+            ),
+        2 => array(
+            '<![CDATA[' => ']]>'
+            ),
+        3 => array(
+            '<' => '>'
+            )
+    ),
+    'HIGHLIGHT_STRICT_BLOCK' => array(
+        -1 => false,
+        0 => false,
+        1 => false,
+        2 => false,
+        3 => true
+        ),
+    'TAB_WIDTH' => 2,
+    'PARSER_CONTROL' => array(
+        'ENABLE_FLAGS' => array(
+            'NUMBERS' => GESHI_NEVER
+        )
+    )
 );
 
 ?>
diff -aruN --binary 22/libraries/geshi/geshi.php 23/libraries/geshi/geshi.php
--- 22/libraries/geshi/geshi.php	2009-05-29 13:54:38.000000000 +0200
+++ 23/libraries/geshi/geshi.php	2011-03-31 18:09:16.000000000 +0200
@@ -1,4 +1,7 @@
 <?php
+// no direct access
+defined('_JEXEC') or die;
+
 /**
  * GeSHi - Generic Syntax Highlighter
  *
@@ -27,8 +30,8 @@
  *
  * @package    geshi
  * @subpackage core
- * @author     Nigel McNie <nigel@geshi.org>
- * @copyright  (C) 2004 - 2007 Nigel McNie
+ * @author     Nigel McNie <nigel@geshi.org>, Benny Baumann <BenBE@omorphia.de>
+ * @copyright  (C) 2004 - 2007 Nigel McNie, (C) 2007 - 2008 Benny Baumann
  * @license    http://gnu.org/copyleft/gpl.html GNU GPL
  *
  */
@@ -41,7 +44,7 @@
 //
 
 /** The version of this GeSHi file */
-define('GESHI_VERSION', '1.0.7.19');
+define('GESHI_VERSION', '1.0.8.10');
 
 // Define the root directory for the GeSHi code tree
 if (!defined('GESHI_ROOT')) {
@@ -52,6 +55,11 @@
     @access private */
 define('GESHI_LANG_ROOT', GESHI_ROOT . 'geshi' . DIRECTORY_SEPARATOR);
 
+// Define if GeSHi should be paranoid about security
+if (!defined('GESHI_SECURITY_PARANOID')) {
+    /** Tells GeSHi to be paranoid about security settings */
+    define('GESHI_SECURITY_PARANOID', false);
+}
 
 // Line numbers - use with enable_line_numbers()
 /** Use no line numbers when building the result */
@@ -68,6 +76,22 @@
 define('GESHI_HEADER_DIV', 1);
 /** Use a "pre" to surround the source */
 define('GESHI_HEADER_PRE', 2);
+/** Use a pre to wrap lines when line numbers are enabled or to wrap the whole code. */
+define('GESHI_HEADER_PRE_VALID', 3);
+/**
+ * Use a "table" to surround the source:
+ *
+ *  <table>
+ *    <thead><tr><td colspan="2">$header</td></tr></thead>
+ *    <tbody><tr><td><pre>$linenumbers</pre></td><td><pre>$code></pre></td></tr></tbody>
+ *    <tfooter><tr><td colspan="2">$footer</td></tr></tfoot>
+ *  </table>
+ *
+ * this is essentially only a workaround for Firefox, see sf#1651996 or take a look at
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=365805
+ * @note when linenumbers are disabled this is essentially the same as GESHI_HEADER_PRE
+ */
+define('GESHI_HEADER_PRE_TABLE', 4);
 
 // Capatalisation constants
 /** Lowercase keywords found */
@@ -102,7 +126,7 @@
 /** Strict mode never applies (this is the most common) */
 define('GESHI_NEVER', 0);
 /** Strict mode *might* apply, and can be enabled or
-    disabled by {@link GeSHi::enable_strict_mode()} */
+    disabled by {@link GeSHi->enable_strict_mode()} */
 define('GESHI_MAYBE', 1);
 /** Strict mode always applies */
 define('GESHI_ALWAYS', 2);
@@ -128,6 +152,86 @@
 /** Used in language files to mark comments */
 define('GESHI_COMMENTS', 0);
 
+/** Used to work around missing PHP features **/
+define('GESHI_PHP_PRE_433', !(version_compare(PHP_VERSION, '4.3.3') === 1));
+
+/** make sure we can call stripos **/
+if (!function_exists('stripos')) {
+    // the offset param of preg_match is not supported below PHP 4.3.3
+    if (GESHI_PHP_PRE_433) {
+        /**
+         * @ignore
+         */
+        function stripos($haystack, $needle, $offset = null) {
+            if (!is_null($offset)) {
+                $haystack = substr($haystack, $offset);
+            }
+            if (preg_match('/'. preg_quote($needle, '/') . '/', $haystack, $match, PREG_OFFSET_CAPTURE)) {
+                return $match[0][1];
+            }
+            return false;
+        }
+    }
+    else {
+        /**
+         * @ignore
+         */
+        function stripos($haystack, $needle, $offset = null) {
+            if (preg_match('/'. preg_quote($needle, '/') . '/', $haystack, $match, PREG_OFFSET_CAPTURE, $offset)) {
+                return $match[0][1];
+            }
+            return false;
+        }
+    }
+}
+
+/** some old PHP / PCRE subpatterns only support up to xxx subpatterns in
+    regular expressions. Set this to false if your PCRE lib is up to date
+    @see GeSHi->optimize_regexp_list()
+    **/
+define('GESHI_MAX_PCRE_SUBPATTERNS', 500);
+/** it's also important not to generate too long regular expressions
+    be generous here... but keep in mind, that when reaching this limit we
+    still have to close open patterns. 12k should do just fine on a 16k limit.
+    @see GeSHi->optimize_regexp_list()
+    **/
+define('GESHI_MAX_PCRE_LENGTH', 12288);
+
+//Number format specification
+/** Basic number format for integers */
+define('GESHI_NUMBER_INT_BASIC', 1);        //Default integers \d+
+/** Enhanced number format for integers like seen in C */
+define('GESHI_NUMBER_INT_CSTYLE', 2);       //Default C-Style \d+[lL]?
+/** Number format to highlight binary numbers with a suffix "b" */
+define('GESHI_NUMBER_BIN_SUFFIX', 16);           //[01]+[bB]
+/** Number format to highlight binary numbers with a prefix % */
+define('GESHI_NUMBER_BIN_PREFIX_PERCENT', 32);   //%[01]+
+/** Number format to highlight binary numbers with a prefix 0b (C) */
+define('GESHI_NUMBER_BIN_PREFIX_0B', 64);        //0b[01]+
+/** Number format to highlight octal numbers with a leading zero */
+define('GESHI_NUMBER_OCT_PREFIX', 256);           //0[0-7]+
+/** Number format to highlight octal numbers with a prefix 0o (logtalk) */
+define('GESHI_NUMBER_OCT_PREFIX_0O', 512);           //0[0-7]+
+/** Number format to highlight octal numbers with a leading @ (Used in HiSofts Devpac series). */
+define('GESHI_NUMBER_OCT_PREFIX_AT', 1024);           //@[0-7]+
+/** Number format to highlight octal numbers with a suffix of o */
+define('GESHI_NUMBER_OCT_SUFFIX', 2048);           //[0-7]+[oO]
+/** Number format to highlight hex numbers with a prefix 0x */
+define('GESHI_NUMBER_HEX_PREFIX', 4096);           //0x[0-9a-fA-F]+
+/** Number format to highlight hex numbers with a prefix $ */
+define('GESHI_NUMBER_HEX_PREFIX_DOLLAR', 8192);           //$[0-9a-fA-F]+
+/** Number format to highlight hex numbers with a suffix of h */
+define('GESHI_NUMBER_HEX_SUFFIX', 16384);           //[0-9][0-9a-fA-F]*h
+/** Number format to highlight floating-point numbers without support for scientific notation */
+define('GESHI_NUMBER_FLT_NONSCI', 65536);          //\d+\.\d+
+/** Number format to highlight floating-point numbers without support for scientific notation */
+define('GESHI_NUMBER_FLT_NONSCI_F', 131072);       //\d+(\.\d+)?f
+/** Number format to highlight floating-point numbers with support for scientific notation (E) and optional leading zero */
+define('GESHI_NUMBER_FLT_SCI_SHORT', 262144);      //\.\d+e\d+
+/** Number format to highlight floating-point numbers with support for scientific notation (E) and required leading digit */
+define('GESHI_NUMBER_FLT_SCI_ZERO', 524288);       //\d+(\.\d+)?e\d+
+//Custom formats are passed by RX array
+
 // Error detection - use these to analyse faults
 /** No sourcecode to highlight was specified
  * @deprecated
@@ -137,9 +241,9 @@
 define('GESHI_ERROR_NO_SUCH_LANG', 2);
 /** GeSHi could not open a file for reading (generally a language file) */
 define('GESHI_ERROR_FILE_NOT_READABLE', 3);
-/** The header type passed to {@link GeSHi::set_header_type()} was invalid */
+/** The header type passed to {@link GeSHi->set_header_type()} was invalid */
 define('GESHI_ERROR_INVALID_HEADER_TYPE', 4);
-/** The line number type passed to {@link GeSHi::enable_line_numbers()} was invalid */
+/** The line number type passed to {@link GeSHi->enable_line_numbers()} was invalid */
 define('GESHI_ERROR_INVALID_LINE_NUMBER_TYPE', 5);
 /**#@-*/
 
@@ -152,8 +256,8 @@
  * about how to use this class.
  *
  * @package   geshi
- * @author    Nigel McNie <nigel@geshi.org>
- * @copyright (C) 2004 - 2007 Nigel McNie
+ * @author    Nigel McNie <nigel@geshi.org>, Benny Baumann <BenBE@omorphia.de>
+ * @copyright (C) 2004 - 2007 Nigel McNie, (C) 2007 - 2008 Benny Baumann
  */
 class GeSHi {
     /**#@+
@@ -235,7 +339,7 @@
         'REGEXPS' =>     array(),
         'ESCAPE_CHAR' => true,
         'BRACKETS' =>    true,
-        'SYMBOLS' =>     true,
+        'SYMBOLS' =>     false,
         'STRINGS' =>     true,
         'NUMBERS' =>     true,
         'METHODS' =>     true,
@@ -273,6 +377,13 @@
     var $footer_content_style = '';
 
     /**
+     * Tells if a block around the highlighted source should be forced
+     * if not using line numbering
+     * @var boolean
+     */
+    var $force_code_block = false;
+
+    /**
      * The styles for hyperlinks in the code
      * @var array
      */
@@ -308,10 +419,24 @@
     var $highlight_extra_lines = array();
 
     /**
+     * Styles of lines that should be highlighted extra
+     * @var array
+     */
+    var $highlight_extra_lines_styles = array();
+
+    /**
      * Styles of extra-highlighted lines
      * @var string
      */
-    var $highlight_extra_lines_style = 'color: #cc0; background-color: #ffc;';
+    var $highlight_extra_lines_style = 'background-color: #ffc;';
+
+    /**
+     * The line ending
+     * If null, nl2br() will be used on the result string.
+     * Otherwise, all instances of \n will be replaced with $line_ending
+     * @var string
+     */
+    var $line_ending = null;
 
     /**
      * Number at which line numbers should start at
@@ -323,13 +448,13 @@
      * The overall style for this code block
      * @var string
      */
-    var $overall_style = '';
+    var $overall_style = 'font-family:monospace;';
 
     /**
      *  The style for the actual code
      * @var string
      */
-    var $code_style = 'font-family: \'Courier New\', Courier, monospace; font-weight: normal;';
+    var $code_style = 'font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;';
 
     /**
      * The overall class for this code block
@@ -347,21 +472,34 @@
      * Line number styles
      * @var string
      */
-    var $line_style1 = 'font-family: \'Courier New\', Courier, monospace; color: black; font-weight: normal; font-style: normal;';
+    var $line_style1 = 'font-weight: normal; vertical-align:top;';
 
     /**
      * Line number styles for fancy lines
      * @var string
      */
-    var $line_style2 = 'font-weight: bold;';
+    var $line_style2 = 'font-weight: bold; vertical-align:top;';
+
+    /**
+     * Style for line numbers when GESHI_HEADER_PRE_TABLE is chosen
+     * @var string
+     */
+    var $table_linenumber_style = 'width:1px;text-align:right;margin:0;padding:0 2px;vertical-align:top;';
 
     /**
-     * Flag for how line nubmers are displayed
+     * Flag for how line numbers are displayed
      * @var boolean
      */
     var $line_numbers = GESHI_NO_LINE_NUMBERS;
 
     /**
+     * Flag to decide if multi line spans are allowed. Set it to false to make sure
+     * each tag is closed before and reopened after each linefeed.
+     * @var boolean
+     */
+    var $allow_multiline_span = true;
+
+    /**
      * The "nth" value for fancy line highlighting
      * @var int
      */
@@ -374,6 +512,12 @@
     var $tab_width = 8;
 
     /**
+     * Should we use language-defined tab stop widths?
+     * @var int
+     */
+    var $use_language_tab_width = false;
+
+    /**
      * Default target for keyword links
      * @var string
      */
@@ -381,7 +525,7 @@
 
     /**
      * The encoding to use for entity encoding
-     * NOTE: no longer used
+     * NOTE: Used with Escape Char Sequences to fix UTF-8 handling (cf. SF#2037598)
      * @var string
      */
     var $encoding = 'utf-8';
@@ -392,6 +536,51 @@
      */
     var $keyword_links = true;
 
+    /**
+     * Currently loaded language file
+     * @var string
+     * @since 1.0.7.22
+     */
+    var $loaded_language = '';
+
+    /**
+     * Wether the caches needed for parsing are built or not
+     *
+     * @var bool
+     * @since 1.0.8
+     */
+    var $parse_cache_built = false;
+
+    /**
+     * Work around for Suhosin Patch with disabled /e modifier
+     *
+     * Note from suhosins author in config file:
+     * <blockquote>
+     *   The /e modifier inside <code>preg_replace()</code> allows code execution.
+     *   Often it is the cause for remote code execution exploits. It is wise to
+     *   deactivate this feature and test where in the application it is used.
+     *   The developer using the /e modifier should be made aware that he should
+     *   use <code>preg_replace_callback()</code> instead
+     * </blockquote>
+     *
+     * @var array
+     * @since 1.0.8
+     */
+    var $_kw_replace_group = 0;
+    var $_rx_key = 0;
+
+    /**
+     * some "callback parameters" for handle_multiline_regexps
+     *
+     * @since 1.0.8
+     * @access private
+     * @var string
+     */
+    var $_hmr_before = '';
+    var $_hmr_replace = '';
+    var $_hmr_after = '';
+    var $_hmr_key = 0;
+
     /**#@-*/
 
     /**
@@ -405,13 +594,17 @@
      *               should be automatically set correctly. If you have
      *               renamed the language directory however, you will
      *               still need to set the path using this parameter or
-     *               {@link GeSHi::set_language_path()}
+     *               {@link GeSHi->set_language_path()}
      * @since 1.0.0
      */
-    function GeSHi($source, $language, $path = '') {
-        $this->set_source($source);
+    function GeSHi($source = '', $language = '', $path = '') {
+        if (!empty($source)) {
+            $this->set_source($source);
+        }
+        if (!empty($language)) {
+            $this->set_language($language);
+        }
         $this->set_language_path($path);
-        $this->set_language($language);
     }
 
     /**
@@ -423,15 +616,17 @@
      */
     function error() {
         if ($this->error) {
-            $msg = $this->error_messages[$this->error];
+            //Put some template variables for debugging here ...
             $debug_tpl_vars = array(
                 '{LANGUAGE}' => $this->language,
                 '{PATH}' => $this->language_path
             );
-            foreach ($debug_tpl_vars as $tpl => $var) {
-                $msg = str_replace($tpl, $var, $msg);
-            }
-            return "<br /><strong>GeSHi Error:</strong> $msg (code $this->error)<br />";
+            $msg = str_replace(
+                array_keys($debug_tpl_vars),
+                array_values($debug_tpl_vars),
+                $this->error_messages[$this->error]);
+
+            return "<br /><strong>GeSHi Error:</strong> $msg (code {$this->error})<br />";
         }
         return false;
     }
@@ -464,21 +659,40 @@
     /**
      * Sets the language for this object
      *
+     * @note since 1.0.8 this function won't reset language-settings by default anymore!
+     *       if you need this set $force_reset = true
+     *
      * @param string The name of the language to use
      * @since 1.0.0
      */
-    function set_language($language) {
-        $this->error = false;
-        $this->strict_mode = GESHI_NEVER;
+    function set_language($language, $force_reset = false) {
+        if ($force_reset) {
+            $this->loaded_language = false;
+        }
 
+        //Clean up the language name to prevent malicious code injection
         $language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language);
-        $this->language = strtolower($language);
 
-        $file_name = $this->language_path . $this->language . '.php';
+        $language = strtolower($language);
+
+        //Retreive the full filename
+        $file_name = $this->language_path . $language . '.php';
+        if ($file_name == $this->loaded_language) {
+            // this language is already loaded!
+            return;
+        }
+
+        $this->language = $language;
+
+        $this->error = false;
+        $this->strict_mode = GESHI_NEVER;
+
+        //Check if we can read the desired file
         if (!is_readable($file_name)) {
             $this->error = GESHI_ERROR_NO_SUCH_LANG;
             return;
         }
+
         // Load the language for parsing
         $this->load_language($file_name);
     }
@@ -496,10 +710,114 @@
      *             so this method will disappear in 1.2.0.
      */
     function set_language_path($path) {
+        if(strpos($path,':')) {
+            //Security Fix to prevent external directories using fopen wrappers.
+            if(DIRECTORY_SEPARATOR == "\\") {
+                if(!preg_match('#^[a-zA-Z]:#', $path) || false !== strpos($path, ':', 2)) {
+                    return;
+                }
+            } else {
+                return;
+            }
+        }
+        if(preg_match('#[^/a-zA-Z0-9_\.\-\\\s:]#', $path)) {
+            //Security Fix to prevent external directories using fopen wrappers.
+            return;
+        }
+        if(GESHI_SECURITY_PARANOID && false !== strpos($path, '/.')) {
+            //Security Fix to prevent external directories using fopen wrappers.
+            return;
+        }
+        if(GESHI_SECURITY_PARANOID && false !== strpos($path, '..')) {
+            //Security Fix to prevent external directories using fopen wrappers.
+            return;
+        }
         if ($path) {
-            $this->language_path = ('/' == substr($path, strlen($path) - 1, 1)) ? $path : $path . '/';
-            $this->set_language($this->language);        // otherwise set_language_path has no effect
+            $this->language_path = ('/' == $path[strlen($path) - 1]) ? $path : $path . '/';
+            $this->set_language($this->language); // otherwise set_language_path has no effect
+        }
+    }
+
+    /**
+     * Get supported langs or an associative array lang=>full_name.
+     * @param boolean $longnames
+     * @return array
+     */
+    function get_supported_languages($full_names=false)
+    {
+        // return array
+        $back = array();
+
+        // we walk the lang root
+        $dir = dir($this->language_path);
+
+        // foreach entry
+        while (false !== ($entry = $dir->read()))
+        {
+            $full_path = $this->language_path.$entry;
+
+            // Skip all dirs
+            if (is_dir($full_path)) {
+                continue;
+            }
+
+            // we only want lang.php files
+            if (!preg_match('/^([^.]+)\.php$/', $entry, $matches)) {
+                continue;
+            }
+
+            // Raw lang name is here
+            $langname = $matches[1];
+
+            // We want the fullname too?
+            if ($full_names === true)
+            {
+                if (false !== ($fullname = $this->get_language_fullname($langname)))
+                {
+                    $back[$langname] = $fullname; // we go associative
+                }
+            }
+            else
+            {
+                // just store raw langname
+                $back[] = $langname;
+            }
+        }
+
+        $dir->close();
+
+        return $back;
+    }
+
+    /**
+     * Get full_name for a lang or false.
+     * @param string $language short langname (html4strict for example)
+     * @return mixed
+     */
+    function get_language_fullname($language)
+    {
+        //Clean up the language name to prevent malicious code injection
+        $language = preg_replace('#[^a-zA-Z0-9\-_]#', '', $language);
+
+        $language = strtolower($language);
+
+        // get fullpath-filename for a langname
+        $fullpath = $this->language_path.$language.'.php';
+
+        // we need to get contents :S
+        if (false === ($data = file_get_contents($fullpath))) {
+            $this->error = sprintf('Geshi::get_lang_fullname() Unknown Language: %s', $language);
+            return false;
+        }
+
+        // match the langname
+        if (!preg_match('/\'LANG_NAME\'\s*=>\s*\'((?:[^\']|\\\')+)\'/', $data, $matches)) {
+            $this->error = sprintf('Geshi::get_lang_fullname(%s): Regex can not detect language', $language);
+            return false;
         }
+
+        // return fullname for langname
+        return stripcslashes($matches[1]);
     }
 
     /**
@@ -517,15 +835,15 @@
      * @since 1.0.0
      */
     function set_header_type($type) {
-        if (GESHI_HEADER_DIV != $type && GESHI_HEADER_PRE != $type && GESHI_HEADER_NONE != $type) {
+        //Check if we got a valid header type
+        if (!in_array($type, array(GESHI_HEADER_NONE, GESHI_HEADER_DIV,
+            GESHI_HEADER_PRE, GESHI_HEADER_PRE_VALID, GESHI_HEADER_PRE_TABLE))) {
             $this->error = GESHI_ERROR_INVALID_HEADER_TYPE;
             return;
         }
+
+        //Set that new header type
         $this->header_type = $type;
-        // Set a default overall style if the header is a <div>
-        if (GESHI_HEADER_DIV == $type && !$this->overall_style) {
-            $this->overall_style = 'font-family: monospace;';
-        }
     }
 
     /**
@@ -540,8 +858,7 @@
     function set_overall_style($style, $preserve_defaults = false) {
         if (!$preserve_defaults) {
             $this->overall_style = $style;
-        }
-        else {
+        } else {
             $this->overall_style .= $style;
         }
     }
@@ -593,12 +910,12 @@
      *
      * @param string  The style to use for actual code
      * @param boolean Whether to merge the current styles with the new styles
+     * @since 1.0.2
      */
     function set_code_style($style, $preserve_defaults = false) {
         if (!$preserve_defaults) {
             $this->code_style = $style;
-        }
-        else {
+        } else {
             $this->code_style .= $style;
         }
     }
@@ -616,15 +933,17 @@
      * @since 1.0.2
      */
     function set_line_style($style1, $style2 = '', $preserve_defaults = false) {
+        //Check if we got 2 or three parameters
         if (is_bool($style2)) {
             $preserve_defaults = $style2;
             $style2 = '';
         }
+
+        //Actually set the new styles
         if (!$preserve_defaults) {
             $this->line_style1 = $style1;
             $this->line_style2 = $style2;
-        }
-        else {
+        } else {
             $this->line_style1 .= $style1;
             $this->line_style2 .= $style2;
         }
@@ -657,6 +976,29 @@
     }
 
     /**
+     * Sets wether spans and other HTML markup generated by GeSHi can
+     * span over multiple lines or not. Defaults to true to reduce overhead.
+     * Set it to false if you want to manipulate the output or manually display
+     * the code in an ordered list.
+     *
+     * @param boolean Wether multiline spans are allowed or not
+     * @since 1.0.7.22
+     */
+    function enable_multiline_span($flag) {
+        $this->allow_multiline_span = (bool) $flag;
+    }
+
+    /**
+     * Get current setting for multiline spans, see GeSHi->enable_multiline_span().
+     *
+     * @see enable_multiline_span
+     * @return bool
+     */
+    function get_multiline_span() {
+        return $this->allow_multiline_span;
+    }
+
+    /**
      * Sets the style for a keyword group. If $preserve_defaults is
      * true, then styles are merged with the default styles, with the
      * user defined styles having priority
@@ -668,12 +1010,17 @@
      * @since 1.0.0
      */
     function set_keyword_group_style($key, $style, $preserve_defaults = false) {
+        //Set the style for this keyword group
         if (!$preserve_defaults) {
             $this->language_data['STYLES']['KEYWORDS'][$key] = $style;
-        }
-        else {
+        } else {
             $this->language_data['STYLES']['KEYWORDS'][$key] .= $style;
         }
+
+        //Update the lexic permissions
+        if (!isset($this->lexic_permissions['KEYWORDS'][$key])) {
+            $this->lexic_permissions['KEYWORDS'][$key] = true;
+        }
     }
 
     /**
@@ -701,8 +1048,7 @@
     function set_comments_style($key, $style, $preserve_defaults = false) {
         if (!$preserve_defaults) {
             $this->language_data['STYLES']['COMMENTS'][$key] = $style;
-        }
-        else {
+        } else {
             $this->language_data['STYLES']['COMMENTS'][$key] .= $style;
         }
     }
@@ -728,12 +1074,11 @@
      *                to overwrite them
      * @since 1.0.0
      */
-    function set_escape_characters_style($style, $preserve_defaults = false) {
+    function set_escape_characters_style($style, $preserve_defaults = false, $group = 0) {
         if (!$preserve_defaults) {
-            $this->language_data['STYLES']['ESCAPE_CHAR'][0] = $style;
-        }
-        else {
-            $this->language_data['STYLES']['ESCAPE_CHAR'][0] .= $style;
+            $this->language_data['STYLES']['ESCAPE_CHAR'][$group] = $style;
+        } else {
+            $this->language_data['STYLES']['ESCAPE_CHAR'][$group] .= $style;
         }
     }
 
@@ -764,8 +1109,7 @@
     function set_brackets_style($style, $preserve_defaults = false) {
         if (!$preserve_defaults) {
             $this->language_data['STYLES']['BRACKETS'][0] = $style;
-        }
-        else {
+        } else {
             $this->language_data['STYLES']['BRACKETS'][0] .= $style;
         }
     }
@@ -792,17 +1136,21 @@
      * @param string  The style to make the symbols
      * @param boolean Whether to merge the new styles with the old or just
      *                to overwrite them
+     * @param int     Tells the group of symbols for which style should be set.
      * @since 1.0.1
      */
-    function set_symbols_style($style, $preserve_defaults = false) {
+    function set_symbols_style($style, $preserve_defaults = false, $group = 0) {
+        // Update the style of symbols
         if (!$preserve_defaults) {
-            $this->language_data['STYLES']['SYMBOLS'][0] = $style;
-        }
-        else {
-            $this->language_data['STYLES']['SYMBOLS'][0] .= $style;
+            $this->language_data['STYLES']['SYMBOLS'][$group] = $style;
+        } else {
+            $this->language_data['STYLES']['SYMBOLS'][$group] .= $style;
         }
+
         // For backward compatibility
-        $this->set_brackets_style ($style, $preserve_defaults);
+        if (0 == $group) {
+            $this->set_brackets_style ($style, $preserve_defaults);
+        }
     }
 
     /**
@@ -812,7 +1160,9 @@
      * @since 1.0.0
      */
     function set_symbols_highlighting($flag) {
+        // Update lexic permissions for this symbol group
         $this->lexic_permissions['SYMBOLS'] = ($flag) ? true : false;
+
         // For backward compatibility
         $this->set_brackets_highlighting ($flag);
     }
@@ -825,14 +1175,14 @@
      * @param string  The style to make the escape characters
      * @param boolean Whether to merge the new styles with the old or just
      *                to overwrite them
+     * @param int     Tells the group of strings for which style should be set.
      * @since 1.0.0
      */
-    function set_strings_style($style, $preserve_defaults = false) {
+    function set_strings_style($style, $preserve_defaults = false, $group = 0) {
         if (!$preserve_defaults) {
-            $this->language_data['STYLES']['STRINGS'][0] = $style;
-        }
-        else {
-            $this->language_data['STYLES']['STRINGS'][0] .= $style;
+            $this->language_data['STYLES']['STRINGS'][$group] = $style;
+        } else {
+            $this->language_data['STYLES']['STRINGS'][$group] .= $style;
         }
     }
 
@@ -847,6 +1197,26 @@
     }
 
     /**
+     * Sets the styles for strict code blocks. If $preserve_defaults is
+     * true, then styles are merged with the default styles, with the
+     * user defined styles having priority
+     *
+     * @param string  The style to make the script blocks
+     * @param boolean Whether to merge the new styles with the old or just
+     *                to overwrite them
+     * @param int     Tells the group of script blocks for which style should be set.
+     * @since 1.0.8.4
+     */
+    function set_script_style($style, $preserve_defaults = false, $group = 0) {
+        // Update the style of symbols
+        if (!$preserve_defaults) {
+            $this->language_data['STYLES']['SCRIPT'][$group] = $style;
+        } else {
+            $this->language_data['STYLES']['SCRIPT'][$group] .= $style;
+        }
+    }
+
+    /**
      * Sets the styles for numbers. If $preserve_defaults is
      * true, then styles are merged with the default styles, with the
      * user defined styles having priority
@@ -854,14 +1224,14 @@
      * @param string  The style to make the numbers
      * @param boolean Whether to merge the new styles with the old or just
      *                to overwrite them
+     * @param int     Tells the group of numbers for which style should be set.
      * @since 1.0.0
      */
-    function set_numbers_style($style, $preserve_defaults = false) {
+    function set_numbers_style($style, $preserve_defaults = false, $group = 0) {
         if (!$preserve_defaults) {
-            $this->language_data['STYLES']['NUMBERS'][0] = $style;
-        }
-        else {
-            $this->language_data['STYLES']['NUMBERS'][0] .= $style;
+            $this->language_data['STYLES']['NUMBERS'][$group] = $style;
+        } else {
+            $this->language_data['STYLES']['NUMBERS'][$group] .= $style;
         }
     }
 
@@ -891,8 +1261,7 @@
     function set_methods_style($key, $style, $preserve_defaults = false) {
         if (!$preserve_defaults) {
             $this->language_data['STYLES']['METHODS'][$key] = $style;
-        }
-        else {
+        } else {
             $this->language_data['STYLES']['METHODS'][$key] .= $style;
         }
     }
@@ -920,8 +1289,7 @@
     function set_regexps_style($key, $style, $preserve_defaults = false) {
         if (!$preserve_defaults) {
             $this->language_data['STYLES']['REGEXPS'][$key] = $style;
-        }
-        else {
+        } else {
             $this->language_data['STYLES']['REGEXPS'][$key] .= $style;
         }
     }
@@ -957,10 +1325,12 @@
      *
      * @param int A constant specifying what to do with matched keywords
      * @since 1.0.1
-     * @todo  Error check the passed value
      */
     function set_case_keywords($case) {
-        $this->language_data['CASE_KEYWORDS'] = $case;
+        if (in_array($case, array(
+            GESHI_CAPS_NO_CHANGE, GESHI_CAPS_UPPER, GESHI_CAPS_LOWER))) {
+            $this->language_data['CASE_KEYWORDS'] = $case;
+        }
     }
 
     /**
@@ -973,6 +1343,38 @@
      */
     function set_tab_width($width) {
         $this->tab_width = intval($width);
+
+        //Check if it fit's the constraints:
+        if ($this->tab_width < 1) {
+            //Return it to the default
+            $this->tab_width = 8;
+        }
+    }
+
+    /**
+     * Sets whether or not to use tab-stop width specifed by language
+     *
+     * @param boolean Whether to use language-specific tab-stop widths
+     * @since 1.0.7.20
+     */
+    function set_use_language_tab_width($use) {
+        $this->use_language_tab_width = (bool) $use;
+    }
+
+    /**
+     * Returns the tab width to use, based on the current language and user
+     * preference
+     *
+     * @return int Tab width
+     * @since 1.0.7.20
+     */
+    function get_real_tab_width() {
+        if (!$this->use_language_tab_width ||
+            !isset($this->language_data['TAB_WIDTH'])) {
+            return $this->tab_width;
+        } else {
+            return $this->language_data['TAB_WIDTH'];
+        }
     }
 
     /**
@@ -985,7 +1387,7 @@
      */
     function enable_strict_mode($mode = true) {
         if (GESHI_MAYBE == $this->language_data['STRICT_MODE_APPLIES']) {
-          $this->strict_mode = ($mode) ? true : false;
+            $this->strict_mode = ($mode) ? GESHI_ALWAYS : GESHI_NEVER;
         }
     }
 
@@ -993,42 +1395,37 @@
      * Disables all highlighting
      *
      * @since 1.0.0
-     * @todo Rewrite with an array traversal
+     * @todo  Rewrite with array traversal
+     * @deprecated In favour of enable_highlighting
      */
     function disable_highlighting() {
-        foreach ($this->lexic_permissions as $key => $value) {
-            if (is_array($value)) {
-                foreach ($value as $k => $v) {
-                    $this->lexic_permissions[$key][$k] = false;
-                }
-            }
-            else {
-                $this->lexic_permissions[$key] = false;
-            }
-        }
-        // Context blocks
-        $this->enable_important_blocks = false;
+        $this->enable_highlighting(false);
     }
 
     /**
      * Enables all highlighting
      *
+     * The optional flag parameter was added in version 1.0.7.21 and can be used
+     * to enable (true) or disable (false) all highlighting.
+     *
      * @since 1.0.0
+     * @param boolean A flag specifying whether to enable or disable all highlighting
      * @todo  Rewrite with array traversal
      */
-    function enable_highlighting() {
+    function enable_highlighting($flag = true) {
+        $flag = $flag ? true : false;
         foreach ($this->lexic_permissions as $key => $value) {
             if (is_array($value)) {
                 foreach ($value as $k => $v) {
-                    $this->lexic_permissions[$key][$k] = true;
+                    $this->lexic_permissions[$key][$k] = $flag;
                 }
-            }
-            else {
-                $this->lexic_permissions[$key] = true;
+            } else {
+                $this->lexic_permissions[$key] = $flag;
             }
         }
+
         // Context blocks
-        $this->enable_important_blocks = true;
+        $this->enable_important_blocks = $flag;
     }
 
     /**
@@ -1036,59 +1433,92 @@
      * name, or the empty string if it couldn't be found
      *
      * @param string The extension to get a language name for
-     * @param array  A lookup array to use instead of the default
+     * @param array  A lookup array to use instead of the default one
      * @since 1.0.5
      * @todo Re-think about how this method works (maybe make it private and/or make it
      *       a extension->lang lookup?)
      * @todo static?
      */
     function get_language_name_from_extension( $extension, $lookup = array() ) {
-        if ( !$lookup ) {
+        if ( !is_array($lookup) || empty($lookup)) {
             $lookup = array(
+                '6502acme' => array( 'a', 's', 'asm', 'inc' ),
+                '6502tasm' => array( 'a', 's', 'asm', 'inc' ),
+                '6502kickass' => array( 'a', 's', 'asm', 'inc' ),
+                '68000devpac' => array( 'a', 's', 'asm', 'inc' ),
+                'abap' => array('abap'),
                 'actionscript' => array('as'),
                 'ada' => array('a', 'ada', 'adb', 'ads'),
                 'apache' => array('conf'),
-                'asm' => array('ash', 'asm'),
+                'asm' => array('ash', 'asm', 'inc'),
                 'asp' => array('asp'),
                 'bash' => array('sh'),
+                'bf' => array('bf'),
                 'c' => array('c', 'h'),
                 'c_mac' => array('c', 'h'),
                 'caddcl' => array(),
                 'cadlisp' => array(),
                 'cdfg' => array('cdfg'),
-                'cpp' => array('cpp', 'h', 'hpp'),
-                'csharp' => array(),
+                'cobol' => array('cbl'),
+                'cpp' => array('cpp', 'hpp', 'C', 'H', 'CPP', 'HPP'),
+                'csharp' => array('cs'),
                 'css' => array('css'),
-                'delphi' => array('dpk', 'dpr'),
+                'd' => array('d'),
+                'delphi' => array('dpk', 'dpr', 'pp', 'pas'),
+                'diff' => array('diff', 'patch'),
+                'dos' => array('bat', 'cmd'),
+                'gdb' => array('kcrash', 'crash', 'bt'),
+                'gettext' => array('po', 'pot'),
+                'gml' => array('gml'),
+                'gnuplot' => array('plt'),
+                'groovy' => array('groovy'),
+                'haskell' => array('hs'),
                 'html4strict' => array('html', 'htm'),
+                'ini' => array('ini', 'desktop'),
                 'java' => array('java'),
                 'javascript' => array('js'),
+                'klonec' => array('kl1'),
+                'klonecpp' => array('klx'),
+                'latex' => array('tex'),
                 'lisp' => array('lisp'),
                 'lua' => array('lua'),
+                'matlab' => array('m'),
                 'mpasm' => array(),
+                'mysql' => array('sql'),
                 'nsis' => array(),
                 'objc' => array(),
                 'oobas' => array(),
                 'oracle8' => array(),
+                'oracle10' => array(),
                 'pascal' => array('pas'),
                 'perl' => array('pl', 'pm'),
                 'php' => array('php', 'php5', 'phtml', 'phps'),
+                'povray' => array('pov'),
+                'providex' => array('pvc', 'pvx'),
+                'prolog' => array('pl'),
                 'python' => array('py'),
                 'qbasic' => array('bi'),
+                'reg' => array('reg'),
+                'ruby' => array('rb'),
                 'sas' => array('sas'),
+                'scala' => array('scala'),
+                'scheme' => array('scm'),
+                'scilab' => array('sci'),
+                'smalltalk' => array('st'),
                 'smarty' => array(),
+                'tcl' => array('tcl'),
                 'vb' => array('bas'),
                 'vbnet' => array(),
                 'visualfoxpro' => array(),
-                'xml' => array('xml')
+                'whitespace' => array('ws'),
+                'xml' => array('xml', 'svg', 'xrc'),
+                'z80' => array('z80', 'asm', 'inc')
             );
         }
 
         foreach ($lookup as $lang => $extensions) {
-            foreach ($extensions as $ext) {
-                if ($ext == $extension) {
-                    return $lang;
-                }
+            if (in_array($extension, $extensions)) {
+                return $lang;
             }
         }
         return '';
@@ -1106,15 +1536,16 @@
      *   'lang_name' ...
      * );</pre>
      *
+     * @param string The filename to load the source from
+     * @param array  A lookup array to use instead of the default one
      * @todo Complete rethink of this and above method
      * @since 1.0.5
      */
     function load_from_file($file_name, $lookup = array()) {
         if (is_readable($file_name)) {
-            $this->set_source(implode('', file($file_name)));
+            $this->set_source(file_get_contents($file_name));
             $this->set_language($this->get_language_name_from_extension(substr(strrchr($file_name, '.'), 1), $lookup));
-        }
-        else {
+        } else {
             $this->error = GESHI_ERROR_FILE_NOT_READABLE;
         }
     }
@@ -1127,7 +1558,15 @@
      * @since 1.0.0
      */
     function add_keyword($key, $word) {
-        $this->language_data['KEYWORDS'][$key][] = $word;
+        if (!in_array($word, $this->language_data['KEYWORDS'][$key])) {
+            $this->language_data['KEYWORDS'][$key][] = $word;
+
+            //NEW in 1.0.8 don't recompile the whole optimized regexp, simply append it
+            if ($this->parse_cache_built) {
+                $subkey = count($this->language_data['CACHED_KEYWORD_LISTS'][$key]) - 1;
+                $this->language_data['CACHED_KEYWORD_LISTS'][$key][$subkey] .= '|' . preg_quote($word, '/');
+            }
+        }
     }
 
     /**
@@ -1135,11 +1574,24 @@
      *
      * @param int    The key of the keyword group to remove the keyword from
      * @param string The word to remove from the keyword group
+     * @param bool   Wether to automatically recompile the optimized regexp list or not.
+     *               Note: if you set this to false and @see GeSHi->parse_code() was already called once,
+     *               for the current language, you have to manually call @see GeSHi->optimize_keyword_group()
+     *               or the removed keyword will stay in cache and still be highlighted! On the other hand
+     *               it might be too expensive to recompile the regexp list for every removal if you want to
+     *               remove a lot of keywords.
      * @since 1.0.0
      */
-    function remove_keyword($key, $word) {
-        $this->language_data['KEYWORDS'][$key] =
-            array_diff($this->language_data['KEYWORDS'][$key], array($word));
+    function remove_keyword($key, $word, $recompile = true) {
+        $key_to_remove = array_search($word, $this->language_data['KEYWORDS'][$key]);
+        if ($key_to_remove !== false) {
+            unset($this->language_data['KEYWORDS'][$key][$key_to_remove]);
+
+            //NEW in 1.0.8, optionally recompile keyword group
+            if ($recompile && $this->parse_cache_built) {
+                $this->optimize_keyword_group($key);
+            }
+        }
     }
 
     /**
@@ -1153,10 +1605,21 @@
      */
     function add_keyword_group($key, $styles, $case_sensitive = true, $words = array()) {
         $words = (array) $words;
+        if  (empty($words)) {
+            // empty word lists mess up highlighting
+            return false;
+        }
+
+        //Add the new keyword group internally
         $this->language_data['KEYWORDS'][$key] = $words;
         $this->lexic_permissions['KEYWORDS'][$key] = true;
         $this->language_data['CASE_SENSITIVE'][$key] = $case_sensitive;
         $this->language_data['STYLES']['KEYWORDS'][$key] = $styles;
+
+        //NEW in 1.0.8, cache keyword regexp
+        if ($this->parse_cache_built) {
+            $this->optimize_keyword_group($key);
+        }
     }
 
     /**
@@ -1166,10 +1629,44 @@
      * @since 1.0.0
      */
     function remove_keyword_group ($key) {
+        //Remove the keyword group internally
         unset($this->language_data['KEYWORDS'][$key]);
         unset($this->lexic_permissions['KEYWORDS'][$key]);
         unset($this->language_data['CASE_SENSITIVE'][$key]);
         unset($this->language_data['STYLES']['KEYWORDS'][$key]);
+
+        //NEW in 1.0.8
+        unset($this->language_data['CACHED_KEYWORD_LISTS'][$key]);
+    }
+
+    /**
+     * compile optimized regexp list for keyword group
+     *
+     * @param int   The key of the keyword group to compile & optimize
+     * @since 1.0.8
+     */
+    function optimize_keyword_group($key) {
+        $this->language_data['CACHED_KEYWORD_LISTS'][$key] =
+            $this->optimize_regexp_list($this->language_data['KEYWORDS'][$key]);
+        $space_as_whitespace = false;
+        if(isset($this->language_data['PARSER_CONTROL'])) {
+            if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'])) {
+                if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS']['SPACE_AS_WHITESPACE'])) {
+                    $space_as_whitespace = $this->language_data['PARSER_CONTROL']['KEYWORDS']['SPACE_AS_WHITESPACE'];
+                }
+                if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE'])) {
+                    if(isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE'])) {
+                        $space_as_whitespace = $this->language_data['PARSER_CONTROL']['KEYWORDS'][$key]['SPACE_AS_WHITESPACE'];
+                    }
+                }
+            }
+        }
+        if($space_as_whitespace) {
+            foreach($this->language_data['CACHED_KEYWORD_LISTS'][$key] as $rxk => $rxv) {
+                $this->language_data['CACHED_KEYWORD_LISTS'][$key][$rxk] =
+                    str_replace(" ", "\\s+", $rxv);
+            }
+        }
     }
 
     /**
@@ -1213,6 +1710,17 @@
     }
 
     /**
+     * Sets whether to force a surrounding block around
+     * the highlighted code or not
+     *
+     * @param boolean Tells whether to enable or disable this feature
+     * @since 1.0.7.20
+     */
+    function enable_inner_code_block($flag) {
+        $this->force_code_block = (bool)$flag;
+    }
+
+    /**
      * Sets the base URL to be used for keywords
      *
      * @param int The key of the keyword group to set the URL for
@@ -1246,9 +1754,8 @@
     function set_link_target($target) {
         if (!$target) {
             $this->link_target = '';
-        }
-        else {
-            $this->link_target = ' target="' . $target . '" ';
+        } else {
+            $this->link_target = ' target="' . $target . '"';
         }
     }
 
@@ -1265,8 +1772,10 @@
     /**
      * Sets whether context-important blocks are highlighted
      *
+     * @param boolean Tells whether to enable or disable highlighting of important blocks
      * @todo REMOVE THIS SHIZ FROM GESHI!
      * @deprecated
+     * @since 1.0.2
      */
     function enable_important_blocks($flag) {
         $this->enable_important_blocks = ( $flag ) ? true : false;
@@ -1285,19 +1794,37 @@
     /**
      * Specifies which lines to highlight extra
      *
+     * The extra style parameter was added in 1.0.7.21.
+     *
      * @param mixed An array of line numbers to highlight, or just a line
      *              number on its own.
+     * @param string A string specifying the style to use for this line.
+     *              If null is specified, the default style is used.
+     *              If false is specified, the line will be removed from
+     *              special highlighting
      * @since 1.0.2
      * @todo  Some data replication here that could be cut down on
      */
-    function highlight_lines_extra($lines) {
+    function highlight_lines_extra($lines, $style = null) {
         if (is_array($lines)) {
+            //Split up the job using single lines at a time
             foreach ($lines as $line) {
-                $this->highlight_extra_lines[intval($line)] = intval($line);
+                $this->highlight_lines_extra($line, $style);
+            }
+        } else {
+            //Mark the line as being highlighted specially
+            $lines = intval($lines);
+            $this->highlight_extra_lines[$lines] = $lines;
+
+            //Decide on which style to use
+            if ($style === null) { //Check if we should use default style
+                unset($this->highlight_extra_lines_styles[$lines]);
+            } else if ($style === false) { //Check if to remove this line
+                unset($this->highlight_extra_lines[$lines]);
+                unset($this->highlight_extra_lines_styles[$lines]);
+            } else {
+                $this->highlight_extra_lines_styles[$lines] = $style;
             }
-        }
-        else {
-            $this->highlight_extra_lines[intval($lines)] = intval($lines);
         }
     }
 
@@ -1312,6 +1839,16 @@
     }
 
     /**
+     * Sets the line-ending
+     *
+     * @param string The new line-ending
+     * @since 1.0.2
+     */
+    function set_line_ending($line_ending) {
+        $this->line_ending = (string)$line_ending;
+    }
+
+    /**
      * Sets what number line numbers should start at. Should
      * be a positive integer, and will be converted to one.
      *
@@ -1344,7 +1881,7 @@
      */
     function set_encoding($encoding) {
         if ($encoding) {
-          $this->encoding = $encoding;
+          $this->encoding = strtolower($encoding);
         }
     }
 
@@ -1352,18 +1889,251 @@
      * Turns linking of keywords on or off.
      *
      * @param boolean If true, links will be added to keywords
+     * @since 1.0.2
      */
     function enable_keyword_links($enable = true) {
-        $this->keyword_links = ($enable) ? true : false;
+        $this->keyword_links = (bool) $enable;
     }
 
     /**
-     * Returns the code in $this->source, highlighted and surrounded by the
-     * nessecary HTML.
-     *
-     * This should only be called ONCE, cos it's SLOW! If you want to highlight
-     * the same source multiple times, you're better off doing a whole lot of
-     * str_replaces to replace the &lt;span&gt;s
+     * Setup caches needed for styling. This is automatically called in
+     * parse_code() and get_stylesheet() when appropriate. This function helps
+     * stylesheet generators as they rely on some style information being
+     * preprocessed
+     *
+     * @since 1.0.8
+     * @access private
+     */
+    function build_style_cache() {
+        //Build the style cache needed to highlight numbers appropriate
+        if($this->lexic_permissions['NUMBERS']) {
+            //First check what way highlighting information for numbers are given
+            if(!isset($this->language_data['NUMBERS'])) {
+                $this->language_data['NUMBERS'] = 0;
+            }
+
+            if(is_array($this->language_data['NUMBERS'])) {
+                $this->language_data['NUMBERS_CACHE'] = $this->language_data['NUMBERS'];
+            } else {
+                $this->language_data['NUMBERS_CACHE'] = array();
+                if(!$this->language_data['NUMBERS']) {
+                    $this->language_data['NUMBERS'] =
+                        GESHI_NUMBER_INT_BASIC |
+                        GESHI_NUMBER_FLT_NONSCI;
+                }
+
+                for($i = 0, $j = $this->language_data['NUMBERS']; $j > 0; ++$i, $j>>=1) {
+                    //Rearrange style indices if required ...
+                    if(isset($this->language_data['STYLES']['NUMBERS'][1<<$i])) {
+                        $this->language_data['STYLES']['NUMBERS'][$i] =
+                            $this->language_data['STYLES']['NUMBERS'][1<<$i];
+                        unset($this->language_data['STYLES']['NUMBERS'][1<<$i]);
+                    }
+
+                    //Check if this bit is set for highlighting
+                    if($j&1) {
+                        //So this bit is set ...
+                        //Check if it belongs to group 0 or the actual stylegroup
+                        if(isset($this->language_data['STYLES']['NUMBERS'][$i])) {
+                            $this->language_data['NUMBERS_CACHE'][$i] = 1 << $i;
+                        } else {
+                            if(!isset($this->language_data['NUMBERS_CACHE'][0])) {
+                                $this->language_data['NUMBERS_CACHE'][0] = 0;
+                            }
+                            $this->language_data['NUMBERS_CACHE'][0] |= 1 << $i;
+                        }
+                    }
+                }
+            }
+        }
+    }
+
+    /**
+     * Setup caches needed for parsing. This is automatically called in parse_code() when appropriate.
+     * This function makes stylesheet generators much faster as they do not need these caches.
+     *
+     * @since 1.0.8
+     * @access private
+     */
+    function build_parse_cache() {
+        // cache symbol regexp
+        //As this is a costy operation, we avoid doing it for multiple groups ...
+        //Instead we perform it for all symbols at once.
+        //
+        //For this to work, we need to reorganize the data arrays.
+        if ($this->lexic_permissions['SYMBOLS'] && !empty($this->language_data['SYMBOLS'])) {
+            $this->language_data['MULTIPLE_SYMBOL_GROUPS'] = count($this->language_data['STYLES']['SYMBOLS']) > 1;
+
+            $this->language_data['SYMBOL_DATA'] = array();
+            $symbol_preg_multi = array(); // multi char symbols
+            $symbol_preg_single = array(); // single char symbols
+            foreach ($this->language_data['SYMBOLS'] as $key => $symbols) {
+                if (is_array($symbols)) {
+                    foreach ($symbols as $sym) {
+                        $sym = $this->hsc($sym);
+                        if (!isset($this->language_data['SYMBOL_DATA'][$sym])) {
+                            $this->language_data['SYMBOL_DATA'][$sym] = $key;
+                            if (isset($sym[1])) { // multiple chars
+                                $symbol_preg_multi[] = preg_quote($sym, '/');
+                            } else { // single char
+                                if ($sym == '-') {
+                                    // don't trigger range out of order error
+                                    $symbol_preg_single[] = '\-';
+                                } else {
+                                    $symbol_preg_single[] = preg_quote($sym, '/');
+                                }
+                            }
+                        }
+                    }
+                } else {
+                    $symbols = $this->hsc($symbols);
+                    if (!isset($this->language_data['SYMBOL_DATA'][$symbols])) {
+                        $this->language_data['SYMBOL_DATA'][$symbols] = 0;
+                        if (isset($symbols[1])) { // multiple chars
+                            $symbol_preg_multi[] = preg_quote($symbols, '/');
+                        } else if ($symbols == '-') {
+                            // don't trigger range out of order error
+                            $symbol_preg_single[] = '\-';
+                        } else { // single char
+                            $symbol_preg_single[] = preg_quote($symbols, '/');
+                        }
+                    }
+                }
+            }
+
+            //Now we have an array with each possible symbol as the key and the style as the actual data.
+            //This way we can set the correct style just the moment we highlight ...
+            //
+            //Now we need to rewrite our array to get a search string that
+            $symbol_preg = array();
+            if (!empty($symbol_preg_multi)) {
+                rsort($symbol_preg_multi);
+                $symbol_preg[] = implode('|', $symbol_preg_multi);
+            }
+            if (!empty($symbol_preg_single)) {
+                rsort($symbol_preg_single);
+                $symbol_preg[] = '[' . implode('', $symbol_preg_single) . ']';
+            }
+            $this->language_data['SYMBOL_SEARCH'] = implode("|", $symbol_preg);
+        }
+
+        // cache optimized regexp for keyword matching
+        // remove old cache
+        $this->language_data['CACHED_KEYWORD_LISTS'] = array();
+        foreach (array_keys($this->language_data['KEYWORDS']) as $key) {
+            if (!isset($this->lexic_permissions['KEYWORDS'][$key]) ||
+                    $this->lexic_permissions['KEYWORDS'][$key]) {
+                $this->optimize_keyword_group($key);
+            }
+        }
+
+        // brackets
+        if ($this->lexic_permissions['BRACKETS']) {
+            $this->language_data['CACHE_BRACKET_MATCH'] = array('[', ']', '(', ')', '{', '}');
+            if (!$this->use_classes && isset($this->language_data['STYLES']['BRACKETS'][0])) {
+                $this->language_data['CACHE_BRACKET_REPLACE'] = array(
+                    '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#91;|>',
+                    '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#93;|>',
+                    '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#40;|>',
+                    '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#41;|>',
+                    '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#123;|>',
+                    '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#125;|>',
+                );
+            }
+            else {
+                $this->language_data['CACHE_BRACKET_REPLACE'] = array(
+                    '<| class="br0">&#91;|>',
+                    '<| class="br0">&#93;|>',
+                    '<| class="br0">&#40;|>',
+                    '<| class="br0">&#41;|>',
+                    '<| class="br0">&#123;|>',
+                    '<| class="br0">&#125;|>',
+                );
+            }
+        }
+
+        //Build the parse cache needed to highlight numbers appropriate
+        if($this->lexic_permissions['NUMBERS']) {
+            //Check if the style rearrangements have been processed ...
+            //This also does some preprocessing to check which style groups are useable ...
+            if(!isset($this->language_data['NUMBERS_CACHE'])) {
+                $this->build_style_cache();
+            }
+
+            //Number format specification
+            //All this formats are matched case-insensitively!
+            static $numbers_format = array(
+                GESHI_NUMBER_INT_BASIC =>
+                    '(?:(?<![0-9a-z_\.%$@])|(?<=\.\.))(?<![\d\.]e[+\-])([1-9]\d*?|0)(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
+                GESHI_NUMBER_INT_CSTYLE =>
+                    '(?<![0-9a-z_\.%])(?<![\d\.]e[+\-])([1-9]\d*?|0)l(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
+                GESHI_NUMBER_BIN_SUFFIX =>
+                    '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])[01]+?[bB](?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
+                GESHI_NUMBER_BIN_PREFIX_PERCENT =>
+                    '(?<![0-9a-z_\.%])(?<![\d\.]e[+\-])%[01]+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
+                GESHI_NUMBER_BIN_PREFIX_0B =>
+                    '(?<![0-9a-z_\.%])(?<![\d\.]e[+\-])0b[01]+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
+                GESHI_NUMBER_OCT_PREFIX =>
+                    '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])0[0-7]+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
+                GESHI_NUMBER_OCT_PREFIX_0O =>
+                    '(?<![0-9a-z_\.%])(?<![\d\.]e[+\-])0o[0-7]+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
+                GESHI_NUMBER_OCT_PREFIX_AT =>
+                    '(?<![0-9a-z_\.%])(?<![\d\.]e[+\-])\@[0-7]+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
+                GESHI_NUMBER_OCT_SUFFIX =>
+                    '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])[0-7]+?o(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
+                GESHI_NUMBER_HEX_PREFIX =>
+                    '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])0x[0-9a-fA-F]+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
+                GESHI_NUMBER_HEX_PREFIX_DOLLAR =>
+                    '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])\$[0-9a-fA-F]+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
+                GESHI_NUMBER_HEX_SUFFIX =>
+                    '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])\d[0-9a-fA-F]*?[hH](?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
+                GESHI_NUMBER_FLT_NONSCI =>
+                    '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])\d+?\.\d+?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
+                GESHI_NUMBER_FLT_NONSCI_F =>
+                    '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])(?:\d+?(?:\.\d*?)?|\.\d+?)f(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
+                GESHI_NUMBER_FLT_SCI_SHORT =>
+                    '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])\.\d+?(?:e[+\-]?\d+?)?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)',
+                GESHI_NUMBER_FLT_SCI_ZERO =>
+                    '(?<![0-9a-z_\.])(?<![\d\.]e[+\-])(?:\d+?(?:\.\d*?)?|\.\d+?)(?:e[+\-]?\d+?)?(?![0-9a-z]|\.(?:[eE][+\-]?)?\d)'
+                );
+
+            //At this step we have an associative array with flag groups for a
+            //specific style or an string denoting a regexp given its index.
+            $this->language_data['NUMBERS_RXCACHE'] = array();
+            foreach($this->language_data['NUMBERS_CACHE'] as $key => $rxdata) {
+                if(is_string($rxdata)) {
+                    $regexp = $rxdata;
+                } else {
+                    //This is a bitfield of number flags to highlight:
+                    //Build an array, implode them together and make this the actual RX
+                    $rxuse = array();
+                    for($i = 1; $i <= $rxdata; $i<<=1) {
+                        if($rxdata & $i) {
+                            $rxuse[] = $numbers_format[$i];
+                        }
+                    }
+                    $regexp = implode("|", $rxuse);
+                }
+
+                $this->language_data['NUMBERS_RXCACHE'][$key] =
+                    "/(?<!<\|\/)(?<!<\|!REG3XP)(?<!<\|\/NUM!)(?<!\d\/>)($regexp)(?!(?:<DOT>|(?>[^\<]))+>)(?![^<]*>)(?!\|>)(?!\/>)/i"; //
+            }
+
+            if(!isset($this->language_data['PARSER_CONTROL']['NUMBERS']['PRECHECK_RX'])) {
+                $this->language_data['PARSER_CONTROL']['NUMBERS']['PRECHECK_RX'] = '#\d#';
+            }
+        }
+
+        $this->parse_cache_built = true;
+    }
+
+    /**
+     * Returns the code in $this->source, highlighted and surrounded by the
+     * nessecary HTML.
+     *
+     * This should only be called ONCE, cos it's SLOW! If you want to highlight
+     * the same source multiple times, you're better off doing a whole lot of
+     * str_replaces to replace the &lt;span&gt;s
      *
      * @since 1.0.0
      */
@@ -1371,34 +2141,35 @@
         // Start the timer
         $start_time = microtime();
 
+        // Replace all newlines to a common form.
+        $code = str_replace("\r\n", "\n", $this->source);
+        $code = str_replace("\r", "\n", $code);
+
         // Firstly, if there is an error, we won't highlight
         if ($this->error) {
-            $result = GeSHi::hsc($this->source);
+            //Escape the source for output
+            $result = $this->hsc($this->source);
+
+            //This fix is related to SF#1923020, but has to be applied regardless of
+            //actually highlighting symbols.
+            $result = str_replace(array('<SEMI>', '<PIPE>'), array(';', '|'), $result);
+
             // Timing is irrelevant
             $this->set_time($start_time, $start_time);
-            return $this->finalise($result);
+            $this->finalise($result);
+            return $result;
         }
 
-        // Replace all newlines to a common form.
-        $code = str_replace("\r\n", "\n", $this->source);
-        $code = str_replace("\r", "\n", $code);
-        // Add spaces for regular expression matching and line numbers
-        $code = "\n" . $code . "\n";
+        // make sure the parse cache is up2date
+        if (!$this->parse_cache_built) {
+            $this->build_parse_cache();
+        }
 
         // Initialise various stuff
         $length           = strlen($code);
-        $STRING_OPEN      = '';
-        $CLOSE_STRING     = false;
-        $ESCAPE_CHAR_OPEN = false;
         $COMMENT_MATCHED  = false;
-        // Turn highlighting on if strict mode doesn't apply to this language
-        $HIGHLIGHTING_ON  = ( !$this->strict_mode ) ? true : '';
-        // Whether to highlight inside a block of code
-        $HIGHLIGHT_INSIDE_STRICT = false;
-        $HARDQUOTE_OPEN = false;
-        $STRICTATTRS = '';
         $stuff_to_parse   = '';
-        $result           = '';
+        $endresult        = '';
 
         // "Important" selections are handled like multiline comments
         // @todo GET RID OF THIS SHIZ
@@ -1409,446 +2180,957 @@
         if ($this->strict_mode) {
             // Break the source into bits. Each bit will be a portion of the code
             // within script delimiters - for example, HTML between < and >
-            $parts = array(0 => array(0 => ''));
             $k = 0;
-            for ($i = 0; $i < $length; $i++) {
-                $char = substr($code, $i, 1);
-                if (!$HIGHLIGHTING_ON) {
-                    foreach ($this->language_data['SCRIPT_DELIMITERS'] as $key => $delimiters) {
+            $parts = array();
+            $matches = array();
+            $next_match_pointer = null;
+            // we use a copy to unset delimiters on demand (when they are not found)
+            $delim_copy = $this->language_data['SCRIPT_DELIMITERS'];
+            $i = 0;
+            while ($i < $length) {
+                $next_match_pos = $length + 1; // never true
+                foreach ($delim_copy as $dk => $delimiters) {
+                    if(is_array($delimiters)) {
                         foreach ($delimiters as $open => $close) {
+                            // make sure the cache is setup properly
+                            if (!isset($matches[$dk][$open])) {
+                                $matches[$dk][$open] = array(
+                                    'next_match' => -1,
+                                    'dk' => $dk,
+
+                                    'open' => $open, // needed for grouping of adjacent code blocks (see below)
+                                    'open_strlen' => strlen($open),
+
+                                    'close' => $close,
+                                    'close_strlen' => strlen($close),
+                                );
+                            }
                             // Get the next little bit for this opening string
-                            $check = substr($code, $i, strlen($open));
-                            // If it matches...
-                            if ($check == $open) {
-                                // We start a new block with the highlightable
-                                // code in it
-                                $HIGHLIGHTING_ON = $open;
-                                $i += strlen($open) - 1;
-                                $char = $open;
-                                $parts[++$k][0] = $char;
+                            if ($matches[$dk][$open]['next_match'] < $i) {
+                                // only find the next pos if it was not already cached
+                                $open_pos = strpos($code, $open, $i);
+                                if ($open_pos === false) {
+                                    // no match for this delimiter ever
+                                    unset($delim_copy[$dk][$open]);
+                                    continue;
+                                }
+                                $matches[$dk][$open]['next_match'] = $open_pos;
+                            }
+                            if ($matches[$dk][$open]['next_match'] < $next_match_pos) {
+                                //So we got a new match, update the close_pos
+                                $matches[$dk][$open]['close_pos'] =
+                                    strpos($code, $close, $matches[$dk][$open]['next_match']+1);
 
-                                // No point going around again...
-                                break(2);
+                                $next_match_pointer =& $matches[$dk][$open];
+                                $next_match_pos = $matches[$dk][$open]['next_match'];
                             }
                         }
+                    } else {
+                        //So we should match an RegExp as Strict Block ...
+                        /**
+                         * The value in $delimiters is expected to be an RegExp
+                         * containing exactly 2 matching groups:
+                         *  - Group 1 is the opener
+                         *  - Group 2 is the closer
+                         */
+                        if(!GESHI_PHP_PRE_433 && //Needs proper rewrite to work with PHP >=4.3.0; 4.3.3 is guaranteed to work.
+                            preg_match($delimiters, $code, $matches_rx, PREG_OFFSET_CAPTURE, $i)) {
+                            //We got a match ...
+                            if(isset($matches_rx['start']) && isset($matches_rx['end']))
+                            {
+                                $matches[$dk] = array(
+                                    'next_match' => $matches_rx['start'][1],
+                                    'dk' => $dk,
+
+                                    'close_strlen' => strlen($matches_rx['end'][0]),
+                                    'close_pos' => $matches_rx['end'][1],
+                                    );
+                            } else {
+                                $matches[$dk] = array(
+                                    'next_match' => $matches_rx[1][1],
+                                    'dk' => $dk,
+
+                                    'close_strlen' => strlen($matches_rx[2][0]),
+                                    'close_pos' => $matches_rx[2][1],
+                                    );
+                            }
+                        } else {
+                            // no match for this delimiter ever
+                            unset($delim_copy[$dk]);
+                            continue;
+                        }
+
+                        if ($matches[$dk]['next_match'] <= $next_match_pos) {
+                            $next_match_pointer =& $matches[$dk];
+                            $next_match_pos = $matches[$dk]['next_match'];
+                        }
                     }
                 }
-                else {
-                    foreach ($this->language_data['SCRIPT_DELIMITERS'] as $key => $delimiters) {
-                        foreach ($delimiters as $open => $close) {
-                            if ($open == $HIGHLIGHTING_ON) {
-                                // Found the closing tag
-                                break(2);
+
+                // non-highlightable text
+                $parts[$k] = array(
+                    1 => substr($code, $i, $next_match_pos - $i)
+                );
+                ++$k;
+
+                if ($next_match_pos > $length) {
+                    // out of bounds means no next match was found
+                    break;
+                }
+
+                // highlightable code
+                $parts[$k][0] = $next_match_pointer['dk'];
+
+                //Only combine for non-rx script blocks
+                if(is_array($delim_copy[$next_match_pointer['dk']])) {
+                    // group adjacent script blocks, e.g. <foobar><asdf> should be one block, not three!
+                    $i = $next_match_pos + $next_match_pointer['open_strlen'];
+                    while (true) {
+                        $close_pos = strpos($code, $next_match_pointer['close'], $i);
+                        if ($close_pos == false) {
+                            break;
+                        }
+                        $i = $close_pos + $next_match_pointer['close_strlen'];
+                        if ($i == $length) {
+                            break;
+                        }
+                        if ($code[$i] == $next_match_pointer['open'][0] && ($next_match_pointer['open_strlen'] == 1 ||
+                            substr($code, $i, $next_match_pointer['open_strlen']) == $next_match_pointer['open'])) {
+                            // merge adjacent but make sure we don't merge things like <tag><!-- comment -->
+                            foreach ($matches as $submatches) {
+                                foreach ($submatches as $match) {
+                                    if ($match['next_match'] == $i) {
+                                        // a different block already matches here!
+                                        break 3;
+                                    }
+                                }
                             }
+                        } else {
+                            break;
                         }
                     }
-                    // We check code from our current position BACKWARDS. This is so
-                    // the ending string for highlighting can be included in the block
-                    $check = substr($code, $i - strlen($close) + 1, strlen($close));
-                    if ($check == $close) {
-                        $HIGHLIGHTING_ON = '';
-                        // Add the string to the rest of the string for this part
-                        $parts[$k][1] = ( isset($parts[$k][1]) ) ? $parts[$k][1] . $char : $char;
-                        $parts[++$k][0] = '';
-                        $char = '';
-                    }
+                } else {
+                    $close_pos = $next_match_pointer['close_pos'] + $next_match_pointer['close_strlen'];
+                    $i = $close_pos;
+                }
+
+                if ($close_pos === false) {
+                    // no closing delimiter found!
+                    $parts[$k][1] = substr($code, $next_match_pos);
+                    ++$k;
+                    break;
+                } else {
+                    $parts[$k][1] = substr($code, $next_match_pos, $i - $next_match_pos);
+                    ++$k;
                 }
-                $parts[$k][1] = ( isset($parts[$k][1]) ) ? $parts[$k][1] . $char : $char;
             }
-            $HIGHLIGHTING_ON = '';
-        }
-        else {
+            unset($delim_copy, $next_match_pointer, $next_match_pos, $matches);
+            $num_parts = $k;
+
+            if ($num_parts == 1 && $this->strict_mode == GESHI_MAYBE) {
+                // when we have only one part, we don't have anything to highlight at all.
+                // if we have a "maybe" strict language, this should be handled as highlightable code
+                $parts = array(
+                    0 => array(
+                        0 => '',
+                        1 => ''
+                    ),
+                    1 => array(
+                        0 => null,
+                        1 => $parts[0][1]
+                    )
+                );
+                $num_parts = 2;
+            }
+
+        } else {
             // Not strict mode - simply dump the source into
             // the array at index 1 (the first highlightable block)
             $parts = array(
-                1 => array(
+                0 => array(
                     0 => '',
+                    1 => ''
+                ),
+                1 => array(
+                    0 => null,
                     1 => $code
                 )
             );
+            $num_parts = 2;
+        }
+
+        //Unset variables we won't need any longer
+        unset($code);
+
+        //Preload some repeatedly used values regarding hardquotes ...
+        $hq = isset($this->language_data['HARDQUOTE']) ? $this->language_data['HARDQUOTE'][0] : false;
+        $hq_strlen = strlen($hq);
+
+        //Preload if line numbers are to be generated afterwards
+        //Added a check if line breaks should be forced even without line numbers, fixes SF#1727398
+        $check_linenumbers = $this->line_numbers != GESHI_NO_LINE_NUMBERS ||
+            !empty($this->highlight_extra_lines) || !$this->allow_multiline_span;
+
+        //preload the escape char for faster checking ...
+        $escaped_escape_char = $this->hsc($this->language_data['ESCAPE_CHAR']);
+
+        // this is used for single-line comments
+        $sc_disallowed_before = "";
+        $sc_disallowed_after = "";
+
+        if (isset($this->language_data['PARSER_CONTROL'])) {
+            if (isset($this->language_data['PARSER_CONTROL']['COMMENTS'])) {
+                if (isset($this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_BEFORE'])) {
+                    $sc_disallowed_before = $this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_BEFORE'];
+                }
+                if (isset($this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_AFTER'])) {
+                    $sc_disallowed_after = $this->language_data['PARSER_CONTROL']['COMMENTS']['DISALLOWED_AFTER'];
+                }
+            }
+        }
+
+        //Fix for SF#1932083: Multichar Quotemarks unsupported
+        $is_string_starter = array();
+        if ($this->lexic_permissions['STRINGS']) {
+            foreach ($this->language_data['QUOTEMARKS'] as $quotemark) {
+                if (!isset($is_string_starter[$quotemark[0]])) {
+                    $is_string_starter[$quotemark[0]] = (string)$quotemark;
+                } else if (is_string($is_string_starter[$quotemark[0]])) {
+                    $is_string_starter[$quotemark[0]] = array(
+                        $is_string_starter[$quotemark[0]],
+                        $quotemark);
+                } else {
+                    $is_string_starter[$quotemark[0]][] = $quotemark;
+                }
+            }
         }
 
         // Now we go through each part. We know that even-indexed parts are
         // code that shouldn't be highlighted, and odd-indexed parts should
         // be highlighted
-        foreach ($parts as $key => $data) {
-            $part = $data[1];
+        for ($key = 0; $key < $num_parts; ++$key) {
+            $STRICTATTRS = '';
+
             // If this block should be highlighted...
-            if ($key % 2) {
-                if ($this->strict_mode) {
-                    // Find the class key for this block of code
-                    foreach ($this->language_data['SCRIPT_DELIMITERS'] as $script_key => $script_data) {
-                        foreach ($script_data as $open => $close) {
-                            if ($data[0] == $open) {
-                                break(2);
-                            }
-                        }
-                    }
+            if (!($key & 1)) {
+                // Else not a block to highlight
+                $endresult .= $this->hsc($parts[$key][1]);
+                unset($parts[$key]);
+                continue;
+            }
 
-                    if ($this->language_data['STYLES']['SCRIPT'][$script_key] != '' &&
-                        $this->lexic_permissions['SCRIPT']) {
-                        // Add a span element around the source to
-                        // highlight the overall source block
-                        if (!$this->use_classes &&
-                            $this->language_data['STYLES']['SCRIPT'][$script_key] != '') {
-                            $attributes = ' style="' . $this->language_data['STYLES']['SCRIPT'][$script_key] . '"';
-                        }
-                        else {
-                            $attributes = ' class="sc' . $script_key . '"';
-                        }
-                        $result .= "<span$attributes>";
-                        $STRICTATTRS = $attributes;
+            $result = '';
+            $part = $parts[$key][1];
+
+            $highlight_part = true;
+            if ($this->strict_mode && !is_null($parts[$key][0])) {
+                // get the class key for this block of code
+                $script_key = $parts[$key][0];
+                $highlight_part = $this->language_data['HIGHLIGHT_STRICT_BLOCK'][$script_key];
+                if ($this->language_data['STYLES']['SCRIPT'][$script_key] != '' &&
+                    $this->lexic_permissions['SCRIPT']) {
+                    // Add a span element around the source to
+                    // highlight the overall source block
+                    if (!$this->use_classes &&
+                        $this->language_data['STYLES']['SCRIPT'][$script_key] != '') {
+                        $attributes = ' style="' . $this->language_data['STYLES']['SCRIPT'][$script_key] . '"';
+                    } else {
+                        $attributes = ' class="sc' . $script_key . '"';
                     }
+                    $result .= "<span$attributes>";
+                    $STRICTATTRS = $attributes;
                 }
+            }
 
-                if (!$this->strict_mode || $this->language_data['HIGHLIGHT_STRICT_BLOCK'][$script_key]) {
-                    // Now, highlight the code in this block. This code
-                    // is really the engine of GeSHi (along with the method
-                    // parse_non_string_part).
-                    $length = strlen($part);
-                    for ($i = 0; $i < $length; $i++) {
-                        // Get the next char
-                        $char = substr($part, $i, 1);
-                        $hq = isset($this->language_data['HARDQUOTE']) ? $this->language_data['HARDQUOTE'][0] : false;
-                        // Is this char the newline and line numbers being used?
-                        if (($this->line_numbers != GESHI_NO_LINE_NUMBERS
-                            || count($this->highlight_extra_lines) > 0)
-                            && $char == "\n") {
-                            // If so, is there a string open? If there is, we should end it before
-                            // the newline and begin it again (so when <li>s are put in the source
-                            // remains XHTML compliant)
-                            // note to self: This opens up possibility of config files specifying
-                            // that languages can/cannot have multiline strings???
-                            if ($STRING_OPEN) {
-                                if (!$this->use_classes) {
-                                    $attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][0] . '"';
+            if ($highlight_part) {
+                // Now, highlight the code in this block. This code
+                // is really the engine of GeSHi (along with the method
+                // parse_non_string_part).
+
+                // cache comment regexps incrementally
+                $next_comment_regexp_key = '';
+                $next_comment_regexp_pos = -1;
+                $next_comment_multi_pos = -1;
+                $next_comment_single_pos = -1;
+                $comment_regexp_cache_per_key = array();
+                $comment_multi_cache_per_key = array();
+                $comment_single_cache_per_key = array();
+                $next_open_comment_multi = '';
+                $next_comment_single_key = '';
+                $escape_regexp_cache_per_key = array();
+                $next_escape_regexp_key = '';
+                $next_escape_regexp_pos = -1;
+
+                $length = strlen($part);
+                for ($i = 0; $i < $length; ++$i) {
+                    // Get the next char
+                    $char = $part[$i];
+                    $char_len = 1;
+
+                    // update regexp comment cache if needed
+                    if (isset($this->language_data['COMMENT_REGEXP']) && $next_comment_regexp_pos < $i) {
+                        $next_comment_regexp_pos = $length;
+                        foreach ($this->language_data['COMMENT_REGEXP'] as $comment_key => $regexp) {
+                            $match_i = false;
+                            if (isset($comment_regexp_cache_per_key[$comment_key]) &&
+                                ($comment_regexp_cache_per_key[$comment_key]['pos'] >= $i ||
+                                 $comment_regexp_cache_per_key[$comment_key]['pos'] === false)) {
+                                // we have already matched something
+                                if ($comment_regexp_cache_per_key[$comment_key]['pos'] === false) {
+                                    // this comment is never matched
+                                    continue;
                                 }
-                                else {
-                                    $attributes = ' class="st0"';
+                                $match_i = $comment_regexp_cache_per_key[$comment_key]['pos'];
+                            } else if (
+                                //This is to allow use of the offset parameter in preg_match and stay as compatible with older PHP versions as possible
+                                (GESHI_PHP_PRE_433 && preg_match($regexp, substr($part, $i), $match, PREG_OFFSET_CAPTURE)) ||
+                                (!GESHI_PHP_PRE_433 && preg_match($regexp, $part, $match, PREG_OFFSET_CAPTURE, $i))
+                                ) {
+                                $match_i = $match[0][1];
+                                if (GESHI_PHP_PRE_433) {
+                                    $match_i += $i;
                                 }
-                                $char = '</span>' . $char . "<span$attributes>";
+
+                                $comment_regexp_cache_per_key[$comment_key] = array(
+                                    'key' => $comment_key,
+                                    'length' => strlen($match[0][0]),
+                                    'pos' => $match_i
+                                );
+                            } else {
+                                $comment_regexp_cache_per_key[$comment_key]['pos'] = false;
+                                continue;
                             }
-                        }
-                        else if ($char == $STRING_OPEN) {
-                            // A match of a string delimiter
-                            if (($this->lexic_permissions['ESCAPE_CHAR'] && $ESCAPE_CHAR_OPEN) ||
-                                ($this->lexic_permissions['STRINGS'] && !$ESCAPE_CHAR_OPEN)) {
-                                $char = GeSHi::hsc($char) . '</span>';
+
+                            if ($match_i !== false && $match_i < $next_comment_regexp_pos) {
+                                $next_comment_regexp_pos = $match_i;
+                                $next_comment_regexp_key = $comment_key;
+                                if ($match_i === $i) {
+                                    break;
+                                }
                             }
-                            $escape_me = false;
-                            if ($HARDQUOTE_OPEN) {
-                                if ($ESCAPE_CHAR_OPEN) {
-                                    $escape_me = true;
+                        }
+                    }
+
+                    $string_started = false;
+
+                    if (isset($is_string_starter[$char])) {
+                        // Possibly the start of a new string ...
+
+                        //Check which starter it was ...
+                        //Fix for SF#1932083: Multichar Quotemarks unsupported
+                        if (is_array($is_string_starter[$char])) {
+                            $char_new = '';
+                            foreach ($is_string_starter[$char] as $testchar) {
+                                if ($testchar === substr($part, $i, strlen($testchar)) &&
+                                    strlen($testchar) > strlen($char_new)) {
+                                    $char_new = $testchar;
+                                    $string_started = true;
                                 }
-                                else {
-                                    foreach ($this->language_data['HARDESCAPE'] as $hardesc) {
-                                        if (substr($part, $i, strlen($hardesc)) == $hardesc) {
-                                            $escape_me = true;
-                                            break;
+                            }
+                            if ($string_started) {
+                                $char = $char_new;
+                            }
+                        } else {
+                            $testchar = $is_string_starter[$char];
+                            if ($testchar === substr($part, $i, strlen($testchar))) {
+                                $char = $testchar;
+                                $string_started = true;
+                            }
+                        }
+                        $char_len = strlen($char);
+                    }
+
+                    if ($string_started && ($i != $next_comment_regexp_pos)) {
+                        // Hand out the correct style information for this string
+                        $string_key = array_search($char, $this->language_data['QUOTEMARKS']);
+                        if (!isset($this->language_data['STYLES']['STRINGS'][$string_key]) ||
+                            !isset($this->language_data['STYLES']['ESCAPE_CHAR'][$string_key])) {
+                            $string_key = 0;
+                        }
+
+                        // parse the stuff before this
+                        $result .= $this->parse_non_string_part($stuff_to_parse);
+                        $stuff_to_parse = '';
+
+                        if (!$this->use_classes) {
+                            $string_attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][$string_key] . '"';
+                        } else {
+                            $string_attributes = ' class="st'.$string_key.'"';
+                        }
+
+                        // now handle the string
+                        $string = "<span$string_attributes>" . GeSHi::hsc($char);
+                        $start = $i + $char_len;
+                        $string_open = true;
+
+                        if(empty($this->language_data['ESCAPE_REGEXP'])) {
+                            $next_escape_regexp_pos = $length;
+                        }
+
+                        do {
+                            //Get the regular ending pos ...
+                            $close_pos = strpos($part, $char, $start);
+                            if(false === $close_pos) {
+                                $close_pos = $length;
+                            }
+
+                            if($this->lexic_permissions['ESCAPE_CHAR']) {
+                                // update escape regexp cache if needed
+                                if (isset($this->language_data['ESCAPE_REGEXP']) && $next_escape_regexp_pos < $start) {
+                                    $next_escape_regexp_pos = $length;
+                                    foreach ($this->language_data['ESCAPE_REGEXP'] as $escape_key => $regexp) {
+                                        $match_i = false;
+                                        if (isset($escape_regexp_cache_per_key[$escape_key]) &&
+                                            ($escape_regexp_cache_per_key[$escape_key]['pos'] >= $start ||
+                                             $escape_regexp_cache_per_key[$escape_key]['pos'] === false)) {
+                                            // we have already matched something
+                                            if ($escape_regexp_cache_per_key[$escape_key]['pos'] === false) {
+                                                // this comment is never matched
+                                                continue;
+                                            }
+                                            $match_i = $escape_regexp_cache_per_key[$escape_key]['pos'];
+                                        } else if (
+                                            //This is to allow use of the offset parameter in preg_match and stay as compatible with older PHP versions as possible
+                                            (GESHI_PHP_PRE_433 && preg_match($regexp, substr($part, $start), $match, PREG_OFFSET_CAPTURE)) ||
+                                            (!GESHI_PHP_PRE_433 && preg_match($regexp, $part, $match, PREG_OFFSET_CAPTURE, $start))
+                                            ) {
+                                            $match_i = $match[0][1];
+                                            if (GESHI_PHP_PRE_433) {
+                                                $match_i += $start;
+                                            }
+
+                                            $escape_regexp_cache_per_key[$escape_key] = array(
+                                                'key' => $escape_key,
+                                                'length' => strlen($match[0][0]),
+                                                'pos' => $match_i
+                                            );
+                                        } else {
+                                            $escape_regexp_cache_per_key[$escape_key]['pos'] = false;
+                                            continue;
+                                        }
+
+                                        if ($match_i !== false && $match_i < $next_escape_regexp_pos) {
+                                            $next_escape_regexp_pos = $match_i;
+                                            $next_escape_regexp_key = $escape_key;
+                                            if ($match_i === $start) {
+                                                break;
+                                            }
                                         }
                                     }
                                 }
+
+                                //Find the next simple escape position
+                                if('' != $this->language_data['ESCAPE_CHAR']) {
+                                    $simple_escape = strpos($part, $this->language_data['ESCAPE_CHAR'], $start);
+                                    if(false === $simple_escape) {
+                                        $simple_escape = $length;
+                                    }
+                                } else {
+                                    $simple_escape = $length;
+                                }
+                            } else {
+                                $next_escape_regexp_pos = $length;
+                                $simple_escape = $length;
                             }
 
-                            if (!$ESCAPE_CHAR_OPEN) {
-                                $STRING_OPEN = '';
-                                $CLOSE_STRING = true;
-                            }
-                            if (!$escape_me) {
-                                $HARDQUOTE_OPEN = false;
-                            }
-                            $ESCAPE_CHAR_OPEN = false;
-                        }
-                        else if (in_array($char, $this->language_data['QUOTEMARKS']) &&
-                            ($STRING_OPEN == '') && $this->lexic_permissions['STRINGS']) {
-                            // The start of a new string
-                            $STRING_OPEN = $char;
-                            if (!$this->use_classes) {
-                                $attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][0] . '"';
+                            if($simple_escape < $next_escape_regexp_pos &&
+                                $simple_escape < $length &&
+                                $simple_escape < $close_pos) {
+                                //The nexxt escape sequence is a simple one ...
+                                $es_pos = $simple_escape;
+
+                                //Add the stuff not in the string yet ...
+                                $string .= $this->hsc(substr($part, $start, $es_pos - $start));
+
+                                //Get the style for this escaped char ...
+                                if (!$this->use_classes) {
+                                    $escape_char_attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR'][0] . '"';
+                                } else {
+                                    $escape_char_attributes = ' class="es0"';
+                                }
+
+                                //Add the style for the escape char ...
+                                $string .= "<span$escape_char_attributes>" .
+                                    GeSHi::hsc($this->language_data['ESCAPE_CHAR']);
+
+                                //Get the byte AFTER the ESCAPE_CHAR we just found
+                                $es_char = $part[$es_pos + 1];
+                                if ($es_char == "\n") {
+                                    // don't put a newline around newlines
+                                    $string .= "</span>\n";
+                                    $start = $es_pos + 2;
+                                } else if (ord($es_char) >= 128) {
+                                    //This is an non-ASCII char (UTF8 or single byte)
+                                    //This code tries to work around SF#2037598 ...
+                                    if(function_exists('mb_substr')) {
+                                        $es_char_m = mb_substr(substr($part, $es_pos+1, 16), 0, 1, $this->encoding);
+                                        $string .= $es_char_m . '</span>';
+                                    } else if (!GESHI_PHP_PRE_433 && 'utf-8' == $this->encoding) {
+                                        if(preg_match("/[\xC2-\xDF][\x80-\xBF]".
+                                            "|\xE0[\xA0-\xBF][\x80-\xBF]".
+                                            "|[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}".
+                                            "|\xED[\x80-\x9F][\x80-\xBF]".
+                                            "|\xF0[\x90-\xBF][\x80-\xBF]{2}".
+                                            "|[\xF1-\xF3][\x80-\xBF]{3}".
+                                            "|\xF4[\x80-\x8F][\x80-\xBF]{2}/s",
+                                            $part, $es_char_m, null, $es_pos + 1)) {
+                                            $es_char_m = $es_char_m[0];
+                                        } else {
+                                            $es_char_m = $es_char;
+                                        }
+                                        $string .= $this->hsc($es_char_m) . '</span>';
+                                    } else {
+                                        $es_char_m = $this->hsc($es_char);
+                                    }
+                                    $start = $es_pos + strlen($es_char_m) + 1;
+                                } else {
+                                    $string .= $this->hsc($es_char) . '</span>';
+                                    $start = $es_pos + 2;
+                                }
+                            } else if ($next_escape_regexp_pos < $length &&
+                                $next_escape_regexp_pos < $close_pos) {
+                                $es_pos = $next_escape_regexp_pos;
+                                //Add the stuff not in the string yet ...
+                                $string .= $this->hsc(substr($part, $start, $es_pos - $start));
+
+                                //Get the key and length of this match ...
+                                $escape = $escape_regexp_cache_per_key[$next_escape_regexp_key];
+                                $escape_str = substr($part, $es_pos, $escape['length']);
+                                $escape_key = $escape['key'];
+
+                                //Get the style for this escaped char ...
+                                if (!$this->use_classes) {
+                                    $escape_char_attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR'][$escape_key] . '"';
+                                } else {
+                                    $escape_char_attributes = ' class="es' . $escape_key . '"';
+                                }
+
+                                //Add the style for the escape char ...
+                                $string .= "<span$escape_char_attributes>" .
+                                    $this->hsc($escape_str) . '</span>';
+
+                                $start = $es_pos + $escape['length'];
+                            } else {
+                                //Copy the remainder of the string ...
+                                $string .= $this->hsc(substr($part, $start, $close_pos - $start + $char_len)) . '</span>';
+                                $start = $close_pos + $char_len;
+                                $string_open = false;
                             }
-                            else {
-                                $attributes = ' class="st0"';
+                        } while($string_open);
+
+                        if ($check_linenumbers) {
+                            // Are line numbers used? If, we should end the string before
+                            // the newline and begin it again (so when <li>s are put in the source
+                            // remains XHTML compliant)
+                            // note to self: This opens up possibility of config files specifying
+                            // that languages can/cannot have multiline strings???
+                            $string = str_replace("\n", "</span>\n<span$string_attributes>", $string);
+                        }
+
+                        $result .= $string;
+                        $string = '';
+                        $i = $start - 1;
+                        continue;
+                    } else if ($this->lexic_permissions['STRINGS'] && $hq && $hq[0] == $char &&
+                        substr($part, $i, $hq_strlen) == $hq && ($i != $next_comment_regexp_pos)) {
+                        // The start of a hard quoted string
+                        if (!$this->use_classes) {
+                            $string_attributes = ' style="' . $this->language_data['STYLES']['STRINGS']['HARD'] . '"';
+                            $escape_char_attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR']['HARD'] . '"';
+                        } else {
+                            $string_attributes = ' class="st_h"';
+                            $escape_char_attributes = ' class="es_h"';
+                        }
+                        // parse the stuff before this
+                        $result .= $this->parse_non_string_part($stuff_to_parse);
+                        $stuff_to_parse = '';
+
+                        // now handle the string
+                        $string = '';
+
+                        // look for closing quote
+                        $start = $i + $hq_strlen;
+                        while ($close_pos = strpos($part, $this->language_data['HARDQUOTE'][1], $start)) {
+                            $start = $close_pos + 1;
+                            if ($this->lexic_permissions['ESCAPE_CHAR'] && $part[$close_pos - 1] == $this->language_data['HARDCHAR'] &&
+                                (($i + $hq_strlen) != ($close_pos))) { //Support empty string for HQ escapes if Starter = Escape
+                                // make sure this quote is not escaped
+                                foreach ($this->language_data['HARDESCAPE'] as $hardescape) {
+                                    if (substr($part, $close_pos - 1, strlen($hardescape)) == $hardescape) {
+                                        // check wether this quote is escaped or if it is something like '\\'
+                                        $escape_char_pos = $close_pos - 1;
+                                        while ($escape_char_pos > 0
+                                                && $part[$escape_char_pos - 1] == $this->language_data['HARDCHAR']) {
+                                            --$escape_char_pos;
+                                        }
+                                        if (($close_pos - $escape_char_pos) & 1) {
+                                            // uneven number of escape chars => this quote is escaped
+                                            continue 2;
+                                        }
+                                    }
+                                }
                             }
-                            $char = "<span$attributes>" . GeSHi::hsc($char);
 
-                            $result .= $this->parse_non_string_part( $stuff_to_parse );
-                            $stuff_to_parse = '';
+                            // found closing quote
+                            break;
                         }
-                        else if ($hq && substr($part, $i, strlen($hq)) == $hq &&
-                            ($STRING_OPEN == '') && $this->lexic_permissions['STRINGS']) {
-                            // The start of a hard quoted string
-                            $STRING_OPEN = $this->language_data['HARDQUOTE'][1];
-                            if (!$this->use_classes) {
-                                $attributes = ' style="' . $this->language_data['STYLES']['STRINGS'][0] . '"';
+
+                        //Found the closing delimiter?
+                        if (!$close_pos) {
+                            // span till the end of this $part when no closing delimiter is found
+                            $close_pos = $length;
+                        }
+
+                        //Get the actual string
+                        $string = substr($part, $i, $close_pos - $i + 1);
+                        $i = $close_pos;
+
+                        // handle escape chars and encode html chars
+                        // (special because when we have escape chars within our string they may not be escaped)
+                        if ($this->lexic_permissions['ESCAPE_CHAR'] && $this->language_data['ESCAPE_CHAR']) {
+                            $start = 0;
+                            $new_string = '';
+                            while ($es_pos = strpos($string, $this->language_data['ESCAPE_CHAR'], $start)) {
+                                // hmtl escape stuff before
+                                $new_string .= $this->hsc(substr($string, $start, $es_pos - $start));
+                                // check if this is a hard escape
+                                foreach ($this->language_data['HARDESCAPE'] as $hardescape) {
+                                    if (substr($string, $es_pos, strlen($hardescape)) == $hardescape) {
+                                        // indeed, this is a hardescape
+                                        $new_string .= "<span$escape_char_attributes>" .
+                                            $this->hsc($hardescape) . '</span>';
+                                        $start = $es_pos + strlen($hardescape);
+                                        continue 2;
+                                    }
+                                }
+                                // not a hard escape, but a normal escape
+                                // they come in pairs of two
+                                $c = 0;
+                                while (isset($string[$es_pos + $c]) && isset($string[$es_pos + $c + 1])
+                                    && $string[$es_pos + $c] == $this->language_data['ESCAPE_CHAR']
+                                    && $string[$es_pos + $c + 1] == $this->language_data['ESCAPE_CHAR']) {
+                                    $c += 2;
+                                }
+                                if ($c) {
+                                    $new_string .= "<span$escape_char_attributes>" .
+                                        str_repeat($escaped_escape_char, $c) .
+                                        '</span>';
+                                    $start = $es_pos + $c;
+                                } else {
+                                    // this is just a single lonely escape char...
+                                    $new_string .= $escaped_escape_char;
+                                    $start = $es_pos + 1;
+                                }
                             }
-                            else {
-                                $attributes = ' class="st0"';
+                            $string = $new_string . $this->hsc(substr($string, $start));
+                        } else {
+                            $string = $this->hsc($string);
+                        }
+
+                        if ($check_linenumbers) {
+                            // Are line numbers used? If, we should end the string before
+                            // the newline and begin it again (so when <li>s are put in the source
+                            // remains XHTML compliant)
+                            // note to self: This opens up possibility of config files specifying
+                            // that languages can/cannot have multiline strings???
+                            $string = str_replace("\n", "</span>\n<span$string_attributes>", $string);
+                        }
+
+                        $result .= "<span$string_attributes>" . $string . '</span>';
+                        $string = '';
+                        continue;
+                    } else {
+                        //Have a look for regexp comments
+                        if ($i == $next_comment_regexp_pos) {
+                            $COMMENT_MATCHED = true;
+                            $comment = $comment_regexp_cache_per_key[$next_comment_regexp_key];
+                            $test_str = $this->hsc(substr($part, $i, $comment['length']));
+
+                            //@todo If remove important do remove here
+                            if ($this->lexic_permissions['COMMENTS']['MULTI']) {
+                                if (!$this->use_classes) {
+                                    $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS'][$comment['key']] . '"';
+                                } else {
+                                    $attributes = ' class="co' . $comment['key'] . '"';
+                                }
+
+                                $test_str = "<span$attributes>" . $test_str . "</span>";
+
+                                // Short-cut through all the multiline code
+                                if ($check_linenumbers) {
+                                    // strreplace to put close span and open span around multiline newlines
+                                    $test_str = str_replace(
+                                        "\n", "</span>\n<span$attributes>",
+                                        str_replace("\n ", "\n&nbsp;", $test_str)
+                                    );
+                                }
                             }
-                            $char = "<span$attributes>" . $hq;
-                            $i += strlen($hq) - 1;
-                            $HARDQUOTE_OPEN = true;
+
+                            $i += $comment['length'] - 1;
+
+                            // parse the rest
                             $result .= $this->parse_non_string_part($stuff_to_parse);
                             $stuff_to_parse = '';
                         }
-                        else if ($char == $this->language_data['ESCAPE_CHAR'] && $STRING_OPEN != '') {
-                            // An escape character
-                            if (!$ESCAPE_CHAR_OPEN) {
-                                $ESCAPE_CHAR_OPEN = !$HARDQUOTE_OPEN;  // true unless $HARDQUOTE_OPEN
-                                if ($HARDQUOTE_OPEN) {
-                                    foreach ($this->language_data['HARDESCAPE'] as $hard) {
-                                        if (substr($part, $i, strlen($hard)) == $hard) {
-                                            $ESCAPE_CHAR_OPEN = true;
+
+                        // If we haven't matched a regexp comment, try multi-line comments
+                        if (!$COMMENT_MATCHED) {
+                            // Is this a multiline comment?
+                            if (!empty($this->language_data['COMMENT_MULTI']) && $next_comment_multi_pos < $i) {
+                                $next_comment_multi_pos = $length;
+                                foreach ($this->language_data['COMMENT_MULTI'] as $open => $close) {
+                                    $match_i = false;
+                                    if (isset($comment_multi_cache_per_key[$open]) &&
+                                        ($comment_multi_cache_per_key[$open] >= $i ||
+                                         $comment_multi_cache_per_key[$open] === false)) {
+                                        // we have already matched something
+                                        if ($comment_multi_cache_per_key[$open] === false) {
+                                            // this comment is never matched
+                                            continue;
+                                        }
+                                        $match_i = $comment_multi_cache_per_key[$open];
+                                    } else if (($match_i = stripos($part, $open, $i)) !== false) {
+                                        $comment_multi_cache_per_key[$open] = $match_i;
+                                    } else {
+                                        $comment_multi_cache_per_key[$open] = false;
+                                        continue;
+                                    }
+                                    if ($match_i !== false && $match_i < $next_comment_multi_pos) {
+                                        $next_comment_multi_pos = $match_i;
+                                        $next_open_comment_multi = $open;
+                                        if ($match_i === $i) {
                                             break;
                                         }
                                     }
                                 }
-                                if ($ESCAPE_CHAR_OPEN && $this->lexic_permissions['ESCAPE_CHAR']) {
-                                    if (!$this->use_classes) {
-                                        $attributes = ' style="' . $this->language_data['STYLES']['ESCAPE_CHAR'][0] . '"';
-                                    }
-                                    else {
-                                        $attributes = ' class="es0"';
-                                    }
-                                    $char = "<span$attributes>" . $char;
-                                    if (substr($code, $i + 1, 1) == "\n") {
-                                        // escaping a newline, what's the point in putting the span around
-                                        // the newline? It only causes hassles when inserting line numbers
-                                        $char .= '</span>';
-                                        $ESCAPE_CHAR_OPEN = false;
+                            }
+                            if ($i == $next_comment_multi_pos) {
+                                $open = $next_open_comment_multi;
+                                $close = $this->language_data['COMMENT_MULTI'][$open];
+                                $open_strlen = strlen($open);
+                                $close_strlen = strlen($close);
+                                $COMMENT_MATCHED = true;
+                                $test_str_match = $open;
+                                //@todo If remove important do remove here
+                                if ($this->lexic_permissions['COMMENTS']['MULTI'] ||
+                                    $open == GESHI_START_IMPORTANT) {
+                                    if ($open != GESHI_START_IMPORTANT) {
+                                        if (!$this->use_classes) {
+                                            $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS']['MULTI'] . '"';
+                                        } else {
+                                            $attributes = ' class="coMULTI"';
+                                        }
+                                        $test_str = "<span$attributes>" . $this->hsc($open);
+                                    } else {
+                                        if (!$this->use_classes) {
+                                            $attributes = ' style="' . $this->important_styles . '"';
+                                        } else {
+                                            $attributes = ' class="imp"';
+                                        }
+
+                                        // We don't include the start of the comment if it's an
+                                        // "important" part
+                                        $test_str = "<span$attributes>";
                                     }
+                                } else {
+                                    $test_str = $this->hsc($open);
                                 }
-                            }
-                            else {
-                                $ESCAPE_CHAR_OPEN = false;
-                                if ($this->lexic_permissions['ESCAPE_CHAR']) {
-                                    $char .= '</span>';
+
+                                $close_pos = strpos( $part, $close, $i + $open_strlen );
+
+                                if ($close_pos === false) {
+                                    $close_pos = $length;
                                 }
+
+                                // Short-cut through all the multiline code
+                                $rest_of_comment = $this->hsc(substr($part, $i + $open_strlen, $close_pos - $i - $open_strlen + $close_strlen));
+                                if (($this->lexic_permissions['COMMENTS']['MULTI'] ||
+                                    $test_str_match == GESHI_START_IMPORTANT) &&
+                                    $check_linenumbers) {
+
+                                    // strreplace to put close span and open span around multiline newlines
+                                    $test_str .= str_replace(
+                                        "\n", "</span>\n<span$attributes>",
+                                        str_replace("\n ", "\n&nbsp;", $rest_of_comment)
+                                    );
+                                } else {
+                                    $test_str .= $rest_of_comment;
+                                }
+
+                                if ($this->lexic_permissions['COMMENTS']['MULTI'] ||
+                                    $test_str_match == GESHI_START_IMPORTANT) {
+                                    $test_str .= '</span>';
+                                }
+
+                                $i = $close_pos + $close_strlen - 1;
+
+                                // parse the rest
+                                $result .= $this->parse_non_string_part($stuff_to_parse);
+                                $stuff_to_parse = '';
                             }
                         }
-                        else if ($ESCAPE_CHAR_OPEN) {
-                            if ($this->lexic_permissions['ESCAPE_CHAR']) {
-                                $char .= '</span>';
-                            }
-                            $ESCAPE_CHAR_OPEN = false;
-                            $test_str = $char;
-                        }
-                        else if ($STRING_OPEN == '') {
-                            // Is this a multiline comment?
-                            foreach ($this->language_data['COMMENT_MULTI'] as $open => $close) {
-                                $com_len = strlen($open);
-                                $test_str = substr( $part, $i, $com_len );
-                                $test_str_match = $test_str;
-                                if ($open == $test_str) {
-                                    $COMMENT_MATCHED = true;
-                                    //@todo If remove important do remove here
-                                    if ($this->lexic_permissions['COMMENTS']['MULTI'] ||
-                                        $test_str == GESHI_START_IMPORTANT) {
-                                        if ($test_str != GESHI_START_IMPORTANT) {
-                                            if (!$this->use_classes) {
-                                                $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS']['MULTI'] . '"';
-                                            }
-                                            else {
-                                                $attributes = ' class="coMULTI"';
-                                            }
-                                            $test_str = "<span$attributes>" . GeSHi::hsc($test_str);
+
+                        // If we haven't matched a multiline comment, try single-line comments
+                        if (!$COMMENT_MATCHED) {
+                            // cache potential single line comment occurances
+                            if (!empty($this->language_data['COMMENT_SINGLE']) && $next_comment_single_pos < $i) {
+                                $next_comment_single_pos = $length;
+                                foreach ($this->language_data['COMMENT_SINGLE'] as $comment_key => $comment_mark) {
+                                    $match_i = false;
+                                    if (isset($comment_single_cache_per_key[$comment_key]) &&
+                                        ($comment_single_cache_per_key[$comment_key] >= $i ||
+                                         $comment_single_cache_per_key[$comment_key] === false)) {
+                                        // we have already matched something
+                                        if ($comment_single_cache_per_key[$comment_key] === false) {
+                                            // this comment is never matched
+                                            continue;
                                         }
-                                        else {
-                                            if (!$this->use_classes) {
-                                                $attributes = ' style="' . $this->important_styles . '"';
-                                            }
-                                            else {
-                                                $attributes = ' class="imp"';
-                                            }
-                                            // We don't include the start of the comment if it's an
-                                            // "important" part
-                                            $test_str = "<span$attributes>";
+                                        $match_i = $comment_single_cache_per_key[$comment_key];
+                                    } else if (
+                                        // case sensitive comments
+                                        ($this->language_data['CASE_SENSITIVE'][GESHI_COMMENTS] &&
+                                        ($match_i = stripos($part, $comment_mark, $i)) !== false) ||
+                                        // non case sensitive
+                                        (!$this->language_data['CASE_SENSITIVE'][GESHI_COMMENTS] &&
+                                          (($match_i = strpos($part, $comment_mark, $i)) !== false))) {
+                                        $comment_single_cache_per_key[$comment_key] = $match_i;
+                                    } else {
+                                        $comment_single_cache_per_key[$comment_key] = false;
+                                        continue;
+                                    }
+                                    if ($match_i !== false && $match_i < $next_comment_single_pos) {
+                                        $next_comment_single_pos = $match_i;
+                                        $next_comment_single_key = $comment_key;
+                                        if ($match_i === $i) {
+                                            break;
                                         }
                                     }
-                                    else {
-                                        $test_str = GeSHi::hsc($test_str);
+                                }
+                            }
+                            if ($next_comment_single_pos == $i) {
+                                $comment_key = $next_comment_single_key;
+                                $comment_mark = $this->language_data['COMMENT_SINGLE'][$comment_key];
+                                $com_len = strlen($comment_mark);
+
+                                // This check will find special variables like $# in bash
+                                // or compiler directives of Delphi beginning {$
+                                if ((empty($sc_disallowed_before) || ($i == 0) ||
+                                    (false === strpos($sc_disallowed_before, $part[$i-1]))) &&
+                                    (empty($sc_disallowed_after) || ($length <= $i + $com_len) ||
+                                    (false === strpos($sc_disallowed_after, $part[$i + $com_len]))))
+                                {
+                                    // this is a valid comment
+                                    $COMMENT_MATCHED = true;
+                                    if ($this->lexic_permissions['COMMENTS'][$comment_key]) {
+                                        if (!$this->use_classes) {
+                                            $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS'][$comment_key] . '"';
+                                        } else {
+                                            $attributes = ' class="co' . $comment_key . '"';
+                                        }
+                                        $test_str = "<span$attributes>" . $this->hsc($this->change_case($comment_mark));
+                                    } else {
+                                        $test_str = $this->hsc($comment_mark);
                                     }
 
-                                    $close_pos = strpos( $part, $close, $i + strlen($close) );
-
+                                    //Check if this comment is the last in the source
+                                    $close_pos = strpos($part, "\n", $i);
                                     $oops = false;
                                     if ($close_pos === false) {
-                                        $close_pos = strlen($part);
+                                        $close_pos = $length;
                                         $oops = true;
                                     }
-                                    else {
-                                        $close_pos -= ($com_len - strlen($close));
+                                    $test_str .= $this->hsc(substr($part, $i + $com_len, $close_pos - $i - $com_len));
+                                    if ($this->lexic_permissions['COMMENTS'][$comment_key]) {
+                                        $test_str .= "</span>";
                                     }
 
-                                    // Short-cut through all the multiline code
-                                    $rest_of_comment = GeSHi::hsc(substr($part, $i + $com_len, $close_pos - $i));
-                                    if (($this->lexic_permissions['COMMENTS']['MULTI'] ||
-                                        $test_str_match == GESHI_START_IMPORTANT) &&
-                                        ($this->line_numbers != GESHI_NO_LINE_NUMBERS ||
-                                        count($this->highlight_extra_lines) > 0)) {
-                                        // strreplace to put close span and open span around multiline newlines
-                                        $test_str .= str_replace("\n", "</span>\n<span$attributes>", $rest_of_comment);
-                                    }
-                                    else {
-                                        $test_str .= $rest_of_comment;
+                                    // Take into account that the comment might be the last in the source
+                                    if (!$oops) {
+                                      $test_str .= "\n";
                                     }
 
-                                    if ($this->lexic_permissions['COMMENTS']['MULTI'] ||
-                                        $test_str_match == GESHI_START_IMPORTANT) {
-                                        $test_str .= '</span>';
-                                        if ($oops) {
-                                            $test_str .= "\n";
-                                        }
-                                    }
-                                    $i = $close_pos + $com_len - 1;
+                                    $i = $close_pos;
+
                                     // parse the rest
                                     $result .= $this->parse_non_string_part($stuff_to_parse);
                                     $stuff_to_parse = '';
-                                    break;
-                                }
-                            }
-                            // If we haven't matched a multiline comment, try single-line comments
-                            if (!$COMMENT_MATCHED) {
-                                foreach ($this->language_data['COMMENT_SINGLE'] as $comment_key => $comment_mark) {
-                                    $com_len = strlen($comment_mark);
-                                    $test_str = substr($part, $i, $com_len);
-                                    if ($this->language_data['CASE_SENSITIVE'][GESHI_COMMENTS]) {
-                                        $match = ($comment_mark == $test_str);
-                                    }
-                                    else {
-                                        $match = (strtolower($comment_mark) == strtolower($test_str));
-                                    }
-                                    if ($match) {
-                                        $COMMENT_MATCHED = true;
-                                        if ($this->lexic_permissions['COMMENTS'][$comment_key]) {
-                                            if (!$this->use_classes) {
-                                                $attributes = ' style="' . $this->language_data['STYLES']['COMMENTS'][$comment_key] . '"';
-                                            }
-                                            else {
-                                                $attributes = ' class="co' . $comment_key . '"';
-                                            }
-                                            $test_str = "<span$attributes>" . GeSHi::hsc($this->change_case($test_str));
-                                        }
-                                        else {
-                                            $test_str = GeSHi::hsc($test_str);
-                                        }
-                                        $close_pos = strpos($part, "\n", $i);
-                                        $oops = false;
-                                        if ($close_pos === false) {
-                                            $close_pos = strlen($part);
-                                            $oops = true;
-                                        }
-                                        $test_str .= GeSHi::hsc(substr($part, $i + $com_len, $close_pos - $i - $com_len));
-                                        if ($this->lexic_permissions['COMMENTS'][$comment_key]) {
-                                            $test_str .= "</span>";
-                                        }
-                                        // Take into account that the comment might be the last in the source
-                                        if (!$oops) {
-                                          $test_str .= "\n";
-                                        }
-                                        $i = $close_pos;
-                                        // parse the rest
-                                        $result .= $this->parse_non_string_part($stuff_to_parse);
-                                        $stuff_to_parse = '';
-                                        break;
-                                    }
                                 }
                             }
                         }
-                        else if ($STRING_OPEN != '') {
-                            // Otherwise, convert it to HTML form
-                            if (strtolower($this->encoding) == 'utf-8') {
-                                //only escape <128 (we don't want to break multibyte chars)
-                                if (ord($char) < 128) {
-                                    $char = GeSHi::hsc($char);
-                                }
-                            }
-                            else {
-                                //encode everthing
-                                $char = GeSHi::hsc($char);
-                            }
-                        }
-                        // Where are we adding this char?
-                        if (!$COMMENT_MATCHED) {
-                            if (($STRING_OPEN == '') && !$CLOSE_STRING) {
-                                $stuff_to_parse .= $char;
-                            }
-                            else {
-                                $result .= $char;
-                                $CLOSE_STRING = false;
-                            }
-                        }
-                        else {
-                            $result .= $test_str;
-                            $COMMENT_MATCHED = false;
-                        }
                     }
-                    // Parse the last bit
-                    $result .= $this->parse_non_string_part($stuff_to_parse);
-                    $stuff_to_parse = '';
-                }
-                else {
-                    if ($STRICTATTRS != '') {
-                        $part = str_replace("\n", "</span>\n<span$STRICTATTRS>", GeSHi::hsc($part));
-                        $STRICTATTRS = '';
+
+                    // Where are we adding this char?
+                    if (!$COMMENT_MATCHED) {
+                        $stuff_to_parse .= $char;
+                    } else {
+                        $result .= $test_str;
+                        unset($test_str);
+                        $COMMENT_MATCHED = false;
                     }
-                    $result .= $part;
-                }
-                // Close the <span> that surrounds the block
-                if ($this->strict_mode && $this->language_data['STYLES']['SCRIPT'][$script_key] != '' &&
-                    $this->lexic_permissions['SCRIPT']) {
-                    $result .= '</span>';
                 }
+                // Parse the last bit
+                $result .= $this->parse_non_string_part($stuff_to_parse);
+                $stuff_to_parse = '';
+            } else {
+                $result .= $this->hsc($part);
             }
-            else {
-                // Else not a block to highlight
-                $result .= GeSHi::hsc($part);
+            // Close the <span> that surrounds the block
+            if ($STRICTATTRS != '') {
+                $result = str_replace("\n", "</span>\n<span$STRICTATTRS>", $result);
+                $result .= '</span>';
             }
+
+            $endresult .= $result;
+            unset($part, $parts[$key], $result);
         }
 
-        // Parse the last stuff (redundant?)
-        $result .= $this->parse_non_string_part($stuff_to_parse);
+        //This fix is related to SF#1923020, but has to be applied regardless of
+        //actually highlighting symbols.
+        /** NOTE: memorypeak #3 */
+        $endresult = str_replace(array('<SEMI>', '<PIPE>'), array(';', '|'), $endresult);
 
-        // Lop off the very first and last spaces
-        $result = substr($result, 1, -1);
+//        // Parse the last stuff (redundant?)
+//        $result .= $this->parse_non_string_part($stuff_to_parse);
 
-        // Are we still in a string?
-        if ($STRING_OPEN) {
-            $result .= '</span>';
-        }
+        // Lop off the very first and last spaces
+//        $result = substr($result, 1, -1);
 
         // We're finished: stop timing
         $this->set_time($start_time, microtime());
 
-        return $this->finalise($result);
+        $this->finalise($endresult);
+        return $endresult;
     }
 
     /**
      * Swaps out spaces and tabs for HTML indentation. Not needed if
      * the code is in a pre block...
      *
-     * @param  string The source to indent
-     * @return string The source with HTML indenting applied
+     * @param  string The source to indent (reference!)
      * @since  1.0.0
      * @access private
      */
-    function indent($result) {
+    function indent(&$result) {
         /// Replace tabs with the correct number of spaces
         if (false !== strpos($result, "\t")) {
             $lines = explode("\n", $result);
-            foreach ($lines as $key => $line) {
+            $result = null;//Save memory while we process the lines individually
+            $tab_width = $this->get_real_tab_width();
+            $tab_string = '&nbsp;' . str_repeat(' ', $tab_width);
+
+            for ($key = 0, $n = count($lines); $key < $n; $key++) {
+                $line = $lines[$key];
                 if (false === strpos($line, "\t")) {
-                    $lines[$key] = $line;
                     continue;
                 }
 
                 $pos = 0;
-                $tab_width = $this->tab_width;
                 $length = strlen($line);
-                $result_line = '';
+                $lines[$key] = ''; // reduce memory
 
                 $IN_TAG = false;
-                for ($i = 0; $i < $length; $i++) {
-                    $char = substr($line, $i, 1);
+                for ($i = 0; $i < $length; ++$i) {
+                    $char = $line[$i];
                     // Simple engine to work out whether we're in a tag.
                     // If we are we modify $pos. This is so we ignore HTML
                     // in the line and only workout the tab replacement
@@ -1856,26 +3138,24 @@
                     // This test could be improved to include strings in the
                     // html so that < or > would be allowed in user's styles
                     // (e.g. quotes: '<' '>'; or similar)
-                    if ($IN_TAG && '>' == $char) {
-                        $IN_TAG = false;
-                        $result_line .= '>';
-                        ++$pos;
-                    }
-                    else if (!$IN_TAG && '<' == $char) {
+                    if ($IN_TAG) {
+                        if ('>' == $char) {
+                            $IN_TAG = false;
+                        }
+                        $lines[$key] .= $char;
+                    } else if ('<' == $char) {
                         $IN_TAG = true;
-                        $result_line .= '<';
-                        ++$pos;
-                    }
-                    else if (!$IN_TAG && '&' == $char) {
-                        $substr = substr($line, $i + 3, 4);
-                        //$substr_5 = substr($line, 5, 1);
+                        $lines[$key] .= '<';
+                    } else if ('&' == $char) {
+                        $substr = substr($line, $i + 3, 5);
                         $posi = strpos($substr, ';');
-                        if (false !== $posi) {
-                            $pos += $posi + 3;
+                        if (false === $posi) {
+                            ++$pos;
+                        } else {
+                            $pos -= $posi+2;
                         }
-                        $result_line .= '&';
-                    }
-                    else if (!$IN_TAG && "\t" == $char) {
+                        $lines[$key] .= $char;
+                    } else if ("\t" == $char) {
                         $str = '';
                         // OPTIMISE - move $strs out. Make an array:
                         // $tabs = array(
@@ -1883,38 +3163,43 @@
                         //  2 => '&nbsp; ',
                         //  3 => '&nbsp; &nbsp;' etc etc
                         // to use instead of building a string every time
-                        $strs = array(0 => '&nbsp;', 1 => ' ');
-                        for ($k = 0; $k < ($tab_width - (($i - $pos) % $tab_width)); $k++) $str .= $strs[$k % 2];
-                        $result_line .= $str;
-                        $pos++;
+                        $tab_end_width = $tab_width - ($pos % $tab_width); //Moved out of the look as it doesn't change within the loop
+                        if (($pos & 1) || 1 == $tab_end_width) {
+                            $str .= substr($tab_string, 6, $tab_end_width);
+                        } else {
+                            $str .= substr($tab_string, 0, $tab_end_width+5);
+                        }
+                        $lines[$key] .= $str;
+                        $pos += $tab_end_width;
 
                         if (false === strpos($line, "\t", $i + 1)) {
-                            $result_line .= substr($line, $i + 1);
+                            $lines[$key] .= substr($line, $i + 1);
                             break;
                         }
-                    }
-                    else if ($IN_TAG) {
+                    } else if (0 == $pos && ' ' == $char) {
+                        $lines[$key] .= '&nbsp;';
+                        ++$pos;
+                    } else {
+                        $lines[$key] .= $char;
                         ++$pos;
-                        $result_line .= $char;
-                    }
-                    else {
-                        $result_line .= $char;
-                        //++$pos;
                     }
                 }
-                $lines[$key] = $result_line;
             }
             $result = implode("\n", $lines);
+            unset($lines);//We don't need the lines separated beyond this --- free them!
         }
         // Other whitespace
-        $result = str_replace('  ', '&nbsp; ', $result);
+        // BenBE: Fix to reduce the number of replacements to be done
+        $result = preg_replace('/^ /m', '&nbsp;', $result);
         $result = str_replace('  ', ' &nbsp;', $result);
-        $result = str_replace("\n ", "\n&nbsp;", $result);
 
-        if ($this->line_numbers == GESHI_NO_LINE_NUMBERS) {
-            $result = nl2br($result);
+        if ($this->line_numbers == GESHI_NO_LINE_NUMBERS && $this->header_type != GESHI_HEADER_PRE_TABLE) {
+            if ($this->line_ending === null) {
+                $result = nl2br($result);
+            } else {
+                $result = str_replace("\n", $this->line_ending, $result);
+            }
         }
-        return $result;
     }
 
     /**
@@ -1926,65 +3211,122 @@
      * @access private
      */
     function change_case($instr) {
-        if ($this->language_data['CASE_KEYWORDS'] == GESHI_CAPS_UPPER) {
-            return strtoupper($instr);
-        }
-        else if ($this->language_data['CASE_KEYWORDS'] == GESHI_CAPS_LOWER) {
-            return strtolower($instr);
+        switch ($this->language_data['CASE_KEYWORDS']) {
+            case GESHI_CAPS_UPPER:
+                return strtoupper($instr);
+            case GESHI_CAPS_LOWER:
+                return strtolower($instr);
+            default:
+                return $instr;
         }
-        return $instr;
     }
 
     /**
-     * Adds a url to a keyword where needed.
+     * Handles replacements of keywords to include markup and links if requested
      *
-     * @param  string The keyword to add the URL HTML to
-     * @param  int What group the keyword is from
-     * @param  boolean Whether to get the HTML for the start or end
-     * @return The HTML for either the start or end of the HTML &lt;a&gt; tag
-     * @since  1.0.2
+     * @param  string The keyword to add the Markup to
+     * @return The HTML for the match found
+     * @since  1.0.8
      * @access private
-     * @todo   Get rid of ender
+     *
+     * @todo   Get rid of ender in keyword links
      */
-    function add_url_to_keyword($keyword, $group, $start_or_end) {
-        if (!$this->keyword_links) {
-            // Keyword links have been disabled
-            return;
-        }
-
-        if (isset($this->language_data['URLS'][$group]) &&
-            $this->language_data['URLS'][$group] != '' &&
-            substr($keyword, 0, 5) != '&lt;/') {
-            // There is a base group for this keyword
-            if ($start_or_end == 'BEGIN') {
-                // HTML workaround... not good form (tm) but should work for 1.0.X
-                if ($keyword != '') {
-                    // Old system: strtolower
-                    //$keyword = ( $this->language_data['CASE_SENSITIVE'][$group] ) ? $keyword : strtolower($keyword);
-                    // New system: get keyword from language file to get correct case
-                    foreach ($this->language_data['KEYWORDS'][$group] as $word) {
-                        if (strtolower($word) == strtolower($keyword)) {
+    function handle_keyword_replace($match) {
+        $k = $this->_kw_replace_group;
+        $keyword = $match[0];
+
+        $before = '';
+        $after = '';
+
+        if ($this->keyword_links) {
+            // Keyword links have been ebabled
+
+            if (isset($this->language_data['URLS'][$k]) &&
+                $this->language_data['URLS'][$k] != '') {
+                // There is a base group for this keyword
+
+                // Old system: strtolower
+                //$keyword = ( $this->language_data['CASE_SENSITIVE'][$group] ) ? $keyword : strtolower($keyword);
+                // New system: get keyword from language file to get correct case
+                if (!$this->language_data['CASE_SENSITIVE'][$k] &&
+                    strpos($this->language_data['URLS'][$k], '{FNAME}') !== false) {
+                    foreach ($this->language_data['KEYWORDS'][$k] as $word) {
+                        if (strcasecmp($word, $keyword) == 0) {
                             break;
                         }
                     }
-                    $word = ( substr($word, 0, 4) == '&lt;' ) ? substr($word, 4) : $word;
-                    $word = ( substr($word, -4) == '&gt;' ) ? substr($word, 0, strlen($word) - 4) : $word;
-                    if (!$word) return '';
-
-                    return '<|UR1|"' .
-                        str_replace(
-                            array('{FNAME}', '.'),
-                            array(GeSHi::hsc($word), '<DOT>'),
-                            $this->language_data['URLS'][$group]
-                        ) . '">';
+                } else {
+                    $word = $keyword;
                 }
-                return '';
-            // HTML fix. Again, dirty hackage...
-            }
-            else if (!($this->language == 'html4strict' && ('&gt;' == $keyword || '&lt;' == $keyword))) {
-                return '</a>';
+
+                $before = '<|UR1|"' .
+                    str_replace(
+                        array(
+                            '{FNAME}',
+                            '{FNAMEL}',
+                            '{FNAMEU}',
+                            '.'),
+                        array(
+                            str_replace('+', '%20', urlencode($this->hsc($word))),
+                            str_replace('+', '%20', urlencode($this->hsc(strtolower($word)))),
+                            str_replace('+', '%20', urlencode($this->hsc(strtoupper($word)))),
+                            '<DOT>'),
+                        $this->language_data['URLS'][$k]
+                    ) . '">';
+                $after = '</a>';
             }
         }
+
+        return $before . '<|/'. $k .'/>' . $this->change_case($keyword) . '|>' . $after;
+    }
+
+    /**
+     * handles regular expressions highlighting-definitions with callback functions
+     *
+     * @note this is a callback, don't use it directly
+     *
+     * @param array the matches array
+     * @return The highlighted string
+     * @since 1.0.8
+     * @access private
+     */
+    function handle_regexps_callback($matches) {
+        // before: "' style=\"' . call_user_func(\"$func\", '\\1') . '\"\\1|>'",
+        return  ' style="' . call_user_func($this->language_data['STYLES']['REGEXPS'][$this->_rx_key], $matches[1]) . '"'. $matches[1] . '|>';
+    }
+
+    /**
+     * handles newlines in REGEXPS matches. Set the _hmr_* vars before calling this
+     *
+     * @note this is a callback, don't use it directly
+     *
+     * @param array the matches array
+     * @return string
+     * @since 1.0.8
+     * @access private
+     */
+    function handle_multiline_regexps($matches) {
+        $before = $this->_hmr_before;
+        $after = $this->_hmr_after;
+        if ($this->_hmr_replace) {
+            $replace = $this->_hmr_replace;
+            $search = array();
+
+            foreach (array_keys($matches) as $k) {
+                $search[] = '\\' . $k;
+            }
+
+            $before = str_replace($search, $matches, $before);
+            $after = str_replace($search, $matches, $after);
+            $replace = str_replace($search, $matches, $replace);
+        } else {
+            $replace = $matches[0];
+        }
+        return $before
+                    . '<|!REG3XP' . $this->_hmr_key .'!>'
+                        . str_replace("\n", "|>\n<|!REG3XP" . $this->_hmr_key . '!>', $replace)
+                    . '|>'
+              . $after;
     }
 
     /**
@@ -1996,123 +3338,186 @@
      * @access private
      * @todo BUGGY! Why? Why not build string and return?
      */
-    function parse_non_string_part(&$stuff_to_parse) {
-        $stuff_to_parse = ' ' . GeSHi::hsc($stuff_to_parse);
-        $stuff_to_parse_pregquote = preg_quote($stuff_to_parse, '/');
-        $func = '$this->change_case';
-        $func2 = '$this->add_url_to_keyword';
+    function parse_non_string_part($stuff_to_parse) {
+        $stuff_to_parse = ' ' . $this->hsc($stuff_to_parse);
 
-        //
-        // Regular expressions
-        //
-        foreach ($this->language_data['REGEXPS'] as $key => $regexp) {
-            if ($this->lexic_permissions['REGEXPS'][$key]) {
-                if (is_array($regexp)) {
-                    $stuff_to_parse = preg_replace(
-                        "/" .
-                        str_replace('/', '\/', $regexp[GESHI_SEARCH]) .
-                        "/{$regexp[GESHI_MODIFIERS]}",
-                        "{$regexp[GESHI_BEFORE]}<|!REG3XP$key!>{$regexp[GESHI_REPLACE]}|>{$regexp[GESHI_AFTER]}",
-                        $stuff_to_parse
-                    );
+        // Highlight keywords
+        $disallowed_before = "(?<![a-zA-Z0-9\$_\|\#|^&";
+        $disallowed_after = "(?![a-zA-Z0-9_\|%\\-&;";
+        if ($this->lexic_permissions['STRINGS']) {
+            $quotemarks = preg_quote(implode($this->language_data['QUOTEMARKS']), '/');
+            $disallowed_before .= $quotemarks;
+            $disallowed_after .= $quotemarks;
+        }
+        $disallowed_before .= "])";
+        $disallowed_after .= "])";
+
+        $parser_control_pergroup = false;
+        if (isset($this->language_data['PARSER_CONTROL'])) {
+            if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS'])) {
+                $x = 0; // check wether per-keyword-group parser_control is enabled
+                if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'])) {
+                    $disallowed_before = $this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_BEFORE'];
+                    ++$x;
                 }
-                else {
-                    $stuff_to_parse = preg_replace( "/(" . str_replace('/', '\/', $regexp) . ")/", "<|!REG3XP$key!>\\1|>", $stuff_to_parse);
+                if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'])) {
+                    $disallowed_after = $this->language_data['PARSER_CONTROL']['KEYWORDS']['DISALLOWED_AFTER'];
+                    ++$x;
                 }
+                $parser_control_pergroup = (count($this->language_data['PARSER_CONTROL']['KEYWORDS']) - $x) > 0;
             }
         }
 
-        //
-        // Highlight numbers. This regexp sucks... anyone with a regexp that WORKS
-        // here wins a cookie if they send it to me. At the moment there's two doing
-        // almost exactly the same thing, except the second one prevents a number
-        // being highlighted twice (eg <span...><span...>5</span></span>)
-        // Put /NUM!/ in for the styles, which gets replaced at the end.
-        //
-        // NEW ONE: Brice Bernard
-        //
-        if ($this->lexic_permissions['NUMBERS'] && preg_match('#[0-9]#', $stuff_to_parse )) {
-            $stuff_to_parse = preg_replace('/([-+]?\\b(?:[0-9]*\\.)?[0-9]+\\b)/', '<|/NUM!/>\\1|>', $stuff_to_parse);
+        foreach (array_keys($this->language_data['KEYWORDS']) as $k) {
+            if (!isset($this->lexic_permissions['KEYWORDS'][$k]) ||
+            $this->lexic_permissions['KEYWORDS'][$k]) {
+
+                $case_sensitive = $this->language_data['CASE_SENSITIVE'][$k];
+                $modifiers = $case_sensitive ? '' : 'i';
+
+                // NEW in 1.0.8 - per-keyword-group parser control
+                $disallowed_before_local = $disallowed_before;
+                $disallowed_after_local = $disallowed_after;
+                if ($parser_control_pergroup && isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$k])) {
+                    if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_BEFORE'])) {
+                        $disallowed_before_local =
+                            $this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_BEFORE'];
+                    }
+
+                    if (isset($this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_AFTER'])) {
+                        $disallowed_after_local =
+                            $this->language_data['PARSER_CONTROL']['KEYWORDS'][$k]['DISALLOWED_AFTER'];
+                    }
+                }
+
+                $this->_kw_replace_group = $k;
+
+                //NEW in 1.0.8, the cached regexp list
+                // since we don't want PHP / PCRE to crash due to too large patterns we split them into smaller chunks
+                for ($set = 0, $set_length = count($this->language_data['CACHED_KEYWORD_LISTS'][$k]); $set <  $set_length; ++$set) {
+                    $keywordset =& $this->language_data['CACHED_KEYWORD_LISTS'][$k][$set];
+                    // Might make a more unique string for putting the number in soon
+                    // Basically, we don't put the styles in yet because then the styles themselves will
+                    // get highlighted if the language has a CSS keyword in it (like CSS, for example ;))
+                    $stuff_to_parse = preg_replace_callback(
+                        "/$disallowed_before_local({$keywordset})(?!\<DOT\>(?:htm|php|aspx?))$disallowed_after_local/$modifiers",
+                        array($this, 'handle_keyword_replace'),
+                        $stuff_to_parse
+                        );
+                }
+            }
         }
 
-        // Highlight keywords
-        // if there is a couple of alpha symbols there *might* be a keyword
-        if (preg_match('#[a-zA-Z]{2,}#', $stuff_to_parse)) {
-            foreach ($this->language_data['KEYWORDS'] as $k => $keywordset) {
-                if ($this->lexic_permissions['KEYWORDS'][$k]) {
-                    foreach ($keywordset as $keyword) {
-                        $keyword = preg_quote($keyword, '/');
-                        //
-                        // This replacement checks the word is on it's own (except if brackets etc
-                        // are next to it), then highlights it. We don't put the color=" for the span
-                        // in just yet - otherwise languages with the keywords "color" or "or" have
-                        // a fit.
-                        //
-                        if (false !== stristr($stuff_to_parse_pregquote, $keyword )) {
-                            $stuff_to_parse .= ' ';
-                            // Might make a more unique string for putting the number in soon
-                            // Basically, we don't put the styles in yet because then the styles themselves will
-                            // get highlighted if the language has a CSS keyword in it (like CSS, for example ;))
-                            $styles = "/$k/";
-                            if ($this->language_data['CASE_SENSITIVE'][$k]) {
-                                $stuff_to_parse = preg_replace(
-                                    "/([^a-zA-Z0-9\$_\|\#;>|^])($keyword)(?=[^a-zA-Z0-9_<\|%\-&])/e",
-                                    "'\\1' . $func2('\\2', '$k', 'BEGIN') . '<|$styles>' . $func('\\2') . '|>' . $func2('\\2', '$k', 'END')",
-                                    $stuff_to_parse
-                                );
-                            }
-                            else {
-                                // Change the case of the word.
-                                // hackage again... must... release... 1.2...
-                                if ('smarty' == $this->language) { $hackage = '\/'; } else { $hackage = ''; }
-                                $stuff_to_parse = preg_replace(
-                                    "/([^a-zA-Z0-9\$_\|\#;>$hackage|^])($keyword)(?=[^a-zA-Z0-9_<\|%\-&])/ie",
-                                    "'\\1' . $func2('\\2', '$k', 'BEGIN') . '<|$styles>' . $func('\\2') . '|>' . $func2('\\2', '$k', 'END')",
-                                    $stuff_to_parse
-                                );
-                            }
-                            $stuff_to_parse = substr($stuff_to_parse, 0, strlen($stuff_to_parse) - 1);
-                        }
+        // Regular expressions
+        foreach ($this->language_data['REGEXPS'] as $key => $regexp) {
+            if ($this->lexic_permissions['REGEXPS'][$key]) {
+                if (is_array($regexp)) {
+                    if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
+                        // produce valid HTML when we match multiple lines
+                        $this->_hmr_replace = $regexp[GESHI_REPLACE];
+                        $this->_hmr_before = $regexp[GESHI_BEFORE];
+                        $this->_hmr_key = $key;
+                        $this->_hmr_after = $regexp[GESHI_AFTER];
+                        $stuff_to_parse = preg_replace_callback(
+                            "/" . $regexp[GESHI_SEARCH] . "/{$regexp[GESHI_MODIFIERS]}",
+                            array($this, 'handle_multiline_regexps'),
+                            $stuff_to_parse);
+                        $this->_hmr_replace = false;
+                        $this->_hmr_before = '';
+                        $this->_hmr_after = '';
+                    } else {
+                        $stuff_to_parse = preg_replace(
+                            '/' . $regexp[GESHI_SEARCH] . '/' . $regexp[GESHI_MODIFIERS],
+                            $regexp[GESHI_BEFORE] . '<|!REG3XP'. $key .'!>' . $regexp[GESHI_REPLACE] . '|>' . $regexp[GESHI_AFTER],
+                            $stuff_to_parse);
+                    }
+                } else {
+                    if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
+                        // produce valid HTML when we match multiple lines
+                        $this->_hmr_key = $key;
+                        $stuff_to_parse = preg_replace_callback( "/(" . $regexp . ")/",
+                                              array($this, 'handle_multiline_regexps'), $stuff_to_parse);
+                        $this->_hmr_key = '';
+                    } else {
+                        $stuff_to_parse = preg_replace( "/(" . $regexp . ")/", "<|!REG3XP$key!>\\1|>", $stuff_to_parse);
                     }
                 }
             }
         }
 
+        // Highlight numbers. As of 1.0.8 we support different types of numbers
+        $numbers_found = false;
+
+        if ($this->lexic_permissions['NUMBERS'] && preg_match($this->language_data['PARSER_CONTROL']['NUMBERS']['PRECHECK_RX'], $stuff_to_parse )) {
+            $numbers_found = true;
+
+            //For each of the formats ...
+            foreach($this->language_data['NUMBERS_RXCACHE'] as $id => $regexp) {
+                //Check if it should be highlighted ...
+                $stuff_to_parse = preg_replace($regexp, "<|/NUM!$id/>\\1|>", $stuff_to_parse);
+            }
+        }
+
         //
         // Now that's all done, replace /[number]/ with the correct styles
         //
-        foreach ($this->language_data['KEYWORDS'] as $k => $kws) {
+        foreach (array_keys($this->language_data['KEYWORDS']) as $k) {
             if (!$this->use_classes) {
-                $attributes = ' style="' . $this->language_data['STYLES']['KEYWORDS'][$k] . '"';
-            }
-            else {
+                $attributes = ' style="' .
+                    (isset($this->language_data['STYLES']['KEYWORDS'][$k]) ?
+                    $this->language_data['STYLES']['KEYWORDS'][$k] : "") . '"';
+            } else {
                 $attributes = ' class="kw' . $k . '"';
             }
-            $stuff_to_parse = str_replace("/$k/", $attributes, $stuff_to_parse);
+            $stuff_to_parse = str_replace("<|/$k/>", "<|$attributes>", $stuff_to_parse);
         }
 
-        // Put number styles in
-        if (!$this->use_classes && $this->lexic_permissions['NUMBERS']) {
-            $attributes = ' style="' . $this->language_data['STYLES']['NUMBERS'][0] . '"';
-        }
-        else {
-            $attributes = ' class="nu0"';
+        if ($numbers_found) {
+            // Put number styles in
+            foreach($this->language_data['NUMBERS_RXCACHE'] as $id => $regexp) {
+                //Commented out for now, as this needs some review ...
+                //                if ($numbers_permissions & $id) {
+                //Get the appropriate style ...
+                //Checking for unset styles is done by the style cache builder ...
+                if (!$this->use_classes) {
+                    $attributes = ' style="' . $this->language_data['STYLES']['NUMBERS'][$id] . '"';
+                } else {
+                    $attributes = ' class="nu'.$id.'"';
+                }
+
+                //Set in the correct styles ...
+                $stuff_to_parse = str_replace("/NUM!$id/", $attributes, $stuff_to_parse);
+                //                }
+            }
         }
-        $stuff_to_parse = str_replace('/NUM!/', $attributes, $stuff_to_parse);
 
-        //
         // Highlight methods and fields in objects
-        //
         if ($this->lexic_permissions['METHODS'] && $this->language_data['OOLANG']) {
+            $oolang_spaces = "[\s]*";
+            $oolang_before = "";
+            $oolang_after = "[a-zA-Z][a-zA-Z0-9_]*";
+            if (isset($this->language_data['PARSER_CONTROL'])) {
+                if (isset($this->language_data['PARSER_CONTROL']['OOLANG'])) {
+                    if (isset($this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_BEFORE'])) {
+                        $oolang_before = $this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_BEFORE'];
+                    }
+                    if (isset($this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_AFTER'])) {
+                        $oolang_after = $this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_AFTER'];
+                    }
+                    if (isset($this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_SPACES'])) {
+                        $oolang_spaces = $this->language_data['PARSER_CONTROL']['OOLANG']['MATCH_SPACES'];
+                    }
+                }
+            }
+
             foreach ($this->language_data['OBJECT_SPLITTERS'] as $key => $splitter) {
-                if (false !== stristr($stuff_to_parse, $splitter)) {
+                if (false !== strpos($stuff_to_parse, $splitter)) {
                     if (!$this->use_classes) {
                         $attributes = ' style="' . $this->language_data['STYLES']['METHODS'][$key] . '"';
-                    }
-                    else {
+                    } else {
                         $attributes = ' class="me' . $key . '"';
                     }
-                    $stuff_to_parse = preg_replace("/(" . preg_quote($this->language_data['OBJECT_SPLITTERS'][$key], 1) . "[\s]*)([a-zA-Z\*\(][a-zA-Z0-9_\*]*)/", "\\1<|$attributes>\\2|>", $stuff_to_parse);
+                    $stuff_to_parse = preg_replace("/($oolang_before)(" . preg_quote($this->language_data['OBJECT_SPLITTERS'][$key], '/') . ")($oolang_spaces)($oolang_after)/", "\\1\\2\\3<|$attributes>\\4|>", $stuff_to_parse);
                 }
             }
         }
@@ -2124,49 +3529,104 @@
         // be highlighting regardless
         //
         if ($this->lexic_permissions['BRACKETS']) {
-            $code_entities_match = array('[', ']', '(', ')', '{', '}');
-            if (!$this->use_classes) {
-                $code_entities_replace = array(
-                    '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#91;|>',
-                    '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#93;|>',
-                    '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#40;|>',
-                    '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#41;|>',
-                    '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#123;|>',
-                    '<| style="' . $this->language_data['STYLES']['BRACKETS'][0] . '">&#125;|>',
-                );
-            }
-            else {
-                $code_entities_replace = array(
-                    '<| class="br0">&#91;|>',
-                    '<| class="br0">&#93;|>',
-                    '<| class="br0">&#40;|>',
-                    '<| class="br0">&#41;|>',
-                    '<| class="br0">&#123;|>',
-                    '<| class="br0">&#125;|>',
-                );
+            $stuff_to_parse = str_replace( $this->language_data['CACHE_BRACKET_MATCH'],
+                              $this->language_data['CACHE_BRACKET_REPLACE'], $stuff_to_parse );
+        }
+
+
+        //FIX for symbol highlighting ...
+        if ($this->lexic_permissions['SYMBOLS'] && !empty($this->language_data['SYMBOLS'])) {
+            //Get all matches and throw away those witin a block that is already highlighted... (i.e. matched by a regexp)
+            $n_symbols = preg_match_all("/<\|(?:<DOT>|[^>])+>(?:(?!\|>).*?)\|>|<\/a>|(?:" . $this->language_data['SYMBOL_SEARCH'] . ")+(?![^<]+?>)/", $stuff_to_parse, $pot_symbols, PREG_OFFSET_CAPTURE | PREG_SET_ORDER);
+            $global_offset = 0;
+            for ($s_id = 0; $s_id < $n_symbols; ++$s_id) {
+                $symbol_match = $pot_symbols[$s_id][0][0];
+                if (strpos($symbol_match, '<') !== false || strpos($symbol_match, '>') !== false) {
+                    // already highlighted blocks _must_ include either < or >
+                    // so if this conditional applies, we have to skip this match
+                    // BenBE: UNLESS the block contains <SEMI> or <PIPE>
+                    if(strpos($symbol_match, '<SEMI>') === false &&
+                        strpos($symbol_match, '<PIPE>') === false) {
+                        continue;
+                    }
+                }
+
+                // if we reach this point, we have a valid match which needs to be highlighted
+
+                $symbol_length = strlen($symbol_match);
+                $symbol_offset = $pot_symbols[$s_id][0][1];
+                unset($pot_symbols[$s_id]);
+                $symbol_end = $symbol_length + $symbol_offset;
+                $symbol_hl = "";
+
+                // if we have multiple styles, we have to handle them properly
+                if ($this->language_data['MULTIPLE_SYMBOL_GROUPS']) {
+                    $old_sym = -1;
+                    // Split the current stuff to replace into its atomic symbols ...
+                    preg_match_all("/" . $this->language_data['SYMBOL_SEARCH'] . "/", $symbol_match, $sym_match_syms, PREG_PATTERN_ORDER);
+                    foreach ($sym_match_syms[0] as $sym_ms) {
+                        //Check if consequtive symbols belong to the same group to save output ...
+                        if (isset($this->language_data['SYMBOL_DATA'][$sym_ms])
+                            && ($this->language_data['SYMBOL_DATA'][$sym_ms] != $old_sym)) {
+                            if (-1 != $old_sym) {
+                                $symbol_hl .= "|>";
+                            }
+                            $old_sym = $this->language_data['SYMBOL_DATA'][$sym_ms];
+                            if (!$this->use_classes) {
+                                $symbol_hl .= '<| style="' . $this->language_data['STYLES']['SYMBOLS'][$old_sym] . '">';
+                            } else {
+                                $symbol_hl .= '<| class="sy' . $old_sym . '">';
+                            }
+                        }
+                        $symbol_hl .= $sym_ms;
+                    }
+                    unset($sym_match_syms);
+
+                    //Close remaining tags and insert the replacement at the right position ...
+                    //Take caution if symbol_hl is empty to avoid doubled closing spans.
+                    if (-1 != $old_sym) {
+                        $symbol_hl .= "|>";
+                    }
+                } else {
+                    if (!$this->use_classes) {
+                        $symbol_hl = '<| style="' . $this->language_data['STYLES']['SYMBOLS'][0] . '">';
+                    } else {
+                        $symbol_hl = '<| class="sy0">';
+                    }
+                    $symbol_hl .= $symbol_match . '|>';
+                }
+
+                $stuff_to_parse = substr_replace($stuff_to_parse, $symbol_hl, $symbol_offset + $global_offset, $symbol_length);
+
+                // since we replace old text with something of different size,
+                // we'll have to keep track of the differences
+                $global_offset += strlen($symbol_hl) - $symbol_length;
             }
-            $stuff_to_parse = str_replace( $code_entities_match,  $code_entities_replace, $stuff_to_parse );
         }
+        //FIX for symbol highlighting ...
 
-        //
         // Add class/style for regexps
-        //
-        foreach ($this->language_data['REGEXPS'] as $key => $regexp) {
+        foreach (array_keys($this->language_data['REGEXPS']) as $key) {
             if ($this->lexic_permissions['REGEXPS'][$key]) {
-                if (!$this->use_classes) {
-                    $attributes = ' style="' . $this->language_data['STYLES']['REGEXPS'][$key] . '"';
-                }
-                else {
-                   if(is_array($this->language_data['REGEXPS'][$key]) &&
+                if (is_callable($this->language_data['STYLES']['REGEXPS'][$key])) {
+                    $this->_rx_key = $key;
+                    $stuff_to_parse = preg_replace_callback("/!REG3XP$key!(.*)\|>/U",
+                        array($this, 'handle_regexps_callback'),
+                        $stuff_to_parse);
+                } else {
+                    if (!$this->use_classes) {
+                        $attributes = ' style="' . $this->language_data['STYLES']['REGEXPS'][$key] . '"';
+                    } else {
+                        if (is_array($this->language_data['REGEXPS'][$key]) &&
                             array_key_exists(GESHI_CLASS, $this->language_data['REGEXPS'][$key])) {
-                        $attributes = ' class="'
-                            . $this->language_data['REGEXPS'][$key][GESHI_CLASS] . '"';
-                    }
-                   else {
-                       $attributes = ' class="re' . $key . '"';
+                            $attributes = ' class="' .
+                                $this->language_data['REGEXPS'][$key][GESHI_CLASS] . '"';
+                        } else {
+                           $attributes = ' class="re' . $key . '"';
+                        }
                     }
+                    $stuff_to_parse = str_replace("!REG3XP$key!", "$attributes", $stuff_to_parse);
                 }
-                $stuff_to_parse = str_replace("!REG3XP$key!", "$attributes", $stuff_to_parse);
             }
         }
 
@@ -2176,12 +3636,10 @@
         if (isset($this->link_styles[GESHI_LINK])) {
             if ($this->use_classes) {
                 $stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' href=', $stuff_to_parse);
-            }
-            else {
+            } else {
                 $stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' style="' . $this->link_styles[GESHI_LINK] . '" href=', $stuff_to_parse);
             }
-        }
-        else {
+        } else {
             $stuff_to_parse = str_replace('<|UR1|', '<a' . $this->link_target . ' href=', $stuff_to_parse);
         }
 
@@ -2191,7 +3649,6 @@
 
         $stuff_to_parse = str_replace('<|', '<span', $stuff_to_parse);
         $stuff_to_parse = str_replace ( '|>', '</span>', $stuff_to_parse );
-
         return substr($stuff_to_parse, 1);
     }
 
@@ -2220,63 +3677,168 @@
     }
 
     /**
+     * Merges arrays recursively, overwriting values of the first array with values of later arrays
+     *
+     * @since 1.0.8
+     * @access private
+     */
+    function merge_arrays() {
+        $arrays = func_get_args();
+        $narrays = count($arrays);
+
+        // check arguments
+        // comment out if more performance is necessary (in this case the foreach loop will trigger a warning if the argument is not an array)
+        for ($i = 0; $i < $narrays; $i ++) {
+            if (!is_array($arrays[$i])) {
+                // also array_merge_recursive returns nothing in this case
+                trigger_error('Argument #' . ($i+1) . ' is not an array - trying to merge array with scalar! Returning false!', E_USER_WARNING);
+                return false;
+            }
+        }
+
+        // the first array is in the output set in every case
+        $ret = $arrays[0];
+
+        // merege $ret with the remaining arrays
+        for ($i = 1; $i < $narrays; $i ++) {
+            foreach ($arrays[$i] as $key => $value) {
+                if (is_array($value) && isset($ret[$key])) {
+                    // if $ret[$key] is not an array you try to merge an scalar value with an array - the result is not defined (incompatible arrays)
+                    // in this case the call will trigger an E_USER_WARNING and the $ret[$key] will be false.
+                    $ret[$key] = $this->merge_arrays($ret[$key], $value);
+                } else {
+                    $ret[$key] = $value;
+                }
+            }
+        }
+
+        return $ret;
+    }
+
+    /**
      * Gets language information and stores it for later use
      *
+     * @param string The filename of the language file you want to load
+     * @since 1.0.0
      * @access private
      * @todo Needs to load keys for lexic permissions for keywords, regexps etc
      */
     function load_language($file_name) {
+        if ($file_name == $this->loaded_language) {
+            // this file is already loaded!
+            return;
+        }
+
+        //Prepare some stuff before actually loading the language file
+        $this->loaded_language = $file_name;
+        $this->parse_cache_built = false;
         $this->enable_highlighting();
         $language_data = array();
+
+        //Load the language file
         require $file_name;
+
         // Perhaps some checking might be added here later to check that
         // $language data is a valid thing but maybe not
         $this->language_data = $language_data;
+
         // Set strict mode if should be set
-        if ($this->language_data['STRICT_MODE_APPLIES'] == GESHI_ALWAYS) {
-            $this->strict_mode = true;
-        }
+        $this->strict_mode = $this->language_data['STRICT_MODE_APPLIES'];
+
         // Set permissions for all lexics to true
         // so they'll be highlighted by default
-        foreach ($this->language_data['KEYWORDS'] as $key => $words) {
-            $this->lexic_permissions['KEYWORDS'][$key] = true;
+        foreach (array_keys($this->language_data['KEYWORDS']) as $key) {
+            if (!empty($this->language_data['KEYWORDS'][$key])) {
+                $this->lexic_permissions['KEYWORDS'][$key] = true;
+            } else {
+                $this->lexic_permissions['KEYWORDS'][$key] = false;
+            }
         }
-        foreach ($this->language_data['COMMENT_SINGLE'] as $key => $comment) {
+
+        foreach (array_keys($this->language_data['COMMENT_SINGLE']) as $key) {
             $this->lexic_permissions['COMMENTS'][$key] = true;
         }
-        foreach ($this->language_data['REGEXPS'] as $key => $regexp) {
+        foreach (array_keys($this->language_data['REGEXPS']) as $key) {
             $this->lexic_permissions['REGEXPS'][$key] = true;
         }
-        // Set default class for CSS
-        $this->overall_class = $this->language;
+
+        // for BenBE and future code reviews:
+        // we can use empty here since we only check for existance and emptiness of an array
+        // if it is not an array at all but rather false or null this will work as intended as well
+        // even if $this->language_data['PARSER_CONTROL'] is undefined this won't trigger a notice
+        if (!empty($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS'])) {
+            foreach ($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS'] as $flag => $value) {
+                // it's either true or false and maybe is true as well
+                $perm = $value !== GESHI_NEVER;
+                if ($flag == 'ALL') {
+                    $this->enable_highlighting($perm);
+                    continue;
+                }
+                if (!isset($this->lexic_permissions[$flag])) {
+                    // unknown lexic permission
+                    continue;
+                }
+                if (is_array($this->lexic_permissions[$flag])) {
+                    foreach ($this->lexic_permissions[$flag] as $key => $val) {
+                        $this->lexic_permissions[$flag][$key] = $perm;
+                    }
+                } else {
+                    $this->lexic_permissions[$flag] = $perm;
+                }
+            }
+            unset($this->language_data['PARSER_CONTROL']['ENABLE_FLAGS']);
+        }
+
+        //Fix: Problem where hardescapes weren't handled if no ESCAPE_CHAR was given
+        //You need to set one for HARDESCAPES only in this case.
+        if(!isset($this->language_data['HARDCHAR'])) {
+            $this->language_data['HARDCHAR'] = $this->language_data['ESCAPE_CHAR'];
+        }
+
+        //NEW in 1.0.8: Allow styles to be loaded from a separate file to override defaults
+        $style_filename = substr($file_name, 0, -4) . '.style.php';
+        if (is_readable($style_filename)) {
+            //Clear any style_data that could have been set before ...
+            if (isset($style_data)) {
+                unset($style_data);
+            }
+
+            //Read the Style Information from the style file
+            include $style_filename;
+
+            //Apply the new styles to our current language styles
+            if (isset($style_data) && is_array($style_data)) {
+                $this->language_data['STYLES'] =
+                    $this->merge_arrays($this->language_data['STYLES'], $style_data);
+            }
+        }
     }
 
     /**
      * Takes the parsed code and various options, and creates the HTML
      * surrounding it to make it look nice.
      *
-     * @param  string The code already parsed
-     * @return string The code nicely finalised
+     * @param  string The code already parsed (reference!)
      * @since  1.0.0
      * @access private
      */
-    function finalise($parsed_code) {
+    function finalise(&$parsed_code) {
         // Remove end parts of important declarations
         // This is BUGGY!! My fault for bad code: fix coming in 1.2
         // @todo Remove this crap
         if ($this->enable_important_blocks &&
-            (strstr($parsed_code, GeSHi::hsc(GESHI_START_IMPORTANT)) === false)) {
-            $parsed_code = str_replace(GeSHi::hsc(GESHI_END_IMPORTANT), '', $parsed_code);
+            (strpos($parsed_code, $this->hsc(GESHI_START_IMPORTANT)) === false)) {
+            $parsed_code = str_replace($this->hsc(GESHI_END_IMPORTANT), '', $parsed_code);
         }
 
         // Add HTML whitespace stuff if we're using the <div> header
-        if ($this->header_type != GESHI_HEADER_PRE) {
-            $parsed_code = $this->indent($parsed_code);
+        if ($this->header_type != GESHI_HEADER_PRE && $this->header_type != GESHI_HEADER_PRE_VALID) {
+            $this->indent($parsed_code);
         }
 
         // purge some unnecessary stuff
+        /** NOTE: memorypeak #1 */
         $parsed_code = preg_replace('#<span[^>]+>(\s*)</span>#', '\\1', $parsed_code);
-        $parsed_code = preg_replace('#<div[^>]+>(\s*)</div>#', '\\1', $parsed_code);
 
         // If we are using IDs for line numbers, there needs to be an overall
         // ID set to prevent collisions.
@@ -2284,26 +3846,32 @@
             $this->overall_id = 'geshi-' . substr(md5(microtime()), 0, 4);
         }
 
+        // Get code into lines
+        /** NOTE: memorypeak #2 */
+        $code = explode("\n", $parsed_code);
+        $parsed_code = $this->header();
+
         // If we're using line numbers, we insert <li>s and appropriate
         // markup to style them (otherwise we don't need to do anything)
-        if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
+        if ($this->line_numbers != GESHI_NO_LINE_NUMBERS && $this->header_type != GESHI_HEADER_PRE_TABLE) {
             // If we're using the <pre> header, we shouldn't add newlines because
             // the <pre> will line-break them (and the <li>s already do this for us)
-            $ls = ($this->header_type != GESHI_HEADER_PRE) ? "\n" : '';
-            // Get code into lines
-            $code = explode("\n", $parsed_code);
+            $ls = ($this->header_type != GESHI_HEADER_PRE && $this->header_type != GESHI_HEADER_PRE_VALID) ? "\n" : '';
+
             // Set vars to defaults for following loop
-            $parsed_code = '';
             $i = 0;
-            $attrs = array();
 
             // Foreach line...
-            foreach ($code as $line) {
+            for ($i = 0, $n = count($code); $i < $n;) {
+                //Reset the attributes for a new line ...
+                $attrs = array();
+
                 // Make lines have at least one space in them if they're empty
                 // BenBE: Checking emptiness using trim instead of relying on blanks
-                if ('' == trim($line)) {
-                    $line = '&nbsp;';
+                if ('' == trim($code[$i])) {
+                    $code[$i] = '&nbsp;';
                 }
+
                 // If this is a "special line"...
                 if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS &&
                     $i % $this->line_nth_row == ($this->line_nth_row - 1)) {
@@ -2312,8 +3880,7 @@
                         //$attr = ' class="li2"';
                         $attrs['class'][] = 'li2';
                         $def_attr = ' class="de2"';
-                    }
-                    else {
+                    } else {
                         //$attr = ' style="' . $this->line_style2 . '"';
                         $attrs['style'][] = $this->line_style2;
                         // This style "covers up" the special styles set for special lines
@@ -2321,81 +3888,179 @@
                         // code on that line
                         $def_attr = ' style="' . $this->code_style . '"';
                     }
-                    // Span or div?
-                    $start = "<div$def_attr>";
-                    $end = '</div>';
-                }
-                else {
+                } else {
                     if ($this->use_classes) {
                         //$attr = ' class="li1"';
                         $attrs['class'][] = 'li1';
                         $def_attr = ' class="de1"';
-                    }
-                    else {
+                    } else {
                         //$attr = ' style="' . $this->line_style1 . '"';
                         $attrs['style'][] = $this->line_style1;
                         $def_attr = ' style="' . $this->code_style . '"';
                     }
+                }
+
+                //Check which type of tag to insert for this line
+                if ($this->header_type == GESHI_HEADER_PRE_VALID) {
+                    $start = "<pre$def_attr>";
+                    $end = '</pre>';
+                } else {
+                    // Span or div?
                     $start = "<div$def_attr>";
                     $end = '</div>';
                 }
 
                 ++$i;
+
                 // Are we supposed to use ids? If so, add them
                 if ($this->add_ids) {
                     $attrs['id'][] = "$this->overall_id-$i";
                 }
-                if ($this->use_classes && in_array($i, $this->highlight_extra_lines)) {
-                    $attrs['class'][] = 'ln-xtra';
-                }
-                if (!$this->use_classes && in_array($i, $this->highlight_extra_lines)) {
-                    $attrs['style'][] = $this->highlight_extra_lines_style;
+
+                //Is this some line with extra styles???
+                if (in_array($i, $this->highlight_extra_lines)) {
+                    if ($this->use_classes) {
+                        if (isset($this->highlight_extra_lines_styles[$i])) {
+                            $attrs['class'][] = "lx$i";
+                        } else {
+                            $attrs['class'][] = "ln-xtra";
+                        }
+                    } else {
+                        array_push($attrs['style'], $this->get_line_style($i));
+                    }
                 }
 
                 // Add in the line surrounded by appropriate list HTML
-                $attr_string = ' ';
+                $attr_string = '';
                 foreach ($attrs as $key => $attr) {
-                    $attr_string .= $key . '="' . implode(' ', $attr) . '" ';
+                    $attr_string .= ' ' . $key . '="' . implode(' ', $attr) . '"';
                 }
-                $attr_string = substr($attr_string, 0, -1);
-                $parsed_code .= "<li$attr_string>$start$line$end</li>$ls";
-                $attrs = array();
+
+                $parsed_code .= "<li$attr_string>$start{$code[$i-1]}$end</li>$ls";
+                unset($code[$i - 1]);
+            }
+        } else {
+            $n = count($code);
+            if ($this->use_classes) {
+                $attributes = ' class="de1"';
+            } else {
+                $attributes = ' style="'. $this->code_style .'"';
+            }
+            if ($this->header_type == GESHI_HEADER_PRE_VALID) {
+                $parsed_code .= '<pre'. $attributes .'>';
+            } elseif ($this->header_type == GESHI_HEADER_PRE_TABLE) {
+                if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
+                    if ($this->use_classes) {
+                        $attrs = ' class="ln"';
+                    } else {
+                        $attrs = ' style="'. $this->table_linenumber_style .'"';
+                    }
+                    $parsed_code .= '<td'.$attrs.'><pre'.$attributes.'>';
+                    // get linenumbers
+                    // we don't merge it with the for below, since it should be better for
+                    // memory consumption this way
+                    // @todo: but... actually it would still be somewhat nice to merge the two loops
+                    //        the mem peaks are at different positions
+                    for ($i = 0; $i < $n; ++$i) {
+                        $close = 0;
+                        // fancy lines
+                        if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS &&
+                            $i % $this->line_nth_row == ($this->line_nth_row - 1)) {
+                            // Set the attributes to style the line
+                            if ($this->use_classes) {
+                                $parsed_code .= '<span class="xtra li2"><span class="de2">';
+                            } else {
+                                // This style "covers up" the special styles set for special lines
+                                // so that styles applied to special lines don't apply to the actual
+                                // code on that line
+                                $parsed_code .= '<span style="display:block;' . $this->line_style2 . '">'
+                                                  .'<span style="' . $this->code_style .'">';
+                            }
+                            $close += 2;
+                        }
+                        //Is this some line with extra styles???
+                        if (in_array($i + 1, $this->highlight_extra_lines)) {
+                            if ($this->use_classes) {
+                                if (isset($this->highlight_extra_lines_styles[$i])) {
+                                    $parsed_code .= "<span class=\"xtra lx$i\">";
+                                } else {
+                                    $parsed_code .= "<span class=\"xtra ln-xtra\">";
+                                }
+                            } else {
+                                $parsed_code .= "<span style=\"display:block;" . $this->get_line_style($i) . "\">";
+                            }
+                            ++$close;
+                        }
+                        $parsed_code .= $this->line_numbers_start + $i;
+                        if ($close) {
+                            $parsed_code .= str_repeat('</span>', $close);
+                        } else if ($i != $n) {
+                            $parsed_code .= "\n";
+                        }
+                    }
+                    $parsed_code .= '</pre></td><td'.$attributes.'>';
+                }
+                $parsed_code .= '<pre'. $attributes .'>';
             }
-        }
-        else {
             // No line numbers, but still need to handle highlighting lines extra.
             // Have to use divs so the full width of the code is highlighted
-            $code = explode("\n", $parsed_code);
-            $parsed_code = '';
-            $i = 0;
-            foreach ($code as $line) {
+            $close = 0;
+            for ($i = 0; $i < $n; ++$i) {
                 // Make lines have at least one space in them if they're empty
                 // BenBE: Checking emptiness using trim instead of relying on blanks
-                if ('' == trim($line)) {
-                    $line = '&nbsp;';
+                if ('' == trim($code[$i])) {
+                    $code[$i] = '&nbsp;';
                 }
-                if (in_array(++$i, $this->highlight_extra_lines)) {
+                // fancy lines
+                if ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS &&
+                    $i % $this->line_nth_row == ($this->line_nth_row - 1)) {
+                    // Set the attributes to style the line
                     if ($this->use_classes) {
-                        $parsed_code .= '<div class="ln-xtra">';
+                        $parsed_code .= '<span class="xtra li2"><span class="de2">';
+                    } else {
+                        // This style "covers up" the special styles set for special lines
+                        // so that styles applied to special lines don't apply to the actual
+                        // code on that line
+                        $parsed_code .= '<span style="display:block;' . $this->line_style2 . '">'
+                                          .'<span style="' . $this->code_style .'">';
                     }
-                    else {
-                        $parsed_code .= "<div style=\"{$this->highlight_extra_lines_style}\">";
+                    $close += 2;
+                }
+                //Is this some line with extra styles???
+                if (in_array($i + 1, $this->highlight_extra_lines)) {
+                    if ($this->use_classes) {
+                        if (isset($this->highlight_extra_lines_styles[$i])) {
+                            $parsed_code .= "<span class=\"xtra lx$i\">";
+                        } else {
+                            $parsed_code .= "<span class=\"xtra ln-xtra\">";
+                        }
+                    } else {
+                        $parsed_code .= "<span style=\"display:block;" . $this->get_line_style($i) . "\">";
                     }
-                    // Remove \n because it stuffs up <pre> header
-                    $parsed_code .= $line . "</div>";
+                    ++$close;
                 }
-                else {
-                    $parsed_code .= $line . "\n";
+
+                $parsed_code .= $code[$i];
+
+                if ($close) {
+                  $parsed_code .= str_repeat('</span>', $close);
+                  $close = 0;
                 }
+                elseif ($i + 1 < $n) {
+                    $parsed_code .= "\n";
+                }
+                unset($code[$i]);
             }
-        }
 
-        if ($this->header_type == GESHI_HEADER_PRE) {
-            // enforce line numbers when using pre
-            $parsed_code = str_replace('<li></li>', '<li>&nbsp;</li>', $parsed_code);
+            if ($this->header_type == GESHI_HEADER_PRE_VALID || $this->header_type == GESHI_HEADER_PRE_TABLE) {
+                $parsed_code .= '</pre>';
+            }
+            if ($this->header_type == GESHI_HEADER_PRE_TABLE && $this->line_numbers != GESHI_NO_LINE_NUMBERS) {
+                $parsed_code .= '</td>';
+            }
         }
 
-        return $this->header() . chop($parsed_code) . $this->footer();
+        $parsed_code .= $this->footer();
     }
 
     /**
@@ -2407,7 +4072,22 @@
      */
     function header() {
         // Get attributes needed
-        $attributes = $this->get_attributes();
+        /**
+         * @todo   Document behaviour change - class is outputted regardless of whether
+         *         we're using classes or not. Same with style
+         */
+        $attributes = ' class="' . $this->_genCSSName($this->language);
+        if ($this->overall_class != '') {
+            $attributes .= " ".$this->_genCSSName($this->overall_class);
+        }
+        $attributes .= '"';
+
+        if ($this->overall_id != '') {
+            $attributes .= " id=\"{$this->overall_id}\"";
+        }
+        if ($this->overall_style != '' && !$this->use_classes) {
+            $attributes .= ' style="' . $this->overall_style . '"';
+        }
 
         $ol_attributes = '';
 
@@ -2416,110 +4096,104 @@
         }
 
         // Get the header HTML
-        $header = $this->format_header_content();
+        $header = $this->header_content;
+        if ($header) {
+            if ($this->header_type == GESHI_HEADER_PRE || $this->header_type == GESHI_HEADER_PRE_VALID) {
+                $header = str_replace("\n", '', $header);
+            }
+            $header = $this->replace_keywords($header);
+
+            if ($this->use_classes) {
+                $attr = ' class="head"';
+            } else {
+                $attr = " style=\"{$this->header_content_style}\"";
+            }
+            if ($this->header_type == GESHI_HEADER_PRE_TABLE && $this->line_numbers != GESHI_NO_LINE_NUMBERS) {
+                $header = "<thead><tr><td colspan=\"2\" $attr>$header</td></tr></thead>";
+            } else {
+                $header = "<div$attr>$header</div>";
+            }
+        }
 
         if (GESHI_HEADER_NONE == $this->header_type) {
             if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
-                return "$header<ol$ol_attributes>";
+                return "$header<ol$attributes$ol_attributes>";
             }
-            return $header;
+            return $header . ($this->force_code_block ? '<div>' : '');
         }
 
         // Work out what to return and do it
         if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
             if ($this->header_type == GESHI_HEADER_PRE) {
                 return "<pre$attributes>$header<ol$ol_attributes>";
-            }
-            else if ($this->header_type == GESHI_HEADER_DIV) {
+            } else if ($this->header_type == GESHI_HEADER_DIV ||
+                $this->header_type == GESHI_HEADER_PRE_VALID) {
                 return "<div$attributes>$header<ol$ol_attributes>";
+            } else if ($this->header_type == GESHI_HEADER_PRE_TABLE) {
+                return "<table$attributes>$header<tbody><tr class=\"li1\">";
             }
-        }
-        else {
+        } else {
             if ($this->header_type == GESHI_HEADER_PRE) {
-                return "<pre$attributes>$header";
-            }
-            else if ($this->header_type == GESHI_HEADER_DIV) {
-                return "<div$attributes>$header";
+                return "<pre$attributes>$header"  .
+                    ($this->force_code_block ? '<div>' : '');
+            } else {
+                return "<div$attributes>$header" .
+                    ($this->force_code_block ? '<div>' : '');
             }
         }
     }
 
     /**
-     * Returns the header content, formatted for output
+     * Returns the footer for the code block.
      *
-     * @return string The header content, formatted for output
-     * @since  1.0.2
+     * @return string The footer for the code block
+     * @since  1.0.0
      * @access private
      */
-    function format_header_content() {
-        $header = $this->header_content;
-        if ($header) {
+    function footer() {
+        $footer = $this->footer_content;
+        if ($footer) {
             if ($this->header_type == GESHI_HEADER_PRE) {
-                $header = str_replace("\n", '', $header);
+                $footer = str_replace("\n", '', $footer);;
             }
-            $header = $this->replace_keywords($header);
+            $footer = $this->replace_keywords($footer);
 
             if ($this->use_classes) {
-                $attr = ' class="head"';
+                $attr = ' class="foot"';
+            } else {
+                $attr = " style=\"{$this->footer_content_style}\"";
             }
-            else {
-                $attr = " style=\"{$this->header_content_style}\"";
+            if ($this->header_type == GESHI_HEADER_PRE_TABLE && $this->line_numbers != GESHI_NO_LINE_NUMBERS) {
+                $footer = "<tfoot><tr><td colspan=\"2\">$footer</td></tr></tfoot>";
+            } else {
+                $footer = "<div$attr>$footer</div>";
             }
-            return "<div$attr>$header</div>";
         }
-    }
-
-    /**
-     * Returns the footer for the code block.
-     *
-     * @return string The footer for the code block
-     * @since  1.0.0
-     * @access private
-     */
-    function footer() {
-        $footer_content = $this->format_footer_content();
 
         if (GESHI_HEADER_NONE == $this->header_type) {
-            return ($this->line_numbers != GESHI_NO_LINE_NUMBERS) ? '</ol>' . $footer_content
-                : $footer_content;
+            return ($this->line_numbers != GESHI_NO_LINE_NUMBERS) ? '</ol>' . $footer : $footer;
         }
 
-        if ($this->header_type == GESHI_HEADER_DIV) {
+        if ($this->header_type == GESHI_HEADER_DIV || $this->header_type == GESHI_HEADER_PRE_VALID) {
             if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
-                return "</ol>$footer_content</div>";
+                return "</ol>$footer</div>";
             }
-            return "$footer_content</div>";
+            return ($this->force_code_block ? '</div>' : '') .
+                "$footer</div>";
         }
-        else {
+        elseif ($this->header_type == GESHI_HEADER_PRE_TABLE) {
             if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
-                return "</ol>$footer_content</pre>";
+                return "</tr></tbody>$footer</table>";
             }
-            return "$footer_content</pre>";
+            return ($this->force_code_block ? '</div>' : '') .
+                "$footer</div>";
         }
-    }
-
-    /**
-     * Returns the footer content, formatted for output
-     *
-     * @return string The footer content, formatted for output
-     * @since  1.0.2
-     * @access private
-     */
-    function format_footer_content() {
-        $footer = $this->footer_content;
-        if ($footer) {
-            if ($this->header_type == GESHI_HEADER_PRE) {
-                $footer = str_replace("\n", '', $footer);;
-            }
-            $footer = $this->replace_keywords($footer);
-
-            if ($this->use_classes) {
-                $attr = ' class="foot"';
-            }
-            else {
-                $attr = " style=\"{$this->footer_content_style}\"";
+        else {
+            if ($this->line_numbers != GESHI_NO_LINE_NUMBERS) {
+                return "</ol>$footer</pre>";
             }
-            return "<div$attr>$footer</div>";
+            return ($this->force_code_block ? '</div>' : '') .
+                "$footer</pre>";
         }
     }
 
@@ -2537,41 +4211,31 @@
 
         $keywords[] = '<TIME>';
         $keywords[] = '{TIME}';
-        $replacements[] = $replacements[] = number_format($this->get_time(), 3);
+        $replacements[] = $replacements[] = number_format($time = $this->get_time(), 3);
 
         $keywords[] = '<LANGUAGE>';
         $keywords[] = '{LANGUAGE}';
-        $replacements[] = $replacements[] = $this->language;
+        $replacements[] = $replacements[] = $this->language_data['LANG_NAME'];
 
         $keywords[] = '<VERSION>';
         $keywords[] = '{VERSION}';
         $replacements[] = $replacements[] = GESHI_VERSION;
 
-        return str_replace($keywords, $replacements, $instr);
-    }
-
-    /**
-     * Gets the CSS attributes for this code
-     *
-     * @return The CSS attributes for this code
-     * @since  1.0.0
-     * @access private
-     * @todo   Document behaviour change - class is outputted regardless of whether we're using classes or not.
-     *         Same with style
-     */
-    function get_attributes() {
-        $attributes = '';
-
-        if ($this->overall_class != '') {
-            $attributes .= " class=\"{$this->overall_class}\"";
-        }
-        if ($this->overall_id != '') {
-            $attributes .= " id=\"{$this->overall_id}\"";
-        }
-        if ($this->overall_style != '') {
-            $attributes .= ' style="' . $this->overall_style . '"';
+        $keywords[] = '<SPEED>';
+        $keywords[] = '{SPEED}';
+        if ($time <= 0) {
+            $speed = 'N/A';
+        } else {
+            $speed = strlen($this->source) / $time;
+            if ($speed >= 1024) {
+                $speed = sprintf("%.2f KB/s", $speed / 1024.0);
+            } else {
+                $speed = sprintf("%.0f B/s", $speed);
+            }
         }
-        return $attributes;
+        $replacements[] = $replacements[] = $speed;
+
+        return str_replace($keywords, $replacements, $instr);
     }
 
     /**
@@ -2618,34 +4282,48 @@
      * @copyright   Copyright 2007, {@link http://wikkawiki.org/CreditsPage
      *              Wikka Development Team}
      *
-     * @access      public
+     * @access      private
      * @param       string  $string string to be converted
      * @param       integer $quote_style
      *                      - ENT_COMPAT:   escapes &, <, > and double quote (default)
      *                      - ENT_NOQUOTES: escapes only &, < and >
      *                      - ENT_QUOTES:   escapes &, <, >, double and single quotes
      * @return      string  converted string
+     * @since       1.0.7.18
      */
-    function hsc($string, $quote_style=ENT_COMPAT) {
+    function hsc($string, $quote_style = ENT_COMPAT) {
         // init
-        $aTransSpecchar = array(
+        static $aTransSpecchar = array(
             '&' => '&amp;',
             '"' => '&quot;',
             '<' => '&lt;',
-            '>' => '&gt;'
+            '>' => '&gt;',
+
+            //This fix is related to SF#1923020, but has to be applied
+            //regardless of actually highlighting symbols.
+
+            //Circumvent a bug with symbol highlighting
+            //This is required as ; would produce undesirable side-effects if it
+            //was not to be processed as an entity.
+            ';' => '<SEMI>', // Force ; to be processed as entity
+            '|' => '<PIPE>' // Force | to be processed as entity
             );                      // ENT_COMPAT set
 
-        if (ENT_NOQUOTES == $quote_style)       // don't convert double quotes
-        {
-            unset($aTransSpecchar['"']);
-        }
-        elseif (ENT_QUOTES == $quote_style)     // convert single quotes as well
-        {
-            $aTransSpecchar["'"] = '&#39;'; // (apos) htmlspecialchars() uses '&#039;'
+        switch ($quote_style) {
+            case ENT_NOQUOTES: // don't convert double quotes
+                unset($aTransSpecchar['"']);
+                break;
+            case ENT_QUOTES: // convert single quotes as well
+                $aTransSpecchar["'"] = '&#39;'; // (apos) htmlspecialchars() uses '&#039;'
+                break;
         }
 
         // return translated string
-        return strtr($string,$aTransSpecchar);
+        return strtr($string, $aTransSpecchar);
+    }
+
+    function _genCSSName($name){
+        return (is_numeric($name[0]) ? '_' : '') . $name;
     }
 
     /**
@@ -2664,17 +4342,42 @@
         if ($this->error) {
             return '';
         }
+
+        //Check if the style rearrangements have been processed ...
+        //This also does some preprocessing to check which style groups are useable ...
+        if(!isset($this->language_data['NUMBERS_CACHE'])) {
+            $this->build_style_cache();
+        }
+
         // First, work out what the selector should be. If there's an ID,
         // that should be used, the same for a class. Otherwise, a selector
         // of '' means that these styles will be applied anywhere
-        $selector = ($this->overall_id != '') ? "#{$this->overall_id} " : '';
-        $selector = ($selector == '' && $this->overall_class != '') ? ".{$this->overall_class} " : $selector;
+        if ($this->overall_id) {
+            $selector = '#' . $this->_genCSSName($this->overall_id);
+        } else {
+            $selector = '.' . $this->_genCSSName($this->language);
+            if ($this->overall_class) {
+                $selector .= '.' . $this->_genCSSName($this->overall_class);
+            }
+        }
+        $selector .= ' ';
 
         // Header of the stylesheet
         if (!$economy_mode) {
-            $stylesheet = "/**\n * GeSHi Dynamically Generated Stylesheet\n * --------------------------------------\n * Dynamically generated stylesheet for {$this->language}\n * CSS class: {$this->overall_class}, CSS id: {$this->overall_id}\n * GeSHi (C) 2004 - 2007 Nigel McNie (http://qbnz.com/highlighter)\n */\n";
-         } else {
-            $stylesheet = '/* GeSHi (C) 2004 - 2007 Nigel McNie (http://qbnz.com/highlighter) */' . "\n";
+            $stylesheet = "/**\n".
+                " * GeSHi Dynamically Generated Stylesheet\n".
+                " * --------------------------------------\n".
+                " * Dynamically generated stylesheet for {$this->language}\n".
+                " * CSS class: {$this->overall_class}, CSS id: {$this->overall_id}\n".
+                " * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann\n" .
+                " * (http://qbnz.com/highlighter/ and http://geshi.org/)\n".
+                " * --------------------------------------\n".
+                " */\n";
+        } else {
+            $stylesheet = "/**\n".
+                " * GeSHi (C) 2004 - 2007 Nigel McNie, 2007 - 2008 Benny Baumann\n" .
+                " * (http://qbnz.com/highlighter/ and http://geshi.org/)\n".
+                " */\n";
         }
 
         // Set the <ol> to have no effect at all if there are line numbers
@@ -2687,119 +4390,339 @@
         }
 
         // Add overall styles
-        if (!$economy_mode || $this->overall_style != '') {
+        // note: neglect economy_mode, empty styles are meaningless
+        if ($this->overall_style != '') {
             $stylesheet .= "$selector {{$this->overall_style}}\n";
         }
 
         // Add styles for links
+        // note: economy mode does not make _any_ sense here
+        //       either the style is empty and thus no selector is needed
+        //       or the appropriate key is given.
         foreach ($this->link_styles as $key => $style) {
-            if (!$economy_mode || $key == GESHI_LINK && $style != '') {
-                $stylesheet .= "{$selector}a:link {{$style}}\n";
-            }
-            if (!$economy_mode || $key == GESHI_HOVER && $style != '') {
-                $stylesheet .= "{$selector}a:hover {{$style}}\n";
-            }
-            if (!$economy_mode || $key == GESHI_ACTIVE && $style != '') {
-                $stylesheet .= "{$selector}a:active {{$style}}\n";
-            }
-            if (!$economy_mode || $key == GESHI_VISITED && $style != '') {
-                $stylesheet .= "{$selector}a:visited {{$style}}\n";
+            if ($style != '') {
+                switch ($key) {
+                    case GESHI_LINK:
+                        $stylesheet .= "{$selector}a:link {{$style}}\n";
+                        break;
+                    case GESHI_HOVER:
+                        $stylesheet .= "{$selector}a:hover {{$style}}\n";
+                        break;
+                    case GESHI_ACTIVE:
+                        $stylesheet .= "{$selector}a:active {{$style}}\n";
+                        break;
+                    case GESHI_VISITED:
+                        $stylesheet .= "{$selector}a:visited {{$style}}\n";
+                        break;
+                }
             }
         }
 
         // Header and footer
-        if (!$economy_mode || $this->header_content_style != '') {
+        // note: neglect economy_mode, empty styles are meaningless
+        if ($this->header_content_style != '') {
             $stylesheet .= "$selector.head {{$this->header_content_style}}\n";
         }
-        if (!$economy_mode || $this->footer_content_style != '') {
+        if ($this->footer_content_style != '') {
             $stylesheet .= "$selector.foot {{$this->footer_content_style}}\n";
         }
 
         // Styles for important stuff
-        if (!$economy_mode || $this->important_styles != '') {
+        // note: neglect economy_mode, empty styles are meaningless
+        if ($this->important_styles != '') {
             $stylesheet .= "$selector.imp {{$this->important_styles}}\n";
         }
 
-        // Styles for lines being highlighted extra
-        if (!$economy_mode || count($this->highlight_extra_lines)) {
-            $stylesheet .= "$selector.ln-xtra {{$this->highlight_extra_lines_style}}\n";
-        }
-
         // Simple line number styles
-        if (!$economy_mode || ($this->line_numbers != GESHI_NO_LINE_NUMBERS && $this->line_style1 != '')) {
-            $stylesheet .= "{$selector}li {{$this->line_style1}}\n";
+        if ((!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) && $this->line_style1 != '') {
+            $stylesheet .= "{$selector}li, {$selector}.li1 {{$this->line_style1}}\n";
+        }
+        if ((!$economy_mode || $this->line_numbers != GESHI_NO_LINE_NUMBERS) && $this->table_linenumber_style != '') {
+            $stylesheet .= "{$selector}.ln {{$this->table_linenumber_style}}\n";
         }
-
         // If there is a style set for fancy line numbers, echo it out
-        if (!$economy_mode || ($this->line_numbers == GESHI_FANCY_LINE_NUMBERS && $this->line_style2 != '')) {
-            $stylesheet .= "{$selector}li.li2 {{$this->line_style2}}\n";
+        if ((!$economy_mode || $this->line_numbers == GESHI_FANCY_LINE_NUMBERS) && $this->line_style2 != '') {
+            $stylesheet .= "{$selector}.li2 {{$this->line_style2}}\n";
         }
 
+        // note: empty styles are meaningless
         foreach ($this->language_data['STYLES']['KEYWORDS'] as $group => $styles) {
-            if (!$economy_mode || !($economy_mode && (!$this->lexic_permissions['KEYWORDS'][$group] || $styles == ''))) {
+            if ($styles != '' && (!$economy_mode ||
+                (isset($this->lexic_permissions['KEYWORDS'][$group]) &&
+                $this->lexic_permissions['KEYWORDS'][$group]))) {
                 $stylesheet .= "$selector.kw$group {{$styles}}\n";
             }
         }
         foreach ($this->language_data['STYLES']['COMMENTS'] as $group => $styles) {
-            if (!$economy_mode || !($economy_mode && $styles == '') &&
-                !($economy_mode && !$this->lexic_permissions['COMMENTS'][$group])) {
+            if ($styles != '' && (!$economy_mode ||
+                (isset($this->lexic_permissions['COMMENTS'][$group]) &&
+                $this->lexic_permissions['COMMENTS'][$group]) ||
+                (!empty($this->language_data['COMMENT_REGEXP']) &&
+                !empty($this->language_data['COMMENT_REGEXP'][$group])))) {
                 $stylesheet .= "$selector.co$group {{$styles}}\n";
             }
         }
         foreach ($this->language_data['STYLES']['ESCAPE_CHAR'] as $group => $styles) {
-            if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
-                !$this->lexic_permissions['ESCAPE_CHAR'])) {
+            if ($styles != '' && (!$economy_mode || $this->lexic_permissions['ESCAPE_CHAR'])) {
+                // NEW: since 1.0.8 we have to handle hardescapes
+                if ($group === 'HARD') {
+                    $group = '_h';
+                }
                 $stylesheet .= "$selector.es$group {{$styles}}\n";
             }
         }
-        foreach ($this->language_data['STYLES']['SYMBOLS'] as $group => $styles) {
-            if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
-                !$this->lexic_permissions['BRACKETS'])) {
+        foreach ($this->language_data['STYLES']['BRACKETS'] as $group => $styles) {
+            if ($styles != '' && (!$economy_mode || $this->lexic_permissions['BRACKETS'])) {
                 $stylesheet .= "$selector.br$group {{$styles}}\n";
             }
         }
+        foreach ($this->language_data['STYLES']['SYMBOLS'] as $group => $styles) {
+            if ($styles != '' && (!$economy_mode || $this->lexic_permissions['SYMBOLS'])) {
+                $stylesheet .= "$selector.sy$group {{$styles}}\n";
+            }
+        }
         foreach ($this->language_data['STYLES']['STRINGS'] as $group => $styles) {
-            if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
-                !$this->lexic_permissions['STRINGS'])) {
+            if ($styles != '' && (!$economy_mode || $this->lexic_permissions['STRINGS'])) {
+                // NEW: since 1.0.8 we have to handle hardquotes
+                if ($group === 'HARD') {
+                    $group = '_h';
+                }
                 $stylesheet .= "$selector.st$group {{$styles}}\n";
             }
         }
         foreach ($this->language_data['STYLES']['NUMBERS'] as $group => $styles) {
-            if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
-                !$this->lexic_permissions['NUMBERS'])) {
+            if ($styles != '' && (!$economy_mode || $this->lexic_permissions['NUMBERS'])) {
                 $stylesheet .= "$selector.nu$group {{$styles}}\n";
             }
         }
         foreach ($this->language_data['STYLES']['METHODS'] as $group => $styles) {
-            if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
-                !$this->lexic_permissions['METHODS'])) {
+            if ($styles != '' && (!$economy_mode || $this->lexic_permissions['METHODS'])) {
                 $stylesheet .= "$selector.me$group {{$styles}}\n";
             }
         }
+        // note: neglect economy_mode, empty styles are meaningless
         foreach ($this->language_data['STYLES']['SCRIPT'] as $group => $styles) {
-            if (!$economy_mode || !($economy_mode && $styles == '')) {
+            if ($styles != '') {
                 $stylesheet .= "$selector.sc$group {{$styles}}\n";
             }
         }
         foreach ($this->language_data['STYLES']['REGEXPS'] as $group => $styles) {
-            if (!$economy_mode || !($economy_mode && $styles == '') && !($economy_mode &&
-                !$this->lexic_permissions['REGEXPS'][$group])) {
+            if ($styles != '' && (!$economy_mode ||
+                (isset($this->lexic_permissions['REGEXPS'][$group]) &&
+                $this->lexic_permissions['REGEXPS'][$group]))) {
                 if (is_array($this->language_data['REGEXPS'][$group]) &&
-                         array_key_exists(GESHI_CLASS,
-                                    $this->language_data['REGEXPS'][$group])) {
+                    array_key_exists(GESHI_CLASS, $this->language_data['REGEXPS'][$group])) {
                     $stylesheet .= "$selector.";
                     $stylesheet .= $this->language_data['REGEXPS'][$group][GESHI_CLASS];
                     $stylesheet .= " {{$styles}}\n";
-                }
-                else {
+                } else {
                     $stylesheet .= "$selector.re$group {{$styles}}\n";
                 }
             }
         }
+        // Styles for lines being highlighted extra
+        if (!$economy_mode || (count($this->highlight_extra_lines)!=count($this->highlight_extra_lines_styles))) {
+            $stylesheet .= "{$selector}.ln-xtra, {$selector}li.ln-xtra, {$selector}div.ln-xtra {{$this->highlight_extra_lines_style}}\n";
+        }
+        $stylesheet .= "{$selector}span.xtra { display:block; }\n";
+        foreach ($this->highlight_extra_lines_styles as $lineid => $linestyle) {
+            $stylesheet .= "{$selector}.lx$lineid, {$selector}li.lx$lineid, {$selector}div.lx$lineid {{$linestyle}}\n";
+        }
 
         return $stylesheet;
     }
 
+    /**
+     * Get's the style that is used for the specified line
+     *
+     * @param int The line number information is requested for
+     * @access private
+     * @since 1.0.7.21
+     */
+    function get_line_style($line) {
+        //$style = null;
+        $style = null;
+        if (isset($this->highlight_extra_lines_styles[$line])) {
+            $style = $this->highlight_extra_lines_styles[$line];
+        } else { // if no "extra" style assigned
+            $style = $this->highlight_extra_lines_style;
+        }
+
+        return $style;
+    }
+
+    /**
+    * this functions creates an optimized regular expression list
+    * of an array of strings.
+    *
+    * Example:
+    * <code>$list = array('faa', 'foo', 'foobar');
+    *          => string 'f(aa|oo(bar)?)'</code>
+    *
+    * @param $list array of (unquoted) strings
+    * @param $regexp_delimiter your regular expression delimiter, @see preg_quote()
+    * @return string for regular expression
+    * @author Milian Wolff <mail@milianw.de>
+    * @since 1.0.8
+    * @access private
+    */
+    function optimize_regexp_list($list, $regexp_delimiter = '/') {
+        $regex_chars = array('.', '\\', '+', '-', '*', '?', '[', '^', ']', '$',
+            '(', ')', '{', '}', '=', '!', '<', '>', '|', ':', $regexp_delimiter);
+        sort($list);
+        $regexp_list = array('');
+        $num_subpatterns = 0;
+        $list_key = 0;
+
+        // the tokens which we will use to generate the regexp list
+        $tokens = array();
+        $prev_keys = array();
+        // go through all entries of the list and generate the token list
+        $cur_len = 0;
+        for ($i = 0, $i_max = count($list); $i < $i_max; ++$i) {
+            if ($cur_len > GESHI_MAX_PCRE_LENGTH) {
+                // seems like the length of this pcre is growing exorbitantly
+                $regexp_list[++$list_key] = $this->_optimize_regexp_list_tokens_to_string($tokens);
+                $num_subpatterns = substr_count($regexp_list[$list_key], '(?:');
+                $tokens = array();
+                $cur_len = 0;
+            }
+            $level = 0;
+            $entry = preg_quote((string) $list[$i], $regexp_delimiter);
+            $pointer = &$tokens;
+            // properly assign the new entry to the correct position in the token array
+            // possibly generate smaller common denominator keys
+            while (true) {
+                // get the common denominator
+                if (isset($prev_keys[$level])) {
+                    if ($prev_keys[$level] == $entry) {
+                        // this is a duplicate entry, skip it
+                        continue 2;
+                    }
+                    $char = 0;
+                    while (isset($entry[$char]) && isset($prev_keys[$level][$char])
+                            && $entry[$char] == $prev_keys[$level][$char]) {
+                        ++$char;
+                    }
+                    if ($char > 0) {
+                        // this entry has at least some chars in common with the current key
+                        if ($char == strlen($prev_keys[$level])) {
+                            // current key is totally matched, i.e. this entry has just some bits appended
+                            $pointer = &$pointer[$prev_keys[$level]];
+                        } else {
+                            // only part of the keys match
+                            $new_key_part1 = substr($prev_keys[$level], 0, $char);
+                            $new_key_part2 = substr($prev_keys[$level], $char);
+
+                            if (in_array($new_key_part1[0], $regex_chars)
+                                || in_array($new_key_part2[0], $regex_chars)) {
+                                // this is bad, a regex char as first character
+                                $pointer[$entry] = array('' => true);
+                                array_splice($prev_keys, $level, count($prev_keys), $entry);
+                                $cur_len += strlen($entry);
+                                continue;
+                            } else {
+                                // relocate previous tokens
+                                $pointer[$new_key_part1] = array($new_key_part2 => $pointer[$prev_keys[$level]]);
+                                unset($pointer[$prev_keys[$level]]);
+                                $pointer = &$pointer[$new_key_part1];
+                                // recreate key index
+                                array_splice($prev_keys, $level, count($prev_keys), array($new_key_part1, $new_key_part2));
+                                $cur_len += strlen($new_key_part2);
+                            }
+                        }
+                        ++$level;
+                        $entry = substr($entry, $char);
+                        continue;
+                    }
+                    // else: fall trough, i.e. no common denominator was found
+                }
+                if ($level == 0 && !empty($tokens)) {
+                    // we can dump current tokens into the string and throw them away afterwards
+                    $new_entry = $this->_optimize_regexp_list_tokens_to_string($tokens);
+                    $new_subpatterns = substr_count($new_entry, '(?:');
+                    if (GESHI_MAX_PCRE_SUBPATTERNS && $num_subpatterns + $new_subpatterns > GESHI_MAX_PCRE_SUBPATTERNS) {
+                        $regexp_list[++$list_key] = $new_entry;
+                        $num_subpatterns = $new_subpatterns;
+                    } else {
+                        if (!empty($regexp_list[$list_key])) {
+                            $new_entry = '|' . $new_entry;
+                        }
+                        $regexp_list[$list_key] .= $new_entry;
+                        $num_subpatterns += $new_subpatterns;
+                    }
+                    $tokens = array();
+                    $cur_len = 0;
+                }
+                // no further common denominator found
+                $pointer[$entry] = array('' => true);
+                array_splice($prev_keys, $level, count($prev_keys), $entry);
+
+                $cur_len += strlen($entry);
+                break;
+            }
+            unset($list[$i]);
+        }
+        // make sure the last tokens get converted as well
+        $new_entry = $this->_optimize_regexp_list_tokens_to_string($tokens);
+        if (GESHI_MAX_PCRE_SUBPATTERNS && $num_subpatterns + substr_count($new_entry, '(?:') > GESHI_MAX_PCRE_SUBPATTERNS) {
+            if ( !empty($regexp_list[$list_key]) ) {
+              ++$list_key;
+            }
+            $regexp_list[$list_key] = $new_entry;
+        } else {
+            if (!empty($regexp_list[$list_key])) {
+                $new_entry = '|' . $new_entry;
+            }
+            $regexp_list[$list_key] .= $new_entry;
+        }
+        return $regexp_list;
+    }
+    /**
+    * this function creates the appropriate regexp string of an token array
+    * you should not call this function directly, @see $this->optimize_regexp_list().
+    *
+    * @param &$tokens array of tokens
+    * @param $recursed bool to know wether we recursed or not
+    * @return string
+    * @author Milian Wolff <mail@milianw.de>
+    * @since 1.0.8
+    * @access private
+    */
+    function _optimize_regexp_list_tokens_to_string(&$tokens, $recursed = false) {
+        $list = '';
+        foreach ($tokens as $token => $sub_tokens) {
+            $list .= $token;
+            $close_entry = isset($sub_tokens['']);
+            unset($sub_tokens['']);
+            if (!empty($sub_tokens)) {
+                $list .= '(?:' . $this->_optimize_regexp_list_tokens_to_string($sub_tokens, true) . ')';
+                if ($close_entry) {
+                    // make sub_tokens optional
+                    $list .= '?';
+                }
+            }
+            $list .= '|';
+        }
+        if (!$recursed) {
+            // do some optimizations
+            // common trailing strings
+            // BUGGY!
+            //$list = preg_replace_callback('#(?<=^|\:|\|)\w+?(\w+)(?:\|.+\1)+(?=\|)#', create_function(
+            //    '$matches', 'return "(?:" . preg_replace("#" . preg_quote($matches[1], "#") . "(?=\||$)#", "", $matches[0]) . ")" . $matches[1];'), $list);
+            // (?:p)? => p?
+            $list = preg_replace('#\(\?\:(.)\)\?#', '\1?', $list);
+            // (?:a|b|c|d|...)? => [abcd...]?
+            // TODO: a|bb|c => [ac]|bb
+            static $callback_2;
+            if (!isset($callback_2)) {
+                $callback_2 = create_function('$matches', 'return "[" . str_replace("|", "", $matches[1]) . "]";');
+            }
+            $list = preg_replace_callback('#\(\?\:((?:.\|)+.)\)#', $callback_2, $list);
+        }
+        // return $list without trailing pipe
+        return substr($list, 0, -1);
+    }
 } // End Class GeSHi
 
 
@@ -2818,10 +4741,13 @@
     function geshi_highlight($string, $language, $path = null, $return = false) {
         $geshi = new GeSHi($string, $language, $path);
         $geshi->set_header_type(GESHI_HEADER_NONE);
+
         if ($return) {
             return '<code>' . $geshi->parse_code() . '</code>';
         }
+
         echo '<code>' . $geshi->parse_code() . '</code>';
+
         if ($geshi->error()) {
             return false;
         }
@@ -2829,4 +4755,4 @@
     }
 }
 
-?>
+?>
\ No hay ningún carácter de nueva línea al final del fichero
diff -aruN --binary 22/libraries/joomla/application/application.php 23/libraries/joomla/application/application.php
--- 22/libraries/joomla/application/application.php	2010-04-27 02:31:16.000000000 +0200
+++ 23/libraries/joomla/application/application.php	2011-04-04 18:51:40.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: application.php 16449 2010-04-25 21:17:31Z ian $
+* @version		$Id: application.php 21074 2011-04-04 16:51:40Z dextercowley $
 * @package		Joomla.Framework
 * @subpackage	Application
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -15,6 +15,8 @@
 // Check to ensure this file is within the rest of the framework
 defined('JPATH_BASE') or die();
 
+jimport('joomla.event.dispatcher');
+
 /**
 * Base class for a Joomla! application.
 *
diff -aruN --binary 22/libraries/joomla/document/html/renderer/head.php 23/libraries/joomla/document/html/renderer/head.php
--- 22/libraries/joomla/document/html/renderer/head.php	2010-04-23 12:40:18.000000000 +0200
+++ 23/libraries/joomla/document/html/renderer/head.php	2011-04-04 18:51:40.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: head.php 14401 2010-01-26 14:10:00Z louis $
+* @version		$Id: head.php 21074 2011-04-04 16:51:40Z dextercowley $
 * @package		Joomla.Framework
 * @subpackage	Document
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -52,6 +52,10 @@
 	 */
 	function fetchHead(&$document)
 	{
+		// Trigger the onBeforeCompileHead event.
+		$app = &JFactory::getApplication();
+		$app->triggerEvent('onBeforeCompileHead');
+		
 		// get line endings
 		$lnEnd = $document->_getLineEnd();
 		$tab = $document->_getTab();
diff -aruN --binary 22/libraries/joomla/environment/response.php 23/libraries/joomla/environment/response.php
--- 22/libraries/joomla/environment/response.php	2010-04-23 12:40:18.000000000 +0200
+++ 23/libraries/joomla/environment/response.php	2011-03-31 18:03:24.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: response.php 14401 2010-01-26 14:10:00Z louis $
+ * @version		$Id: response.php 21044 2011-03-31 16:03:23Z dextercowley $
  * @package		Joomla.Framework
  * @subpackage	Environment
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -198,7 +198,8 @@
 		{
 			JResponse::setHeader( 'Expires', 'Mon, 1 Jan 2001 00:00:00 GMT', true ); 				// Expires in the past
 			JResponse::setHeader( 'Last-Modified', gmdate("D, d M Y H:i:s") . ' GMT', true ); 		// Always modified
-			JResponse::setHeader( 'Cache-Control', 'no-store, no-cache, must-revalidate, post-check=0, pre-check=0', false );
+			JResponse::setHeader( 'Cache-Control', 'no-store, no-cache, must-revalidate', true ); 	// Extra CYA
+			JResponse::setHeader( 'Cache-Control', 'post-check=0, pre-check=0', false );			// HTTP/1.1
 			JResponse::setHeader( 'Pragma', 'no-cache' ); 											// HTTP 1.0
 		}
 
diff -aruN --binary 22/libraries/joomla/environment/uri.php 23/libraries/joomla/environment/uri.php
--- 22/libraries/joomla/environment/uri.php	2010-10-08 06:39:10.000000000 +0200
+++ 23/libraries/joomla/environment/uri.php	2011-04-04 22:54:40.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: uri.php 19058 2010-10-08 04:15:39Z dextercowley $
+ * @version		$Id: uri.php 21079 2011-04-04 20:54:40Z dextercowley $
  * @package		Joomla.Framework
  * @subpackage	Environment
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -240,11 +240,15 @@
 				$uri	         =& JURI::getInstance();
 				$base['prefix'] = $uri->toString( array('scheme', 'host', 'port'));
 
-				if (strpos(php_sapi_name(), 'cgi') !== false && !empty($_SERVER['REQUEST_URI'])) {
-					//Apache CGI
+				if (strpos(php_sapi_name(), 'cgi') !== false && !empty($_SERVER['REQUEST_URI']) &&
+				    (!ini_get('cgi.fix_pathinfo') || version_compare(PHP_VERSION, '5.2.4', '<'))) {
+					// CGI on PHP pre-5.2.4 with cgi.fix_pathinfo = 0.
+
+					// In pre-rev. 240885 of main_cgi.c, SCRIPT_NAME doesn't conform the PHP spec.,
+					// therefore we use PHP_SELF instead.
 					$base['path'] =  rtrim(dirname(str_replace(array('"', '<', '>', "'"), '', $_SERVER["PHP_SELF"])), '/\\');
 				} else {
-					//Others
+					// Since PHP 5.2.4 we can trust SCRIPT_NAME;  it conforms the spec.
 					$base['path'] =  rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\');
 				}
 			}
diff -aruN --binary 22/libraries/joomla/filesystem/path.php 23/libraries/joomla/filesystem/path.php
--- 22/libraries/joomla/filesystem/path.php	2010-04-23 12:40:18.000000000 +0200
+++ 23/libraries/joomla/filesystem/path.php	2011-04-04 00:19:02.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: path.php 14401 2010-01-26 14:10:00Z louis $
+ * @version		$Id: path.php 21066 2011-04-03 22:19:02Z dextercowley $
  * @package		Joomla.Framework
  * @subpackage	FileSystem
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -244,8 +244,13 @@
 			{
 				// not a stream, so do a realpath() to avoid directory
 				// traversal attempts on the local file system.
-				$path = realpath($path); // needed for substr() later
-				$fullname = realpath($fullname);
+				if (file_exists($path)) {
+					$path = realpath($path); // needed for substr() later
+					$fullname = realpath($fullname);
+				} else {
+					$path = '';
+					$fullname = '';
+				}
 			}
 
 			// the substr() check added to make sure that the realpath()
diff -aruN --binary 22/libraries/joomla/version.php 23/libraries/joomla/version.php
--- 22/libraries/joomla/version.php	2010-11-03 16:00:56.000000000 +0100
+++ 23/libraries/joomla/version.php	2011-04-05 00:01:18.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: version.php 19340 2010-11-03 15:00:55Z ian $
+ * @version		$Id: version.php 21080 2011-04-04 22:01:17Z dextercowley $
  * @package	Joomla.Framework
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
  * @license		GNU/GPL, see LICENSE.php
@@ -26,19 +26,19 @@
 	/** @var string Development Status */
 	var $DEV_STATUS = 'Stable';
 	/** @var int Sub Release Level */
-	var $DEV_LEVEL 	= '22';
+	var $DEV_LEVEL 	= '23';
 	/** @var int build Number */
 	var $BUILD	= '';
 	/** @var string Codename */
-	var $CODENAME 	= 'senu takaa ama woi';
+	var $CODENAME 	= 'senu takaa ama baji';
 	/** @var string Date */
-	var $RELDATE 	= '04-November-2010';
+	var $RELDATE 	= '04-March-2011';
 	/** @var string Time */
 	var $RELTIME 	= '18:00';
 	/** @var string Timezone */
 	var $RELTZ 	= 'GMT';
 	/** @var string Copyright Text */
-	var $COPYRIGHT 	= 'Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.';
+	var $COPYRIGHT 	= 'Copyright (C) 2005 - 2011 Open Source Matters. All rights reserved.';
 	/** @var string URL */
 	var $URL 	= '<a href="http://www.joomla.org">Joomla!</a> is Free Software released under the GNU General Public License.';
 
diff -aruN --binary 22/plugins/editors-xtd/image.php 23/plugins/editors-xtd/image.php
--- 22/plugins/editors-xtd/image.php	2010-04-23 12:40:20.000000000 +0200
+++ 23/plugins/editors-xtd/image.php	2011-04-04 00:58:48.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version		$Id: image.php 14401 2010-01-26 14:10:00Z louis $
+ * @version		$Id: image.php 21069 2011-04-03 22:58:48Z dextercowley $
  * @package		Joomla
  * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
  * @license		GNU/GPL, see LICENSE.php
@@ -51,7 +51,7 @@
 		$params =& JComponentHelper::getParams('com_media');
 		//Find out who has permission to upload and change the acl to let them.
 		$acl = & JFactory::getACL();
-		switch ($params->get('allowed_media_usergroup')) 
+		switch ($params->get('allowed_media_usergroup'))
 		{
 			case '1':
 				$acl->addACL( 'com_media', 'upload', 'users', 'publisher' );
@@ -60,19 +60,19 @@
 				$acl->addACL( 'com_media', 'upload', 'users', 'publisher' );
 				$acl->addACL( 'com_media', 'upload', 'users', 'editor' );
 				break;
-			case '3': 
+			case '3':
 				$acl->addACL( 'com_media', 'upload', 'users', 'publisher' );
-				$acl->addACL( 'com_media', 'upload', 'users', 'editor' );				
+				$acl->addACL( 'com_media', 'upload', 'users', 'editor' );
 				$acl->addACL( 'com_media', 'upload', 'users', 'author' );
-				break;								
+				break;
 			case '4':
-				$acl->addACL( 'com_media', 'upload', 'users', 'publisher' );				
+				$acl->addACL( 'com_media', 'upload', 'users', 'publisher' );
 				$acl->addACL( 'com_media', 'upload', 'users', 'editor' );
 				$acl->addACL( 'com_media', 'upload', 'users', 'author' );
 				$acl->addACL( 'com_media', 'upload', 'users', 'registered' );
 				break;
 		}
-	
+
 		//Make sure the user is authorized to view this page
 		$user = & JFactory::getUser();
 		if (!$user->authorize( 'com_media', 'popup' )) {
@@ -81,7 +81,7 @@
 		$doc 		=& JFactory::getDocument();
 		$template 	= $mainframe->getTemplate();
 
-		$link = 'index.php?option=com_media&amp;view=images&amp;tmpl=component&amp;e_name='.$name;
+		$link = 'index.php?option=com_media&amp;view=images&amp;layout=default&amp;tmpl=component&amp;e_name='.$name;
 
 		JHTML::_('behavior.modal');
 
diff -aruN --binary 22/plugins/system/legacy/toolbar.php 23/plugins/system/legacy/toolbar.php
--- 22/plugins/system/legacy/toolbar.php	2010-04-23 12:40:20.000000000 +0200
+++ 23/plugins/system/legacy/toolbar.php	2011-04-04 00:03:08.000000000 +0200
@@ -1,6 +1,6 @@
 <?php
 /**
-* @version		$Id: toolbar.php 14401 2010-01-26 14:10:00Z louis $
+* @version		$Id: toolbar.php 21062 2011-04-03 22:03:07Z dextercowley $
 * @package		Joomla.Legacy
 * @subpackage	1.5
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.
@@ -12,6 +12,9 @@
 * See COPYRIGHT.php for copyright notices and details.
 */
 
+// Check to ensure this file is within the rest of the framework
+defined('JPATH_BASE') or die();
+
 /**
  * Legacy class
  *
diff -aruN --binary 22/plugins/system/mtupgrade/mootools.js 23/plugins/system/mtupgrade/mootools.js
--- 22/plugins/system/mtupgrade/mootools.js	2010-07-18 04:20:32.000000000 +0200
+++ 23/plugins/system/mtupgrade/mootools.js	2011-04-04 22:46:26.000000000 +0200
@@ -1 +1 @@
-var MooTools={version:"1.2.4",build:"0d9113241a90b9cd5643b926795852a2026710d4"};var Native=function(k){k=k||{};var a=k.name;var i=k.legacy;var b=k.protect;var c=k.implement;var h=k.generics;var f=k.initialize;var g=k.afterImplement||function(){};var d=f||i;h=h!==false;d.constructor=Native;d.$family={name:"native"};if(i&&f){d.prototype=i.prototype}d.prototype.constructor=d;if(a){var e=a.toLowerCase();d.prototype.$family={name:e};Native.typize(d,e)}var j=function(n,l,o,m){if(!b||m||!n.prototype[l]){n.prototype[l]=o}if(h){Native.genericize(n,l,b)}g.call(n,l,o);return n};d.alias=function(n,l,p){if(typeof n=="string"){var o=this.prototype[n];if((n=o)){return j(this,l,n,p)}}for(var m in n){this.alias(m,n[m],l)}return this};d.implement=function(m,l,o){if(typeof m=="string"){return j(this,m,l,o)}for(var n in m){j(this,n,m[n],l)}return this};if(c){d.implement(c)}return d};Native.genericize=function(b,c,a){if((!a||!b[c])&&typeof b.prototype[c]=="function"){b[c]=function(){var d=Array.prototype.slice.call(arguments);return b.prototype[c].apply(d.shift(),d)}}};Native.implement=function(d,c){for(var b=0,a=d.length;b<a;b++){d[b].implement(c)}};Native.typize=function(a,b){if(!a.type){a.type=function(c){return($type(c)===b)}}};(function(){var a={Array:Array,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String};for(var h in a){new Native({name:h,initialize:a[h],protect:true})}var d={"boolean":Boolean,"native":Native,object:Object};for(var c in d){Native.typize(d[c],c)}var f={Array:["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],String:["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]};for(var e in f){for(var b=f[e].length;b--;){Native.genericize(a[e],f[e][b],true)}}})();var Hash=new Native({name:"Hash",initialize:function(a){if($type(a)=="hash"){a=$unlink(a.getClean())}for(var b in a){this[b]=a[b]}return this}});Hash.implement({forEach:function(b,c){for(var a in this){if(this.hasOwnProperty(a)){b.call(c,this[a],a,this)}}},getClean:function(){var b={};for(var a in this){if(this.hasOwnProperty(a)){b[a]=this[a]}}return b},getLength:function(){var b=0;for(var a in this){if(this.hasOwnProperty(a)){b++}}return b}});Hash.alias("forEach","each");Array.implement({forEach:function(c,d){for(var b=0,a=this.length;b<a;b++){c.call(d,this[b],b,this)}}});Array.alias("forEach","each");function $A(b){if(b.item){var a=b.length,c=new Array(a);while(a--){c[a]=b[a]}return c}return Array.prototype.slice.call(b)}function $arguments(a){return function(){return arguments[a]}}function $chk(a){return !!(a||a===0)}function $clear(a){clearTimeout(a);clearInterval(a);return null}function $defined(a){return(a!=undefined)}function $each(c,b,d){var a=$type(c);((a=="arguments"||a=="collection"||a=="array")?Array:Hash).each(c,b,d)}function $empty(){}function $extend(c,a){for(var b in (a||{})){c[b]=a[b]}return c}function $H(a){return new Hash(a)}function $lambda(a){return($type(a)=="function")?a:function(){return a}}function $merge(){var a=Array.slice(arguments);a.unshift({});return $mixin.apply(null,a)}function $mixin(e){for(var d=1,a=arguments.length;d<a;d++){var b=arguments[d];if($type(b)!="object"){continue}for(var c in b){var g=b[c],f=e[c];e[c]=(f&&$type(g)=="object"&&$type(f)=="object")?$mixin(f,g):$unlink(g)}}return e}function $pick(){for(var b=0,a=arguments.length;b<a;b++){if(arguments[b]!=undefined){return arguments[b]}}return null}function $random(b,a){return Math.floor(Math.random()*(a-b+1)+b)}function $splat(b){var a=$type(b);return(a)?((a!="array"&&a!="arguments")?[b]:b):[]}var $time=Date.now||function(){return +new Date};function $try(){for(var b=0,a=arguments.length;b<a;b++){try{return arguments[b]()}catch(c){}}return null}function $type(a){if(a==undefined){return false}if(a.$family){return(a.$family.name=="number"&&!isFinite(a))?false:a.$family.name}if(a.nodeName){switch(a.nodeType){case 1:return"element";case 3:return(/\S/).test(a.nodeValue)?"textnode":"whitespace"}}else{if(typeof a.length=="number"){if(a.callee){return"arguments"}else{if(a.item){return"collection"}}}}return typeof a}function $unlink(c){var b;switch($type(c)){case"object":b={};for(var e in c){b[e]=$unlink(c[e])}break;case"hash":b=new Hash(c);break;case"array":b=[];for(var d=0,a=c.length;d<a;d++){b[d]=$unlink(c[d])}break;default:return c}return b}var Browser=$merge({Engine:{name:"unknown",version:0},Platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925))},trident:function(){return(!window.ActiveXObject)?false:((window.XMLHttpRequest)?((document.querySelectorAll)?6:5):4)},webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419)},gecko:function(){return(!document.getBoxObjectFor&&window.mozInnerScreenX==null)?false:((document.getElementsByClassName)?19:18)}}},Browser||{});Browser.Platform[Browser.Platform.name]=true;Browser.detect=function(){for(var b in this.Engines){var a=this.Engines[b]();if(a){this.Engine={name:b,version:a};this.Engine[b]=this.Engine[b+a]=true;break}}return{name:b,version:a}};Browser.detect();Browser.Request=function(){return $try(function(){return new XMLHttpRequest()},function(){return new ActiveXObject("MSXML2.XMLHTTP")},function(){return new ActiveXObject("Microsoft.XMLHTTP")})};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var a=($try(function(){return navigator.plugins["Shockwave Flash"].description},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version")})||"0 r0").match(/\d+/g);return{version:parseInt(a[0]||0+"."+a[1],10)||0,build:parseInt(a[2],10)||0}})();function $exec(b){if(!b){return b}if(window.execScript){window.execScript(b)}else{var a=document.createElement("script");a.setAttribute("type","text/javascript");a[(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerText":"text"]=b;document.head.appendChild(a);document.head.removeChild(a)}return b}Native.UID=1;var $uid=(Browser.Engine.trident)?function(a){return(a.uid||(a.uid=[Native.UID++]))[0]}:function(a){return a.uid||(a.uid=Native.UID++)};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(a){$uid(a);if(!a.Element){a.Element=$empty;if(Browser.Engine.webkit){a.document.createElement("iframe")}a.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{}}a.document.window=a;return $extend(a,Window.Prototype)},afterImplement:function(b,a){window[b]=Window.Prototype[b]=a}});Window.Prototype={$family:{name:"window"}};new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(a){$uid(a);a.head=a.getElementsByTagName("head")[0];a.html=a.getElementsByTagName("html")[0];if(Browser.Engine.trident&&Browser.Engine.version<=4){$try(function(){a.execCommand("BackgroundImageCache",false,true)})}if(Browser.Engine.trident){a.window.attachEvent("onunload",function(){a.window.detachEvent("onunload",arguments.callee);a.head=a.html=a.window=null})}return $extend(a,Document.Prototype)},afterImplement:function(b,a){document[b]=Document.Prototype[b]=a}});Document.Prototype={$family:{name:"document"}};new Document(document);Array.implement({every:function(c,d){for(var b=0,a=this.length;b<a;b++){if(!c.call(d,this[b],b,this)){return false}}return true},filter:function(d,e){var c=[];for(var b=0,a=this.length;b<a;b++){if(d.call(e,this[b],b,this)){c.push(this[b])}}return c},clean:function(){return this.filter($defined)},indexOf:function(c,d){var a=this.length;for(var b=(d<0)?Math.max(0,a+d):d||0;b<a;b++){if(this[b]===c){return b}}return -1},map:function(d,e){var c=[];for(var b=0,a=this.length;b<a;b++){c[b]=d.call(e,this[b],b,this)}return c},some:function(c,d){for(var b=0,a=this.length;b<a;b++){if(c.call(d,this[b],b,this)){return true}}return false},associate:function(c){var d={},b=Math.min(this.length,c.length);for(var a=0;a<b;a++){d[c[a]]=this[a]}return d},link:function(c){var a={};for(var e=0,b=this.length;e<b;e++){for(var d in c){if(c[d](this[e])){a[d]=this[e];delete c[d];break}}}return a},contains:function(a,b){return this.indexOf(a,b)!=-1},extend:function(c){for(var b=0,a=c.length;b<a;b++){this.push(c[b])}return this},getLast:function(){return(this.length)?this[this.length-1]:null},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null},include:function(a){if(!this.contains(a)){this.push(a)}return this},combine:function(c){for(var b=0,a=c.length;b<a;b++){this.include(c[b])}return this},erase:function(b){for(var a=this.length;a--;a){if(this[a]===b){this.splice(a,1)}}return this},empty:function(){this.length=0;return this},flatten:function(){var d=[];for(var b=0,a=this.length;b<a;b++){var c=$type(this[b]);if(!c){continue}d=d.concat((c=="array"||c=="collection"||c=="arguments")?Array.flatten(this[b]):this[b])}return d},hexToRgb:function(b){if(this.length!=3){return null}var a=this.map(function(c){if(c.length==1){c+=c}return c.toInt(16)});return(b)?a:"rgb("+a+")"},rgbToHex:function(d){if(this.length<3){return null}if(this.length==4&&this[3]==0&&!d){return"transparent"}var b=[];for(var a=0;a<3;a++){var c=(this[a]-0).toString(16);b.push((c.length==1)?"0"+c:c)}return(d)?b:"#"+b.join("")}});Function.implement({extend:function(a){for(var b in a){this[b]=a[b]}return this},create:function(b){var a=this;b=b||{};return function(d){var c=b.arguments;c=(c!=undefined)?$splat(c):Array.slice(arguments,(b.event)?1:0);if(b.event){c=[d||window.event].extend(c)}var e=function(){return a.apply(b.bind||null,c)};if(b.delay){return setTimeout(e,b.delay)}if(b.periodical){return setInterval(e,b.periodical)}if(b.attempt){return $try(e)}return e()}},run:function(a,b){return this.apply(b,$splat(a))},pass:function(a,b){return this.create({bind:b,arguments:a})},bind:function(b,a){return this.create({bind:b,arguments:a})},bindWithEvent:function(b,a){return this.create({bind:b,arguments:a,event:true})},attempt:function(a,b){return this.create({bind:b,arguments:a,attempt:true})()},delay:function(b,c,a){return this.create({bind:c,arguments:a,delay:b})()},periodical:function(c,b,a){return this.create({bind:b,arguments:a,periodical:c})()}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this))},round:function(a){a=Math.pow(10,a||0);return Math.round(this*a)/a},times:function(b,c){for(var a=0;a<this;a++){b.call(c,a,this)}},toFloat:function(){return parseFloat(this)},toInt:function(a){return parseInt(this,a||10)}});Number.alias("times","each");(function(b){var a={};b.each(function(c){if(!Number[c]){a[c]=function(){return Math[c].apply(null,[this].concat($A(arguments)))}}});Number.implement(a)})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(a,b){return((typeof a=="string")?new RegExp(a,b):a).test(this)},contains:function(a,b){return(b)?(b+this+b).indexOf(b+a+b)>-1:this.indexOf(a)>-1},trim:function(){return this.replace(/^\s+|\s+$/g,"")},clean:function(){return this.replace(/\s+/g," ").trim()},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase()})},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase())})},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase()})},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")},toInt:function(a){return parseInt(this,a||10)},toFloat:function(){return parseFloat(this)},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(a)?a.slice(1).hexToRgb(b):null},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null},stripScripts:function(b){var a="";var c=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){a+=arguments[1]+"\n";return""});if(b===true){$exec(a)}else{if($type(b)=="function"){b(a,c)}}return c},substitute:function(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1)}return(a[c]!=undefined)?a[c]:""})}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(b){for(var a in this){if(this.hasOwnProperty(a)&&this[a]===b){return a}}return null},hasValue:function(a){return(Hash.keyOf(this,a)!==null)},extend:function(a){Hash.each(a||{},function(c,b){Hash.set(this,b,c)},this);return this},combine:function(a){Hash.each(a||{},function(c,b){Hash.include(this,b,c)},this);return this},erase:function(a){if(this.hasOwnProperty(a)){delete this[a]}return this},get:function(a){return(this.hasOwnProperty(a))?this[a]:null},set:function(a,b){if(!this[a]||this.hasOwnProperty(a)){this[a]=b}return this},empty:function(){Hash.each(this,function(b,a){delete this[a]},this);return this},include:function(a,b){if(this[a]==undefined){this[a]=b}return this},map:function(b,c){var a=new Hash;Hash.each(this,function(e,d){a.set(d,b.call(c,e,d,this))},this);return a},filter:function(b,c){var a=new Hash;Hash.each(this,function(e,d){if(b.call(c,e,d,this)){a.set(d,e)}},this);return a},every:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&!b.call(c,this[a],a)){return false}}return true},some:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&b.call(c,this[a],a)){return true}}return false},getKeys:function(){var a=[];Hash.each(this,function(c,b){a.push(b)});return a},getValues:function(){var a=[];Hash.each(this,function(b){a.push(b)});return a},toQueryString:function(a){var b=[];Hash.each(this,function(f,e){if(a){e=a+"["+e+"]"}var d;switch($type(f)){case"object":d=Hash.toQueryString(f,e);break;case"array":var c={};f.each(function(h,g){c[g]=h});d=Hash.toQueryString(c,e);break;default:d=e+"="+encodeURIComponent(f)}if(f!=undefined){b.push(d)}});return b.join("&")}});Hash.alias({keyOf:"indexOf",hasValue:"contains"});var Event=new Native({name:"Event",initialize:function(a,f){f=f||window;var k=f.document;a=a||f.event;if(a.$extended){return a}this.$extended=true;var j=a.type;var g=a.target||a.srcElement;while(g&&g.nodeType==3){g=g.parentNode}if(j.test(/key/)){var b=a.which||a.keyCode;var m=Event.Keys.keyOf(b);if(j=="keydown"){var d=b-111;if(d>0&&d<13){m="f"+d}}m=m||String.fromCharCode(b).toLowerCase()}else{if(j.match(/(click|mouse|menu)/i)){k=(!k.compatMode||k.compatMode=="CSS1Compat")?k.html:k.body;var i={x:a.pageX||a.clientX+k.scrollLeft,y:a.pageY||a.clientY+k.scrollTop};var c={x:(a.pageX)?a.pageX-f.pageXOffset:a.clientX,y:(a.pageY)?a.pageY-f.pageYOffset:a.clientY};if(j.match(/DOMMouseScroll|mousewheel/)){var h=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3}var e=(a.which==3)||(a.button==2);var l=null;if(j.match(/over|out/)){switch(j){case"mouseover":l=a.relatedTarget||a.fromElement;break;case"mouseout":l=a.relatedTarget||a.toElement}if(!(function(){while(l&&l.nodeType==3){l=l.parentNode}return true}).create({attempt:Browser.Engine.gecko})()){l=false}}}}return $extend(this,{event:a,type:j,page:i,client:c,rightClick:e,wheel:h,relatedTarget:l,target:g,code:b,key:m,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey})}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault()},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation()}else{this.event.cancelBubble=true}return this},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault()}else{this.event.returnValue=false}return this}});function Class(b){if(b instanceof Function){b={initialize:b}}var a=function(){Object.reset(this);if(a._prototyping){return this}this._current=$empty;var c=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._current;delete this.caller;return c}.extend(this);a.implement(b);a.constructor=Class;a.prototype.constructor=a;return a}Function.prototype.protect=function(){this._protected=true;return this};Object.reset=function(a,c){if(c==null){for(var e in a){Object.reset(a,e)}return a}delete a[c];switch($type(a[c])){case"object":var d=function(){};d.prototype=a[c];var b=new d;a[c]=Object.reset(b);break;case"array":a[c]=$unlink(a[c]);break}return a};new Native({name:"Class",initialize:Class}).extend({instantiate:function(b){b._prototyping=true;var a=new b;delete b._prototyping;return a},wrap:function(a,b,c){if(c._origin){c=c._origin}return function(){if(c._protected&&this._current==null){throw new Error('The method "'+b+'" cannot be called.')}var e=this.caller,f=this._current;this.caller=f;this._current=arguments.callee;var d=c.apply(this,arguments);this._current=f;this.caller=e;return d}.extend({_owner:a,_origin:c,_name:b})}});Class.implement({implement:function(a,d){if($type(a)=="object"){for(var e in a){this.implement(e,a[e])}return this}var f=Class.Mutators[a];if(f){d=f.call(this,d);if(d==null){return this}}var c=this.prototype;switch($type(d)){case"function":if(d._hidden){return this}c[a]=Class.wrap(this,a,d);break;case"object":var b=c[a];if($type(b)=="object"){$mixin(b,d)}else{c[a]=$unlink(d)}break;case"array":c[a]=$unlink(d);break;default:c[a]=d}return this}});Class.Mutators={Extends:function(a){this.parent=a;this.prototype=Class.instantiate(a);this.implement("parent",function(){var b=this.caller._name,c=this.caller._owner.parent.prototype[b];if(!c){throw new Error('The method "'+b+'" has no parent.')}return c.apply(this,arguments)}.protect())},Implements:function(a){$splat(a).each(function(b){if(b instanceof Function){b=Class.instantiate(b)}this.implement(b)},this)}};var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false},clearChain:function(){this.$chain.empty();return this}});var Events=new Class({$events:{},addEvent:function(c,b,a){c=Events.removeOn(c);if(b!=$empty){this.$events[c]=this.$events[c]||[];this.$events[c].include(b);if(a){b.internal=true}}return this},addEvents:function(a){for(var b in a){this.addEvent(b,a[b])}return this},fireEvent:function(c,b,a){c=Events.removeOn(c);if(!this.$events||!this.$events[c]){return this}this.$events[c].each(function(d){d.create({bind:this,delay:a,"arguments":b})()},this);return this},removeEvent:function(b,a){b=Events.removeOn(b);if(!this.$events[b]){return this}if(!a.internal){this.$events[b].erase(a)}return this},removeEvents:function(c){var d;if($type(c)=="object"){for(d in c){this.removeEvent(d,c[d])}return this}if(c){c=Events.removeOn(c)}for(d in this.$events){if(c&&c!=d){continue}var b=this.$events[d];for(var a=b.length;a--;a){this.removeEvent(d,b[a])}}return this}});Events.removeOn=function(a){return a.replace(/^on([A-Z])/,function(b,c){return c.toLowerCase()})};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments));if(!this.addEvent){return this}for(var a in this.options){if($type(this.options[a])!="function"||!(/^on[A-Z]/).test(a)){continue}this.addEvent(a,this.options[a]);delete this.options[a]}return this}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(a,b){var c=Element.Constructors.get(a);if(c){return c(b)}if(typeof a=="string"){return document.newElement(a,b)}return document.id(a).set(b)},afterImplement:function(a,b){Element.Prototype[a]=b;if(Array[a]){return}Elements.implement(a,function(){var c=[],g=true;for(var e=0,d=this.length;e<d;e++){var f=this[e][a].apply(this[e],arguments);c.push(f);if(g){g=($type(f)=="element")}}return(g)?new Elements(c):c})}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var f=Array.link(arguments,{properties:Object.type,iframe:$defined});var d=f.properties||{};var c=document.id(f.iframe);var e=d.onload||$empty;delete d.onload;d.id=d.name=$pick(d.id,d.name,c?(c.id||c.name):"IFrame_"+$time());c=new Element(c||"iframe",d);var b=function(){var g=$try(function(){return c.contentWindow.location.host});if(!g||g==window.location.host){var h=new Window(c.contentWindow);new Document(c.contentWindow.document);$extend(h.Element.prototype,Element.Prototype)}e.call(c.contentWindow,c.contentWindow.document)};var a=$try(function(){return c.contentWindow});((a&&a.document.body)||window.frames[d.id])?b():c.addListener("load",b);return c}});var Elements=new Native({initialize:function(f,b){b=$extend({ddup:true,cash:true},b);f=f||[];if(b.ddup||b.cash){var g={},e=[];for(var c=0,a=f.length;c<a;c++){var d=document.id(f[c],!b.cash);if(b.ddup){if(g[d.uid]){continue}g[d.uid]=true}if(d){e.push(d)}}f=e}return(b.cash)?$extend(f,this):f}});Elements.implement({filter:function(a,b){if(!a){return this}return new Elements(Array.filter(this,(typeof a=="string")?function(c){return c.match(a)}:a,b))}});Document.implement({newElement:function(a,b){if(Browser.Engine.trident&&b){["name","type","checked"].each(function(c){if(!b[c]){return}a+=" "+c+'="'+b[c]+'"';if(c!="checked"){delete b[c]}});a="<"+a+">"}return document.id(this.createElement(a)).set(b)},newTextNode:function(a){return this.createTextNode(a)},getDocument:function(){return this},getWindow:function(){return this.window},id:(function(){var a={string:function(d,c,b){d=b.getElementById(d);return(d)?a.element(d,c):null},element:function(b,e){$uid(b);if(!e&&!b.$family&&!(/^object|embed$/i).test(b.tagName)){var c=Element.Prototype;for(var d in c){b[d]=c[d]}}return b},object:function(c,d,b){if(c.toElement){return a.element(c.toElement(b),d)}return null}};a.textnode=a.whitespace=a.window=a.document=$arguments(0);return function(c,e,d){if(c&&c.$family&&c.uid){return c}var b=$type(c);return(a[b])?a[b](c,e,d||document):null}})()});if(window.$==null){Window.implement({$:function(a,b){return document.id(a,b,this.document)}})}Window.implement({$$:function(a){if(arguments.length==1&&typeof a=="string"){return this.document.getElements(a)}var f=[];var c=Array.flatten(arguments);for(var d=0,b=c.length;d<b;d++){var e=c[d];switch($type(e)){case"element":f.push(e);break;case"string":f.extend(this.document.getElements(e,true))}}return new Elements(f)},getDocument:function(){return this.document},getWindow:function(){return this}});Native.implement([Element,Document],{getElement:function(a,b){return document.id(this.getElements(a,true)[0]||null,b)},getElements:function(a,d){a=a.split(",");var c=[];var b=(a.length>1);a.each(function(e){var f=this.getElementsByTagName(e.trim());(b)?c.extend(f):c=f},this);return new Elements(c,{ddup:b,cash:!d})}});(function(){var h={},f={};var i={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"};var c=function(l){return(f[l]||(f[l]={}))};var g=function(n,l){if(!n){return}var m=n.uid;if(Browser.Engine.trident){if(n.clearAttributes){var q=l&&n.cloneNode(false);n.clearAttributes();if(q){n.mergeAttributes(q)}}else{if(n.removeEvents){n.removeEvents()}}if((/object/i).test(n.tagName)){for(var o in n){if(typeof n[o]=="function"){n[o]=$empty}}Element.dispose(n)}}if(!m){return}h[m]=f[m]=null};var d=function(){Hash.each(h,g);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(g)}if(window.CollectGarbage){CollectGarbage()}h=f=null};var j=function(n,l,s,m,p,r){var o=n[s||l];var q=[];while(o){if(o.nodeType==1&&(!m||Element.match(o,m))){if(!p){return document.id(o,r)}q.push(o)}o=o[l]}return(p)?new Elements(q,{ddup:false,cash:!r}):null};var e={html:"innerHTML","class":"className","for":"htmlFor",defaultValue:"defaultValue",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"};var b=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var k=["value","type","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"];b=b.associate(b);Hash.extend(e,b);Hash.extend(e,k.associate(k.map(String.toLowerCase)));var a={before:function(m,l){if(l.parentNode){l.parentNode.insertBefore(m,l)}},after:function(m,l){if(!l.parentNode){return}var n=l.nextSibling;(n)?l.parentNode.insertBefore(m,n):l.parentNode.appendChild(m)},bottom:function(m,l){l.appendChild(m)},top:function(m,l){var n=l.firstChild;(n)?l.insertBefore(m,n):l.appendChild(m)}};a.inside=a.bottom;Hash.each(a,function(l,m){m=m.capitalize();Element.implement("inject"+m,function(n){l(this,document.id(n,true));return this});Element.implement("grab"+m,function(n){l(document.id(n,true),this);return this})});Element.implement({set:function(o,m){switch($type(o)){case"object":for(var n in o){this.set(n,o[n])}break;case"string":var l=Element.Properties.get(o);(l&&l.set)?l.set.apply(this,Array.slice(arguments,1)):this.setProperty(o,m)}return this},get:function(m){var l=Element.Properties.get(m);return(l&&l.get)?l.get.apply(this,Array.slice(arguments,1)):this.getProperty(m)},erase:function(m){var l=Element.Properties.get(m);(l&&l.erase)?l.erase.apply(this):this.removeProperty(m);return this},setProperty:function(m,n){var l=e[m];if(n==undefined){return this.removeProperty(m)}if(l&&b[m]){n=!!n}(l)?this[l]=n:this.setAttribute(m,""+n);return this},setProperties:function(l){for(var m in l){this.setProperty(m,l[m])}return this},getProperty:function(m){var l=e[m];var n=(l)?this[l]:this.getAttribute(m,2);return(b[m])?!!n:(l)?n:n||null},getProperties:function(){var l=$A(arguments);return l.map(this.getProperty,this).associate(l)},removeProperty:function(m){var l=e[m];(l)?this[l]=(l&&b[m])?false:"":this.removeAttribute(m);return this},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this},hasClass:function(l){return this.className.contains(l," ")},addClass:function(l){if(!this.hasClass(l)){this.className=(this.className+" "+l).clean()}return this},removeClass:function(l){this.className=this.className.replace(new RegExp("(^|\\s)"+l+"(?:\\s|$)"),"$1");return this},toggleClass:function(l){return this.hasClass(l)?this.removeClass(l):this.addClass(l)},adopt:function(){Array.flatten(arguments).each(function(l){l=document.id(l,true);if(l){this.appendChild(l)}},this);return this},appendText:function(m,l){return this.grab(this.getDocument().newTextNode(m),l)},grab:function(m,l){a[l||"bottom"](document.id(m,true),this);return this},inject:function(m,l){a[l||"bottom"](this,document.id(m,true));return this},replaces:function(l){l=document.id(l,true);l.parentNode.replaceChild(this,l);return this},wraps:function(m,l){m=document.id(m,true);return this.replaces(m).grab(m,l)},getPrevious:function(l,m){return j(this,"previousSibling",null,l,false,m)},getAllPrevious:function(l,m){return j(this,"previousSibling",null,l,true,m)},getNext:function(l,m){return j(this,"nextSibling",null,l,false,m)},getAllNext:function(l,m){return j(this,"nextSibling",null,l,true,m)},getFirst:function(l,m){return j(this,"nextSibling","firstChild",l,false,m)},getLast:function(l,m){return j(this,"previousSibling","lastChild",l,false,m)},getParent:function(l,m){return j(this,"parentNode",null,l,false,m)},getParents:function(l,m){return j(this,"parentNode",null,l,true,m)},getSiblings:function(l,m){return this.getParent().getChildren(l,m).erase(this)},getChildren:function(l,m){return j(this,"nextSibling","firstChild",l,true,m)},getWindow:function(){return this.ownerDocument.window},getDocument:function(){return this.ownerDocument},getElementById:function(o,n){var m=this.ownerDocument.getElementById(o);if(!m){return null}for(var l=m.parentNode;l!=this;l=l.parentNode){if(!l){return null}}return document.id(m,n)},getSelected:function(){return new Elements($A(this.options).filter(function(l){return l.selected}))},getComputedStyle:function(m){if(this.currentStyle){return this.currentStyle[m.camelCase()]}var l=this.getDocument().defaultView.getComputedStyle(this,null);return(l)?l.getPropertyValue([m.hyphenate()]):null},toQueryString:function(){var l=[];this.getElements("input, select, textarea",true).each(function(m){if(!m.name||m.disabled||m.type=="submit"||m.type=="reset"||m.type=="file"){return}var n=(m.tagName.toLowerCase()=="select")?Element.getSelected(m).map(function(o){return o.value}):((m.type=="radio"||m.type=="checkbox")&&!m.checked)?null:m.value;$splat(n).each(function(o){if(typeof o!="undefined"){l.push(m.name+"="+encodeURIComponent(o))}})});return l.join("&")},clone:function(o,l){o=o!==false;var r=this.cloneNode(o);var n=function(v,u){if(!l){v.removeAttribute("id")}if(Browser.Engine.trident){v.clearAttributes();v.mergeAttributes(u);v.removeAttribute("uid");if(v.options){var w=v.options,s=u.options;for(var t=w.length;t--;){w[t].selected=s[t].selected}}}var x=i[u.tagName.toLowerCase()];if(x&&u[x]){v[x]=u[x]}};if(o){var p=r.getElementsByTagName("*"),q=this.getElementsByTagName("*");for(var m=p.length;m--;){n(p[m],q[m])}}n(r,this);return document.id(r)},destroy:function(){Element.empty(this);Element.dispose(this);g(this,true);return null},empty:function(){$A(this.childNodes).each(function(l){Element.destroy(l)});return this},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this},hasChild:function(l){l=document.id(l,true);if(!l){return false}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(l.tagName)).contains(l)}return(this.contains)?(this!=l&&this.contains(l)):!!(this.compareDocumentPosition(l)&16)},match:function(l){return(!l||(l==this)||(Element.get(this,"tag")==l))}});Native.implement([Element,Window,Document],{addListener:function(o,n){if(o=="unload"){var l=n,m=this;n=function(){m.removeListener("unload",n);l()}}else{h[this.uid]=this}if(this.addEventListener){this.addEventListener(o,n,false)}else{this.attachEvent("on"+o,n)}return this},removeListener:function(m,l){if(this.removeEventListener){this.removeEventListener(m,l,false)}else{this.detachEvent("on"+m,l)}return this},retrieve:function(m,l){var o=c(this.uid),n=o[m];if(l!=undefined&&n==undefined){n=o[m]=l}return $pick(n)},store:function(m,l){var n=c(this.uid);n[m]=l;return this},eliminate:function(l){var m=c(this.uid);delete m[l];return this}});window.addListener("unload",d)})();Element.Properties=new Hash;Element.Properties.style={set:function(a){this.style.cssText=a},get:function(){return this.style.cssText},erase:function(){this.style.cssText=""}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase()}};Element.Properties.html=(function(){var c=document.createElement("div");var a={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]};a.thead=a.tfoot=a.tbody;var b={set:function(){var e=Array.flatten(arguments).join("");var f=Browser.Engine.trident&&a[this.get("tag")];if(f){var g=c;g.innerHTML=f[1]+e+f[2];for(var d=f[0];d--;){g=g.firstChild}this.empty().adopt(g.childNodes)}else{this.innerHTML=e}}};b.erase=b.set;return b})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText}var a=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var b=a.innerText;a.destroy();return b}}}Element.Properties.events={set:function(a){this.addEvents(a)}};Native.implement([Element,Window,Document],{addEvent:function(e,g){var h=this.retrieve("events",{});h[e]=h[e]||{keys:[],values:[]};if(h[e].keys.contains(g)){return this}h[e].keys.push(g);var f=e,a=Element.Events.get(e),c=g,i=this;if(a){if(a.onAdd){a.onAdd.call(this,g)}if(a.condition){c=function(j){if(a.condition.call(this,j)){return g.call(this,j)}return true}}f=a.base||f}var d=function(){return g.call(i)};var b=Element.NativeEvents[f];if(b){if(b==2){d=function(j){j=new Event(j,i.getWindow());if(c.call(i,j)===false){j.stop()}}}this.addListener(f,d)}h[e].values.push(d);return this},removeEvent:function(c,b){var a=this.retrieve("events");if(!a||!a[c]){return this}var f=a[c].keys.indexOf(b);if(f==-1){return this}a[c].keys.splice(f,1);var e=a[c].values.splice(f,1)[0];var d=Element.Events.get(c);if(d){if(d.onRemove){d.onRemove.call(this,b)}c=d.base||c}return(Element.NativeEvents[c])?this.removeListener(c,e):this},addEvents:function(a){for(var b in a){this.addEvent(b,a[b])}return this},removeEvents:function(a){var c;if($type(a)=="object"){for(c in a){this.removeEvent(c,a[c])}return this}var b=this.retrieve("events");if(!b){return this}if(!a){for(c in b){this.removeEvents(c)}this.eliminate("events")}else{if(b[a]){while(b[a].keys[0]){this.removeEvent(a,b[a].keys[0])}b[a]=null}}return this},fireEvent:function(d,b,a){var c=this.retrieve("events");if(!c||!c[d]){return this}c[d].keys.each(function(e){e.create({bind:this,delay:a,"arguments":b})()},this);return this},cloneEvents:function(d,a){d=document.id(d);var c=d.retrieve("events");if(!c){return this}if(!a){for(var b in c){this.cloneEvents(d,b)}}else{if(c[a]){c[a].keys.each(function(e){this.addEvent(a,e)},this)}}return this}});Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};(function(){var a=function(b){var c=b.relatedTarget;if(c==undefined){return true}if(c===false){return false}return($type(this)!="document"&&c!=this&&c.prefix!="xul"&&!this.hasChild(c))};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}})})();Element.Properties.styles={set:function(a){this.setStyles(a)}};Element.Properties.opacity={set:function(a,b){if(!b){if(a==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden"}}else{if(this.style.visibility!="visible"){this.style.visibility="visible"}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1}if(Browser.Engine.trident){this.style.filter=(a==1)?"":"alpha(opacity="+a*100+")"}this.style.opacity=a;this.store("opacity",a)},get:function(){return this.retrieve("opacity",1)}};Element.implement({setOpacity:function(a){return this.set("opacity",a,true)},getOpacity:function(){return this.get("opacity")},setStyle:function(b,a){switch(b){case"opacity":return this.set("opacity",parseFloat(a));case"float":b=(Browser.Engine.trident)?"styleFloat":"cssFloat"}b=b.camelCase();if($type(a)!="string"){var c=(Element.Styles.get(b)||"@").split(" ");a=$splat(a).map(function(e,d){if(!c[d]){return""}return($type(e)=="number")?c[d].replace("@",Math.round(e)):e}).join(" ")}else{if(a==String(Number(a))){a=Math.round(a)}}this.style[b]=a;return this},getStyle:function(g){switch(g){case"opacity":return this.get("opacity");case"float":g=(Browser.Engine.trident)?"styleFloat":"cssFloat"}g=g.camelCase();var a=this.style[g];if(!$chk(a)){a=[];for(var f in Element.ShortStyles){if(g!=f){continue}for(var e in Element.ShortStyles[f]){a.push(this.getStyle(e))}return a.join(" ")}a=this.getComputedStyle(g)}if(a){a=String(a);var c=a.match(/rgba?\([\d\s,]+\)/);if(c){a=a.replace(c[0],c[0].rgbToHex())}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(a,10)))){if(g.test(/^(height|width)$/)){var b=(g=="width")?["left","right"]:["top","bottom"],d=0;b.each(function(h){d+=this.getStyle("border-"+h+"-width").toInt()+this.getStyle("padding-"+h).toInt()},this);return this["offset"+g.capitalize()]-d+"px"}if((Browser.Engine.presto)&&String(a).test("px")){return a}if(g.test(/(border(.+)Width|margin|padding)/)){return"0px"}}return a},setStyles:function(b){for(var a in b){this.setStyle(a,b[a])}return this},getStyles:function(){var a={};Array.flatten(arguments).each(function(b){a[b]=this.getStyle(b)},this);return a}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"});Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(g){var f=Element.ShortStyles;var b=Element.Styles;["margin","padding"].each(function(h){var i=h+g;f[h][i]=b[i]="@px"});var e="border"+g;f.border[e]=b[e]="@px @ rgb(@, @, @)";var d=e+"Width",a=e+"Style",c=e+"Color";f[e]={};f.borderWidth[d]=f[e][d]=b[d]="@px";f.borderStyle[a]=f[e][a]=b[a]="@";f.borderColor[c]=f[e][c]=b[c]="rgb(@, @, @)"});(function(){Element.implement({scrollTo:function(h,i){if(b(this)){this.getWindow().scrollTo(h,i)}else{this.scrollLeft=h;this.scrollTop=i}return this},getSize:function(){if(b(this)){return this.getWindow().getSize()}return{x:this.offsetWidth,y:this.offsetHeight}},getScrollSize:function(){if(b(this)){return this.getWindow().getScrollSize()}return{x:this.scrollWidth,y:this.scrollHeight}},getScroll:function(){if(b(this)){return this.getWindow().getScroll()}return{x:this.scrollLeft,y:this.scrollTop}},getScrolls:function(){var i=this,h={x:0,y:0};while(i&&!b(i)){h.x+=i.scrollLeft;h.y+=i.scrollTop;i=i.parentNode}return h},getOffsetParent:function(){var h=this;if(b(h)){return null}if(!Browser.Engine.trident){return h.offsetParent}while((h=h.parentNode)&&!b(h)){if(d(h,"position")!="static"){return h}}return null},getOffsets:function(){if(this.getBoundingClientRect){var j=this.getBoundingClientRect(),m=document.id(this.getDocument().documentElement),p=m.getScroll(),k=this.getScrolls(),i=this.getScroll(),h=(d(this,"position")=="fixed");return{x:j.left.toInt()+k.x-i.x+((h)?0:p.x)-m.clientLeft,y:j.top.toInt()+k.y-i.y+((h)?0:p.y)-m.clientTop}}var l=this,n={x:0,y:0};if(b(this)){return n}while(l&&!b(l)){n.x+=l.offsetLeft;n.y+=l.offsetTop;if(Browser.Engine.gecko){if(!f(l)){n.x+=c(l);n.y+=g(l)}var o=l.parentNode;if(o&&d(o,"overflow")!="visible"){n.x+=c(o);n.y+=g(o)}}else{if(l!=this&&Browser.Engine.webkit){n.x+=c(l);n.y+=g(l)}}l=l.offsetParent}if(Browser.Engine.gecko&&!f(this)){n.x-=c(this);n.y-=g(this)}return n},getPosition:function(k){if(b(this)){return{x:0,y:0}}var l=this.getOffsets(),i=this.getScrolls();var h={x:l.x-i.x,y:l.y-i.y};var j=(k&&(k=document.id(k)))?k.getPosition():{x:0,y:0};return{x:h.x-j.x,y:h.y-j.y}},getCoordinates:function(j){if(b(this)){return this.getWindow().getCoordinates()}var h=this.getPosition(j),i=this.getSize();var k={left:h.x,top:h.y,width:i.x,height:i.y};k.right=k.left+k.width;k.bottom=k.top+k.height;return k},computePosition:function(h){return{left:h.x-e(this,"margin-left"),top:h.y-e(this,"margin-top")}},setPosition:function(h){return this.setStyles(this.computePosition(h))}});Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var i=this.getWindow();return{x:i.innerWidth,y:i.innerHeight}}var h=a(this);return{x:h.clientWidth,y:h.clientHeight}},getScroll:function(){var i=this.getWindow(),h=a(this);return{x:i.pageXOffset||h.scrollLeft,y:i.pageYOffset||h.scrollTop}},getScrollSize:function(){var i=a(this),h=this.getSize();return{x:Math.max(i.scrollWidth,h.x),y:Math.max(i.scrollHeight,h.y)}},getPosition:function(){return{x:0,y:0}},getCoordinates:function(){var h=this.getSize();return{top:0,left:0,bottom:h.y,right:h.x,height:h.y,width:h.x}}});var d=Element.getComputedStyle;function e(h,i){return d(h,i).toInt()||0}function f(h){return d(h,"-moz-box-sizing")=="border-box"}function g(h){return e(h,"border-top-width")}function c(h){return e(h,"border-left-width")}function b(h){return(/^(?:body|html)$/i).test(h.tagName)}function a(h){var i=h.getDocument();return(!i.compatMode||i.compatMode=="CSS1Compat")?i.html:i.body}})();Element.alias("setPosition","position");Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y},getWidth:function(){return this.getSize().x},getScrollTop:function(){return this.getScroll().y},getScrollLeft:function(){return this.getScroll().x},getScrollHeight:function(){return this.getScrollSize().y},getScrollWidth:function(){return this.getScrollSize().x},getTop:function(){return this.getPosition().y},getLeft:function(){return this.getPosition().x}});Native.implement([Document,Element],{getElements:function(h,g){h=h.split(",");var c,e={};for(var d=0,b=h.length;d<b;d++){var a=h[d],f=Selectors.Utils.search(this,a,e);if(d!=0&&f.item){f=$A(f)}c=(d==0)?f:(c.item)?$A(c).concat(f):c.concat(f)}return new Elements(c,{ddup:(h.length>1),cash:!g})}});Element.implement({match:function(b){if(!b||(b==this)){return true}var d=Selectors.Utils.parseTagAndID(b);var a=d[0],e=d[1];if(!Selectors.Filters.byID(this,e)||!Selectors.Filters.byTag(this,a)){return false}var c=Selectors.Utils.parseSelector(b);return(c)?Selectors.Utils.filter(this,c,{}):true}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)};Selectors.Utils={chk:function(b,c){if(!c){return true}var a=$uid(b);if(!c[a]){return c[a]=true}return false},parseNthArgument:function(h){if(Selectors.Cache.nth[h]){return Selectors.Cache.nth[h]}var e=h.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!e){return false}var g=parseInt(e[1],10);var d=(g||g===0)?g:1;var f=e[2]||false;var c=parseInt(e[3],10)||0;if(d!=0){c--;while(c<1){c+=d}while(c>=d){c-=d}}else{d=c;f="index"}switch(f){case"n":e={a:d,b:c,special:"n"};break;case"odd":e={a:2,b:0,special:"n"};break;case"even":e={a:2,b:1,special:"n"};break;case"first":e={a:0,special:"index"};break;case"last":e={special:"last-child"};break;case"only":e={special:"only-child"};break;default:e={a:(d-1),special:"index"}}return Selectors.Cache.nth[h]=e},parseSelector:function(e){if(Selectors.Cache.parsed[e]){return Selectors.Cache.parsed[e]}var d,h={classes:[],pseudos:[],attributes:[]};while((d=Selectors.RegExps.combined.exec(e))){var i=d[1],g=d[2],f=d[3],b=d[5],c=d[6],j=d[7];if(i){h.classes.push(i)}else{if(c){var a=Selectors.Pseudo.get(c);if(a){h.pseudos.push({parser:a,argument:j})}else{h.attributes.push({name:c,operator:"=",value:j})}}else{if(g){h.attributes.push({name:g,operator:f,value:b})}}}}if(!h.classes.length){delete h.classes}if(!h.attributes.length){delete h.attributes}if(!h.pseudos.length){delete h.pseudos}if(!h.classes&&!h.attributes&&!h.pseudos){h=null}return Selectors.Cache.parsed[e]=h},parseTagAndID:function(b){var a=b.match(Selectors.RegExps.tag);var c=b.match(Selectors.RegExps.id);return[(a)?a[1]:"*",(c)?c[1]:false]},filter:function(f,c,e){var d;if(c.classes){for(d=c.classes.length;d--;d){var g=c.classes[d];if(!Selectors.Filters.byClass(f,g)){return false}}}if(c.attributes){for(d=c.attributes.length;d--;d){var b=c.attributes[d];if(!Selectors.Filters.byAttribute(f,b.name,b.operator,b.value)){return false}}}if(c.pseudos){for(d=c.pseudos.length;d--;d){var a=c.pseudos[d];if(!Selectors.Filters.byPseudo(f,a.parser,a.argument,e)){return false}}}return true},getByTagAndID:function(b,a,d){if(d){var c=(b.getElementById)?b.getElementById(d,true):Element.getElementById(b,d,true);return(c&&Selectors.Filters.byTag(c,a))?[c]:[]}else{return b.getElementsByTagName(a)}},search:function(o,h,t){var b=[];var c=h.trim().replace(Selectors.RegExps.splitter,function(k,j,i){b.push(j);return":)"+i}).split(":)");var p,e,A;for(var z=0,v=c.length;z<v;z++){var y=c[z];if(z==0&&Selectors.RegExps.quick.test(y)){p=o.getElementsByTagName(y);continue}var a=b[z-1];var q=Selectors.Utils.parseTagAndID(y);var B=q[0],r=q[1];if(z==0){p=Selectors.Utils.getByTagAndID(o,B,r)}else{var d={},g=[];for(var x=0,w=p.length;x<w;x++){g=Selectors.Getters[a](g,p[x],B,r,d)}p=g}var f=Selectors.Utils.parseSelector(y);if(f){e=[];for(var u=0,s=p.length;u<s;u++){A=p[u];if(Selectors.Utils.filter(A,f,t)){e.push(A)}}p=e}}return p}};Selectors.Getters={" ":function(h,g,j,a,e){var d=Selectors.Utils.getByTagAndID(g,j,a);for(var c=0,b=d.length;c<b;c++){var f=d[c];if(Selectors.Utils.chk(f,e)){h.push(f)}}return h},">":function(h,g,j,a,f){var c=Selectors.Utils.getByTagAndID(g,j,a);for(var e=0,d=c.length;e<d;e++){var b=c[e];if(b.parentNode==g&&Selectors.Utils.chk(b,f)){h.push(b)}}return h},"+":function(c,b,a,e,d){while((b=b.nextSibling)){if(b.nodeType==1){if(Selectors.Utils.chk(b,d)&&Selectors.Filters.byTag(b,a)&&Selectors.Filters.byID(b,e)){c.push(b)}break}}return c},"~":function(c,b,a,e,d){while((b=b.nextSibling)){if(b.nodeType==1){if(!Selectors.Utils.chk(b,d)){break}if(Selectors.Filters.byTag(b,a)&&Selectors.Filters.byID(b,e)){c.push(b)}}}return c}};Selectors.Filters={byTag:function(b,a){return(a=="*"||(b.tagName&&b.tagName.toLowerCase()==a))},byID:function(a,b){return(!b||(a.id&&a.id==b))},byClass:function(b,a){return(b.className&&b.className.contains&&b.className.contains(a," "))},byPseudo:function(a,d,c,b){return d.call(a,c,b)},byAttribute:function(c,d,b,e){var a=Element.prototype.getProperty.call(c,d);if(!a){return(b=="!=")}if(!b||e==undefined){return true}switch(b){case"=":return(a==e);case"*=":return(a.contains(e));case"^=":return(a.substr(0,e.length)==e);case"$=":return(a.substr(a.length-e.length)==e);case"!=":return(a!=e);case"~=":return a.contains(e," ");case"|=":return a.contains(e,"-")}return false}};Selectors.Pseudo=new Hash({checked:function(){return this.checked},empty:function(){return !(this.innerText||this.textContent||"").length},not:function(a){return !Element.match(this,a)},contains:function(a){return(this.innerText||this.textContent||"").contains(a)},"first-child":function(){return Selectors.Pseudo.index.call(this,0)},"last-child":function(){var a=this;while((a=a.nextSibling)){if(a.nodeType==1){return false}}return true},"only-child":function(){var b=this;while((b=b.previousSibling)){if(b.nodeType==1){return false}}var a=this;while((a=a.nextSibling)){if(a.nodeType==1){return false}}return true},"nth-child":function(g,e){g=(g==undefined)?"n":g;var c=Selectors.Utils.parseNthArgument(g);if(c.special!="n"){return Selectors.Pseudo[c.special].call(this,c.a,e)}var f=0;e.positions=e.positions||{};var d=$uid(this);if(!e.positions[d]){var b=this;while((b=b.previousSibling)){if(b.nodeType!=1){continue}f++;var a=e.positions[$uid(b)];if(a!=undefined){f=a+f;break}}e.positions[d]=f}return(e.positions[d]%c.a==c.b)},index:function(a){var b=this,c=0;while((b=b.previousSibling)){if(b.nodeType==1&&++c>a){return false}}return(c==a)},even:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n+1",a)},odd:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n",a)},selected:function(){return this.selected},enabled:function(){return(this.disabled===false)}});Element.Events.domready={onAdd:function(a){if(Browser.loaded){a.call(this)}}};(function(){var b=function(){if(Browser.loaded){return}Browser.loaded=true;window.fireEvent("domready");document.fireEvent("domready")};window.addEvent("load",b);if(Browser.Engine.trident){var a=document.createElement("div");(function(){($try(function(){a.doScroll();return document.id(a).inject(document.body).set("html","temp").dispose()}))?b():arguments.callee.delay(50)})()}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?b():arguments.callee.delay(50)})()}else{document.addEvent("DOMContentLoaded",b)}}})();var JSON=new Hash(this.JSON&&{stringify:JSON.stringify,parse:JSON.parse}).extend({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(a){return JSON.$specialChars[a]||"\\u00"+Math.floor(a.charCodeAt()/16).toString(16)+(a.charCodeAt()%16).toString(16)},encode:function(b){switch($type(b)){case"string":return'"'+b.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(b.map(JSON.encode).clean())+"]";case"object":case"hash":var a=[];Hash.each(b,function(e,d){var c=JSON.encode(e);if(c){a.push(JSON.encode(d)+":"+c)}});return"{"+a+"}";case"number":case"boolean":return String(b);case false:return"null"}return null},decode:function(string,secure){if($type(string)!="string"||!string.length){return null}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null}return eval("("+string+")")}});Native.implement([Hash,Array,String,Number],{toJSON:function(){return JSON.encode(this)}});var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize:function(b,a){this.key=b;this.setOptions(a)},write:function(b){b=encodeURIComponent(b);if(this.options.domain){b+="; domain="+this.options.domain}if(this.options.path){b+="; path="+this.options.path}if(this.options.duration){var a=new Date();a.setTime(a.getTime()+this.options.duration*24*60*60*1000);b+="; expires="+a.toGMTString()}if(this.options.secure){b+="; secure"}this.options.document.cookie=this.key+"="+b;return this},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");return(a)?decodeURIComponent(a[1]):null},dispose:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write("");return this}});Cookie.write=function(b,c,a){return new Cookie(b,a).write(c)};Cookie.read=function(a){return new Cookie(a).read()};Cookie.dispose=function(b,a){return new Cookie(b,a).dispose()};var Swiff=new Class({Implements:[Options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"transparent",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object},initialize:function(l,m){this.instance="Swiff_"+$time();this.setOptions(m);m=this.options;var b=this.id=m.id||this.instance;var a=document.id(m.container);Swiff.CallBacks[this.instance]={};var e=m.params,g=m.vars,f=m.callBacks;var h=$extend({height:m.height,width:m.width},m.properties);var k=this;for(var d in f){Swiff.CallBacks[this.instance][d]=(function(n){return function(){return n.apply(k.object,arguments)}})(f[d]);g[d]="Swiff.CallBacks."+this.instance+"."+d}e.flashVars=Hash.toQueryString(g);if(Browser.Engine.trident){h.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";e.movie=l}else{h.type="application/x-shockwave-flash";h.data=l}var j='<object id="'+b+'"';for(var i in h){j+=" "+i+'="'+h[i]+'"'}j+=">";for(var c in e){if(e[c]){j+='<param name="'+c+'" value="'+e[c]+'" />'}}j+="</object>";this.object=((a)?a.empty():new Element("div")).set("html",j).firstChild},replaces:function(a){a=document.id(a,true);a.parentNode.replaceChild(this.toElement(),a);return this},inject:function(a){document.id(a,true).appendChild(this.toElement());return this},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].extend(arguments))}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction('<invoke name="'+fn+'" returntype="javascript">'+__flash__argumentsToXML(arguments,2)+"</invoke>");return eval(rs)};var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(a){this.subject=this.subject||this;this.setOptions(a);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var b=this.options.wait;if(b===false){this.options.link="cancel"}},getTransition:function(){return function(a){return -(Math.cos(Math.PI*a)-1)/2}},step:function(){var a=$time();if(a<this.time+this.options.duration){var b=this.transition((a-this.time)/this.options.duration);this.set(this.compute(this.from,this.to,b))}else{this.set(this.compute(this.from,this.to,1));this.complete()}},set:function(a){return a},compute:function(c,b,a){return Fx.compute(c,b,a)},check:function(){if(!this.timer){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false}return false},start:function(b,a){if(!this.check(b,a)){return this}this.from=b;this.to=a;this.time=0;this.transition=this.getTransition();this.startTimer();this.onStart();return this},complete:function(){if(this.stopTimer()){this.onComplete()}return this},cancel:function(){if(this.stopTimer()){this.onCancel()}return this},onStart:function(){this.fireEvent("start",this.subject)},onComplete:function(){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject)}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain()},pause:function(){this.stopTimer();return this},resume:function(){this.startTimer();return this},stopTimer:function(){if(!this.timer){return false}this.time=$time()-this.time;this.timer=$clear(this.timer);return true},startTimer:function(){if(this.timer){return false}this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true}});Fx.compute=function(c,b,a){return(b-c)*a+c};Fx.Durations={"short":250,normal:500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(d,e,b){b=$splat(b);var c=b[1];if(!$chk(c)){b[1]=b[0];b[0]=d.getStyle(e)}var a=b.map(this.parse);return{from:a[0],to:a[1]}},parse:function(a){a=$lambda(a)();a=(typeof a=="string")?a.split(" "):$splat(a);return a.map(function(c){c=String(c);var b=false;Fx.CSS.Parsers.each(function(f,e){if(b){return}var d=f.parse(c);if($chk(d)){b={value:d,parser:f}}});b=b||{value:c,parser:Fx.CSS.Parsers.String};return b})},compute:function(d,c,b){var a=[];(Math.min(d.length,c.length)).times(function(e){a.push({value:d[e].parser.compute(d[e].value,c[e].value,b),parser:d[e].parser})});a.$family={name:"fx:css:value"};return a},serve:function(c,b){if($type(c)!="fx:css:value"){c=this.parse(c)}var a=[];c.each(function(d){a=a.concat(d.parser.serve(d.value,b))});return a},render:function(a,d,c,b){a.setStyle(d,this.serve(c,b))},search:function(a){if(Fx.CSS.Cache[a]){return Fx.CSS.Cache[a]}var b={};Array.each(document.styleSheets,function(e,d){var c=e.href;if(c&&c.contains("://")&&!c.contains(document.domain)){return}var f=e.rules||e.cssRules;Array.each(f,function(j,g){if(!j.style){return}var h=(j.selectorText)?j.selectorText.replace(/^\w+/,function(i){return i.toLowerCase()}):null;if(!h||!h.test("^"+a+"$")){return}Element.Styles.each(function(k,i){if(!j.style[i]||Element.ShortStyles[i]){return}k=String(j.style[i]);b[i]=(k.test(/^rgb/))?k.rgbToHex():k})})});return Fx.CSS.Cache[a]=b}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(a){if(a.match(/^#[0-9a-f]{3,6}$/i)){return a.hexToRgb(true)}return((a=a.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[a[1],a[2],a[3]]:false},compute:function(c,b,a){return c.map(function(e,d){return Math.round(Fx.compute(c[d],b[d],a))})},serve:function(a){return a.map(Number)}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(b,a){return(a)?b+a:b}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}});Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a)},set:function(b,a){if(arguments.length==1){a=b;b=this.property||this.options.property}this.render(this.element,b,a,this.options.unit);return this},start:function(c,e,d){if(!this.check(c,e,d)){return this}var b=Array.flatten(arguments);this.property=this.options.property||b.shift();var a=this.prepare(this.element,this.property,b);return this.parent(a.from,a.to)}});Element.Properties.tween={set:function(a){var b=this.retrieve("tween");if(b){b.cancel()}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},a))},get:function(a){if(a||!this.retrieve("tween")){if(a||!this.retrieve("tween:options")){this.set("tween",a)}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options")))}return this.retrieve("tween")}};Element.implement({tween:function(a,c,b){this.get("tween").start(arguments);return this},fade:function(c){var e=this.get("tween"),d="opacity",a;c=$pick(c,"toggle");switch(c){case"in":e.start(d,1);break;case"out":e.start(d,0);break;case"show":e.set(d,1);break;case"hide":e.set(d,0);break;case"toggle":var b=this.retrieve("fade:flag",this.get("opacity")==1);e.start(d,(b)?0:1);this.store("fade:flag",!b);a=true;break;default:e.start(d,arguments)}if(!a){this.eliminate("fade:flag")}return this},highlight:function(c,a){if(!a){a=this.retrieve("highlight:original",this.getStyle("background-color"));a=(a=="transparent")?"#fff":a}var b=this.get("tween");b.start("background-color",c||"#ffff88",a).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original"));b.callChain()}.bind(this));return this}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a)},set:function(a){if(typeof a=="string"){a=this.search(a)}for(var b in a){this.render(this.element,b,a[b],this.options.unit)}return this},compute:function(e,d,c){var a={};for(var b in e){a[b]=this.parent(e[b],d[b],c)}return a},start:function(b){if(!this.check(b)){return this}if(typeof b=="string"){b=this.search(b)}var e={},d={};for(var c in b){var a=this.prepare(this.element,c,b[c]);e[c]=a.from;d[c]=a.to}return this.parent(e,d)}});Element.Properties.morph={set:function(a){var b=this.retrieve("morph");if(b){b.cancel()}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},a))},get:function(a){if(a||!this.retrieve("morph")){if(a||!this.retrieve("morph:options")){this.set("morph",a)}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")))}return this.retrieve("morph")}};Element.implement({morph:function(a){this.get("morph").start(a);return this}});Fx.implement({getTransition:function(){var a=this.options.transition||Fx.Transitions.Sine.easeInOut;if(typeof a=="string"){var b=a.split(":");a=Fx.Transitions;a=a[b[0]]||a[b[0].capitalize()];if(b[1]){a=a["ease"+b[1].capitalize()+(b[2]?b[2].capitalize():"")]}}return a}});Fx.Transition=function(b,a){a=$splat(a);return $extend(b,{easeIn:function(c){return b(c,a)},easeOut:function(c){return 1-b(1-c,a)},easeInOut:function(c){return(c<=0.5)?b(2*c,a)/2:(2-b(2*(1-c),a))/2}})};Fx.Transitions=new Hash({linear:$arguments(0)});Fx.Transitions.extend=function(a){for(var b in a){Fx.Transitions[b]=new Fx.Transition(a[b])}};Fx.Transitions.extend({Pow:function(b,a){return Math.pow(b,a[0]||6)},Expo:function(a){return Math.pow(2,8*(a-1))},Circ:function(a){return 1-Math.sin(Math.acos(a))},Sine:function(a){return 1-Math.sin((1-a)*Math.PI/2)},Back:function(b,a){a=a[0]||1.618;return Math.pow(b,2)*((a+1)*b-a)},Bounce:function(f){var e;for(var d=0,c=1;1;d+=c,c/=2){if(f>=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2);break}}return e},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a[0]||1)/3)}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,[a+2])})});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,noCache:false},initialize:function(a){this.xhr=new Browser.Request();this.setOptions(a);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers)},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status}.bind(this));this.xhr.onreadystatechange=$empty;if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};this.success(this.response.text,this.response.xml)}else{this.response={text:null,xml:null};this.failure()}},isSuccess:function(){return((this.status>=200)&&(this.status<300))},processScripts:function(a){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(a)}return a.stripScripts(this.options.evalScripts)},success:function(b,a){this.onSuccess(this.processScripts(b),a)},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain()},failure:function(){this.onFailure()},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr)},setHeader:function(a,b){this.headers.set(a,b);return this},getHeader:function(a){return $try(function(){return this.xhr.getResponseHeader(a)}.bind(this))},check:function(){if(!this.running){return true}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false}return false},send:function(k){if(!this.check(k)){return this}this.running=true;var i=$type(k);if(i=="string"||i=="element"){k={data:k}}var d=this.options;k=$extend({data:d.data,url:d.url,method:d.method},k);var g=k.data,b=String(k.url),a=k.method.toLowerCase();switch($type(g)){case"element":g=document.id(g).toQueryString();break;case"object":case"hash":g=Hash.toQueryString(g)}if(this.options.format){var j="format="+this.options.format;g=(g)?j+"&"+g:j}if(this.options.emulation&&!["get","post"].contains(a)){var h="_method="+a;g=(g)?h+"&"+g:h;a="post"}if(this.options.urlEncoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers.set("Content-type","application/x-www-form-urlencoded"+c)}if(this.options.noCache){var f="noCache="+new Date().getTime();g=(g)?f+"&"+g:f}var e=b.lastIndexOf("/");if(e>-1&&(e=b.indexOf("#"))>-1){b=b.substr(0,e)}if(g&&a=="get"){b=b+(b.contains("?")?"&":"?")+g;g=null}this.xhr.open(a.toUpperCase(),b,this.options.async);this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(m,l){try{this.xhr.setRequestHeader(l,m)}catch(n){this.fireEvent("exception",[l,m])}},this);this.fireEvent("request");this.xhr.send(g);if(!this.options.async){this.onStateChange()}return this},cancel:function(){if(!this.running){return this}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this}});(function(){var a={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(b){a[b]=function(){var c=Array.link(arguments,{url:String.type,data:$defined});return this.send($extend(c,{method:b}))}});Request.implement(a)})();Element.Properties.send={set:function(a){var b=this.retrieve("send");if(b){b.cancel()}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},a))},get:function(a){if(a||!this.retrieve("send")){if(a||!this.retrieve("send:options")){this.set("send",a)}this.store("send",new Request(this.retrieve("send:options")))}return this.retrieve("send")}};Element.implement({send:function(a){var b=this.get("send");b.send({data:this,url:a||b.options.url});return this}});Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false},processHTML:function(c){var b=c.match(/<body[^>]*>([\s\S]*?)<\/body>/i);c=(b)?b[1]:c;var a=new Element("div");return $try(function(){var d="<root>"+c+"</root>",g;if(Browser.Engine.trident){g=new ActiveXObject("Microsoft.XMLDOM");g.async=false;g.loadXML(d)}else{g=new DOMParser().parseFromString(d,"text/xml")}d=g.getElementsByTagName("root")[0];if(!d){return null}for(var f=0,e=d.childNodes.length;f<e;f++){var h=Element.clone(d.childNodes[f],true,true);if(h){a.grab(h)}}return a})||a.set("html",c)},success:function(d){var c=this.options,b=this.response;b.html=d.stripScripts(function(e){b.javascript=e});var a=this.processHTML(b.html);b.tree=a.childNodes;b.elements=a.getElements("*");if(c.filter){b.tree=b.elements.filter(c.filter)}if(c.update){document.id(c.update).empty().set("html",b.html)}else{if(c.append){document.id(c.append).adopt(a.getChildren())}}if(c.evalScripts){$exec(b.javascript)}this.onSuccess(b.tree,b.elements,b.html,b.javascript)}});Element.Properties.load={set:function(a){var b=this.retrieve("load");if(b){b.cancel()}return this.eliminate("load").store("load:options",$extend({data:this,link:"cancel",update:this,method:"get"},a))},get:function(a){if(a||!this.retrieve("load")){if(a||!this.retrieve("load:options")){this.set("load",a)}this.store("load",new Request.HTML(this.retrieve("load:options")))}return this.retrieve("load")}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Object.type,url:String.type}));return this}});Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);this.headers.extend({Accept:"application/json","X-Request":"JSON"})},success:function(a){this.response.json=JSON.decode(a,this.options.secure);this.onSuccess(this.response.json,a)}});MooTools.More={version:"1.2.4.2",build:"bd5a93c0913cce25917c48cbdacde568e15e02ef"};Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(b,a){this.elements=this.subject=$$(b);this.parent(a)},compute:function(g,h,j){var c={};for(var d in g){var a=g[d],e=h[d],f=c[d]={};for(var b in a){f[b]=this.parent(a[b],e[b],j)}}return c},set:function(b){for(var c in b){var a=b[c];for(var d in a){this.render(this.elements[c],d,a[d],this.options.unit)}}return this},start:function(c){if(!this.check(c)){return this}var h={},j={};for(var d in c){var f=c[d],a=h[d]={},g=j[d]={};for(var b in f){var e=this.prepare(this.elements[d],b,f[b]);a[b]=e.from;g[b]=e.to}}return this.parent(h,j)}});var Accordion=Fx.Accordion=new Class({Extends:Fx.Elements,options:{display:0,show:false,height:true,width:false,opacity:true,alwaysHide:false,trigger:"click",initialDisplayFx:true,returnHeightToAuto:true},initialize:function(){var c=Array.link(arguments,{container:Element.type,options:Object.type,togglers:$defined,elements:$defined});this.parent(c.elements,c.options);this.togglers=$$(c.togglers);this.container=document.id(c.container);this.previous=-1;this.internalChain=new Chain();if(this.options.alwaysHide){this.options.wait=true}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show}if(this.options.start){this.options.display=false;this.options.show=false}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity"}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth"}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight"}for(var b=0,a=this.togglers.length;b<a;b++){this.addSection(this.togglers[b],this.elements[b])}this.elements.each(function(e,d){if(this.options.show===d){this.fireEvent("active",[this.togglers[d],e])}else{for(var f in this.effects){e.setStyle(f,0)}}},this);if($chk(this.options.display)){this.display(this.options.display,this.options.initialDisplayFx)}this.addEvent("complete",this.internalChain.callChain.bind(this.internalChain))},addSection:function(e,c){e=document.id(e);c=document.id(c);var f=this.togglers.contains(e);this.togglers.include(e);this.elements.include(c);var a=this.togglers.indexOf(e);var b=this.display.bind(this,a);e.store("accordion:display",b);e.addEvent(this.options.trigger,b);if(this.options.height){c.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"})}if(this.options.width){c.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"})}c.fullOpacity=1;if(this.options.fixedWidth){c.fullWidth=this.options.fixedWidth}if(this.options.fixedHeight){c.fullHeight=this.options.fixedHeight}c.setStyle("overflow","hidden");if(!f){for(var d in this.effects){c.setStyle(d,0)}}return this},detach:function(){this.togglers.each(function(a){a.removeEvent(this.options.trigger,a.retrieve("accordion:display"))},this)},display:function(a,b){if(!this.check(a,b)){return this}b=$pick(b,true);if(this.options.returnHeightToAuto){var d=this.elements[this.previous];if(d&&!this.selfHidden){for(var c in this.effects){d.setStyle(c,d[this.effects[c]])}}}a=($type(a)=="element")?this.elements.indexOf(a):a;if((this.timer&&this.options.wait)||(a===this.previous&&!this.options.alwaysHide)){return this}this.previous=a;var e={};this.elements.each(function(h,g){e[g]={};var f;if(g!=a){f=true}else{if(this.options.alwaysHide&&((h.offsetHeight>0&&this.options.height)||h.offsetWidth>0&&this.options.width)){f=true;this.selfHidden=true}}this.fireEvent(f?"background":"active",[this.togglers[g],h]);for(var j in this.effects){e[g][j]=f?0:h[this.effects[j]]}},this);this.internalChain.chain(function(){if(this.options.returnHeightToAuto&&!this.selfHidden){var f=this.elements[a];if(f){f.setStyle("height","auto")}}}.bind(this));return b?this.start(e):this.set(e)}});Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a);var d=this.cancel.bind(this,false);if($type(this.element)!="element"){this.element=document.id(this.element.getDocument().body)}var c=this.element;if(this.options.wheelStops){this.addEvent("start",function(){c.addEvent("mousewheel",d)},true);this.addEvent("complete",function(){c.removeEvent("mousewheel",d)},true)}},set:function(){var a=Array.flatten(arguments);if(Browser.Engine.gecko){a=[Math.round(a[0]),Math.round(a[1])]}this.element.scrollTo(a[0],a[1])},compute:function(c,b,a){return[0,1].map(function(d){return Fx.compute(c[d],b[d],a)})},start:function(c,g){if(!this.check(c,g)){return this}var e=this.element.getScrollSize(),b=this.element.getScroll(),d={x:c,y:g};for(var f in d){var a=e[f];if($chk(d[f])){d[f]=($type(d[f])=="number")?d[f]:a}else{d[f]=b[f]}d[f]+=this.options.offset[f]}return this.parent([b.x,b.y],[d.x,d.y])},toTop:function(){return this.start(false,0)},toLeft:function(){return this.start(0,false)},toRight:function(){return this.start("right",false)},toBottom:function(){return this.start(false,"bottom")},toElement:function(b){var a=document.id(b).getPosition(this.element);return this.start(a.x,a.y)},scrollIntoView:function(c,e,d){e=e?$splat(e):["x","y"];var h={};c=document.id(c);var f=c.getPosition(this.element);var i=c.getSize();var g=this.element.getScroll();var a=this.element.getSize();var b={x:f.x+i.x,y:f.y+i.y};["x","y"].each(function(j){if(e.contains(j)){if(b[j]>g[j]+a[j]){h[j]=b[j]-a[j]}if(f[j]<g[j]){h[j]=f[j]}}if(h[j]==null){h[j]=g[j]}if(d&&d[j]){h[j]=h[j]+d[j]}},this);if(h.x!=g.x||h.y!=g.y){this.start(h.x,h.y)}return this},scrollToCenter:function(c,e,d){e=e?$splat(e):["x","y"];c=$(c);var h={},f=c.getPosition(this.element),i=c.getSize(),g=this.element.getScroll(),a=this.element.getSize(),b={x:f.x+i.x,y:f.y+i.y};["x","y"].each(function(j){if(e.contains(j)){h[j]=f[j]-(a[j]-i[j])/2}if(h[j]==null){h[j]=g[j]}if(d&&d[j]){h[j]=h[j]+d[j]}},this);if(h.x!=g.x||h.y!=g.y){this.start(h.x,h.y)}return this}});Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical",hideOverflow:true},initialize:function(b,a){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0);if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper)}},true);this.element=this.subject=document.id(b);this.parent(a);var d=this.element.retrieve("wrapper");var c=this.element.getStyles("margin","position","overflow");if(this.options.hideOverflow){c=$extend(c,{overflow:"hidden"})}this.wrapper=d||new Element("div",{styles:c}).wraps(this.element);this.element.store("wrapper",this.wrapper).setStyle("margin",0);this.now=[];this.open=true},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth},set:function(a){this.element.setStyle(this.margin,a[0]);this.wrapper.setStyle(this.layout,a[1]);return this},compute:function(c,b,a){return[0,1].map(function(d){return Fx.compute(c[d],b[d],a)})},start:function(b,e){if(!this.check(b,e)){return this}this[e||this.options.mode]();var d=this.element.getStyle(this.margin).toInt();var c=this.wrapper.getStyle(this.layout).toInt();var a=[[d,c],[0,this.offset]];var g=[[d,c],[-this.offset,0]];var f;switch(b){case"in":f=a;break;case"out":f=g;break;case"toggle":f=(c==0)?a:g}return this.parent(f[0],f[1])},slideIn:function(a){return this.start("in",a)},slideOut:function(a){return this.start("out",a)},hide:function(a){this[a||this.options.mode]();this.open=false;return this.set([-this.offset,0])},show:function(a){this[a||this.options.mode]();this.open=true;return this.set([0,this.offset])},toggle:function(a){return this.start("toggle",a)}});Element.Properties.slide={set:function(b){var a=this.retrieve("slide");if(a){a.cancel()}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},b))},get:function(a){if(a||!this.retrieve("slide")){if(a||!this.retrieve("slide:options")){this.set("slide",a)}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")))}return this.retrieve("slide")}};Element.implement({slide:function(d,e){d=d||"toggle";var b=this.get("slide"),a;switch(d){case"hide":b.hide(e);break;case"show":b.show(e);break;case"toggle":var c=this.retrieve("slide:flag",b.open);b[c?"slideOut":"slideIn"](e);this.store("slide:flag",!c);a=true;break;default:b.start(d,e)}if(!a){this.eliminate("slide:flag")}return this}});var SmoothScroll=Fx.SmoothScroll=new Class({Extends:Fx.Scroll,initialize:function(b,c){c=c||document;this.doc=c.getDocument();var d=c.getWindow();this.parent(this.doc,b);this.links=$$(this.options.links||this.doc.links);var a=d.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(f){if(f.href.indexOf(a)!=0){return}var e=f.href.substr(a.length);if(e){this.useLink(f,e)}},this);if(!Browser.Engine.webkit419){this.addEvent("complete",function(){d.location.hash=this.anchor},true)}},useLink:function(c,a){var b;c.addEvent("click",function(d){if(b!==false&&!b){b=document.id(a)||this.doc.getElement("a[name="+a+"]")}if(b){d.preventDefault();this.anchor=a;this.toElement(b).chain(function(){this.fireEvent("scrolledTo",[c,b])}.bind(this));c.blur()}}.bind(this))}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,stopPropagation:false,modifiers:{x:"left",y:"top"}},initialize:function(){var b=Array.link(arguments,{options:Object.type,element:$defined});this.element=document.id(b.element);this.document=this.element.getDocument();this.setOptions(b.options||{});var a=$type(this.options.handle);this.handles=((a=="array"||a=="collection")?$$(this.options.handle):document.id(this.options.handle))||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.Engine.trident)?"selectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};this.attach()},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);return this},start:function(c){if(c.rightClick){return}if(this.options.preventDefault){c.preventDefault()}if(this.options.stopPropagation){c.stopPropagation()}this.mouse.start=c.page;this.fireEvent("beforeStart",this.element);var a=this.options.limit;this.limit={x:[],y:[]};for(var d in this.options.modifiers){if(!this.options.modifiers[d]){continue}if(this.options.style){this.value.now[d]=this.element.getStyle(this.options.modifiers[d]).toInt()}else{this.value.now[d]=this.element[this.options.modifiers[d]]}if(this.options.invert){this.value.now[d]*=-1}this.mouse.pos[d]=c.page[d]-this.value.now[d];if(a&&a[d]){for(var b=2;b--;b){if($chk(a[d][b])){this.limit[d][b]=$lambda(a[d][b])()}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid}}this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop)},check:function(a){if(this.options.preventDefault){a.preventDefault()}var b=Math.round(Math.sqrt(Math.pow(a.page.x-this.mouse.start.x,2)+Math.pow(a.page.y-this.mouse.start.y,2)));if(b>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",[this.element,a]).fireEvent("snap",this.element)}},drag:function(a){if(this.options.preventDefault){a.preventDefault()}this.mouse.now=a.page;for(var b in this.options.modifiers){if(!this.options.modifiers[b]){continue}this.value.now[b]=this.mouse.now[b]-this.mouse.pos[b];if(this.options.invert){this.value.now[b]*=-1}if(this.options.limit&&this.limit[b]){if($chk(this.limit[b][1])&&(this.value.now[b]>this.limit[b][1])){this.value.now[b]=this.limit[b][1]}else{if($chk(this.limit[b][0])&&(this.value.now[b]<this.limit[b][0])){this.value.now[b]=this.limit[b][0]}}}if(this.options.grid[b]){this.value.now[b]-=((this.value.now[b]-(this.limit[b][0]||0))%this.options.grid[b])}if(this.options.style){this.element.setStyle(this.options.modifiers[b],this.value.now[b]+this.options.unit)}else{this.element[this.options.modifiers[b]]=this.value.now[b]}}this.fireEvent("drag",[this.element,a])},cancel:function(a){this.document.removeEvent("mousemove",this.bound.check);this.document.removeEvent("mouseup",this.bound.cancel);if(a){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element)}},stop:function(a){this.document.removeEvent(this.selection,this.bound.eventStop);this.document.removeEvent("mousemove",this.bound.drag);this.document.removeEvent("mouseup",this.bound.stop);if(a){this.fireEvent("complete",[this.element,a])}}});Element.implement({makeResizable:function(a){var b=new Drag(this,$merge({modifiers:{x:"width",y:"height"}},a));this.store("resizer",b);return b.addEvent("drag",function(){this.fireEvent("resize",b)}.bind(this))}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false,precalculate:false,includeMargins:true,checkDroppables:true},initialize:function(b,a){this.parent(b,a);b=this.element;this.droppables=$$(this.options.droppables);this.container=document.id(this.options.container);if(this.container&&$type(this.container)!="element"){this.container=document.id(this.container.getDocument().body)}var c=b.getStyles("left","right","position");if(c.left=="auto"||c.top=="auto"){b.setPosition(b.getPosition(b.getOffsetParent()))}if(c.position=="static"){b.setStyle("position","absolute")}this.addEvent("start",this.checkDroppables,true);this.overed=null},start:function(a){if(this.container){this.options.limit=this.calculateLimit()}if(this.options.precalculate){this.positions=this.droppables.map(function(b){return b.getCoordinates()})}this.parent(a)},calculateLimit:function(){var d=this.element.getOffsetParent(),g=this.container.getCoordinates(d),f={},c={},b={},i={},k={};["top","right","bottom","left"].each(function(o){f[o]=this.container.getStyle("border-"+o).toInt();b[o]=this.element.getStyle("border-"+o).toInt();c[o]=this.element.getStyle("margin-"+o).toInt();i[o]=this.container.getStyle("margin-"+o).toInt();k[o]=d.getStyle("padding-"+o).toInt()},this);var e=this.element.offsetWidth+c.left+c.right,n=this.element.offsetHeight+c.top+c.bottom,h=0,j=0,m=g.right-f.right-e,a=g.bottom-f.bottom-n;if(this.options.includeMargins){h+=c.left;j+=c.top}else{m+=c.right;a+=c.bottom}if(this.element.getStyle("position")=="relative"){var l=this.element.getCoordinates(d);l.left-=this.element.getStyle("left").toInt();l.top-=this.element.getStyle("top").toInt();h+=f.left-l.left;j+=f.top-l.top;m+=c.left-l.left;a+=c.top-l.top;if(this.container!=d){h+=i.left+k.left;j+=(Browser.Engine.trident4?0:i.top)+k.top}}else{h-=c.left;j-=c.top;if(this.container==d){m-=f.left;a-=f.top}else{h+=g.left+f.left;j+=g.top+f.top}}return{x:[h,m],y:[j,a]}},checkAgainst:function(c,b){c=(this.positions)?this.positions[b]:c.getCoordinates();var a=this.mouse.now;return(a.x>c.left&&a.x<c.right&&a.y<c.bottom&&a.y>c.top)},checkDroppables:function(){var a=this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=a){if(this.overed){this.fireEvent("leave",[this.element,this.overed])}if(a){this.fireEvent("enter",[this.element,a])}this.overed=a}},drag:function(a){this.parent(a);if(this.options.checkDroppables&&this.droppables.length){this.checkDroppables()}},stop:function(a){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed,a]);this.overed=null;return this.parent(a)}});Element.implement({makeDraggable:function(a){var b=new Drag.Move(this,a);this.store("dragger",b);return b}});Class.Mutators.Binds=function(a){return a};Class.Mutators.initialize=function(a){return function(){$splat(this.Binds).each(function(b){var c=this[b];if(c){this[b]=c.bind(this)}},this);return a.apply(this,arguments)}};Element.implement({measure:function(e){var g=function(h){return !!(!h||h.offsetHeight||h.offsetWidth)};if(g(this)){return e.apply(this)}var d=this.getParent(),f=[],b=[];while(!g(d)&&d!=document.body){b.push(d.expose());d=d.getParent()}var c=this.expose();var a=e.apply(this);c();b.each(function(h){h()});return a},expose:function(){if(this.getStyle("display")!="none"){return $empty}var a=this.style.cssText;this.setStyles({display:"block",position:"absolute",visibility:"hidden"});return function(){this.style.cssText=a}.bind(this)},getDimensions:function(a){a=$merge({computeSize:false},a);var f={};var d=function(g,e){return(e.computeSize)?g.getComputedSize(e):g.getSize()};var b=this.getParent("body");if(b&&this.getStyle("display")=="none"){f=this.measure(function(){return d(this,a)})}else{if(b){try{f=d(this,a)}catch(c){}}else{f={x:0,y:0}}}return $chk(f.x)?$extend(f,{width:f.x,height:f.y}):$extend(f,{x:f.width,y:f.height})},getComputedSize:function(a){a=$merge({styles:["padding","border"],plains:{height:["top","bottom"],width:["left","right"]},mode:"both"},a);var c={width:0,height:0};switch(a.mode){case"vertical":delete c.width;delete a.plains.width;break;case"horizontal":delete c.height;delete a.plains.height;break}var b=[];$each(a.plains,function(g,f){g.each(function(h){a.styles.each(function(i){b.push((i=="border")?i+"-"+h+"-width":i+"-"+h)})})});var e={};b.each(function(f){e[f]=this.getComputedStyle(f)},this);var d=[];$each(a.plains,function(g,f){var h=f.capitalize();c["total"+h]=c["computed"+h]=0;g.each(function(i){c["computed"+i.capitalize()]=0;b.each(function(k,j){if(k.test(i)){e[k]=e[k].toInt()||0;c["total"+h]=c["total"+h]+e[k];c["computed"+i.capitalize()]=c["computed"+i.capitalize()]+e[k]}if(k.test(i)&&f!=k&&(k.test("border")||k.test("padding"))&&!d.contains(k)){d.push(k);c["computed"+h]=c["computed"+h]-e[k]}})})});["Width","Height"].each(function(g){var f=g.toLowerCase();if(!$chk(c[f])){return}c[f]=c[f]+this["offset"+g]+c["computed"+g];c["total"+g]=c[f]+c["total"+g];delete c["computed"+g]},this);return $extend(e,c)}});var Slider=new Class({Implements:[Events,Options],Binds:["clickedElement","draggedKnob","scrolledElement"],options:{onTick:function(a){if(this.options.snap){a=this.toPosition(this.step)}this.knob.setStyle(this.property,a)},initialStep:0,snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(f,a,e){this.setOptions(e);this.element=document.id(f);this.knob=document.id(a);this.previousChange=this.previousEnd=this.step=-1;var g,b={},d={x:false,y:false};switch(this.options.mode){case"vertical":this.axis="y";this.property="top";g="offsetHeight";break;case"horizontal":this.axis="x";this.property="left";g="offsetWidth"}this.full=this.element.measure(function(){this.half=this.knob[g]/2;return this.element[g]-this.knob[g]+(this.options.offset*2)}.bind(this));this.min=$chk(this.options.range[0])?this.options.range[0]:0;this.max=$chk(this.options.range[1])?this.options.range[1]:this.options.steps;this.range=this.max-this.min;this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;this.stepWidth=this.stepSize*this.full/Math.abs(this.range);this.knob.setStyle("position","relative").setStyle(this.property,this.options.initialStep?this.toPosition(this.options.initialStep):-this.options.offset);d[this.axis]=this.property;b[this.axis]=[-this.options.offset,this.full-this.options.offset];var c={snap:0,limit:b,modifiers:d,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:(function(){this.isDragging=true}).bind(this),onCancel:function(){this.isDragging=false}.bind(this),onComplete:function(){this.isDragging=false;this.draggedKnob();this.end()}.bind(this)};if(this.options.snap){c.grid=Math.ceil(this.stepWidth);c.limit[this.axis][1]=this.full}this.drag=new Drag(this.knob,c);this.attach()},attach:function(){this.element.addEvent("mousedown",this.clickedElement);if(this.options.wheel){this.element.addEvent("mousewheel",this.scrolledElement)}this.drag.attach();return this},detach:function(){this.element.removeEvent("mousedown",this.clickedElement);this.element.removeEvent("mousewheel",this.scrolledElement);this.drag.detach();return this},set:function(a){if(!((this.range>0)^(a<this.min))){a=this.min}if(!((this.range>0)^(a>this.max))){a=this.max}this.step=Math.round(a);this.checkStep();this.fireEvent("tick",this.toPosition(this.step));this.end();return this},clickedElement:function(c){if(this.isDragging||c.target==this.knob){return}var b=this.range<0?-1:1;var a=c.page[this.axis]-this.element.getPosition()[this.axis]-this.half;a=a.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+b*this.toStep(a));this.checkStep();this.fireEvent("tick",a);this.end()},scrolledElement:function(a){var b=(this.options.mode=="horizontal")?(a.wheel<0):(a.wheel>0);this.set(b?this.step-this.stepSize:this.step+this.stepSize);a.stop()},draggedKnob:function(){var b=this.range<0?-1:1;var a=this.drag.value.now[this.axis];a=a.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+b*this.toStep(a));this.checkStep()},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("change",this.step)}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("complete",this.step+"")}},toStep:function(a){var b=(a+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(b-=b%this.stepSize):b},toPosition:function(a){return(this.full*Math.abs(this.min-a))/(this.steps*this.stepSize)-this.options.offset}});var Sortables=new Class({Implements:[Events,Options],options:{snap:4,opacity:1,clone:false,revert:false,handle:false,constrain:false},initialize:function(a,b){this.setOptions(b);this.elements=[];this.lists=[];this.idle=true;this.addLists($$(document.id(a)||a));if(!this.options.clone){this.options.revert=false}if(this.options.revert){this.effect=new Fx.Morph(null,$merge({duration:250,link:"cancel"},this.options.revert))}},attach:function(){this.addLists(this.lists);return this},detach:function(){this.lists=this.removeLists(this.lists);return this},addItems:function(){Array.flatten(arguments).each(function(a){this.elements.push(a);var b=a.retrieve("sortables:start",this.start.bindWithEvent(this,a));(this.options.handle?a.getElement(this.options.handle)||a:a).addEvent("mousedown",b)},this);return this},addLists:function(){Array.flatten(arguments).each(function(a){this.lists.push(a);this.addItems(a.getChildren())},this);return this},removeItems:function(){return $$(Array.flatten(arguments).map(function(a){this.elements.erase(a);var b=a.retrieve("sortables:start");(this.options.handle?a.getElement(this.options.handle)||a:a).removeEvent("mousedown",b);return a},this))},removeLists:function(){return $$(Array.flatten(arguments).map(function(a){this.lists.erase(a);this.removeItems(a.getChildren());return a},this))},getClone:function(b,a){if(!this.options.clone){return new Element("div").inject(document.body)}if($type(this.options.clone)=="function"){return this.options.clone.call(this,b,a,this.list)}return a.clone(true).setStyles({margin:"0px",position:"absolute",visibility:"hidden",width:a.getStyle("width")}).inject(this.list).setPosition(a.getPosition(a.getOffsetParent()))},getDroppables:function(){var a=this.list.getChildren();if(!this.options.constrain){a=this.lists.concat(a).erase(this.list)}return a.erase(this.clone).erase(this.element)},insert:function(c,b){var a="inside";if(this.lists.contains(b)){this.list=b;this.drag.droppables=this.getDroppables()}else{a=this.element.getAllPrevious().contains(b)?"before":"after"}this.element.inject(b,a);this.fireEvent("sort",[this.element,this.clone])},start:function(b,a){if(!this.idle){return}this.idle=false;this.element=a;this.opacity=a.get("opacity");this.list=a.getParent();this.clone=this.getClone(b,a);this.drag=new Drag.Move(this.clone,{snap:this.options.snap,container:this.options.constrain&&this.element.getParent(),droppables:this.getDroppables(),onSnap:function(){b.stop();this.clone.setStyle("visibility","visible");this.element.set("opacity",this.options.opacity||0);this.fireEvent("start",[this.element,this.clone])}.bind(this),onEnter:this.insert.bind(this),onCancel:this.reset.bind(this),onComplete:this.end.bind(this)});this.clone.inject(this.element,"before");this.drag.start(b)},end:function(){this.drag.detach();this.element.set("opacity",this.opacity);if(this.effect){var a=this.element.getStyles("width","height");var b=this.clone.computePosition(this.element.getPosition(this.clone.offsetParent));this.effect.element=this.clone;this.effect.start({top:b.top,left:b.left,width:a.width,height:a.height,opacity:0.25}).chain(this.reset.bind(this))}else{this.reset()}},reset:function(){this.idle=true;this.clone.destroy();this.fireEvent("complete",this.element)},serialize:function(){var c=Array.link(arguments,{modifier:Function.type,index:$defined});var b=this.lists.map(function(d){return d.getChildren().map(c.modifier||function(e){return e.get("id")},this)},this);var a=c.index;if(this.lists.length==1){a=0}return $chk(a)&&a>=0&&a<this.lists.length?b[a]:b}});var Color=new Native({initialize:function(b,c){if(arguments.length>=3){c="rgb";b=Array.slice(arguments,0,3)}else{if(typeof b=="string"){if(b.match(/rgb/)){b=b.rgbToHex().hexToRgb(true)}else{if(b.match(/hsb/)){b=b.hsbToRgb()}else{b=b.hexToRgb(true)}}}}c=c||"rgb";switch(c){case"hsb":var a=b;b=b.hsbToRgb();b.hsb=a;break;case"hex":b=b.hexToRgb(true);break}b.rgb=b.slice(0,3);b.hsb=b.hsb||b.rgbToHsb();b.hex=b.rgbToHex();return $extend(b,this)}});Color.implement({mix:function(){var a=Array.slice(arguments);var c=($type(a.getLast())=="number")?a.pop():50;var b=this.slice();a.each(function(d){d=new Color(d);for(var e=0;e<3;e++){b[e]=Math.round((b[e]/100*(100-c))+(d[e]/100*c))}});return new Color(b,"rgb")},invert:function(){return new Color(this.map(function(a){return 255-a}))},setHue:function(a){return new Color([a,this.hsb[1],this.hsb[2]],"hsb")},setSaturation:function(a){return new Color([this.hsb[0],a,this.hsb[2]],"hsb")},setBrightness:function(a){return new Color([this.hsb[0],this.hsb[1],a],"hsb")}});var $RGB=function(d,c,a){return new Color([d,c,a],"rgb")};var $HSB=function(d,c,a){return new Color([d,c,a],"hsb")};var $HEX=function(a){return new Color(a,"hex")};Array.implement({rgbToHsb:function(){var b=this[0],c=this[1],j=this[2],g=0;var i=Math.max(b,c,j),e=Math.min(b,c,j);var k=i-e;var h=i/255,f=(i!=0)?k/i:0;if(f!=0){var d=(i-b)/k;var a=(i-c)/k;var l=(i-j)/k;if(b==i){g=l-a}else{if(c==i){g=2+d-l}else{g=4+a-d}}g/=6;if(g<0){g++}}return[Math.round(g*360),Math.round(f*100),Math.round(h*100)]},hsbToRgb:function(){var c=Math.round(this[2]/100*255);if(this[1]==0){return[c,c,c]}else{var a=this[0]%360;var e=a%60;var g=Math.round((this[2]*(100-this[1]))/10000*255);var d=Math.round((this[2]*(6000-this[1]*e))/600000*255);var b=Math.round((this[2]*(6000-this[1]*(60-e)))/600000*255);switch(Math.floor(a/60)){case 0:return[c,b,g];case 1:return[d,c,g];case 2:return[g,c,b];case 3:return[g,d,c];case 4:return[b,g,c];case 5:return[c,g,d]}}return false}});String.implement({rgbToHsb:function(){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHsb():null},hsbToRgb:function(){var a=this.match(/\d{1,3}/g);return(a)?a.hsbToRgb():null}});var Group=new Class({initialize:function(){this.instances=Array.flatten(arguments);this.events={};this.checker={}},addEvent:function(b,a){this.checker[b]=this.checker[b]||{};this.events[b]=this.events[b]||[];if(this.events[b].contains(a)){return false}else{this.events[b].push(a)}this.instances.each(function(c,d){c.addEvent(b,this.check.bind(this,[b,c,d]))},this);return this},check:function(c,a,b){this.checker[c][b]=true;var d=this.instances.every(function(f,e){return this.checker[c][e]||false},this);if(!d){return}this.checker[c]={};this.events[c].each(function(e){e.call(this,this.instances,a)},this)}});Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:true},initialize:function(b,a){this.parent(b,a);this.load()},save:function(){var a=JSON.encode(this.hash);if(!a||a.length>4096){return false}if(a=="{}"){this.dispose()}else{this.write(a)}return true},load:function(){this.hash=new Hash(JSON.decode(this.read(),true));return this}});Hash.each(Hash.prototype,function(b,a){if(typeof b=="function"){Hash.Cookie.implement(a,function(){var c=b.apply(this.hash,arguments);if(this.options.autoSave){this.save()}return c})}});var Scroller=new Class({Implements:[Events,Options],options:{area:20,velocity:1,onChange:function(a,b){this.element.scrollTo(a,b)},fps:50},initialize:function(b,a){this.setOptions(a);this.element=document.id(b);this.listener=($type(this.element)!="element")?document.id(this.element.getDocument().body):this.element;this.timer=null;this.bound={attach:this.attach.bind(this),detach:this.detach.bind(this),getCoords:this.getCoords.bind(this)}},start:function(){this.listener.addEvents({mouseover:this.bound.attach,mouseout:this.bound.detach})},stop:function(){this.listener.removeEvents({mouseover:this.bound.attach,mouseout:this.bound.detach});this.detach();this.timer=$clear(this.timer)},attach:function(){this.listener.addEvent("mousemove",this.bound.getCoords)},detach:function(){this.listener.removeEvent("mousemove",this.bound.getCoords);this.timer=$clear(this.timer)},getCoords:function(a){this.page=(this.listener.get("tag")=="body")?a.client:a.page;if(!this.timer){this.timer=this.scroll.periodical(Math.round(1000/this.options.fps),this)}},scroll:function(){var b=this.element.getSize(),a=this.element.getScroll(),f=this.element.getOffsets(),c=this.element.getScrollSize(),e={x:0,y:0};for(var d in this.page){if(this.page[d]<(this.options.area+f[d])&&a[d]!=0){e[d]=(this.page[d]-this.options.area-f[d])*this.options.velocity}else{if(this.page[d]+this.options.area>(b[d]+f[d])&&a[d]+b[d]!=c[d]){e[d]=(this.page[d]-b[d]+this.options.area-f[d])*this.options.velocity}}}if(e.y||e.x){this.fireEvent("change",[a.x+e.x,a.y+e.y])}}});(function(){var a=function(c,b){return(c)?($type(c)=="function"?c(b):b.get(c)):""};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle("display","block")},onHide:function(){this.tip.setStyle("display","none")},title:"title",text:function(b){return b.get("rel")||b.get("href")},showDelay:100,hideDelay:100,className:"tip-wrap",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:false},initialize:function(){var b=Array.link(arguments,{options:Object.type,elements:$defined});this.setOptions(b.options);if(b.elements){this.attach(b.elements)}this.container=new Element("div",{"class":"tip"})},toElement:function(){if(this.tip){return this.tip}this.container=new Element("div",{"class":"tip"});return this.tip=new Element("div",{"class":this.options.className,styles:{position:"absolute",top:0,left:0}}).adopt(new Element("div",{"class":"tip-top"}),this.container,new Element("div",{"class":"tip-bottom"})).inject(document.body)},attach:function(b){$$(b).each(function(d){var f=a(this.options.title,d),e=a(this.options.text,d);d.erase("title").store("tip:native",f).retrieve("tip:title",f);d.retrieve("tip:text",e);this.fireEvent("attach",[d]);var c=["enter","leave"];if(!this.options.fixed){c.push("move")}c.each(function(h){var g=d.retrieve("tip:"+h);if(!g){g=this["element"+h.capitalize()].bindWithEvent(this,d)}d.store("tip:"+h,g).addEvent("mouse"+h,g)},this)},this);return this},detach:function(b){$$(b).each(function(d){["enter","leave","move"].each(function(e){d.removeEvent("mouse"+e,d.retrieve("tip:"+e)).eliminate("tip:"+e)});this.fireEvent("detach",[d]);if(this.options.title=="title"){var c=d.retrieve("tip:native");if(c){d.set("title",c)}}},this);return this},elementEnter:function(c,b){this.container.empty();["title","text"].each(function(e){var d=b.retrieve("tip:"+e);if(d){this.fill(new Element("div",{"class":"tip-"+e}).inject(this.container),d)}},this);$clear(this.timer);this.timer=(function(){this.show(b);this.position((this.options.fixed)?{page:b.getPosition()}:c)}).delay(this.options.showDelay,this)},elementLeave:function(c,b){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this,b);this.fireForParent(c,b)},fireForParent:function(c,b){b=b.getParent();if(!b||b==document.body){return}if(b.retrieve("tip:enter")){b.fireEvent("mouseenter",c)}else{this.fireForParent(c,b)}},elementMove:function(c,b){this.position(c)},position:function(e){if(!this.tip){document.id(this)}var c=window.getSize(),b=window.getScroll(),f={x:this.tip.offsetWidth,y:this.tip.offsetHeight},d={x:"left",y:"top"},g={};for(var h in d){g[d[h]]=e.page[h]+this.options.offset[h];if((g[d[h]]+f[h]-b[h])>c[h]-this.options.windowPadding[h]){g[d[h]]=e.page[h]-this.options.offset[h]-f[h]}}this.tip.setStyles(g)},fill:function(b,c){if(typeof c=="string"){b.set("html",c)}else{b.adopt(c)}},show:function(b){if(!this.tip){document.id(this)}this.fireEvent("show",[this.tip,b])},hide:function(b){if(!this.tip){document.id(this)}this.fireEvent("hide",[this.tip,b])}})})();var Asset={javascript:function(f,d){d=$extend({onload:$empty,document:document,check:$lambda(true)},d);var b=new Element("script",{src:f,type:"text/javascript"});var e=d.onload.bind(b),a=d.check,g=d.document;delete d.onload;delete d.check;delete d.document;b.addEvents({load:e,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){e()}}}).set(d);if(Browser.Engine.webkit419){var c=(function(){if(!$try(a)){return}$clear(c);e()}).periodical(50)}return b.inject(g.head)},css:function(b,a){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:b},a)).inject(document.head)},image:function(c,b){b=$merge({onload:$empty,onabort:$empty,onerror:$empty},b);var d=new Image();var a=document.id(d)||new Element("img");["load","abort","error"].each(function(e){var f="on"+e;var g=b[f];delete b[f];d[f]=function(){if(!d){return}if(!a.parentNode){a.width=d.width;a.height=d.height}d=d.onload=d.onabort=d.onerror=null;g.delay(1,a,a);a.fireEvent(e,a,1)}});d.src=a.src=c;if(d&&d.complete){d.onload.delay(1)}return a.set(b)},images:function(d,c){c=$merge({onComplete:$empty,onProgress:$empty,onError:$empty,properties:{}},c);d=$splat(d);var a=[];var b=0;return new Elements(d.map(function(e){return Asset.image(e,$extend(c.properties,{onload:function(){c.onProgress.call(this,b,d.indexOf(e));b++;if(b==d.length){c.onComplete()}},onerror:function(){c.onError.call(this,b,d.indexOf(e));b++;if(b==d.length){c.onComplete()}}}))}))}};if(!window.console){var console={}}if(!console.log){console.log=function(){}}if(!console.warn){console.warn=console.log}if(!console.error){console.error=console.warn}MooTools.upgradeLog=function(){if(console[this.upgradeLogLevel]){console[this.upgradeLogLevel].apply(console,arguments)}};(function(){oldA=$A;window.$A=function(k,m,j){if(m!=undefined&&j!=undefined){MooTools.upgradeLog("1.1 > 1.2: $A no longer takes start and length arguments.");if(Browser.Engine.trident&&$type(k)=="collection"){m=m||0;if(m<0){m=k.length+m}j=j||(k.length-m);var l=[];for(var h=0;h<j;h++){l[h]=k[m++]}return l}m=(m||0)+((m<0)?k.length:0);var g=((!$chk(j))?k.length:j)+m;return Array.prototype.slice.call(k,m,g)}return oldA(k)};var e=["Array","Function","String","RegExp","Number","Window","Document","Element","Elements"];for(var c=0,b=e.length;c<b;c++){var d=e[c];var a=window[d];if(a){var f=a.extend;a.extend=function(g){MooTools.upgradeLog("1.1 > 1.2: native types no longer use .extend to add methods to prototypes but instead use .implement. NOTE: YOUR METHODS WERE NOT IMPLEMENTED ON THE NATIVE "+d.toUpperCase()+" PROTOTYPE.");return f.apply(this,arguments)}}}})();window.onDomReady=Window.onDomReady=function(a){MooTools.upgradeLog('1.1 > 1.2: window.onDomReady is no longer supported. Use window.addEvent("domready") instead');return window.addEvent("domready",a)};if(Browser.__defineGetter__){Browser.__defineGetter__("hasGetter",function(){return true})}if(Browser.hasGetter){window.__defineGetter__("ie",function(){MooTools.upgradeLog("1.1 > 1.2: window.ie is deprecated. Use Browser.Engine.trident");return(Browser.Engine.name=="trident")?true:false});window.__defineGetter__("ie6",function(){MooTools.upgradeLog("1.1 > 1.2: window.ie6 is deprecated. Use Browser.Engine.trident and Browser.Engine.version");return(Browser.Engine.name=="trident"&&Browser.Engine.version==4)?true:false});window.__defineGetter__("ie7",function(){MooTools.upgradeLog("1.1 > 1.2: window.ie7 is deprecated. Use Browser.Engine.trident and Browser.Engine.version");return(Browser.Engine.name=="trident"&&Browser.Engine.version==5)?true:false});window.__defineGetter__("gecko",function(){MooTools.upgradeLog("1.1 > 1.2: window.gecko is deprecated. Use Browser.Engine.gecko");return(Browser.Engine.name=="gecko")?true:false});window.__defineGetter__("webkit",function(){MooTools.upgradeLog("1.1 > 1.2: window.webkit is deprecated. Use Browser.Engine.webkit");return(Browser.Engine.name=="webkit")?true:false});window.__defineGetter__("webkit419",function(){MooTools.upgradeLog("1.1 > 1.2: window.webkit is deprecated. Use Browser.Engine.webkit and Browser.Engine.version");return(Browser.Engine.name=="webkit"&&Browser.Engine.version==419)?true:false});window.__defineGetter__("webkit420",function(){MooTools.upgradeLog("1.1 > 1.2: window.webkit is deprecated. Use Browser.Engine.webkit and Browser.Engine.version");return(Browser.Engine.name=="webkit"&&Browser.Engine.version==420)?true:false});window.__defineGetter__("opera",function(){MooTools.upgradeLog("1.1 > 1.2: window.opera is deprecated. Use Browser.Engine.presto");return(Browser.Engine.name=="presto")?true:false})}else{window[Browser.Engine.name]=window[Browser.Engine.name+Browser.Engine.version]=true;window.ie=window.trident;window.ie6=window.trident4;window.ie7=window.trident5}Array.implement({copy:function(b,a){MooTools.upgradeLog("1.1 > 1.2: Array.copy is deprecated. Use Array.splice");return $A(this,b,a)},remove:function(a){MooTools.upgradeLog("1.1 > 1.2: Array.remove is deprecated. Use Array.erase");return this.erase(a)},merge:function(a){MooTools.upgradeLog("1.1 > 1.2: Array.merge is deprecated. Use Array.combine");return this.combine(a)}});Function.implement({bindAsEventListener:function(b,a){MooTools.upgradeLog("1.1 > 1.2: Function.bindAsEventListener is deprecated. Use bindWithEvent.");return this.bindWithEvent.call(this,b,a)}});Function.empty=function(){MooTools.upgradeLog("1.1 > 1.2: Function.empty is now just $empty.")};Hash.implement({keys:function(){MooTools.upgradeLog("1.1 > 1.2: Hash.keys is deprecated. Use Hash.getKeys");return this.getKeys()},values:function(){MooTools.upgradeLog("1.1 > 1.2: Hash.values is deprecated. Use Hash.getValues");return this.getValues()},hasKey:function(a){MooTools.upgradeLog("1.1 > 1.2: Hash.hasKey is deprecated. Use Hash.has");return this.has(a)},merge:function(a){MooTools.upgradeLog("1.1 > 1.2: Hash.merge is deprecated. Use Hash.combine");return this.extend(a)},remove:function(a){MooTools.upgradeLog("1.1 > 1.2: Hash.remove is deprecated. use Hash.erase");return this.erase(a)}});Object.toQueryString=function(a){MooTools.upgradeLog("1.1 > 1.2: Object.toQueryString() is deprecated. use Hash.toQueryString() instead");$H(a).each(function(c,b){if($type(c)=="object"||$type(c)=="array"){a[b]=c.toString()}});return Hash.toQueryString(a)};var Abstract=function(a){MooTools.upgradeLog("1.1 > 1.2: Abstract is deprecated. Use Hash");return new Hash(a)};Class.empty=function(){MooTools.upgradeLog("1.1 > 1.2: replace Class.empty with $empty");return $empty};(function(){var a=function(d){var c=function(){return this};c.prototype=d;return c};Class.prototype.extend=function(d){MooTools.upgradeLog("1.1 > 1.2: Class.extend is deprecated. See the class Extend mutator.");var c=a(d);var e=new c();e.Extends=this;return new Class(e)};var b=Class.prototype.implement;Class.prototype.implement=function(){if(arguments.length>1&&Array.every(arguments,Object.type)){MooTools.upgradeLog("1.1 > 1.2: Class.implement no longer takes more than one thing at a time, either MyClass.implement(key, value) or MyClass.implement(object) but NOT MyClass.implement(new Foo, new Bar, new Baz). See also: the class Implements mutator.");Array.each(arguments,function(c){b.call(this,c)},this);return this}return b.apply(this,arguments)}})();(function(){var c=Element.prototype.getPosition;var a=Element.prototype.getCoordinates;function b(e){return(/^(?:body|html)$/i).test(e.tagName)}var d=Element.prototype.getSize;Element.implement({getSize:function(){MooTools.upgradeLog("1.1 > 1.2: NOTE: getSize is different in 1.2; it no longer returns values for size, scroll, and scrollSize, but instead just returns x/y values for the dimensions of the element.");var e=d.apply(this,arguments);return $merge(e,{size:e,scroll:this.getScroll(),scrollSize:this.getScrollSize()})},getPosition:function(e){if(e&&$type(e)=="array"){MooTools.upgradeLog("1.1 > 1.2: Element.getPosition no longer accepts an array of overflown elements but rather, optionally, a single element to get relative coordinates.");e=null}return c.apply(this,[e])},getCoordinates:function(e){if(e&&$type(e)=="array"){MooTools.upgradeLog("1.1 > 1.2: Element.getCoordinates no longer accepts an array of overflown elements but rather, optionally, a single element to get relative coordinates.");e=null}return a.apply(this,[e])}});Native.implement([Document,Window],{getSize:function(){MooTools.upgradeLog("1.1 > 1.2: NOTE: getSize is different in 1.2; it no longer returns values for size, scroll, and scrollSize, but instead just returns x/y values for the dimensions of the element.");var e;var g=this.getWindow();var f=this.getDocument();f=(!f.compatMode||f.compatMode=="CSS1Compat")?f.html:f.body;if(Browser.Engine.presto||Browser.Engine.webkit){e={x:g.innerWidth,y:g.innerHeight}}else{e={x:f.clientWidth,y:f.clientHeight}}return $extend(e,{size:e,scroll:{x:g.pageXOffset||f.scrollLeft,y:g.pageYOffset||f.scrollTop},scrollSize:{x:Math.max(f.scrollWidth,e.x),y:Math.max(f.scrollHeight,e.y)}})}})})();Event.keys=Event.Keys;(function(){var a=Element.prototype.toQueryString;Element.implement({getFormElements:function(){MooTools.upgradeLog('1.1 > 1.2: Element.getFormElements is deprecated, use Element.getElements("input, textarea, select");');return this.getElements("input, textarea, select")},replaceWith:function(b){MooTools.upgradeLog("1.1 > 1.2: Element.replaceWith is deprecated, use Element.replaces instead.");b=$(b);this.parentNode.replaceChild(b,this);return b},remove:function(){MooTools.upgradeLog("1.1 > 1.2: Element.remove is deprecated - use Element.dispose.");return this.dispose.apply(this,arguments)},getText:function(){MooTools.upgradeLog('1.1 > 1.2: Element.getText is deprecated - use Element.get("text").');return this.get("text")},setText:function(b){MooTools.upgradeLog('1.1 > 1.2: Element.setText is deprecated - use Element.set("text", text).');return this.set("text",b)},setHTML:function(){MooTools.upgradeLog('1.1 > 1.2: Element.setHTML is deprecated - use Element.set("html", HTML).');return this.set("html",arguments)},getHTML:function(){MooTools.upgradeLog('1.1 > 1.2: Element.getHTML is deprecated - use Element.get("html").');return this.get("html")},getTag:function(){MooTools.upgradeLog('1.1 > 1.2: Element.getTag is deprecated - use Element.get("tag").');return this.get("tag")},getValue:function(){MooTools.upgradeLog('1.1 > 1.2: Element.getValue is deprecated - use Element.get("value").');switch(this.getTag()){case"select":var b=[];$each(this.options,function(c){if(c.selected){b.push($pick(c.value,c.text))}});return(this.multiple)?b:b[0];case"input":if(!(this.checked&&["checkbox","radio"].contains(this.type))&&!["hidden","text","password"].contains(this.type)){break}case"textarea":return this.value}return false},toQueryString:function(){MooTools.upgradeLog("1.1 > 1.2: warning Element.toQueryString is slightly different; inputs without names are excluded, inputs with type == submit, reset, and file are excluded, and inputs with undefined values are excluded.");return a.apply(this,arguments)}})})();Element.Properties.properties={set:function(a){MooTools.upgradeLog("1.1 > 1.2: Element.set({properties: {}}) is deprecated; instead of properties, just name the values at the root of the object (Element.set({src: url})).");$H(a).each(function(c,b){this.set(b,c)},this)}};Element.implement({setOpacity:function(a){MooTools.upgradeLog('1.1 > 1.2: Element.setOpacity is deprecated; use Element.setStyle("opacity", value).');return this.setStyle("opacity",a)}});Element.Properties.styles={set:function(a){MooTools.upgradeLog('1.1 > 1.2: Element.set("styles") no longer accepts a string as an argument. Pass an object instead.');if($type(a)=="string"){a.split(";").each(function(b){this.setStyle(b.split(":")[0],b.split(":")[1])},this)}else{this.setStyles(a)}}};Fx.implement({custom:function(b,a){MooTools.upgradeLog("1.1 > 1.2: Fx.custom is deprecated. use Fx.start.");return this.start(b,a)},clearTimer:function(){MooTools.upgradeLog("1.1 > 1.2: Fx.clearTimer is deprecated. use Fx.cancel.");return this.cancel()},stop:function(){MooTools.upgradeLog("1.1 > 1.2: Fx.stop is deprecated. use Fx.cancel.");return this.cancel()}});Fx.Base=new Class({Extends:Fx,initialize:function(){MooTools.upgradeLog("1.1 > 1.2: Fx.Base is deprecated. use Fx.");this.parent.apply(this,arguments)}});Fx.Style=new Class({Extends:Fx.Tween,initialize:function(b,c,a){MooTools.upgradeLog("1.1 > 1.2: Fx.Style is deprecated. use Fx.Tween.");this.property=c;this.parent(b,a)},start:function(b,a){return this.parent(this.property,b,a)},set:function(a){return this.parent(this.property,a)},hide:function(){MooTools.upgradeLog("1.1 > 1.2: Fx.Style .hide() is deprecated; use Fx.Tween .set(0) instead");return this.set(0)}});Element.implement({effect:function(b,a){MooTools.upgradeLog("1.1 > 1.2: Element.effect is deprecated; use Fx.Tween or Element.tween.");return new Fx.Style(this,b,a)}});Fx.Styles=new Class({Extends:Fx.Morph,initialize:function(){MooTools.upgradeLog("1.1 > 1.2: Fx.Styles is deprecated. use Fx.Morph.");this.parent.apply(this,arguments)}});Element.implement({effects:function(a){MooTools.upgradeLog("1.1 > 1.2: Element.effects is deprecated; use Fx.Morph or Element.morph.");return new Fx.Morph(this,a)}});Fx.Scroll.implement({scrollTo:function(b,a){MooTools.upgradeLog("1.1 > 1.2: Fx.Scroll's .scrollTo is deprecated; use .start.");return this.start(b,a)}});Request.implement({onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status}.bind(this));this.xhr.onreadystatechange=$empty;this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};if(this.options.isSuccess.call(this,this.status)){this.success(this.response.text,this.response.xml)}else{this.failure(this.response.text,this.response.xml)}},failure:function(){this.onFailure.apply(this,arguments)},onFailure:function(){MooTools.upgradeLog("1.1 > 1.2: Note that onComplete does not receive arguments in 1.2. Also note that onComplete is invoked on BOTH success and failure (while in 1.1 it was only invoked on success). Use the onSuccess event instead if you wish to limit this invocation to success.");this.fireEvent("complete",arguments).fireEvent("failure",this.xhr)}});var XHR=new Class({Extends:Request,options:{update:false},initialize:function(a){MooTools.upgradeLog("1.1 > 1.2: XHR is deprecated. Use Request.");this.parent(a);this.transport=this.xhr},request:function(a){MooTools.upgradeLog("1.1 > 1.2: XHR.request() is deprecated. Use Request.send() instead.");return this.send(this.url,a||this.options.data)},send:function(a,b){if(!this.check(arguments.callee,a,b)){return this}return this.parent({url:a,data:b})},success:function(b,a){b=this.processScripts(b);if(this.options.update){$(this.options.update).empty().set("html",b)}this.onSuccess(b,a)},failure:function(){this.fireEvent("failure",this.xhr)}});var Ajax=new Class({Extends:XHR,initialize:function(b,a){MooTools.upgradeLog("1.1 > 1.2: Ajax is deprecated. Use Request.");this.url=b;this.parent(a)},success:function(b,a){this.processScripts(b);response=this.response;response.html=b.stripScripts(function(c){response.javascript=c});if(this.options.update){$(this.options.update).empty().set("html",response.html)}if(this.options.evalScripts){$exec(response.javascript)}this.onSuccess(b,a)}});(function(){var a=Element.prototype.send;Element.implement({send:function(b){if($type(b)=="string"){return a.apply(this,arguments)}if($type(b)=="object"){MooTools.upgradeLog("1.1 > 1.2: Element.send no longer takes an options argument as its object but rather a url. See docs.");this.set("send",b);a.call(this)}return this}})})();JSON.Remote=new Class({options:{key:"json"},Extends:Request.JSON,initialize:function(b,a){MooTools.upgradeLog("JSON.Remote is deprecated. Use Request.JSON");this.parent(a);this.onComplete=$empty;this.url=b},send:function(a){if(!this.check(arguments.callee,a)){return this}return this.parent({url:this.url,data:{json:Json.encode(a)}})},failure:function(){this.fireEvent("failure",this.xhr)}});Cookie.set=function(b,c,a){MooTools.upgradeLog("1.1 > 1.2: Cookie.set is deprecated. Use Cookie.write");return new Cookie(b,a).write(c)};Cookie.get=function(a){MooTools.upgradeLog("1.1 > 1.2: Cookie.get is deprecated. Use Cookie.read");return new Cookie(a).read()};Cookie.remove=function(b,a){MooTools.upgradeLog("1.1 > 1.2: Cookie.remove is deprecated. Use Cookie.dispose");return new Cookie(b,a).dispose()};JSON.toString=function(a){MooTools.upgradeLog("1.1 > 1.2: JSON.toString is deprecated. Use JSON.encode");return JSON.encode(a)};JSON.evaluate=function(a){MooTools.upgradeLog("1.1 > 1.2: JSON.evaluate is deprecated. Use JSON.decode");return JSON.decode(a)};var Json=JSON;Native.implement([Element,Document],{getElementsByClassName:function(a){MooTools.upgradeLog("1.1 > 1.2: Element.filterByTag is deprecated.");return this.getElements("."+a)},getElementsBySelector:function(a){MooTools.upgradeLog("1.1 > 1.2: Element.getElementsBySelector is deprecated. Use getElements()");return this.getElements(a)}});Elements.implement({filterByTag:function(a){MooTools.upgradeLog("1.1 > 1.2: Elements.filterByTag is deprecated. Use Elements.filter.");return this.filter(a)},filterByClass:function(a){MooTools.upgradeLog("1.1 > 1.2: Elements.filterByClass is deprecated. Use Elements.filter.");return this.filter("."+a)},filterById:function(a){MooTools.upgradeLog("1.1 > 1.2: Elements.filterById is deprecated. Use Elements.filter.");return this.filter("#"+a)},filterByAttribute:function(c,a,d){MooTools.upgradeLog("1.1 > 1.2: Elements.filterByAttribute is deprecated. Use Elements.filter.");var b=this.filter("["+c+(a||"")+(d||"")+"]");if(d){b=b.filter("["+c+"]")}return b}});var $E=function(a,b){MooTools.upgradeLog("1.1 > 1.2: $E is deprecated, use document.getElement.");return($(b)||document).getElement(a)};var $ES=function(a,b){MooTools.upgradeLog("1.1 > 1.2: $ES is deprecated. Use $$.");return($(b)||document).getElements(a)};(function(){if(!window.Tips){return}Tips.implement({initialize:function(){MooTools.upgradeLog("1.1 > 1.2: Tips DOM element layout has changed and your CSS classes may need to change.");var a=Array.link(arguments,{options:Object.type,elements:$defined});this.setOptions(a.options);if(this.options.offsets){MooTools.upgradeLog('1.1 > 1.2: Tips no longer have an "offsets" option; use "offset".');this.options.offset=this.options.offsets}document.id(this);this.addEvent("show",function(){this.tip.addClass("tool-tip");this.tip.getElement(".tip-title").addClass("tool-title");this.tip.getElement(".tip-text").addClass("tool-text")});this.parseTitle(a.elements);if(a.elements){this.attach(a.elements)}},parseTitle:function(a){a.each(function(b){var c=b.get("title");if(c.test("::")){MooTools.upgradeLog('1.1 > 1.2: Tips no longer parse the title attribute for "::" for title/caption; use title and rel attributes instead.');b.store("tip:title",c.split("::")[0]);b.store("tip:text",c.split("::")[1]);b.set("title","")}})}})})();
\ No hay ningún carácter de nueva línea al final del fichero
+var MooTools={version:"1.2.5",build:"008d8f0f2fcc2044e54fdd3635341aaab274e757"};var Native=function(l){l=l||{};var a=l.name;var j=l.legacy;var b=l.protect;var c=l.implement;var i=l.generics;var g=l.initialize;var h=l.afterImplement||function(){};var d=g||j;i=i!==false;d.constructor=Native;d.$family={name:"native"};if(j&&g){d.prototype=j.prototype;}d.prototype.constructor=d;if(a){var f=a.toLowerCase();d.prototype.$family={name:f};Native.typize(d,f);}var k=function(o,m,p,n){if(!b||n||!o.prototype[m]){o.prototype[m]=p;}if(i){Native.genericize(o,m,b);}h.call(o,m,p);return o;};d.alias=function(o,m,q){if(typeof o=="string"){var p=this.prototype[o];if((o=p)){return k(this,m,o,q);}}for(var n in o){this.alias(n,o[n],m);}return this;};d.implement=function(n,m,q){if(typeof n=="string"){return k(this,n,m,q);}for(var o in n){k(this,o,n[o],m);}return this;};if(c){d.implement(c);}return d;};Native.genericize=function(b,c,a){if((!a||!b[c])&&typeof b.prototype[c]=="function"){b[c]=function(){var d=Array.prototype.slice.call(arguments);return b.prototype[c].apply(d.shift(),d);};}};Native.implement=function(d,c){for(var b=0,a=d.length;b<a;b++){d[b].implement(c);}};Native.typize=function(a,b){if(!a.type){a.type=function(c){return($type(c)===b);};}};(function(){var a={Array:Array,Date:Date,Function:Function,Number:Number,RegExp:RegExp,String:String};for(var j in a){new Native({name:j,initialize:a[j],protect:true});}var d={"boolean":Boolean,"native":Native,object:Object};for(var c in d){Native.typize(d[c],c);}var h={Array:["concat","indexOf","join","lastIndexOf","pop","push","reverse","shift","slice","sort","splice","toString","unshift","valueOf"],String:["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","replace","search","slice","split","substr","substring","toLowerCase","toUpperCase","valueOf"]};for(var f in h){for(var b=h[f].length;b--;){Native.genericize(a[f],h[f][b],true);}}})();var Hash=new Native({name:"Hash",initialize:function(a){if($type(a)=="hash"){a=$unlink(a.getClean());}for(var b in a){this[b]=a[b];}return this;}});Hash.implement({forEach:function(b,c){for(var a in this){if(this.hasOwnProperty(a)){b.call(c,this[a],a,this);}}},getClean:function(){var b={};for(var a in this){if(this.hasOwnProperty(a)){b[a]=this[a];}}return b;},getLength:function(){var b=0;for(var a in this){if(this.hasOwnProperty(a)){b++;}}return b;}});Hash.alias("forEach","each");Array.implement({forEach:function(c,d){for(var b=0,a=this.length;b<a;b++){c.call(d,this[b],b,this);}}});Array.alias("forEach","each");function $A(b){if(b.item){var a=b.length,c=new Array(a);while(a--){c[a]=b[a];}return c;}return Array.prototype.slice.call(b);}function $arguments(a){return function(){return arguments[a];};}function $chk(a){return !!(a||a===0);}function $clear(a){clearTimeout(a);clearInterval(a);return null;}function $defined(a){return(a!=undefined);}function $each(c,b,d){var a=$type(c);((a=="arguments"||a=="collection"||a=="array")?Array:Hash).each(c,b,d);}function $empty(){}function $extend(c,a){for(var b in (a||{})){c[b]=a[b];}return c;}function $H(a){return new Hash(a);}function $lambda(a){return($type(a)=="function")?a:function(){return a;};}function $merge(){var a=Array.slice(arguments);a.unshift({});return $mixin.apply(null,a);}function $mixin(f){for(var d=1,a=arguments.length;d<a;d++){var b=arguments[d];if($type(b)!="object"){continue;}for(var c in b){var h=b[c],g=f[c];f[c]=(g&&$type(h)=="object"&&$type(g)=="object")?$mixin(g,h):$unlink(h);}}return f;}function $pick(){for(var b=0,a=arguments.length;b<a;b++){if(arguments[b]!=undefined){return arguments[b];}}return null;}function $random(b,a){return Math.floor(Math.random()*(a-b+1)+b);}function $splat(b){var a=$type(b);return(a)?((a!="array"&&a!="arguments")?[b]:b):[];}var $time=Date.now||function(){return +new Date;};function $try(){for(var b=0,a=arguments.length;b<a;b++){try{return arguments[b]();}catch(c){}}return null;}function $type(a){if(a==undefined){return false;}if(a.$family){return(a.$family.name=="number"&&!isFinite(a))?false:a.$family.name;}if(a.nodeName){switch(a.nodeType){case 1:return"element";case 3:return(/\S/).test(a.nodeValue)?"textnode":"whitespace";}}else{if(typeof a.length=="number"){if(a.callee){return"arguments";}else{if(a.item){return"collection";}}}}return typeof a;}function $unlink(c){var b;switch($type(c)){case"object":b={};for(var f in c){b[f]=$unlink(c[f]);}break;case"hash":b=new Hash(c);break;case"array":b=[];for(var d=0,a=c.length;d<a;d++){b[d]=$unlink(c[d]);}break;default:return c;}return b;}var Browser=$merge({Engine:{name:"unknown",version:0},Platform:{name:(window.orientation!=undefined)?"ipod":(navigator.platform.match(/mac|win|linux/i)||["other"])[0].toLowerCase()},Features:{xpath:!!(document.evaluate),air:!!(window.runtime),query:!!(document.querySelector)},Plugins:{},Engines:{presto:function(){return(!window.opera)?false:((arguments.callee.caller)?960:((document.getElementsByClassName)?950:925));},trident:function(){return(!window.ActiveXObject)?false:((window.XMLHttpRequest)?((document.querySelectorAll)?6:5):4);},webkit:function(){return(navigator.taintEnabled)?false:((Browser.Features.xpath)?((Browser.Features.query)?525:420):419);},gecko:function(){return(!document.getBoxObjectFor&&window.mozInnerScreenX==null)?false:((document.getElementsByClassName)?19:18);}}},Browser||{});Browser.Platform[Browser.Platform.name]=true;Browser.detect=function(){for(var b in this.Engines){var a=this.Engines[b]();if(a){this.Engine={name:b,version:a};this.Engine[b]=this.Engine[b+a]=true;break;}}return{name:b,version:a};};Browser.detect();Browser.Request=function(){return $try(function(){return new XMLHttpRequest();},function(){return new ActiveXObject("MSXML2.XMLHTTP");},function(){return new ActiveXObject("Microsoft.XMLHTTP");});};Browser.Features.xhr=!!(Browser.Request());Browser.Plugins.Flash=(function(){var a=($try(function(){return navigator.plugins["Shockwave Flash"].description;},function(){return new ActiveXObject("ShockwaveFlash.ShockwaveFlash").GetVariable("$version");})||"0 r0").match(/\d+/g);return{version:parseInt(a[0]||0+"."+a[1],10)||0,build:parseInt(a[2],10)||0};})();function $exec(b){if(!b){return b;}if(window.execScript){window.execScript(b);}else{var a=document.createElement("script");a.setAttribute("type","text/javascript");a[(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerText":"text"]=b;document.head.appendChild(a);document.head.removeChild(a);}return b;}Native.UID=1;var $uid=(Browser.Engine.trident)?function(a){return(a.uid||(a.uid=[Native.UID++]))[0];}:function(a){return a.uid||(a.uid=Native.UID++);};var Window=new Native({name:"Window",legacy:(Browser.Engine.trident)?null:window.Window,initialize:function(a){$uid(a);if(!a.Element){a.Element=$empty;if(Browser.Engine.webkit){a.document.createElement("iframe");}a.Element.prototype=(Browser.Engine.webkit)?window["[[DOMElement.prototype]]"]:{};}a.document.window=a;return $extend(a,Window.Prototype);},afterImplement:function(b,a){window[b]=Window.Prototype[b]=a;}});Window.Prototype={$family:{name:"window"}};new Window(window);var Document=new Native({name:"Document",legacy:(Browser.Engine.trident)?null:window.Document,initialize:function(a){$uid(a);a.head=a.getElementsByTagName("head")[0];a.html=a.getElementsByTagName("html")[0];if(Browser.Engine.trident&&Browser.Engine.version<=4){$try(function(){a.execCommand("BackgroundImageCache",false,true);});}if(Browser.Engine.trident){a.window.attachEvent("onunload",function(){a.window.detachEvent("onunload",arguments.callee);a.head=a.html=a.window=null;});}return $extend(a,Document.Prototype);},afterImplement:function(b,a){document[b]=Document.Prototype[b]=a;}});Document.Prototype={$family:{name:"document"}};new Document(document);Array.implement({every:function(c,d){for(var b=0,a=this.length;b<a;b++){if(!c.call(d,this[b],b,this)){return false;}}return true;},filter:function(d,f){var c=[];for(var b=0,a=this.length;b<a;b++){if(d.call(f,this[b],b,this)){c.push(this[b]);}}return c;},clean:function(){return this.filter($defined);},indexOf:function(c,d){var a=this.length;for(var b=(d<0)?Math.max(0,a+d):d||0;b<a;b++){if(this[b]===c){return b;}}return -1;},map:function(d,f){var c=[];for(var b=0,a=this.length;b<a;b++){c[b]=d.call(f,this[b],b,this);}return c;},some:function(c,d){for(var b=0,a=this.length;b<a;b++){if(c.call(d,this[b],b,this)){return true;}}return false;},associate:function(c){var d={},b=Math.min(this.length,c.length);for(var a=0;a<b;a++){d[c[a]]=this[a];}return d;},link:function(c){var a={};for(var f=0,b=this.length;f<b;f++){for(var d in c){if(c[d](this[f])){a[d]=this[f];delete c[d];break;}}}return a;},contains:function(a,b){return this.indexOf(a,b)!=-1;},extend:function(c){for(var b=0,a=c.length;b<a;b++){this.push(c[b]);}return this;},getLast:function(){return(this.length)?this[this.length-1]:null;},getRandom:function(){return(this.length)?this[$random(0,this.length-1)]:null;},include:function(a){if(!this.contains(a)){this.push(a);}return this;},combine:function(c){for(var b=0,a=c.length;b<a;b++){this.include(c[b]);}return this;},erase:function(b){for(var a=this.length;a--;a){if(this[a]===b){this.splice(a,1);}}return this;},empty:function(){this.length=0;return this;},flatten:function(){var d=[];for(var b=0,a=this.length;b<a;b++){var c=$type(this[b]);if(!c){continue;}d=d.concat((c=="array"||c=="collection"||c=="arguments")?Array.flatten(this[b]):this[b]);}return d;},hexToRgb:function(b){if(this.length!=3){return null;}var a=this.map(function(c){if(c.length==1){c+=c;}return c.toInt(16);});return(b)?a:"rgb("+a+")";},rgbToHex:function(d){if(this.length<3){return null;}if(this.length==4&&this[3]==0&&!d){return"transparent";}var b=[];for(var a=0;a<3;a++){var c=(this[a]-0).toString(16);b.push((c.length==1)?"0"+c:c);}return(d)?b:"#"+b.join("");}});try{delete Function.prototype.bind;}catch(e){}Function.implement({extend:function(a){for(var b in a){this[b]=a[b];}return this;},create:function(b){var a=this;b=b||{};return function(d){var c=b.arguments;c=(c!=undefined)?$splat(c):Array.slice(arguments,(b.event)?1:0);if(b.event){c=[d||window.event].extend(c);}var f=function(){return a.apply(b.bind||null,c);};if(b.delay){return setTimeout(f,b.delay);}if(b.periodical){return setInterval(f,b.periodical);}if(b.attempt){return $try(f);}return f();};},run:function(a,b){return this.apply(b,$splat(a));},pass:function(a,b){return this.create({bind:b,arguments:a});},bind:function(b,a){return this.create({bind:b,arguments:a});},bindWithEvent:function(b,a){return this.create({bind:b,arguments:a,event:true});},attempt:function(a,b){return this.create({bind:b,arguments:a,attempt:true})();},delay:function(b,c,a){return this.create({bind:c,arguments:a,delay:b})();},periodical:function(c,b,a){return this.create({bind:b,arguments:a,periodical:c})();}});Number.implement({limit:function(b,a){return Math.min(a,Math.max(b,this));},round:function(a){a=Math.pow(10,a||0);return Math.round(this*a)/a;},times:function(b,c){for(var a=0;a<this;a++){b.call(c,a,this);}},toFloat:function(){return parseFloat(this);},toInt:function(a){return parseInt(this,a||10);}});Number.alias("times","each");(function(b){var a={};b.each(function(c){if(!Number[c]){a[c]=function(){return Math[c].apply(null,[this].concat($A(arguments)));};}});Number.implement(a);})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);String.implement({test:function(a,b){return((typeof a=="string")?new RegExp(a,b):a).test(this);},contains:function(a,b){return(b)?(b+this+b).indexOf(b+a+b)>-1:this.indexOf(a)>-1;},trim:function(){return this.replace(/^\s+|\s+$/g,"");},clean:function(){return this.replace(/\s+/g," ").trim();},camelCase:function(){return this.replace(/-\D/g,function(a){return a.charAt(1).toUpperCase();});},hyphenate:function(){return this.replace(/[A-Z]/g,function(a){return("-"+a.charAt(0).toLowerCase());});},capitalize:function(){return this.replace(/\b[a-z]/g,function(a){return a.toUpperCase();});},escapeRegExp:function(){return this.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1");},toInt:function(a){return parseInt(this,a||10);},toFloat:function(){return parseFloat(this);},hexToRgb:function(b){var a=this.match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return(a)?a.slice(1).hexToRgb(b):null;},rgbToHex:function(b){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHex(b):null;},stripScripts:function(b){var a="";var c=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(){a+=arguments[1]+"\n";return"";});if(b===true){$exec(a);}else{if($type(b)=="function"){b(a,c);}}return c;},substitute:function(a,b){return this.replace(b||(/\\?\{([^{}]+)\}/g),function(d,c){if(d.charAt(0)=="\\"){return d.slice(1);}return(a[c]!=undefined)?a[c]:"";});}});Hash.implement({has:Object.prototype.hasOwnProperty,keyOf:function(b){for(var a in this){if(this.hasOwnProperty(a)&&this[a]===b){return a;}}return null;},hasValue:function(a){return(Hash.keyOf(this,a)!==null);},extend:function(a){Hash.each(a||{},function(c,b){Hash.set(this,b,c);},this);return this;},combine:function(a){Hash.each(a||{},function(c,b){Hash.include(this,b,c);},this);return this;},erase:function(a){if(this.hasOwnProperty(a)){delete this[a];}return this;},get:function(a){return(this.hasOwnProperty(a))?this[a]:null;},set:function(a,b){if(!this[a]||this.hasOwnProperty(a)){this[a]=b;}return this;},empty:function(){Hash.each(this,function(b,a){delete this[a];},this);return this;},include:function(a,b){if(this[a]==undefined){this[a]=b;}return this;},map:function(b,c){var a=new Hash;Hash.each(this,function(f,d){a.set(d,b.call(c,f,d,this));},this);return a;},filter:function(b,c){var a=new Hash;Hash.each(this,function(f,d){if(b.call(c,f,d,this)){a.set(d,f);}},this);return a;},every:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&!b.call(c,this[a],a)){return false;}}return true;},some:function(b,c){for(var a in this){if(this.hasOwnProperty(a)&&b.call(c,this[a],a)){return true;}}return false;},getKeys:function(){var a=[];Hash.each(this,function(c,b){a.push(b);});return a;},getValues:function(){var a=[];Hash.each(this,function(b){a.push(b);});return a;},toQueryString:function(a){var b=[];Hash.each(this,function(g,f){if(a){f=a+"["+f+"]";}var d;switch($type(g)){case"object":d=Hash.toQueryString(g,f);break;case"array":var c={};g.each(function(j,h){c[h]=j;});d=Hash.toQueryString(c,f);break;default:d=f+"="+encodeURIComponent(g);}if(g!=undefined){b.push(d);}});return b.join("&");}});Hash.alias({keyOf:"indexOf",hasValue:"contains"});var Event=new Native({name:"Event",initialize:function(a,g){g=g||window;var l=g.document;a=a||g.event;if(a.$extended){return a;}this.$extended=true;var k=a.type;var h=a.target||a.srcElement;while(h&&h.nodeType==3){h=h.parentNode;}if(k.test(/key/)){var b=a.which||a.keyCode;var n=Event.Keys.keyOf(b);if(k=="keydown"){var d=b-111;if(d>0&&d<13){n="f"+d;}}n=n||String.fromCharCode(b).toLowerCase();}else{if(k.match(/(click|mouse|menu)/i)){l=(!l.compatMode||l.compatMode=="CSS1Compat")?l.html:l.body;var j={x:a.pageX||a.clientX+l.scrollLeft,y:a.pageY||a.clientY+l.scrollTop};var c={x:(a.pageX)?a.pageX-g.pageXOffset:a.clientX,y:(a.pageY)?a.pageY-g.pageYOffset:a.clientY};if(k.match(/DOMMouseScroll|mousewheel/)){var i=(a.wheelDelta)?a.wheelDelta/120:-(a.detail||0)/3;}var f=(a.which==3)||(a.button==2);var m=null;if(k.match(/over|out/)){switch(k){case"mouseover":m=a.relatedTarget||a.fromElement;break;case"mouseout":m=a.relatedTarget||a.toElement;}if(!(function(){while(m&&m.nodeType==3){m=m.parentNode;}return true;}).create({attempt:Browser.Engine.gecko})()){m=false;}}}}return $extend(this,{event:a,type:k,page:j,client:c,rightClick:f,wheel:i,relatedTarget:m,target:h,code:b,key:n,shift:a.shiftKey,control:a.ctrlKey,alt:a.altKey,meta:a.metaKey});}});Event.Keys=new Hash({enter:13,up:38,down:40,left:37,right:39,esc:27,space:32,backspace:8,tab:9,"delete":46});Event.implement({stop:function(){return this.stopPropagation().preventDefault();},stopPropagation:function(){if(this.event.stopPropagation){this.event.stopPropagation();}else{this.event.cancelBubble=true;}return this;},preventDefault:function(){if(this.event.preventDefault){this.event.preventDefault();}else{this.event.returnValue=false;}return this;}});function Class(b){if(b instanceof Function){b={initialize:b};}var a=function(){Object.reset(this);if(a._prototyping){return this;}this._current=$empty;var c=(this.initialize)?this.initialize.apply(this,arguments):this;delete this._current;delete this.caller;return c;}.extend(this);a.implement(b);a.constructor=Class;a.prototype.constructor=a;return a;}Function.prototype.protect=function(){this._protected=true;return this;};Object.reset=function(a,c){if(c==null){for(var f in a){Object.reset(a,f);}return a;}delete a[c];switch($type(a[c])){case"object":var d=function(){};d.prototype=a[c];var b=new d;a[c]=Object.reset(b);break;case"array":a[c]=$unlink(a[c]);break;}return a;};new Native({name:"Class",initialize:Class}).extend({instantiate:function(b){b._prototyping=true;var a=new b;delete b._prototyping;return a;},wrap:function(a,b,c){if(c._origin){c=c._origin;}return function(){if(c._protected&&this._current==null){throw new Error('The method "'+b+'" cannot be called.');}var f=this.caller,g=this._current;this.caller=g;this._current=arguments.callee;var d=c.apply(this,arguments);this._current=g;this.caller=f;return d;}.extend({_owner:a,_origin:c,_name:b});}});Class.implement({implement:function(a,d){if($type(a)=="object"){for(var f in a){this.implement(f,a[f]);}return this;}var g=Class.Mutators[a];if(g){d=g.call(this,d);if(d==null){return this;}}var c=this.prototype;switch($type(d)){case"function":if(d._hidden){return this;}c[a]=Class.wrap(this,a,d);break;case"object":var b=c[a];if($type(b)=="object"){$mixin(b,d);}else{c[a]=$unlink(d);}break;case"array":c[a]=$unlink(d);break;default:c[a]=d;}return this;}});Class.Mutators={Extends:function(a){this.parent=a;this.prototype=Class.instantiate(a);this.implement("parent",function(){var b=this.caller._name,c=this.caller._owner.parent.prototype[b];if(!c){throw new Error('The method "'+b+'" has no parent.');}return c.apply(this,arguments);}.protect());},Implements:function(a){$splat(a).each(function(b){if(b instanceof Function){b=Class.instantiate(b);}this.implement(b);},this);}};var Chain=new Class({$chain:[],chain:function(){this.$chain.extend(Array.flatten(arguments));return this;},callChain:function(){return(this.$chain.length)?this.$chain.shift().apply(this,arguments):false;},clearChain:function(){this.$chain.empty();return this;}});var Events=new Class({$events:{},addEvent:function(c,b,a){c=Events.removeOn(c);if(b!=$empty){this.$events[c]=this.$events[c]||[];this.$events[c].include(b);if(a){b.internal=true;}}return this;},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);}return this;},fireEvent:function(c,b,a){c=Events.removeOn(c);if(!this.$events||!this.$events[c]){return this;}this.$events[c].each(function(d){d.create({bind:this,delay:a,"arguments":b})();},this);return this;},removeEvent:function(b,a){b=Events.removeOn(b);if(!this.$events[b]){return this;}if(!a.internal){this.$events[b].erase(a);}return this;},removeEvents:function(c){var d;if($type(c)=="object"){for(d in c){this.removeEvent(d,c[d]);}return this;}if(c){c=Events.removeOn(c);}for(d in this.$events){if(c&&c!=d){continue;}var b=this.$events[d];for(var a=b.length;a--;a){this.removeEvent(d,b[a]);}}return this;}});Events.removeOn=function(a){return a.replace(/^on([A-Z])/,function(b,c){return c.toLowerCase();});};var Options=new Class({setOptions:function(){this.options=$merge.run([this.options].extend(arguments));if(!this.addEvent){return this;}for(var a in this.options){if($type(this.options[a])!="function"||!(/^on[A-Z]/).test(a)){continue;}this.addEvent(a,this.options[a]);delete this.options[a];}return this;}});var Element=new Native({name:"Element",legacy:window.Element,initialize:function(a,b){var c=Element.Constructors.get(a);if(c){return c(b);}if(typeof a=="string"){return document.newElement(a,b);}return document.id(a).set(b);},afterImplement:function(a,b){Element.Prototype[a]=b;if(Array[a]){return;}Elements.implement(a,function(){var c=[],h=true;for(var f=0,d=this.length;f<d;f++){var g=this[f][a].apply(this[f],arguments);c.push(g);if(h){h=($type(g)=="element");}}return(h)?new Elements(c):c;});}});Element.Prototype={$family:{name:"element"}};Element.Constructors=new Hash;var IFrame=new Native({name:"IFrame",generics:false,initialize:function(){var g=Array.link(arguments,{properties:Object.type,iframe:$defined});var d=g.properties||{};var c=document.id(g.iframe);var f=d.onload||$empty;delete d.onload;d.id=d.name=$pick(d.id,d.name,c?(c.id||c.name):"IFrame_"+$time());c=new Element(c||"iframe",d);var b=function(){var h=$try(function(){return c.contentWindow.location.host;});if(!h||h==window.location.host){var i=new Window(c.contentWindow);new Document(c.contentWindow.document);$extend(i.Element.prototype,Element.Prototype);}f.call(c.contentWindow,c.contentWindow.document);};var a=$try(function(){return c.contentWindow;});((a&&a.document.body)||window.frames[d.id])?b():c.addListener("load",b);return c;}});var Elements=new Native({initialize:function(g,b){b=$extend({ddup:true,cash:true},b);g=g||[];if(b.ddup||b.cash){var h={},f=[];for(var c=0,a=g.length;c<a;c++){var d=document.id(g[c],!b.cash);if(b.ddup){if(h[d.uid]){continue;}h[d.uid]=true;}if(d){f.push(d);}}g=f;}return(b.cash)?$extend(g,this):g;}});Elements.implement({filter:function(a,b){if(!a){return this;}return new Elements(Array.filter(this,(typeof a=="string")?function(c){return c.match(a);}:a,b));}});(function(){var d;try{var a=document.createElement("<input name=x>");d=(a.name=="x");}catch(b){}var c=function(f){return(""+f).replace(/&/g,"&amp;").replace(/"/g,"&quot;");};Document.implement({newElement:function(f,g){if(g&&g.checked!=null){g.defaultChecked=g.checked;}if(d&&g){f="<"+f;if(g.name){f+=' name="'+c(g.name)+'"';}if(g.type){f+=' type="'+c(g.type)+'"';}f+=">";delete g.name;delete g.type;}return this.id(this.createElement(f)).set(g);},newTextNode:function(f){return this.createTextNode(f);},getDocument:function(){return this;},getWindow:function(){return this.window;},id:(function(){var f={string:function(i,h,g){i=g.getElementById(i);return(i)?f.element(i,h):null;},element:function(g,j){$uid(g);if(!j&&!g.$family&&!(/^object|embed$/i).test(g.tagName)){var h=Element.Prototype;for(var i in h){g[i]=h[i];}}return g;},object:function(h,i,g){if(h.toElement){return f.element(h.toElement(g),i);}return null;}};f.textnode=f.whitespace=f.window=f.document=$arguments(0);return function(h,j,i){if(h&&h.$family&&h.uid){return h;}var g=$type(h);return(f[g])?f[g](h,j,i||document):null;};})()});})();if(window.$==null){Window.implement({$:function(a,b){return document.id(a,b,this.document);}});}Window.implement({$$:function(a){if(arguments.length==1&&typeof a=="string"){return this.document.getElements(a);}var g=[];var c=Array.flatten(arguments);for(var d=0,b=c.length;d<b;d++){var f=c[d];switch($type(f)){case"element":g.push(f);break;case"string":g.extend(this.document.getElements(f,true));}}return new Elements(g);},getDocument:function(){return this.document;},getWindow:function(){return this;}});Native.implement([Element,Document],{getElement:function(a,b){return document.id(this.getElements(a,true)[0]||null,b);},getElements:function(a,d){a=a.split(",");var c=[];var b=(a.length>1);a.each(function(f){var g=this.getElementsByTagName(f.trim());(b)?c.extend(g):c=g;},this);return new Elements(c,{ddup:b,cash:!d});}});(function(){var i={},g={};var j={input:"checked",option:"selected",textarea:(Browser.Engine.webkit&&Browser.Engine.version<420)?"innerHTML":"value"};var c=function(m){return(g[m]||(g[m]={}));};var h=function(o,m){if(!o){return;}var n=o.uid;if(m!==true){m=false;}if(Browser.Engine.trident){if(o.clearAttributes){var r=m&&o.cloneNode(false);o.clearAttributes();if(r){o.mergeAttributes(r);}}else{if(o.removeEvents){o.removeEvents();}}if((/object/i).test(o.tagName)){for(var q in o){if(typeof o[q]=="function"){o[q]=$empty;}}Element.dispose(o);}}if(!n){return;}i[n]=g[n]=null;};var d=function(){Hash.each(i,h);if(Browser.Engine.trident){$A(document.getElementsByTagName("object")).each(h);}if(window.CollectGarbage){CollectGarbage();}i=g=null;};var k=function(o,m,t,n,q,s){var p=o[t||m];var r=[];while(p){if(p.nodeType==1&&(!n||Element.match(p,n))){if(!q){return document.id(p,s);}r.push(p);}p=p[m];}return(q)?new Elements(r,{ddup:false,cash:!s}):null;};var f={html:"innerHTML","class":"className","for":"htmlFor",defaultValue:"defaultValue",text:(Browser.Engine.trident||(Browser.Engine.webkit&&Browser.Engine.version<420))?"innerText":"textContent"};var b=["compact","nowrap","ismap","declare","noshade","checked","disabled","readonly","multiple","selected","noresize","defer"];var l=["value","type","defaultValue","accessKey","cellPadding","cellSpacing","colSpan","frameBorder","maxLength","readOnly","rowSpan","tabIndex","useMap"];b=b.associate(b);Hash.extend(f,b);Hash.extend(f,l.associate(l.map(String.toLowerCase)));var a={before:function(n,m){if(m.parentNode){m.parentNode.insertBefore(n,m);}},after:function(n,m){if(!m.parentNode){return;}var o=m.nextSibling;(o)?m.parentNode.insertBefore(n,o):m.parentNode.appendChild(n);},bottom:function(n,m){m.appendChild(n);},top:function(n,m){var o=m.firstChild;(o)?m.insertBefore(n,o):m.appendChild(n);}};a.inside=a.bottom;Hash.each(a,function(m,n){n=n.capitalize();Element.implement("inject"+n,function(o){m(this,document.id(o,true));return this;});Element.implement("grab"+n,function(o){m(document.id(o,true),this);return this;});});Element.implement({set:function(q,n){switch($type(q)){case"object":for(var o in q){this.set(o,q[o]);}break;case"string":var m=Element.Properties.get(q);(m&&m.set)?m.set.apply(this,Array.slice(arguments,1)):this.setProperty(q,n);}return this;},get:function(n){var m=Element.Properties.get(n);return(m&&m.get)?m.get.apply(this,Array.slice(arguments,1)):this.getProperty(n);},erase:function(n){var m=Element.Properties.get(n);(m&&m.erase)?m.erase.apply(this):this.removeProperty(n);return this;},setProperty:function(n,o){var m=f[n];if(o==undefined){return this.removeProperty(n);}if(m&&b[n]){o=!!o;}(m)?this[m]=o:this.setAttribute(n,""+o);return this;},setProperties:function(m){for(var n in m){this.setProperty(n,m[n]);}return this;},getProperty:function(n){var m=f[n];var o=(m)?this[m]:this.getAttribute(n,2);return(b[n])?!!o:(m)?o:o||null;},getProperties:function(){var m=$A(arguments);return m.map(this.getProperty,this).associate(m);},removeProperty:function(n){var m=f[n];(m)?this[m]=(m&&b[n])?false:"":this.removeAttribute(n);return this;},removeProperties:function(){Array.each(arguments,this.removeProperty,this);return this;},hasClass:function(m){return this.className.contains(m," ");},addClass:function(m){if(!this.hasClass(m)){this.className=(this.className+" "+m).clean();}return this;},removeClass:function(m){this.className=this.className.replace(new RegExp("(^|\\s)"+m+"(?:\\s|$)"),"$1");return this;},toggleClass:function(m){return this.hasClass(m)?this.removeClass(m):this.addClass(m);},adopt:function(){Array.flatten(arguments).each(function(m){m=document.id(m,true);if(m){this.appendChild(m);}},this);return this;},appendText:function(n,m){return this.grab(this.getDocument().newTextNode(n),m);},grab:function(n,m){a[m||"bottom"](document.id(n,true),this);return this;},inject:function(n,m){a[m||"bottom"](this,document.id(n,true));return this;},replaces:function(m){m=document.id(m,true);m.parentNode.replaceChild(this,m);return this;},wraps:function(n,m){n=document.id(n,true);return this.replaces(n).grab(n,m);},getPrevious:function(m,n){return k(this,"previousSibling",null,m,false,n);},getAllPrevious:function(m,n){return k(this,"previousSibling",null,m,true,n);},getNext:function(m,n){return k(this,"nextSibling",null,m,false,n);},getAllNext:function(m,n){return k(this,"nextSibling",null,m,true,n);},getFirst:function(m,n){return k(this,"nextSibling","firstChild",m,false,n);},getLast:function(m,n){return k(this,"previousSibling","lastChild",m,false,n);},getParent:function(m,n){return k(this,"parentNode",null,m,false,n);},getParents:function(m,n){return k(this,"parentNode",null,m,true,n);},getSiblings:function(m,n){return this.getParent().getChildren(m,n).erase(this);},getChildren:function(m,n){return k(this,"nextSibling","firstChild",m,true,n);},getWindow:function(){return this.ownerDocument.window;},getDocument:function(){return this.ownerDocument;},getElementById:function(p,o){var n=this.ownerDocument.getElementById(p);if(!n){return null;}for(var m=n.parentNode;m!=this;m=m.parentNode){if(!m){return null;}}return document.id(n,o);},getSelected:function(){return new Elements($A(this.options).filter(function(m){return m.selected;}));},getComputedStyle:function(n){if(this.currentStyle){return this.currentStyle[n.camelCase()];}var m=this.getDocument().defaultView.getComputedStyle(this,null);return(m)?m.getPropertyValue([n.hyphenate()]):null;},toQueryString:function(){var m=[];this.getElements("input, select, textarea",true).each(function(n){if(!n.name||n.disabled||n.type=="submit"||n.type=="reset"||n.type=="file"){return;}var o=(n.tagName.toLowerCase()=="select")?Element.getSelected(n).map(function(p){return p.value;}):((n.type=="radio"||n.type=="checkbox")&&!n.checked)?null:n.value;$splat(o).each(function(p){if(typeof p!="undefined"){m.push(n.name+"="+encodeURIComponent(p));}});});return m.join("&");},clone:function(p,m){p=p!==false;var s=this.cloneNode(p);var o=function(w,v){if(!m){w.removeAttribute("id");}if(Browser.Engine.trident){w.clearAttributes();w.mergeAttributes(v);w.removeAttribute("uid");if(w.options){var x=w.options,t=v.options;for(var u=x.length;u--;){x[u].selected=t[u].selected;}}}var y=j[v.tagName.toLowerCase()];if(y&&v[y]){w[y]=v[y];}};if(p){var q=s.getElementsByTagName("*"),r=this.getElementsByTagName("*");for(var n=q.length;n--;){o(q[n],r[n]);}}o(s,this);return document.id(s);},destroy:function(){Element.empty(this);Element.dispose(this);h(this,true);return null;},empty:function(){$A(this.childNodes).each(function(m){Element.destroy(m);});return this;},dispose:function(){return(this.parentNode)?this.parentNode.removeChild(this):this;},hasChild:function(m){m=document.id(m,true);if(!m){return false;}if(Browser.Engine.webkit&&Browser.Engine.version<420){return $A(this.getElementsByTagName(m.tagName)).contains(m);}return(this.contains)?(this!=m&&this.contains(m)):!!(this.compareDocumentPosition(m)&16);},match:function(m){return(!m||(m==this)||(Element.get(this,"tag")==m));}});Native.implement([Element,Window,Document],{addListener:function(p,o){if(p=="unload"){var m=o,n=this;o=function(){n.removeListener("unload",o);m();};}else{i[this.uid]=this;}if(this.addEventListener){this.addEventListener(p,o,false);}else{this.attachEvent("on"+p,o);}return this;},removeListener:function(n,m){if(this.removeEventListener){this.removeEventListener(n,m,false);}else{this.detachEvent("on"+n,m);}return this;},retrieve:function(n,m){var p=c(this.uid),o=p[n];if(m!=undefined&&o==undefined){o=p[n]=m;}return $pick(o);},store:function(n,m){var o=c(this.uid);o[n]=m;return this;},eliminate:function(m){var n=c(this.uid);delete n[m];return this;}});window.addListener("unload",d);})();Element.Properties=new Hash;Element.Properties.style={set:function(a){this.style.cssText=a;},get:function(){return this.style.cssText;},erase:function(){this.style.cssText="";}};Element.Properties.tag={get:function(){return this.tagName.toLowerCase();}};Element.Properties.html=(function(){var c=document.createElement("div");var a={table:[1,"<table>","</table>"],select:[1,"<select>","</select>"],tbody:[2,"<table><tbody>","</tbody></table>"],tr:[3,"<table><tbody><tr>","</tr></tbody></table>"]};a.thead=a.tfoot=a.tbody;var b={set:function(){var f=Array.flatten(arguments).join("");var g=Browser.Engine.trident&&a[this.get("tag")];if(g){var h=c;h.innerHTML=g[1]+f+g[2];for(var d=g[0];d--;){h=h.firstChild;}this.empty().adopt(h.childNodes);}else{this.innerHTML=f;}}};b.erase=b.set;return b;})();if(Browser.Engine.webkit&&Browser.Engine.version<420){Element.Properties.text={get:function(){if(this.innerText){return this.innerText;}var a=this.ownerDocument.newElement("div",{html:this.innerHTML}).inject(this.ownerDocument.body);var b=a.innerText;a.destroy();return b;}};}Element.Properties.events={set:function(a){this.addEvents(a);}};Native.implement([Element,Window,Document],{addEvent:function(f,h){var i=this.retrieve("events",{});i[f]=i[f]||{keys:[],values:[]};if(i[f].keys.contains(h)){return this;}i[f].keys.push(h);var g=f,a=Element.Events.get(f),c=h,j=this;if(a){if(a.onAdd){a.onAdd.call(this,h);}if(a.condition){c=function(k){if(a.condition.call(this,k)){return h.call(this,k);}return true;};}g=a.base||g;}var d=function(){return h.call(j);};var b=Element.NativeEvents[g];if(b){if(b==2){d=function(k){k=new Event(k,j.getWindow());if(c.call(j,k)===false){k.stop();}};}this.addListener(g,d);}i[f].values.push(d);return this;},removeEvent:function(c,b){var a=this.retrieve("events");if(!a||!a[c]){return this;}var g=a[c].keys.indexOf(b);if(g==-1){return this;}a[c].keys.splice(g,1);var f=a[c].values.splice(g,1)[0];var d=Element.Events.get(c);if(d){if(d.onRemove){d.onRemove.call(this,b);}c=d.base||c;}return(Element.NativeEvents[c])?this.removeListener(c,f):this;},addEvents:function(a){for(var b in a){this.addEvent(b,a[b]);}return this;},removeEvents:function(a){var c;if($type(a)=="object"){for(c in a){this.removeEvent(c,a[c]);}return this;}var b=this.retrieve("events");if(!b){return this;}if(!a){for(c in b){this.removeEvents(c);}this.eliminate("events");}else{if(b[a]){while(b[a].keys[0]){this.removeEvent(a,b[a].keys[0]);}b[a]=null;}}return this;},fireEvent:function(d,b,a){var c=this.retrieve("events");if(!c||!c[d]){return this;}c[d].keys.each(function(f){f.create({bind:this,delay:a,"arguments":b})();},this);return this;},cloneEvents:function(d,a){d=document.id(d);var c=d.retrieve("events");if(!c){return this;}if(!a){for(var b in c){this.cloneEvents(d,b);}}else{if(c[a]){c[a].keys.each(function(f){this.addEvent(a,f);},this);}}return this;}});try{if(typeof HTMLElement!="undefined"){HTMLElement.prototype.fireEvent=Element.prototype.fireEvent;}}catch(e){}Element.NativeEvents={click:2,dblclick:2,mouseup:2,mousedown:2,contextmenu:2,mousewheel:2,DOMMouseScroll:2,mouseover:2,mouseout:2,mousemove:2,selectstart:2,selectend:2,keydown:2,keypress:2,keyup:2,focus:2,blur:2,change:2,reset:2,select:2,submit:2,load:1,unload:1,beforeunload:2,resize:1,move:1,DOMContentLoaded:1,readystatechange:1,error:1,abort:1,scroll:1};(function(){var a=function(b){var c=b.relatedTarget;if(c==undefined){return true;}if(c===false){return false;}return($type(this)!="document"&&c!=this&&c.prefix!="xul"&&!this.hasChild(c));};Element.Events=new Hash({mouseenter:{base:"mouseover",condition:a},mouseleave:{base:"mouseout",condition:a},mousewheel:{base:(Browser.Engine.gecko)?"DOMMouseScroll":"mousewheel"}});})();Element.Properties.styles={set:function(a){this.setStyles(a);}};Element.Properties.opacity={set:function(a,b){if(!b){if(a==0){if(this.style.visibility!="hidden"){this.style.visibility="hidden";}}else{if(this.style.visibility!="visible"){this.style.visibility="visible";}}}if(!this.currentStyle||!this.currentStyle.hasLayout){this.style.zoom=1;}if(Browser.Engine.trident){this.style.filter=(a==1)?"":"alpha(opacity="+a*100+")";}this.style.opacity=a;this.store("opacity",a);},get:function(){return this.retrieve("opacity",1);}};Element.implement({setOpacity:function(a){return this.set("opacity",a,true);},getOpacity:function(){return this.get("opacity");},setStyle:function(b,a){switch(b){case"opacity":return this.set("opacity",parseFloat(a));case"float":b=(Browser.Engine.trident)?"styleFloat":"cssFloat";}b=b.camelCase();if($type(a)!="string"){var c=(Element.Styles.get(b)||"@").split(" ");a=$splat(a).map(function(f,d){if(!c[d]){return"";}return($type(f)=="number")?c[d].replace("@",Math.round(f)):f;}).join(" ");}else{if(a==String(Number(a))){a=Math.round(a);}}this.style[b]=a;return this;},getStyle:function(h){switch(h){case"opacity":return this.get("opacity");case"float":h=(Browser.Engine.trident)?"styleFloat":"cssFloat";}h=h.camelCase();var a=this.style[h];if(!$chk(a)){a=[];for(var g in Element.ShortStyles){if(h!=g){continue;}for(var f in Element.ShortStyles[g]){a.push(this.getStyle(f));}return a.join(" ");}a=this.getComputedStyle(h);}if(a){a=String(a);var c=a.match(/rgba?\([\d\s,]+\)/);if(c){a=a.replace(c[0],c[0].rgbToHex());}}if(Browser.Engine.presto||(Browser.Engine.trident&&!$chk(parseInt(a,10)))){if(h.test(/^(height|width)$/)){var b=(h=="width")?["left","right"]:["top","bottom"],d=0;b.each(function(i){d+=this.getStyle("border-"+i+"-width").toInt()+this.getStyle("padding-"+i).toInt();},this);return this["offset"+h.capitalize()]-d+"px";}if((Browser.Engine.presto)&&String(a).test("px")){return a;}if(h.test(/(border(.+)Width|margin|padding)/)){return"0px";}}return a;},setStyles:function(b){for(var a in b){this.setStyle(a,b[a]);}return this;},getStyles:function(){var a={};Array.flatten(arguments).each(function(b){a[b]=this.getStyle(b);},this);return a;}});Element.Styles=new Hash({left:"@px",top:"@px",bottom:"@px",right:"@px",width:"@px",height:"@px",maxWidth:"@px",maxHeight:"@px",minWidth:"@px",minHeight:"@px",backgroundColor:"rgb(@, @, @)",backgroundPosition:"@px @px",color:"rgb(@, @, @)",fontSize:"@px",letterSpacing:"@px",lineHeight:"@px",clip:"rect(@px @px @px @px)",margin:"@px @px @px @px",padding:"@px @px @px @px",border:"@px @ rgb(@, @, @) @px @ rgb(@, @, @) @px @ rgb(@, @, @)",borderWidth:"@px @px @px @px",borderStyle:"@ @ @ @",borderColor:"rgb(@, @, @) rgb(@, @, @) rgb(@, @, @) rgb(@, @, @)",zIndex:"@",zoom:"@",fontWeight:"@",textIndent:"@px",opacity:"@"});Element.ShortStyles={margin:{},padding:{},border:{},borderWidth:{},borderStyle:{},borderColor:{}};["Top","Right","Bottom","Left"].each(function(h){var g=Element.ShortStyles;var b=Element.Styles;["margin","padding"].each(function(i){var j=i+h;g[i][j]=b[j]="@px";});var f="border"+h;g.border[f]=b[f]="@px @ rgb(@, @, @)";var d=f+"Width",a=f+"Style",c=f+"Color";g[f]={};g.borderWidth[d]=g[f][d]=b[d]="@px";g.borderStyle[a]=g[f][a]=b[a]="@";g.borderColor[c]=g[f][c]=b[c]="rgb(@, @, @)";});(function(){Element.implement({scrollTo:function(i,j){if(b(this)){this.getWindow().scrollTo(i,j);}else{this.scrollLeft=i;this.scrollTop=j;}return this;},getSize:function(){if(b(this)){return this.getWindow().getSize();}return{x:this.offsetWidth,y:this.offsetHeight};},getScrollSize:function(){if(b(this)){return this.getWindow().getScrollSize();}return{x:this.scrollWidth,y:this.scrollHeight};},getScroll:function(){if(b(this)){return this.getWindow().getScroll();}return{x:this.scrollLeft,y:this.scrollTop};},getScrolls:function(){var j=this,i={x:0,y:0};while(j&&!b(j)){i.x+=j.scrollLeft;i.y+=j.scrollTop;j=j.parentNode;}return i;},getOffsetParent:function(){var i=this;if(b(i)){return null;}if(!Browser.Engine.trident){return i.offsetParent;}while((i=i.parentNode)&&!b(i)){if(d(i,"position")!="static"){return i;}}return null;},getOffsets:function(){if(this.getBoundingClientRect){var k=this.getBoundingClientRect(),n=document.id(this.getDocument().documentElement),q=n.getScroll(),l=this.getScrolls(),j=this.getScroll(),i=(d(this,"position")=="fixed");return{x:k.left.toInt()+l.x-j.x+((i)?0:q.x)-n.clientLeft,y:k.top.toInt()+l.y-j.y+((i)?0:q.y)-n.clientTop};}var m=this,o={x:0,y:0};if(b(this)){return o;}while(m&&!b(m)){o.x+=m.offsetLeft;o.y+=m.offsetTop;if(Browser.Engine.gecko){if(!g(m)){o.x+=c(m);o.y+=h(m);}var p=m.parentNode;if(p&&d(p,"overflow")!="visible"){o.x+=c(p);o.y+=h(p);}}else{if(m!=this&&Browser.Engine.webkit){o.x+=c(m);o.y+=h(m);}}m=m.offsetParent;}if(Browser.Engine.gecko&&!g(this)){o.x-=c(this);o.y-=h(this);}return o;},getPosition:function(l){if(b(this)){return{x:0,y:0};}var m=this.getOffsets(),j=this.getScrolls();var i={x:m.x-j.x,y:m.y-j.y};var k=(l&&(l=document.id(l)))?l.getPosition():{x:0,y:0};return{x:i.x-k.x,y:i.y-k.y};},getCoordinates:function(k){if(b(this)){return this.getWindow().getCoordinates();}var i=this.getPosition(k),j=this.getSize();var l={left:i.x,top:i.y,width:j.x,height:j.y};l.right=l.left+l.width;l.bottom=l.top+l.height;return l;},computePosition:function(i){return{left:i.x-f(this,"margin-left"),top:i.y-f(this,"margin-top")};},setPosition:function(i){return this.setStyles(this.computePosition(i));}});Native.implement([Document,Window],{getSize:function(){if(Browser.Engine.presto||Browser.Engine.webkit){var j=this.getWindow();return{x:j.innerWidth,y:j.innerHeight};}var i=a(this);return{x:i.clientWidth,y:i.clientHeight};},getScroll:function(){var j=this.getWindow(),i=a(this);return{x:j.pageXOffset||i.scrollLeft,y:j.pageYOffset||i.scrollTop};},getScrollSize:function(){var j=a(this),i=this.getSize();return{x:Math.max(j.scrollWidth,i.x),y:Math.max(j.scrollHeight,i.y)};},getPosition:function(){return{x:0,y:0};},getCoordinates:function(){var i=this.getSize();return{top:0,left:0,bottom:i.y,right:i.x,height:i.y,width:i.x};}});var d=Element.getComputedStyle;function f(i,j){return d(i,j).toInt()||0;}function g(i){return d(i,"-moz-box-sizing")=="border-box";}function h(i){return f(i,"border-top-width");}function c(i){return f(i,"border-left-width");}function b(i){return(/^(?:body|html)$/i).test(i.tagName);}function a(i){var j=i.getDocument();return(!j.compatMode||j.compatMode=="CSS1Compat")?j.html:j.body;}})();Element.alias("setPosition","position");Native.implement([Window,Document,Element],{getHeight:function(){return this.getSize().y;},getWidth:function(){return this.getSize().x;},getScrollTop:function(){return this.getScroll().y;},getScrollLeft:function(){return this.getScroll().x;},getScrollHeight:function(){return this.getScrollSize().y;},getScrollWidth:function(){return this.getScrollSize().x;},getTop:function(){return this.getPosition().y;},getLeft:function(){return this.getPosition().x;}});Native.implement([Document,Element],{getElements:function(j,h){j=j.split(",");var c,f={};for(var d=0,b=j.length;d<b;d++){var a=j[d],g=Selectors.Utils.search(this,a,f);if(d!=0&&g.item){g=$A(g);}c=(d==0)?g:(c.item)?$A(c).concat(g):c.concat(g);}return new Elements(c,{ddup:(j.length>1),cash:!h});}});Element.implement({match:function(b){if(!b||(b==this)){return true;}var d=Selectors.Utils.parseTagAndID(b);var a=d[0],f=d[1];if(!Selectors.Filters.byID(this,f)||!Selectors.Filters.byTag(this,a)){return false;}var c=Selectors.Utils.parseSelector(b);return(c)?Selectors.Utils.filter(this,c,{}):true;}});var Selectors={Cache:{nth:{},parsed:{}}};Selectors.RegExps={id:(/#([\w-]+)/),tag:(/^(\w+|\*)/),quick:(/^(\w+|\*)$/),splitter:(/\s*([+>~\s])\s*([a-zA-Z#.*:\[])/g),combined:(/\.([\w-]+)|\[(\w+)(?:([!*^$~|]?=)(["']?)([^\4]*?)\4)?\]|:([\w-]+)(?:\(["']?(.*?)?["']?\)|$)/g)};Selectors.Utils={chk:function(b,c){if(!c){return true;}var a=$uid(b);if(!c[a]){return c[a]=true;}return false;},parseNthArgument:function(i){if(Selectors.Cache.nth[i]){return Selectors.Cache.nth[i];}var f=i.match(/^([+-]?\d*)?([a-z]+)?([+-]?\d*)?$/);if(!f){return false;}var h=parseInt(f[1],10);var d=(h||h===0)?h:1;var g=f[2]||false;var c=parseInt(f[3],10)||0;if(d!=0){c--;while(c<1){c+=d;}while(c>=d){c-=d;}}else{d=c;g="index";}switch(g){case"n":f={a:d,b:c,special:"n"};break;case"odd":f={a:2,b:0,special:"n"};break;case"even":f={a:2,b:1,special:"n"};break;case"first":f={a:0,special:"index"};break;case"last":f={special:"last-child"};break;case"only":f={special:"only-child"};break;default:f={a:(d-1),special:"index"};}return Selectors.Cache.nth[i]=f;},parseSelector:function(f){if(Selectors.Cache.parsed[f]){return Selectors.Cache.parsed[f];}var d,i={classes:[],pseudos:[],attributes:[]};while((d=Selectors.RegExps.combined.exec(f))){var j=d[1],h=d[2],g=d[3],b=d[5],c=d[6],k=d[7];if(j){i.classes.push(j);}else{if(c){var a=Selectors.Pseudo.get(c);if(a){i.pseudos.push({parser:a,argument:k});}else{i.attributes.push({name:c,operator:"=",value:k});}}else{if(h){i.attributes.push({name:h,operator:g,value:b});}}}}if(!i.classes.length){delete i.classes;}if(!i.attributes.length){delete i.attributes;}if(!i.pseudos.length){delete i.pseudos;}if(!i.classes&&!i.attributes&&!i.pseudos){i=null;}return Selectors.Cache.parsed[f]=i;},parseTagAndID:function(b){var a=b.match(Selectors.RegExps.tag);var c=b.match(Selectors.RegExps.id);return[(a)?a[1]:"*",(c)?c[1]:false];},filter:function(g,c,f){var d;if(c.classes){for(d=c.classes.length;d--;d){var h=c.classes[d];if(!Selectors.Filters.byClass(g,h)){return false;}}}if(c.attributes){for(d=c.attributes.length;d--;d){var b=c.attributes[d];if(!Selectors.Filters.byAttribute(g,b.name,b.operator,b.value)){return false;}}}if(c.pseudos){for(d=c.pseudos.length;d--;d){var a=c.pseudos[d];if(!Selectors.Filters.byPseudo(g,a.parser,a.argument,f)){return false;}}}return true;},getByTagAndID:function(b,a,d){if(d){var c=(b.getElementById)?b.getElementById(d,true):Element.getElementById(b,d,true);return(c&&Selectors.Filters.byTag(c,a))?[c]:[];}else{return b.getElementsByTagName(a);}},search:function(p,o,u){var b=[];var c=o.trim().replace(Selectors.RegExps.splitter,function(k,j,i){b.push(j);return":)"+i;}).split(":)");var q,f,B;for(var A=0,w=c.length;A<w;A++){var z=c[A];if(A==0&&Selectors.RegExps.quick.test(z)){q=p.getElementsByTagName(z);continue;}var a=b[A-1];var r=Selectors.Utils.parseTagAndID(z);var C=r[0],s=r[1];if(A==0){q=Selectors.Utils.getByTagAndID(p,C,s);}else{var d={},h=[];for(var y=0,x=q.length;y<x;y++){h=Selectors.Getters[a](h,q[y],C,s,d);}q=h;}var g=Selectors.Utils.parseSelector(z);if(g){f=[];for(var v=0,t=q.length;v<t;v++){B=q[v];if(Selectors.Utils.filter(B,g,u)){f.push(B);}}q=f;}}return q;}};Selectors.Getters={" ":function(j,h,k,a,f){var d=Selectors.Utils.getByTagAndID(h,k,a);for(var c=0,b=d.length;c<b;c++){var g=d[c];if(Selectors.Utils.chk(g,f)){j.push(g);}}return j;},">":function(j,h,k,a,g){var c=Selectors.Utils.getByTagAndID(h,k,a);for(var f=0,d=c.length;f<d;f++){var b=c[f];if(b.parentNode==h&&Selectors.Utils.chk(b,g)){j.push(b);}}return j;},"+":function(c,b,a,f,d){while((b=b.nextSibling)){if(b.nodeType==1){if(Selectors.Utils.chk(b,d)&&Selectors.Filters.byTag(b,a)&&Selectors.Filters.byID(b,f)){c.push(b);}break;}}return c;},"~":function(c,b,a,f,d){while((b=b.nextSibling)){if(b.nodeType==1){if(!Selectors.Utils.chk(b,d)){break;}if(Selectors.Filters.byTag(b,a)&&Selectors.Filters.byID(b,f)){c.push(b);}}}return c;}};Selectors.Filters={byTag:function(b,a){return(a=="*"||(b.tagName&&b.tagName.toLowerCase()==a));},byID:function(a,b){return(!b||(a.id&&a.id==b));},byClass:function(b,a){return(b.className&&b.className.contains&&b.className.contains(a," "));},byPseudo:function(a,d,c,b){return d.call(a,c,b);},byAttribute:function(c,d,b,f){var a=Element.prototype.getProperty.call(c,d);if(!a){return(b=="!=");}if(!b||f==undefined){return true;}switch(b){case"=":return(a==f);case"*=":return(a.contains(f));case"^=":return(a.substr(0,f.length)==f);case"$=":return(a.substr(a.length-f.length)==f);case"!=":return(a!=f);case"~=":return a.contains(f," ");case"|=":return a.contains(f,"-");}return false;}};Selectors.Pseudo=new Hash({checked:function(){return this.checked;},empty:function(){return !(this.innerText||this.textContent||"").length;},not:function(a){return !Element.match(this,a);},contains:function(a){return(this.innerText||this.textContent||"").contains(a);},"first-child":function(){return Selectors.Pseudo.index.call(this,0);},"last-child":function(){var a=this;while((a=a.nextSibling)){if(a.nodeType==1){return false;}}return true;},"only-child":function(){var b=this;while((b=b.previousSibling)){if(b.nodeType==1){return false;}}var a=this;while((a=a.nextSibling)){if(a.nodeType==1){return false;}}return true;},"nth-child":function(h,f){h=(h==undefined)?"n":h;var c=Selectors.Utils.parseNthArgument(h);if(c.special!="n"){return Selectors.Pseudo[c.special].call(this,c.a,f);}var g=0;f.positions=f.positions||{};var d=$uid(this);if(!f.positions[d]){var b=this;while((b=b.previousSibling)){if(b.nodeType!=1){continue;}g++;var a=f.positions[$uid(b)];if(a!=undefined){g=a+g;break;}}f.positions[d]=g;}return(f.positions[d]%c.a==c.b);},index:function(a){var b=this,c=0;while((b=b.previousSibling)){if(b.nodeType==1&&++c>a){return false;}}return(c==a);},even:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n+1",a);},odd:function(b,a){return Selectors.Pseudo["nth-child"].call(this,"2n",a);},selected:function(){return this.selected;},enabled:function(){return(this.disabled===false);}});Element.Events.domready={onAdd:function(a){if(Browser.loaded){a.call(this);}}};(function(){var b=function(){if(Browser.loaded){return;}Browser.loaded=true;window.fireEvent("domready");document.fireEvent("domready");};window.addEvent("load",b);if(Browser.Engine.trident){var a=document.createElement("div");(function(){($try(function(){a.doScroll();return document.id(a).inject(document.body).set("html","temp").dispose();}))?b():arguments.callee.delay(50);})();}else{if(Browser.Engine.webkit&&Browser.Engine.version<525){(function(){(["loaded","complete"].contains(document.readyState))?b():arguments.callee.delay(50);})();}else{document.addEvent("DOMContentLoaded",b);}}})();var JSON=new Hash(this.JSON&&{stringify:JSON.stringify,parse:JSON.parse}).extend({$specialChars:{"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},$replaceChars:function(a){return JSON.$specialChars[a]||"\\u00"+Math.floor(a.charCodeAt()/16).toString(16)+(a.charCodeAt()%16).toString(16);},encode:function(b){switch($type(b)){case"string":return'"'+b.replace(/[\x00-\x1f\\"]/g,JSON.$replaceChars)+'"';case"array":return"["+String(b.map(JSON.encode).clean())+"]";case"object":case"hash":var a=[];Hash.each(b,function(f,d){var c=JSON.encode(f);if(c){a.push(JSON.encode(d)+":"+c);}});return"{"+a+"}";case"number":case"boolean":return String(b);case false:return"null";}return null;},decode:function(string,secure){if($type(string)!="string"||!string.length){return null;}if(secure&&!(/^[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]*$/).test(string.replace(/\\./g,"@").replace(/"[^"\\\n\r]*"/g,""))){return null;}return eval("("+string+")");}});var Cookie=new Class({Implements:Options,options:{path:false,domain:false,duration:false,secure:false,document:document},initialize:function(b,a){this.key=b;this.setOptions(a);},write:function(b){b=encodeURIComponent(b);if(this.options.domain){b+="; domain="+this.options.domain;}if(this.options.path){b+="; path="+this.options.path;}if(this.options.duration){var a=new Date();a.setTime(a.getTime()+this.options.duration*24*60*60*1000);b+="; expires="+a.toGMTString();}if(this.options.secure){b+="; secure";}this.options.document.cookie=this.key+"="+b;return this;},read:function(){var a=this.options.document.cookie.match("(?:^|;)\\s*"+this.key.escapeRegExp()+"=([^;]*)");return(a)?decodeURIComponent(a[1]):null;},dispose:function(){new Cookie(this.key,$merge(this.options,{duration:-1})).write("");return this;}});Cookie.write=function(b,c,a){return new Cookie(b,a).write(c);};Cookie.read=function(a){return new Cookie(a).read();};Cookie.dispose=function(b,a){return new Cookie(b,a).dispose();};var Swiff=new Class({Implements:[Options],options:{id:null,height:1,width:1,container:null,properties:{},params:{quality:"high",allowScriptAccess:"always",wMode:"transparent",swLiveConnect:true},callBacks:{},vars:{}},toElement:function(){return this.object;},initialize:function(m,n){this.instance="Swiff_"+$time();this.setOptions(n);n=this.options;var b=this.id=n.id||this.instance;var a=document.id(n.container);Swiff.CallBacks[this.instance]={};var f=n.params,h=n.vars,g=n.callBacks;var i=$extend({height:n.height,width:n.width},n.properties);var l=this;for(var d in g){Swiff.CallBacks[this.instance][d]=(function(o){return function(){return o.apply(l.object,arguments);};})(g[d]);h[d]="Swiff.CallBacks."+this.instance+"."+d;}f.flashVars=Hash.toQueryString(h);if(Browser.Engine.trident){i.classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000";f.movie=m;}else{i.type="application/x-shockwave-flash";i.data=m;}var k='<object id="'+b+'"';for(var j in i){k+=" "+j+'="'+i[j]+'"';}k+=">";for(var c in f){if(f[c]){k+='<param name="'+c+'" value="'+f[c]+'" />';}}k+="</object>";this.object=((a)?a.empty():new Element("div")).set("html",k).firstChild;},replaces:function(a){a=document.id(a,true);a.parentNode.replaceChild(this.toElement(),a);return this;},inject:function(a){document.id(a,true).appendChild(this.toElement());return this;},remote:function(){return Swiff.remote.apply(Swiff,[this.toElement()].extend(arguments));}});Swiff.CallBacks={};Swiff.remote=function(obj,fn){var rs=obj.CallFunction('<invoke name="'+fn+'" returntype="javascript">'+__flash__argumentsToXML(arguments,2)+"</invoke>");return eval(rs);};var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore"},initialize:function(a){this.subject=this.subject||this;this.setOptions(a);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt();var b=this.options.wait;if(b===false){this.options.link="cancel";}},getTransition:function(){return function(a){return -(Math.cos(Math.PI*a)-1)/2;};},step:function(){var a=$time();if(a<this.time+this.options.duration){var b=this.transition((a-this.time)/this.options.duration);this.set(this.compute(this.from,this.to,b));}else{this.set(this.compute(this.from,this.to,1));this.complete();}},set:function(a){return a;},compute:function(c,b,a){return Fx.compute(c,b,a);},check:function(){if(!this.timer){return true;}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false;}return false;},start:function(b,a){if(!this.check(b,a)){return this;}this.from=b;this.to=a;this.time=0;this.transition=this.getTransition();this.startTimer();this.onStart();return this;},complete:function(){if(this.stopTimer()){this.onComplete();}return this;},cancel:function(){if(this.stopTimer()){this.onCancel();}return this;},onStart:function(){this.fireEvent("start",this.subject);},onComplete:function(){this.fireEvent("complete",this.subject);if(!this.callChain()){this.fireEvent("chainComplete",this.subject);}},onCancel:function(){this.fireEvent("cancel",this.subject).clearChain();},pause:function(){this.stopTimer();return this;},resume:function(){this.startTimer();return this;},stopTimer:function(){if(!this.timer){return false;}this.time=$time()-this.time;this.timer=$clear(this.timer);return true;},startTimer:function(){if(this.timer){return false;}this.time=$time()-this.time;this.timer=this.step.periodical(Math.round(1000/this.options.fps),this);return true;}});Fx.compute=function(c,b,a){return(b-c)*a+c;};Fx.Durations={"short":250,normal:500,"long":1000};Fx.CSS=new Class({Extends:Fx,prepare:function(d,f,b){b=$splat(b);var c=b[1];if(!$chk(c)){b[1]=b[0];b[0]=d.getStyle(f);}var a=b.map(this.parse);return{from:a[0],to:a[1]};},parse:function(a){a=$lambda(a)();a=(typeof a=="string")?a.split(" "):$splat(a);return a.map(function(c){c=String(c);var b=false;Fx.CSS.Parsers.each(function(g,f){if(b){return;}var d=g.parse(c);if($chk(d)){b={value:d,parser:g};}});b=b||{value:c,parser:Fx.CSS.Parsers.String};return b;});},compute:function(d,c,b){var a=[];(Math.min(d.length,c.length)).times(function(f){a.push({value:d[f].parser.compute(d[f].value,c[f].value,b),parser:d[f].parser});});a.$family={name:"fx:css:value"};return a;},serve:function(c,b){if($type(c)!="fx:css:value"){c=this.parse(c);}var a=[];c.each(function(d){a=a.concat(d.parser.serve(d.value,b));});return a;},render:function(a,d,c,b){a.setStyle(d,this.serve(c,b));},search:function(a){if(Fx.CSS.Cache[a]){return Fx.CSS.Cache[a];}var b={};Array.each(document.styleSheets,function(f,d){var c=f.href;if(c&&c.contains("://")&&!c.contains(document.domain)){return;}var g=f.rules||f.cssRules;Array.each(g,function(k,h){if(!k.style){return;}var j=(k.selectorText)?k.selectorText.replace(/^\w+/,function(i){return i.toLowerCase();}):null;if(!j||!j.test("^"+a+"$")){return;}Element.Styles.each(function(l,i){if(!k.style[i]||Element.ShortStyles[i]){return;}l=String(k.style[i]);b[i]=(l.test(/^rgb/))?l.rgbToHex():l;});});});return Fx.CSS.Cache[a]=b;}});Fx.CSS.Cache={};Fx.CSS.Parsers=new Hash({Color:{parse:function(a){if(a.match(/^#[0-9a-f]{3,6}$/i)){return a.hexToRgb(true);}return((a=a.match(/(\d+),\s*(\d+),\s*(\d+)/)))?[a[1],a[2],a[3]]:false;},compute:function(c,b,a){return c.map(function(f,d){return Math.round(Fx.compute(c[d],b[d],a));});},serve:function(a){return a.map(Number);}},Number:{parse:parseFloat,compute:Fx.compute,serve:function(b,a){return(a)?b+a:b;}},String:{parse:$lambda(false),compute:$arguments(1),serve:$arguments(0)}});Fx.Tween=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a);},set:function(b,a){if(arguments.length==1){a=b;b=this.property||this.options.property;}this.render(this.element,b,a,this.options.unit);return this;},start:function(c,f,d){if(!this.check(c,f,d)){return this;}var b=Array.flatten(arguments);this.property=this.options.property||b.shift();var a=this.prepare(this.element,this.property,b);return this.parent(a.from,a.to);}});Element.Properties.tween={set:function(a){var b=this.retrieve("tween");if(b){b.cancel();}return this.eliminate("tween").store("tween:options",$extend({link:"cancel"},a));},get:function(a){if(a||!this.retrieve("tween")){if(a||!this.retrieve("tween:options")){this.set("tween",a);}this.store("tween",new Fx.Tween(this,this.retrieve("tween:options")));}return this.retrieve("tween");}};Element.implement({tween:function(a,c,b){this.get("tween").start(arguments);return this;},fade:function(c){var f=this.get("tween"),d="opacity",a;c=$pick(c,"toggle");switch(c){case"in":f.start(d,1);break;case"out":f.start(d,0);break;case"show":f.set(d,1);break;case"hide":f.set(d,0);break;case"toggle":var b=this.retrieve("fade:flag",this.get("opacity")==1);f.start(d,(b)?0:1);this.store("fade:flag",!b);a=true;break;default:f.start(d,arguments);}if(!a){this.eliminate("fade:flag");}return this;},highlight:function(c,a){if(!a){a=this.retrieve("highlight:original",this.getStyle("background-color"));a=(a=="transparent")?"#fff":a;}var b=this.get("tween");b.start("background-color",c||"#ffff88",a).chain(function(){this.setStyle("background-color",this.retrieve("highlight:original"));b.callChain();}.bind(this));return this;}});Fx.Morph=new Class({Extends:Fx.CSS,initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a);},set:function(a){if(typeof a=="string"){a=this.search(a);}for(var b in a){this.render(this.element,b,a[b],this.options.unit);}return this;},compute:function(f,d,c){var a={};for(var b in f){a[b]=this.parent(f[b],d[b],c);}return a;},start:function(b){if(!this.check(b)){return this;}if(typeof b=="string"){b=this.search(b);}var f={},d={};for(var c in b){var a=this.prepare(this.element,c,b[c]);f[c]=a.from;d[c]=a.to;}return this.parent(f,d);}});Element.Properties.morph={set:function(a){var b=this.retrieve("morph");if(b){b.cancel();}return this.eliminate("morph").store("morph:options",$extend({link:"cancel"},a));},get:function(a){if(a||!this.retrieve("morph")){if(a||!this.retrieve("morph:options")){this.set("morph",a);}this.store("morph",new Fx.Morph(this,this.retrieve("morph:options")));}return this.retrieve("morph");}};Element.implement({morph:function(a){this.get("morph").start(a);return this;}});Fx.implement({getTransition:function(){var a=this.options.transition||Fx.Transitions.Sine.easeInOut;if(typeof a=="string"){var b=a.split(":");a=Fx.Transitions;a=a[b[0]]||a[b[0].capitalize()];if(b[1]){a=a["ease"+b[1].capitalize()+(b[2]?b[2].capitalize():"")];}}return a;}});Fx.Transition=function(b,a){a=$splat(a);return $extend(b,{easeIn:function(c){return b(c,a);},easeOut:function(c){return 1-b(1-c,a);},easeInOut:function(c){return(c<=0.5)?b(2*c,a)/2:(2-b(2*(1-c),a))/2;}});};Fx.Transitions=new Hash({linear:$arguments(0)});Fx.Transitions.extend=function(a){for(var b in a){Fx.Transitions[b]=new Fx.Transition(a[b]);}};Fx.Transitions.extend({Pow:function(b,a){return Math.pow(b,a[0]||6);},Expo:function(a){return Math.pow(2,8*(a-1));},Circ:function(a){return 1-Math.sin(Math.acos(a));},Sine:function(a){return 1-Math.sin((1-a)*Math.PI/2);},Back:function(b,a){a=a[0]||1.618;return Math.pow(b,2)*((a+1)*b-a);},Bounce:function(g){var f;for(var d=0,c=1;1;d+=c,c/=2){if(g>=(7-4*d)/11){f=c*c-Math.pow((11-6*d-11*g)/4,2);break;}}return f;},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,[a+2]);});});var Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, application/xml, text/xml, */*"},async:true,format:false,method:"post",link:"ignore",isSuccess:null,emulation:true,urlEncoded:true,encoding:"utf-8",evalScripts:false,evalResponse:false,noCache:false},initialize:function(a){this.xhr=new Browser.Request();this.setOptions(a);this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.headers=new Hash(this.options.headers);},onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return;}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bind(this));this.xhr.onreadystatechange=$empty;if(this.options.isSuccess.call(this,this.status)){this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};this.success(this.response.text,this.response.xml);}else{this.response={text:null,xml:null};this.failure();}},isSuccess:function(){return((this.status>=200)&&(this.status<300));},processScripts:function(a){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){return $exec(a);}return a.stripScripts(this.options.evalScripts);},success:function(b,a){this.onSuccess(this.processScripts(b),a);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain();},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},setHeader:function(a,b){this.headers.set(a,b);return this;},getHeader:function(a){return $try(function(){return this.xhr.getResponseHeader(a);}.bind(this));},check:function(){if(!this.running){return true;}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.bind(this,arguments));return false;}return false;},send:function(l){if(!this.check(l)){return this;}this.running=true;var j=$type(l);if(j=="string"||j=="element"){l={data:l};}var d=this.options;l=$extend({data:d.data,url:d.url,method:d.method},l);var h=l.data,b=String(l.url),a=l.method.toLowerCase();switch($type(h)){case"element":h=document.id(h).toQueryString();break;case"object":case"hash":h=Hash.toQueryString(h);}if(this.options.format){var k="format="+this.options.format;h=(h)?k+"&"+h:k;}if(this.options.emulation&&!["get","post"].contains(a)){var i="_method="+a;h=(h)?i+"&"+h:i;a="post";}if(this.options.urlEncoded&&a=="post"){var c=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers.set("Content-type","application/x-www-form-urlencoded"+c);}if(this.options.noCache){var g="noCache="+new Date().getTime();h=(h)?g+"&"+h:g;}var f=b.lastIndexOf("/");if(f>-1&&(f=b.indexOf("#"))>-1){b=b.substr(0,f);}if(h&&a=="get"){b=b+(b.contains("?")?"&":"?")+h;h=null;}this.xhr.open(a.toUpperCase(),b,this.options.async);this.xhr.onreadystatechange=this.onStateChange.bind(this);this.headers.each(function(n,m){try{this.xhr.setRequestHeader(m,n);}catch(o){this.fireEvent("exception",[m,n]);}},this);this.fireEvent("request");this.xhr.send(h);if(!this.options.async){this.onStateChange();}return this;},cancel:function(){if(!this.running){return this;}this.running=false;this.xhr.abort();this.xhr.onreadystatechange=$empty;this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});(function(){var a={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(b){a[b]=function(){var c=Array.link(arguments,{url:String.type,data:$defined});return this.send($extend(c,{method:b}));};});Request.implement(a);})();Element.Properties.send={set:function(a){var b=this.retrieve("send");if(b){b.cancel();}return this.eliminate("send").store("send:options",$extend({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")},a));},get:function(a){if(a||!this.retrieve("send")){if(a||!this.retrieve("send:options")){this.set("send",a);}this.store("send",new Request(this.retrieve("send:options")));}return this.retrieve("send");}};Element.implement({send:function(a){var b=this.get("send");b.send({data:this,url:a||b.options.url});return this;}});Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false},processHTML:function(c){var b=c.match(/<body[^>]*>([\s\S]*?)<\/body>/i);c=(b)?b[1]:c;var a=new Element("div");return $try(function(){var d="<root>"+c+"</root>",h;if(Browser.Engine.trident){h=new ActiveXObject("Microsoft.XMLDOM");h.async=false;h.loadXML(d);}else{h=new DOMParser().parseFromString(d,"text/xml");}d=h.getElementsByTagName("root")[0];if(!d){return null;}for(var g=0,f=d.childNodes.length;g<f;g++){var j=Element.clone(d.childNodes[g],true,true);if(j){a.grab(j);}}return a;})||a.set("html",c);},success:function(d){var c=this.options,b=this.response;b.html=d.stripScripts(function(f){b.javascript=f;});var a=this.processHTML(b.html);b.tree=a.childNodes;b.elements=a.getElements("*");if(c.filter){b.tree=b.elements.filter(c.filter);}if(c.update){document.id(c.update).empty().set("html",b.html);}else{if(c.append){document.id(c.append).adopt(a.getChildren());}}if(c.evalScripts){$exec(b.javascript);}this.onSuccess(b.tree,b.elements,b.html,b.javascript);}});Element.Properties.load={set:function(a){var b=this.retrieve("load");if(b){b.cancel();}return this.eliminate("load").store("load:options",$extend({data:this,link:"cancel",update:this,method:"get"},a));},get:function(a){if(a||!this.retrieve("load")){if(a||!this.retrieve("load:options")){this.set("load",a);}this.store("load",new Request.HTML(this.retrieve("load:options")));}return this.retrieve("load");}};Element.implement({load:function(){this.get("load").send(Array.link(arguments,{data:Object.type,url:String.type}));return this;}});Request.JSON=new Class({Extends:Request,options:{secure:true},initialize:function(a){this.parent(a);this.headers.extend({Accept:"application/json","X-Request":"JSON"});},success:function(a){this.response.json=JSON.decode(a,this.options.secure);this.onSuccess(this.response.json,a);}});MooTools.More={version:"1.2.4.2",build:"bd5a93c0913cce25917c48cbdacde568e15e02ef"};Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(b,a){this.elements=this.subject=$$(b);this.parent(a);},compute:function(h,j,k){var c={};for(var d in h){var a=h[d],f=j[d],g=c[d]={};for(var b in a){g[b]=this.parent(a[b],f[b],k);}}return c;},set:function(b){for(var c in b){var a=b[c];for(var d in a){this.render(this.elements[c],d,a[d],this.options.unit);}}return this;},start:function(c){if(!this.check(c)){return this;}var j={},k={};for(var d in c){var g=c[d],a=j[d]={},h=k[d]={};for(var b in g){var f=this.prepare(this.elements[d],b,g[b]);a[b]=f.from;h[b]=f.to;}}return this.parent(j,k);}});var Accordion=Fx.Accordion=new Class({Extends:Fx.Elements,options:{display:0,show:false,height:true,width:false,opacity:true,alwaysHide:false,trigger:"click",initialDisplayFx:true,returnHeightToAuto:true},initialize:function(){var c=Array.link(arguments,{container:Element.type,options:Object.type,togglers:$defined,elements:$defined});this.parent(c.elements,c.options);this.togglers=$$(c.togglers);this.container=document.id(c.container);this.previous=-1;this.internalChain=new Chain();if(this.options.alwaysHide){this.options.wait=true;}if($chk(this.options.show)){this.options.display=false;this.previous=this.options.show;}if(this.options.start){this.options.display=false;this.options.show=false;}this.effects={};if(this.options.opacity){this.effects.opacity="fullOpacity";}if(this.options.width){this.effects.width=this.options.fixedWidth?"fullWidth":"offsetWidth";}if(this.options.height){this.effects.height=this.options.fixedHeight?"fullHeight":"scrollHeight";}for(var b=0,a=this.togglers.length;b<a;b++){this.addSection(this.togglers[b],this.elements[b]);}this.elements.each(function(f,d){if(this.options.show===d){this.fireEvent("active",[this.togglers[d],f]);}else{for(var g in this.effects){f.setStyle(g,0);}}},this);if($chk(this.options.display)){this.display(this.options.display,this.options.initialDisplayFx);}this.addEvent("complete",this.internalChain.callChain.bind(this.internalChain));},addSection:function(f,c){f=document.id(f);c=document.id(c);var g=this.togglers.contains(f);this.togglers.include(f);this.elements.include(c);var a=this.togglers.indexOf(f);var b=this.display.bind(this,a);f.store("accordion:display",b);f.addEvent(this.options.trigger,b);if(this.options.height){c.setStyles({"padding-top":0,"border-top":"none","padding-bottom":0,"border-bottom":"none"});}if(this.options.width){c.setStyles({"padding-left":0,"border-left":"none","padding-right":0,"border-right":"none"});}c.fullOpacity=1;if(this.options.fixedWidth){c.fullWidth=this.options.fixedWidth;}if(this.options.fixedHeight){c.fullHeight=this.options.fixedHeight;}c.setStyle("overflow","hidden");if(!g){for(var d in this.effects){c.setStyle(d,0);}}return this;},detach:function(){this.togglers.each(function(a){a.removeEvent(this.options.trigger,a.retrieve("accordion:display"));},this);},display:function(a,b){if(!this.check(a,b)){return this;}b=$pick(b,true);if(this.options.returnHeightToAuto){var d=this.elements[this.previous];if(d&&!this.selfHidden){for(var c in this.effects){d.setStyle(c,d[this.effects[c]]);}}}a=($type(a)=="element")?this.elements.indexOf(a):a;if((this.timer&&this.options.wait)||(a===this.previous&&!this.options.alwaysHide)){return this;}this.previous=a;var f={};this.elements.each(function(j,h){f[h]={};var g;if(h!=a){g=true;}else{if(this.options.alwaysHide&&((j.offsetHeight>0&&this.options.height)||j.offsetWidth>0&&this.options.width)){g=true;this.selfHidden=true;}}this.fireEvent(g?"background":"active",[this.togglers[h],j]);for(var k in this.effects){f[h][k]=g?0:j[this.effects[k]];}},this);this.internalChain.chain(function(){if(this.options.returnHeightToAuto&&!this.selfHidden){var g=this.elements[a];if(g){g.setStyle("height","auto");}}}.bind(this));return b?this.start(f):this.set(f);}});Fx.Scroll=new Class({Extends:Fx,options:{offset:{x:0,y:0},wheelStops:true},initialize:function(b,a){this.element=this.subject=document.id(b);this.parent(a);var d=this.cancel.bind(this,false);if($type(this.element)!="element"){this.element=document.id(this.element.getDocument().body);}var c=this.element;if(this.options.wheelStops){this.addEvent("start",function(){c.addEvent("mousewheel",d);},true);this.addEvent("complete",function(){c.removeEvent("mousewheel",d);},true);}},set:function(){var a=Array.flatten(arguments);if(Browser.Engine.gecko){a=[Math.round(a[0]),Math.round(a[1])];}this.element.scrollTo(a[0],a[1]);},compute:function(c,b,a){return[0,1].map(function(d){return Fx.compute(c[d],b[d],a);});},start:function(c,h){if(!this.check(c,h)){return this;}var f=this.element.getScrollSize(),b=this.element.getScroll(),d={x:c,y:h};for(var g in d){var a=f[g];if($chk(d[g])){d[g]=($type(d[g])=="number")?d[g]:a;}else{d[g]=b[g];}d[g]+=this.options.offset[g];}return this.parent([b.x,b.y],[d.x,d.y]);},toTop:function(){return this.start(false,0);},toLeft:function(){return this.start(0,false);},toRight:function(){return this.start("right",false);},toBottom:function(){return this.start(false,"bottom");},toElement:function(b){var a=document.id(b).getPosition(this.element);return this.start(a.x,a.y);},scrollIntoView:function(c,f,d){f=f?$splat(f):["x","y"];var i={};c=document.id(c);var g=c.getPosition(this.element);var j=c.getSize();var h=this.element.getScroll();var a=this.element.getSize();var b={x:g.x+j.x,y:g.y+j.y};["x","y"].each(function(k){if(f.contains(k)){if(b[k]>h[k]+a[k]){i[k]=b[k]-a[k];}if(g[k]<h[k]){i[k]=g[k];}}if(i[k]==null){i[k]=h[k];}if(d&&d[k]){i[k]=i[k]+d[k];}},this);if(i.x!=h.x||i.y!=h.y){this.start(i.x,i.y);}return this;},scrollToCenter:function(c,f,d){f=f?$splat(f):["x","y"];c=$(c);var i={},g=c.getPosition(this.element),j=c.getSize(),h=this.element.getScroll(),a=this.element.getSize(),b={x:g.x+j.x,y:g.y+j.y};["x","y"].each(function(k){if(f.contains(k)){i[k]=g[k]-(a[k]-j[k])/2;}if(i[k]==null){i[k]=h[k];}if(d&&d[k]){i[k]=i[k]+d[k];}},this);if(i.x!=h.x||i.y!=h.y){this.start(i.x,i.y);}return this;}});Fx.Slide=new Class({Extends:Fx,options:{mode:"vertical",hideOverflow:true},initialize:function(b,a){this.addEvent("complete",function(){this.open=(this.wrapper["offset"+this.layout.capitalize()]!=0);if(this.open&&Browser.Engine.webkit419){this.element.dispose().inject(this.wrapper);}},true);this.element=this.subject=document.id(b);this.parent(a);var d=this.element.retrieve("wrapper");var c=this.element.getStyles("margin","position","overflow");if(this.options.hideOverflow){c=$extend(c,{overflow:"hidden"});}this.wrapper=d||new Element("div",{styles:c}).wraps(this.element);this.element.store("wrapper",this.wrapper).setStyle("margin",0);this.now=[];this.open=true;},vertical:function(){this.margin="margin-top";this.layout="height";this.offset=this.element.offsetHeight;},horizontal:function(){this.margin="margin-left";this.layout="width";this.offset=this.element.offsetWidth;},set:function(a){this.element.setStyle(this.margin,a[0]);this.wrapper.setStyle(this.layout,a[1]);return this;},compute:function(c,b,a){return[0,1].map(function(d){return Fx.compute(c[d],b[d],a);});},start:function(b,f){if(!this.check(b,f)){return this;}this[f||this.options.mode]();var d=this.element.getStyle(this.margin).toInt();var c=this.wrapper.getStyle(this.layout).toInt();var a=[[d,c],[0,this.offset]];var h=[[d,c],[-this.offset,0]];var g;switch(b){case"in":g=a;break;case"out":g=h;break;case"toggle":g=(c==0)?a:h;}return this.parent(g[0],g[1]);},slideIn:function(a){return this.start("in",a);},slideOut:function(a){return this.start("out",a);},hide:function(a){this[a||this.options.mode]();this.open=false;return this.set([-this.offset,0]);},show:function(a){this[a||this.options.mode]();this.open=true;return this.set([0,this.offset]);},toggle:function(a){return this.start("toggle",a);}});Element.Properties.slide={set:function(b){var a=this.retrieve("slide");if(a){a.cancel();}return this.eliminate("slide").store("slide:options",$extend({link:"cancel"},b));},get:function(a){if(a||!this.retrieve("slide")){if(a||!this.retrieve("slide:options")){this.set("slide",a);}this.store("slide",new Fx.Slide(this,this.retrieve("slide:options")));}return this.retrieve("slide");}};Element.implement({slide:function(d,f){d=d||"toggle";var b=this.get("slide"),a;switch(d){case"hide":b.hide(f);break;case"show":b.show(f);break;case"toggle":var c=this.retrieve("slide:flag",b.open);b[c?"slideOut":"slideIn"](f);this.store("slide:flag",!c);a=true;break;default:b.start(d,f);}if(!a){this.eliminate("slide:flag");}return this;}});var SmoothScroll=Fx.SmoothScroll=new Class({Extends:Fx.Scroll,initialize:function(b,c){c=c||document;this.doc=c.getDocument();var d=c.getWindow();this.parent(this.doc,b);this.links=$$(this.options.links||this.doc.links);var a=d.location.href.match(/^[^#]*/)[0]+"#";this.links.each(function(g){if(g.href.indexOf(a)!=0){return;}var f=g.href.substr(a.length);if(f){this.useLink(g,f);}},this);if(!Browser.Engine.webkit419){this.addEvent("complete",function(){d.location.hash=this.anchor;},true);}},useLink:function(c,a){var b;c.addEvent("click",function(d){if(b!==false&&!b){b=document.id(a)||this.doc.getElement("a[name="+a+"]");}if(b){d.preventDefault();this.anchor=a;this.toElement(b).chain(function(){this.fireEvent("scrolledTo",[c,b]);}.bind(this));c.blur();}}.bind(this));}});var Drag=new Class({Implements:[Events,Options],options:{snap:6,unit:"px",grid:false,style:true,limit:false,handle:false,invert:false,preventDefault:false,stopPropagation:false,modifiers:{x:"left",y:"top"}},initialize:function(){var b=Array.link(arguments,{options:Object.type,element:$defined});this.element=document.id(b.element);this.document=this.element.getDocument();this.setOptions(b.options||{});var a=$type(this.options.handle);this.handles=((a=="array"||a=="collection")?$$(this.options.handle):document.id(this.options.handle))||this.element;this.mouse={now:{},pos:{}};this.value={start:{},now:{}};this.selection=(Browser.Engine.trident)?"selectstart":"mousedown";this.bound={start:this.start.bind(this),check:this.check.bind(this),drag:this.drag.bind(this),stop:this.stop.bind(this),cancel:this.cancel.bind(this),eventStop:$lambda(false)};this.attach();},attach:function(){this.handles.addEvent("mousedown",this.bound.start);return this;},detach:function(){this.handles.removeEvent("mousedown",this.bound.start);return this;},start:function(c){if(c.rightClick){return;}if(this.options.preventDefault){c.preventDefault();}if(this.options.stopPropagation){c.stopPropagation();}this.mouse.start=c.page;this.fireEvent("beforeStart",this.element);var a=this.options.limit;this.limit={x:[],y:[]};for(var d in this.options.modifiers){if(!this.options.modifiers[d]){continue;}if(this.options.style){this.value.now[d]=this.element.getStyle(this.options.modifiers[d]).toInt();}else{this.value.now[d]=this.element[this.options.modifiers[d]];}if(this.options.invert){this.value.now[d]*=-1;}this.mouse.pos[d]=c.page[d]-this.value.now[d];if(a&&a[d]){for(var b=2;b--;b){if($chk(a[d][b])){this.limit[d][b]=$lambda(a[d][b])();}}}}if($type(this.options.grid)=="number"){this.options.grid={x:this.options.grid,y:this.options.grid};}this.document.addEvents({mousemove:this.bound.check,mouseup:this.bound.cancel});this.document.addEvent(this.selection,this.bound.eventStop);},check:function(a){if(this.options.preventDefault){a.preventDefault();}var b=Math.round(Math.sqrt(Math.pow(a.page.x-this.mouse.start.x,2)+Math.pow(a.page.y-this.mouse.start.y,2)));if(b>this.options.snap){this.cancel();this.document.addEvents({mousemove:this.bound.drag,mouseup:this.bound.stop});this.fireEvent("start",[this.element,a]).fireEvent("snap",this.element);}},drag:function(a){if(this.options.preventDefault){a.preventDefault();}this.mouse.now=a.page;for(var b in this.options.modifiers){if(!this.options.modifiers[b]){continue;}this.value.now[b]=this.mouse.now[b]-this.mouse.pos[b];if(this.options.invert){this.value.now[b]*=-1;}if(this.options.limit&&this.limit[b]){if($chk(this.limit[b][1])&&(this.value.now[b]>this.limit[b][1])){this.value.now[b]=this.limit[b][1];}else{if($chk(this.limit[b][0])&&(this.value.now[b]<this.limit[b][0])){this.value.now[b]=this.limit[b][0];}}}if(this.options.grid[b]){this.value.now[b]-=((this.value.now[b]-(this.limit[b][0]||0))%this.options.grid[b]);}if(this.options.style){this.element.setStyle(this.options.modifiers[b],this.value.now[b]+this.options.unit);}else{this.element[this.options.modifiers[b]]=this.value.now[b];}}this.fireEvent("drag",[this.element,a]);},cancel:function(a){this.document.removeEvent("mousemove",this.bound.check);this.document.removeEvent("mouseup",this.bound.cancel);if(a){this.document.removeEvent(this.selection,this.bound.eventStop);this.fireEvent("cancel",this.element);}},stop:function(a){this.document.removeEvent(this.selection,this.bound.eventStop);this.document.removeEvent("mousemove",this.bound.drag);this.document.removeEvent("mouseup",this.bound.stop);if(a){this.fireEvent("complete",[this.element,a]);}}});Element.implement({makeResizable:function(a){var b=new Drag(this,$merge({modifiers:{x:"width",y:"height"}},a));this.store("resizer",b);return b.addEvent("drag",function(){this.fireEvent("resize",b);}.bind(this));}});Drag.Move=new Class({Extends:Drag,options:{droppables:[],container:false,precalculate:false,includeMargins:true,checkDroppables:true},initialize:function(b,a){this.parent(b,a);b=this.element;this.droppables=$$(this.options.droppables);this.container=document.id(this.options.container);if(this.container&&$type(this.container)!="element"){this.container=document.id(this.container.getDocument().body);}var c=b.getStyles("left","right","position");if(c.left=="auto"||c.top=="auto"){b.setPosition(b.getPosition(b.getOffsetParent()));}if(c.position=="static"){b.setStyle("position","absolute");}this.addEvent("start",this.checkDroppables,true);this.overed=null;},start:function(a){if(this.container){this.options.limit=this.calculateLimit();}if(this.options.precalculate){this.positions=this.droppables.map(function(b){return b.getCoordinates();});}this.parent(a);},calculateLimit:function(){var d=this.element.getOffsetParent(),h=this.container.getCoordinates(d),g={},c={},b={},j={},l={};["top","right","bottom","left"].each(function(p){g[p]=this.container.getStyle("border-"+p).toInt();b[p]=this.element.getStyle("border-"+p).toInt();c[p]=this.element.getStyle("margin-"+p).toInt();j[p]=this.container.getStyle("margin-"+p).toInt();l[p]=d.getStyle("padding-"+p).toInt();},this);var f=this.element.offsetWidth+c.left+c.right,o=this.element.offsetHeight+c.top+c.bottom,i=0,k=0,n=h.right-g.right-f,a=h.bottom-g.bottom-o;if(this.options.includeMargins){i+=c.left;k+=c.top;}else{n+=c.right;a+=c.bottom;}if(this.element.getStyle("position")=="relative"){var m=this.element.getCoordinates(d);m.left-=this.element.getStyle("left").toInt();m.top-=this.element.getStyle("top").toInt();i+=g.left-m.left;k+=g.top-m.top;n+=c.left-m.left;a+=c.top-m.top;if(this.container!=d){i+=j.left+l.left;k+=(Browser.Engine.trident4?0:j.top)+l.top;}}else{i-=c.left;k-=c.top;if(this.container==d){n-=g.left;a-=g.top;}else{i+=h.left+g.left;k+=h.top+g.top;}}return{x:[i,n],y:[k,a]};},checkAgainst:function(c,b){c=(this.positions)?this.positions[b]:c.getCoordinates();var a=this.mouse.now;return(a.x>c.left&&a.x<c.right&&a.y<c.bottom&&a.y>c.top);},checkDroppables:function(){var a=this.droppables.filter(this.checkAgainst,this).getLast();if(this.overed!=a){if(this.overed){this.fireEvent("leave",[this.element,this.overed]);}if(a){this.fireEvent("enter",[this.element,a]);}this.overed=a;}},drag:function(a){this.parent(a);if(this.options.checkDroppables&&this.droppables.length){this.checkDroppables();}},stop:function(a){this.checkDroppables();this.fireEvent("drop",[this.element,this.overed,a]);this.overed=null;return this.parent(a);}});Element.implement({makeDraggable:function(a){var b=new Drag.Move(this,a);this.store("dragger",b);return b;}});Class.Mutators.Binds=function(a){return a;};Class.Mutators.initialize=function(a){return function(){$splat(this.Binds).each(function(b){var c=this[b];if(c){this[b]=c.bind(this);}},this);return a.apply(this,arguments);};};Element.implement({measure:function(f){var h=function(i){return !!(!i||i.offsetHeight||i.offsetWidth);};if(h(this)){return f.apply(this);}var d=this.getParent(),g=[],b=[];while(!h(d)&&d!=document.body){b.push(d.expose());d=d.getParent();}var c=this.expose();var a=f.apply(this);c();b.each(function(i){i();});return a;},expose:function(){if(this.getStyle("display")!="none"){return $empty;}var a=this.style.cssText;this.setStyles({display:"block",position:"absolute",visibility:"hidden"});return function(){this.style.cssText=a;}.bind(this);},getDimensions:function(a){a=$merge({computeSize:false},a);var f={};var d=function(h,g){return(g.computeSize)?h.getComputedSize(g):h.getSize();};var b=this.getParent("body");if(b&&this.getStyle("display")=="none"){f=this.measure(function(){return d(this,a);});}else{if(b){try{f=d(this,a);}catch(c){}}else{f={x:0,y:0};}}return $chk(f.x)?$extend(f,{width:f.x,height:f.y}):$extend(f,{x:f.width,y:f.height});},getComputedSize:function(a){a=$merge({styles:["padding","border"],plains:{height:["top","bottom"],width:["left","right"]},mode:"both"},a);var c={width:0,height:0};switch(a.mode){case"vertical":delete c.width;delete a.plains.width;break;case"horizontal":delete c.height;delete a.plains.height;break;}var b=[];$each(a.plains,function(h,g){h.each(function(i){a.styles.each(function(j){b.push((j=="border")?j+"-"+i+"-width":j+"-"+i);});});});var f={};b.each(function(g){f[g]=this.getComputedStyle(g);},this);var d=[];$each(a.plains,function(h,g){var i=g.capitalize();c["total"+i]=c["computed"+i]=0;h.each(function(j){c["computed"+j.capitalize()]=0;b.each(function(l,k){if(l.test(j)){f[l]=f[l].toInt()||0;c["total"+i]=c["total"+i]+f[l];c["computed"+j.capitalize()]=c["computed"+j.capitalize()]+f[l];}if(l.test(j)&&g!=l&&(l.test("border")||l.test("padding"))&&!d.contains(l)){d.push(l);c["computed"+i]=c["computed"+i]-f[l];}});});});["Width","Height"].each(function(h){var g=h.toLowerCase();if(!$chk(c[g])){return;}c[g]=c[g]+this["offset"+h]+c["computed"+h];c["total"+h]=c[g]+c["total"+h];delete c["computed"+h];},this);return $extend(f,c);}});var Slider=new Class({Implements:[Events,Options],Binds:["clickedElement","draggedKnob","scrolledElement"],options:{onTick:function(a){if(this.options.snap){a=this.toPosition(this.step);}this.knob.setStyle(this.property,a);},initialStep:0,snap:false,offset:0,range:false,wheel:false,steps:100,mode:"horizontal"},initialize:function(g,a,f){this.setOptions(f);this.element=document.id(g);this.knob=document.id(a);this.previousChange=this.previousEnd=this.step=-1;var h,b={},d={x:false,y:false};switch(this.options.mode){case"vertical":this.axis="y";this.property="top";h="offsetHeight";break;case"horizontal":this.axis="x";this.property="left";h="offsetWidth";}this.full=this.element.measure(function(){this.half=this.knob[h]/2;return this.element[h]-this.knob[h]+(this.options.offset*2);}.bind(this));this.min=$chk(this.options.range[0])?this.options.range[0]:0;this.max=$chk(this.options.range[1])?this.options.range[1]:this.options.steps;this.range=this.max-this.min;this.steps=this.options.steps||this.full;this.stepSize=Math.abs(this.range)/this.steps;this.stepWidth=this.stepSize*this.full/Math.abs(this.range);this.knob.setStyle("position","relative").setStyle(this.property,this.options.initialStep?this.toPosition(this.options.initialStep):-this.options.offset);d[this.axis]=this.property;b[this.axis]=[-this.options.offset,this.full-this.options.offset];var c={snap:0,limit:b,modifiers:d,onDrag:this.draggedKnob,onStart:this.draggedKnob,onBeforeStart:(function(){this.isDragging=true;}).bind(this),onCancel:function(){this.isDragging=false;}.bind(this),onComplete:function(){this.isDragging=false;this.draggedKnob();this.end();}.bind(this)};if(this.options.snap){c.grid=Math.ceil(this.stepWidth);c.limit[this.axis][1]=this.full;}this.drag=new Drag(this.knob,c);this.attach();},attach:function(){this.element.addEvent("mousedown",this.clickedElement);if(this.options.wheel){this.element.addEvent("mousewheel",this.scrolledElement);}this.drag.attach();return this;},detach:function(){this.element.removeEvent("mousedown",this.clickedElement);this.element.removeEvent("mousewheel",this.scrolledElement);this.drag.detach();return this;},set:function(a){if(!((this.range>0)^(a<this.min))){a=this.min;}if(!((this.range>0)^(a>this.max))){a=this.max;}this.step=Math.round(a);this.checkStep();this.fireEvent("tick",this.toPosition(this.step));this.end();return this;},clickedElement:function(c){if(this.isDragging||c.target==this.knob){return;}var b=this.range<0?-1:1;var a=c.page[this.axis]-this.element.getPosition()[this.axis]-this.half;a=a.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+b*this.toStep(a));this.checkStep();this.fireEvent("tick",a);this.end();},scrolledElement:function(a){var b=(this.options.mode=="horizontal")?(a.wheel<0):(a.wheel>0);this.set(b?this.step-this.stepSize:this.step+this.stepSize);a.stop();},draggedKnob:function(){var b=this.range<0?-1:1;var a=this.drag.value.now[this.axis];a=a.limit(-this.options.offset,this.full-this.options.offset);this.step=Math.round(this.min+b*this.toStep(a));this.checkStep();},checkStep:function(){if(this.previousChange!=this.step){this.previousChange=this.step;this.fireEvent("change",this.step);}},end:function(){if(this.previousEnd!==this.step){this.previousEnd=this.step;this.fireEvent("complete",this.step+"");}},toStep:function(a){var b=(a+this.options.offset)*this.stepSize/this.full*this.steps;return this.options.steps?Math.round(b-=b%this.stepSize):b;},toPosition:function(a){return(this.full*Math.abs(this.min-a))/(this.steps*this.stepSize)-this.options.offset;}});var Sortables=new Class({Implements:[Events,Options],options:{snap:4,opacity:1,clone:false,revert:false,handle:false,constrain:false},initialize:function(a,b){this.setOptions(b);this.elements=[];this.lists=[];this.idle=true;this.addLists($$(document.id(a)||a));if(!this.options.clone){this.options.revert=false;}if(this.options.revert){this.effect=new Fx.Morph(null,$merge({duration:250,link:"cancel"},this.options.revert));}},attach:function(){this.addLists(this.lists);return this;},detach:function(){this.lists=this.removeLists(this.lists);return this;},addItems:function(){Array.flatten(arguments).each(function(a){this.elements.push(a);var b=a.retrieve("sortables:start",this.start.bindWithEvent(this,a));(this.options.handle?a.getElement(this.options.handle)||a:a).addEvent("mousedown",b);},this);return this;},addLists:function(){Array.flatten(arguments).each(function(a){this.lists.push(a);this.addItems(a.getChildren());},this);return this;},removeItems:function(){return $$(Array.flatten(arguments).map(function(a){this.elements.erase(a);var b=a.retrieve("sortables:start");(this.options.handle?a.getElement(this.options.handle)||a:a).removeEvent("mousedown",b);return a;},this));},removeLists:function(){return $$(Array.flatten(arguments).map(function(a){this.lists.erase(a);this.removeItems(a.getChildren());return a;},this));},getClone:function(b,a){if(!this.options.clone){return new Element("div").inject(document.body);}if($type(this.options.clone)=="function"){return this.options.clone.call(this,b,a,this.list);}return a.clone(true).setStyles({margin:"0px",position:"absolute",visibility:"hidden",width:a.getStyle("width")}).inject(this.list).setPosition(a.getPosition(a.getOffsetParent()));},getDroppables:function(){var a=this.list.getChildren();if(!this.options.constrain){a=this.lists.concat(a).erase(this.list);}return a.erase(this.clone).erase(this.element);},insert:function(c,b){var a="inside";if(this.lists.contains(b)){this.list=b;this.drag.droppables=this.getDroppables();}else{a=this.element.getAllPrevious().contains(b)?"before":"after";}this.element.inject(b,a);this.fireEvent("sort",[this.element,this.clone]);},start:function(b,a){if(!this.idle){return;}this.idle=false;this.element=a;this.opacity=a.get("opacity");this.list=a.getParent();this.clone=this.getClone(b,a);this.drag=new Drag.Move(this.clone,{snap:this.options.snap,container:this.options.constrain&&this.element.getParent(),droppables:this.getDroppables(),onSnap:function(){b.stop();this.clone.setStyle("visibility","visible");this.element.set("opacity",this.options.opacity||0);this.fireEvent("start",[this.element,this.clone]);}.bind(this),onEnter:this.insert.bind(this),onCancel:this.reset.bind(this),onComplete:this.end.bind(this)});this.clone.inject(this.element,"before");this.drag.start(b);},end:function(){this.drag.detach();this.element.set("opacity",this.opacity);if(this.effect){var a=this.element.getStyles("width","height");var b=this.clone.computePosition(this.element.getPosition(this.clone.offsetParent));this.effect.element=this.clone;this.effect.start({top:b.top,left:b.left,width:a.width,height:a.height,opacity:0.25}).chain(this.reset.bind(this));}else{this.reset();}},reset:function(){this.idle=true;this.clone.destroy();this.fireEvent("complete",this.element);},serialize:function(){var c=Array.link(arguments,{modifier:Function.type,index:$defined});var b=this.lists.map(function(d){return d.getChildren().map(c.modifier||function(f){return f.get("id");},this);},this);var a=c.index;if(this.lists.length==1){a=0;}return $chk(a)&&a>=0&&a<this.lists.length?b[a]:b;}});var Color=new Native({initialize:function(b,c){if(arguments.length>=3){c="rgb";b=Array.slice(arguments,0,3);}else{if(typeof b=="string"){if(b.match(/rgb/)){b=b.rgbToHex().hexToRgb(true);}else{if(b.match(/hsb/)){b=b.hsbToRgb();}else{b=b.hexToRgb(true);}}}}c=c||"rgb";switch(c){case"hsb":var a=b;b=b.hsbToRgb();b.hsb=a;break;case"hex":b=b.hexToRgb(true);break;}b.rgb=b.slice(0,3);b.hsb=b.hsb||b.rgbToHsb();b.hex=b.rgbToHex();return $extend(b,this);}});Color.implement({mix:function(){var a=Array.slice(arguments);var c=($type(a.getLast())=="number")?a.pop():50;var b=this.slice();a.each(function(d){d=new Color(d);for(var f=0;f<3;f++){b[f]=Math.round((b[f]/100*(100-c))+(d[f]/100*c));}});return new Color(b,"rgb");},invert:function(){return new Color(this.map(function(a){return 255-a;}));},setHue:function(a){return new Color([a,this.hsb[1],this.hsb[2]],"hsb");},setSaturation:function(a){return new Color([this.hsb[0],a,this.hsb[2]],"hsb");},setBrightness:function(a){return new Color([this.hsb[0],this.hsb[1],a],"hsb");}});var $RGB=function(d,c,a){return new Color([d,c,a],"rgb");};var $HSB=function(d,c,a){return new Color([d,c,a],"hsb");};var $HEX=function(a){return new Color(a,"hex");};Array.implement({rgbToHsb:function(){var b=this[0],c=this[1],k=this[2],h=0;var j=Math.max(b,c,k),f=Math.min(b,c,k);var l=j-f;var i=j/255,g=(j!=0)?l/j:0;if(g!=0){var d=(j-b)/l;var a=(j-c)/l;var m=(j-k)/l;if(b==j){h=m-a;}else{if(c==j){h=2+d-m;}else{h=4+a-d;}}h/=6;if(h<0){h++;}}return[Math.round(h*360),Math.round(g*100),Math.round(i*100)];},hsbToRgb:function(){var c=Math.round(this[2]/100*255);if(this[1]==0){return[c,c,c];}else{var a=this[0]%360;var g=a%60;var h=Math.round((this[2]*(100-this[1]))/10000*255);var d=Math.round((this[2]*(6000-this[1]*g))/600000*255);var b=Math.round((this[2]*(6000-this[1]*(60-g)))/600000*255);switch(Math.floor(a/60)){case 0:return[c,b,h];case 1:return[d,c,h];case 2:return[h,c,b];case 3:return[h,d,c];case 4:return[b,h,c];case 5:return[c,h,d];}}return false;}});String.implement({rgbToHsb:function(){var a=this.match(/\d{1,3}/g);return(a)?a.rgbToHsb():null;},hsbToRgb:function(){var a=this.match(/\d{1,3}/g);return(a)?a.hsbToRgb():null;}});var Group=new Class({initialize:function(){this.instances=Array.flatten(arguments);this.events={};this.checker={};},addEvent:function(b,a){this.checker[b]=this.checker[b]||{};this.events[b]=this.events[b]||[];if(this.events[b].contains(a)){return false;}else{this.events[b].push(a);}this.instances.each(function(c,d){c.addEvent(b,this.check.bind(this,[b,c,d]));},this);return this;},check:function(c,a,b){this.checker[c][b]=true;var d=this.instances.every(function(g,f){return this.checker[c][f]||false;},this);if(!d){return;}this.checker[c]={};this.events[c].each(function(f){f.call(this,this.instances,a);},this);}});Hash.Cookie=new Class({Extends:Cookie,options:{autoSave:true},initialize:function(b,a){this.parent(b,a);this.load();},save:function(){var a=JSON.encode(this.hash);if(!a||a.length>4096){return false;}if(a=="{}"){this.dispose();}else{this.write(a);}return true;},load:function(){this.hash=new Hash(JSON.decode(this.read(),true));return this;}});Hash.each(Hash.prototype,function(b,a){if(typeof b=="function"){Hash.Cookie.implement(a,function(){var c=b.apply(this.hash,arguments);if(this.options.autoSave){this.save();}return c;});}});var Scroller=new Class({Implements:[Events,Options],options:{area:20,velocity:1,onChange:function(a,b){this.element.scrollTo(a,b);},fps:50},initialize:function(b,a){this.setOptions(a);this.element=document.id(b);this.listener=($type(this.element)!="element")?document.id(this.element.getDocument().body):this.element;this.timer=null;this.bound={attach:this.attach.bind(this),detach:this.detach.bind(this),getCoords:this.getCoords.bind(this)};},start:function(){this.listener.addEvents({mouseover:this.bound.attach,mouseout:this.bound.detach});},stop:function(){this.listener.removeEvents({mouseover:this.bound.attach,mouseout:this.bound.detach});this.detach();this.timer=$clear(this.timer);},attach:function(){this.listener.addEvent("mousemove",this.bound.getCoords);},detach:function(){this.listener.removeEvent("mousemove",this.bound.getCoords);this.timer=$clear(this.timer);},getCoords:function(a){this.page=(this.listener.get("tag")=="body")?a.client:a.page;if(!this.timer){this.timer=this.scroll.periodical(Math.round(1000/this.options.fps),this);}},scroll:function(){var b=this.element.getSize(),a=this.element.getScroll(),g=this.element.getOffsets(),c=this.element.getScrollSize(),f={x:0,y:0};for(var d in this.page){if(this.page[d]<(this.options.area+g[d])&&a[d]!=0){f[d]=(this.page[d]-this.options.area-g[d])*this.options.velocity;}else{if(this.page[d]+this.options.area>(b[d]+g[d])&&a[d]+b[d]!=c[d]){f[d]=(this.page[d]-b[d]+this.options.area-g[d])*this.options.velocity;}}}if(f.y||f.x){this.fireEvent("change",[a.x+f.x,a.y+f.y]);}}});(function(){var a=function(c,b){return(c)?($type(c)=="function"?c(b):b.get(c)):"";};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle("display","block");},onHide:function(){this.tip.setStyle("display","none");},title:"title",text:function(b){return b.get("rel")||b.get("href");},showDelay:100,hideDelay:100,className:"tip-wrap",offset:{x:16,y:16},windowPadding:{x:0,y:0},fixed:false},initialize:function(){var b=Array.link(arguments,{options:Object.type,elements:$defined});this.setOptions(b.options);if(b.elements){this.attach(b.elements);}this.container=new Element("div",{"class":"tip"});},toElement:function(){if(this.tip){return this.tip;}this.container=new Element("div",{"class":"tip"});return this.tip=new Element("div",{"class":this.options.className,styles:{position:"absolute",top:0,left:0}}).adopt(new Element("div",{"class":"tip-top"}),this.container,new Element("div",{"class":"tip-bottom"})).inject(document.body);},attach:function(b){$$(b).each(function(d){var g=a(this.options.title,d),f=a(this.options.text,d);d.erase("title").store("tip:native",g).retrieve("tip:title",g);d.retrieve("tip:text",f);this.fireEvent("attach",[d]);var c=["enter","leave"];if(!this.options.fixed){c.push("move");}c.each(function(i){var h=d.retrieve("tip:"+i);if(!h){h=this["element"+i.capitalize()].bindWithEvent(this,d);}d.store("tip:"+i,h).addEvent("mouse"+i,h);},this);},this);return this;},detach:function(b){$$(b).each(function(d){["enter","leave","move"].each(function(f){d.removeEvent("mouse"+f,d.retrieve("tip:"+f)).eliminate("tip:"+f);});this.fireEvent("detach",[d]);if(this.options.title=="title"){var c=d.retrieve("tip:native");if(c){d.set("title",c);}}},this);return this;},elementEnter:function(c,b){this.container.empty();["title","text"].each(function(f){var d=b.retrieve("tip:"+f);if(d){this.fill(new Element("div",{"class":"tip-"+f}).inject(this.container),d);}},this);$clear(this.timer);this.timer=(function(){this.show(b);this.position((this.options.fixed)?{page:b.getPosition()}:c);}).delay(this.options.showDelay,this);},elementLeave:function(c,b){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this,b);this.fireForParent(c,b);},fireForParent:function(c,b){b=b.getParent();if(!b||b==document.body){return;}if(b.retrieve("tip:enter")){b.fireEvent("mouseenter",c);}else{this.fireForParent(c,b);}},elementMove:function(c,b){this.position(c);},position:function(f){if(!this.tip){document.id(this);}var c=window.getSize(),b=window.getScroll(),g={x:this.tip.offsetWidth,y:this.tip.offsetHeight},d={x:"left",y:"top"},h={};for(var i in d){h[d[i]]=f.page[i]+this.options.offset[i];if((h[d[i]]+g[i]-b[i])>c[i]-this.options.windowPadding[i]){h[d[i]]=f.page[i]-this.options.offset[i]-g[i];}}this.tip.setStyles(h);},fill:function(b,c){if(typeof c=="string"){b.set("html",c);}else{b.adopt(c);}},show:function(b){if(!this.tip){document.id(this);}this.fireEvent("show",[this.tip,b]);},hide:function(b){if(!this.tip){document.id(this);}this.fireEvent("hide",[this.tip,b]);}});})();var Asset={javascript:function(g,d){d=$extend({onload:$empty,document:document,check:$lambda(true)},d);var b=new Element("script",{src:g,type:"text/javascript"});var f=d.onload.bind(b),a=d.check,h=d.document;delete d.onload;delete d.check;delete d.document;b.addEvents({load:f,readystatechange:function(){if(["loaded","complete"].contains(this.readyState)){f();}}}).set(d);if(Browser.Engine.webkit419){var c=(function(){if(!$try(a)){return;}$clear(c);f();}).periodical(50);}return b.inject(h.head);},css:function(b,a){return new Element("link",$merge({rel:"stylesheet",media:"screen",type:"text/css",href:b},a)).inject(document.head);},image:function(c,b){b=$merge({onload:$empty,onabort:$empty,onerror:$empty},b);var d=new Image();var a=document.id(d)||new Element("img");["load","abort","error"].each(function(f){var g="on"+f;var h=b[g];delete b[g];d[g]=function(){if(!d){return;}if(!a.parentNode){a.width=d.width;a.height=d.height;}d=d.onload=d.onabort=d.onerror=null;h.delay(1,a,a);a.fireEvent(f,a,1);};});d.src=a.src=c;if(d&&d.complete){d.onload.delay(1);}return a.set(b);},images:function(d,c){c=$merge({onComplete:$empty,onProgress:$empty,onError:$empty,properties:{}},c);d=$splat(d);var a=[];var b=0;return new Elements(d.map(function(f){return Asset.image(f,$extend(c.properties,{onload:function(){c.onProgress.call(this,b,d.indexOf(f));b++;if(b==d.length){c.onComplete();}},onerror:function(){c.onError.call(this,b,d.indexOf(f));b++;if(b==d.length){c.onComplete();}}}));}));}};if(!window.console){var console={};}if(!console.log){console.log=function(){};}if(!console.warn){console.warn=console.log;}if(!console.error){console.error=console.warn;}MooTools.upgradeLog=function(){if(console[this.upgradeLogLevel]){console[this.upgradeLogLevel].apply(console,arguments);}};(function(){oldA=$A;window.$A=function(l,n,k){if(n!=undefined&&k!=undefined){MooTools.upgradeLog("1.1 > 1.2: $A no longer takes start and length arguments.");if(Browser.Engine.trident&&$type(l)=="collection"){n=n||0;if(n<0){n=l.length+n;}k=k||(l.length-n);var m=[];for(var j=0;j<k;j++){m[j]=l[n++];}return m;}n=(n||0)+((n<0)?l.length:0);var h=((!$chk(k))?l.length:k)+n;return Array.prototype.slice.call(l,n,h);}return oldA(l);};var f=["Array","Function","String","RegExp","Number","Window","Document","Element","Elements"];for(var c=0,b=f.length;c<b;c++){var d=f[c];var a=window[d];if(a){var g=a.extend;a.extend=function(h){MooTools.upgradeLog("1.1 > 1.2: native types no longer use .extend to add methods to prototypes but instead use .implement. NOTE: YOUR METHODS WERE NOT IMPLEMENTED ON THE NATIVE "+d.toUpperCase()+" PROTOTYPE.");return g.apply(this,arguments);};}}})();window.onDomReady=Window.onDomReady=function(a){MooTools.upgradeLog('1.1 > 1.2: window.onDomReady is no longer supported. Use window.addEvent("domready") instead');return window.addEvent("domready",a);};if(Browser.__defineGetter__){Browser.__defineGetter__("hasGetter",function(){return true;});}if(Browser.hasGetter){window.__defineGetter__("ie",function(){MooTools.upgradeLog("1.1 > 1.2: window.ie is deprecated. Use Browser.Engine.trident");return(Browser.Engine.name=="trident")?true:false;});window.__defineGetter__("ie6",function(){MooTools.upgradeLog("1.1 > 1.2: window.ie6 is deprecated. Use Browser.Engine.trident and Browser.Engine.version");return(Browser.Engine.name=="trident"&&Browser.Engine.version==4)?true:false;});window.__defineGetter__("ie7",function(){MooTools.upgradeLog("1.1 > 1.2: window.ie7 is deprecated. Use Browser.Engine.trident and Browser.Engine.version");return(Browser.Engine.name=="trident"&&Browser.Engine.version==5)?true:false;});window.__defineGetter__("gecko",function(){MooTools.upgradeLog("1.1 > 1.2: window.gecko is deprecated. Use Browser.Engine.gecko");return(Browser.Engine.name=="gecko")?true:false;});window.__defineGetter__("webkit",function(){MooTools.upgradeLog("1.1 > 1.2: window.webkit is deprecated. Use Browser.Engine.webkit");return(Browser.Engine.name=="webkit")?true:false;});window.__defineGetter__("webkit419",function(){MooTools.upgradeLog("1.1 > 1.2: window.webkit is deprecated. Use Browser.Engine.webkit and Browser.Engine.version");return(Browser.Engine.name=="webkit"&&Browser.Engine.version==419)?true:false;});window.__defineGetter__("webkit420",function(){MooTools.upgradeLog("1.1 > 1.2: window.webkit is deprecated. Use Browser.Engine.webkit and Browser.Engine.version");return(Browser.Engine.name=="webkit"&&Browser.Engine.version==420)?true:false;});window.__defineGetter__("opera",function(){MooTools.upgradeLog("1.1 > 1.2: window.opera is deprecated. Use Browser.Engine.presto");return(Browser.Engine.name=="presto")?true:false;});}else{window[Browser.Engine.name]=window[Browser.Engine.name+Browser.Engine.version]=true;window.ie=window.trident;window.ie6=window.trident4;window.ie7=window.trident5;}Array.implement({copy:function(b,a){MooTools.upgradeLog("1.1 > 1.2: Array.copy is deprecated. Use Array.splice");return $A(this,b,a);},remove:function(a){MooTools.upgradeLog("1.1 > 1.2: Array.remove is deprecated. Use Array.erase");return this.erase(a);},merge:function(a){MooTools.upgradeLog("1.1 > 1.2: Array.merge is deprecated. Use Array.combine");return this.combine(a);}});Function.implement({bindAsEventListener:function(b,a){MooTools.upgradeLog("1.1 > 1.2: Function.bindAsEventListener is deprecated. Use bindWithEvent.");return this.bindWithEvent.call(this,b,a);}});Function.empty=function(){MooTools.upgradeLog("1.1 > 1.2: Function.empty is now just $empty.");};Hash.implement({keys:function(){MooTools.upgradeLog("1.1 > 1.2: Hash.keys is deprecated. Use Hash.getKeys");return this.getKeys();},values:function(){MooTools.upgradeLog("1.1 > 1.2: Hash.values is deprecated. Use Hash.getValues");return this.getValues();},hasKey:function(a){MooTools.upgradeLog("1.1 > 1.2: Hash.hasKey is deprecated. Use Hash.has");return this.has(a);},merge:function(a){MooTools.upgradeLog("1.1 > 1.2: Hash.merge is deprecated. Use Hash.combine");return this.extend(a);},remove:function(a){MooTools.upgradeLog("1.1 > 1.2: Hash.remove is deprecated. use Hash.erase");return this.erase(a);}});Object.toQueryString=function(a){MooTools.upgradeLog("1.1 > 1.2: Object.toQueryString() is deprecated. use Hash.toQueryString() instead");$H(a).each(function(c,b){if($type(c)=="object"||$type(c)=="array"){a[b]=c.toString();}});return Hash.toQueryString(a);};var Abstract=function(a){MooTools.upgradeLog("1.1 > 1.2: Abstract is deprecated. Use Hash");return new Hash(a);};Class.empty=function(){MooTools.upgradeLog("1.1 > 1.2: replace Class.empty with $empty");return $empty;};(function(){var a=function(d){var c=function(){return this;};c.prototype=d;return c;};Class.prototype.extend=function(d){MooTools.upgradeLog("1.1 > 1.2: Class.extend is deprecated. See the class Extend mutator.");var c=a(d);var f=new c();f.Extends=this;return new Class(f);};var b=Class.prototype.implement;Class.prototype.implement=function(){if(arguments.length>1&&Array.every(arguments,Object.type)){MooTools.upgradeLog("1.1 > 1.2: Class.implement no longer takes more than one thing at a time, either MyClass.implement(key, value) or MyClass.implement(object) but NOT MyClass.implement(new Foo, new Bar, new Baz). See also: the class Implements mutator.");Array.each(arguments,function(c){b.call(this,c);},this);return this;}return b.apply(this,arguments);};})();(function(){var c=Element.prototype.getPosition;var a=Element.prototype.getCoordinates;function b(f){return(/^(?:body|html)$/i).test(f.tagName);}var d=Element.prototype.getSize;Element.implement({getSize:function(){MooTools.upgradeLog("1.1 > 1.2: NOTE: getSize is different in 1.2; it no longer returns values for size, scroll, and scrollSize, but instead just returns x/y values for the dimensions of the element.");var f=d.apply(this,arguments);return $merge(f,{size:f,scroll:this.getScroll(),scrollSize:this.getScrollSize()});},getPosition:function(f){if(f&&$type(f)=="array"){MooTools.upgradeLog("1.1 > 1.2: Element.getPosition no longer accepts an array of overflown elements but rather, optionally, a single element to get relative coordinates.");f=null;}return c.apply(this,[f]);},getCoordinates:function(f){if(f&&$type(f)=="array"){MooTools.upgradeLog("1.1 > 1.2: Element.getCoordinates no longer accepts an array of overflown elements but rather, optionally, a single element to get relative coordinates.");f=null;}return a.apply(this,[f]);}});Native.implement([Document,Window],{getSize:function(){MooTools.upgradeLog("1.1 > 1.2: NOTE: getSize is different in 1.2; it no longer returns values for size, scroll, and scrollSize, but instead just returns x/y values for the dimensions of the element.");var f;var h=this.getWindow();var g=this.getDocument();g=(!g.compatMode||g.compatMode=="CSS1Compat")?g.html:g.body;if(Browser.Engine.presto||Browser.Engine.webkit){f={x:h.innerWidth,y:h.innerHeight};}else{f={x:g.clientWidth,y:g.clientHeight};}return $extend(f,{size:f,scroll:{x:h.pageXOffset||g.scrollLeft,y:h.pageYOffset||g.scrollTop},scrollSize:{x:Math.max(g.scrollWidth,f.x),y:Math.max(g.scrollHeight,f.y)}});}});})();Event.keys=Event.Keys;(function(){var a=Element.prototype.toQueryString;Element.implement({getFormElements:function(){MooTools.upgradeLog('1.1 > 1.2: Element.getFormElements is deprecated, use Element.getElements("input, textarea, select");');return this.getElements("input, textarea, select");},replaceWith:function(b){MooTools.upgradeLog("1.1 > 1.2: Element.replaceWith is deprecated, use Element.replaces instead.");b=$(b);this.parentNode.replaceChild(b,this);return b;},remove:function(){MooTools.upgradeLog("1.1 > 1.2: Element.remove is deprecated - use Element.dispose.");return this.dispose.apply(this,arguments);},getText:function(){MooTools.upgradeLog('1.1 > 1.2: Element.getText is deprecated - use Element.get("text").');return this.get("text");},setText:function(b){MooTools.upgradeLog('1.1 > 1.2: Element.setText is deprecated - use Element.set("text", text).');return this.set("text",b);},setHTML:function(){MooTools.upgradeLog('1.1 > 1.2: Element.setHTML is deprecated - use Element.set("html", HTML).');return this.set("html",arguments);},getHTML:function(){MooTools.upgradeLog('1.1 > 1.2: Element.getHTML is deprecated - use Element.get("html").');return this.get("html");},getTag:function(){MooTools.upgradeLog('1.1 > 1.2: Element.getTag is deprecated - use Element.get("tag").');return this.get("tag");},getValue:function(){MooTools.upgradeLog('1.1 > 1.2: Element.getValue is deprecated - use Element.get("value").');switch(this.getTag()){case"select":var b=[];$each(this.options,function(c){if(c.selected){b.push($pick(c.value,c.text));}});return(this.multiple)?b:b[0];case"input":if(!(this.checked&&["checkbox","radio"].contains(this.type))&&!["hidden","text","password"].contains(this.type)){break;}case"textarea":return this.value;}return false;},toQueryString:function(){MooTools.upgradeLog("1.1 > 1.2: warning Element.toQueryString is slightly different; inputs without names are excluded, inputs with type == submit, reset, and file are excluded, and inputs with undefined values are excluded.");return a.apply(this,arguments);}});})();Element.Properties.properties={set:function(a){MooTools.upgradeLog("1.1 > 1.2: Element.set({properties: {}}) is deprecated; instead of properties, just name the values at the root of the object (Element.set({src: url})).");$H(a).each(function(c,b){this.set(b,c);},this);}};Element.implement({setOpacity:function(a){MooTools.upgradeLog('1.1 > 1.2: Element.setOpacity is deprecated; use Element.setStyle("opacity", value).');return this.setStyle("opacity",a);}});Element.Properties.styles={set:function(a){MooTools.upgradeLog('1.1 > 1.2: Element.set("styles") no longer accepts a string as an argument. Pass an object instead.');if($type(a)=="string"){a.split(";").each(function(b){this.setStyle(b.split(":")[0],b.split(":")[1]);},this);}else{this.setStyles(a);}}};Fx.implement({custom:function(b,a){MooTools.upgradeLog("1.1 > 1.2: Fx.custom is deprecated. use Fx.start.");return this.start(b,a);},clearTimer:function(){MooTools.upgradeLog("1.1 > 1.2: Fx.clearTimer is deprecated. use Fx.cancel.");return this.cancel();},stop:function(){MooTools.upgradeLog("1.1 > 1.2: Fx.stop is deprecated. use Fx.cancel.");return this.cancel();}});Fx.Base=new Class({Extends:Fx,initialize:function(){MooTools.upgradeLog("1.1 > 1.2: Fx.Base is deprecated. use Fx.");this.parent.apply(this,arguments);}});Fx.Style=new Class({Extends:Fx.Tween,initialize:function(b,c,a){MooTools.upgradeLog("1.1 > 1.2: Fx.Style is deprecated. use Fx.Tween.");this.property=c;this.parent(b,a);},start:function(b,a){return this.parent(this.property,b,a);},set:function(a){return this.parent(this.property,a);},hide:function(){MooTools.upgradeLog("1.1 > 1.2: Fx.Style .hide() is deprecated; use Fx.Tween .set(0) instead");return this.set(0);}});Element.implement({effect:function(b,a){MooTools.upgradeLog("1.1 > 1.2: Element.effect is deprecated; use Fx.Tween or Element.tween.");return new Fx.Style(this,b,a);}});Fx.Styles=new Class({Extends:Fx.Morph,initialize:function(){MooTools.upgradeLog("1.1 > 1.2: Fx.Styles is deprecated. use Fx.Morph.");this.parent.apply(this,arguments);}});Element.implement({effects:function(a){MooTools.upgradeLog("1.1 > 1.2: Element.effects is deprecated; use Fx.Morph or Element.morph.");return new Fx.Morph(this,a);}});Fx.Scroll.implement({scrollTo:function(b,a){MooTools.upgradeLog("1.1 > 1.2: Fx.Scroll's .scrollTo is deprecated; use .start.");return this.start(b,a);}});Request.implement({onStateChange:function(){if(this.xhr.readyState!=4||!this.running){return;}this.running=false;this.status=0;$try(function(){this.status=this.xhr.status;}.bind(this));this.xhr.onreadystatechange=$empty;this.response={text:this.xhr.responseText,xml:this.xhr.responseXML};if(this.options.isSuccess.call(this,this.status)){this.success(this.response.text,this.response.xml);}else{this.failure(this.response.text,this.response.xml);}},failure:function(){this.onFailure.apply(this,arguments);},onFailure:function(){MooTools.upgradeLog("1.1 > 1.2: Note that onComplete does not receive arguments in 1.2. Also note that onComplete is invoked on BOTH success and failure (while in 1.1 it was only invoked on success). Use the onSuccess event instead if you wish to limit this invocation to success.");this.fireEvent("complete",arguments).fireEvent("failure",this.xhr);}});var XHR=new Class({Extends:Request,options:{update:false},initialize:function(a){MooTools.upgradeLog("1.1 > 1.2: XHR is deprecated. Use Request.");this.parent(a);this.transport=this.xhr;},request:function(a){MooTools.upgradeLog("1.1 > 1.2: XHR.request() is deprecated. Use Request.send() instead.");return this.send(this.url,a||this.options.data);},send:function(a,b){if(!this.check(arguments.callee,a,b)){return this;}return this.parent({url:a,data:b});},success:function(b,a){b=this.processScripts(b);if(this.options.update){$(this.options.update).empty().set("html",b);}this.onSuccess(b,a);},failure:function(){this.fireEvent("failure",this.xhr);}});var Ajax=new Class({Extends:XHR,initialize:function(b,a){MooTools.upgradeLog("1.1 > 1.2: Ajax is deprecated. Use Request.");this.url=b;this.parent(a);},success:function(b,a){this.processScripts(b);response=this.response;response.html=b.stripScripts(function(c){response.javascript=c;});if(this.options.update){$(this.options.update).empty().set("html",response.html);}if(this.options.evalScripts){$exec(response.javascript);}this.onSuccess(b,a);}});(function(){var a=Element.prototype.send;Element.implement({send:function(b){if($type(b)=="string"){return a.apply(this,arguments);}if($type(b)=="object"){MooTools.upgradeLog("1.1 > 1.2: Element.send no longer takes an options argument as its object but rather a url. See docs.");this.set("send",b);a.call(this);}return this;}});})();JSON.Remote=new Class({options:{key:"json"},Extends:Request.JSON,initialize:function(b,a){MooTools.upgradeLog("JSON.Remote is deprecated. Use Request.JSON");this.parent(a);this.onComplete=$empty;this.url=b;},send:function(a){if(!this.check(arguments.callee,a)){return this;}return this.parent({url:this.url,data:{json:Json.encode(a)}});},failure:function(){this.fireEvent("failure",this.xhr);}});Cookie.set=function(b,c,a){MooTools.upgradeLog("1.1 > 1.2: Cookie.set is deprecated. Use Cookie.write");return new Cookie(b,a).write(c);};Cookie.get=function(a){MooTools.upgradeLog("1.1 > 1.2: Cookie.get is deprecated. Use Cookie.read");return new Cookie(a).read();};Cookie.remove=function(b,a){MooTools.upgradeLog("1.1 > 1.2: Cookie.remove is deprecated. Use Cookie.dispose");return new Cookie(b,a).dispose();};JSON.toString=function(a){MooTools.upgradeLog("1.1 > 1.2: JSON.toString is deprecated. Use JSON.encode");return JSON.encode(a);};JSON.evaluate=function(a){MooTools.upgradeLog("1.1 > 1.2: JSON.evaluate is deprecated. Use JSON.decode");return JSON.decode(a);};var Json=JSON;Native.implement([Element,Document],{getElementsByClassName:function(a){MooTools.upgradeLog("1.1 > 1.2: Element.filterByTag is deprecated.");return this.getElements("."+a);},getElementsBySelector:function(a){MooTools.upgradeLog("1.1 > 1.2: Element.getElementsBySelector is deprecated. Use getElements()");return this.getElements(a);}});Elements.implement({filterByTag:function(a){MooTools.upgradeLog("1.1 > 1.2: Elements.filterByTag is deprecated. Use Elements.filter.");return this.filter(a);},filterByClass:function(a){MooTools.upgradeLog("1.1 > 1.2: Elements.filterByClass is deprecated. Use Elements.filter.");return this.filter("."+a);},filterById:function(a){MooTools.upgradeLog("1.1 > 1.2: Elements.filterById is deprecated. Use Elements.filter.");return this.filter("#"+a);},filterByAttribute:function(c,a,d){MooTools.upgradeLog("1.1 > 1.2: Elements.filterByAttribute is deprecated. Use Elements.filter.");var b=this.filter("["+c+(a||"")+(d||"")+"]");if(d){b=b.filter("["+c+"]");}return b;}});var $E=function(a,b){MooTools.upgradeLog("1.1 > 1.2: $E is deprecated, use document.getElement.");return($(b)||document).getElement(a);};var $ES=function(a,b){MooTools.upgradeLog("1.1 > 1.2: $ES is deprecated. Use $$.");return($(b)||document).getElements(a);};(function(){if(!window.Tips){return;}Tips.implement({initialize:function(){MooTools.upgradeLog("1.1 > 1.2: Tips DOM element layout has changed and your CSS classes may need to change.");var a=Array.link(arguments,{options:Object.type,elements:$defined});this.setOptions(a.options);if(this.options.offsets){MooTools.upgradeLog('1.1 > 1.2: Tips no longer have an "offsets" option; use "offset".');this.options.offset=this.options.offsets;}document.id(this);this.addEvent("show",function(){this.tip.addClass("tool-tip");this.tip.getElement(".tip-title").addClass("tool-title");this.tip.getElement(".tip-text").addClass("tool-text");});this.parseTitle(a.elements);if(a.elements){this.attach(a.elements);}},parseTitle:function(a){a.each(function(b){var c=b.get("title");if(c.test("::")){MooTools.upgradeLog('1.1 > 1.2: Tips no longer parse the title attribute for "::" for title/caption; use title and rel attributes instead.');b.store("tip:title",c.split("::")[0]);b.store("tip:text",c.split("::")[1]);b.set("title","");}});}});})();
\ No hay ningún carácter de nueva línea al final del fichero
diff -aruN --binary 22/plugins/system/mtupgrade/mootools-uncompressed.js 23/plugins/system/mtupgrade/mootools-uncompressed.js
--- 22/plugins/system/mtupgrade/mootools-uncompressed.js	2010-07-18 04:20:32.000000000 +0200
+++ 23/plugins/system/mtupgrade/mootools-uncompressed.js	2011-04-04 22:46:26.000000000 +0200
@@ -1,12 +1,7 @@
-//MooTools, <http://mootools.net>, My Object Oriented (JavaScript) Tools. Copyright (c) 2006-2009 Valerio Proietti, <http://mad4milk.net>, MIT Style License.
-//MooTools More, <http://mootools.net/more>. Copyright (c) 2006-2009 Aaron Newton <http://clientcide.com/>, Valerio Proietti <http://mad4milk.net> & the MooTools team <http://mootools.net/developers>, MIT Style License.
-
-//Contents: Core, Browser, Array, Function, Number, String, Hash, Event, Class, Class.Extras, Element, Element.Event, Element.Style, Element.Dimensions, Selectors, DomReady, JSON, Cookie, Swiff, Fx, Fx.CSS, Fx.Tween, Fx.Morph, Fx.Transitions, Request, Request.HTML, Request.JSON, More, Fx.Elements, Fx.Accordion, Fx.Scroll, Fx.Slide, Fx.SmoothScroll, Drag, Drag.Move, Class.Binds, Element.Measure, Slider, Sortables, Color, Group, Hash.Cookie, Scroller, Tips
-
 /*
 ---
 
-script: Core.js
+name: Core
 
 description: The core of MooTools, contains all the base functions and the Native and Hash implementations. Required by all the other scripts.
 
@@ -17,17 +12,17 @@
 authors: The MooTools production team (http://mootools.net/developers/)
 
 inspiration:
-- Class implementation inspired by [Base.js](http://dean.edwards.name/weblog/2006/03/base/) Copyright (c) 2006 Dean Edwards, [GNU Lesser General Public License](http://opensource.org/licenses/lgpl-license.php)
-- Some functionality inspired by [Prototype.js](http://prototypejs.org) Copyright (c) 2005-2007 Sam Stephenson, [MIT License](http://opensource.org/licenses/mit-license.php)
+  - Class implementation inspired by [Base.js](http://dean.edwards.name/weblog/2006/03/base/) Copyright (c) 2006 Dean Edwards, [GNU Lesser General Public License](http://opensource.org/licenses/lgpl-license.php)
+  - Some functionality inspired by [Prototype.js](http://prototypejs.org) Copyright (c) 2005-2007 Sam Stephenson, [MIT License](http://opensource.org/licenses/mit-license.php)
 
-provides: [Mootools, Native, Hash.base, Array.each, $util]
+provides: [MooTools, Native, Hash.base, Array.each, $util]
 
 ...
 */
 
 var MooTools = {
-	'version': '1.2.4',
-	'build': '0d9113241a90b9cd5643b926795852a2026710d4'
+	'version': '1.2.5',
+	'build': '008d8f0f2fcc2044e54fdd3635341aaab274e757'
 };
 
 var Native = function(options){
@@ -294,18 +289,18 @@
 	}
 	return unlinked;
 };
+
+
 /*
 ---
 
-script: Browser.js
+name: Browser
 
 description: The Browser Core. Contains Browser initialization, Window and Document, and the Browser Hash.
 
 license: MIT-style license.
 
-requires: 
-- /Native
-- /$util
+requires: [Native, $util]
 
 provides: [Browser, Window, Document, $exec]
 
@@ -462,20 +457,20 @@
 Document.Prototype = {$family: {name: 'document'}};
 
 new Document(document);
+
+
 /*
 ---
 
-script: Array.js
+name: Array
 
 description: Contains Array Prototypes like each, contains, and erase.
 
 license: MIT-style license.
 
-requires:
-- /$util
-- /Array.each
+requires: [$util, Array.each]
 
-provides: [Array]
+provides: Array
 
 ...
 */
@@ -612,24 +607,28 @@
 	}
 
 });
+
+
 /*
 ---
 
-script: Function.js
+name: Function
 
 description: Contains Function Prototypes like create, bind, pass, and delay.
 
 license: MIT-style license.
 
-requires:
-- /Native
-- /$util
+requires: [Native, $util]
 
-provides: [Function]
+provides: Function
 
 ...
 */
 
+try {
+	delete Function.prototype.bind;
+} catch(e){}
+
 Function.implement({
 
 	extend: function(properties){
@@ -683,20 +682,20 @@
 	}
 
 });
+
+
 /*
 ---
 
-script: Number.js
+name: Number
 
 description: Contains Number Prototypes like limit, round, times, and ceil.
 
 license: MIT-style license.
 
-requires:
-- /Native
-- /$util
+requires: [Native, $util]
 
-provides: [Number]
+provides: Number
 
 ...
 */
@@ -737,19 +736,20 @@
 	});
 	Number.implement(methods);
 })(['abs', 'acos', 'asin', 'atan', 'atan2', 'ceil', 'cos', 'exp', 'floor', 'log', 'max', 'min', 'pow', 'sin', 'sqrt', 'tan']);
+
+
 /*
 ---
 
-script: String.js
+name: String
 
 description: Contains String Prototypes like camelCase, capitalize, test, and toInt.
 
 license: MIT-style license.
 
-requires:
-- /Native
+requires: Native
 
-provides: [String]
+provides: String
 
 ...
 */
@@ -831,19 +831,20 @@
 	}
 
 });
+
+
 /*
 ---
 
-script: Hash.js
+name: Hash
 
 description: Contains Hash Prototypes. Provides a means for overcoming the JavaScript practical impossibility of extending native Objects.
 
 license: MIT-style license.
 
-requires:
-- /Hash.base
+requires: Hash.base
 
-provides: [Hash]
+provides: Hash
 
 ...
 */
@@ -974,24 +975,20 @@
 });
 
 Hash.alias({keyOf: 'indexOf', hasValue: 'contains'});
+
+
 /*
 ---
 
-script: Event.js
+name: Event
 
 description: Contains the Event Class, to make the event object cross-browser.
 
 license: MIT-style license.
 
-requires:
-- /Window
-- /Document
-- /Hash
-- /Array
-- /Function
-- /String
+requires: [Window, Document, Hash, Array, Function, String]
 
-provides: [Event]
+provides: Event
 
 ...
 */
@@ -1102,25 +1099,20 @@
 	}
 
 });
+
+
 /*
 ---
 
-script: Class.js
+name: Class
 
 description: Contains the Class Function for easily creating, extending, and implementing reusable Classes.
 
 license: MIT-style license.
 
-requires:
-- /$util
-- /Native
-- /Array
-- /String
-- /Function
-- /Number
-- /Hash
+requires: [$util, Native, Array, String, Function, Number, Hash]
 
-provides: [Class]
+provides: Class
 
 ...
 */
@@ -1269,19 +1261,20 @@
 	}
 	
 };
+
+
 /*
 ---
 
-script: Class.Extras.js
+name: Class.Extras
 
 description: Contains Utility Classes that can be implemented into your own Classes to ease the execution of many common tasks.
 
 license: MIT-style license.
 
-requires:
-- /Class
+requires: Class
 
-provides: [Chain, Events, Options]
+provides: [Chain, Events, Options, Class.Extras]
 
 ...
 */
@@ -1378,23 +1371,18 @@
 	}
 
 });
+
+
 /*
 ---
 
-script: Element.js
+name: Element
 
 description: One of the most important items in MooTools. Contains the dollar function, the dollars function, and an handful of cross-browser, time-saver methods to let you easily work with HTML Elements.
 
 license: MIT-style license.
 
-requires:
-- /Window
-- /Document
-- /Array
-- /String
-- /Function
-- /Number
-- /Hash
+requires: [Window, Document, Array, String, Function, Number, Hash]
 
 provides: [Element, Elements, $, $$, Iframe]
 
@@ -1501,18 +1489,35 @@
 
 });
 
+(function(){
+
+/*<ltIE8>*/
+var createElementAcceptsHTML;
+try {
+	var x = document.createElement('<input name=x>');
+	createElementAcceptsHTML = (x.name == 'x');
+} catch(e){}
+
+var escapeQuotes = function(html){
+	return ('' + html).replace(/&/g,'&amp;').replace(/"/g,'&quot;');
+};
+/*</ltIE8>*/
+
 Document.implement({
 
 	newElement: function(tag, props){
-		if (Browser.Engine.trident && props){
-			['name', 'type', 'checked'].each(function(attribute){
-				if (!props[attribute]) return;
-				tag += ' ' + attribute + '="' + props[attribute] + '"';
-				if (attribute != 'checked') delete props[attribute];
-			});
-			tag = '<' + tag + '>';
+		if (props && props.checked != null) props.defaultChecked = props.checked;
+		/*<ltIE8>*/// Fix for readonly name and type properties in IE < 8
+		if (createElementAcceptsHTML && props){
+			tag = '<' + tag;
+			if (props.name) tag += ' name="' + escapeQuotes(props.name) + '"';
+			if (props.type) tag += ' type="' + escapeQuotes(props.type) + '"';
+			tag += '>';
+			delete props.name;
+			delete props.type;
 		}
-		return document.id(this.createElement(tag)).set(props);
+		/*</ltIE8>*/
+		return this.id(this.createElement(tag)).set(props);
 	},
 
 	newTextNode: function(text){
@@ -1564,6 +1569,8 @@
 
 });
 
+})();
+
 if (window.$ == null) Window.implement({
 	$: function(el, nc){
 		return document.id(el, nc, this.document);
@@ -1627,6 +1634,7 @@
 var clean = function(item, retain){
 	if (!item) return;
 	var uid = item.uid;
+	if (retain !== true) retain = false;
 	if (Browser.Engine.trident){
 		if (item.clearAttributes){
 			var clone = retain && item.cloneNode(false);
@@ -2087,20 +2095,20 @@
 		return text;
 	}
 };
+
+
 /*
 ---
 
-script: Element.Event.js
+name: Element.Event
 
 description: Contains Element methods for dealing with events. This file also includes mouseenter and mouseleave custom Element Events.
 
 license: MIT-style license.
 
-requires: 
-- /Element
-- /Event
+requires: [Element, Event]
 
-provides: [Element.Event]
+provides: Element.Event
 
 ...
 */
@@ -2207,6 +2215,12 @@
 
 });
 
+// IE9
+try {
+	if (typeof HTMLElement != 'undefined')
+		HTMLElement.prototype.fireEvent = Element.prototype.fireEvent;
+} catch(e){}
+
 Element.NativeEvents = {
 	click: 2, dblclick: 2, mouseup: 2, mousedown: 2, contextmenu: 2, //mouse buttons
 	mousewheel: 2, DOMMouseScroll: 2, //mouse wheel
@@ -2245,19 +2259,20 @@
 });
 
 })();
+
+
 /*
 ---
 
-script: Element.Style.js
+name: Element.Style
 
 description: Contains methods for interacting with the styles of Elements in a fashionable way.
 
 license: MIT-style license.
 
-requires:
-- /Element
+requires: Element
 
-provides: [Element.Style]
+provides: Element.Style
 
 ...
 */
@@ -2394,23 +2409,24 @@
 	Short.borderStyle[bds] = Short[bd][bds] = All[bds] = '@';
 	Short.borderColor[bdc] = Short[bd][bdc] = All[bdc] = 'rgb(@, @, @)';
 });
+
+
 /*
 ---
 
-script: Element.Dimensions.js
+name: Element.Dimensions
 
 description: Contains methods to work with size, scroll, or positioning of Elements and the window object.
 
 license: MIT-style license.
 
 credits:
-- Element positioning based on the [qooxdoo](http://qooxdoo.org/) code and smart browser fixes, [LGPL License](http://www.gnu.org/licenses/lgpl.html).
-- Viewport dimensions based on [YUI](http://developer.yahoo.com/yui/) code, [BSD License](http://developer.yahoo.com/yui/license.html).
+  - Element positioning based on the [qooxdoo](http://qooxdoo.org/) code and smart browser fixes, [LGPL License](http://www.gnu.org/licenses/lgpl.html).
+  - Viewport dimensions based on [YUI](http://developer.yahoo.com/yui/) code, [BSD License](http://developer.yahoo.com/yui/license.html).
 
-requires:
-- /Element
+requires: Element
 
-provides: [Element.Dimensions]
+provides: Element.Dimensions
 
 ...
 */
@@ -2652,19 +2668,20 @@
 	}
 
 });
+
+
 /*
 ---
 
-script: Selectors.js
+name: Selectors
 
 description: Adds advanced CSS-style querying capabilities for targeting HTML Elements. Includes pseudo selectors.
 
 license: MIT-style license.
 
-requires:
-- /Element
+requires: Element
 
-provides: [Selectors]
+provides: Selectors
 
 ...
 */
@@ -3028,19 +3045,20 @@
 	}
 
 });
+
+
 /*
 ---
 
-script: DomReady.js
+name: DomReady
 
 description: Contains the custom event domready.
 
 license: MIT-style license.
 
-requires:
-- /Element.Event
+requires: Element.Event
 
-provides: [DomReady]
+provides: DomReady
 
 ...
 */
@@ -3081,25 +3099,22 @@
 	}
 
 })();
+
+
 /*
 ---
 
-script: JSON.js
+name: JSON
 
 description: JSON encoder and decoder.
 
 license: MIT-style license.
 
-See Also: <http://www.json.org/>
+see: <http://www.json.org/>
 
-requires:
-- /Array
-- /String
-- /Number
-- /Function
-- /Hash
+requires: [Array, String, Number, Function, Hash]
 
-provides: [JSON]
+provides: JSON
 
 ...
 */
@@ -3142,29 +3157,21 @@
 
 });
 
-Native.implement([Hash, Array, String, Number], {
 
-	toJSON: function(){
-		return JSON.encode(this);
-	}
-
-});
 /*
 ---
 
-script: Cookie.js
+name: Cookie
 
 description: Class for creating, reading, and deleting browser Cookies.
 
 license: MIT-style license.
 
-credits:
-- Based on the functions by Peter-Paul Koch (http://quirksmode.org).
+credits: Based on the functions by Peter-Paul Koch (http://quirksmode.org).
 
-requires:
-- /Options
+requires: Options
 
-provides: [Cookie]
+provides: Cookie
 
 ...
 */
@@ -3223,23 +3230,22 @@
 Cookie.dispose = function(key, options){
 	return new Cookie(key, options).dispose();
 };
+
+
 /*
 ---
 
-script: Swiff.js
+name: Swiff
 
 description: Wrapper for embedding SWF movies. Supports External Interface Communication.
 
 license: MIT-style license.
 
-credits: 
-- Flash detection & Internet Explorer + Flash Player 9 fix inspired by SWFObject.
+credits: Flash detection & Internet Explorer + Flash Player 9 fix inspired by SWFObject.
 
-requires:
-- /Options
-- /$util
+requires: [Options, $util]
 
-provides: [Swiff]
+provides: Swiff
 
 ...
 */
@@ -3333,21 +3339,20 @@
 	var rs = obj.CallFunction('<invoke name="' + fn + '" returntype="javascript">' + __flash__argumentsToXML(arguments, 2) + '</invoke>');
 	return eval(rs);
 };
+
+
 /*
 ---
 
-script: Fx.js
+name: Fx
 
 description: Contains the basic animation logic to be extended by all other Fx Classes.
 
 license: MIT-style license.
 
-requires:
-- /Chain
-- /Events
-- /Options
+requires: [Chain, Events, Options]
 
-provides: [Fx]
+provides: Fx
 
 ...
 */
@@ -3475,20 +3480,20 @@
 };
 
 Fx.Durations = {'short': 250, 'normal': 500, 'long': 1000};
+
+
 /*
 ---
 
-script: Fx.CSS.js
+name: Fx.CSS
 
 description: Contains the CSS animation logic. Used by Fx.Tween, Fx.Morph, Fx.Elements.
 
 license: MIT-style license.
 
-requires:
-- /Fx
-- /Element.Style
+requires: [Fx, Element.Style]
 
-provides: [Fx.CSS]
+provides: Fx.CSS
 
 ...
 */
@@ -3617,17 +3622,18 @@
 	}
 
 });
+
+
 /*
 ---
 
-script: Fx.Tween.js
+name: Fx.Tween
 
 description: Formerly Fx.Style, effect to transition any CSS property for an element.
 
 license: MIT-style license.
 
-requires: 
-- /Fx.CSS
+requires: Fx.CSS
 
 provides: [Fx.Tween, Element.fade, Element.highlight]
 
@@ -3721,19 +3727,20 @@
 	}
 
 });
+
+
 /*
 ---
 
-script: Fx.Morph.js
+name: Fx.Morph
 
 description: Formerly Fx.Styles, effect to transition any number of CSS properties for an element using an object of rules, or CSS based selector rules.
 
 license: MIT-style license.
 
-requires:
-- /Fx.CSS
+requires: Fx.CSS
 
-provides: [Fx.Morph]
+provides: Fx.Morph
 
 ...
 */
@@ -3799,22 +3806,22 @@
 	}
 
 });
+
+
 /*
 ---
 
-script: Fx.Transitions.js
+name: Fx.Transitions
 
 description: Contains a set of advanced transitions to be used with any of the Fx Classes.
 
 license: MIT-style license.
 
-credits:
-- Easing Equations by Robert Penner, <http://www.robertpenner.com/easing/>, modified and optimized to be used with MooTools.
+credits: Easing Equations by Robert Penner, <http://www.robertpenner.com/easing/>, modified and optimized to be used with MooTools.
 
-requires:
-- /Fx
+requires: Fx
 
-provides: [Fx.Transitions]
+provides: Fx.Transitions
 
 ...
 */
@@ -3904,23 +3911,20 @@
 		return Math.pow(p, [i + 2]);
 	});
 });
+
+
 /*
 ---
 
-script: Request.js
+name: Request
 
 description: Powerful all purpose Request Class. Uses XMLHTTPRequest.
 
 license: MIT-style license.
 
-requires:
-- /Element
-- /Chain
-- /Events
-- /Options
-- /Browser
+requires: [Element, Chain, Events, Options, Browser]
 
-provides: [Request]
+provides: Request
 
 ...
 */
@@ -4142,20 +4146,20 @@
 	}
 
 });
+
+
 /*
 ---
 
-script: Request.HTML.js
+name: Request.HTML
 
 description: Extends the basic Request Class with additional methods for interacting with HTML responses.
 
 license: MIT-style license.
 
-requires:
-- /Request
-- /Element
+requires: [Request, Element]
 
-provides: [Request.HTML]
+provides: Request.HTML
 
 ...
 */
@@ -4244,19 +4248,20 @@
 	}
 
 });
+
+
 /*
 ---
 
-script: Request.JSON.js
+name: Request.JSON
 
 description: Extends the basic Request Class with additional methods for sending and receiving JSON data.
 
 license: MIT-style license.
 
-requires:
-- /Request JSON
+requires: [Request, JSON]
 
-provides: [Request.HTML]
+provides: [Request.JSON]
 
 ...
 */
@@ -4280,6 +4285,7 @@
 	}
 
 });
+
 /*
 ---
 
diff -aruN --binary 22/plugins/system/mtupgrade.xml 23/plugins/system/mtupgrade.xml
--- 22/plugins/system/mtupgrade.xml	2010-07-18 04:20:32.000000000 +0200
+++ 23/plugins/system/mtupgrade.xml	2011-04-04 22:46:26.000000000 +0200
@@ -3,12 +3,12 @@
 	<name>System - Mootools Upgrade</name>
 	<author>Joomla! Project</author>
 	<creationDate>June 2010</creationDate>
-	<copyright>Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved.</copyright>
+	<copyright>Copyright (C) 2005 - 2011 Open Source Matters. All rights reserved.</copyright>
 	<license>http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL</license>
 	<authorEmail>admin@joomla.org</authorEmail>
 	<authorUrl>www.joomla.org</authorUrl>
 	<version>1.5</version>
-	<description>Mootools 1.2.4</description>
+	<description>Mootools 1.2.5</description>
 	<files>
 		<filename plugin="mtupgrade">mtupgrade.php</filename>
 		<folder>mtupgrade</folder>
diff -aruN --binary 22/templates/system/error.php 23/templates/system/error.php
--- 22/templates/system/error.php	2010-04-23 12:40:20.000000000 +0200
+++ 23/templates/system/error.php	2011-04-05 00:01:18.000000000 +0200
@@ -11,6 +11,10 @@
 
 // no direct access
 defined( '_JEXEC' ) or die( 'Restricted access' );
+if (!isset($this->error)) {
+	$this->error = JError::raiseWarning( 403, JText::_('ALERTNOTAUTH') );
+	$this->debug = false; 
+}
 ?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" dir="<?php echo $this->direction; ?>">
