Index: CHANGELOG
===================================================================
--- CHANGELOG	(revision 1046)
+++ CHANGELOG	(revision 1083)
@@ -1,4 +1,5 @@
 Dotclear 2.5.0 - 201?-??-13
 ===========================================================
+* Ductile theme may now use webfont (from Google, Adobe and similar providers)
 * daInstaller plugin is now included in the official distribution
 * The media enhanced uploader may now be temporarily enabled or disabled
@@ -24,5 +25,5 @@
 * Adaptative compression rate for thumbnails generation
 * Add timestamp on admin information messages
-* Update to jQuery 1.8.2 and jQuery-UI 1.9 (custom)
+* Update to jQuery 1.8.3 and jQuery-UI 1.9.2 (custom)
 * Add default favicon.ico
 * Add default attributes settings for image,mp3,flv insertion
Index: admin/auth.php
===================================================================
--- admin/auth.php	(revision 1089)
+++ admin/auth.php	(revision 794)
@@ -14,5 +14,6 @@
 
 # If we have a session cookie, go to index.php
-if (isset($_SESSION['sess_user_id'])) {
+if (isset($_SESSION['sess_user_id']))
+{
 	http::redirect('index.php');
 }
@@ -22,7 +23,18 @@
 $dlang = http::getAcceptLanguage();
 $dlang = ($dlang == '' ? 'en' : $dlang);
-if ($dlang != 'en' && preg_match('/^[a-z]{2}(-[a-z]{2})?$/',$dlang)) {
+if ($dlang != 'en' && preg_match('/^[a-z]{2}(-[a-z]{2})?$/',$dlang))
+{
 	l10n::set(dirname(__FILE__).'/../locales/'.$dlang.'/main');
 }
+
+$page_url = http::getHost().$_SERVER['REQUEST_URI'];
+
+$change_pwd = $core->auth->allowPassChange() && isset($_POST['new_pwd']) && isset($_POST['new_pwd_c']) && isset($_POST['login_data']);
+$login_data = !empty($_POST['login_data']) ? html::escapeHTML($_POST['login_data']) : null;
+$recover = $core->auth->allowPassChange() && !empty($_REQUEST['recover']);
+$safe_mode = !empty($_REQUEST['safe_mode']);
+$akey = $core->auth->allowPassChange() && !empty($_GET['akey']) ? $_GET['akey'] : null;
+$user_id = $user_pwd = $user_key = $user_email = null;
+$err = $msg = null;
 
 # Auto upgrade
@@ -31,307 +43,389 @@
 	try {
 		if (($changes = dotclearUpgrade($core)) !== false) {
-			$_ctx->setAlert(__('Dotclear has been upgraded.').'<!-- '.$changes.' -->');
-		}
-	}
-	catch (Exception $e) {
-		$_ctx->addError($e->getMessage());
-	}
-}
-
-/**
-Actions for authentication on admin pages
-*/
-class adminPageAuth
-{
-	# Send new password from recover email
-	public static function send($akey)
-	{
-		global $core, $_ctx;
-		
-		$_ctx->akey = true;
-		
-		try	{
-			$recover_res = $core->auth->recoverUserPassword($akey);
-			
-			$subject = mb_encode_mimeheader('DotClear '.__('Your new password'),'UTF-8','B');
-			$message =
-			__('Username:').' '.$recover_res['user_id']."\n".
-			__('Password:').' '.$recover_res['new_pass']."\n\n".
-			preg_replace('/\?(.*)$/','',http::getHost().$_SERVER['REQUEST_URI']);
-			
-			$headers[] = 'From: dotclear@'.$_SERVER['HTTP_HOST'];
-			$headers[] = 'Content-Type: text/plain; charset=UTF-8;';
-			
-			mail::sendMail($recover_res['user_email'],$subject,$message,$headers);
-			$_ctx->setAlert(__('Your new password is in your mailbox.'));
-		}
-		catch (Exception $e) {
-			$_ctx->addError($e->getMessage());
-		}
-	}
-	
-	# Authentication process
-	public static function process($form,$user_id,$user_pwd,$user_key=null)
-	{
-		global $core, $_ctx;
-		
-		# We check the user
-		$check_user = $core->auth->checkUser($user_id,$user_pwd,$user_key) === true;
-		
-		$cookie_admin = http::browserUID(DC_MASTER_KEY.$user_id.
-			crypt::hmac(DC_MASTER_KEY,$user_pwd)).bin2hex(pack('a32',$user_id));
-		
-		if ($check_user && $core->auth->mustChangePassword())
-		{
-			$form->login_data = join('/',array(
-				base64_encode($user_id),
-				$cookie_admin,
-				$form->user_remember == '' ? '0' : '1'
-			));
-			
-			if (!$core->auth->allowPassChange()) {
-				$_ctx->addError(__('You have to change your password before you can login.'));
-			} else {
-				$_ctx->addError(__('In order to login, you have to change your password now.'));
-				$_ctx->change_pwd = true;
-			}
-		}
-		elseif ($check_user && $form->safe_mode != '' && !$core->auth->isSuperAdmin()) 
-		{
-			$_ctx->addError(__('Safe Mode can only be used for super administrators.'));
-		}
-		elseif ($check_user)
-		{
-			$core->session->start();
-			$_SESSION['sess_user_id'] = $user_id;
-			$_SESSION['sess_browser_uid'] = http::browserUID(DC_MASTER_KEY);
-			
-			if ($form->blog != '') {
-				$_SESSION['sess_blog_id'] = $form->blog;
-			}
-			
-			if ($form->safe_mode != '' && $core->auth->isSuperAdmin()) {
-				$_SESSION['sess_safe_mode'] = true;
-			}
-			
-			if ($form->user_remember != '') {
-				setcookie('dc_admin',$cookie_admin,strtotime('+15 days'),'','',DC_ADMIN_SSL);
-			}
-			
-			http::redirect('index.php');
-		}
-		else
-		{
-			if (isset($_COOKIE['dc_admin'])) {
-				unset($_COOKIE['dc_admin']);
-				setcookie('dc_admin',false,-600,'','',DC_ADMIN_SSL);
-			}
-			$_ctx->addError(__('Wrong username or password'));
-		}
-	}
-	
-	# Login form action
-	public static function login($form)
-	{
-		global $_ctx;
-		
-		if ($form->user_id != '' && $form->user_pwd != '') {
-			self::process($form,$form->user_id,$form->user_pwd);
-		}
-		
-		# Send post values to form
-		$form->user_id = $form->user_id;
-	}
-
-	# Recover password form action
-	public static function recover($form)
-	{
-		global $core, $_ctx;
-		
-		if ($form->user_id == '' || $form->user_email == '') {
-			return;
-		}
-		
-		$user_id = $form->user_id;
-		$user_email = $form->user_email;
-		$page_url = http::getHost().$_SERVER['REQUEST_URI'];
-		
-		try {
-			$recover_key = $core->auth->setRecoverKey($user_id,$user_email);
-			
-			$subject = mail::B64Header('DotClear '.__('Password reset'));
-			$message =
-			__('Someone has requested to reset the password for the following site and username.')."\n\n".
-			$page_url."\n".__('Username:').' '.$user_id."\n\n".
-			__('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.')."\n".
-			$page_url.'?akey='.$recover_key;
-			
-			$headers[] = 'From: '.(defined('DC_ADMIN_MAILFROM') && DC_ADMIN_MAILFROM ? DC_ADMIN_MAILFROM : 'dotclear@local');
-			$headers[] = 'Content-Type: text/plain; charset=UTF-8;';
-			
-			mail::sendMail($user_email,$subject,$message,$headers);
-			$_ctx->setAlert(sprintf(__('The e-mail was sent successfully to %s.'),$user_email));
-		}
-		catch (Exception $e) {
-			$_ctx->addError($e->getMessage());
-		}
-		
-		# Send post values to form
-		$form->user_id = $form->user_id;
-		$form->user_email = $form->user_email;
-	}
-
-	# Change password form action
-	public static function change($form)
-	{
-		global $core, $_ctx;
-		
-		if ($form->login_data) {
-			return;
-		}
-		$_ctx->change_pwd = true;
-		
-		$new_pwd = (string) $form->new_pwd;
-		$new_pwd_c = (string) $form->new_pwd_c;
-		
-		try {
-			$tmp_data = explode('/',$form->login_data);
-			if (count($tmp_data) != 3) {
-				throw new Exception();
-			}
-			$data = array(
-				'user_id'=>base64_decode($tmp_data[0]),
-				'cookie_admin'=>$tmp_data[1],
-				'user_remember'=>$tmp_data[2]=='1'
-			);
-			if ($data['user_id'] === false) {
-				throw new Exception();
-			}
-			
-			# Check login informations
-			$check_user = false;
-			if (isset($data['cookie_admin']) && strlen($data['cookie_admin']) == 104)
-			{
-				$user_id = substr($data['cookie_admin'],40);
-				$user_id = @unpack('a32',@pack('H*',$user_id));
-				if (is_array($user_id))
-				{
-					$user_id = $user_id[1];
-					$user_key = substr($data['cookie_admin'],0,40);
-					$check_user = $core->auth->checkUser($user_id,null,$user_key) === true;
-				}
-			}
-			
-			if (!$core->auth->allowPassChange() || !$check_user) {
-				$_ctx->change_pwd = false;
-				throw new Exception();
-			}
-			
-			if ($new_pwd != $new_pwd_c) {
-				throw new Exception(__("Passwords don't match"));
-			}
-			
-			if ($core->auth->checkUser($user_id,$new_pwd) === true) {
-				throw new Exception(__("You didn't change your password."));
-			}
-			
-			$cur = $core->con->openCursor($core->prefix.'user');
-			$cur->user_change_pwd = 0;
-			$cur->user_pwd = $new_pwd;
-			$core->updUser($core->auth->userID(),$cur);
-			
-			$core->session->start();
-			$_SESSION['sess_user_id'] = $user_id;
-			$_SESSION['sess_browser_uid'] = http::browserUID(DC_MASTER_KEY);
-			
-			if ($data['user_remember']) {
-				setcookie('dc_admin',$data['cookie_admin'],strtotime('+15 days'),'','',DC_ADMIN_SSL);
-			}
-			
-			http::redirect('index.php');
-		}
-		catch (Exception $e) {
-			$_ctx->addError($e->getMessage());
-		}
-		
-		# Send post values to form
-		$form->login_data = $form->login_data;
-	}
-}
-
-# Form fields
-$form = new dcForm($core,'auth','auth.php');
-$form
-	->addField(
-		new dcFieldText('user_id','',array(
-			"label" => __('Username:'))))
-	->addField(
-		new dcFieldPassword('user_pwd','',array(
-			"label" => __('Password:'))))
-	->addField(
-		new dcFieldText('user_email','',array(
-			"label" => __('Email:'))))
-	->addField(
-		new dcFieldPassword('new_pwd','',array(
-			"label" => __('New password:'))))
-	->addField(
-		new dcFieldPassword('new_pwd_c','',array(
-			"label" => __('Confirm password:'))))
-	->addField(
-		new dcFieldCheckbox ('user_remenber',1,array(
-			"label" => __('Remember my ID on this computer'))))
-	->addField(
-		new dcFieldSubmit('auth_login',__('log in'),array(
-			'action' => array('adminPageAuth','login'))))
-	->addField(
-		new dcFieldSubmit('auth_recover',__('recover'),array(
-			'action' => array('adminPageAuth','recover'))))
-	->addField(
-		new dcFieldSubmit('auth_change',__('change'),array(
-			'action' => array('adminPageAuth','change'))))
-	->addField(
-		new dcFieldHidden ('safe_mode','0'))
-	->addField(
-		new dcFieldHidden ('recover','0'))
-	->addField(
-		new dcFieldHidden ('login_data',''))
-	->addField(
-		new dcFieldHidden ('blog',''));
-
-# Context variables
-$_ctx->allow_pass_change = $core->auth->allowPassChange();
-$_ctx->change_pwd = $core->auth->allowPassChange() && $form->new_pwd != '' && $form->new_pwd_c != '' && $form->login_data != '';
-$_ctx->recover = $form->recover = $core->auth->allowPassChange() && !empty($_REQUEST['recover']);
-$_ctx->setSafeMode(!empty($_REQUEST['safe_mode'])); 
-$form->safe_mode = !empty($_REQUEST['safe_mode']);
-$_ctx->akey = false;
-
-# If we have no POST login informations and have COOKIE login informations, go throug auth process
-if ($form->user_id == '' && $form->user_pwd == '' 
- && isset($_COOKIE['dc_admin']) && strlen($_COOKIE['dc_admin']) == 104) {
-
+			$msg = __('Dotclear has been upgraded.').'<!-- '.$changes.' -->';
+		}
+	} catch (Exception $e) {
+		$err = $e->getMessage();
+	}
+}
+
+# If we have POST login informations, go throug auth process
+if (!empty($_POST['user_id']) && !empty($_POST['user_pwd']))
+{
+	$user_id = !empty($_POST['user_id']) ? $_POST['user_id'] : null;
+	$user_pwd = !empty($_POST['user_pwd']) ? $_POST['user_pwd'] : null;
+}
+# If we have COOKIE login informations, go throug auth process
+elseif (isset($_COOKIE['dc_admin']) && strlen($_COOKIE['dc_admin']) == 104)
+{
 	# If we have a remember cookie, go through auth process with user_key
 	$user_id = substr($_COOKIE['dc_admin'],40);
 	$user_id = @unpack('a32',@pack('H*',$user_id));
-	
-	if (is_array($user_id)) {
+	if (is_array($user_id))
+	{
 		$user_id = $user_id[1];
 		$user_key = substr($_COOKIE['dc_admin'],0,40);
-		$user_pwd = '';
-		
-		adminPageAuth::process($form,$user_id,$user_pwd,$user_key);
-	}
-}
-# If we have an akey, go throug send password process
-elseif ($core->auth->allowPassChange() && !empty($_GET['akey'])) {
-	adminPageAuth::send($_GET['akey']);
+		$user_pwd = null;
+	}
+	else
+	{
+		$user_id = null;
+	}
+}
+
+# Recover password
+if ($recover && !empty($_POST['user_id']) && !empty($_POST['user_email']))
+{
+	$user_id = !empty($_POST['user_id']) ? $_POST['user_id'] : null;
+	$user_email = !empty($_POST['user_email']) ? $_POST['user_email'] : '';
+	try
+	{
+		$recover_key = $core->auth->setRecoverKey($user_id,$user_email);
+		
+		$subject = mail::B64Header('DotClear '.__('Password reset'));
+		$message =
+		__('Someone has requested to reset the password for the following site and username.')."\n\n".
+		$page_url."\n".__('Username:').' '.$user_id."\n\n".
+		__('To reset your password visit the following address, otherwise just ignore this email and nothing will happen.')."\n".
+		$page_url.'?akey='.$recover_key;
+		
+		$headers[] = 'From: '.(defined('DC_ADMIN_MAILFROM') && DC_ADMIN_MAILFROM ? DC_ADMIN_MAILFROM : 'dotclear@local');
+		$headers[] = 'Content-Type: text/plain; charset=UTF-8;';
+		
+		mail::sendMail($user_email,$subject,$message,$headers);
+		$msg = sprintf(__('The e-mail was sent successfully to %s.'),$user_email);
+	}
+	catch (Exception $e)
+	{
+		$err = $e->getMessage();
+	}
+}
+# Send new password
+elseif ($akey)
+{
+	try
+	{
+		$recover_res = $core->auth->recoverUserPassword($akey);
+		
+		$subject = mb_encode_mimeheader('DotClear '.__('Your new password'),'UTF-8','B');
+		$message =
+		__('Username:').' '.$recover_res['user_id']."\n".
+		__('Password:').' '.$recover_res['new_pass']."\n\n".
+		preg_replace('/\?(.*)$/','',$page_url);
+		
+		$headers[] = 'From: dotclear@'.$_SERVER['HTTP_HOST'];
+		$headers[] = 'Content-Type: text/plain; charset=UTF-8;';
+		
+		mail::sendMail($recover_res['user_email'],$subject,$message,$headers);
+		$msg = __('Your new password is in your mailbox.');
+	}
+	catch (Exception $e)
+	{
+		$err = $e->getMessage();
+	}
+}
+# Change password and retry to log
+elseif ($change_pwd)
+{
+	try
+	{
+		$tmp_data = explode('/',$_POST['login_data']);
+		if (count($tmp_data) != 3) {
+			throw new Exception();
+		}
+		$data = array(
+			'user_id'=>base64_decode($tmp_data[0]),
+			'cookie_admin'=>$tmp_data[1],
+			'user_remember'=>$tmp_data[2]=='1'
+		);
+		if ($data['user_id'] === false) {
+			throw new Exception();
+		}
+		
+	# Check login informations
+	$check_user = false;
+	if (isset($data['cookie_admin']) && strlen($data['cookie_admin']) == 104)
+	{
+		$user_id = substr($data['cookie_admin'],40);
+		$user_id = @unpack('a32',@pack('H*',$user_id));
+		if (is_array($user_id))
+		{
+			$user_id = $user_id[1];
+			$user_key = substr($data['cookie_admin'],0,40);
+			$check_user = $core->auth->checkUser($user_id,null,$user_key) === true;
+		}
+	}
+	
+		if (!$core->auth->allowPassChange() || !$check_user) {
+			$change_pwd = false;
+			throw new Exception();
+		}
+		
+		if ($_POST['new_pwd'] != $_POST['new_pwd_c']) {
+			throw new Exception(__("Passwords don't match"));
+		}
+		
+		if ($core->auth->checkUser($user_id,$_POST['new_pwd']) === true) {
+			throw new Exception(__("You didn't change your password."));
+		}
+		
+		$cur = $core->con->openCursor($core->prefix.'user');
+		$cur->user_change_pwd = 0;
+		$cur->user_pwd = $_POST['new_pwd'];
+		$core->updUser($core->auth->userID(),$cur);
+		
+		$core->session->start();
+		$_SESSION['sess_user_id'] = $user_id;
+		$_SESSION['sess_browser_uid'] = http::browserUID(DC_MASTER_KEY);
+		
+		if ($data['user_remember'])
+		{
+			setcookie('dc_admin',$data['cookie_admin'],strtotime('+15 days'),'','',DC_ADMIN_SSL);
+		}
+		
+		http::redirect('index.php');
+	}
+	catch (Exception $e)
+	{
+		$err = $e->getMessage();
+	}
+}
+# Try to log
+elseif ($user_id !== null && ($user_pwd !== null || $user_key !== null))
+{
+	# We check the user
+	$check_user = $core->auth->checkUser($user_id,$user_pwd,$user_key) === true;
+	
+	$cookie_admin = http::browserUID(DC_MASTER_KEY.$user_id.
+		crypt::hmac(DC_MASTER_KEY,$user_pwd)).bin2hex(pack('a32',$user_id));
+	
+	if ($check_user && $core->auth->mustChangePassword())
+	{
+		$login_data = join('/',array(
+			base64_encode($user_id),
+			$cookie_admin,
+			empty($_POST['user_remember'])?'0':'1'
+		));
+		
+		if (!$core->auth->allowPassChange()) {
+			$err = __('You have to change your password before you can login.');
+		} else {
+			$err = __('In order to login, you have to change your password now.');
+			$change_pwd = true;
+		}
+	}
+	elseif ($check_user && !empty($_POST['safe_mode']) && !$core->auth->isSuperAdmin()) 
+	{
+		$err = __('Safe Mode can only be used for super administrators.');
+	}
+	elseif ($check_user)
+	{
+		$core->session->start();
+		$_SESSION['sess_user_id'] = $user_id;
+		$_SESSION['sess_browser_uid'] = http::browserUID(DC_MASTER_KEY);
+		
+		if (!empty($_POST['blog'])) {
+			$_SESSION['sess_blog_id'] = $_POST['blog'];
+		}
+		
+		if (!empty($_POST['safe_mode']) && $core->auth->isSuperAdmin()) {
+			$_SESSION['sess_safe_mode'] = true;
+		}
+		
+		if (!empty($_POST['user_remember'])) {
+			setcookie('dc_admin',$cookie_admin,strtotime('+15 days'),'','',DC_ADMIN_SSL);
+		}
+		
+		http::redirect('index.php');
+	}
+	else
+	{
+		if (isset($_COOKIE['dc_admin'])) {
+			unset($_COOKIE['dc_admin']);
+			setcookie('dc_admin',false,-600,'','',DC_ADMIN_SSL);
+		}
+		$err = __('Wrong username or password');
+	}
 }
 
 if (isset($_GET['user'])) {
-	$form->user_id = $_GET['user'];
-}
-
-$form->setup();
-
-$core->tpl->display('auth.html.twig');
+	$user_id = $_GET['user'];
+}
+
+header('Content-Type: text/html; charset=UTF-8');
 ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml"
+xml:lang="<?php echo $dlang; ?>" lang="<?php echo $dlang; ?>">
+<head>
+  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+  <meta http-equiv="Content-Script-Type" content="text/javascript" />
+  <meta http-equiv="Content-Style-Type" content="text/css" />
+  <meta http-equiv="Content-Language" content="<?php echo $dlang; ?>" />
+  <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />
+  <meta name="GOOGLEBOT" content="NOSNIPPET" />
+  <title><?php echo html::escapeHTML(DC_VENDOR_NAME); ?></title>
+  
+<?php
+echo dcPage::jsLoadIE7();
+echo dcPage::jsCommon();
+?>
+  
+	<link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />
+	 
+  <?php
+  # --BEHAVIOR-- loginPageHTMLHead
+  $core->callBehavior('loginPageHTMLHead');
+  ?>
+  
+  <script type="text/javascript">
+  //<![CDATA[
+  $(window).load(function() {
+    var uid = $('input[name=user_id]');
+    var upw = $('input[name=user_pwd]');
+    uid.focus();
+    
+    if (upw.length == 0) { return; }
+    
+    if ($.browser.mozilla) {
+      uid.keypress(processKey);
+    } else {
+      uid.keydown(processKey);
+    }
+    function processKey(evt) {
+      if (evt.keyCode == 13 && upw.val() == '') {
+         upw.focus();
+	    return false;
+      }
+	 return true;
+    };
+    $.cookie('dc_admin_test_cookie',true);
+    if ($.cookie('dc_admin_test_cookie')) {
+      $('#cookie_help').hide();
+      $.cookie('dc_admin_test_cookie', '', {'expires': -1});
+    } else {
+      $('#cookie_help').show();
+    }
+    $('#issue #more').toggleWithLegend($('#issue').children().not('#more'));
+  });
+  //]]>
+  </script>
+</head>
+
+<body id="dotclear-admin" class="auth">
+
+<form action="auth.php" method="post" id="login-screen">
+<h1><?php echo html::escapeHTML(DC_VENDOR_NAME); ?></h1>
+
+<?php
+if ($err) {
+	echo '<div class="error">'.$err.'</div>';
+}
+if ($msg) {
+	echo '<p class="message">'.$msg.'</p>';
+}
+
+if ($akey)
+{
+	echo '<p><a href="auth.php">'.__('Back to login screen').'</a></p>';
+}
+elseif ($recover)
+{
+	echo
+	'<fieldset><legend>'.__('Request a new password').'</legend>'.
+	'<p><label for="user_id">'.__('Username:').'</label> '.
+	form::field(array('user_id','user_id'),20,32,html::escapeHTML($user_id)).'</p>'.
+	
+	'<p><label for="user_email">'.__('Email:').'</label> '.
+	form::field(array('user_email','user_email'),20,255,html::escapeHTML($user_email)).'</p>'.
+	
+	'<p><input type="submit" value="'.__('recover').'" />'.
+	form::hidden(array('recover'),1).'</p>'.
+	'</fieldset>'.
+	
+	'<div id="issue">'.
+	'<p><a href="auth.php">'.__('Back to login screen').'</a></p></div>';
+}
+elseif ($change_pwd)
+{
+	echo
+	'<fieldset><legend>'.__('Change your password').'</legend>'.
+	'<p><label for="new_pwd">'.__('New password:').'</label> '.
+	form::password(array('new_pwd','new_pwd'),20,255).'</p>'.
+	
+	'<p><label for="new_pwd_c">'.__('Confirm password:').'</label> '.
+	form::password(array('new_pwd_c','new_pwd_c'),20,255).'</p>'.
+	'</fielset>'.
+	
+	'<p><input type="submit" value="'.__('change').'" />'.
+	form::hidden('login_data',$login_data).'</p>';
+}
+else
+{
+	if (is_callable(array($core->auth,'authForm')))
+	{
+		echo $core->auth->authForm($user_id);
+	}
+	else
+	{
+		if ($safe_mode) {
+			echo '<fieldset>';
+			echo '<legend>'.__('Safe mode login').'</legend>';
+			echo 
+				'<p class="form-note info">'.
+				__('This mode allows you to login without activating any of your plugins. This may be useful to solve compatibility problems').'&nbsp;<br />'.
+				__('Disable or delete any plugin suspected to cause trouble, then log out and log back in normally.').
+				'</p>';
+		}
+		else {
+			echo '<div class="fieldset">';
+		}
+
+		echo
+		'<p><label for="user_id">'.__('Username:').'</label> '.
+		form::field(array('user_id','user_id'),20,32,html::escapeHTML($user_id)).'</p>'.
+		
+		'<p><label for="user_pwd">'.__('Password:').'</label> '.
+		form::password(array('user_pwd','user_pwd'),20,255).'</p>'.
+		
+		'<p>'.
+		form::checkbox(array('user_remember','user_remember'),1).
+		'<label for="user_remember" class="classic">'.
+		__('Remember my ID on this computer').'</label></p>'.
+		
+		'<p><input type="submit" value="'.__('log in').'" /></p>';
+		
+		if (!empty($_REQUEST['blog'])) {
+			echo form::hidden('blog',html::escapeHTML($_REQUEST['blog']));
+		}
+		if($safe_mode) {
+			echo 
+			form::hidden('safe_mode',1).
+			'</fieldset>';
+		}
+		else {
+			echo '</div>';
+		}
+		echo
+		'<p id="cookie_help" class="error">'.__('You must accept cookies in order to use the private area.').'</p>';
+
+		echo '<div id="issue">';
+		
+		if ($safe_mode) {
+			echo
+			'<p><a href="auth.php" id="normal_mode_link">'.__('Get back to normal authentication').'</a></p>';
+		} else {
+			echo '<p id="more"><strong>'.__('Connection issue?').'</strong></p>';
+			if ($core->auth->allowPassChange()) {
+				echo '<p><a href="auth.php?recover=1">'.__('I forgot my password').'</a></p>';
+			}
+			echo '<p><a href="auth.php?safe_mode=1" id="safe_mode_link">'.__('I want to log in in safe mode').'</a></p>';
+		}
+		
+		echo '</div>';
+	}
+}
+?>
+</form>
+</body>
+</html>
Index: admin/index.php
===================================================================
--- admin/index.php	(revision 1090)
+++ admin/index.php	(revision 1077)
@@ -15,9 +15,4 @@
 	exit;
 }
-if (!empty($_GET['tf'])) {
-	define('DC_CONTEXT_ADMIN',true);
-	require dirname(__FILE__).'/../inc/load_theme_file.php';
-	exit;
-}
 
 require dirname(__FILE__).'/../inc/admin/prepend.php';
@@ -48,35 +43,6 @@
 $plugins_install = $core->plugins->installModules();
 
-# Send plugins install messages to templates
-if (!empty($plugins_install['success'])) {
-	$_ctx->addMessagesList(__('Following plugins have been installed:'),$plugins_install['success']);
-}
-if (!empty($plugins_install['failure'])) {
-	$_ctx->addMessagesList(__('Following plugins have not been installed:'),$plugins_install['failure']);
-}
-
-# Send plugins errors messages to templates
-$_ctx->modules_errors = $core->auth->isSuperAdmin() ? $core->plugins->getErrors() : array();
-
-# Send Dotclear updates notifications to tempaltes
-$_ctx->updater = array();
-if ($core->auth->isSuperAdmin() && is_readable(DC_DIGESTS)) {
-
-	$updater = new dcUpdate(DC_UPDATE_URL,'dotclear',DC_UPDATE_VERSION,DC_TPL_CACHE.'/versions');
-	$new_v = $updater->check(DC_VERSION);
-	$version_info = $new_v ? $updater->getInfoURL() : '';
-	
-	if ($updater->getNotify() && $new_v) {
-		$_ctx->updater = array(
-			'new_version'	=> $new_v,
-			'version_info'	=> $version_info
-		);
-	}
-}
-
 # Check dashboard module prefs
 $ws = $core->auth->user_prefs->addWorkspace('dashboard');
-
-# Doclinks prefs
 if (!$core->auth->user_prefs->dashboard->prefExists('doclinks')) {
 	if (!$core->auth->user_prefs->dashboard->prefExists('doclinks',true)) {
@@ -85,12 +51,4 @@
 	$core->auth->user_prefs->dashboard->put('doclinks',true,'boolean');
 }
-
-# Send doclinks to templates
-$_ctx->dashboard_doclinks = array();
-if ($core->auth->user_prefs->dashboard->doclinks && !empty($__resources['doc'])) {
-	$_ctx->dashboard_doclinks = $__resources['doc'];
-}
-
-# Dcnews prefs
 if (!$core->auth->user_prefs->dashboard->prefExists('dcnews')) {
 	if (!$core->auth->user_prefs->dashboard->prefExists('dcnews',true)) {
@@ -99,35 +57,4 @@
 	$core->auth->user_prefs->dashboard->put('dcnews',true,'boolean');
 }
-
-# Send dcnews to templates
-$_ctx->dashboard_dcnews = array();
-if ($core->auth->user_prefs->dashboard->dcnews && !empty($__resources['rss_news'])) {
-	try
-	{
-		$feed_reader = new feedReader;
-		$feed_reader->setCacheDir(DC_TPL_CACHE);
-		$feed_reader->setTimeout(2);
-		$feed_reader->setUserAgent('Dotclear - http://www.dotclear.org/');
-		$feed = $feed_reader->parse($__resources['rss_news']);
-		if ($feed) {
-			$items = array();
-			$i = 1;
-			foreach ($feed->items as $item) {
-				$items[] = array(
-					'title' => $item->title,
-					'link' => isset($item->link) ? $item->link : '',
-					'date' => dt::dt2str(__('%d %B %Y'),$item->pubdate,'Europe/Paris'),
-					'content' => html::clean($item->content)
-				);
-				$i++;
-				if ($i > 3) { break; }
-			}
-			$_ctx->dashboard_dcnews = $items;
-		}
-	}
-	catch (Exception $e) {}
-}
-
-# Quick entry prefs
 if (!$core->auth->user_prefs->dashboard->prefExists('quickentry')) {
 	if (!$core->auth->user_prefs->dashboard->prefExists('quickentry',true)) {
@@ -135,57 +62,4 @@
 	}
 	$core->auth->user_prefs->dashboard->put('quickentry',true,'boolean');
-}
-
-# Send quick entry to templates
-$_ctx->dashboard_quickentry = false;
-if ($core->auth->user_prefs->dashboard->quickentry &&$core->auth->check('usage,contentadmin',$core->blog->id))
-{
-	$categories_combo = array('&nbsp;' => '');
-	try {
-		$categories = $core->blog->getCategories(array('post_type'=>'post'));
-		while ($categories->fetch()) {
-			$categories_combo[] = new formSelectOption(
-				str_repeat('&nbsp;&nbsp;',$categories->level-1).
-				($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title),
-				$categories->cat_id
-			);
-		}
-	}
-	catch (Exception $e) { }
-	
-	$form = new dcForm($core,array('quickentry','quick-entry'),'post.php');
-	$form
-		->addField(
-			new dcFieldText('post_title','', array(
-				'size'		=> 20,
-				'required'	=> true,
-				'label'		=> __('Title'))))
-		->addField(
-			new dcFieldTextArea('post_content','', array(
-				'required'	=> true,
-				'label'		=> __("Content:"))))
-		->addField(
-			new dcFieldCombo('cat_id','',$categories_combo,array(
-				"label" => __('Category:'))))
-		->addField(
-			new dcFieldSubmit('save',__('Save'),array(
-				'action' => 'savePost')))
-		->addField(
-			new dcFieldHidden ('post_status',-2))
-		->addField(
-			new dcFieldHidden ('post_format',$core->auth->getOption('post_format')))
-		->addField(
-			new dcFieldHidden ('post_excerpt',''))
-		->addField(
-			new dcFieldHidden ('post_lang',$core->auth->getInfo('user_lang')))
-		->addField(
-			new dcFieldHidden ('post_notes',''))
-	;
-	if ($core->auth->check('publish',$core->blog->id)) {
-		$form->addField(
-			new dcFieldHidden ('save-publish',__('Save and publish')));
-	}
-	
-	$_ctx->dashboard_quickentry = true;
 }
 
@@ -244,67 +118,250 @@
 }
 
-# Send dashboard icons to templates
-$icons = array();
-foreach ($__dashboard_icons as $i) {
-	$icons[] = array(
-		'title' 	=> $i[0],
-		'url' 	=> $i[1],
-		'img' 	=> dc_admin_icon_url($i[2])
-	);
-}
-$_ctx->dashboard_icons = $icons;
-
-# Dashboard items
+# Latest news for dashboard
 $__dashboard_items = new ArrayObject(array(new ArrayObject,new ArrayObject));
+
+# Documentation links
+$dashboardItem = 0;
+if ($core->auth->user_prefs->dashboard->doclinks) {
+	if (!empty($__resources['doc']))
+	{
+		$doc_links = '<h3>'.__('Documentation and support').'</h3><ul>';
+	
+		foreach ($__resources['doc'] as $k => $v) {
+			$doc_links .= '<li><a href="'.$v.'" title="'.$k.' '.__('(external link)').'">'.$k.'</a></li>';
+		}
+	
+		$doc_links .= '</ul>';
+		$__dashboard_items[$dashboardItem][] = $doc_links;
+		$dashboardItem++;
+	}
+}
+
+if ($core->auth->user_prefs->dashboard->dcnews) {
+	try
+	{
+		if (empty($__resources['rss_news'])) {
+			throw new Exception();
+		}
+	
+		$feed_reader = new feedReader;
+		$feed_reader->setCacheDir(DC_TPL_CACHE);
+		$feed_reader->setTimeout(2);
+		$feed_reader->setUserAgent('Dotclear - http://www.dotclear.org/');
+		$feed = $feed_reader->parse($__resources['rss_news']);
+		if ($feed)
+		{
+			$latest_news = '<h3>'.__('Latest news').'</h3><dl id="news">';
+			$i = 1;
+			foreach ($feed->items as $item)
+			{
+				$dt = isset($item->link) ? '<a href="'.$item->link.'" title="'.$item->title.' '.__('(external link)').'">'.
+					$item->title.'</a>' : $item->title;
+			
+				if ($i < 3) {
+					$latest_news .=
+					'<dt>'.$dt.'</dt>'.
+					'<dd><p><strong>'.dt::dt2str(__('%d %B %Y:'),$item->pubdate,'Europe/Paris').'</strong> '.
+					'<em>'.text::cutString(html::clean($item->content),120).'...</em></p></dd>';
+				} else {
+					$latest_news .=
+					'<dt>'.$dt.'</dt>'.
+					'<dd>'.dt::dt2str(__('%d %B %Y:'),$item->pubdate,'Europe/Paris').'</dd>';
+				}
+				$i++;
+				if ($i > 3) { break; }
+			}
+			$latest_news .= '</dl>';
+			$__dashboard_items[$dashboardItem][] = $latest_news;
+			$dashboardItem++;
+		}
+	}
+	catch (Exception $e) {}
+}
+
 $core->callBehavior('adminDashboardItems', $core, $__dashboard_items);
 
-# Send dashboard items to templates
-$items = array();
-foreach ($__dashboard_items as $i) {	
-	if ($i->count() > 0) {
-		foreach ($i as $v) {
-			$items[] = $v;
-		}
-	}
-}
-$_ctx->dashboard_items = $items;
-
 # Dashboard content
+$dashboardContents = '';
 $__dashboard_contents = new ArrayObject(array(new ArrayObject,new ArrayObject));
 $core->callBehavior('adminDashboardContents', $core, $__dashboard_contents);
 
-# Send dashboard contents to templates
-$contents = array();
-foreach ($__dashboard_contents as $i) {	
-	if ($i->count() > 0) {
+/* DISPLAY
+-------------------------------------------------------- */
+dcPage::open(__('Dashboard'),
+	dcPage::jsToolBar().
+	dcPage::jsLoad('js/_index.js').
+	# --BEHAVIOR-- adminDashboardHeaders
+	$core->callBehavior('adminDashboardHeaders')
+);
+
+echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Dashboard').'</span></h2>';
+
+if ($core->auth->getInfo('user_default_blog') != $core->blog->id && $core->auth->blog_count > 1) {
+	echo
+	'<p><a href="index.php?default_blog=1" class="button">'.__('Make this blog my default blog').'</a></p>';
+}
+
+if ($core->blog->status == 0) {
+	echo '<p class="static-msg">'.__('This blog is offline').'</p>';
+} elseif ($core->blog->status == -1) {
+	echo '<p class="static-msg">'.__('This blog is removed').'</p>';
+}
+
+if (!defined('DC_ADMIN_URL') || !DC_ADMIN_URL) {
+	echo
+	'<p class="static-msg">'.
+	sprintf(__('%s is not defined, you should edit your configuration file.'),'DC_ADMIN_URL').
+	' '.__('See <a href="http://dotclear.org/documentation/2.0/admin/config">documentation</a> for more information.').
+	'</p>';
+}
+
+if (!defined('DC_ADMIN_MAILFROM') || !DC_ADMIN_MAILFROM) {
+	echo
+	'<p class="static-msg">'.
+	sprintf(__('%s is not defined, you should edit your configuration file.'),'DC_ADMIN_MAILFROM').
+	' '.__('See <a href="http://dotclear.org/documentation/2.0/admin/config">documentation</a> for more information.').
+	'</p>';
+}
+
+# Plugins install messages
+if (!empty($plugins_install['success']))
+{
+	echo '<div class="static-msg">'.__('Following plugins have been installed:').'<ul>';
+	foreach ($plugins_install['success'] as $k => $v) {
+		echo '<li>'.$k.'</li>';
+	}
+	echo '</ul></div>';
+}
+if (!empty($plugins_install['failure']))
+{
+	echo '<div class="error">'.__('Following plugins have not been installed:').'<ul>';
+	foreach ($plugins_install['failure'] as $k => $v) {
+		echo '<li>'.$k.' ('.$v.')</li>';
+	}
+	echo '</ul></div>';
+}
+
+# Dashboard columns (processed first, as we need to know the result before displaying the icons.)
+$dashboardItems = '';
+
+# Dotclear updates notifications
+if ($core->auth->isSuperAdmin() && is_readable(DC_DIGESTS))
+{
+	$updater = new dcUpdate(DC_UPDATE_URL,'dotclear',DC_UPDATE_VERSION,DC_TPL_CACHE.'/versions');
+	$new_v = $updater->check(DC_VERSION);
+	$version_info = $new_v ? $updater->getInfoURL() : '';
+	
+	if ($updater->getNotify() && $new_v) {
+		$dashboardItems .=
+		'<div id="upg-notify" class="static-msg"><p>'.sprintf(__('Dotclear %s is available!'),$new_v).'</p> '.
+		'<ul><li><strong><a href="update.php">'.sprintf(__('Upgrade now'),$new_v).'</a></strong>'.
+		'</li><li><a href="update.php?hide_msg=1">'.__('Remind me later').'</a>'.
+		($version_info ? ' </li><li><a href="'.$version_info.'">'.__('information about this version').'</a>' : '').
+		'</li></ul></div>';
+	}
+}
+
+# Errors modules notifications
+if ($core->auth->isSuperAdmin())
+{
+	$list = array();
+	foreach ($core->plugins->getErrors() as $k => $error) {
+		$list[] = '<li>'.$error.'</li>';
+	}
+	
+	if (count($list) > 0) {
+		$dashboardItems .=
+		'<div id="module-errors" class="error"><p>'.__('Some plugins are installed twice:').'</p> '.
+		'<ul>'.implode("\n",$list).'</ul></div>';
+	}
+	
+}
+
+foreach ($__dashboard_items as $i)
+{	
+	if ($i->count() > 0)
+	{
+		$dashboardItems .= '<div>';
 		foreach ($i as $v) {
-			$contents[] = $v;
-		}
-	}
-}
-$_ctx->dashboard_contents = $contents;
-
-# Blog status message
-if ($core->blog->status == 0) {
-	$_ctx->addMessageStatic(__('This blog is offline'));
-} elseif ($core->blog->status == -1) {
-	$_ctx->addMessageStatic(__('This blog is removed'));
-}
-
-# Config errors messages
-if (!defined('DC_ADMIN_URL') || !DC_ADMIN_URL) {
-	$_ctx->addMessageStatic(
-		sprintf(__('%s is not defined, you should edit your configuration file.'),'DC_ADMIN_URL').' '.
-		__('See <a href="http://dotclear.org/documentation/2.0/admin/config">documentation</a> for more information.')
-	);
-}
-if (!defined('DC_ADMIN_MAILFROM') || !DC_ADMIN_MAILFROM) {
-	$_ctx->addMessageStatic(
-		sprintf(__('%s is not defined, you should edit your configuration file.'),'DC_ADMIN_MAILFROM').' '.
-		__('See <a href="http://dotclear.org/documentation/2.0/admin/config">documentation</a> for more information.')
-	);
-}
-
-$_ctx->fillPageTitle(__('Dashboard'));
-$core->tpl->display('index.html.twig');
+			$dashboardItems .= $v;
+		}
+		$dashboardItems .= '</div>';
+	}
+}
+
+# Dashboard icons
+echo '<div id="dashboard-main"'.($dashboardItems ? '' : ' class="fullwidth"').'><div id="icons">';
+foreach ($__dashboard_icons as $i)
+{
+	echo
+	'<p><a href="'.$i[1].'"><img src="'.dc_admin_icon_url($i[2]).'" alt="" />'.
+	'<br /><span>'.$i[0].'</span></a></p>';
+}
+echo '</div>';
+
+if ($core->auth->user_prefs->dashboard->quickentry) {
+	if ($core->auth->check('usage,contentadmin',$core->blog->id))
+	{
+		$categories_combo = array('&nbsp;' => '');
+		try {
+			$categories = $core->blog->getCategories(array('post_type'=>'post'));
+			while ($categories->fetch()) {
+				$categories_combo[] = new formSelectOption(
+					str_repeat('&nbsp;&nbsp;',$categories->level-1).
+					($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title),
+					$categories->cat_id
+				);
+			}
+		} catch (Exception $e) { }
+	
+		echo
+		'<div id="quick">'.
+		'<h3>'.__('Quick entry').'</h3>'.
+		'<form id="quick-entry" action="post.php" method="post">'.
+		'<fieldset><legend>'.__('New entry').'</legend>'.
+		'<p class="col"><label for="post_title" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').
+		form::field('post_title',20,255,'','maximal').
+		'</label></p>'.
+		'<p class="area"><label class="required" '.
+		'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '.
+		form::textarea('post_content',50,7).
+		'</p>'.
+		'<p><label for="cat_id" class="classic">'.__('Category:').' '.
+		form::combo('cat_id',$categories_combo).'</label></p>'.
+		'<p><input type="submit" value="'.__('Save').'" name="save" /> '.
+		($core->auth->check('publish',$core->blog->id)
+			? '<input type="hidden" value="'.__('Save and publish').'" name="save-publish" />'
+			: '').
+		$core->formNonce().
+		form::hidden('post_status',-2).
+		form::hidden('post_format',$core->auth->getOption('post_format')).
+		form::hidden('post_excerpt','').
+		form::hidden('post_lang',$core->auth->getInfo('user_lang')).
+		form::hidden('post_notes','').
+		'</p>'.
+		'</fieldset>'.
+		'</form>'.
+		'</div>';
+	}
+}
+
+foreach ($__dashboard_contents as $i)
+{	
+	if ($i->count() > 0)
+	{
+		$dashboardContents .= '<div>';
+		foreach ($i as $v) {
+			$dashboardContents .= $v;
+		}
+		$dashboardContents .= '</div>';
+	}
+}
+echo ($dashboardContents ? '<div id="dashboard-contents">'.$dashboardContents.'</div>' : '');
+
+echo '</div>';
+
+echo ($dashboardItems ? '<div id="dashboard-items">'.$dashboardItems.'</div>' : '');
+
+dcPage::close();
 ?>
Index: admin/plugin.php
===================================================================
--- admin/plugin.php	(revision 1089)
+++ admin/plugin.php	(revision 500)
@@ -15,82 +15,77 @@
 dcPage::check('usage,contentadmin');
 
-$has_content = false;
 $p_file = '';
 $p = !empty($_REQUEST['p']) ? $_REQUEST['p'] : null;
-$popup = $_ctx->popup = (integer) !empty($_REQUEST['popup']);
+$popup = (integer) !empty($_REQUEST['popup']);
+
+if ($popup) {
+	$open_f = array('dcPage','openPopup');
+	$close_f = array('dcPage','closePopup');
+} else {
+	$open_f = array('dcPage','open');
+	$close_f = array('dcPage','close');
+}
 
 if ($core->plugins->moduleExists($p)) {
 	$p_file = $core->plugins->moduleRoot($p).'/index.php';
 }
-if (file_exists($p_file)) {
 
-//* Keep this for old style plugins using dcPage
-	if ($popup) {
-		$open_f = array('dcPage','openPopup');
-		$close_f = array('dcPage','closePopup');
-	} else {
-		$open_f = array('dcPage','open');
-		$close_f = array('dcPage','close');
-	}
+if (file_exists($p_file))
+{
+	# Loading plugin
+	$p_info = $core->plugins->getModules($p);
 	
-	$p_info = $core->plugins->getModules($p);
 	$p_url = 'plugin.php?p='.$p;
-	$p_title = $p_head = $p_content = '';
-//*/	
-	# Get page content
+	
+	$p_title = 'no content - plugin';
+	$p_head = '';
+	$p_content = '<p>'.__('No content found on this plugin.').'</p>';
+	
 	ob_start();
 	include $p_file;
 	$res = ob_get_contents();
 	ob_end_clean();
-
-	# Check context and display
-	if ($_ctx->hasPageTitle() && !empty($res)) {
-		$has_content = true;
-		echo $res;
-	}
-//* Keep this for old style plugins using dcPage
-	elseif (!$_ctx->hasPageTitle()) {
+	
+	if (preg_match('|<head>(.*?)</head|ms',$res,$m)) {
+		if (preg_match('|<title>(.*?)</title>|ms',$m[1],$mt)) {
+			$p_title = $mt[1];
+		}
 		
-		if (preg_match('|<head>(.*?)</head|ms',$res,$m)) {
-			if (preg_match('|<title>(.*?)</title>|ms',$m[1],$mt)) {
-				$p_title = $mt[1];
-			}
-			
-			if (preg_match_all('|(<script.*?>.*?</script>)|ms',$m[1],$ms)) {
-				foreach ($ms[1] as $v) {
-					$p_head .= $v."\n";
-				}
-			}
-			
-			if (preg_match_all('|(<style.*?>.*?</style>)|ms',$m[1],$ms)) {
-				foreach ($ms[1] as $v) {
-					$p_head .= $v."\n";
-				}
-			}
-			
-			if (preg_match_all('|(<link.*?/>)|ms',$m[1],$ms)) {
-				foreach ($ms[1] as $v) {
-					$p_head .= $v."\n";
-				}
+		if (preg_match_all('|(<script.*?>.*?</script>)|ms',$m[1],$ms)) {
+			foreach ($ms[1] as $v) {
+				$p_head .= $v."\n";
 			}
 		}
 		
-		if (preg_match('|<body.*?>(.+)</body>|ms',$res,$m)) {
-			$p_content = $m[1];
-			
-			call_user_func($open_f,$p_title,$p_head);
-			echo $p_content;
-			call_user_func($close_f);
-			
-			$has_content = true;
+		if (preg_match_all('|(<style.*?>.*?</style>)|ms',$m[1],$ms)) {
+			foreach ($ms[1] as $v) {
+				$p_head .= $v."\n";
+			}
+		}
+		
+		if (preg_match_all('|(<link.*?/>)|ms',$m[1],$ms)) {
+			foreach ($ms[1] as $v) {
+				$p_head .= $v."\n";
+			}
 		}
 	}
-//*/
+	
+	if (preg_match('|<body.*?>(.+)</body>|ms',$res,$m)) {
+		$p_content = $m[1];
+	}
+	
+	call_user_func($open_f,$p_title,$p_head);
+	echo $p_content;
+	call_user_func($close_f);
 }
-# No plugin or content found
-if (!$has_content) {
-	$_ctx->fillPageTitle(__('Plugin not found'));
-	$_ctx->addError(__('The plugin you reached does not exist or does not have an admin page.'));
-	$core->tpl->display('plugin.html.twig');
+else
+{
+	call_user_func($open_f,__('Plugin not found'));
+	
+	echo '<h2 class="page-title">'.__('Plugin not found').'</h2>';
+	
+	echo '<p>'.__('The plugin you reached does not exist or does not have an admin page.').'</p>';
+	
+	call_user_func($close_f);
 }
 ?>
Index: admin/post.php
===================================================================
--- admin/post.php	(revision 1089)
+++ admin/post.php	(revision 1068)
@@ -15,13 +15,21 @@
 dcPage::check('usage,contentadmin');
 
-function savePost($form) {
-	global $_ctx;
-	$_ctx->setAlert('save');
-
-}
-
-function deletePost($form) {
-	print_r($form); exit;
-}
+$post_id = '';
+$cat_id = '';
+$post_dt = '';
+$post_format = $core->auth->getOption('post_format');
+$post_password = '';
+$post_url = '';
+$post_lang = $core->auth->getInfo('user_lang');
+$post_title = '';
+$post_excerpt = '';
+$post_excerpt_xhtml = '';
+$post_content = '';
+$post_content_xhtml = '';
+$post_notes = '';
+$post_status = $core->auth->getInfo('user_post_status');
+$post_selected = false;
+$post_open_comment = $core->blog->settings->system->allow_comments;
+$post_open_tb = $core->blog->settings->system->allow_trackbacks;
 
 $page_title = __('New entry');
@@ -39,5 +47,5 @@
 # If user can't publish
 if (!$can_publish) {
-	$form->post_status = -2;
+	$post_status = -2;
 }
 
@@ -47,8 +55,8 @@
 	$categories = $core->blog->getCategories(array('post_type'=>'post'));
 	while ($categories->fetch()) {
-		$categories_combo[$categories->cat_id] = 
-			str_repeat('&nbsp;&nbsp;',$categories->level-1).
-			($categories->level-1 == 0 ? '' : '&bull; ').
-			html::escapeHTML($categories->cat_title);
+		$categories_combo[] = new formSelectOption(
+			str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title),
+			$categories->cat_id
+		);
 	}
 } catch (Exception $e) { }
@@ -56,6 +64,7 @@
 # Status combo
 foreach ($core->blog->getAllPostStatus() as $k => $v) {
-	$status_combo[$k] = $v;
-}
+	$status_combo[$v] = (string) $k;
+}
+$img_status_pattern = '<img class="img_select_option" alt="%1$s" title="%1$s" src="images/%2$s" />';
 
 # Formaters combo
@@ -79,57 +88,7 @@
 unset($rs);
 
-$form = new dcForm($core,'post','post.php');
-$form
-	->addField(
-		new dcFieldText('post_title','', array(
-			'size'		=> 20,
-			'required'	=> true,
-			'label'		=> __('Title'))))
-	->addField(
-		new dcFieldTextArea('post_excerpt','', array(
-			'cols'		=> 50,
-			'rows'		=> 5,
-			'label'		=> __("Excerpt:"))))
-	->addField(
-		new dcFieldTextArea('post_content','', array(
-			'required'	=> true,
-			'label'		=> __("Content:"))))
-	->addField(
-		new dcFieldTextArea('post_notes','', array(
-			'label'		=> __("Notes"))))
-	->addField(
-		new dcFieldSubmit('save',__('Save'),array(
-			'action' => 'savePost')))
-	->addField(
-		new dcFieldSubmit('delete',__('Delete'),array(
-			'action' => 'deletePost')))
-	->addField(
-		new dcFieldCombo('post_status',$core->auth->getInfo('user_post_status'),$status_combo,array(
-			'disabled' => !$can_publish,
-			'label' => __('Entry status:'))))
-	->addField(
-		new dcFieldCombo('cat_id','',$categories_combo,array(
-			"label" => __('Category:'))))
-	->addField(
-		new dcFieldText('post_dt','',array(
-			"label" => __('Published on:'))))
-	->addField(
-		new dcFieldCombo('post_format',$core->auth->getOption('post_format'),$formaters_combo,array(
-			"label" => __('Text formating:'))))
-	->addField(
-		new dcFieldCheckbox ('post_open_comment',$core->blog->settings->system->allow_comments,array(
-			"label" => __('Accept comments'))))
-	->addField(
-		new dcFieldCheckbox ('post_open_tb',$core->blog->settings->system->allow_trackbacks,array(
-			"label" => __('Accept trackbacks'))))
-	->addField(
-		new dcFieldCheckbox ('post_selected',false,array(
-			"label" => __('Selected entry'))))
-	->addField(
-		new dcFieldCombo ('post_lang',$core->auth->getInfo('user_lang'),$lang_combo, array(
-			"label" => __('Entry lang:'))))
-	->addField(
-		new dcFieldHidden ('id',''))
-;
+# Validation flag
+$bad_dt = false;
+
 # Get entry informations
 if (!empty($_REQUEST['id']))
@@ -146,28 +105,182 @@
 	else
 	{
-		$form->id = $post->post_id;
-		$form->cat_id = $post->cat_id;
-		$form->post_dt = date('Y-m-d H:i',strtotime($post->post_dt));
-		$form->post_format = $post->post_format;
-		$form->post_password = $post->post_password;
-		$form->post_url = $post->post_url;
-		$form->post_lang = $post->post_lang;
-		$form->post_title = $post->post_title;
-		$form->post_excerpt = $post->post_excerpt;
-		$form->post_excerpt_xhtml = $post->post_excerpt_xhtml;
-		$form->post_content = $post->post_content;
-		$form->post_content_xhtml = $post->post_content_xhtml;
-		$form->post_notes = $post->post_notes;
-		$form->post_status = $post->post_status;
-		$form->post_selected = (boolean) $post->post_selected;
-		$form->post_open_comment = (boolean) $post->post_open_comment;
-		$form->post_open_tb = (boolean) $post->post_open_tb;
-		$form->can_edit_post = $post->isEditable();
-		$form->can_delete= $post->isDeletable();
-		
-	}
-}
-
-$form->setup();
+		$post_id = $post->post_id;
+		$cat_id = $post->cat_id;
+		$post_dt = date('Y-m-d H:i',strtotime($post->post_dt));
+		$post_format = $post->post_format;
+		$post_password = $post->post_password;
+		$post_url = $post->post_url;
+		$post_lang = $post->post_lang;
+		$post_title = $post->post_title;
+		$post_excerpt = $post->post_excerpt;
+		$post_excerpt_xhtml = $post->post_excerpt_xhtml;
+		$post_content = $post->post_content;
+		$post_content_xhtml = $post->post_content_xhtml;
+		$post_notes = $post->post_notes;
+		$post_status = $post->post_status;
+		$post_selected = (boolean) $post->post_selected;
+		$post_open_comment = (boolean) $post->post_open_comment;
+		$post_open_tb = (boolean) $post->post_open_tb;
+		
+		$page_title = __('Edit entry');
+		
+		$can_edit_post = $post->isEditable();
+		$can_delete= $post->isDeletable();
+		
+		$next_rs = $core->blog->getNextPost($post,1);
+		$prev_rs = $core->blog->getNextPost($post,-1);
+		
+		if ($next_rs !== null) {
+			$next_link = sprintf($post_link,$next_rs->post_id,
+				html::escapeHTML($next_rs->post_title),__('next entry').'&nbsp;&#187;');
+			$next_headlink = sprintf($post_headlink,'next',
+				html::escapeHTML($next_rs->post_title),$next_rs->post_id);
+		}
+		
+		if ($prev_rs !== null) {
+			$prev_link = sprintf($post_link,$prev_rs->post_id,
+				html::escapeHTML($prev_rs->post_title),'&#171;&nbsp;'.__('previous entry'));
+			$prev_headlink = sprintf($post_headlink,'previous',
+				html::escapeHTML($prev_rs->post_title),$prev_rs->post_id);
+		}
+		
+		try {
+			$core->media = new dcMedia($core);
+		} catch (Exception $e) {}
+	}
+}
+
+# Format excerpt and content
+if (!empty($_POST) && $can_edit_post)
+{
+	$post_format = $_POST['post_format'];
+	$post_excerpt = $_POST['post_excerpt'];
+	$post_content = $_POST['post_content'];
+	
+	$post_title = $_POST['post_title'];
+	
+	$cat_id = (integer) $_POST['cat_id'];
+	
+	if (isset($_POST['post_status'])) {
+		$post_status = (integer) $_POST['post_status'];
+	}
+	
+	if (empty($_POST['post_dt'])) {
+		$post_dt = '';
+	} else {
+		try
+		{
+			$post_dt = strtotime($_POST['post_dt']);
+			if ($post_dt == false || $post_dt == -1) {
+				$bad_dt = true;
+				throw new Exception(__('Invalid publication date'));
+			}
+			$post_dt = date('Y-m-d H:i',$post_dt);
+		}
+		catch (Exception $e)
+		{
+			$core->error->add($e->getMessage());
+		}
+	}
+	
+	$post_open_comment = !empty($_POST['post_open_comment']);
+	$post_open_tb = !empty($_POST['post_open_tb']);
+	$post_selected = !empty($_POST['post_selected']);
+	$post_lang = $_POST['post_lang'];
+	$post_password = !empty($_POST['post_password']) ? $_POST['post_password'] : null;
+	
+	$post_notes = $_POST['post_notes'];
+	
+	if (isset($_POST['post_url'])) {
+		$post_url = $_POST['post_url'];
+	}
+	
+	$core->blog->setPostContent(
+		$post_id,$post_format,$post_lang,
+		$post_excerpt,$post_excerpt_xhtml,$post_content,$post_content_xhtml
+	);
+}
+
+# Delete post
+if (!empty($_POST['delete']) && $can_delete)
+{
+	try {
+		# --BEHAVIOR-- adminBeforePostDelete
+		$core->callBehavior('adminBeforePostDelete',$post_id);
+		$core->blog->delPost($post_id);
+		http::redirect('posts.php');
+	} catch (Exception $e) {
+		$core->error->add($e->getMessage());
+	}
+}
+
+# Create or update post
+if (!empty($_POST) && !empty($_POST['save']) && $can_edit_post && !$bad_dt)
+{
+	$cur = $core->con->openCursor($core->prefix.'post');
+	
+	$cur->post_title = $post_title;
+	$cur->cat_id = ($cat_id ? $cat_id : null);
+	$cur->post_dt = $post_dt ? date('Y-m-d H:i:00',strtotime($post_dt)) : '';
+	$cur->post_format = $post_format;
+	$cur->post_password = $post_password;
+	$cur->post_lang = $post_lang;
+	$cur->post_title = $post_title;
+	$cur->post_excerpt = $post_excerpt;
+	$cur->post_excerpt_xhtml = $post_excerpt_xhtml;
+	$cur->post_content = $post_content;
+	$cur->post_content_xhtml = $post_content_xhtml;
+	$cur->post_notes = $post_notes;
+	$cur->post_status = $post_status;
+	$cur->post_selected = (integer) $post_selected;
+	$cur->post_open_comment = (integer) $post_open_comment;
+	$cur->post_open_tb = (integer) $post_open_tb;
+	
+	if (isset($_POST['post_url'])) {
+		$cur->post_url = $post_url;
+	}
+	
+	# Update post
+	if ($post_id)
+	{
+		try
+		{
+			# --BEHAVIOR-- adminBeforePostUpdate
+			$core->callBehavior('adminBeforePostUpdate',$cur,$post_id);
+			
+			$core->blog->updPost($post_id,$cur);
+			
+			# --BEHAVIOR-- adminAfterPostUpdate
+			$core->callBehavior('adminAfterPostUpdate',$cur,$post_id);
+			
+			http::redirect('post.php?id='.$post_id.'&upd=1');
+		}
+		catch (Exception $e)
+		{
+			$core->error->add($e->getMessage());
+		}
+	}
+	else
+	{
+		$cur->user_id = $core->auth->userID();
+		
+		try
+		{
+			# --BEHAVIOR-- adminBeforePostCreate
+			$core->callBehavior('adminBeforePostCreate',$cur);
+			
+			$return_id = $core->blog->addPost($cur);
+			
+			# --BEHAVIOR-- adminAfterPostCreate
+			$core->callBehavior('adminAfterPostCreate',$cur,$return_id);
+			
+			http::redirect('post.php?id='.$return_id.'&crea=1');
+		}
+		catch (Exception $e)
+		{
+			$core->error->add($e->getMessage());
+		}
+	}
+}
 
 /* DISPLAY
@@ -181,9 +294,393 @@
 }
 
-$_ctx
-	->fillPageTitle(__('Entries'),'posts.php')
-	->fillPageTitle($page_title)
-	->default_tab = $default_tab;
-
-$core->tpl->display('post.html.twig');
+dcPage::open($page_title.' - '.__('Entries'),
+	dcPage::jsDatePicker().
+	dcPage::jsToolBar().
+	dcPage::jsModal().
+	dcPage::jsMetaEditor().
+	dcPage::jsLoad('js/_post.js').
+	dcPage::jsConfirmClose('entry-form','comment-form').
+	# --BEHAVIOR-- adminPostHeaders
+	$core->callBehavior('adminPostHeaders').
+	dcPage::jsPageTabs($default_tab).
+	$next_headlink."\n".$prev_headlink
+);
+
+if (!empty($_GET['upd'])) {
+	dcPage::message(__('Entry has been successfully updated.'));
+}
+elseif (!empty($_GET['crea'])) {
+	dcPage::message(__('Entry has been successfully created.'));
+}
+elseif (!empty($_GET['attached'])) {
+	dcPage::message(__('File has been successfully attached.'));
+}
+elseif (!empty($_GET['rmattach'])) {
+	dcPage::message(__('Attachment has been successfully removed.'));
+}
+
+if (!empty($_GET['creaco'])) {
+	dcPage::message(__('Comment has been successfully created.'));
+}
+
+# XHTML conversion
+if (!empty($_GET['xconv']))
+{
+	$post_excerpt = $post_excerpt_xhtml;
+	$post_content = $post_content_xhtml;
+	$post_format = 'xhtml';
+	
+	dcPage::message(__('Don\'t forget to validate your XHTML conversion by saving your post.'));
+}
+
+echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.'<a href="posts.php">'.__('Entries').'</a> &rsaquo; <span class="page-title">'.$page_title;
+if ($post_id) {
+	switch ($post_status) {
+		case 1:
+			$img_status = sprintf($img_status_pattern,__('published'),'check-on.png');
+			break;
+		case 0:
+			$img_status = sprintf($img_status_pattern,__('unpublished'),'check-off.png');
+			break;
+		case -1:
+			$img_status = sprintf($img_status_pattern,__('scheduled'),'scheduled.png');
+			break;
+		case -2:
+			$img_status = sprintf($img_status_pattern,__('pending'),'check-wrn.png');
+			break;
+		default:
+			$img_status = '';
+	}
+	echo ' &ldquo;'.$post_title.'&rdquo;'.' '.$img_status;
+}
+echo	'</span></h2>';
+
+if ($post_id && $post->post_status == 1) {
+	echo '<p><a href="'.$post->getURL().'" onclick="window.open(this.href);return false;" title="'.$post_title.' ('.__('new window').')'.'">'.__('Go to this entry on the site').' <img src="images/outgoing-blue.png" alt="" /></a></p>';
+}
+if ($post_id)
+{
+	echo '<p>';
+	if ($prev_link) { echo $prev_link; }
+	if ($next_link && $prev_link) { echo ' - '; }
+	if ($next_link) { echo $next_link; }
+	
+	# --BEHAVIOR-- adminPostNavLinks
+	$core->callBehavior('adminPostNavLinks',isset($post) ? $post : null);
+	
+	echo '</p>';
+}
+
+# Exit if we cannot view page
+if (!$can_view_page) {
+	dcPage::helpBlock('core_post');
+	dcPage::close();
+	exit;
+}
+
+/* Post form if we can edit post
+-------------------------------------------------------- */
+if ($can_edit_post)
+{
+	echo '<div class="multi-part" title="'.__('Edit entry').'" id="edit-entry">';
+	echo '<form action="post.php" method="post" id="entry-form">';
+	echo '<div id="entry-wrapper">';
+	echo '<div id="entry-content"><div class="constrained">';
+	
+	echo
+	'<p class="col"><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').
+	form::field('post_title',20,255,html::escapeHTML($post_title),'maximal').
+	'</label></p>'.
+	
+	'<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:').'</label> '.
+	form::textarea('post_excerpt',50,5,html::escapeHTML($post_excerpt)).
+	'</p>'.
+	
+	'<p class="area"><label class="required" '.
+	'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '.
+	form::textarea('post_content',50,$core->auth->getOption('edit_size'),html::escapeHTML($post_content)).
+	'</p>'.
+	
+	'<p class="area" id="notes-area"><label for="post_notes">'.__('Notes:').'</label>'.
+	form::textarea('post_notes',50,5,html::escapeHTML($post_notes)).
+	'</p>';
+	
+	# --BEHAVIOR-- adminPostForm
+	$core->callBehavior('adminPostForm',isset($post) ? $post : null);
+	
+	echo
+	'<p>'.
+	($post_id ? form::hidden('id',$post_id) : '').
+	'<input type="submit" value="'.__('Save').' (s)" '.
+	'accesskey="s" name="save" /> ';
+	if ($post_id) {
+		$preview_url =
+		$core->blog->url.$core->url->getURLFor('preview',$core->auth->userID().'/'.
+		http::browserUID(DC_MASTER_KEY.$core->auth->userID().$core->auth->getInfo('user_pwd')).
+		'/'.$post->post_url);
+		echo '<a id="post-preview" href="'.$preview_url.'" class="button">'.__('Preview').'</a> ';
+	}
+	echo
+	($can_delete ? '<input type="submit" class="delete" value="'.__('Delete').'" name="delete" />' : '').
+	$core->formNonce().
+	'</p>';
+	
+	echo '</div></div>';		// End #entry-content
+	echo '</div>';		// End #entry-wrapper
+
+	echo '<div id="entry-sidebar">';
+	
+	echo
+	'<p><label for="cat_id">'.__('Category:').
+	form::combo('cat_id',$categories_combo,$cat_id,'maximal').
+	'</label></p>'.
+	
+	'<p><label for="post_status">'.__('Entry status:').
+	form::combo('post_status',$status_combo,$post_status,'','',!$can_publish).
+	'</label></p>'.
+	
+	'<p><label for="post_dt">'.__('Published on:').
+	form::field('post_dt',16,16,$post_dt,($bad_dt ? 'invalid' : '')).
+	'</label></p>'.
+	
+	'<p><label for="post_format">'.__('Text formating:').
+	form::combo('post_format',$formaters_combo,$post_format).
+	'</label>'.
+	'</p>'.
+	'<p>'.($post_id && $post_format != 'xhtml' ? '<a id="convert-xhtml" class="button" href="post.php?id='.$post_id.'&amp;xconv=1">'.__('Convert to XHTML').'</a>' : '').'</p>'.
+	
+	'<p><label for="post_open_comment" class="classic">'.form::checkbox('post_open_comment',1,$post_open_comment).' '.
+	__('Accept comments').'</label></p>'.
+	($core->blog->settings->system->allow_comments ? 
+		(isContributionAllowed($post_id,strtotime($post_dt),true) ? 
+			'' :
+			'<p class="form-note warn">'.__('Warning: Comments are not more accepted for this entry.').'</p>') : 
+		'<p class="form-note warn">'.__('Warning: Comments are not accepted on this blog.').'</p>').
+
+	'<p><label for="post_open_tb" class="classic">'.form::checkbox('post_open_tb',1,$post_open_tb).' '.
+	__('Accept trackbacks').'</label></p>'.
+	($core->blog->settings->system->allow_trackbacks ? 
+		(isContributionAllowed($post_id,strtotime($post_dt),false) ? 
+			'' :
+			'<p class="form-note warn">'.__('Warning: Trackbacks are not more accepted for this entry.').'</p>') : 
+		'<p class="form-note warn">'.__('Warning: Trackbacks are not accepted on this blog.').'</p>').
+
+	'<p><label for="post_selected" class="classic">'.form::checkbox('post_selected',1,$post_selected).' '.
+	__('Selected entry').'</label></p>'.
+	
+	'<p><label for="post_lang">'.__('Entry lang:').
+	form::combo('post_lang',$lang_combo,$post_lang).
+	'</label></p>'.
+	
+	'<p><label for="post_password">'.__('Entry password:').
+	form::field('post_password',10,32,html::escapeHTML($post_password),'maximal').
+	'</label></p>'.
+	
+	'<div class="lockable">'.
+	'<p><label for="post_url">'.__('Basename:').
+	form::field('post_url',10,255,html::escapeHTML($post_url),'maximal').
+	'</label></p>'.
+	'<p class="form-note warn">'.
+	__('Warning: If you set the URL manually, it may conflict with another entry.').
+	'</p>'.
+	'</div>';
+	
+	# --BEHAVIOR-- adminPostFormSidebar
+	$core->callBehavior('adminPostFormSidebar',isset($post) ? $post : null);
+	
+	echo '</div>';		// End #entry-sidebar
+
+	echo '</form>';
+	
+	# --BEHAVIOR-- adminPostForm
+	$core->callBehavior('adminPostAfterForm',isset($post) ? $post : null);
+	
+	echo '</div>';
+	
+	if ($post_id && $post->post_status == 1) {
+		echo '<p><a href="trackbacks.php?id='.$post_id.'" class="multi-part">'.
+		__('Ping blogs').'</a></p>';
+	}
+	
+}
+
+
+/* Comments and trackbacks
+-------------------------------------------------------- */
+if ($post_id)
+{
+	$params = array('post_id' => $post_id, 'order' => 'comment_dt ASC');
+	
+	$comments = $core->blog->getComments(array_merge($params,array('comment_trackback'=>0)));
+	$trackbacks = $core->blog->getComments(array_merge($params,array('comment_trackback'=>1)));
+	
+	# Actions combo box
+	$combo_action = array();
+	if ($can_edit_post && $core->auth->check('publish,contentadmin',$core->blog->id))
+	{
+		$combo_action[__('publish')] = 'publish';
+		$combo_action[__('unpublish')] = 'unpublish';
+		$combo_action[__('mark as pending')] = 'pending';
+		$combo_action[__('mark as junk')] = 'junk';
+	}
+	
+	if ($can_edit_post && $core->auth->check('delete,contentadmin',$core->blog->id))
+	{
+		$combo_action[__('Delete')] = 'delete';
+	}
+	
+	# --BEHAVIOR-- adminCommentsActionsCombo
+	$core->callBehavior('adminCommentsActionsCombo',array(&$combo_action));
+	
+	$has_action = !empty($combo_action) && (!$trackbacks->isEmpty() || !$comments->isEmpty());
+	
+	echo
+	'<div id="comments" class="multi-part" title="'.__('Comments').'">';
+	
+	if ($has_action) {
+		echo '<form action="comments_actions.php" id="form-comments" method="post">';
+	}
+	
+	echo '<h3>'.__('Trackbacks').'</h3>';
+	
+	if (!$trackbacks->isEmpty()) {
+		showComments($trackbacks,$has_action,true);
+	} else {
+		echo '<p>'.__('No trackback').'</p>';
+	}
+	
+	echo '<h3>'.__('Comments').'</h3>';
+	if (!$comments->isEmpty()) {
+		showComments($comments,$has_action);
+	} else {
+		echo '<p>'.__('No comment').'</p>';
+	}
+	
+	if ($has_action) {
+		echo
+		'<div class="two-cols">'.
+		'<p class="col checkboxes-helpers"></p>'.
+		
+		'<p class="col right"><label for="action" class="classic">'.__('Selected comments action:').'</label> '.
+		form::combo('action',$combo_action).
+		form::hidden('redir','post.php?id='.$post_id.'&amp;co=1').
+		$core->formNonce().
+		'<input type="submit" value="'.__('ok').'" /></p>'.
+		'</div>'.
+		'</form>';
+	}
+	
+	echo '</div>';
+}
+
+/* Add a comment
+-------------------------------------------------------- */
+if ($post_id)
+{
+	echo
+	'<div class="multi-part" id="add-comment" title="'.__('Add a comment').'">'.
+	'<h3>'.__('Add a comment').'</h3>'.
+	
+	'<form action="comment.php" method="post" id="comment-form">'.
+	'<div class="constrained">'.
+	'<p><label for="comment_author" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Name:').
+	form::field('comment_author',30,255,html::escapeHTML($core->auth->getInfo('user_cn'))).
+	'</label></p>'.
+	
+	'<p><label for="comment_email">'.__('Email:').
+	form::field('comment_email',30,255,html::escapeHTML($core->auth->getInfo('user_email'))).
+	'</label></p>'.
+	
+	'<p><label for="comment_site">'.__('Web site:').
+	form::field('comment_site',30,255,html::escapeHTML($core->auth->getInfo('user_url'))).
+	'</label></p>'.
+	
+	'<p class="area"><label for="comment_content" class="required"><abbr title="'.__('Required field').'">*</abbr> '.
+	__('Comment:').'</label> '.
+	form::textarea('comment_content',50,8,html::escapeHTML('')).
+	'</p>'.
+	
+	'<p>'.form::hidden('post_id',$post_id).
+	$core->formNonce().
+	'<input type="submit" name="add" value="'.__('Save').'" /></p>'.
+	'</div>'.
+	'</form>'.
+	'</div>';
+}
+
+# Controls comments or trakbacks capabilities
+function isContributionAllowed($id,$dt,$com=true)
+{
+	global $core;
+
+	if (!$id) {
+		return true;
+	}
+	if ($com) {
+		if (($core->blog->settings->system->comments_ttl == 0) || 
+			(time() - $core->blog->settings->system->comments_ttl*86400 < $dt)) {
+			return true;
+		}
+	} else {
+		if (($core->blog->settings->system->trackbacks_ttl == 0) || 
+			(time() - $core->blog->settings->system->trackbacks_ttl*86400 < $dt)) {
+			return true;
+		}
+	}
+	return false;
+}
+
+# Show comments or trackbacks
+function showComments($rs,$has_action,$tb=false)
+{
+	echo
+	'<table class="comments-list"><tr>'.
+	'<th colspan="2">'.__('Author').'</th>'.
+	'<th>'.__('Date').'</th>'.
+	'<th class="nowrap">'.__('IP address').'</th>'.
+	'<th>'.__('Status').'</th>'.
+	'<th>&nbsp;</th>'.
+	'</tr>';
+	
+	while($rs->fetch())
+	{
+		$comment_url = 'comment.php?id='.$rs->comment_id;
+		
+		$img = '<img alt="%1$s" title="%1$s" src="images/%2$s" />';
+		switch ($rs->comment_status) {
+			case 1:
+				$img_status = sprintf($img,__('published'),'check-on.png');
+				break;
+			case 0:
+				$img_status = sprintf($img,__('unpublished'),'check-off.png');
+				break;
+			case -1:
+				$img_status = sprintf($img,__('pending'),'check-wrn.png');
+				break;
+			case -2:
+				$img_status = sprintf($img,__('junk'),'junk.png');
+				break;
+		}
+		
+		echo
+		'<tr class="line'.($rs->comment_status != 1 ? ' offline' : '').'"'.
+		' id="c'.$rs->comment_id.'">'.
+		
+		'<td class="nowrap">'.
+		($has_action ? form::checkbox(array('comments[]'),$rs->comment_id,'','','',0,'title="'.($tb ? __('select this trackback') : __('select this comment')).'"') : '').'</td>'.
+		'<td class="maximal">'.html::escapeHTML($rs->comment_author).'</td>'.
+		'<td class="nowrap">'.dt::dt2str(__('%Y-%m-%d %H:%M'),$rs->comment_dt).'</td>'.
+		'<td class="nowrap"><a href="comments.php?ip='.$rs->comment_ip.'">'.$rs->comment_ip.'</a></td>'.
+		'<td class="nowrap status">'.$img_status.'</td>'.
+		'<td class="nowrap status"><a href="'.$comment_url.'">'.
+		'<img src="images/edit-mini.png" alt="" title="'.__('Edit this comment').'" /></a></td>'.
+		
+		'</tr>';
+	}
+	
+	echo '</table>';
+}
+
+dcPage::helpBlock('core_post','core_wiki');
+dcPage::close();
 ?>
Index: nc/admin/class.dc.admincontext.php
===================================================================
--- inc/admin/class.dc.admincontext.php	(revision 1091)
+++ 	(revision )
@@ -1,493 +1,0 @@
-<?php
-# -- BEGIN LICENSE BLOCK ---------------------------------------
-#
-# This file is part of Dotclear 2.
-#
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
-# Licensed under the GPL version 2.0 license.
-# See LICENSE file or
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-#
-# -- END LICENSE BLOCK -----------------------------------------
-if (!defined('DC_RC_PATH')) { return; }
-
-/**
-@ingroup DC_CORE
-@brief Template extension for admin context
-
-This extends template environment with tools required in admin context.
-*/
-class dcAdminContext extends Twig_Extension
-{
-	protected $core;
-	protected $globals = array();
-	protected $protected_globals = array();
-	protected $memory = array();
-	
-	public function __construct($core)
-	{
-		$this->core = $core;
-		
-		# Globals editable via context
-		$this->globals = array();
-		
-		# Globals not editable via context
-		$this->protected_globals = array(
-			'messages' => array(
-				'static' => array(),
-				'lists' => array(),
-				'alert' => '',
-				'errors' => array()
-			),
-			
-			'page_title'	=> array(),
-			'page_global'	=> false,
-			
-			'admin_url' 	=> DC_ADMIN_URL,
-			'theme_url' 	=> DC_ADMIN_URL.'index.php?tf=',
-			'plugin_url' 	=> DC_ADMIN_URL.'index.php?pf=',
-			
-			'version' 		=> DC_VERSION,
-			'vendor_name' 	=> DC_VENDOR_NAME,
-			
-			'safe_mode' 	=> isset($_SESSION['sess_safe_mode']) && $_SESSION['sess_safe_mode'],
-			'debug_mode'	=> DC_DEBUG
-		);
-	}
-	
-	/**
-	Prevent call crash from template on method that return this class
-	*/
-	public function __toString()
-	{
-		return '';
-	}
-	
-	/**
-	Test a global variable
-	
-	@param string $name Name of the variable to test
-	@return boolean
-	*/
-	public function __isset($name)
-	{
-		return isset($this->globals[$name]);
-	}
-	
-	/**
-	Add a global variable
-	
-	@param string $name Name of the variable
-	@param mixed $value Value of the variable
-	*/
-	public function __set($name,$value)
-	{
-/*
-		# Overload protect
-		if ($value === null && isset($this->globals[$name])) {
-			unset($this->globals[$name]);
-		}
-		elseif (!isset($this->globals[$name])) {
-			throw new Exception('Modification of overloaded globals has no effect');
-		}
-//*/
-		$this->globals[$name] = $value;
-	}
-	
-	/**
-	Get a global variable
-	
-	@param string $name Name of the variable
-	@return mixed Value of the variable or null
-	*/
-	public function __get($name)
-	{
-		return isset($this->globals[$name]) ? $this->globals[$name] : null;
-	}
-	
-	/**
-	Returns a list of filters to add to the existing list.
-	
-	@return array An array of filters
-	*/
-	public function getFilters()
-	{
-		return array(
-			'trans' => new Twig_Filter_Function("__", array('is_safe' => array('html')))
-		);
-	}
-	
-	/**
-	Returns a list of functions to add to the existing list.
-	
-	@return array An array of functions
-	*/
-	public function getFunctions()
-	{
-		return array(
-			'__' 		=> new Twig_Function_Function("__", array('is_safe' => array('html'))),
-			'debug_info' => new Twig_Function_Method($this, 'getDebugInfo', array('is_safe' => array('html'))),
-			'memorize' => new Twig_Function_Method($this, 'setMemory', array('is_safe' => array('html'))),
-			'memorized' => new Twig_Function_Method($this, 'getMemory', array('is_safe' => array('html')))
-		);
-	}
-	
-	/**
-	Returns a list of global variables to add to the existing list.
-	
-	This merges overloaded variables with defined variables.
-	
-	@return array An array of global variables
-	*/
-	public function getGlobals()
-	{
-		$this->getBlogs();
-		$this->getCurrentBlog();
-		$this->getCurrentUser();
-		$this->getMenus();
-		
-		# Additional globals
-		$p = path::info($_SERVER['REQUEST_URI']);
-		$this->protected_globals['current_page'] = $p['base'];
-		$this->protected_globals['blog_count'] = $this->core->auth->blog_count;
-		$this->protected_globals['rtl'] = l10n::getTextDirection(
-			$this->protected_globals['current_user']['lang']) == 'rtl';
-		$this->protected_globals['session'] = array(
-			'id' => session_id(),
-			'uid' => isset($_SESSION['sess_browser_uid']) ? $_SESSION['sess_browser_uid'] : '',
-			'nonce' => $this->core->getNonce()
-		);
-		
-		# Keep protected globals safe
-		return array_merge($this->globals,$this->protected_globals);
-	}
-	
-	/**
-	Returns the name of the extension.
-	
-	@return string The extension name
-	*/
-	public function getName()
-	{
-		return 'AdminContext';
-	}
-	
-	
-	/**
-	Add an informational message
-	
-	@param string $message A message
-	@return object self
-	*/
-	public function setSafeMode($safe_mode)
-	{
-		$this->protected_globals['safe_mode'] = (boolean) $safe_mode;
-		return $this;
-	}
-	
-	/**
-	Add an informational message
-	
-	@param string $message A message
-	@return object self
-	*/
-	public function addMessageStatic($message)
-	{
-		$this->protected_globals['messages']['static'][] = $message;
-		return $this;
-	}
-	
-	/**
-	Add a list of informational messages
-	
-	@param string $message A title
-	@param array $message A list of messages
-	@return object self
-	*/
-	public function addMessagesList($title,$messages)
-	{
-		$this->protected_globals['messages']['lists'][$title] = $messages;
-		return $this;
-	}
-	
-	/**
-	Set an important message
-	
-	@param string $message A message
-	@return object self
-	*/
-	public function setAlert($message)
-	{
-		$this->protected_globals['messages']['alert'] = $message;
-		return $this;
-	}
-	
-	/**
-	Add an error message
-	
-	@param string Error message
-	@return object self
-	*/
-	public function addError($error)
-	{
-		$this->protected_globals['messages']['errors'][] = $error;
-		return $this;
-	}
-	
-	/**
-	Check if there is an error message
-	
-	@return boolean
-	*/
-	public function hasError()
-	{
-		return !empty($this->protected_globals['messages']['errors']);
-	}
-	
-	/**
-	Fill the page title
-	
-	$title can be: 
-	a string for page title part or 
-	TRUE to add blog name at the begining of title or
-	NULL to empty/reset title
-	
-	@param mixed $title A title part
-	@param boolean $url Link of the title part
-	@return object self
-	*/
-	public function fillPageTitle($title,$url='')
-	{
-		if (is_bool($title)) {
-			$this->protected_globals['page_global'] = $title;
-		}
-		elseif (null === $title) {
-			$this->protected_globals['page_global'] = false;
-			$this->protected_globals['page_title'] = array();
-		}
-		else {
-			$this->protected_globals['page_title'][] = array(
-				'title' => $title,
-				'link' => $url
-			);
-		}
-		return $this;
-	}
-	
-	/**
-	Check if a page title is set
-	*/
-	public function hasPageTitle()
-	{
-		return !empty($this->protected_globals['page_title']);
-	}
-	
-	/**
-	Get list of blogs
-	*/
-	protected function getBlogs()
-	{
-		$blog_id = '';
-		
-		# Blogs list
-		$blogs = array();
-		if ($this->core->auth->blog_count > 1 && $this->core->auth->blog_count < 20) {
-			$blog_id = $this->core->blog->id;
-			$rs_blogs = $this->core->getBlogs(array('order'=>'LOWER(blog_name)','limit'=>20));
-			while ($rs_blogs->fetch()) {
-				$blogs[$rs_blogs->blog_id] = $rs_blogs->blog_name.' - '.$rs_blogs->blog_url;
-				$this->protected_globals['blogs'][$rs_blogs->blog_id] = array(
-					'id' 	=> $rs_blogs->blog_id,
-					'name' 	=> $rs_blogs->blog_name,
-					'desc' 	=> $rs_blogs->blog_desc,
-					'url' 	=> $rs_blogs->blog_url,
-					'creadt'	=> $rs_blogs->blog_creadt,
-					'upddt'	=> $rs_blogs->blog_upddt
-				);
-			}
-		}
-		
-		# Switch blog form
-		$form = new dcForm($this->core,'switchblog_menu','index.php');
-		$form
-			->addField(
-				new dcFieldCombo('switchblog',$blog_id,$blogs,array(
-				'label' => __('Blogs:'))))
-			->addField(
-				new dcFieldSubmit('switchblog_submit',__('ok'),array(
-				'action' => 'switchblog')))
-			->setup();
-	}
-	
-	/**
-	Get current blog information
-	*/
-	protected function getCurrentBlog()
-	{
-		$this->protected_globals['current_blog'] = $this->core->auth->blog_count ?
-			array(
-				'id' 	=> $this->core->blog->id,
-				'name' 	=> $this->core->blog->name,
-				'desc' 	=> $this->core->blog->desc,
-				'url' 	=> $this->core->blog->url,
-				'host' 	=> $this->core->blog->host,
-				'creadt'	=> $this->core->blog->creadt,
-				'upddt'	=> $this->core->blog->upddt
-			) : array(
-				'id' 	=> '',
-				'name' 	=> '',
-				'desc' 	=> '',
-				'url' 	=> '',
-				'host' 	=> '',
-				'creadt'	=> '',
-				'upddt'	=> ''
-			);
-	}
-	
-	/**
-	Get current user information
-	*/
-	protected function getCurrentUser()
-	{
-		$infos = array(
-			'pwd','name','firstname','displayname',
-			'email','url','default_blog','lang','tz',
-			'post_status','creadt','upddt','cn'
-		);
-		
-		$user = array(
-			'id' => '',
-			'super' => false,
-			'lang' => 'en',
-			'options' => $this->core->userDefaults(),
-			'prefs' => array(),
-			'rights' => array(
-				'media' => false
-			)
-		);
-		
-		foreach($infos as $i) {
-			$user[$i] = '';
-		}
-		
-		if ($this->core->auth->userID()) {
-		
-			$user = array(
-				'id' => $this->core->auth->userID(),
-				'super' => $this->core->auth->isSuperAdmin(),
-				'options' => $this->core->auth->getOptions(),
-				'rights' => array(
-					'media' => $this->core->auth->check('media,media_admin',$this->core->blog->id)
-				)
-			);
-			
-			foreach($infos as $i) {
-				$user[$i] = $this->core->auth->getInfo('user_'.$i);
-			}
-			
-			foreach($this->core->auth->user_prefs->dumpWorkspaces() as $ws => $prefs) {
-				$user['prefs'][$ws] = $prefs->dumpPrefs();
-			}
-		}
-		
-		$this->protected_globals['current_user'] = $user;
-	}
-	
-	/**
-	Get sidebar menus
-	*/
-	protected function getMenus()
-	{
-		global $_menu;
-		
-		$this->protected_globals['menus'] = array();
-		
-		if (!isset($_menu)) {
-			return;
-		}
-		
-		foreach($_menu as $m) {
-			$this->protected_globals['menus'][] = array(
-				'id' 		=> $m->getID(),
-				'title' 		=> $m->getTitle(),
-				'separator' 	=> $m->getSeparator(),
-				'items' 		=> $m->getItems()
-			);
-		}
-	}
-	
-	/**
-	Get an array of debug/dev infos
-	*/
-	public function getDebugInfo()
-	{
-		if (!DC_DEBUG) {
-			return array();
-		}
-		
-		$di = array(
-			'global_vars' => implode(', ',array_keys($GLOBALS)),
-			'memory' => array(
-				'usage' => memory_get_usage(),
-				'size' => files::size(memory_get_usage())
-			),
-			'xdebug' => array()
-		);
-		
-		if (function_exists('xdebug_get_profiler_filename')) {
-		
-			$url = http::getSelfURI();
-			$url .= strpos($url,'?') === false ? '?' : '&';
-			$url .= 'XDEBUG_PROFILE';
-			
-			$di['xdebug'] = array(
-				'elapse_time' => xdebug_time_index(),
-				'profiler_file' => xdebug_get_profiler_filename(),
-				'profiler_url' =>  $url
-			);
-			
-			/* xdebug configuration:
-			zend_extension = /.../xdebug.so
-			xdebug.auto_trace = On
-			xdebug.trace_format = 0
-			xdebug.trace_options = 1
-			xdebug.show_mem_delta = On
-			xdebug.profiler_enable = 0
-			xdebug.profiler_enable_trigger = 1
-			xdebug.profiler_output_dir = /tmp
-			xdebug.profiler_append = 0
-			xdebug.profiler_output_name = timestamp
-			*/
-		}
-		
-		return $di;
-	}
-	
-	/**
-	Add a value in a namespace memory
-	
-	This help keep variable when recalling Twig macros
-	
-	@param string $ns A namespace
-	@param string $str A value to memorize in this namespace
-	*/
-	public function setMemory($ns,$str)
-	{
-		if (!array_key_exists($ns,$this->memory) || !in_array($str,$this->memory[$ns])) {
-			$this->memory[$ns][] = $str;
-		}
-	}
-	
-	/**
-	Check if a value is previously memorized in a namespace
-	
-	@param string $ns A namespace
-	@param string $str A value to search in this namespace
-	@return array True if exists
-	*/
-	public function getMemory($ns,$str)
-	{
-		return array_key_exists($ns,$this->memory) && in_array($str,$this->memory[$ns]);
-	}
-}
-?>
Index: nc/admin/class.dc.form.php
===================================================================
--- inc/admin/class.dc.form.php	(revision 1090)
+++ 	(revision )
@@ -1,530 +1,0 @@
-<?php
-# -- BEGIN LICENSE BLOCK ---------------------------------------
-#
-# This file is part of Dotclear 2.
-#
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
-# Licensed under the GPL version 2.0 license.
-# See LICENSE file or
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-#
-# -- END LICENSE BLOCK -----------------------------------------
-if (!defined('DC_RC_PATH')) { return; }
-
-/**
- * Template form node
- */
-class dcFormNode extends Twig_Node
-{
-	public function __construct($name,Twig_NodeInterface $body,$lineno,$tag=null)
-	{
-		parent::__construct(array('body' => $body),array('name' => $name),$lineno,$tag);
-	}
-	
-	/**
-	* Compiles the node to PHP.
-	*
-	* @param Twig_Compiler A Twig_Compiler instance
-	*/
-	public function compile(Twig_Compiler $compiler)
-	{
-		$compiler
-			->addDebugInfo($this)
-			->write("\$context['dc_form']->beginForm('".
-				$this->getAttribute('name')."');\n")
-			->subcompile($this->getNode('body'))
-			->write("\$context['dc_form']->renderHiddenWidgets();\n")
-			->write("\$context['dc_form']->endForm();\n")
-		;
-	}
-}
-
-/**
- * Template form token parser
- */
-class dcFormTokenParser extends Twig_TokenParser
-{
-	public function parse(Twig_Token $token)
-	{
-		$lineno = $token->getLine();
-		$stream = $this->parser->getStream();
-		$name = $stream->expect(Twig_Token::NAME_TYPE)->getValue();
-		$stream->expect(Twig_Token::BLOCK_END_TYPE);
-		$body = $this->parser->subparse(array($this,'decideBlockEnd'),true);
-		$stream->expect(Twig_Token::BLOCK_END_TYPE);
-		
-		return new dcFormNode($name,$body,$token->getLine(),$this->getTag());
-	}
-	
-	public function decideBlockEnd(Twig_Token $token)
-	{
-		return $token->test('endform');
-	}
-	
-	public function getTag()
-	{
-		return 'form';
-	}
-}
-
-/**
- * Template form extension
- */
-class dcFormExtension extends Twig_Extension
-{
-	protected $template;
-	protected $tpl;
-	protected $core;
-	protected $twig;
-	protected $blocks;
-	protected $forms;
-	protected $currentForm;
-	
-	public function __construct($core)
-	{
-		$this->core = $core;
-		$this->tpl = 'form_layout.html.twig';
-		$this->forms = array();
-		$this->currentForm = null;
-	}
-	
-	public function initRuntime(Twig_Environment $environment)
-	{
-		$this->twig = $environment;
-		$this->template = $this->twig->loadTemplate($this->tpl);
-		$this->blocks = $this->template->getBlocks();
-	}
-	
-	public function getGlobals()
-	{
-		return array('dc_form' => $this);
-	}
-	
-	public function getFunctions()
-	{
-		return array(
-			'form_field' => new Twig_Function_Method(
-				$this,
-				'renderWidget',
-				array('is_safe' => array('html'))
-			),
-			'_form_is_choice_group' => new Twig_Function_Method(
-				$this,
-				'isChoiceGroup',
-				array('is_safe' => array('html'))
-			),
-			'_form_is_choice_selected' => new Twig_Function_Method(
-				$this,
-				'isChoiceSelected',
-				array('is_safe' => array('html'))
-			)
-		);
-	}
-	
-	public function isChoiceGroup($choice)
-	{
-		return is_array($choice);
-	}
-	
-	public function isChoiceSelected($choice,$value)
-	{
-		return $choice == $value;
-	}
-	
-	public function getTokenParsers()
-	{
-		return array(new dcFormTokenParser());
-	}
-	
-	public function renderWidget($name,$attributes=array())
-	{
-		$field = $this->currentForm->$name;
-		if ($field) {
-			echo $this->template->renderBlock(
-				$field->getWidgetBlock(),
-				array_merge(
-					$field->getAttributes(),
-					array('attr' => $attributes)
-				),
-				$this->blocks
-			);
-		}
-	}
-
-	public function renderHiddenWidgets()
-	{
-		foreach ($this->currentForm->getHiddenFields() as $h) {
-			$this->renderWidget($h->getName());
-		}
-	}
-
-	public function getName()
-	{
-		return 'dc_form';
-	}
-
-	public function addForm(dcForm $form)
-	{
-		$this->forms[$form->getName()] = $form;
-	}
-
-	public function beginForm($name)
-	{
-		if (isset($this->forms[$name])) {
-			$this->currentForm = $this->forms[$name];
-			$this->currentForm->begin();
-		}
-		else {
-			throw new Twig_Error_Runtime(sprintf(
-				'Form "%s" does not exist',
-				$name
-			));
-		}
-	}
-	
-	public function endForm()
-	{
-		$this->currentForm->end();
-		$this->currentForm = null;
-	}
-}
-
-/**
- * Template form exception
- */
-class InvalidFieldException extends Exception {
-}
-
-/**
- * Template form
- */
-class dcForm
-{
-	protected $id;
-	protected $name;
-	protected $core;
-	protected $action;
-	protected $fields;
-	protected $method;
-	protected $submitfields;
-	protected $hiddenfields;
-	protected $errors;
-	
-	private function addNonce()
-	{
-		$this->addField(
-			new dcFieldHidden(array('xd_check'),
-			$this->core->getNonce())
-		);
-	}
-	
-	protected function getNID($nid)
-	{
-		if (is_array($nid)) {
-			$this->name = $nid[0];
-			$this->id = !empty($nid[1]) ? $nid[1] : null;
-		}
-		else {
-			$this->id = null;
-			$this->name = $nid;
-		}
-	}
-	
-	public function __construct($core,$name,$action,$method='POST')
-	{
-		$this->core = $core;
-		$this->getNID($name);
-		$this->method = $method;
-		$this->action = $action;
-		$this->fields = array();
-		$this->core->tpl->getExtension('dc_form')->addForm($this);
-		$this->submitfields = array();
-		$this->hiddenfields = array();
-		$this->errors = array();
-		if ($method == 'POST') {
-			$this->addNonce();
-		}
-	}
-	
-	public function getName()
-	{
-		return $this->name;
-	}
-	
-	public function getErrors()
-	{
-		return $this->errors;
-	}
-	
-	public function addField(dcField $f)
-	{
-		if ($f instanceof dcFieldAction) {
-			$this->submitfields[$f->getName()] = $f;
-		}
-		if ($f instanceof dcFieldHidden) {
-			$this->hiddenfields[$f->getName()] = $f;
-		}
-		$this->fields[$f->getName()] = $f;
-		
-		return $this;
-	}
-	
-	public function begin()
-	{
-		echo sprintf(
-			'<form%s method="%s" action="%s">',
-			empty($this->id) ? '' : ' id="'.$this->id.'"',
-			$this->method,
-			$this->action
-		);
-	}
-	
-	public function end()
-	{
-		echo '</form>';
-	}
-	
-	public function __isset($name)
-	{
-		return isset($this->fields[$name]);
-	}
-	
-	public function __get($name)
-	{
-		return isset($this->fields[$name]) ? 
-			$this->fields[$name] : null;
-	}
-	
-	public function __set($name,$value)
-	{
-		if (isset($this->fields[$name])) {
-			$this->fields[$name]->setAttribute('value',$value);
-		}
-	}
-	
-	public function isSubmitted()
-	{
-		$from = $this->method == 'POST' ? $_POST : $_GET;
-		echo "form fields :\n";
-	}
-	
-	public function setup()
-	{
-		$from = $this->method == 'POST' ? $_POST : $_GET;
-		foreach ($this->fields as $f) {
-			$f->setup($from);
-		}
-		foreach ($this->submitfields as $f) {
-			if ($f->isDefined()) {
-				$ret = call_user_func($f->getAction(),$this);
-				return;
-			}
-		}
-	}
-	
-	public function check()
-	{
-		foreach ($this->fields as $f) {
-			try {
-				$f->check();
-			}
-			catch (InvalidFieldException $e) {
-				$this->errors[] = $e->getMessage();
-			}
-		}
-	}
-	
-	public function getHiddenFields()
-	{
-		return $this->hiddenfields;
-	}
-}
-
-/**
- * Template form field
- */
-abstract class dcField
-{
-	protected $attributes;
-	protected $name;
-	protected $value;
-	protected $id;
-	protected $defined;
-	
-	protected function getNID($nid)
-	{
-		if (is_array($nid)) {
-			$this->name = $nid[0];
-			$this->id = !empty($nid[1]) ? $nid[1] : null;
-		}
-		else {
-			$this->id = $this->name = $nid;
-		}
-	}
-	
-	public function __construct($name,$value,$attributes=array())
-	{
-		$this->getNID($name);
-		$this->attributes = $attributes;
-		$this->value = $value;
-		$this->attributes['name'] = $this->name;
-		$this->attributes['id'] = $this->id;
-		$this->attributes['value'] = $this->value;
-		$this->defined = false;
-	}
-	
-	public function __toString()
-	{
-		return $this->value;
-	}
-	
-	abstract public function getWidgetBlock();
-	
-	public function setAttribute($name,$value)
-	{
-		$this->attributes[$name] = $value;
-	}
-	
-	public function getAttributes()
-	{
-		return $this->attributes;
-	}
-	
-	public function getName()
-	{
-		return $this->name;
-	}
-	
-	public function check()
-	{
-		if (!$this->defined && $this->attributes['defined']) {
-			throw new InvalidFieldException(sprintf(
-				'Field "%s" is mandatory',
-				$this->attributes['label'])
-			);
-		}
-	}
-	
-	public function setup($from)
-	{
-		if (isset($from[$this->id])) {
-			$this->value = $from[$this->id];
-			$this->defined = true;
-		}
-	}
-	
-	public function isDefined()
-	{
-		return $this->defined;
-	}
-}
-
-/**
- * Template form field of type "password"
- */
-class dcFieldPassword extends dcField
-{
-	public function getWidgetBlock()
-	{
-		return "field_password";
-	}
-}
-
-/**
- * Template form field of type "text"
- */
-class dcFieldText extends dcField
-{
-	public function getWidgetBlock()
-	{
-	return "field_text";
-	}
-}
-
-/**
- * Template form field of type "textarea"
- */
-class dcFieldTextArea extends dcField
-{
-	public function getWidgetBlock()
-	{
-		return "field_textarea";
-	}
-}
-
-/**
- * Template form field of type "hidden"
- */
-class dcFieldHidden extends dcField
-{
-	public function getWidgetBlock()
-	{
-		return "field_hidden";
-	}
-}
-
-/**
- * Template form field of type "checkbox"
- */
-class dcFieldCheckbox extends dcField
-{
-	public function getWidgetBlock()
-	{
-		return "field_checkbox";
-	}
-}
-
-/**
- * Template form action
- */
-abstract class dcFieldAction extends dcField
-{
-	protected $action;
-	
-	public function __construct($name,$value,$attributes=array())
-	{
-		parent::__construct($name,$value,$attributes);
-		
-		if (isset($attributes['action'])) {
-			$this->action = $attributes['action'];
-		}
-	}
-	
-	public function getAction()
-	{
-		return $this->action;
-	}
-}
-
-/**
- * Template form field of type "submit"
- */
-class dcFieldSubmit extends dcFieldAction
-{
-	public function getWidgetBlock()
-	{
-		return "field_submit";
-	}
-}
-
-/**
- * Template form field of type "combo"
- */
-class dcFieldCombo extends dcField
-{
-	protected $options;
-	
-	public function __construct($name,$value,$options,$attributes=array())
-	{
-		$this->options = $options;
-		parent::__construct($name,$value,$attributes);
-		$this->attributes['options']=$options;
-	}
-	
-	public function getWidgetBlock()
-	{
-		return "field_combo";
-	}
-
-}
-?>
Index: inc/admin/class.dc.menu.php
===================================================================
--- inc/admin/class.dc.menu.php	(revision 1064)
+++ inc/admin/class.dc.menu.php	(revision 691)
@@ -14,35 +14,13 @@
 class dcMenu
 {
-	private $items;
 	private $id;
 	public $title;
-	public $separator;
 	
-	public function __construct($id,$title,$separator='')
+	public function __construct($id,$title,$itemSpace='')
 	{
 		$this->id = $id;
 		$this->title = $title;
-		$this->separator = $separator;
+		$this->itemSpace = $itemSpace;
 		$this->items = array();
-	}
-	
-	public function getID()
-	{
-		return $this->id;
-	}
-	
-	public function getTitle()
-	{
-		return $this->title;
-	}
-	
-	public function getSeparator()
-	{
-		return $this->separator;
-	}
-	
-	public function getItems()
-	{
-		return $this->items;
 	}
 	
@@ -61,28 +39,4 @@
 	}
 	
-	protected function itemDef($title,$url,$img,$active,$id=null,$class=null)
-	{
-		if (is_array($url)) {
-			$link = $url[0];
-			$ahtml = (!empty($url[1])) ? ' '.$url[1] : '';
-		} else {
-			$link = $url;
-			$ahtml = '';
-		}
-		
-		return array(
-			'title' => $title,
-			'link' => $link,
-			'ahtml' => $ahtml,
-			'img' => dc_admin_icon_url($img),
-			'active' => (boolean) $active,
-			'id' => $id,
-			'class' => $class
-		);
-	}
-	
-	/**
-	@deprecated Use Template engine instead
-	*/
 	public function draw()
 	{
@@ -98,9 +52,9 @@
 		for ($i=0; $i<count($this->items); $i++)
 		{
-			if ($i+1 < count($this->items) && $this->separator != '') {
-				$res .= preg_replace('|</li>$|',$this->separator.'</li>',$this->drawItem($this->items[$i]));
+			if ($i+1 < count($this->items) && $this->itemSpace != '') {
+				$res .= preg_replace('|</li>$|',$this->itemSpace.'</li>',$this->items[$i]);
 				$res .= "\n";
 			} else {
-				$res .= $this->drawItem($this->items[$i])."\n";
+				$res .= $this->items[$i]."\n";
 			}
 		}
@@ -111,16 +65,23 @@
 	}
 	
-	/**
-	@deprecated Use Template engine instead
-	*/
-	protected function drawItem($item)
+	protected function itemDef($title,$url,$img,$active,$id=null,$class=null)
 	{
+		if (is_array($url)) {
+			$link = $url[0];
+			$ahtml = (!empty($url[1])) ? ' '.$url[1] : '';
+		} else {
+			$link = $url;
+			$ahtml = '';
+		}
+		
+		$img = dc_admin_icon_url($img);
+		
 		return
-		'<li'.(($item['active'] || $item['class']) ? ' class="'.(($item['active']) ? 'active ' : '').(($item['class']) ? $item['class'] : '').'"' : '').
-		(($item['id']) ? ' id="'.$item['id'].'"' : '').
-		(($item['img']) ? ' style="background-image: url('.$item['img'].');"' : '').
+		'<li'.(($active || $class) ? ' class="'.(($active) ? 'active ' : '').(($class) ? $class : '').'"' : '').
+		(($id) ? ' id="'.$id.'"' : '').
+		(($img) ? ' style="background-image: url('.$img.');"' : '').
 		'>'.
 		
-		'<a href="'.$item['link'].'"'.$item['ahtml'].'>'.$item['title'].'</a></li>'."\n";
+		'<a href="'.$link.'"'.$ahtml.'>'.$title.'</a></li>'."\n";
 	}
 }
Index: nc/admin/class.dc.tab.php
===================================================================
--- inc/admin/class.dc.tab.php	(revision 1092)
+++ 	(revision )
@@ -1,397 +1,0 @@
-<?php
-# -- BEGIN LICENSE BLOCK ---------------------------------------
-#
-# This file is part of Dotclear 2.
-#
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
-# Licensed under the GPL version 2.0 license.
-# See LICENSE file or
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-#
-# -- END LICENSE BLOCK -----------------------------------------
-if (!defined('DC_RC_PATH')) { return; }
-
-/**
-Template tab node
-*/
-class dcTabNode extends Twig_Node
-{
-	public function __construct($name,Twig_NodeInterface $params=null,Twig_NodeInterface $body,$lineno,$tag=null)
-	{
-		parent::__construct(array('body' => $body),array('name' => $name,'params' => $params),$lineno,$tag);
-	}
-	
-	public function compile(Twig_Compiler $compiler)
-	{
-		$n = $this->getAttribute('name');
-		
-		$compiler
-			->addDebugInfo($this)
-			->write("\$context['dc_tabs']->beginTab('".$n."'");
-		
-		/* if tab is created from template, compile args */
-		if ($this->getAttribute('params')) {
-                foreach ($this->getAttribute('params') as $value) {
- 				$compiler
-					->raw(", ")
-					->subcompile($value);
-                }
-		}
-		
-		$compiler
-			->write(");\n")
-			
-			/* if tab is not defined, body is compiled but not display */
-			->write("if (\$context['dc_tabs']->isTab('".$n."')) {\n")
-			->subcompile($this->getNode('body'))
-			->write("}\n")
-			
-			->write("\$context['dc_tabs']->endTab('".$n."');\n")
-			;
-	}
-}
-
-/**
-Template tab token parser
-*/
-class dcTabTokenParser extends Twig_TokenParser
-{
-	public function parse(Twig_Token $token)
-	{
-		$lineno = $token->getLine();
-		$stream = $this->parser->getStream();
-		
-		$values = null;
-		$name = $stream->expect(Twig_Token::NAME_TYPE)->getValue();
-		
-		/* create tab from template */
-		if ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) {
-            $stream->next();
-            $values = $this->parser->getExpressionParser()->parseMultitargetExpression();
-            $stream->next();
-		}
-		
-		$stream->expect(Twig_Token::BLOCK_END_TYPE);
-		$body = $this->parser->subparse(array($this,'decideBlockEnd'),true);
-		$stream->expect(Twig_Token::BLOCK_END_TYPE);
-
-		return new dcTabNode($name, $values, $body, $lineno, $this->getTag());
-	}
-	
-	public function decideBlockEnd(Twig_Token $token)
-	{
-		return $token->test('endtab');
-	}
-	
-	public function getTag()
-	{
-		return 'tab';
-	}
-}
-
-/**
-Template tab extension
-*/
-class dcTabExtension extends Twig_Extension
-{
-	public static $uri = 'tab';
-	
-	protected $tpl;
-	protected $core;
-	
-	protected $tabs = array();
-	protected $selected_tab = ''; // This is tab id, not tab name !
-	
-	public function __construct($core)
-	{
-		$this->core = $core;
-		$this->tpl = 'tab_layout.html.twig';
-		$this->selected_tab = empty($_REQUEST[self::$uri]) ? '' : $_REQUEST[self::$uri];
-	}
-	
-	public function initRuntime(Twig_Environment $environment)
-	{
-		$this->twig = $environment;
-		$this->template = $this->twig->loadTemplate($this->tpl);
-		$this->blocks = $this->template->getBlocks();
-	}
-	
-	public function getName()
-	{
-		return 'dc_tabs';
-	}
-	
-	public function getTokenParsers()
-	{
-		return array(new dcTabTokenParser());
-	}
-	
-	public function getGlobals()
-	{
-		return array('dc_tabs' => $this);
-	}
-	
-	public function getFunctions()
-	{
-		return array(
-			'init_tabs' => new Twig_Function_Method(
-				$this,
-				'initTabs',
-				array('is_safe' => array('html'))
-			),
-			'faketab' => new Twig_Function_Method(
-				$this,
-				'fakeTab',
-				array('is_safe' => array('html'))
-			)
-		);
-	}
-	
-	/**
-	Display page head required by tabs
-	*/
-	public function initTabs($default_tab=null)
-	{
-		if (null === $default_tab) {
-			$default_tab =  $this->selected_tab;
-		}
-		
-		echo $this->template->renderBlock(
-			'page_tab_head',
-			array(
-				'default_tab' => $default_tab,
-				'theme_url' => DC_ADMIN_URL.'index.php?tf='
-			),
-			$this->blocks
-		);
-	}
-	
-	/**
-	Display begin of a tab block
-	
-	This can also create a new tab from template
-	*/
-	public function beginTab()
-	{
-		$case = func_num_args();
-		$args = func_get_args();
-		
-		switch($case) {
-		
-		# No tab name ?!
-		case 0:
-			throw new Exception('Something went wrong while compile tab.');
-			break;
-		# Normal usage
-		case 1:
-			break;
-		# Create a new tab from template
-		case 3:
-			$this->setTab(new dcTab($args[0],$args[1],$args[2]));
-			break;
-		# Wrong argument count
-		default:
-			throw new Exception('Wrong parameters count for tab.');
-			break;
-		
-		};
-		
-		$tab = $this->isTab($args[0]) ? $this->tabs[$args[0]] : false;
-		$this->renderTab('page_tab_begin',$tab);
-	}
-	
-	/**
-	Display end of a tab block
-	*/
-	public function endTab($name)
-	{
-		$tab = $this->isTab($name) ? $this->tabs[$name] : false;
-		$this->renderTab('page_tab_end',$tab);
-	}
-	
-	/**
-	Display a fake tab block
-	*/
-	public function fakeTab()
-	{
-		$case = func_num_args();
-		$args = func_get_args();
-		
-		switch($case) {
-		
-		# No tab name ?!
-		case 0:
-			throw new Exception('Something went wrong while compile tab.');
-			break;
-		# Normal usage
-		case 1:
-			break;
-		# Create a new fake tab from template
-		case 4:
-			$this->setTab(new dcFakeTab($args[0],$args[1],$args[2],$args[3]));
-			break;
-		# Wrong argument count
-		default:
-			throw new Exception('Wrong parameters count for tab.');
-			break;
-		
-		};
-		
-		$tab = $this->isFake($args[0]) ? $this->tabs[$args[0]] : false;
-		$this->renderTab('page_tab_fake',$tab);
-	}
-	
-	/**
-	Display block
-	*/
-	private function renderTab($block,$tab)
-	{
-		if ($tab) {
-			echo $this->template->renderBlock(
-				$block,
-				$tab->getAttributes(),
-				$this->blocks
-			);
-		}
-	}
-	
-	/**
-	Check if a tab is previously set
-	
-	@param string $name A tab name
-	@return boolean
-	*/
-	public function isTab($name)
-	{
-		return array_key_exists($name,$this->tabs);
-	}
-	
-	
-	/**
-	Check if a tab is previously set and it is a fake tab
-	
-	@param string $name A tab name
-	@return boolean
-	*/
-	public function isFake($name)
-	{
-		return array_key_exists($name,$this->tabs) 
-			&& $this->tabs[$name] instanceOf dcFakeTab;
-	}
-	
-	
-	/**
-	Mark a tab as selected
-	
-	@param string $name A tab name
-	*/
-	public function selectTab($name)
-	{
-		if (!$name) {
-			$this->selected_tab = '';
-		}
-		elseif ($this->isTab($name) && !$this->isFake($name)) {
-			$this->selected_tab =  $this->getTab($name)->getId();
-		}
-	}
-	
-	/**
-	Get a page tab
-	
-	@param string $name A tab name
-	@return object dcTab instance
-	*/
-	public function getTab($name)
-	{
-		return $this->isTab($name) ? $this->tabs[$name] : null;
-	}
-	
-	/**
-	Set (prepapre) a page tab
-	
-	@param object $tab dcTab instance
-	@return object self
-	*/
-	public function setTab($tab)
-	{
-		if ($tab instanceOf dcTab || $tab instanceOf dcFakeTab) {
-			$this->tabs[$tab->getName()] = $tab;
-		}
-		return $this;
-	}
-	
-	/**
-	Check if a tab name is well formed
-	
-	Tab name must look like Twig_Token::NAME_TYPE
-	
-	@param string $name A string to check
-	@param boolean $verbose Throw exception or not
-	@return string The string or false
-	*/
-	public static function checkTabName($name,$verbose=true)
-	{
-		if (!preg_match('/[a-zA-Z0-9_]{2,}/',$name)) {
-			if ($verbose) {
-				throw new Exception(__('Wrong tab name'));
-			}
-			return false;
-		}
-		return $name;
-	}
-}
-
-/**
-Tab
-*/
-class dcTab
-{
-	protected $attributes = array();
-	
-	public function __construct($name,$id,$title)
-	{
-		$this->attributes = array(
-			'name' => dcTabExtension::checkTabName($name),
-			'id' => $id,
-			'title' => $title
-		);
-	}
-	
-	public function getAttributes()
-	{
-		return $this->attributes;
-	}
-	
-	public function getName()
-	{
-		return $this->attributes['name'];
-	}
-	
-	public function getId()
-	{
-		return $this->attributes['id'];
-	}
-	
-	public function getTitle()
-	{
-		return $this->attributes['title'];
-	}
-}
-
-/**
-Fake tab
-*/
-class dcFakeTab extends dcTab
-{
-	public function __construct($name,$id,$title,$url)
-	{
-		parent::__construct($name,$id,$title);
-		$this->attributes['url'] = $url;
-	}
-	
-	public function getURL()
-	{
-		return $this->attributes['url'];
-	}
-}
-?>
Index: nc/admin/default-templates/auth.html.twig
===================================================================
--- inc/admin/default-templates/auth.html.twig	(revision 1089)
+++ 	(revision )
@@ -1,88 +1,0 @@
-{% import "js_helpers.html.twig" as js %}
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $dlang; ?>" lang="en">
-<head>
-  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-  <meta http-equiv="Content-Script-Type" content="text/javascript" />
-  <meta http-equiv="Content-Style-Type" content="text/css" />
-  <meta http-equiv="Content-Language" content="en" />
-  <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />
-  <meta name="GOOGLEBOT" content="NOSNIPPET" />
-  <title>{{vendor_name}}</title>
-  <link rel="stylesheet" href="{{theme_url}}style/default.css" type="text/css" media="screen" />
-  {{ js.load_IE7 }}
-  {{ js.common }}
-  <script type="text/javascript" src="{{theme_url}}js/_auth.js"></script>
-</head>
-
-<body id="dotclear-admin" class="auth">
-
-{% form auth %}
-<div id="login-screen">
-<h1>{{vendor_name}}</h1>
-{% if messages.alert is not empty %}
-	<p class="message">{{ messages.alert }}</p>
-{% endif %}
-{% if messages.errors is not empty %}
-	<div class="error">
-		<p><strong>Errors :</strong></p>
-		<ul>
-		{% for error in messages.errors %}
-			<li>{{ error }}</li>
-		{% endfor %}
-		</ul>
-	</div>
-{% endif %}
-{% if akey %}
-	<p><a href="auth.php">{{__('Back to login screen')}}</a></p>
-{% elseif recover %}
-	<fieldset><legend>{{__('Request a new password')}}</legend>
-	<p>{{ form_field('user_id') }}</p>
-	<p>{{ form_field('user_email') }}</p>
-	<p>{{ form_field('auth_recover')}}</p>
-	</fieldset>
-	<div id="issue">
-	<p><a href="auth.php">{{__('Back to login screen')}}</a></p></div>
-{% elseif change_pwd %}
-	<fieldset><legend>{{__('Change your password')}}</legend>
-	<p>{{ form_field('new_pwd') }}</p>
-	<p>{{ form_field('new_pwd_c') }}</p>
-	</fieldset>
-	<p>{{ form_field('auth_change') }}</p>
-{% else %}
-	{% if safe_mode %}
-		<fieldset>
-		<legend>{{__('Safe mode login')}}</legend>
-		<p class="form-note info">
-		{{__('This mode allows you to login without activating any of your plugins. This may be useful to solve compatibility problems')}}&nbsp;<br />
-		{{__('Disable or delete any plugin suspected to cause trouble, then log out and log back in normally.')}}
-		</p>
-	{% else %}
-		<div class="fieldset">
-	{% endif %}
-			<p>{{ form_field('user_id') }}</p>
-			<p>{{ form_field('user_pwd') }}</p>
-			<p>{{ form_field('user_remenber') }}</p>
-			<p>{{ form_field('auth_login')}}</p>
-	{% if safe_mode %}
-		</fieldset>
-	{% else %}
-		</div>
-	{% endif %}
-		<p id="cookie_help" class="error">{{__('You must accept cookies in order to use the private area.')}}</p>
-		<div id="issue">
-	{% if safe_mode %}
-		<p><a href="auth.php" id="normal_mode_link">{{__('Get back to normal authentication')}}</a></p>
-	{% else %}
-		<p id="more"><strong>{{__('Connection issue?')}}</strong></p>
-		{% if allow_pass_change %}
-			<p><a href="auth.php?recover=1">{{__('I forgot my password')}}</a></p>
-		{% endif %}
-		<p><a href="auth.php?safe_mode=1" id="safe_mode_link">{{__('I want to log in in safe mode')}}</a></p>
-	{% endif %}
-		</div>
-{% endif %}
-</div>
-{% endform %}
-</body>
-</html>
Index: nc/admin/default-templates/form_layout.html.twig
===================================================================
--- inc/admin/default-templates/form_layout.html.twig	(revision 1001)
+++ 	(revision )
@@ -1,95 +1,0 @@
-{# Form Fields #}
-{# Heavily inspired from Symfony Framework #}
-
-{% block field_text %}
-{% spaceless %}
-	{% set type = type|default('text') %}
-	{{ block('field_input') }}
-{% endspaceless %}
-{% endblock field_text %}
-
-{% block field_submit %}
-{% spaceless %}
-	{% set type = type|default('submit') %}
-	{{ block('field_input') }}
-{% endspaceless %}
-{% endblock field_submit %}
-
-{% block field_textarea %}
-{% spaceless %}
-	{{ block('label') }}
-    <textarea {{ block('field_attr') }}>{{ value }}</textarea>
-{% endspaceless %}
-{% endblock field_textarea %}
-
-{% block field_password %}
-{% spaceless %}
-	{% set type = type|default('password') %}
-	{{ block('field_input') }}
-{% endspaceless %}
-{% endblock field_password %}
-
-{% block field_hidden %}
-    {% set type = type|default('hidden') %}
-    {{ block('field_input') }}
-{% endblock field_hidden %}
-
-{% block field_input %}
-{% spaceless %}
-    {% set type = type|default('text') %}
-    {{ block('label') }}
-	<input type="{{ type }}" {{ block('field_attr') }} {% if value is not empty %}value="{{ value }}" {% endif %} />
-{% endspaceless %}
-{% endblock field_input %}
-
-{% block field_checkbox %}
-{% spaceless %}
-	{% if label is not empty %}
-		<label for="{{name}}" class="classic">
-	{% endif %}
-    <input type="checkbox" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %} />
-	{% if label is not empty %}
-		{{ label }}</label>
-	{% endif %}
-{% endspaceless %}
-{% endblock field_checkbox %}
-
-{% block field_attr %}
-{% spaceless %}
- id="{{id}}" name="{{name}}" {% if read_only %} disabled="disabled"{% endif %}{% if required %} required="required"{% endif %}{% if max_length %} maxlength="{{ max_length }}"{% endif %}{% if pattern %} pattern="{{ pattern }}"{% endif %}
-    {% for attrname,attrvalue in attr %}{{attrname}}="{{attrvalue}}" {% endfor %}
-{% endspaceless %}
-{% endblock field_attr %}
-
-{% block field_options %}
-{% spaceless %}
-    {% for choice, label in options %}
-        {% if _form_is_choice_group(label) %}
-            <optgroup label="{{ choice }}">
-                {% for nestedChoice, nestedLabel in label %}
-                    <option value="{{ nestedChoice }}"{% if nestedChoice == value %} selected="selected"{% endif %}>{{ nestedLabel }}</option>
-                {% endfor %}
-            </optgroup>
-        {% else %}
-            <option value="{{ choice }}"{% if choice == value %} selected="selected"{% endif %}>{{ label|raw }}</option>
-        {% endif %}
-    {% endfor %}
-{% endspaceless %}
-{% endblock field_options %}
-
-{% block field_combo %}
-{% spaceless %}
-    {{ block('label') }}
-    <select {{ block('field_attr') }}>
-        {{ block('field_options') }}
-    </select>
-{% endspaceless %}
-{% endblock field_combo %}
-
-{% block label %}
-{% spaceless %}
-	{% if label is not empty %}
-		<label for="{{name}}" {% if required is not empty %}class="required"> <abbr title="{{__('Required field')}}">*</abbr>{% else %}>{% endif %} {{label}}</label>
-	{% endif %}
-{% endspaceless %}
-{% endblock label %}
Index: nc/admin/default-templates/index.html.twig
===================================================================
--- inc/admin/default-templates/index.html.twig	(revision 1088)
+++ 	(revision )
@@ -1,107 +1,0 @@
-{% extends "layout.html.twig" %}
-{% import "js_helpers.html.twig" as js %}
-{% block header %}
-	{{ parent() }}
-	{{ js.tool_bar }}
-	<script type="text/javascript" src="{{theme_url}}js/_index.js"></script>
-{% endblock %}
-
-{% block content %}
-{{ parent() }}
-
-{% if current_user.default_blog != current_blog.id and blog_count > 1 %}
-	<p><a href="index.php?default_blog=1" class="button">{{__('Make this blog my default blog')}}</a></p>
-{% endif %}
-
-{# Check if we need place for dashboard items #}
-{% set has_dashboard_items = updater is not empty or modules_errors is not empty or dashboard_doclinks is not empty or dsahboard_dcnews is not empty or dashboard_items is not empty %}
-
-<div id="dashboard-main"{% if not has_dashboard_items %} class="fullwidth"{% endif %}>
-	<div id="icons">
-		{% for icon in dashboard_icons %}
-			<p><a href="{{ icon.url }}"><img src="{{ icon.img }}" alt="" />
-			<br /><span>{{ icon.title }}</span></a></p>
-		{% endfor %}
-	</div>
-	
-	{% if dashboard_quickentry %}
-		<div id="quick">
-			<h3>{{__('Quick entry')}}</h3>
-			{% form quickentry %}
-				<fieldset><legend>{{__('New entry')}}</legend>
-					<p class="col">{{ form_field('post_title',{'class':'maximal'}) }}</p>
-					<p class="area">{{ form_field('post_content',{'rows':current_user.options.edit_size,'cols':5}) }}</p>
-					<p>{{ form_field('cat_id')}}</p>
-					<p>{{ form_field('save')}}</p>
-				</fieldset>
-			{% endform %}
-		</div>
-	{% endif %}
-	
-	{% if dashboard_contents is not empty %}
-		<div id="dashboard-contents">
-			{% for content in dashboard_contents %}
-			{{ content|raw }}
-			{% endfor %}
-		</div>
-	{% endif %}
-</div>
-
-{% if has_dashboard_items %}
-	<div id="dashboard-items">
-		{% if updater is not empty %}
-			<div id="upg-notify" class="static-msg">
-				<p>{{ __('Dotclear %s is available!')|format(updater.new_version)}}</p>
-				<ul>
-					<li><strong><a href="update.php">{{__('Upgrade now')|format(updater.new_version)}}</a></strong></li>
-					<li><a href="update.php?hide_msg=1">{{__('Remind me later')}}</a></li>
-					{% if updater.version_info is not empty %}
-						<li><a href="{{ updater.version_info }}">{{__('information about this version')}}</a></li>
-					{% endif %}
-				</ul>
-			</div>
-		{% endif %}
-		{% if modules_errors is not empty %}
-			<div id="module-errors" class="error"><p>{{__('Some plugins are installed twice:')}}</p>
-				<ul>
-					{% for error in modules_errors %}
-						<li>{{ error }}</li>
-					{% endfor %}
-				</ul>
-			</div>
-		{% endif %}
-		{% if dashboard_doclinks is not empty %}
-			<div>
-				<h3>{{__('Documentation and support')}}</h3>
-				<ul>
-				{% for title,link in dashboard_doclinks %}
-					<li><a href="{{ link }}" title="{{ title }} {{__('(external link)')}}">{{ title }}</a></li>
-				{% endfor %}
-				</ul>
-			</div>
-		{% endif %}
-		{% if dashboard_dcnews is not empty %}
-			<div>
-				<h3>{{__('Latest news')}}</h3>
-				<dl id="news">
-					{% for news in dashboard_dcnews %}
-						<dt>{% if news.link is not empty %}<a href="{{ news.link }}" title="{{ news.title }} {{__('(external link)')}}">{{ news.title }}</a>{% else %}{{ news.title }}{% endif %}</dt>
-						{% if loop.index < 3 %}
-						<dd><p><strong>{{ news.date }}</strong>: <em>{{ news.content|slice(0,120) }}...</em></p></dd>
-						{% else %}
-						<dd>{{ news.date }}</dd>
-						{% endif %}
-					{% endfor %}
-				</dl>
-			</div>
-		{% endif %}
-		{% if dashboard_items is not empty %}
-			<div>
-			{% for item in dashboard_items %}
-			{{ item|raw }}
-			{% endfor %}
-			</div>
-		{% endif %}
-	</div>
-{% endif %}
-{% endblock %}
Index: nc/admin/default-templates/js/_auth.js
===================================================================
--- inc/admin/default-templates/js/_auth.js	(revision 1059)
+++ 	(revision )
@@ -1,28 +1,0 @@
-$(window).load(function() {
-	var uid = $('input[name=user_id]');
-	var upw = $('input[name=user_pwd]');
-	uid.focus();
-	
-	if (upw.length == 0) { return; }
-	
-	if ($.browser.mozilla) {
-		uid.keypress(processKey);
-	} else {
-		uid.keydown(processKey);
-	}
-	function processKey(evt) {
-		if (evt.keyCode == 13 && upw.val() == '') {
-			upw.focus();
-			return false;
-		}
-		return true;
-	};
-	$.cookie('dc_admin_test_cookie',true);
-	if ($.cookie('dc_admin_test_cookie')) {
-		$('#cookie_help').hide();
-		$.cookie('dc_admin_test_cookie', '', {'expires': -1});
-	} else {
-		$('#cookie_help').show();
-	}
-	$('#issue #more').toggleWithLegend($('#issue').children().not('#more'));
-});
Index: nc/admin/default-templates/js/_blog_pref.js
===================================================================
--- inc/admin/default-templates/js/_blog_pref.js	(revision 1056)
+++ 	(revision )
@@ -1,21 +1,0 @@
-function checkQueryString() {
-	var blogUrl = $('#blog_url')[0].value;
-	var urlScan = $('#url_scan')[0].value;
-	errorMsg = '';
-	if (/.*[^\/]$/.exec(blogUrl) && urlScan=='path_info') {
-		errorMsg = dotclear.msg.warning_path_info;
-	} else if (/.*[^\?]$/.exec(blogUrl) && urlScan=='query_string') {
-		errorMsg = dotclear.msg.warning_query_string;
-	}
-	$("p#urlwarning").remove();
-	if (errorMsg != '') {
-		$("#blog_url").parents('p').before('<p id="urlwarning" class="error">'+errorMsg+'</p>');
-	}
-}
-
-
-$(function() {
-	checkQueryString();
-	$('#blog_url').focusout(checkQueryString);
-	$('#url_scan').live("change",checkQueryString);
-});
Index: nc/admin/default-templates/js/_blog_theme.js
===================================================================
--- inc/admin/default-templates/js/_blog_theme.js	(revision 1056)
+++ 	(revision )
@@ -1,71 +1,0 @@
-$(function() {
-	$('#themes-actions').hide();
-	var submit_s = $('#themes-actions input[name=select]');
-	var submit_r = $('#themes-actions input[name=remove]');
-	
-	var details = $('#themes div.theme-details');
-	$('div.theme-actions',details).hide();
-	$('input:radio',details).hide();
-	$('div.theme-info span, div.theme-info a',details).hide();
-	details.removeClass('theme-details').addClass('theme-details-js');
-	
-	var themes_wrapper = $('<div id="themes-wrapper"></div>');
-	var theme_box = $('<div id="theme-box"><div</div>');
-	$('#themes').wrap(themes_wrapper).before(theme_box);
-	
-	details.each(function() {
-		var box = this;
-		var a = $(document.createElement('a'));
-		a.attr('href','#');
-		a.attr('title',$('>div h3>label',this).text());
-		$(box).wrap(a);
-		$(box).parent().click(function(event) {
-			update_box(box);
-			event.preventDefault();
-			return false;
-		});
-	});
-	
-	function update_box(e) {
-		theme_box.empty();
-		var img = $('div.theme-shot',e).clone();
-		var info = $('div.theme-info',e).clone();
-		
-		if ($(e).hasClass('current-theme')) {
-			var actions = $('div.theme-actions',e).clone();
-			actions.show();
-		} else {
-			var actions = $('<div class="theme-actions"></div>');
-			if (submit_s.length > 0  && !$('input:radio',info).attr('disabled')) {
-				var select = $('<a href="#" class="button">' + dotclear.msg.use_this_theme + '</a>');
-				select.css('font-weight','bold').click(function() {
-					submit_s.click();
-					return false;
-				});
-				actions.append(select).append('&nbsp;&nbsp;');
-			}
-			if (submit_r.length > 0 && $('input:radio',info).attr('id') != 'theme_default') {
-				var remove = $('<a href="#" class="button delete">' + dotclear.msg.remove_this_theme + '</a>');
-				remove.click(function() {
-					var t_name = $(this).parents('#theme-box').find('div.theme-info h3:first').text();
-					t_name = $.trim(t_name);
-					if (window.confirm(dotclear.msg.confirm_delete_theme.replace('%s',t_name))) {
-						submit_r.click();
-					}
-					return false;
-				});
-				actions.append(remove);
-			}
-		}
-		
-		$('input:radio',info).remove();
-		$('span, a',info).show();
-		
-		theme_box.append(img).append(info).append(actions);
-		details.removeClass('theme-selected');
-		$(e).addClass('theme-selected');
-		$('input:radio',e).attr('checked','checked');
-	}
-	
-	update_box(details[0]);
-});
Index: nc/admin/default-templates/js/_categories.js
===================================================================
--- inc/admin/default-templates/js/_categories.js	(revision 1056)
+++ 	(revision )
@@ -1,14 +1,0 @@
-/* TODO: Some nice drag and drop on categories */
-$(function() {
-	$('form#delete-category').submit(function() {
-		var c_id = $('#del_cat').val();
-		var c_name = $('#del_cat option[value='+c_id+']').text();
-		return window.confirm(dotclear.msg.confirm_delete_category.replace('%s',c_name));
-	});
-});
-
-$(function() {
-	$('form#reset-order').submit(function() {
-		return window.confirm(dotclear.msg.confirm_reorder_categories);
-	});
-});
Index: nc/admin/default-templates/js/_category.js
===================================================================
--- inc/admin/default-templates/js/_category.js	(revision 1056)
+++ 	(revision )
@@ -1,6 +1,0 @@
-$(function() {
-	dotclear.hideLockable();
-	
-	var tbCategory = new jsToolBar(document.getElementById('cat_desc'));
-	tbCategory.draw('xhtml');
-});
Index: nc/admin/default-templates/js/_comment.js
===================================================================
--- inc/admin/default-templates/js/_comment.js	(revision 1056)
+++ 	(revision )
@@ -1,10 +1,0 @@
-$(function() {
-	if (!document.getElementById) { return; }
-	
-	var tbComment = new jsToolBar(document.getElementById('comment_content'));
-	tbComment.draw('xhtml');
-	
-	$('#comment-form input[name="delete"]').click(function() {
-		return window.confirm(dotclear.msg.confirm_delete_comment);
-	});
-});
Index: nc/admin/default-templates/js/_comments.js
===================================================================
--- inc/admin/default-templates/js/_comments.js	(revision 1085)
+++ 	(revision )
@@ -1,120 +1,0 @@
-dotclear.commentExpander = function(line) {
-	var td = line.firstChild;
-	
-	var img = document.createElement('img');
-	img.src = dotclear.img_plus_src;
-	img.alt = dotclear.img_plus_alt;
-	img.className = 'expand';
-	$(img).css('cursor','pointer');
-	img.line = line;
-	img.onclick = function() { dotclear.viewCommentContent(this,this.line); };
-	
-	td.insertBefore(img,td.firstChild);
-};
-
-dotclear.commentsExpander = function(line,lines) {
-	var td = line.firstChild;
-	
-	var img = document.createElement('img');
-	img.src = dotclear.img_plus_src;
-	img.alt = dotclear.img_plus_alt;
-	img.className = 'expand';
-	$(img).css('cursor','pointer');
-	img.lines = lines;
-	img.onclick = function() { dotclear.viewCommentsContent(this,this.lines); };
-	
-	td.insertBefore(img,td.firstChild);
-};
-
-dotclear.viewCommentsContent = function(img,lines) {
-	lines.each(function() {
-		var td = this.firstChild;
-		td.firstChild.click();
-	});
-
-	if (img.alt == dotclear.img_plus_alt) {
-		img.src = dotclear.img_minus_src;
-		img.alt = dotclear.img_minus_alt;
-	} else {
-		img.src = dotclear.img_plus_src;
-		img.alt = dotclear.img_plus_alt;
-	}
-};
-
-dotclear.viewCommentContent = function(img,line) {
-	var commentId = line.id.substr(1);
-	
-	var tr = document.getElementById('ce'+commentId);
-	
-	if (!tr) {
-		tr = document.createElement('tr');
-		tr.id = 'ce'+commentId;
-		var td = document.createElement('td');
-		td.colSpan = 6;
-		td.className = 'expand';
-		tr.appendChild(td);
-		
-		img.src = dotclear.img_minus_src;
-		img.alt = dotclear.img_minus_alt;
-		
-		// Get comment content
-		$.get('services.php',{f:'getCommentById',id: commentId},function(data) {
-			var rsp = $(data).children('rsp')[0];
-			
-			if (rsp.attributes[0].value == 'ok') {
-				var comment = $(rsp).find('comment_display_content').text();
-				
-				if (comment) {
-					$(td).append(comment);
-					var comment_email = $(rsp).find('comment_email').text();
-					var comment_site = $(rsp).find('comment_site').text();
-					var comment_ip = $(rsp).find('comment_ip').text();
-					var comment_spam_disp = $(rsp).find('comment_spam_disp').text();
-					
-					$(td).append('<p><strong>' + dotclear.msg.website +
-					'</strong> ' + comment_site + '<br />' +
-					'<strong>' + dotclear.msg.email + '</strong> ' + comment_email + '<br />' +
-					'<strong>' + dotclear.msg.ip_address +
-					'</strong> <a href="comments.php?ip=' + comment_ip + '">' + comment_ip + '</a>' +
-					'<br />' + comment_spam_disp + '</p>');
-				}
-			} else {
-				alert($(rsp).find('message').text());
-			}
-		});
-		
-		$(line).toggleClass('expand');
-		line.parentNode.insertBefore(tr,line.nextSibling);
-	}
-	else if (tr.style.display == 'none')
-	{
-		$(tr).toggle();
-		$(line).toggleClass('expand');
-		img.src = dotclear.img_minus_src;
-		img.alt = dotclear.img_minus_alt;
-	}
-	else
-	{
-		$(tr).toggle();
-		$(line).toggleClass('expand');
-		img.src = dotclear.img_plus_src;
-		img.alt = dotclear.img_plus_alt;
-	}
-};
-
-$(function() {
-	$('#form-comments tr:not(.line)').each(function() {
-		dotclear.commentsExpander(this,$('#form-comments tr.line'));
-	});
-	$('#form-comments tr.line').each(function() {
-		dotclear.commentExpander(this);
-	});
-	$('.checkboxes-helpers').each(function() {
-		dotclear.checkboxesHelpers(this);
-	});
-	$('#form-comments td input[type=checkbox]').enableShiftClick();
-	dotclear.commentsActionsHelper();
-	$('form input[type=submit][name=delete_all_spam]').click(function(){
-		return window.confirm(dotclear.msg.confirm_spam_delete);
-	});
-});
Index: nc/admin/default-templates/js/_index.js
===================================================================
--- inc/admin/default-templates/js/_index.js	(revision 1056)
+++ 	(revision )
@@ -1,69 +1,0 @@
-$(function() {
-	var f = $('#quick-entry');
-	if (f.length > 0) {
-		var contentTb = new jsToolBar($('#post_content',f)[0]);
-		contentTb.switchMode($('#post_format',f).val());
-
-		$('input[name=save]',f).click(function() {
-			quickPost(f,-2);
-			return false;
-		});
-
-		if ($('input[name=save-publish]',f).length > 0) {
-			var btn = $('<input type="submit" value="' + $('input[name=save-publish]',f).val() + '" />');
-			$('input[name=save-publish]',f).remove();
-			$('input[name=save]',f).after(btn).after(' ');
-			btn.click(function() {
-				quickPost(f,1);
-				return false;
-			});
-		}
-
-		function quickPost(f,status) {
-			if (contentTb.getMode() == 'wysiwyg') {
-				contentTb.syncContents('iframe');
-			}
-
-			var params = {
-				f: 'quickPost',
-				xd_check: dotclear.nonce,
-				post_title: $('#post_title',f).val(),
-				post_content: $('#post_content',f).val(),
-				cat_id: $('#cat_id',f).val(),
-				post_status: status,
-				post_format: $('#post_format',f).val(),
-				post_lang: $('#post_lang',f).val()
-			}
-
-			$('p.qinfo',f).remove();
-
-			$.post('services.php',params,function(data) {
-				if ($('rsp[status=failed]',data).length > 0) {
-					var msg = '<p class="qinfo"><strong>' + dotclear.msg.error +
-					'</strong> ' + $('rsp',data).text() + '</p>';
-				} else {
-					var msg = '<p class="qinfo">' + dotclear.msg.entry_created +
-					' - <a href="post.php?id=' + $('rsp>post',data).attr('id') + '">' +
-					dotclear.msg.edit_entry + '</a>';
-					if ($('rsp>post',data).attr('post_status') == 1) {
-						msg += ' - <a href="' + $('rsp>post',data).attr('post_url') + '">' +
-						dotclear.msg.view_entry + '</a>';
-					}
-					msg += '</p>';
-					$('#post_title',f).val('');
-					$('#post_content',f).val('');
-					if (contentTb.getMode() == 'wysiwyg') {
-						contentTb.syncContents('textarea');
-					}
-				}
-
-				$('fieldset',f).prepend(msg);
-			});
-		}
-	}
-
-	// allow to hide quick entry div, and remember choice
-	$('#quick h3').toggleWithLegend($('#quick').children().not('h3'),{
-		cookie: 'dcx_quick_entry'
-	}, positionFooter);
-});
Index: nc/admin/default-templates/js/_langs.js
===================================================================
--- inc/admin/default-templates/js/_langs.js	(revision 1056)
+++ 	(revision )
@@ -1,6 +1,0 @@
-$(function() {
-	$('table.plugins form input[type=submit][name=delete]').click(function() {
-		var l_name = $(this).parents('tr.line').find('td:first').text();
-		return window.confirm(dotclear.msg.confirm_delete_lang.replace('%s',l_name));
-	});
-});
Index: nc/admin/default-templates/js/_media.js
===================================================================
--- inc/admin/default-templates/js/_media.js	(revision 1085)
+++ 	(revision )
@@ -1,91 +1,0 @@
-$(function() {
-	// Replace remove links by a POST on hidden form
-	fileRemoveAct();
-	
-	function fileRemoveAct() {
-		$('a.media-remove').click(function() {
-			var m_name = $(this).parents('ul').find('li:first>a').text();
-			if (window.confirm(dotclear.msg.confirm_delete_media.replace('%s',m_name))) {
-				var f = $('#media-remove-hide').get(0);
-				f.elements['remove'].value = this.href.replace(/^(.*)&remove=(.*?)(&|$)/,'$2');
-				this.href = '';
-				f.submit();
-			}
-			return false;
-		});
-	}
-	
-	if (!$.browser.opera) {
-		var upldr = $('<a href="#" id="cu-enable">' + dotclear.msg.activate_enhanced_uploader + '</a>').click( function() {
-			candyUploadInit();
-			return false;
-		});
-		$('#media-upload').append($('<div></div>').append(upldr));
-		if ((dotclear.candyUpload_force_init == '1') || (($.cookie('dc_candy_upl') == 1))) {
-			candyUploadInit();
-		}
-	}
-	
-	function candyUploadInit()
-	{
-		var candy_upload_success = false;
-		var candy_upload_form_url = $('#media-upload').attr('action') + '&file_sort=date-desc&d=' + $('#media-upload input[name=d]').val();
-		var candy_upload_limit = $('#media-upload input[name=MAX_FILE_SIZE]').val();
-		$('#media-upload').candyUpload({
-			upload_url: dotclear.candyUpload.base_url + '/media.php',
-			flash_movie: dotclear.candyUpload.movie_url,
-			file_size_limit: candy_upload_limit + 'b',
-			params: 'swfupload=1&amp;' + dotclear.candyUpload.params,
-			
-			callbacks: {
-				createControls: function() {
-					var _this = this;
-					this.ctrl.btn_browse.hide();
-					this.ctrl.msg.html(dotclear.msg.load_enhanced_uploader);
-					var l = $('<a href="#">' + dotclear.msg.disable_enhanced_uploader + '</a>').click(function() {
-						_this.upldr.destroy();
-						_this.ctrl.block.empty().remove();
-						$('#media-upload').show();
-						delete _this;
-						$.cookie('dc_candy_upl','',{expires:-1});
-						return false;
-					});
-					this.ctrl.disable = $('<div class="cu-disable"></div>').append(l).appendTo(this.ctrl.block);
-				},
-				flashReady: function() {
-					var _this = this;
-					this.ctrl.msg.fadeOut('fast',function() {
-						$(this).text(_this.locales.no_file_in_queue).fadeIn('fast');
-						_this.ctrl.btn_browse.fadeIn('fast',function() {
-							_this.upldr.container.children().css({
-								width: $('.cu-btn-browse').width(),
-								height: $('.cu-btn-browse').height()
-							});
-						});
-					});
-				},
-				uploadSuccess: function(o,data) {
-					if (data == 'ok') {
-						candy_upload_success = true;
-						this.fileMsg(o.id,this.locales.file_uploaded);
-					} else {
-						this.fileErrorMsg(o.id,data);
-					}
-					
-					// uploads finished and at least one success
-					if (candy_upload_success && $('div.cu-file:has(span.cu-filecancel a)',this.ctrl.files).length == 0) {
-						$.cookie('dc_candy_upl','1',{expires: 30});
-						$.get(candy_upload_form_url,function(data) {
-							var media = $('div.media-list');
-							media.after($('div.media-list',data)).remove();
-							fileRemoveAct();
-						});
-					}
-				},
-				fileQueued: function() {
-					positionFooter();
-				}
-			}
-		});
-	}
-});
Index: nc/admin/default-templates/js/_media_item.js
===================================================================
--- inc/admin/default-templates/js/_media_item.js	(revision 1056)
+++ 	(revision )
@@ -1,71 +1,0 @@
-$(function() {
-	$('#media-details-tab').onetabload(function() {
-		// Add date picker
-		var media_dt = document.getElementById('media_dt');
-		if (media_dt == undefined) { return; }
-		var post_dtPick = new datePicker(media_dt);
-		post_dtPick.img_top = '1.5em';
-		post_dtPick.draw();
-	});
-	
-	// Display zip file content
-	$('#file-unzip').each(function() {
-		var a = document.createElement('a');
-		var mediaId = $(this).find('input[name=id]').val();
-		var self = $(this);
-		
-		a.href = '#';
-		$(a).text(dotclear.msg.zip_file_content);
-		self.before(a);
-		$(a).wrap('<p></p>');
-		
-		$(a).click(function() {
-			$.get('services.php',{f:'getZipMediaContent',id: mediaId},function(data) {
-				var rsp = $(data).children('rsp')[0];
-				
-				if (rsp.attributes[0].value == 'ok') {
-					var div = document.createElement('div');
-					var list = document.createElement('ul');
-					var expanded = false;
-					
-					$(div).css({
-						overflow: 'auto',
-						border: '1px solid #ccc',
-						margin: '1em 0',
-						padding: '1px 0.5em'
-					});
-					
-					$(div).append(list);
-					self.before(div);
-					$(a).hide();
-					$(div).before('<h3>' + dotclear.msg.zip_file_content + '</h3>');
-					
-					$(rsp).find('file').each(function() {
-						$(list).append('<li>' + $(this).text() + '</li>');
-						if ($(div).height() > 200 && !expanded) {
-							$(div).css({height: '200px'});
-							expanded = true;
-						}
-					});
-				} else {
-					alert($(rsp).find('message').text());
-				}
-			});
-			return false;
-		});
-	});
-	
-	// Confirm for inflating in current directory
-	$('#file-unzip').submit(function() {
-		if ($(this).find('#inflate_mode').val() == 'current') {
-			return window.confirm(dotclear.msg.confirm_extract_current);
-		}
-		return true;
-	});
-
-	// Confirm for deleting current medoa
-	$('#delete-form input[name="delete"]').click(function() {
-		return window.confirm(dotclear.msg.confirm_delete_media);
-	});
-
-});
Index: nc/admin/default-templates/js/_plugins.js
===================================================================
--- inc/admin/default-templates/js/_plugins.js	(revision 1056)
+++ 	(revision )
@@ -1,6 +1,0 @@
-$(function() {
-	$('table.plugins form input[type=submit][name=delete]').click(function() {
-		var p_name = $('input[name=plugin_id]',$(this).parent()).val();
-		return window.confirm(dotclear.msg.confirm_delete_plugin.replace('%s',p_name));
-	});
-});
Index: nc/admin/default-templates/js/_post.js
===================================================================
--- inc/admin/default-templates/js/_post.js	(revision 1056)
+++ 	(revision )
@@ -1,231 +1,0 @@
-dotclear.commentExpander = function(line) {
-	var td = line.firstChild;
-	
-	var img = document.createElement('img');
-	img.src = dotclear.img_plus_src;
-	img.alt = dotclear.img_plus_alt;
-	img.className = 'expand';
-	$(img).css('cursor','pointer');
-	img.line = line;
-	img.onclick = function() { dotclear.viewCommentContent(this,this.line); positionFooter(); };
-	
-	td.insertBefore(img,td.firstChild);
-};
-
-dotclear.viewCommentContent = function(img,line) {
-	var commentId = line.id.substr(1);
-	
-	var tr = document.getElementById('ce'+commentId);
-	
-	if (!tr) {
-		tr = document.createElement('tr');
-		tr.id = 'ce'+commentId;
-		var td = document.createElement('td');
-		td.colSpan = 6;
-		td.className = 'expand';
-		tr.appendChild(td);
-		
-		img.src = dotclear.img_minus_src;
-		img.alt = dotclear.img_minus_alt;
-		
-		// Get comment content
-		$.get('services.php',{f:'getCommentById',id: commentId},function(data) {
-			var rsp = $(data).children('rsp')[0];
-			
-			if (rsp.attributes[0].value == 'ok') {
-				var comment = $(rsp).find('comment_display_content').text();
-				
-				if (comment) {
-					$(td).append(comment);
-					var comment_email = $(rsp).find('comment_email').text();
-					var comment_site = $(rsp).find('comment_site').text();
-					var comment_ip = $(rsp).find('comment_ip').text();
-					var comment_spam_disp = $(rsp).find('comment_spam_disp').text();
-					
-					$(td).append('<p><strong>' + dotclear.msg.website +
-					'</strong> ' + comment_site + '<br />' +
-					'<strong>' + dotclear.msg.email + '</strong> ' +
-					comment_email + '<br />' + comment_spam_disp + '</p>');
-				}
-			} else {
-				alert($(rsp).find('message').text());
-			}
-		});
-		
-		$(line).toggleClass('expand');
-		line.parentNode.insertBefore(tr,line.nextSibling);
-	}
-	else if (tr.style.display == 'none')
-	{
-		$(tr).toggle();
-		$(line).toggleClass('expand');
-		img.src = dotclear.img_minus_src;
-		img.alt = dotclear.img_minus_alt;
-	}
-	else
-	{
-		$(tr).toggle();
-		$(line).toggleClass('expand');
-		img.src = dotclear.img_plus_src;
-		img.alt = dotclear.img_plus_alt;
-	}
-};
-
-$(function() {
-	if (!document.getElementById) { return; }
-	
-	if (document.getElementById('edit-entry'))
-	{
-		// Get document format and prepare toolbars
-		var formatField = $('#post_format').get(0);
-		$(formatField).change(function() {
-			excerptTb.switchMode(this.value);
-			contentTb.switchMode(this.value);
-		});
-		
-		var excerptTb = new jsToolBar(document.getElementById('post_excerpt'));
-		var contentTb = new jsToolBar(document.getElementById('post_content'));
-		excerptTb.context = contentTb.context = 'post';
-	}
-	
-	if (document.getElementById('comment_content')) {
-		var commentTb = new jsToolBar(document.getElementById('comment_content'));
-	}
-	
-	// Post preview
-	$('#post-preview').modalWeb($(window).width()-40,$(window).height()-40);
-	
-	// Tabs events
-	$('#edit-entry').onetabload(function() {
-		dotclear.hideLockable();
-		
-		// Add date picker
-		var post_dtPick = new datePicker($('#post_dt').get(0));
-		post_dtPick.img_top = '1.5em';
-		post_dtPick.draw();
-		
-		// Confirm post deletion
-		$('input[name="delete"]').click(function() {
-				return window.confirm(dotclear.msg.confirm_delete_post);
-		});
-		
-		// Hide some fields
-		$('#notes-area label').toggleWithLegend($('#notes-area').children().not('label'),{
-			cookie: 'dcx_post_notes',
-			hide: $('#post_notes').val() == ''
-		});
-		$('#post_lang').parent().toggleWithLegend($('#post_lang'),{
-			cookie: 'dcx_post_lang'
-		});
-		$('#post_password').parent().toggleWithLegend($('#post_password'),{
-			cookie: 'dcx_post_password',
-			hide: $('#post_password').val() == ''
-		});
-		
-		// We load toolbar on excerpt only when it's ready
-		$('#excerpt-area label').toggleWithLegend($('#excerpt-area').children().not('label'),{
-			fn: function() { excerptTb.switchMode(formatField.value); },
-			cookie: 'dcx_post_excerpt',
-			hide: $('#post_excerpt').val() == ''
-		});
-		
-		// Load toolbars
-		contentTb.switchMode(formatField.value);
-		
-		// Replace attachment remove links by a POST form submit
-		$('a.attachment-remove').click(function() {
-			this.href = '';
-			var m_name = $(this).parents('ul').find('li:first>a').attr('title');
-			if (window.confirm(dotclear.msg.confirm_remove_attachment.replace('%s',m_name))) {
-				var f = $('#attachment-remove-hide').get(0);
-				f.elements['media_id'].value = this.id.substring(11);
-				f.submit();
-			}
-			return false;
-		});
-		
-		// Markup validator
-		var h = document.createElement('h4');
-		var a = document.createElement('a');
-		a.href = '#';
-		$(a).click(function() {
-			var params = {
-				xd_check: dotclear.nonce,
-				f: 'validatePostMarkup',
-				excerpt: $('#post_excerpt').text(),
-				content: $('#post_content').text(),
-				format: $('#post_format').get(0).value,
-				lang: $('#post_lang').get(0).value
-			};
-			
-			$.post('services.php',params,function(data) {
-				if ($(data).find('rsp').attr('status') != 'ok') {
-					alert($(data).find('rsp message').text());
-					return false;
-				}
-				
-				if ($(data).find('valid').text() == 1) {
-					var p = document.createElement('p');
-					p.id = 'markup-validator';
-					
-					if ($('#markup-validator').length > 0) {
-						$('#markup-validator').remove();
-					}
-					
-					$(p).addClass('message');
-					$(p).text(dotclear.msg.xhtml_valid);
-					$(p).insertAfter(h);
-					$(p).backgroundFade({sColor:'#666666',eColor:'#ffcc00',steps:50},function() {
-							$(this).backgroundFade({sColor:'#ffcc00',eColor:'#666666'});
-					});
-				} else {
-					var div = document.createElement('div');
-					div.id = 'markup-validator';
-					
-					if ($('#markup-validator').length > 0) {
-						$('#markup-validator').remove();
-					}
-					
-					$(div).addClass('error');
-					$(div).html('<p><strong>' + dotclear.msg.xhtml_not_valid + '</strong></p>' + $(data).find('errors').text());
-					$(div).insertAfter(h);
-					$(div).backgroundFade({sColor:'#ffffff',eColor:'#ff9999',steps:50},function() {
-							$(this).backgroundFade({sColor:'#ff9999',eColor:'#ffffff'});
-					});
-				}
-				
-				return false;
-			});
-			
-			return false;
-		});
-		
-		a.appendChild(document.createTextNode(dotclear.msg.xhtml_validator));
-		h.appendChild(a);
-		$(h).appendTo('#entry-content');
-		
-		// Check unsaved changes before XHTML conversion
-		var excerpt = $('#post_excerpt').val();
-		var content = $('#post_content').val();
-		$('#convert-xhtml').click(function() {
-			if (excerpt != $('#post_excerpt').val() || content != $('#post_content').val()) {
-				return window.confirm(dotclear.msg.confirm_change_post_format);
-			}	
-		});
-	});
-	
-	$('#comments').onetabload(function() {
-		$('.comments-list tr.line').each(function() {
-			dotclear.commentExpander(this);
-		});
-		$('.checkboxes-helpers').each(function() {
-			dotclear.checkboxesHelpers(this);
-		});
-		
-		dotclear.commentsActionsHelper();
-	});
-	
-	$('#add-comment').onetabload(function() {
-		commentTb.draw('xhtml');
-	});
-});
Index: nc/admin/default-templates/js/_posts_actions.js
===================================================================
--- inc/admin/default-templates/js/_posts_actions.js	(revision 1085)
+++ 	(revision )
@@ -1,8 +1,0 @@
-$(function() {
-	$('#new_auth_id').autocomplete(usersList, 
-	{
-		delay: 1000,
-		matchSubset: true,
-		matchContains: true
-	});
-});
Index: nc/admin/default-templates/js/_posts_list.js
===================================================================
--- inc/admin/default-templates/js/_posts_list.js	(revision 1085)
+++ 	(revision )
@@ -1,116 +1,0 @@
-dotclear.postExpander = function(line) {
-	var td = line.firstChild;
-	
-	var img = document.createElement('img');
-	img.src = dotclear.img_plus_src;
-	img.alt = dotclear.img_plus_alt;
-	img.className = 'expand';
-	$(img).css('cursor','pointer');
-	img.line = line;
-	img.onclick = function() { dotclear.viewPostContent(this,this.line); };
-	
-	td.insertBefore(img,td.firstChild);
-};
-
-dotclear.postsExpander = function(line,lines) {
-	var td = line.firstChild;
-
-	var img = document.createElement('img');
-	img.src = dotclear.img_plus_src;
-	img.alt = dotclear.img_plus_alt;
-	img.className = 'expand';
-	$(img).css('cursor','pointer');
-	img.lines = lines;
-	img.onclick = function() { dotclear.viewPostsContent(this,this.lines); };
-
-	td.insertBefore(img,td.firstChild);
-};
-
-dotclear.viewPostsContent = function(img,lines) {
-	lines.each(function() {
-		var td = this.firstChild;
-		td.firstChild.click();
-	});
-
-	if (img.alt == dotclear.img_plus_alt) {
-		img.src = dotclear.img_minus_src;
-		img.alt = dotclear.img_minus_alt;
-	} else {
-		img.src = dotclear.img_plus_src;
-		img.alt = dotclear.img_plus_alt;
-	}
-};
-
-dotclear.viewPostContent = function(img,line) {
-	var postId = line.id.substr(1);
-	var tr = document.getElementById('pe'+postId);
-	
-	if (!tr) {
-		tr = document.createElement('tr');
-		tr.id = 'pe'+postId;
-		var td = document.createElement('td');
-		td.colSpan = 8;
-		td.className = 'expand';
-		tr.appendChild(td);
-		
-		img.src = dotclear.img_minus_src;
-		img.alt = dotclear.img_minus_alt;
-		
-		// Get post content
-		$.get('services.php',{f:'getPostById', id: postId, post_type: ''},function(data) {
-			var rsp = $(data).children('rsp')[0];
-			
-			if (rsp.attributes[0].value == 'ok') {
-				var post = $(rsp).find('post_display_content').text();
-				var post_excerpt = $(rsp).find('post_display_excerpt').text();
-				var res = '';
-				
-				if (post) {
-					if (post_excerpt) {
-						res += post_excerpt + '<hr />';
-					}
-					res += post;
-					$(td).append(res);
-				}
-			} else {
-				alert($(rsp).find('message').text());
-			}
-		});
-		
-		$(line).toggleClass('expand');
-		line.parentNode.insertBefore(tr,line.nextSibling);
-	}
-	else if (tr.style.display == 'none')
-	{
-		$(tr).toggle();
-		$(line).toggleClass('expand');
-		img.src = dotclear.img_minus_src;
-		img.alt = dotclear.img_minus_alt;
-	}
-	else
-	{
-		$(tr).toggle();
-		$(line).toggleClass('expand');
-		img.src = dotclear.img_plus_src;
-		img.alt = dotclear.img_plus_alt;
-	}
-};
-
-$(function() {
-	// Entry type switcher
-	$('#type').change(function() {
-		this.form.submit();
-	});
-
-	$('#form-entries tr:not(.line)').each(function() {
-		dotclear.postsExpander(this,$('#form-entries tr.line'));
-	});
-	$('#form-entries tr.line').each(function() {
-		dotclear.postExpander(this);
-	});
-	$('.checkboxes-helpers').each(function() {
-		dotclear.checkboxesHelpers(this);
-	});
-	$('#form-entries td input[type=checkbox]').enableShiftClick();
-	dotclear.postsActionsHelper();
-});
Index: nc/admin/default-templates/js/_preferences-dragdrop.js
===================================================================
--- inc/admin/default-templates/js/_preferences-dragdrop.js	(revision 1056)
+++ 	(revision )
@@ -1,17 +1,0 @@
-$(function() {
-	$("#my-favs ul").sortable({'cursor':'move'});
-	$("#my-favs ul").hover(function () {
-		$(this).css({'cursor':'move'});
-	}, function () {
-		$(this).css({'cursor':'auto'});
-	});
-	$('#favs-form').submit(function() {
-		var order=[];
-		$("#my-favs ul li input.position").each(function() {
-			order.push(this.name.replace(/^order\[([^\]]+)\]$/,'$1'));
-		});
-		$("input[name=favs_order]")[0].value = order.join(',');
-		return true;
-	});
-	$("#my-favs ul li input.position").hide();
-});
Index: nc/admin/default-templates/js/_preferences.js
===================================================================
--- inc/admin/default-templates/js/_preferences.js	(revision 1056)
+++ 	(revision )
@@ -1,22 +1,0 @@
-$(function() {
-	if ($('#new_pwd').length == 0) {
-		return;
-	}
-	
-	var user_email = $('#user_email').val();
-	
-	$('#user-form').submit(function() {
-		var e = this.elements['cur_pwd'];
-		if (e.value != '') {
-			return true;
-		}
-		if ($('#user_email').val() != user_email || $('#new_pwd').val() != '') {
-			e.focus();
-			$(e).backgroundFade({sColor:'#ffffff',eColor:'#ff9999',steps:50},function() {
-				$(this).backgroundFade({sColor:'#ff9999',eColor:'#ffffff'});
-			});
-			return false;
-		}
-		return true;
-	});
-});
Index: nc/admin/default-templates/js/_trackbacks.js
===================================================================
--- inc/admin/default-templates/js/_trackbacks.js	(revision 1056)
+++ 	(revision )
@@ -1,7 +1,0 @@
-$(function() {
-	$('#tb_excerpt').keypress(function() {
-		if (this.value.length > 255) {
-			this.value = this.value.substring(0,255);
-		}
-	});
-});
Index: nc/admin/default-templates/js/_users.js
===================================================================
--- inc/admin/default-templates/js/_users.js	(revision 1056)
+++ 	(revision )
@@ -1,48 +1,0 @@
-$(function() {
-	$('.checkboxes-helpers').each(function() {
-		dotclear.checkboxesHelpers(this);
-	});
-	$('#form-users').submit(function() {
-		var action = $(this).find('select[name="action"]').val();
-		var user_ids = new Array();
-		var nb_posts = new Array();
-		var i;
-		var msg_cannot_delete = false;
-		
-		$(this).find('input[name="users[]"]').each(function() {
-			user_ids.push(this);
-		});
-		$(this).find('input[name="nb_post[]"]').each(function() {
-			nb_posts.push(this.value);
-		});
-		
-		if (action == 'deleteuser') {
-			for (i=0; i<user_ids.length; i++) {
-				if (nb_posts[i] > 0) {
-					if (user_ids[i].checked == true) {
-						msg_cannot_delete = true;
-						user_ids[i].checked = false;
-					}
-				}
-			}
-			if (msg_cannot_delete == true) {
-				alert(dotclear.msg.cannot_delete_users);
-			}
-		}
-		
-		var selectfields = 0;
-		for (i=0; i<user_ids.length; i++) {
-			selectfields += user_ids[i].checked;
-		}
-		
-		if (selectfields == 0) {
-			return false;
-		}
-		
-		if (action == 'deleteuser') {
-			return window.confirm(dotclear.msg.confirm_delete_user.replace('%s',$('input[name="users[]"]:checked').size()));
-		}
-		
-		return true;
-	});
-});
Index: nc/admin/default-templates/js/_users_actions.js
===================================================================
--- inc/admin/default-templates/js/_users_actions.js	(revision 1056)
+++ 	(revision )
@@ -1,63 +1,0 @@
-jQuery.fn.updatePermissionsForm = function() {
-	return this.each(function() {
-		var perms = {};
-		var re = /^perm\[(.+?)\]\[(.+?)\]$/;
-		var e,prop;
-		
-		// Building a nice object of form elements
-		for (var i=0; i<this.elements.length; i++) {
-			e = this.elements[i];
-			
-			if (e.name == undefined) {
-				continue;
-			}
-			prop = e.name.match(re);
-			if (!prop) {
-				continue;
-			}
-			if (perms[prop[1]] == undefined) {
-				perms[prop[1]] = {};
-			}
-			perms[prop[1]][prop[2]] = e;
-		}
-		
-		// Update elements status
-		var E;
-		for (blog in perms) {
-			for (perm in perms[blog]) {
-				E = perms[blog][perm];
-				E.onclick = function() {};
-				
-				if (perm == 'admin' && !E.disabled) {
-					perms[blog]['usage'].disabled = E.checked;
-					perms[blog]['publish'].disabled = E.checked;
-					perms[blog]['delete'].disabled = E.checked;
-					perms[blog]['contentadmin'].disabled = E.checked;
-					perms[blog]['categories'].disabled = E.checked;
-					perms[blog]['media'].disabled = E.checked;
-					perms[blog]['media_admin'].disabled = E.checked;
-					E.onclick = function() { $(this.form).updatePermissionsForm(); };
-				} else if (perm == 'contentadmin' && !E.disabled) {
-					perms[blog]['usage'].checked = E.checked;
-					perms[blog]['publish'].checked = E.checked;
-					perms[blog]['delete'].checked = E.checked;
-					perms[blog]['usage'].disabled = E.checked;
-					perms[blog]['publish'].disabled = E.checked;
-					perms[blog]['delete'].disabled = E.checked;
-					E.onclick = function() { $(this.form).updatePermissionsForm(); };
-				} else if (perm == 'media_admin' && !E.disabled) {
-					perms[blog]['media'].checked = E.checked;
-					perms[blog]['media'].disabled = E.checked;
-					E.onclick = function() { $(this.form).updatePermissionsForm(); };
-				}
-			}
-		}
-	});
-};
-
-$(function() {
-	$('.checkboxes-helpers').each(function() {
-		dotclear.checkboxesHelpers(this);
-	});
-	$('#permissions-form').updatePermissionsForm();
-});
Index: nc/admin/default-templates/js/color-picker.js
===================================================================
--- inc/admin/default-templates/js/color-picker.js	(revision 1056)
+++ 	(revision )
@@ -1,83 +1,0 @@
-$(function() {
-	$('.colorpicker').colorPicker();
-});
-
-jQuery.fn.colorPicker = function() {
-	$(this).each(function() {
-		var colbox, f;
-		var colbox = $('#jquery-colorpicker')[0];
-		
-		if (colbox == undefined) {
-			colbox = document.createElement('div');
-			colbox.id = 'jquery-colorpicker';
-			colbox.linkedto = null;
-			
-			$(colbox).css({border: '1px solid #000', width: '195px', background: '#fff', position: 'absolute'});
-			$(colbox).css({display: 'none'});
-			$('body').append(colbox);
-		}
-		f = $.farbtastic(colbox);
-		f.linkTo(this);
-		
-		var handler = $(document.createElement('img'));
-		handler.attr('src','images/picker.png');
-		handler.attr('alt','');
-		
-		var span = $(document.createElement('span'));
-		
-		if ($(this).css('position') == 'absolute') {
-			span.css('position','absolute');
-			span.css('top',$(this).css('top'));
-			span.css('left',$(this).css('left'));
-			$(this).css('position','static');
-		} else {
-			span.css('position','relative');
-		}
-		span.css('display','block');
-		
-		/*ligne supprimée car elle ne fait pas le calcul
-		du width de l'input et ça fout la merde */
-		//span.css('width',($(this).width()+12)+'px');
-		span.css('padding','0 5px 0 0');
-		$(this).wrap(span);
-		$(this).after(handler);
-		
-		var offset = $(this).offset();
-		handler.css({
-			position: 'absolute',
-			top: 3,
-			/* la largeur du span n'étant pas calculée
-			right: 0 crée un affichage pourri. On vire. */
-			//right: 0
-		});
-		
-		handler.css({cursor: 'default'});
-		
-		var This = this;
-		handler.click(function() {
-			if ($(colbox).css('display') == 'none' || this != colbox.linkedto) {
-				f.linkTo(This);
-				This.focus();
-				var offset = $(This).offset();
-				$(colbox).css({
-					zIndex: 1000,
-					top: offset.top + $(this).height() + 5,
-					left: offset.left
-				});
-				if (document.all) { $('select').hide(); }
-				$(colbox).show();
-				colbox.linkedto = this;
-				
-			} else {
-				$(colbox).hide();
-				if (document.all) { $('select').show(); }
-				colbox.linkedto = null;
-			}
-		});
-		$(this).blur(function() {
-			$(colbox).hide();
-			if (document.all) { $('select').show(); }
-		});
-	});
-	return this;
-};
Index: nc/admin/default-templates/js/common.js
===================================================================
--- inc/admin/default-templates/js/common.js	(revision 1085)
+++ 	(revision )
@@ -1,372 +1,0 @@
-/* ChainHandler, py Peter van der Beken
--------------------------------------------------------- */
-function chainHandler(obj, handlerName, handler) {
-	obj[handlerName] = (function(existingFunction) {
-		return function() {
-			handler.apply(this, arguments);
-			if (existingFunction)
-				existingFunction.apply(this, arguments);
-		};
-	})(handlerName in obj ? obj[handlerName] : null);
-};
-
-/* jQuery extensions
--------------------------------------------------------- */
-jQuery.fn.check = function() {
-	return this.each(function() {
-		if (this.checked != undefined) { this.checked = true; }
-	});
-};
-jQuery.fn.unCheck = function() {
-	return this.each(function() {
-		if (this.checked != undefined) { this.checked = false; }
-	});
-};
-jQuery.fn.setChecked = function(status) {
-	return this.each(function() {
-		if (this.checked != undefined) { this.checked = status; }
-	});
-};
-jQuery.fn.toggleCheck = function() {
-	return this.each(function() {
-		if (this.checked != undefined) { this.checked = !this.checked; }
-	});
-};
-
-jQuery.fn.enableShiftClick = function() {
-	this.click(
-	function (event) {
-		if (event.shiftKey) {
-			if (dotclear.lastclicked != '') {
-				var range;
-				var trparent = $(this).parents('tr');
-				if (trparent.nextAll('#'+dotclear.lastclicked).length != 0)
-					range = trparent.nextUntil('#'+dotclear.lastclicked);
-				else
-					range = trparent.prevUntil('#'+dotclear.lastclicked);
-
-				range.find('input[type=checkbox]').setChecked(dotclear.lastclickedstatus);
-				this.checked = dotclear.lastclickedstatus;
-			}
-		} else {
-			dotclear.lastclicked = $(this).parents('tr')[0].id;
-			dotclear.lastclickedstatus = this.checked;
-		}
-		return true;
-	});
-}
-
-jQuery.fn.toggleWithLegend = function(target,s) {
-	var defaults = {
-		img_on_src: dotclear.img_plus_src,
-		img_on_alt: dotclear.img_plus_alt,
-		img_off_src: dotclear.img_minus_src,
-		img_off_alt: dotclear.img_minus_alt,
-		hide: true,
-		speed: 0,
-		legend_click: false,
-		fn: false, // A function called on first display,
-		cookie: false,
-		reverse_cookie: false // Reverse cookie behavior
-	};
-	var p = jQuery.extend(defaults,s);
-
-	if (!target) { return this; }
-
-	var set_cookie = p.hide ^ p.reverse_cookie;
-	if (p.cookie && jQuery.cookie(p.cookie)) {
-		p.hide = p.reverse_cookie;
-	}
-
-	var toggle = function(i,speed) {
-		speed = speed || 0;
-		if (p.hide) {
-			$(i).get(0).src = p.img_on_src;
-			$(i).get(0).alt = p.img_on_alt;
-			target.hide(speed, positionFooter);
-		} else {
-			$(i).get(0).src = p.img_off_src;
-			$(i).get(0).alt = p.img_off_alt;
-			target.show(speed, positionFooter);
-			if (p.fn) {
-				p.fn.apply(target);
-				p.fn = false;
-			}
-		}
-
-		if (p.cookie && set_cookie) {
-			if (p.hide ^ p.reverse_cookie) {
-				jQuery.cookie(p.cookie,'',{expires: -1});
-			} else {
-				jQuery.cookie(p.cookie,1,{expires: 30});
-			}
-		}
-
-		p.hide = !p.hide;
-	};
-
-	return this.each(function() {
-		var i = document.createElement('img');
-		i.src = p.img_off_src;
-		i.alt = p.img_off_alt;
-		var a = document.createElement('a');
-		a.href= '#';
-		$(a).append(i);
-		$(a).css({
-			border: 'none',
-			outline: 'none'
-		});
-
-		var ctarget = p.legend_click ? this : a;
-
-		$(ctarget).css('cursor','pointer');
-		$(ctarget).click(function() {
-			toggle(i,p.speed, positionFooter);
-			return false;
-		});
-
-
-		toggle($(i).get(0));
-		$(this).prepend(' ').prepend(a);
-	});
-};
-
-jQuery.fn.helpViewer = function() {
-	if (this.length < 1) {
-		return this;
-	}
-
-	var p = {
-		img_on_src: dotclear.img_plus_src,
-		img_on_alt: dotclear.img_plus_alt,
-		img_off_src: dotclear.img_minus_src,
-		img_off_alt: dotclear.img_minus_alt
-	};
-	var This = this;
-	var toggle = function() {
-		$('#content').toggleClass('with-help');
-		if (document.all) {
-			if ($('#content').hasClass('with-help')) {
-				select = $('#content select:visible').hide();
-			} else {
-				select.show();
-			}
-		}
-		sizeBox();
-		return false;
-	};
-
-	var sizeBox = function() {
-		This.css('height','auto');
-		if ($('#main').height() > This.height()) {
-			This.css('height',$('#main').height() + 'px');
-		}
-	};
-
-	var textToggler = function(o) {
-		var i = $('<img src="'+p.img_on_src+'" alt="'+p.img_on_alt+'" />');
-		o.css('cursor','pointer');
-		var hide = true;
-
-		o.prepend(' ').prepend(i);
-		o.click(function() {
-			$(this).nextAll().each(function() {
-				if ($(this).is('h3')) {
-					return false;
-				}
-				$(this).toggle();
-				sizeBox();
-				return true;
-			});
-			hide = !hide;
-			var img = $(this).find('img');
-			if (!hide) {
-				img.attr('src',p.img_off_src);
-			} else {
-				img.attr('src',p.img_on_src);
-			}
-		});
-	};
-
-	this.addClass('help-box');
-	this.find('>hr').remove();
-
-	this.find('h3').each(function() { textToggler($(this)); });
-	this.find('h3:first').nextAll('*:not(h3)').hide();
-	sizeBox();
-
-	var img = $('<span id="help-button">'+dotclear.msg.help+'</span>');
-	var select = $();
-	img.click(function() { return toggle(); });
-
-	$('#content').append(img);
-
-	return this;
-};
-
-/* Dotclear common object
--------------------------------------------------------- */
-var dotclear = {
-	msg: {},
-
-	hideLockable: function() {
-		$('div.lockable').each(function() {
-			var current_lockable_div = this;
-			$(this).find('p.form-note').hide();
-			$(this).find('input').each(function() {
-				this.disabled = true;
-				$(this).width(($(this).width()-14) + 'px');
-
-				var imgE = document.createElement('img');
-				imgE.src = 'images/locker.png';
-				imgE.style.position = 'absolute';
-				imgE.style.top = '1.7em';
-				imgE.style.left = ($(this).width()+4)+'px';
-				$(imgE).css('cursor','pointer');
-
-				$(imgE).click(function() {
-					$(this).hide();
-					$(this).prev('input').each(function() {
-						this.disabled = false;
-						$(this).width(($(this).width()+14) + 'px');
-					});
-					$(current_lockable_div).find('p.form-note').show();
-				});
-
-				$(this).parent().css('position','relative');
-				$(this).after(imgE);
-			});
-		});
-	},
-
-	checkboxesHelpers: function(e) {
-		var a = document.createElement('a');
-		a.href='#';
-		$(a).append(document.createTextNode(dotclear.msg.select_all));
-		a.onclick = function() {
-			$(this).parents('form').find('input[type="checkbox"]').check();
-			return false;
-		};
-		$(e).append(a);
-
-		$(e).append(document.createTextNode(' - '));
-
-		a = document.createElement('a');
-		a.href='#';
-		$(a).append(document.createTextNode(dotclear.msg.no_selection));
-		a.onclick = function() {
-			$(this).parents('form').find('input[type="checkbox"]').unCheck();
-			return false;
-		};
-		$(e).append(a);
-
-		$(e).append(document.createTextNode(' - '));
-
-		a = document.createElement('a');
-		a.href='#';
-		$(a).append(document.createTextNode(dotclear.msg.invert_sel));
-		a.onclick = function() {
-			$(this).parents('form').find('input[type="checkbox"]').toggleCheck();
-			return false;
-		};
-		$(e).append(a);
-	},
-
-	postsActionsHelper: function() {
-		$('#form-entries').submit(function() {
-			var action = $(this).find('select[name="action"]').val();
-			var checked = false;
-
-			$(this).find('input[name="entries[]"]').each(function() {
-				if (this.checked) {
-					checked = true;
-				}
-			});
-
-			if (!checked) { return false; }
-
-			if (action == 'delete') {
-				return window.confirm(dotclear.msg.confirm_delete_posts.replace('%s',$('input[name="entries[]"]:checked').size()));
-			}
-
-			return true;
-		});
-	},
-
-	commentsActionsHelper: function() {
-		$('#form-comments').submit(function() {
-			var action = $(this).find('select[name="action"]').val();
-			var checked = false;
-
-			$(this).find('input[name="comments[]"]').each(function() {
-				if (this.checked) {
-					checked = true;
-				}
-			});
-
-			if (!checked) { return false; }
-
-			if (action == 'delete') {
-				return window.confirm(dotclear.msg.confirm_delete_comments.replace('%s',$('input[name="comments[]"]:checked').size()));
-			}
-
-			return true;
-		});
-	}
-};
-
-/* Sticky footer
--------------------------------------------------------- */
-function positionFooter() {
-	$('#footer').constantfooter();
-}
-
-/* On document ready
--------------------------------------------------------- */
-$(function() {
-	// Blog switcher
-	$('#switchblog').change(function() {
-		this.form.submit();
-	});
-
-	var menu_settings = {
-		img_on_src: dotclear.img_menu_off,
-		img_off_src: dotclear.img_menu_on,
-		legend_click: true,
-		speed: 100
-	}
-	$('#blog-menu h3:first').toggleWithLegend($('#blog-menu ul:first'),
-		$.extend({cookie:'dc_blog_menu'},menu_settings)
-	);
-	$('#system-menu h3:first').toggleWithLegend($('#system-menu ul:first'),
-		$.extend({cookie:'dc_system_menu'},menu_settings)
-	);
-	$('#plugins-menu h3:first').toggleWithLegend($('#plugins-menu ul:first'),
-		$.extend({cookie:'dc_plugins_menu'},menu_settings)
-	);
-	$('#favorites-menu h3:first').toggleWithLegend($('#favorites-menu ul:first'),
-		$.extend({cookie:'dc_favorites_menu',hide:false,reverse_cookie:true},menu_settings)
-	);
-
-	$('#help').helpViewer();
-
-	$('.message').backgroundFade({sColor:'#cccccc',eColor:'#666666',steps:20});
-	$('.error').backgroundFade({sColor:'#ffeee3',eColor:'#ffdec8',steps:20});
-
-	$('form:has(input[type=password][name=your_pwd])').submit(function() {
-		var e = this.elements['your_pwd'];
-		if (e.value == '') {
-			e.focus();
-			$(e).backgroundFade({sColor:'#ffffff',eColor:'#ff9999',steps:50},function() {
-				$(this).backgroundFade({sColor:'#ff9999',eColor:'#ffffff'});
-			});
-			return false;
-		}
-		return true;
-	});
-
-	// Sticky footer
-	positionFooter();
-	$(window).resize(positionFooter);
-});
-
Index: nc/admin/default-templates/js/confirm-close.js
===================================================================
--- inc/admin/default-templates/js/confirm-close.js	(revision 1056)
+++ 	(revision )
@@ -1,122 +1,0 @@
-function confirmClose() {
-	
-	if (arguments.length > 0) {
-		for (var i=0; i<arguments.length; i++) {
-			this.forms_id.push(arguments[i]);
-		}
-	}
-};
-
-confirmClose.prototype = {
-	prompt: 'You have unsaved changes.',
-	forms_id: new Array(),
-	forms: new Array(),
-	formSubmit: false,
-	
-	getCurrentForms: function() {
-		var formsInPage = this.getForms();
-		var f;
-		var This = this;
-		for (var i=0; i<formsInPage.length; i++) {
-			f = formsInPage[i];
-			var tmpForm = new Array();
-			for (var j=0; j<f.elements.length; j++) {
-				tmpForm.push(this.getFormElementValue(f[j]));
-			}
-			this.forms.push(tmpForm);
-			
-			chainHandler(f,'onsubmit',function() {
-				This.formSubmit = true;
-			});
-		}
-	},
-	
-	compareForms: function() {
-		if (this.forms.length == 0) {
-			return true;
-		}
-		
-		var formsInPage = this.getForms();
-		var f;
-		for (var i=0; i<formsInPage.length; i++) {
-			f = formsInPage[i];
-			for (var j=0; j<f.elements.length; j++) {
-				if (this.forms[i][j] != this.getFormElementValue(f[j])) {
-					return false;
-				}
-			}
-		}
-		
-		return true;
-	},
-	
-	getForms: function() {
-		if (!document.getElementsByTagName || !document.getElementById) {
-			return new Array();
-		}
-		
-		if (this.forms_id.length > 0) {
-			var res = new Array();
-			var f;
-			for (var i=0; i<this.forms_id.length; i++) {
-				f = document.getElementById(this.forms_id[i]);
-				if (f != undefined) {
-					res.push(f);
-				}
-			}
-			return res;
-		} else {
-			return document.getElementsByTagName('form');
-		}
-		
-		return new Array();
-	},
-	
-	getFormElementValue: function(e) {
-		if (e.type != undefined && e.type == 'radio') {
-			return this.getFormRadioValue(e);
-		} else if (e.type != undefined && e.type == 'checkbox') {
-			return this.getFormCheckValue(e);
-		} else if (e.value != undefined) {
-			return e.value;
-		} else {
-			return null;
-		}
-	},
-	
-	getFormCheckValue: function(e) {
-		if (e.checked) {
-			return e.value;
-		}
-		return null;
-	},
-	
-	getFormRadioValue: function(e) {
-		for (var i=0; i <e.length; i++) {
-			if (e[i].checked) {
-				return e[i].value;
-			} else {
-				return null;
-			}
-		}
-		return null;
-	}
-};
-
-var confirmClosePage = new confirmClose();
-
-chainHandler(window,'onload',function() {
-	confirmClosePage.getCurrentForms();
-});
-
-chainHandler(window,'onbeforeunload',function(event_) {
-	if (event_ == undefined && window.event) {
-		event_ = window.event;
-	}
-	
-	if (!confirmClosePage.formSubmit && !confirmClosePage.compareForms()) {
-		event_.returnValue = confirmClosePage.prompt;
-		return confirmClosePage.prompt;
-	}
-	return false;
-});
Index: nc/admin/default-templates/js/date-picker.js
===================================================================
--- inc/admin/default-templates/js/date-picker.js	(revision 1056)
+++ 	(revision )
@@ -1,452 +1,0 @@
-function datePicker(target)
-{
-	if (!document.getElementById) { return; }
-	
-	if (!target || target.nodeName.toLowerCase() != 'input') {
-		return;
-	}
-	
-	this.target = target;
-	this.oTable = document.createElement('table');
-	this.oBody = document.createElement('tbody');
-	this.oDates = new Array();
-	this.oMonth = document.createElement('span');
-	this.oYear = document.createElement('span');
-	this.oHour = document.createElement('input');
-	this.oMinute = document.createElement('input');
-	this.oTable.id = 'dc_datepicker_'+target.id;
-	this.oTable.className = 'date-picker';
-	
-	var cur = 1;
-	var oRow, oHeading, oSpan;
-	
-	// Set title
-	oRow = document.createElement('tr');
-	
-	// Month block
-	oHeading = document.createElement('th');
-	oHeading.colSpan = 4;
-	oHeading.className = 'date-picker-month';
-	
-	var nav = document.createElement('span');
-	nav.appendChild(document.createTextNode(String.fromCharCode(171)));
-	nav.fn = this.changeMonth;
-	nav.obj = this;
-	nav.onclick = function() { this.fn.call(this.obj,-1); };
-	nav.className = 'date-picker-control';
-	oHeading.appendChild(nav);
-	
-	oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
-	
-	nav = document.createElement('span');
-	nav.appendChild(document.createTextNode(String.fromCharCode(187)));
-	nav.fn = this.changeMonth;
-	nav.obj = this;
-	nav.onclick = function() { this.fn.call(this.obj,+1); };
-	nav.className = 'date-picker-control';
-	oHeading.appendChild(nav);
-	
-	oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
-	
-	oHeading.appendChild(this.oMonth);
-	
-	oRow.appendChild(oHeading);
-	
-	// Year block
-	oHeading = document.createElement('th');
-	oHeading.colSpan = 3;
-	oHeading.className = 'date-picker-year';
-	
-	oHeading.appendChild(this.oYear);
-	
-	oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
-	
-	nav = document.createElement('span');
-	nav.appendChild(document.createTextNode(String.fromCharCode(171)));
-	nav.fn = this.changeYear;
-	nav.obj = this;
-	nav.onclick = function() { this.fn.call(this.obj,-1); };
-	nav.className = 'date-picker-control';
-	oHeading.appendChild(nav);
-	
-	oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
-	
-	nav = document.createElement('span');
-	nav.appendChild(document.createTextNode(String.fromCharCode(187)));
-	nav.fn = this.changeYear;
-	nav.obj = this;
-	nav.onclick = function() { this.fn.call(this.obj,+1); };
-	nav.className = 'date-picker-control';
-	oHeading.appendChild(nav);
-	
-	oRow.appendChild(oHeading);
-	
-	this.oBody.appendChild(oRow);
-	
-	// Create legend
-	oRow = document.createElement('tr');
-	var cday;
-	for (i=0; i<this.days.length; i++) {
-		cday = this.days[i].substring(0,1).toUpperCase();
-		oHeading = document.createElement('th');
-		oHeading.appendChild(document.createTextNode(cday));
-		oHeading.setAttribute('title',this.days[i]);
-		oRow.appendChild(oHeading);
-	}
-	this.oBody.appendChild(oRow);
-	
-	// Create 6 rows of 7 cols for days
-	for (var i=0; i<6; i++) {
-		oRow = document.createElement('tr');
-		
-		for (var j=0; j<7; j++) {
-			this.oDates[cur] = document.createElement('td');
-			this.oDates[cur].appendChild(document.createTextNode(
-				String.fromCharCode(160)));
-			oRow.appendChild(this.oDates[cur]);
-			cur++;
-		}
-		
-		this.oBody.appendChild(oRow);
-	}
-	
-	// Time controls
-	oRow = document.createElement('tr');
-	
-	oHeading = document.createElement('th');
-	oHeading.className = 'date-picker-control';
-	oHeading.appendChild(document.createTextNode('!'));
-	oHeading.setAttribute('title',this.now_msg);
-	oHeading.fn = this.sendNow;
-	oHeading.obj = this;
-	oHeading.onclick = function() { this.fn.call(this.obj); };
-	
-	oRow.appendChild(oHeading);
-	
-	oHeading = document.createElement('th');
-	oHeading.colSpan = 5;
-	
-	oSpan = document.createElement('span');
-	oSpan.className = 'date-picker-control';
-	oSpan.appendChild(document.createTextNode('-'));
-	oSpan.fn = this.changeHour;
-	oSpan.obj = this;
-	oSpan.onclick = function() { this.fn.call(this.obj,-1); };
-	oHeading.appendChild(oSpan);
-	oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
-	oSpan = document.createElement('span');
-	oSpan.className = 'date-picker-control';
-	oSpan.appendChild(document.createTextNode('+'));
-	oSpan.fn = this.changeHour;
-	oSpan.obj = this;
-	oSpan.onclick = function() { this.fn.call(this.obj,+1); };
-	oHeading.appendChild(oSpan);
-	oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
-	
-	this.oHour.size = 3;
-	oHeading.appendChild(this.oHour);
-	
-	oHeading.appendChild(document.createTextNode(' : '));
-	
-	this.oMinute.size = 3;
-	oHeading.appendChild(this.oMinute);
-	
-	oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
-	oSpan = document.createElement('span');
-	oSpan.className = 'date-picker-control';
-	oSpan.appendChild(document.createTextNode('-'));
-	oSpan.fn = this.changeMinute;
-	oSpan.obj = this;
-	oSpan.onclick = function() { this.fn.call(this.obj,-1); };
-	oHeading.appendChild(oSpan);
-	oHeading.appendChild(document.createTextNode(String.fromCharCode(160)));
-	oSpan = document.createElement('span');
-	oSpan.className = 'date-picker-control';
-	oSpan.appendChild(document.createTextNode('+'));
-	oSpan.fn = this.changeMinute;
-	oSpan.obj = this;
-	oSpan.onclick = function() { this.fn.call(this.obj,+1); };
-	
-	oHeading.appendChild(oSpan);
-	
-	oRow.appendChild(oHeading);
-	
-	// Close control
-	oHeading = document.createElement('th');
-	oHeading.className = 'date-picker-control';
-	oHeading.appendChild(document.createTextNode('x'));
-	oHeading.setAttribute('title',this.close_msg);
-	oHeading.fn = this.close;
-	oHeading.obj = this;
-	oHeading.onclick = function() { this.fn.call(this.obj); };
-	
-	oRow.appendChild(oHeading);
-	
-	this.oBody.appendChild(oRow);
-};
-
-datePicker.prototype = {
-	year: 0,
-	month: 0,
-	day: 0,
-	hour: 0,
-	minute: 0,
-	
-	img_src: '',
-	img_top: '0.2em',
-	now_msg: 'now',
-	close_msg: 'close',
-	
-	days: new Array('Monday','Tuesday','Wednesday','Thursday','Friday',
-	'Saturday','Sunday'),
-	
-	months: new Array('January','February','March','April','May','June',
-	'July','August','September','October','November','December'),
-	
-	
-	setDate: function() {
-		if (this.numberOfDays() < this.day) {
-			this.day = this.numberOfDays();
-		}
-		
-		while (this.oYear.hasChildNodes()) {
-			this.oYear.removeChild(this.oYear.firstChild)
-		}
-		this.oYear.appendChild(document.createTextNode(this.year));
-		
-		while (this.oMonth.hasChildNodes()) {
-			this.oMonth.removeChild(this.oMonth.firstChild)
-		}
-		this.oMonth.appendChild(document.createTextNode(
-			this.months[this.month-1]));
-		
-		var firstDay = this.firstDay();
-		var nbDays = this.numberOfDays();
-		
-		// Empty days
-		for (var i=1; i<=42; i++) {
-			while (this.oDates[i].hasChildNodes()) {
-				this.oDates[i].removeChild(this.oDates[i].firstChild)
-			}
-			this.oDates[i].appendChild(document.createTextNode('-'));
-			this.oDates[i].className = '';
-			this.oDates[i].onclick = function() { return; };
-		}
-		
-		// Insert days from the first day to the last
-		for (i=1; i<=nbDays; i++) {
-			var j=firstDay+i-1;
-			
-			while (this.oDates[j].hasChildNodes()) {
-				this.oDates[j].removeChild(this.oDates[j].firstChild)
-			}
-			
-			this.oDates[j].appendChild(document.createTextNode(i));
-			this.oDates[j].index = i;
-			this.oDates[j].fn = this.sendDate;
-			this.oDates[j].obj = this;
-			this.oDates[j].onclick = function() { this.fn.call(this.obj,this.index); };
-			if (i == this.day) {
-				this.oDates[j].className = 'date-picker-today';
-			} else {
-				this.oDates[j].className = 'date-picker-day';
-			}
-		}
-		
-		// Set time
-		this.setHour(this.hour);
-		this.setMinute(this.minute);
-	},
-	
-	setHour: function(h) {
-		if (h < 0) { h = 23; }
-		if (h > 23) { h = 0; }
-		if (h < 10) { h = '0'+h; }
-		
-		this.hour = h*1;
-		this.oHour.value = h;
-	},
-	
-	setMinute: function(m) {
-		if (m < 0) { m = 59; }
-		if (m > 59) { m = 0; }
-		if (m < 10) { m = '0'+m; }
-		
-		this.minute = m*1;
-		this.oMinute.value = m;
-	},
-	
-	changeMonth: function(dir) {
-		var y = this.year;
-		var m = this.month;
-		m = m+dir;
-		
-		if (m > 12) { this.month = 1; this.year++; }
-		else if ( m < 1) { this.month = 12; this.year--; }
-		else { this.month = m; }
-		
-		this.setDate();
-	},
-	
-	changeYear: function(dir) {
-		this.year = this.year + dir;
-		this.setDate();
-	},
-	
-	changeHour: function(dir) {
-		this.setHour(this.hour*1+dir);
-	},
-	
-	changeMinute: function(dir) {
-		this.setMinute(this.minute*1+dir);
-	},
-	
-	sendDate: function(d) {
-		var m = this.month;
-		var hour = this.oHour.value*1;
-		var minute = this.oMinute.value*1;
-		
-		if (hour < 0 || hour > 23 || isNaN(hour)) { hour = 0; }
-		if (minute < 0 || minute > 59 || isNaN(minute)) { minute = 0; }
-		
-		if (m < 10) { m = '0'+m; }
-		if (d < 10) { d = '0'+d; }
-		if (hour < 10) { hour = '0'+hour; }
-		if (minute < 10) { minute = '0'+minute; }
-		
-		this.target.value = this.year+'-'+m+'-'+d+' '+hour+':'+minute;
-		this.close();
-	},
-	
-	sendNow: function() {
-		var dt = new Date();
-		var y = dt.getFullYear();
-		var m = dt.getMonth() + 1;
-		var d = dt.getDate();
-		var h = dt.getHours();
-		var i = dt.getMinutes();
-		
-		if (m < 10) { m = '0'+m; }
-		if (d < 10) { d = '0'+d; }
-		if (h < 10) { h = '0'+h; }
-		if (i < 10) { i = '0'+i; }
-		
-		this.target.value = y+'-'+m+'-'+d+' '+h+':'+i;
-		this.close();
-	},
-	
-	close: function() {
-		document.body.removeChild(this.oTable);
-	},
-	
-	numberOfDays: function() {
-		var res = 31;
-		if (this.month == 4 || this.month == 6 || this.month == 9 ||
-		this.month == 11) {
-			res = 30;
-		} else if (this.month == 2) {
-			res = 28;
-			if (this.year%4 == 0 && (this.year%100 != 0 ||
-			this.year%400 == 0)) {
-				res = 29;
-			}
-		}
-		
-		return res;
-	},
-	
-	firstDay: function() {
-		var dt = new Date(this.year,this.month-1,1);
-		var res = dt.getDay();
-		
-		if (res == 0) {
-			res = 7;
-		}
-		
-		return res;
-	},
-	
-	show: function() {
-		// Parsing target value
-		var re = /(\d{4})-(\d{2})-(\d{2}) (\d{2}):(\d{2})/;
-		var match = re.exec(this.target.value);
-		if (match) {
-			this.year = match[1]*1;
-			this.month = match[2]*1;
-			this.day = match[3]*1;
-			this.hour = match[4]*1;
-			this.minute = match[5]*1;
-		} else {
-			var dt = new Date();
-			this.year = dt.getFullYear();
-			this.month = dt.getMonth() + 1;
-			this.day = dt.getDate();
-			this.hour = dt.getHours();
-			this.minute = dt.getMinutes();
-		}
-		
-		this.oTable.appendChild(this.oBody);
-		this.setDate();
-		this.setPosition();
-		document.body.appendChild(this.oTable);
-		this.oHour.focus();
-	},
-	
-	setPosition: function() {
-		var t_x = this.findPosX(this.target);
-		var t_y = this.findPosY(this.target);
-		var o_h = this.oTable.offsetHeight;
-		var o_w = this.oTable.offsetWidth;
-		
-		this.oTable.style.position = 'absolute';
-		this.oTable.style.zIndex = '100';
-		this.oTable.style.top = t_y+'px';
-		this.oTable.style.left = t_x+'px';
-	},
-	
-	findPosX: function(obj) {
-		var curleft = 0;
-		if(obj.offsetParent) {
-			while(1) {
-				curleft += obj.offsetLeft;
-				if(!obj.offsetParent) {
-					break;
-				}
-				obj = obj.offsetParent;
-			}
-		} else if(obj.x) {
-			curleft += obj.x;
-		}
-		return curleft;
-	},
-	
-	findPosY: function(obj) {
-		var curtop = 0;
-		if(obj.offsetParent) {
-			while(1) {
-				curtop += obj.offsetTop;
-				if(!obj.offsetParent) {
-					break;
-				}
-				obj = obj.offsetParent;
-			}
-		} else if(obj.y) {
-			curtop += obj.y;
-		}
-		return curtop;
-	},
-	
-	draw: function() {
-		var imgE = document.createElement('img');
-		imgE.src = this.img_src;
-		imgE.style.position = 'absolute';
-		imgE.style.top = this.img_top;
-		imgE.style.left = (this.target.clientWidth+4)+'px';
-		imgE.obj = this;
-		imgE.fn = this.show;
-		imgE.onclick = function() { this.fn.apply(this.obj); };
-		
-		this.target.parentNode.style.position = 'relative';
-		this.target.parentNode.insertBefore(imgE,this.target.nextSibling);
-	}
-};
Index: nc/admin/default-templates/js/dragsort-tablerows.js
===================================================================
--- inc/admin/default-templates/js/dragsort-tablerows.js	(revision 1056)
+++ 	(revision )
@@ -1,30 +1,0 @@
-ToolMan._dragsortFactory.makeTableSortable = function(table) {
-	if (table == null) return;
-	
-	var helpers = ToolMan.helpers();
-	var coordinates = ToolMan.coordinates();
-	var items = table.getElementsByTagName("tr");
-	
-	helpers.map(items, function(item) {
-		var dragGroup = dragsort.makeSortable(item);
-		dragGroup.setThreshold(4);
-		var min, max;
-		dragGroup.addTransform(function(coordinate, dragEvent) {
-			return coordinate.constrainTo(min, max);
-		});
-		dragGroup.register('dragstart', function() {
-			var items = table.getElementsByTagName("tr");
-			min = max = coordinates.topLeftOffset(items[0]);
-			for (var i = 1, n = items.length; i < n; i++) {
-				var offset = coordinates.topLeftOffset(items[i]);
-				min = min.min(offset);
-				max = max.max(offset);
-			}
-		});
-	});
-	for (var i = 1, n = arguments.length; i < n; i++) {
-		helpers.map(items, arguments[i]);
-	}
-};
-
-ToolMan._dragsortFactory.registerOrder = function(dest) { };
Index: nc/admin/default-templates/js/filter-controls.js
===================================================================
--- inc/admin/default-templates/js/filter-controls.js	(revision 1056)
+++ 	(revision )
@@ -1,10 +1,0 @@
-$(function() {
-	var c = $('#filter-control');
-	c.css('display','inline');
-	$('#filters-form').hide();
-	c.click(function() {
-		$('#filters-form').show();
-		$(this).hide();
-		return false;
-	});
-});
Index: nc/admin/default-templates/js/ie7/IE7.js
===================================================================
--- inc/admin/default-templates/js/ie7/IE7.js	(revision 1056)
+++ 	(revision )
@@ -1,2205 +1,0 @@
-// timestamp: Sun, 03 Feb 2008 19:26:22
-/*
-  IE7/IE8.js - copyright 2004-2008, Dean Edwards
-  http://dean.edwards.name/IE7/
-  http://www.opensource.org/licenses/mit-license.php
-*/
-
-/* W3C compliance for Microsoft Internet Explorer */
-
-/* credits/thanks:
-  Shaggy, Martijn Wargers, Jimmy Cerra, Mark D Anderson,
-  Lars Dieckow, Erik Arvidsson, Gellért Gyuris, James Denny,
-  Unknown W Brackets, Benjamin Westfarer, Rob Eberhardt,
-  Bill Edney, Kevin Newman, James Crompton, Matthew Mastracci,
-  Doug Wright, Richard York, Kenneth Kolano, MegaZone,
-  Thomas Verelst, Mark 'Tarquin' Wilton-Jones, Rainer Åhlfors,
-  David Zulaica, Ken Kolano, Kevin Newman
-*/
-
-// =======================================================================
-// TO DO
-// =======================================================================
-
-// PNG - unclickable content
-
-// =======================================================================
-// TEST/BUGGY
-// =======================================================================
-
-// hr{margin:1em auto} (doesn't look right in IE5)
-
-(function() {
-
-IE7 = {
-  toString: function(){return "IE7 version 2.0 (beta2)"}
-};
-var appVersion = IE7.appVersion = navigator.appVersion.match(/MSIE (\d\.\d)/)[1];
-
-if (/ie7_off/.test(top.location.search) || appVersion < 5) return;
-
-var Undefined = K();
-var quirksMode = document.compatMode != "CSS1Compat";
-var documentElement = document.documentElement, body, viewport;
-var ANON = "!";
-var HEADER = ":link{ie7-link:link}:visited{ie7-link:visited}";
-
-// -----------------------------------------------------------------------
-// external
-// -----------------------------------------------------------------------
-
-var RELATIVE = /^[\w\.]+[^:]*$/;
-function makePath(href, path) {
-  if (RELATIVE.test(href)) href = (path || "") + href;
-  return href;
-};
-
-function getPath(href, path) {
-  href = makePath(href, path);
-  return href.slice(0, href.lastIndexOf("/") + 1);
-};
-
-// get the path to this script
-var script = document.scripts[document.scripts.length - 1];
-var path = getPath(script.src);
-
-// we'll use microsoft's http request object to load external files
-try {
-  var httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
-} catch (e) {
-  // ActiveX disabled
-}
-
-var fileCache = {};
-function loadFile(href, path) {
-try {
-  href = makePath(href, path);
-  if (!fileCache[href]) {
-    // easy to load a file huh?
-    httpRequest.open("GET", href, false);
-    httpRequest.send();
-    if (httpRequest.status == 0 || httpRequest.status == 200) {
-      fileCache[href] = httpRequest.responseText;
-    }
-  }
-} catch (e) {
-  // ignore errors
-} finally {
-  return fileCache[href] || "";
-}};
-
-// -----------------------------------------------------------------------
-// IE5.0 compatibility
-// -----------------------------------------------------------------------
-
-
-if (appVersion < 5.5) {
-  undefined = Undefined();
-
-  ANON = "HTML:!"; // for anonymous content
-  
-  // Fix String.replace (Safari1.x/IE5.0).
-  var GLOBAL = /(g|gi)$/;
-  var _String_replace = String.prototype.replace; 
-  String.prototype.replace = function(expression, replacement) {
-    if (typeof replacement == "function") { // Safari doesn't like functions
-      if (expression && expression.constructor == RegExp) {
-        var regexp = expression;
-        var global = regexp.global;
-        if (global == null) global = GLOBAL.test(regexp);
-        // we have to convert global RexpExps for exec() to work consistently
-        if (global) regexp = new RegExp(regexp.source); // non-global
-      } else {
-        regexp = new RegExp(rescape(expression));
-      }
-      var match, string = this, result = "";
-      while (string && (match = regexp.exec(string))) {
-        result += string.slice(0, match.index) + replacement.apply(this, match);
-        string = string.slice(match.index + match[0].length);
-        if (!global) break;
-      }
-      return result + string;
-    }
-    return _String_replace.apply(this, arguments);
-  };
-  
-  Array.prototype.pop = function() {
-    if (this.length) {
-      var i = this[this.length - 1];
-      this.length--;
-      return i;
-    }
-    return undefined;
-  };
-  
-  Array.prototype.push = function() {
-    for (var i = 0; i < arguments.length; i++) {
-      this[this.length] = arguments[i];
-    }
-    return this.length;
-  };
-  
-  var ns = this;
-  Function.prototype.apply = function(o, a) {
-    if (o === undefined) o = ns;
-    else if (o == null) o = window;
-    else if (typeof o == "string") o = new String(o);
-    else if (typeof o == "number") o = new Number(o);
-    else if (typeof o == "boolean") o = new Boolean(o);
-    if (arguments.length == 1) a = [];
-    else if (a[0] && a[0].writeln) a[0] = a[0].documentElement.document || a[0];
-    var $ = "#ie7_apply", r;
-    o[$] = this;
-    switch (a.length) { // unroll for speed
-      case 0: r = o[$](); break;
-      case 1: r = o[$](a[0]); break;
-      case 2: r = o[$](a[0],a[1]); break;
-      case 3: r = o[$](a[0],a[1],a[2]); break;
-      case 4: r = o[$](a[0],a[1],a[2],a[3]); break;
-      case 5: r = o[$](a[0],a[1],a[2],a[3],a[4]); break;
-      default:
-        var b = [], i = a.length - 1;
-        do b[i] = "a[" + i + "]"; while (i--);
-        eval("r=o[$](" + b + ")");
-    }
-    if (typeof o.valueOf == "function") { // not a COM object
-      delete o[$];
-    } else {
-      o[$] = undefined;
-      if (r && r.writeln) r = r.documentElement.document || r;
-    }
-    return r;
-  };
-  
-  Function.prototype.call = function(o) {
-    return this.apply(o, _slice.apply(arguments, [1]));
-  };
-
-  // block elements are "inline" according to IE5.0 so we'll fix it
-  HEADER += "address,blockquote,body,dd,div,dt,fieldset,form,"+
-    "frame,frameset,h1,h2,h3,h4,h5,h6,iframe,noframes,object,p,"+
-    "hr,applet,center,dir,menu,pre,dl,li,ol,ul{display:block}";
-}
-
-// -----------------------------------------------------------------------
-// OO support
-// -----------------------------------------------------------------------
-
-
-// This is a cut-down version of base2 (http://code.google.com/p/base2/)
-
-var _slice = Array.prototype.slice;
-
-// private
-var _FORMAT = /%([1-9])/g;
-var _LTRIM = /^\s\s*/;
-var _RTRIM = /\s\s*$/;
-var _RESCAPE = /([\/()[\]{}|*+-.,^$?\\])/g;           // safe regular expressions
-var _BASE = /\bbase\b/;
-var _HIDDEN = ["constructor", "toString"];            // only override these when prototyping
-
-var prototyping;
-
-function Base(){};
-Base.extend = function(_instance, _static) {
-  // Build the prototype.
-  prototyping = true;
-  var _prototype = new this;
-  extend(_prototype, _instance);
-  prototyping = false;
-
-  // Create the wrapper for the constructor function.
-  var _constructor = _prototype.constructor;
-  function klass() {
-    // Don't call the constructor function when prototyping.
-    if (!prototyping) _constructor.apply(this, arguments);
-  };
-  _prototype.constructor = klass;
-
-  // Build the static interface.
-  klass.extend = arguments.callee;
-  extend(klass, _static);
-  klass.prototype = _prototype;
-  return klass;
-};
-Base.prototype.extend = function(source) {
-  return extend(this, source);
-};
-
-// A collection of regular expressions and their associated replacement values.
-// A Base class for creating parsers.
-
-var _HASH   = "#";
-var _KEYS   = "~";
-
-var _RG_ESCAPE_CHARS    = /\\./g;
-var _RG_ESCAPE_BRACKETS = /\(\?[:=!]|\[[^\]]+\]/g;
-var _RG_BRACKETS        = /\(/g;
-
-var RegGrp = Base.extend({
-  constructor: function(values) {
-    this[_KEYS] = [];
-    this.merge(values);
-  },
-
-  exec: function(string) {
-    var items = this, keys = this[_KEYS];    
-    return String(string).replace(new RegExp(this, this.ignoreCase ? "gi" : "g"), function() {
-      var item, offset = 1, i = 0;
-      // Loop through the RegGrp items.
-      while ((item = items[_HASH + keys[i++]])) {
-        var next = offset + item.length + 1;
-        if (arguments[offset]) { // do we have a result?
-          var replacement = item.replacement;
-          switch (typeof replacement) {
-            case "function":
-              return replacement.apply(items, _slice.call(arguments, offset, next));
-            case "number":
-              return arguments[offset + replacement];
-            default:
-              return replacement;
-          }
-        }
-        offset = next;
-      }
-    });
-  },
-
-  add: function(expression, replacement) {
-    if (expression instanceof RegExp) {
-      expression = expression.source;
-    }
-    if (!this[_HASH + expression]) this[_KEYS].push(String(expression));
-    this[_HASH + expression] = new RegGrp.Item(expression, replacement);
-  },
-
-  merge: function(values) {
-    for (var i in values) this.add(i, values[i]);
-  },
-
-  toString: function() {
-    // back references not supported in simple RegGrp
-    return "(" + this[_KEYS].join(")|(") + ")";
-  }
-}, {
-  IGNORE: "$0",
-
-  Item: Base.extend({
-    constructor: function(expression, replacement) {
-      expression = expression instanceof RegExp ? expression.source : String(expression);
-
-      if (typeof replacement == "number") replacement = String(replacement);
-      else if (replacement == null) replacement = "";
-
-      // does the pattern use sub-expressions?
-      if (typeof replacement == "string" && /\$(\d+)/.test(replacement)) {
-        // a simple lookup? (e.g. "$2")
-        if (/^\$\d+$/.test(replacement)) {
-          // store the index (used for fast retrieval of matched strings)
-          replacement = parseInt(replacement.slice(1));
-        } else { // a complicated lookup (e.g. "Hello $2 $1")
-          // build a function to do the lookup
-          var Q = /'/.test(replacement.replace(/\\./g, "")) ? '"' : "'";
-          replacement = replacement.replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\$(\d+)/g, Q +
-            "+(arguments[$1]||" + Q+Q + ")+" + Q);
-          replacement = new Function("return " + Q + replacement.replace(/(['"])\1\+(.*)\+\1\1$/, "$1") + Q);
-        }
-      }
-
-      this.length = RegGrp.count(expression);
-      this.replacement = replacement;
-      this.toString = K(expression);
-    }
-  }),
-
-  count: function(expression) {
-    // Count the number of sub-expressions in a RegExp/RegGrp.Item.
-    expression = String(expression).replace(_RG_ESCAPE_CHARS, "").replace(_RG_ESCAPE_BRACKETS, "");
-    return match(expression, _RG_BRACKETS).length;
-  }
-});
-
-// =========================================================================
-// lang/extend.js
-// =========================================================================
-
-function extend(object, source) { // or extend(object, key, value)
-  if (object && source) {
-    var proto = (typeof source == "function" ? Function : Object).prototype;
-    // Add constructor, toString etc
-    var i = _HIDDEN.length, key;
-    if (prototyping) while (key = _HIDDEN[--i]) {
-      var value = source[key];
-      if (value != proto[key]) {
-        if (_BASE.test(value)) {
-          _override(object, key, value)
-        } else {
-          object[key] = value;
-        }
-      }
-    }
-    // Copy each of the source object's properties to the target object.
-    for (key in source) if (proto[key] === undefined) {
-      var value = source[key];
-      // Check for method overriding.
-      if (object[key] && typeof value == "function" && _BASE.test(value)) {
-        _override(object, key, value);
-      } else {
-        object[key] = value;
-      }
-    }
-  }
-  return object;
-};
-
-function _override(object, name, method) {
-  // Override an existing method.
-  var ancestor = object[name];
-  object[name] = function() {
-    var previous = this.base;
-    this.base = ancestor;
-    var returnValue = method.apply(this, arguments);
-    this.base = previous;
-    return returnValue;
-  };
-};
-
-function combine(keys, values) {
-  // Combine two arrays to make a hash.
-  if (!values) values = keys;
-  var hash = {};
-  for (var i in keys) hash[i] = values[i];
-  return hash;
-};
-
-function format(string) {
-  // Replace %n with arguments[n].
-  // e.g. format("%1 %2%3 %2a %1%3", "she", "se", "lls");
-  // ==> "she sells sea shells"
-  // Only %1 - %9 supported.
-  var args = arguments;
-  var _FORMAT = new RegExp("%([1-" + arguments.length + "])", "g");
-  return String(string).replace(_FORMAT, function(match, index) {
-    return index < args.length ? args[index] : match;
-  });
-};
-
-function match(string, expression) {
-  // Same as String.match() except that this function will return an empty
-  // array if there is no match.
-  return String(string).match(expression) || [];
-};
-
-function rescape(string) {
-  // Make a string safe for creating a RegExp.
-  return String(string).replace(_RESCAPE, "\\$1");
-};
-
-// http://blog.stevenlevithan.com/archives/faster-trim-javascript
-function trim(string) {
-  return String(string).replace(_LTRIM, "").replace(_RTRIM, "");
-};
-
-function K(k) {
-  return function() {
-    return k;
-  };
-};
-
-// -----------------------------------------------------------------------
-// parsing
-// -----------------------------------------------------------------------
-
-var Parser = RegGrp.extend({ignoreCase: true});
-
-var ENCODED = /\x01(\d+)/g,
-    QUOTES  = /'/g, 
-    STRING = /^\x01/,
-    UNICODE = /\\([\da-fA-F]{1,4})/g;
-
-var _strings = [];
-
-var encoder = new Parser({
-  // comments
-  "<!\\-\\-|\\-\\->": "",
-  "\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\/": "",
-  // get rid
-  "@(namespace|import)[^;\\n]+[;\\n]": "",
-  // strings
-  "'(\\\\.|[^'\\\\])*'": encodeString,
-  '"(\\\\.|[^"\\\\])*"': encodeString,
-  // white space
-  "\\s+": " "
-});
-
-function encode(cssText) {
-  return encoder.exec(cssText);
-};
-
-function decode(cssText) {
-  return cssText.replace(ENCODED, function(match, index) {
-    return _strings[index - 1];
-  });
-};
-
-function encodeString(string) {
-  return "\x01" + _strings.push(string.replace(UNICODE, function(match, chr) {
-    return eval("'\\u" + "0000".slice(chr.length) + chr + "'");
-  }).slice(1, -1).replace(QUOTES, "\\'"));
-};
-
-function getString(value) {
-  return STRING.test(value) ? _strings[value.slice(1) - 1] : value;
-};
-
-// clone a "width" function to create a "height" function
-var rotater = new RegGrp({
-  Width: "Height",
-  width: "height",
-  Left:  "Top",
-  left:  "top",
-  Right: "Bottom",
-  right: "bottom",
-  onX:   "onY"
-});
-
-function rotate(fn) {
-  return rotater.exec(fn);
-};
-
-// -----------------------------------------------------------------------
-// event handling
-// -----------------------------------------------------------------------
-
-var eventHandlers = [];
-
-function addResize(handler) {
-  addRecalc(handler);
-  addEventHandler(window, "onresize", handler);
-};
-
-// add an event handler (function) to an element
-function addEventHandler(element, type, handler) {
-  element.attachEvent(type, handler);
-  // store the handler so it can be detached later
-  eventHandlers.push(arguments);
-};
-
-// remove an event handler assigned to an element by IE7
-function removeEventHandler(element, type, handler) {
-try {
-  element.detachEvent(type, handler);
-} catch (ignore) {
-  // write a letter of complaint to microsoft..
-}};
-
-// remove event handlers (they eat memory)
-addEventHandler(window, "onunload", function() {
-  var handler;
-  while (handler = eventHandlers.pop()) {
-    removeEventHandler(handler[0], handler[1], handler[2]);
-  }
-});
-
-function register(handler, element, condition) { // -@DRE
-  //var set = handler[element.uniqueID];
-  if (!handler.elements) handler.elements = {};
-  if (condition) handler.elements[element.uniqueID] = element;
-  else delete handler.elements[element.uniqueID];
-  //return !set && condition;
-  return condition;
-};
-
-addEventHandler(window, "onbeforeprint", function() {
-  if (!IE7.CSS.print) new StyleSheet("print");
-  IE7.CSS.print.recalc();
-});
-
-// -----------------------------------------------------------------------
-// pixel conversion
-// -----------------------------------------------------------------------
-
-// this is handy because it means that web developers can mix and match
-//  measurement units in their style sheets. it is not uncommon to
-//  express something like padding in "em" units whilst border thickness
-//  is most often expressed in pixels.
-
-var PIXEL = /^\d+(px)?$/i;
-var PERCENT = /^\d+%$/;
-var getPixelValue = function(element, value) {
-  if (PIXEL.test(value)) return parseInt(value);
-  var style = element.style.left;
-  var runtimeStyle = element.runtimeStyle.left;
-  element.runtimeStyle.left = element.currentStyle.left;
-  element.style.left = value || 0;
-  value = element.style.pixelLeft;
-  element.style.left = style;
-  element.runtimeStyle.left = runtimeStyle;
-  return value;
-};
-
-// -----------------------------------------------------------------------
-// generic
-// -----------------------------------------------------------------------
-
-var $IE7 = "ie7-";
-
-var Fix = Base.extend({
-  constructor: function() {
-    this.fixes = [];
-    this.recalcs = [];
-  },
-  init: Undefined
-});
-
-// a store for functions that will be called when refreshing IE7
-var recalcs = [];
-function addRecalc(recalc) {
-  recalcs.push(recalc);
-};
-
-IE7.recalc = function() {
-  IE7.HTML.recalc();
-  // re-apply style sheet rules (re-calculate ie7 classes)
-  IE7.CSS.recalc();
-  // apply global fixes to the document
-  for (var i = 0; i < recalcs.length; i++) recalcs[i]();
-};
-
-function isFixed(element) {
-  return element.currentStyle["ie7-position"] == "fixed";
-};
-
-// original style
-function getDefinedStyle(element, propertyName) {
-  return element.currentStyle[$IE7 + propertyName] || element.currentStyle[propertyName];
-};
-
-function setOverrideStyle(element, propertyName, value) {
-  if (element.currentStyle[$IE7 + propertyName] == null) {
-    element.runtimeStyle[$IE7 + propertyName] = element.currentStyle[propertyName];
-  }
-  element.runtimeStyle[propertyName] = value;
-};
-
-// create a temporary element which is used to inherit styles
-//  from the target element. the temporary element can be resized
-//  to determine pixel widths/heights
-function createTempElement(tagName) {
-  var element = document.createElement(tagName || "object");
-  element.style.cssText = "position:absolute;padding:0;display:block;border:none;clip:rect(0 0 0 0);left:-9999";
-  element.ie7_anon = true;
-  return element;
-};
-
-
-// =========================================================================
-// ie7-cssQuery.js
-// =========================================================================
-
-function cssQuery(selector, context, single) {
-  if (!_cache[selector]) {
-    reg = []; // store for RegExp objects
-    var fn = "";
-    var selectors = cssParser.escape(selector).split(",");
-    for (var i = 0; i < selectors.length; i++) {
-      _wild = _index = _list = 0; // reset
-      _duplicate = selectors.length > 1 ? 2 : 0; // reset
-      var block = cssParser.exec(selectors[i]) || "if(0){";
-      if (_wild) { // IE's pesky comment nodes
-        block += format("if(e%1.nodeName!='!'){", _index);
-      }
-      // check for duplicates before storing results
-      var store = _duplicate > 1 ? _TEST : "";
-      block += format(store + _STORE, _index);
-      // add closing braces
-      block += Array(match(block, /\{/g).length + 1).join("}");
-      fn += block;
-    }
-    eval(format(_FN, reg) + cssParser.unescape(fn) + "return s?null:r}");
-    _cache[selector] = _selectorFunction;
-  }
-  return _cache[selector](context || document, single);
-};
-
-var _MSIE5 = appVersion < 6;
-
-var _EVALUATED = /^(href|src)$/;
-var _ATTRIBUTES = {
-  "class": "className",
-  "for": "htmlFor"
-};
-
-IE7._indexed = 1;
-
-IE7._byId = function(document, id) {
-  var result = document.all[id] || null;
-  // returns a single element or a collection
-  if (!result || result.id == id) return result;
-  // document.all has returned a collection of elements with name/id
-  for (var i = 0; i < result.length; i++) {
-    if (result[i].id == id) return result[i];
-  }
-  return null;
-};
-
-IE7._getAttribute = function(element, name) {
-  if (name == "src" && element.pngSrc) return element.pngSrc;
-  
-  var attribute = _MSIE5 ? (element.attributes[name] || element.attributes[_ATTRIBUTES[name.toLowerCase()]]) : element.getAttributeNode(name);
-  if (attribute && (attribute.specified || name == "value")) {
-    if (_EVALUATED.test(name)) {
-      return element.getAttribute(name, 2);
-    } else if (name == "class") {
-     return element.className.replace(/\sie7_\w+/g, "");
-    } else if (name == "style") {
-     return element.style.cssText;
-    } else {
-     return attribute.nodeValue;
-    }
-  }
-  return null;
-};
-
-var names = "colSpan,rowSpan,vAlign,dateTime,accessKey,tabIndex,encType,maxLength,readOnly,longDesc";
-// Convert the list of strings to a hash, mapping the lowercase name to the camelCase name.
-extend(_ATTRIBUTES, combine(names.toLowerCase().split(","), names.split(",")));
-
-IE7._getNextElementSibling = function(node) {
-  // return the next element to the supplied element
-  //  nextSibling is not good enough as it might return a text or comment node
-  while (node && (node = node.nextSibling) && (node.nodeType != 1 || node.nodeName == "!")) continue;
-  return node;
-};
-
-IE7._getPreviousElementSibling = function(node) {
-  // return the previous element to the supplied element
-  while (node && (node = node.previousSibling) && (node.nodeType != 1 || node.nodeName == "!")) continue;
-  return node;
-};
-
-// =========================================================================
-// CSSParser
-// =========================================================================
-
-var IMPLIED_ASTERISK = /([\s>+~,]|[^(]\+|^)([#.:\[])/g,
-    IMPLIED_SPACE =    /(^|,)([^\s>+~])/g,
-    WHITESPACE =       /\s*([\s>+~(),]|^|$)\s*/g,
-    WILD_CARD =        /\s\*\s/g;;
-
-var CSSParser = RegGrp.extend({
-  constructor: function(items) {
-    this.base(items);
-    this.sorter = new RegGrp;
-    this.sorter.add(/:not\([^)]*\)/, RegGrp.IGNORE);
-    this.sorter.add(/([ >](\*|[\w-]+))([^: >+~]*)(:\w+-child(\([^)]+\))?)([^: >+~]*)/, "$1$3$6$4");
-  },
-  
-  ignoreCase: true,
-
-  escape: function(selector) {
-    return this.optimise(this.format(selector));
-  },
-
-  format: function(selector) {
-    return selector
-      .replace(WHITESPACE, "$1")
-      .replace(IMPLIED_SPACE, "$1 $2")
-      .replace(IMPLIED_ASTERISK, "$1*$2");
-  },
-
-  optimise: function(selector) {
-    // optimise wild card descendant selectors
-    return this.sorter.exec(selector.replace(WILD_CARD, ">* "));
-  },
-
-  unescape: function(selector) {
-    return decode(selector);
-  }
-});
-
-// some constants
-var _OPERATORS = {
-  "":   "%1!=null",
-  "=":  "%1=='%2'",
-  "~=": /(^| )%1( |$)/,
-  "|=": /^%1(-|$)/,
-  "^=": /^%1/,
-  "$=": /%1$/,
-  "*=": /%1/
-};
-
-var _PSEUDO_CLASSES = {
-  "first-child": "!IE7._getPreviousElementSibling(e%1)",
-  "link":        "e%1.currentStyle['ie7-link']=='link'",
-  "visited":     "e%1.currentStyle['ie7-link']=='visited'"
-};
-
-var _VAR = "var p%2=0,i%2,e%2,n%2=e%1.";
-var _ID = "e%1.sourceIndex";
-var _TEST = "var g=" + _ID + ";if(!p[g]){p[g]=1;";
-var _STORE = "r[r.length]=e%1;if(s)return e%1;";
-var _FN = "var _selectorFunction=function(e0,s){IE7._indexed++;var r=[],p={},reg=[%1],d=document;";
-var reg; // a store for RexExp objects
-var _index;
-var _wild; // need to flag certain _wild card selectors as MSIE includes comment nodes
-var _list; // are we processing a node _list?
-var _duplicate; // possible duplicates?
-var _cache = {}; // store parsed selectors
-
-// a hideous parser
-var cssParser = new CSSParser({
-  " (\\*|[\\w-]+)#([\\w-]+)": function(match, tagName, id) { // descendant selector followed by ID
-    _wild = false;
-    var replacement = "var e%2=IE7._byId(d,'%4');if(e%2&&";
-    if (tagName != "*") replacement += "e%2.nodeName=='%3'&&";
-    replacement += "(e%1==d||e%1.contains(e%2))){";
-    if (_list) replacement += format("i%1=n%1.length;", _list);
-    return format(replacement, _index++, _index, tagName.toUpperCase(), id);
-  },
-  
-  " (\\*|[\\w-]+)": function(match, tagName) { // descendant selector
-    _duplicate++; // this selector may produce duplicates
-    _wild = tagName == "*";
-    var replacement = _VAR;
-    // IE5.x does not support getElementsByTagName("*");
-    replacement += (_wild && _MSIE5) ? "all" : "getElementsByTagName('%3')";
-    replacement += ";for(i%2=0;(e%2=n%2[i%2]);i%2++){";
-    return format(replacement, _index++, _list = _index, tagName.toUpperCase());
-  },
-  
-  ">(\\*|[\\w-]+)": function(match, tagName) { // child selector
-    var children = _list;
-    _wild = tagName == "*";
-    var replacement = _VAR;
-    // use the children property for MSIE as it does not contain text nodes
-    //  (but the children collection still includes comments).
-    // the document object does not have a children collection
-    replacement += children ? "children": "childNodes";
-    if (!_wild && children) replacement += ".tags('%3')";
-    replacement += ";for(i%2=0;(e%2=n%2[i%2]);i%2++){";
-    if (_wild) {
-      replacement += "if(e%2.nodeType==1){";
-      _wild = _MSIE5;
-    } else {
-      if (!children) replacement += "if(e%2.nodeName=='%3'){";
-    }
-    return format(replacement, _index++, _list = _index, tagName.toUpperCase());
-  },
-  
-  "\\+(\\*|[\\w-]+)": function(match, tagName) { // direct adjacent selector
-    var replacement = "";
-    if (_wild) replacement += "if(e%1.nodeName!='!'){";
-    _wild = false;
-    replacement += "e%1=IE7._getNextElementSibling(e%1);if(e%1";
-    if (tagName != "*") replacement += "&&e%1.nodeName=='%2'";
-    replacement += "){";
-    return format(replacement, _index, tagName.toUpperCase());
-  },
-  
-  "~(\\*|[\\w-]+)": function(match, tagName) { // indirect adjacent selector
-    var replacement = "";
-    if (_wild) replacement += "if(e%1.nodeName!='!'){";
-    _wild = false;
-    _duplicate = 2; // this selector may produce duplicates
-    replacement += "while(e%1=e%1.nextSibling){if(e%1.ie7_adjacent==IE7._indexed)break;if(";
-    if (tagName == "*") {
-      replacement += "e%1.nodeType==1";
-      if (_MSIE5) replacement += "&&e%1.nodeName!='!'";
-    } else replacement += "e%1.nodeName=='%2'";
-    replacement += "){e%1.ie7_adjacent=IE7._indexed;";
-    return format(replacement, _index, tagName.toUpperCase());
-  },
-  
-  "#([\\w-]+)": function(match, id) { // ID selector
-    _wild = false;
-    var replacement = "if(e%1.id=='%2'){";
-    if (_list) replacement += format("i%1=n%1.length;", _list);
-    return format(replacement, _index, id);
-  },
-  
-  "\\.([\\w-]+)": function(match, className) { // class selector
-    _wild = false;
-    // store RegExp objects - slightly faster on IE
-    reg.push(new RegExp("(^|\\s)" + rescape(className) + "(\\s|$)"));
-    return format("if(e%1.className&&reg[%2].test(e%1.className)){", _index, reg.length - 1);
-  },
-  
-  "\\[([\\w-]+)\\s*([^=]?=)?\\s*([^\\]]*)\\]": function(match, attr, operator, value) { // attribute selectors
-    var alias = _ATTRIBUTES[attr] || attr;
-    if (operator) {
-      var getAttribute = "e%1.getAttribute('%2',2)";
-      if (!_EVALUATED.test(attr)) {
-        getAttribute = "e%1.%3||" + getAttribute;
-      }
-      attr = format("(" + getAttribute + ")", _index, attr, alias);
-    } else {
-      attr = format("IE7._getAttribute(e%1,'%2')", _index, attr);
-    }
-    var replacement = _OPERATORS[operator || ""] || "0";
-    if (replacement && replacement.source) {
-      reg.push(new RegExp(format(replacement.source, rescape(cssParser.unescape(value)))));
-      replacement = "reg[%2].test(%1)";
-      value = reg.length - 1;
-    }
-    return "if(" + format(replacement, attr, value) + "){";
-  },
-  
-  ":+([\\w-]+)(\\(([^)]+)\\))?": function(match, pseudoClass, $2, args) { // pseudo class selectors
-    pseudoClass = _PSEUDO_CLASSES[pseudoClass];
-    return "if(" + (pseudoClass ? format(pseudoClass, _index, args || "")  : "0") + "){";
-  }
-});
-
-// =========================================================================
-// ie7-css.js
-// =========================================================================
-
-var HYPERLINK = /a(#[\w-]+)?(\.[\w-]+)?:(hover|active)/i;
-var BRACE1 = /\s*\{\s*/, BRACE2 = /\s*\}\s*/, COMMA = /\s*\,\s*/;
-var FIRST_LINE_LETTER = /(.*)(:first-(line|letter))/;
-
-//var UNKNOWN = /UNKNOWN|([:.])\w+\1/i;
-
-var styleSheets = document.styleSheets;
-
-IE7.CSS = new (Fix.extend({ // single instance
-  parser: new Parser,
-  screen: "",
-  print: "",
-  styles: [],
-  rules: [],
-  pseudoClasses: appVersion < 7 ? "first\\-child" : "",
-  dynamicPseudoClasses: {
-    toString: function() {
-      var strings = [];
-      for (var pseudoClass in this) strings.push(pseudoClass);
-      return strings.join("|");
-    }
-  },
-  
-  init: function() {
-    var NONE = "^\x01$";
-    var CLASS = "\\[class=?[^\\]]*\\]";
-    var pseudoClasses = [];
-    if (this.pseudoClasses) pseudoClasses.push(this.pseudoClasses);
-    var dynamicPseudoClasses = this.dynamicPseudoClasses.toString(); 
-    if (dynamicPseudoClasses) pseudoClasses.push(dynamicPseudoClasses);
-    pseudoClasses = pseudoClasses.join("|");
-    var unknown = appVersion < 7 ? ["[>+~[(]|([:.])\\w+\\1"] : [CLASS];
-    if (pseudoClasses) unknown.push(":(" + pseudoClasses + ")");
-    this.UNKNOWN = new RegExp(unknown.join("|") || NONE, "i");
-    var complex = appVersion < 7 ? ["\\[[^\\]]+\\]|[^\\s(\\[]+\\s*[+~]"] : [CLASS];
-    var complexRule = complex.concat();
-    if (pseudoClasses) complexRule.push(":(" + pseudoClasses + ")");
-    Rule.COMPLEX = new RegExp(complexRule.join("|") || NONE, "ig");
-    if (this.pseudoClasses) complex.push(":(" + this.pseudoClasses + ")");
-    DynamicRule.COMPLEX = new RegExp(complex.join("|") || NONE, "i");
-    DynamicRule.MATCH = new RegExp(dynamicPseudoClasses ? "(.*):(" + dynamicPseudoClasses + ")(.*)" : NONE, "i");
-    
-    this.createStyleSheet();
-    this.refresh();
-  },
-  
-	addEventHandler: function() {
-		addEventHandler.apply(null, arguments);
-	},
-  
-  addFix: function(expression, replacement) {
-    this.parser.add(expression, replacement);
-  },
-  
-  addRecalc: function(propertyName, test, handler, replacement) {
-    // recalcs occur whenever the document is refreshed using document.recalc()
-    test = new RegExp("([{;\\s])" + propertyName + "\\s*:\\s*" + test + "[^;}]*");
-    var id = this.recalcs.length;
-    if (replacement) replacement = propertyName + ":" + replacement;
-    this.addFix(test, function(match, $1) {
-      return (replacement ? $1 + replacement : match) + ";ie7-" + match.slice(1) + ";ie7_recalc" + id + ":1";
-    });
-    this.recalcs.push(arguments);
-    return id;
-  },
-  
-  apply: function() {
-    this.getInlineStyles();
-    new StyleSheet("screen");
-    this.trash();
-  },
-  
-  createStyleSheet: function() {
-    // create the IE7 style sheet
-    this.styleSheet = document.createStyleSheet();
-    // flag it so we can ignore it during parsing
-    this.styleSheet.ie7 = true;
-    this.styleSheet.owningElement.ie7 = true;
-    this.styleSheet.cssText = HEADER;
-  },
-  
-  getInlineStyles: function() {
-    // load inline styles
-    var styleSheets = document.getElementsByTagName("style"), styleSheet;
-    for (var i = styleSheets.length - 1; (styleSheet = styleSheets[i]); i--) {
-      if (!styleSheet.disabled && !styleSheet.ie7) {
-        this.styles.push(styleSheet.innerHTML);
-      }
-    }
-  },
-  
-  getText: function(styleSheet, path) {
-    // explorer will trash unknown selectors (it converts them to "UNKNOWN").
-    // so we must reload external style sheets (internal style sheets can have their text
-    //  extracted through the innerHTML property).
-      // load the style sheet text from an external file
-    try {
-      var cssText = styleSheet.cssText;
-    } catch (e) {
-      cssText = "";
-    }
-    if (httpRequest) cssText = loadFile(styleSheet.href, path) || cssText;
-    return cssText;
-  },
-  
-  recalc: function() {
-    this.screen.recalc();
-    // we're going to read through all style rules.
-    //  certain rules have had ie7 properties added to them.
-    //   e.g. p{top:0; ie7_recalc2:1; left:0}
-    //  this flags a property in the rule as needing a fix.
-    //  the selector text is then used to query the document.
-    //  we can then loop through the results of the query
-    //  and fix the elements.
-    // we ignore the IE7 rules - so count them in the header
-    var RECALCS = /ie7_recalc\d+/g;
-    var start = HEADER.match(/[{,]/g).length;
-    // only calculate screen fixes. print fixes don't show up anyway
-    var stop = start + (this.screen.cssText.match(/\{/g)||"").length;
-    var rules = this.styleSheet.rules, rule;
-    var calcs, calc, elements, element, i, j, k, id;
-    // loop through all rules
-    for (i = start; i < stop; i++) {
-      rule = rules[i];
-      var cssText = rule.style.cssText;
-      // search for the "ie7_recalc" flag (there may be more than one)
-      if (rule && (calcs = cssText.match(RECALCS))) {
-        // use the selector text to query the document
-        elements = cssQuery(rule.selectorText);
-        // if there are matching elements then loop
-        //  through the recalc functions and apply them
-        //  to each element
-        if (elements.length) for (j = 0; j < calcs.length; j++) {
-          // get the matching flag (e.g. ie7_recalc3)
-          id = calcs[j];
-          // extract the numeric id from the end of the flag
-          //  and use it to index the collection of recalc
-          //  functions
-          calc = IE7.CSS.recalcs[id.slice(10)][2];
-          for (k = 0; (element = elements[k]); k++) {
-            // apply the fix
-            if (element.currentStyle[id]) calc(element, cssText);
-          }
-        }
-      }
-    }
-  },
-  
-  refresh: function() {
-    this.styleSheet.cssText = HEADER + this.screen + this.print;
-  },
-  
-  trash: function() {
-    // trash the old style sheets
-    for (var i = 0; i < styleSheets.length; i++) {
-      if (!styleSheets[i].ie7) {
-        try {
-          var cssText = styleSheets[i].cssText;
-        } catch (e) {
-          cssText = "";
-        }
-        if (cssText) styleSheets[i].cssText = "";
-      }
-    }
-  }
-}));
-
-// -----------------------------------------------------------------------
-//  IE7 StyleSheet class
-// -----------------------------------------------------------------------
-
-var StyleSheet = Base.extend({
-  constructor: function(media) {
-    this.media = media;
-    this.load();
-    IE7.CSS[media] = this;
-    IE7.CSS.refresh();
-  },
-  
-  createRule: function(selector, cssText) {
-    if (IE7.CSS.UNKNOWN.test(selector)) {
-      var match;
-      if (PseudoElement && (match = selector.match(PseudoElement.MATCH))) {
-        return new PseudoElement(match[1], match[2], cssText);
-      } else if (match = selector.match(DynamicRule.MATCH)) {
-        if (!HYPERLINK.test(match[0]) || DynamicRule.COMPLEX.test(match[0])) {
-          return new DynamicRule(selector, match[1], match[2], match[3], cssText);
-        }
-      } else return new Rule(selector, cssText);
-    }
-    return selector + " {" + cssText + "}";
-  },
-  
-  getText: function() {
-    // store for style sheet text
-    var _inlineStyles = [].concat(IE7.CSS.styles);
-    // parse media decalarations
-    var MEDIA = /@media\s+([^{]*)\{([^@]+\})\s*\}/gi;
-    var ALL = /\ball\b|^$/i, SCREEN = /\bscreen\b/i, PRINT = /\bprint\b/i;
-    function _parseMedia(cssText, media) {
-      _filterMedia.value = media;
-      return cssText.replace(MEDIA, _filterMedia);
-    };
-    function _filterMedia(match, media, cssText) {
-      media = _simpleMedia(media);
-      switch (media) {
-        case "screen":
-        case "print":
-          if (media != _filterMedia.value) return "";
-        case "all":
-          return cssText;
-      }
-      return "";
-    };
-    function _simpleMedia(media) {
-      if (ALL.test(media)) return "all";
-      else if (SCREEN.test(media)) return (PRINT.test(media)) ? "all" : "screen";
-      else if (PRINT.test(media)) return "print";
-    };
-    var self = this;
-    function _getCSSText(styleSheet, path, media, level) {
-      var cssText = "";
-      if (!level) {
-        media = _simpleMedia(styleSheet.media);
-        level = 0;
-      }
-      if (media == "all" || media == self.media) {
-        // IE only allows importing style sheets three levels deep.
-        // it will crash if you try to access a level below this
-        if (level < 3) {
-          // loop through imported style sheets
-          for (var i = 0; i < styleSheet.imports.length; i++) {
-            // call this function recursively to get all imported style sheets
-            cssText += _getCSSText(styleSheet.imports[i], getPath(styleSheet.href, path), media, level + 1);
-          }
-        }
-        // retrieve inline style or load an external style sheet
-        cssText += encode(styleSheet.href ? _loadStyleSheet(styleSheet, path) : _inlineStyles.pop() || "");
-        cssText = _parseMedia(cssText, self.media);
-      }
-      return cssText;
-    };
-    // store loaded cssText URLs
-    var fileCache = {};
-    // load an external style sheet
-    function _loadStyleSheet(styleSheet, path) {
-      var url = makePath(styleSheet.href, path);
-      // if the style sheet has already loaded then don't duplicate it
-      if (fileCache[url]) return "";
-      // load from source
-      fileCache[url] = (styleSheet.disabled) ? "" :
-        _fixUrls(IE7.CSS.getText(styleSheet, path), getPath(styleSheet.href, path));
-      return fileCache[url];
-    };
-    // fix css paths
-    // we're lumping all css text into one big style sheet so relative
-    //  paths have to be fixed. this is necessary anyway because of other
-    //  explorer bugs.
-    var URL = /(url\s*\(\s*['"]?)([\w\.]+[^:\)]*['"]?\))/gi;
-    function _fixUrls(cssText, pathname) {
-      // hack & slash
-      return cssText.replace(URL, "$1" + pathname.slice(0, pathname.lastIndexOf("/") + 1) + "$2");
-    };
-
-    // load all style sheets in the document
-    for (var i = 0; i < styleSheets.length; i++) {
-      if (!styleSheets[i].disabled && !styleSheets[i].ie7) {
-        this.cssText += _getCSSText(styleSheets[i]);
-      }
-    }
-  },
-  
-  load: function() {
-    this.cssText = "";
-    this.getText();
-    this.parse();
-    this.cssText = decode(this.cssText);
-    fileCache = {};
-  },
-  
-  parse: function() {
-    this.cssText = IE7.CSS.parser.exec(this.cssText);
-    
-    // parse the style sheet
-    var offset = IE7.CSS.rules.length;
-    var rules = this.cssText.split(BRACE2), rule;
-    var selectors, cssText, i, j;
-    for (i = 0; i < rules.length; i++) {
-      rule = rules[i].split(BRACE1);
-      selectors = rule[0].split(COMMA);
-      cssText = rule[1];
-      for (j = 0; j < selectors.length; j++) {
-        selectors[j] = cssText ? this.createRule(selectors[j], cssText) : "";
-      }
-      rules[i] = selectors.join("\n");
-    }
-    this.cssText = rules.join("\n");
-    this.rules = IE7.CSS.rules.slice(offset);
-  },
-  
-  recalc: function() {
-    var rule, i;
-    for (i = 0; (rule = this.rules[i]); i++) rule.recalc();
-  },
-  
-  toString: function() {
-    return "@media " + this.media + "{" + this.cssText + "}";
-  }
-});
-
-var PseudoElement;
-
-// -----------------------------------------------------------------------
-// IE7 style rules
-// -----------------------------------------------------------------------
-
-var Rule = IE7.Rule = Base.extend({
-  // properties
-  constructor: function(selector, cssText) {
-    this.id = IE7.CSS.rules.length;
-    this.className = Rule.PREFIX + this.id;
-    selector = selector.match(FIRST_LINE_LETTER) || selector || "*";
-    this.selector = selector[1] || selector;
-    this.selectorText = this.parse(this.selector) + (selector[2] || "");
-    this.cssText = cssText;
-    this.MATCH = new RegExp("\\s" + this.className + "(\\s|$)", "g");
-    IE7.CSS.rules.push(this);
-    this.init();
-  },
-  
-  init: Undefined,
-  
-  add: function(element) {
-    // allocate this class
-    element.className += " " + this.className;
-  },
-  
-  recalc: function() {
-    // execute the underlying css query for this class
-    var match = cssQuery(this.selector);
-    // add the class name for all matching elements
-    for (var i = 0; i < match.length; i++) this.add(match[i]);
-  },
-
-  parse: function(selector) {
-    // attempt to preserve specificity for "loose" parsing by
-    //  removing unknown tokens from a css selector but keep as
-    //  much as we can..
-    var simple = selector.replace(Rule.CHILD, " ").replace(Rule.COMPLEX, "");
-    if (appVersion < 7) simple = simple.replace(Rule.MULTI, "");
-    var tags = match(simple, Rule.TAGS).length - match(selector, Rule.TAGS).length;
-    var classes = match(simple, Rule.CLASSES).length - match(selector, Rule.CLASSES).length + 1;
-    while (classes > 0 && Rule.CLASS.test(simple)) {
-      simple = simple.replace(Rule.CLASS, "");
-      classes--;
-    }
-    while (tags > 0 && Rule.TAG.test(simple)) {
-      simple = simple.replace(Rule.TAG, "$1*");
-      tags--;
-    }
-    simple += "." + this.className;
-    classes = Math.min(classes, 2);
-    tags = Math.min(tags, 2);
-    var score = -10 * classes - tags;
-    if (score > 0) {
-      simple = simple + "," + Rule.MAP[score] + " " + simple;
-    }
-    return simple;
-  },
-  
-  remove: function(element) {
-    // deallocate this class
-    element.className = element.className.replace(this.MATCH, "$1");
-  },
-  
-  toString: function() {
-    return format("%1 {%2}", this.selectorText, this.cssText);
-  }
-}, {
-  CHILD: />/g,
-  CLASS: /\.[\w-]+/,
-  CLASSES: /[.:\[]/g,
-  MULTI: /(\.[\w-]+)+/g,
-  PREFIX: "ie7_class",
-  TAG: /^\w+|([\s>+~])\w+/,
-  TAGS: /^\w|[\s>+~]\w/g,
-  MAP: {
-    1:  "html",
-    2:  "html body",
-    10: ".ie7_html",
-    11: "html.ie7_html",
-    12: "html.ie7_html body",
-    20: ".ie7_html .ie7_body",
-    21: "html.ie7_html .ie7_body",
-    22: "html.ie7_html body.ie7_body"
-  }
-});
-
-// -----------------------------------------------------------------------
-// IE7 dynamic style
-// -----------------------------------------------------------------------
-
-// object properties:
-// attach: the element that an event handler will be attached to
-// target: the element that will have the IE7 class applied
-
-var DynamicRule = Rule.extend({
-  // properties
-  constructor: function(selector, attach, dynamicPseudoClass, target, cssText) {
-    // initialise object properties
-    this.attach = attach || "*";
-    this.dynamicPseudoClass = IE7.CSS.dynamicPseudoClasses[dynamicPseudoClass];
-    this.target = target;
-    this.base(selector, cssText);
-  },
-  
-  recalc: function() {
-    // execute the underlying css query for this class
-    var attaches = cssQuery(this.attach), attach;
-    // process results
-    for (var i = 0; attach = attaches[i]; i++) {
-      // retrieve the event handler's target element(s)
-      var target = this.target ? cssQuery(this.target, attach) : [attach];
-      // attach event handlers for dynamic pseudo-classes
-      if (target.length) this.dynamicPseudoClass.apply(attach, target, this);
-    }
-  }
-});
-
-// -----------------------------------------------------------------------
-//  IE7 dynamic pseudo-classes
-// -----------------------------------------------------------------------
-
-var DynamicPseudoClass = Base.extend({
-  constructor: function(name, apply) {
-    this.name = name;
-    this.apply = apply;
-    this.instances = {};
-    IE7.CSS.dynamicPseudoClasses[name] = this;
-  },
-  
-  register: function(instance) {
-    // an "instance" is actually an Arguments object
-    var _class = instance[2];
-    instance.id = _class.id + instance[0].uniqueID;
-    if (!this.instances[instance.id]) {
-      var target = instance[1], j;
-      for (j = 0; j < target.length; j++) _class.add(target[j]);
-      this.instances[instance.id] = instance;
-    }
-  },
-  
-  unregister: function(instance) {
-    if (this.instances[instance.id]) {
-      var _class = instance[2];
-      var target = instance[1], j;
-      for (j = 0; j < target.length; j++) _class.remove(target[j]);
-      delete this.instances[instance.id];
-    }
-  }
-});
-  
-// -----------------------------------------------------------------------
-// dynamic pseudo-classes
-// -----------------------------------------------------------------------
-
-if (appVersion < 7) {
-  var Hover = new DynamicPseudoClass("hover", function(element) {
-    var instance = arguments;
-    IE7.CSS.addEventHandler(element, appVersion < 5.5 ? "onmouseover" : "onmouseenter", function() {
-      Hover.register(instance);
-    });
-    IE7.CSS.addEventHandler(element, appVersion < 5.5 ? "onmouseout" : "onmouseleave", function() {
-      Hover.unregister(instance);
-    });
-  });
-  
-  // globally trap the mouseup event (thanks Martijn!)
-  addEventHandler(document, "onmouseup", function() {
-    var instances = Hover.instances;
-    for (var i in instances)
-      if (!instances[i][0].contains(event.srcElement))
-        Hover.unregister(instances[i]);
-  });
-}
-
-// -----------------------------------------------------------------------
-// propertyName: inherit;
-// -----------------------------------------------------------------------
-
-IE7.CSS.addRecalc("[\\w-]+", "inherit", function(element, cssText) {
-  var inherited = cssText.match(/[\w-]+\s*:\s*inherit/g);
-  for (var i = 0; i < inherited.length; i++) {
-    var propertyName = inherited[i].replace(/ie7\-|\s*:\s*inherit/g, "").replace(/\-([a-z])/g, function(match, chr) {
-      return chr.toUpperCase()
-    });
-    element.runtimeStyle[propertyName] = element.parentElement.currentStyle[propertyName];
-  }
-});
-
-// =========================================================================
-// ie7-html.js
-// =========================================================================
-
-// default font-sizes
-//HEADER += "h1{font-size:2em}h2{font-size:1.5em;}h3{font-size:1.17em;}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.67em}";
-
-IE7.HTML = new (Fix.extend({ // single instance  
-  fixed: {},
-  
-  init: Undefined,
-  
-  addFix: function() {
-    // fixes are a one-off, they are applied when the document is loaded
-    this.fixes.push(arguments);
-  },
-  
-  apply: function() {
-    for (var i = 0; i < this.fixes.length; i++) {
-      var match = cssQuery(this.fixes[i][0]);
-      var fix = this.fixes[i][1];
-      for (var j = 0; j < match.length; j++) fix(match[j]);
-    }
-  },
-  
-  addRecalc: function() {
-    // recalcs occur whenever the document is refreshed using document.recalc()
-    this.recalcs.push(arguments);
-  },
-  
-  recalc: function() {
-    // loop through the fixes
-    for (var i = 0; i < this.recalcs.length; i++) {
-      var match = cssQuery(this.recalcs[i][0]);
-      var recalc = this.recalcs[i][1], element;
-      var key = Math.pow(2, i);
-      for (var j = 0; (element = match[j]); j++) {
-        var uniqueID = element.uniqueID;
-        if ((this.fixed[uniqueID] & key) == 0) {
-          element = recalc(element) || element;
-          this.fixed[uniqueID] |= key;
-        }
-      }
-    }
-  }
-}));
-
-if (appVersion < 7) {  
-  // provide support for the <abbr> tag.
-  //  this is a proper fix, it preserves the DOM structure and
-  //  <abbr> elements report the correct tagName & namespace prefix
-  document.createElement("abbr");
-  
-  // bind to the first child control
-  IE7.HTML.addRecalc("label", function(label) {
-    if (!label.htmlFor) {
-      var firstChildControl = cssQuery("input,textarea", label, true);
-      if (firstChildControl) {
-        addEventHandler(label, "onclick", function() {
-          firstChildControl.click();
-        });
-      }
-    }
-  });
-}
-
-// =========================================================================
-// ie7-layout.js
-// =========================================================================
-
-var NUMERIC = "[.\\d]";
-
-new function(_) {
-var layout = IE7.Layout = this;
-
-  // big, ugly box-model hack + min/max stuff
-  
-  // #tantek > #erik > #dean { voice-family: hacker; }
-  
-  // -----------------------------------------------------------------------
-  // "layout"
-  // -----------------------------------------------------------------------
-  
-  HEADER += "*{boxSizing:content-box}";
-  
-  // does an element have "layout" ?
-  IE7.hasLayout = appVersion < 5.5 ? function(element) {
-    // element.currentStyle.hasLayout doesn't work for IE5.0
-    return element.clientWidth;
-  } : function(element) {
-    return element.currentStyle.hasLayout;
-  };
-  
-  // give an element "layout"
-  layout.boxSizing = function(element) {
-    if (!IE7.hasLayout(element)) {
-    //#  element.runtimeStyle.fixedHeight =
-      element.style.height = "0cm";
-      if (element.currentStyle.verticalAlign == "auto")
-        element.runtimeStyle.verticalAlign = "top";
-      // when an element acquires "layout", margins no longer collapse correctly
-      collapseMargins(element);
-    }
-  };
-  
-  // -----------------------------------------------------------------------
-  // Margin Collapse
-  // -----------------------------------------------------------------------
-  
-  function collapseMargins(element) {
-    if (element != viewport && element.currentStyle.position != "absolute") {
-      collapseMargin(element, "marginTop");
-      collapseMargin(element, "marginBottom");
-    }
-  };
-  
-  function collapseMargin(element, type) {
-    if (!element.runtimeStyle[type]) {
-      var parentElement = element.parentElement;
-      if (parentElement && IE7.hasLayout(parentElement) && !IE7[type == "marginTop" ? "_getPreviousElementSibling" : "_getNextElementSibling"](element)) return;
-      var child = cssQuery(">*:" + (type == "marginTop" ? "first" : "last") + "-child", element, true);
-      if (child && child.currentStyle.styleFloat == "none" && IE7.hasLayout(child)) {
-        collapseMargin(child, type);
-        margin = _getMargin(element, element.currentStyle[type]);
-        childMargin = _getMargin(child, child.currentStyle[type]);
-        if (margin < 0 || childMargin < 0) {
-          element.runtimeStyle[type] = margin + childMargin;
-        } else {
-          element.runtimeStyle[type] = Math.max(childMargin, margin);
-        }
-        child.runtimeStyle[type] = "0px";
-      }
-    }
-  };
-  
-  function _getMargin(element, value) {
-    return value == "auto" ? 0 : getPixelValue(element, value);
-  };
-  
-  // -----------------------------------------------------------------------
-  // box-model
-  // -----------------------------------------------------------------------
-  
-  // constants
-  var UNIT = /^[.\d][\w%]*$/, AUTO = /^(auto|0cm)$/;
-  
-  var applyWidth, applyHeight;
-  IE7.Layout.borderBox = function(element){
-    applyWidth(element);
-    applyHeight(element);
-  };
-  
-  var fixWidth = function(HEIGHT) {
-    applyWidth = function(element) {
-      if (!PERCENT.test(element.currentStyle.width)) fixWidth(element);
-      collapseMargins(element);
-    };
-  
-    function fixWidth(element, value) {
-      if (!element.runtimeStyle.fixedWidth) {
-        if (!value) value = element.currentStyle.width;
-        element.runtimeStyle.fixedWidth = (UNIT.test(value)) ? Math.max(0, getFixedWidth(element, value)) : value;
-        setOverrideStyle(element, "width", element.runtimeStyle.fixedWidth);
-      }
-    };
-  
-    function layoutWidth(element) {
-      if (!isFixed(element)) {
-        var layoutParent = element.offsetParent;
-        while (layoutParent && !IE7.hasLayout(layoutParent)) layoutParent = layoutParent.offsetParent;
-      }
-      return (layoutParent || viewport).clientWidth;
-    };
-  
-    function getPixelWidth(element, value) {
-      if (PERCENT.test(value)) return parseInt(parseFloat(value) / 100 * layoutWidth(element));
-      return getPixelValue(element, value);
-    };
-  
-    var getFixedWidth = function(element, value) {
-      var borderBox = element.currentStyle["box-sizing"] == "border-box";
-      var adjustment = 0;
-      if (quirksMode && !borderBox)
-        adjustment += getBorderWidth(element) + getWidth(element, "padding");
-      else if (!quirksMode && borderBox)
-        adjustment -= getBorderWidth(element) + getWidth(element, "padding");
-      return getPixelWidth(element, value) + adjustment;
-    };
-  
-    // easy way to get border thickness for elements with "layout"
-    function getBorderWidth(element) {
-      return element.offsetWidth - element.clientWidth;
-    };
-  
-    // have to do some pixel conversion to get padding/margin thickness :-(
-    function getWidth(element, type) {
-      return getPixelWidth(element, element.currentStyle[type + "Left"]) + getPixelWidth(element, element.currentStyle[type + "Right"]);
-    };
-  
-    // -----------------------------------------------------------------------
-    // min/max
-    // -----------------------------------------------------------------------
-  
-    HEADER += "*{minWidth:none;maxWidth:none;min-width:none;max-width:none}";
-  
-    // handle min-width property
-    layout.minWidth = function(element) {
-      // IE6 supports min-height so we frig it here
-      //#if (element.currentStyle.minHeight == "auto") element.runtimeStyle.minHeight = 0;
-      if (element.currentStyle["min-width"] != null) {
-        element.style.minWidth = element.currentStyle["min-width"];
-      }
-      if (register(arguments.callee, element, element.currentStyle.minWidth != "none")) {
-        layout.boxSizing(element);
-        fixWidth(element);
-        resizeWidth(element);
-      }
-    };
-    
-    // clone the minWidth function to make a maxWidth function
-    eval("IE7.Layout.maxWidth=" + String(layout.minWidth).replace(/min/g, "max"));
-    
-    // apply min/max restrictions
-    function resizeWidth(element) {
-      // check boundaries
-      var rect = element.getBoundingClientRect();
-      var width = rect.right - rect.left;
-  
-      if (element.currentStyle.minWidth != "none" && width <= getFixedWidth(element, element.currentStyle.minWidth)) {
-        element.runtimeStyle.width = element.currentStyle.minWidth;
-      } else if (element.currentStyle.maxWidth != "none" && width >= getFixedWidth(element, element.currentStyle.maxWidth)) {
-        element.runtimeStyle.width = element.currentStyle.maxWidth;
-      } else {
-        element.runtimeStyle.width = element.runtimeStyle.fixedWidth; // || "auto";
-      }
-    };
-  
-    // -----------------------------------------------------------------------
-    // right/bottom
-    // -----------------------------------------------------------------------
-  
-    function fixRight(element) {
-      if (register(fixRight, element, /^(fixed|absolute)$/.test(element.currentStyle.position) &&
-        getDefinedStyle(element, "left") != "auto" &&
-        getDefinedStyle(element, "right") != "auto" &&
-        AUTO.test(getDefinedStyle(element, "width")))) {
-          resizeRight(element);
-          IE7.Layout.boxSizing(element);
-      }
-    };
-    IE7.Layout.fixRight = fixRight;
-  
-    function resizeRight(element) {
-      var left = getPixelWidth(element, element.runtimeStyle._left || element.currentStyle.left);
-      var width = layoutWidth(element) - getPixelWidth(element, element.currentStyle.right) -  left - getWidth(element, "margin");
-      if (parseInt(element.runtimeStyle.width) == width) return;
-      element.runtimeStyle.width = "";
-      if (isFixed(element) || HEIGHT || element.offsetWidth < width) {
-        if (!quirksMode) width -= getBorderWidth(element) + getWidth(element, "padding");
-        if (width < 0) width = 0;
-        element.runtimeStyle.fixedWidth = width;
-        setOverrideStyle(element, "width", width);
-      }
-    };
-  
-  // -----------------------------------------------------------------------
-  // window.onresize
-  // -----------------------------------------------------------------------
-  
-    // handle window resize
-    var clientWidth = 0;
-    addResize(function() {
-      if (!viewport) return;
-      var i, wider = (clientWidth < viewport.clientWidth);
-      clientWidth = viewport.clientWidth;
-      // resize elements with "min-width" set
-      var elements = layout.minWidth.elements;
-      for (i in elements) {
-        var element = elements[i];
-        var fixedWidth = (parseInt(element.runtimeStyle.width) == getFixedWidth(element, element.currentStyle.minWidth));
-        if (wider && fixedWidth) element.runtimeStyle.width = "";
-        if (wider == fixedWidth) resizeWidth(element);
-      }
-      // resize elements with "max-width" set
-      var elements = layout.maxWidth.elements;
-      for (i in elements) {
-        var element = elements[i];
-        var fixedWidth = (parseInt(element.runtimeStyle.width) == getFixedWidth(element, element.currentStyle.maxWidth));
-        if (!wider && fixedWidth) element.runtimeStyle.width = "";
-        if (wider != fixedWidth) resizeWidth(element);
-      }
-      // resize elements with "right" set
-      for (i in fixRight.elements) resizeRight(fixRight.elements[i]);
-    });
-  
-  // -----------------------------------------------------------------------
-  // fix CSS
-  // -----------------------------------------------------------------------
-    if (quirksMode) {
-      IE7.CSS.addRecalc("width", NUMERIC, applyWidth);
-    }
-    if (appVersion < 7) {
-      IE7.CSS.addRecalc("min-width", NUMERIC, layout.minWidth);
-      IE7.CSS.addRecalc("max-width", NUMERIC, layout.maxWidth);
-      IE7.CSS.addRecalc("right", NUMERIC, fixRight);
-    }
-  };
-  
-  eval("var fixHeight=" + rotate(fixWidth));
-  
-  // apply box-model + min/max fixes
-  fixWidth();
-  fixHeight(true);
-};
-
-// =========================================================================
-// ie7-graphics.js
-// =========================================================================
-
-// a small transparent image used as a placeholder
-var BLANK_GIF = makePath("blank.gif", path);
-
-var ALPHA_IMAGE_LOADER = "DXImageTransform.Microsoft.AlphaImageLoader";
-var PNG_FILTER = "progid:" + ALPHA_IMAGE_LOADER + "(src='%1',sizingMethod='%2')";
-  
-// regular expression version of the above
-var PNG;
-
-var filtered = [];
-
-function fixImage(element) {
-  if (PNG.test(element.src)) {
-    // we have to preserve width and height
-    var image = new Image(element.width, element.height);
-    image.onload = function() {
-      element.width = image.width;
-      element.height = image.height;
-      image = null;
-    };
-    image.src = element.src;
-    // store the original url (we'll put it back when it's printed)
-    element.pngSrc = element.src;
-    // add the AlphaImageLoader thingy
-    addFilter(element);
-  }
-};
-
-if (appVersion >= 5.5 && appVersion < 7) {
-  // ** IE7 VARIABLE
-  // e.g. only apply the hack to files ending in ".png"
-  // IE7_PNG_SUFFIX = ".png";
-
-  // replace background(-image): url(..) ..  with background(-image): .. ;filter: ..;
-  IE7.CSS.addFix(/background(-image)?\s*:\s*([^};]*)?url\(([^\)]+)\)([^;}]*)?/, function(match, $1, $2, url, $4) {
-    url = getString(url);
-    return PNG.test(url) ? "filter:" + format(PNG_FILTER, url, "crop") +
-      ";zoom:1;background" + ($1||"") + ":" + ($2||"") + "none" + ($4||"") : match;
-  });
-  
-  // -----------------------------------------------------------------------
-  //  fix PNG transparency (HTML images)
-  // -----------------------------------------------------------------------
-
-  IE7.HTML.addRecalc("img,input", function(element) {
-    if (element.tagName == "INPUT" && element.type != "image") return;
-    fixImage(element);
-    addEventHandler(element, "onpropertychange", function() {
-      if (!printing && event.propertyName == "src" &&
-        element.src.indexOf(BLANK_GIF) == -1) fixImage(element);
-    });
-  });
-
-  // assume that background images should not be printed
-  //  (if they are not transparent then they'll just obscure content)
-  // but we'll put foreground images back...
-  var printing = false;
-  addEventHandler(window, "onbeforeprint", function() {
-    printing = true;
-    for (var i = 0; i < filtered.length; i++) removeFilter(filtered[i]);
-  });
-  addEventHandler(window, "onafterprint", function() {
-    for (var i = 0; i < filtered.length; i++) addFilter(filtered[i]);
-    printing = false;
-  });
-}
-
-// apply a filter
-function addFilter(element, sizingMethod) {
-  var filter = element.filters[ALPHA_IMAGE_LOADER];
-  if (filter) {
-    filter.src = element.src;
-    filter.enabled = true;
-  } else {
-    element.runtimeStyle.filter = format(PNG_FILTER, element.src, sizingMethod || "scale");
-    filtered.push(element);
-  }
-  // remove the real image
-  element.src = BLANK_GIF;
-};
-
-function removeFilter(element) {
-  element.src = element.pngSrc;
-  element.filters[ALPHA_IMAGE_LOADER].enabled = false;
-};
-
-// =========================================================================
-// ie7-fixed.js
-// =========================================================================
-
-new function(_) {
-  if (appVersion >= 7) return;
-  
-  // some things to consider for this hack.
-  // the document body requires a fixed background. even if
-  //  it is just a blank image.
-  // you have to use setExpression instead of onscroll, this
-  //  together with a fixed body background helps avoid the
-  //  annoying screen flicker of other solutions.
-  
-  IE7.CSS.addRecalc("position", "fixed", _positionFixed, "absolute");
-  IE7.CSS.addRecalc("background(-attachment)?", "[^};]*fixed", _backgroundFixed);
-  
-  // scrolling is relative to the documentElement (HTML tag) when in
-  //  standards mode, otherwise it's relative to the document body
-  var $viewport = quirksMode ? "body" : "documentElement";
-  
-  function _fixBackground() {
-    // this is required by both position:fixed and background-attachment:fixed.
-    // it is necessary for the document to also have a fixed background image.
-    // we can fake this with a blank image if necessary
-    if (body.currentStyle.backgroundAttachment != "fixed") {
-      if (body.currentStyle.backgroundImage == "none") {
-        body.runtimeStyle.backgroundRepeat = "no-repeat";
-        body.runtimeStyle.backgroundImage = "url(" + BLANK_GIF + ")"; // dummy
-      }
-      body.runtimeStyle.backgroundAttachment = "fixed";
-    }
-    _fixBackground = Undefined;
-  };
-  
-  var _tmp = createTempElement("img");
-  
-  function _isFixed(element) {
-    return element ? isFixed(element) || _isFixed(element.parentElement) : false;
-  };
-  
-  function _setExpression(element, propertyName, expression) {
-    setTimeout("document.all." + element.uniqueID + ".runtimeStyle.setExpression('" + propertyName + "','" + expression + "')", 0);
-  };
-  
-  // -----------------------------------------------------------------------
-  //  backgroundAttachment: fixed
-  // -----------------------------------------------------------------------
-  
-  function _backgroundFixed(element) {
-    if (register(_backgroundFixed, element, element.currentStyle.backgroundAttachment == "fixed" && !element.contains(body))) {
-      _fixBackground();
-      bgLeft(element);
-      bgTop(element);
-      _backgroundPosition(element);
-    }
-  };
-  
-  function _backgroundPosition(element) {
-    _tmp.src = element.currentStyle.backgroundImage.slice(5, -2);
-    var parentElement = element.canHaveChildren ? element : element.parentElement;
-    parentElement.appendChild(_tmp);
-    setOffsetLeft(element);
-    setOffsetTop(element);
-    parentElement.removeChild(_tmp);
-  };
-  
-  function bgLeft(element) {
-    element.style.backgroundPositionX = element.currentStyle.backgroundPositionX;
-    if (!_isFixed(element)) {
-      _setExpression(element, "backgroundPositionX", "(parseInt(runtimeStyle.offsetLeft)+document." + $viewport + ".scrollLeft)||0");
-    }
-  };
-  eval(rotate(bgLeft));
-  
-  function setOffsetLeft(element) {
-    var propertyName = _isFixed(element) ? "backgroundPositionX" : "offsetLeft";
-    element.runtimeStyle[propertyName] =
-      getOffsetLeft(element, element.style.backgroundPositionX) -
-      element.getBoundingClientRect().left - element.clientLeft + 2;
-  };
-  eval(rotate(setOffsetLeft));
-  
-  function getOffsetLeft(element, position) {
-    switch (position) {
-      case "left":
-      case "top":
-        return 0;
-      case "right":
-      case "bottom":
-        return viewport.clientWidth - _tmp.offsetWidth;
-      case "center":
-        return (viewport.clientWidth - _tmp.offsetWidth) / 2;
-      default:
-        if (PERCENT.test(position)) {
-          return parseInt((viewport.clientWidth - _tmp.offsetWidth) * parseFloat(position) / 100);
-        }
-        _tmp.style.left = position;
-        return _tmp.offsetLeft;
-    }
-  };
-  eval(rotate(getOffsetLeft));
-  
-  // -----------------------------------------------------------------------
-  //  position: fixed
-  // -----------------------------------------------------------------------
-  
-  function _positionFixed(element) {
-    if (register(_positionFixed, element, isFixed(element))) {
-      setOverrideStyle(element, "position",  "absolute");
-      setOverrideStyle(element, "left",  element.currentStyle.left);
-      setOverrideStyle(element, "top",  element.currentStyle.top);
-      _fixBackground();
-      IE7.Layout.fixRight(element);
-      _foregroundPosition(element);
-    }
-  };
-  
-  function _foregroundPosition(element, recalc) {
-    positionTop(element, recalc);
-    positionLeft(element, recalc, true);
-    if (!element.runtimeStyle.autoLeft && element.currentStyle.marginLeft == "auto" &&
-      element.currentStyle.right != "auto") {
-      var left = viewport.clientWidth - getPixelWidth(element, element.currentStyle.right) -
-        getPixelWidth(element, element.runtimeStyle._left) - element.clientWidth;
-      if (element.currentStyle.marginRight == "auto") left = parseInt(left / 2);
-      if (_isFixed(element.offsetParent)) element.runtimeStyle.pixelLeft += left;
-      else element.runtimeStyle.shiftLeft = left;
-    }
-    clipWidth(element);
-    clipHeight(element);
-  };
-
-  function clipWidth(element) {
-    var fixWidth = element.runtimeStyle.fixWidth;
-    element.runtimeStyle.borderRightWidth = "";
-    element.runtimeStyle.width = fixWidth ? getPixelWidth(element, fixWidth) : "";
-    if (element.currentStyle.width != "auto") {
-      var rect = element.getBoundingClientRect();
-      var width = element.offsetWidth - viewport.clientWidth + rect.left - 2;
-      if (width >= 0) {
-        element.runtimeStyle.borderRightWidth = "0px";
-        width = Math.max(getPixelValue(element, element.currentStyle.width) - width, 0);
-        setOverrideStyle(element, "width",  width);
-        return width;
-      }
-    }
-  };
-  eval(rotate(clipWidth));
-  
-  function positionLeft(element, recalc) {
-    // if the element's width is in % units then it must be recalculated
-    //  with respect to the viewport
-    if (!recalc && PERCENT.test(element.currentStyle.width)) {
-      element.runtimeStyle.fixWidth = element.currentStyle.width;
-    }
-    if (element.runtimeStyle.fixWidth) {
-      element.runtimeStyle.width = getPixelWidth(element, element.runtimeStyle.fixWidth);
-    }
-    //if (recalc) {
-    //  // if the element is fixed on the right then no need to recalculate
-    //  if (!element.runtimeStyle.autoLeft) return;
-    //} else {
-      element.runtimeStyle.shiftLeft = 0;
-      element.runtimeStyle._left = element.currentStyle.left;
-      // is the element fixed on the right?
-      element.runtimeStyle.autoLeft = element.currentStyle.right != "auto" &&
-        element.currentStyle.left == "auto";
-    //}
-    // reset the element's "left" value and get it's natural position
-    element.runtimeStyle.left = "";
-    element.runtimeStyle.screenLeft = getScreenLeft(element);
-    element.runtimeStyle.pixelLeft = element.runtimeStyle.screenLeft;
-    // if the element is contained by another fixed element then there is no need to
-    //  continually recalculate it's left position
-    if (!recalc && !_isFixed(element.offsetParent)) {
-      // onsrcoll produces jerky movement, so we use an expression
-      _setExpression(element, "pixelLeft", "runtimeStyle.screenLeft+runtimeStyle.shiftLeft+document." + $viewport + ".scrollLeft");
-    }
-  };
-  // clone this function so we can do "top"
-  eval(rotate(positionLeft));
-  
-  // I've forgotten how this works...
-  function getScreenLeft(element) { // thanks to kevin newman (captainn)
-    var screenLeft = element.offsetLeft, nested = 1;
-    if (element.runtimeStyle.autoLeft) {
-      screenLeft = viewport.clientWidth - element.offsetWidth - getPixelWidth(element, element.currentStyle.right);
-    }
-    // accommodate margins
-    if (element.currentStyle.marginLeft != "auto") {
-      screenLeft -= getPixelWidth(element, element.currentStyle.marginLeft);
-    }
-    while (element = element.offsetParent) {
-      if (element.currentStyle.position != "static") nested = -1;
-      screenLeft += element.offsetLeft * nested;
-    }
-    return screenLeft;
-  };
-  eval(rotate(getScreenLeft));
-  
-  function getPixelWidth(element, value) {
-    return PERCENT.test(value) ? parseInt(parseFloat(value) / 100 * viewport.clientWidth) : getPixelValue(element, value);
-  };
-  eval(rotate(getPixelWidth));
-  
-  // -----------------------------------------------------------------------
-  //  capture window resize
-  // -----------------------------------------------------------------------
-  
-  function _resize() {
-    // if the window has been resized then some positions need to be
-    //  recalculated (especially those aligned to "right" or "top"
-    var elements = _backgroundFixed.elements;
-    for (var i in elements) _backgroundPosition(elements[i]);
-    elements = _positionFixed.elements;
-    for (i in elements) {
-      _foregroundPosition(elements[i], true);
-      // do this twice to be sure - hackish, I know :-)
-      _foregroundPosition(elements[i], true);
-    }
-    _timer = 0;
-  };
-  
-  // use a timer for some reason.
-  //  (sometimes this is a good way to prevent resize loops)
-  var _timer;
-  addResize(function() {
-    if (!_timer) _timer = setTimeout(_resize, 0);
-  });
-};
-
-// =========================================================================
-// ie7-oveflow.js
-// =========================================================================
-
-/* ---------------------------------------------------------------------
-
-  This module alters the structure of the document.
-  It may adversely affect other CSS rules. Be warned.
-
---------------------------------------------------------------------- */
-
-var WRAPPER_STYLE = {
-  backgroundColor: "transparent",
-  backgroundImage: "none",
-  backgroundPositionX: null,
-  backgroundPositionY: null,
-  backgroundRepeat: null,
-  borderTopWidth: 0,
-  borderRightWidth: 0,
-  borderBottomWidth: 0,
-  borderLeftStyle: "none",
-  borderTopStyle: "none",
-  borderRightStyle: "none",
-  borderBottomStyle: "none",
-  borderLeftWidth: 0,
-  height: null,
-  marginTop: 0,
-  marginBottom: 0,
-  marginRight: 0,
-  marginLeft: 0,
-  width: "100%"
-};
-
-IE7.CSS.addRecalc("overflow", "visible", function(element) {
-  // don't do this again
-  if (element.parentNode.ie7_wrapped) return;
-
-  // if max-height is applied, makes sure it gets applied first
-  if (IE7.Layout && element.currentStyle["max-height"] != "auto") {
-    IE7.Layout.maxHeight(element);
-  }
-
-  if (element.currentStyle.marginLeft == "auto") element.style.marginLeft = 0;
-  if (element.currentStyle.marginRight == "auto") element.style.marginRight = 0;
-
-  var wrapper = document.createElement(ANON);
-  wrapper.ie7_wrapped = element;
-  for (var propertyName in WRAPPER_STYLE) {
-    wrapper.style[propertyName] = element.currentStyle[propertyName];
-    if (WRAPPER_STYLE[propertyName] != null) {
-      element.runtimeStyle[propertyName] = WRAPPER_STYLE[propertyName];
-    }
-  }
-  wrapper.style.display = "block";
-  wrapper.style.position = "relative";
-  element.runtimeStyle.position = "absolute";
-  element.parentNode.insertBefore(wrapper, element);
-  wrapper.appendChild(element);
-});
-
-// =========================================================================
-// ie7-quirks.js
-// =========================================================================
-
-function ie7Quirks() {
-  var FONT_SIZES = "xx-small,x-small,small,medium,large,x-large,xx-large".split(",");
-  for (var i = 0; i < FONT_SIZES.length; i++) {
-    FONT_SIZES[FONT_SIZES[i]] = FONT_SIZES[i - 1] || "0.67em";
-  }
-  
-  IE7.CSS.addFix(/(font(-size)?\s*:\s*)([\w.-]+)/, function(match, label, size, value) {
-    return label + (FONT_SIZES[value] || value);
-  });
-  
-  if (appVersion < 6) {
-    var NEGATIVE = /^\-/, LENGTH = /(em|ex)$/i;
-    var EM = /em$/i, EX = /ex$/i;
-  
-    getPixelValue = function(element, value) {
-      if (PIXEL.test(value)) return parseInt(value)||0;
-      var scale = NEGATIVE.test(value)? -1 : 1;
-      if (LENGTH.test(value)) scale *= getFontScale(element);
-      temp.style.width = (scale < 0) ? value.slice(1) : value;
-      body.appendChild(temp);
-      // retrieve pixel width
-      value = scale * temp.offsetWidth;
-      // remove the temporary element
-      temp.removeNode();
-      return parseInt(value);
-    };
-
-    var temp = createTempElement();
-    function getFontScale(element) {
-      var scale = 1;
-      temp.style.fontFamily = element.currentStyle.fontFamily;
-      temp.style.lineHeight = element.currentStyle.lineHeight;
-      //temp.style.fontSize = "";
-      while (element != body) {
-        var fontSize = element.currentStyle["ie7-font-size"];
-        if (fontSize) {
-          if (EM.test(fontSize)) scale *= parseFloat(fontSize);
-          else if (PERCENT.test(fontSize)) scale *= (parseFloat(fontSize) / 100);
-          else if (EX.test(fontSize)) scale *= (parseFloat(fontSize) / 2);
-          else {
-            temp.style.fontSize = fontSize;
-            return 1;
-          }
-        }
-        element = element.parentElement;
-      }
-      return scale;
-    };
-
-    // cursor:pointer (IE5.x)
-    IE7.CSS.addFix(/cursor\s*:\s*pointer/, "cursor:hand");
-    // display:list-item (IE5.x)
-    IE7.CSS.addFix(/display\s*:\s*list-item/, "display:block");
-  }
-  
-  // -----------------------------------------------------------------------
-  //  margin:auto
-  // -----------------------------------------------------------------------
-  
-  function fixMargin(element) {
-    if (appVersion < 5.5) IE7.Layout.boxSizing(element.parentElement);
-    var parent = element.parentElement;
-    var margin = parent.offsetWidth - element.offsetWidth - getPaddingWidth(parent);
-    var autoRight = (element.currentStyle["ie7-margin"] && element.currentStyle.marginRight == "auto") ||
-      element.currentStyle["ie7-margin-right"] == "auto";
-    switch (parent.currentStyle.textAlign) {
-      case "right":
-        margin = autoRight ? parseInt(margin / 2) : 0;
-        element.runtimeStyle.marginRight = margin + "px";
-        break;
-      case "center":
-        if (autoRight) margin = 0;
-      default:
-        if (autoRight) margin /= 2;
-        element.runtimeStyle.marginLeft = parseInt(margin) + "px";
-    }
-  };
-
-  function getPaddingWidth(element) {
-    return getPixelValue(element, element.currentStyle.paddingLeft) +
-      getPixelValue(element, element.currentStyle.paddingRight);
-  };
-  
-  IE7.CSS.addRecalc("margin(-left|-right)?", "[^};]*auto", function(element) {
-    if (register(fixMargin, element,
-      element.parentElement &&
-      element.currentStyle.display == "block" &&
-      element.currentStyle.marginLeft == "auto" &&
-      element.currentStyle.position != "absolute")) {
-        fixMargin(element);
-    }
-  });
-  
-  addResize(function() {
-    for (var i in fixMargin.elements) {
-      var element = fixMargin.elements[i];
-      element.runtimeStyle.marginLeft =
-      element.runtimeStyle.marginRight = "";
-      fixMargin(element);
-    }
-  });
-};
-
-
-// -----------------------------------------------------------------------
-// initialisation
-// -----------------------------------------------------------------------
-
-IE7.loaded = true;
-
-(function() {
-  try {
-    // http://javascript.nwbox.com/IEContentLoaded/
-    documentElement.doScroll("left");
-  } catch (e) {
-    setTimeout(arguments.callee, 1);
-    return;
-  }
-  // execute the inner text of the IE7 script
-  try {
-    eval(script.innerHTML);
-  } catch (e) {
-    // ignore errors
-  }
-  PNG = new RegExp(rescape(typeof IE7_PNG_SUFFIX == "string" ? IE7_PNG_SUFFIX : "-trans.png") + "$", "i");
-
-  // frequently used references
-  body = document.body;
-  viewport = quirksMode ? body : documentElement;
-
-  // classes
-  body.className += " ie7_body";
-  documentElement.className += " ie7_html";
-
-  if (quirksMode) ie7Quirks();
-
-  IE7.CSS.init();
-  IE7.HTML.init();
-
-  IE7.HTML.apply();
-  IE7.CSS.apply();
-
-  IE7.recalc();
-})();
-
-
-})();
Index: nc/admin/default-templates/js/ie7/IE8.js
===================================================================
--- inc/admin/default-templates/js/ie7/IE8.js	(revision 1056)
+++ 	(revision )
@@ -1,2601 +1,0 @@
-// timestamp: Sun, 03 Feb 2008 19:26:22
-/*
-  IE7/IE8.js - copyright 2004-2008, Dean Edwards
-  http://dean.edwards.name/IE7/
-  http://www.opensource.org/licenses/mit-license.php
-*/
-
-/* W3C compliance for Microsoft Internet Explorer */
-
-/* credits/thanks:
-  Shaggy, Martijn Wargers, Jimmy Cerra, Mark D Anderson,
-  Lars Dieckow, Erik Arvidsson, Gellért Gyuris, James Denny,
-  Unknown W Brackets, Benjamin Westfarer, Rob Eberhardt,
-  Bill Edney, Kevin Newman, James Crompton, Matthew Mastracci,
-  Doug Wright, Richard York, Kenneth Kolano, MegaZone,
-  Thomas Verelst, Mark 'Tarquin' Wilton-Jones, Rainer Åhlfors,
-  David Zulaica, Ken Kolano, Kevin Newman
-*/
-
-// =======================================================================
-// TO DO
-// =======================================================================
-
-// PNG - unclickable content
-
-// =======================================================================
-// TEST/BUGGY
-// =======================================================================
-
-// hr{margin:1em auto} (doesn't look right in IE5)
-
-(function() {
-
-IE7 = {
-  toString: function(){return "IE7 version 2.0 (beta2)"}
-};
-var appVersion = IE7.appVersion = navigator.appVersion.match(/MSIE (\d\.\d)/)[1];
-
-if (/ie7_off/.test(top.location.search) || appVersion < 5) return;
-
-var Undefined = K();
-var quirksMode = document.compatMode != "CSS1Compat";
-var documentElement = document.documentElement, body, viewport;
-var ANON = "!";
-var HEADER = ":link{ie7-link:link}:visited{ie7-link:visited}";
-
-// -----------------------------------------------------------------------
-// external
-// -----------------------------------------------------------------------
-
-var RELATIVE = /^[\w\.]+[^:]*$/;
-function makePath(href, path) {
-  if (RELATIVE.test(href)) href = (path || "") + href;
-  return href;
-};
-
-function getPath(href, path) {
-  href = makePath(href, path);
-  return href.slice(0, href.lastIndexOf("/") + 1);
-};
-
-// get the path to this script
-var script = document.scripts[document.scripts.length - 1];
-var path = getPath(script.src);
-
-// we'll use microsoft's http request object to load external files
-try {
-  var httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
-} catch (e) {
-  // ActiveX disabled
-}
-
-var fileCache = {};
-function loadFile(href, path) {
-try {
-  href = makePath(href, path);
-  if (!fileCache[href]) {
-    // easy to load a file huh?
-    httpRequest.open("GET", href, false);
-    httpRequest.send();
-    if (httpRequest.status == 0 || httpRequest.status == 200) {
-      fileCache[href] = httpRequest.responseText;
-    }
-  }
-} catch (e) {
-  // ignore errors
-} finally {
-  return fileCache[href] || "";
-}};
-
-// -----------------------------------------------------------------------
-// IE5.0 compatibility
-// -----------------------------------------------------------------------
-
-
-if (appVersion < 5.5) {
-  undefined = Undefined();
-
-  ANON = "HTML:!"; // for anonymous content
-  
-  // Fix String.replace (Safari1.x/IE5.0).
-  var GLOBAL = /(g|gi)$/;
-  var _String_replace = String.prototype.replace; 
-  String.prototype.replace = function(expression, replacement) {
-    if (typeof replacement == "function") { // Safari doesn't like functions
-      if (expression && expression.constructor == RegExp) {
-        var regexp = expression;
-        var global = regexp.global;
-        if (global == null) global = GLOBAL.test(regexp);
-        // we have to convert global RexpExps for exec() to work consistently
-        if (global) regexp = new RegExp(regexp.source); // non-global
-      } else {
-        regexp = new RegExp(rescape(expression));
-      }
-      var match, string = this, result = "";
-      while (string && (match = regexp.exec(string))) {
-        result += string.slice(0, match.index) + replacement.apply(this, match);
-        string = string.slice(match.index + match[0].length);
-        if (!global) break;
-      }
-      return result + string;
-    }
-    return _String_replace.apply(this, arguments);
-  };
-  
-  Array.prototype.pop = function() {
-    if (this.length) {
-      var i = this[this.length - 1];
-      this.length--;
-      return i;
-    }
-    return undefined;
-  };
-  
-  Array.prototype.push = function() {
-    for (var i = 0; i < arguments.length; i++) {
-      this[this.length] = arguments[i];
-    }
-    return this.length;
-  };
-  
-  var ns = this;
-  Function.prototype.apply = function(o, a) {
-    if (o === undefined) o = ns;
-    else if (o == null) o = window;
-    else if (typeof o == "string") o = new String(o);
-    else if (typeof o == "number") o = new Number(o);
-    else if (typeof o == "boolean") o = new Boolean(o);
-    if (arguments.length == 1) a = [];
-    else if (a[0] && a[0].writeln) a[0] = a[0].documentElement.document || a[0];
-    var $ = "#ie7_apply", r;
-    o[$] = this;
-    switch (a.length) { // unroll for speed
-      case 0: r = o[$](); break;
-      case 1: r = o[$](a[0]); break;
-      case 2: r = o[$](a[0],a[1]); break;
-      case 3: r = o[$](a[0],a[1],a[2]); break;
-      case 4: r = o[$](a[0],a[1],a[2],a[3]); break;
-      case 5: r = o[$](a[0],a[1],a[2],a[3],a[4]); break;
-      default:
-        var b = [], i = a.length - 1;
-        do b[i] = "a[" + i + "]"; while (i--);
-        eval("r=o[$](" + b + ")");
-    }
-    if (typeof o.valueOf == "function") { // not a COM object
-      delete o[$];
-    } else {
-      o[$] = undefined;
-      if (r && r.writeln) r = r.documentElement.document || r;
-    }
-    return r;
-  };
-  
-  Function.prototype.call = function(o) {
-    return this.apply(o, _slice.apply(arguments, [1]));
-  };
-
-  // block elements are "inline" according to IE5.0 so we'll fix it
-  HEADER += "address,blockquote,body,dd,div,dt,fieldset,form,"+
-    "frame,frameset,h1,h2,h3,h4,h5,h6,iframe,noframes,object,p,"+
-    "hr,applet,center,dir,menu,pre,dl,li,ol,ul{display:block}";
-}
-
-// -----------------------------------------------------------------------
-// OO support
-// -----------------------------------------------------------------------
-
-
-// This is a cut-down version of base2 (http://code.google.com/p/base2/)
-
-var _slice = Array.prototype.slice;
-
-// private
-var _FORMAT = /%([1-9])/g;
-var _LTRIM = /^\s\s*/;
-var _RTRIM = /\s\s*$/;
-var _RESCAPE = /([\/()[\]{}|*+-.,^$?\\])/g;           // safe regular expressions
-var _BASE = /\bbase\b/;
-var _HIDDEN = ["constructor", "toString"];            // only override these when prototyping
-
-var prototyping;
-
-function Base(){};
-Base.extend = function(_instance, _static) {
-  // Build the prototype.
-  prototyping = true;
-  var _prototype = new this;
-  extend(_prototype, _instance);
-  prototyping = false;
-
-  // Create the wrapper for the constructor function.
-  var _constructor = _prototype.constructor;
-  function klass() {
-    // Don't call the constructor function when prototyping.
-    if (!prototyping) _constructor.apply(this, arguments);
-  };
-  _prototype.constructor = klass;
-
-  // Build the static interface.
-  klass.extend = arguments.callee;
-  extend(klass, _static);
-  klass.prototype = _prototype;
-  return klass;
-};
-Base.prototype.extend = function(source) {
-  return extend(this, source);
-};
-
-// A collection of regular expressions and their associated replacement values.
-// A Base class for creating parsers.
-
-var _HASH   = "#";
-var _KEYS   = "~";
-
-var _RG_ESCAPE_CHARS    = /\\./g;
-var _RG_ESCAPE_BRACKETS = /\(\?[:=!]|\[[^\]]+\]/g;
-var _RG_BRACKETS        = /\(/g;
-
-var RegGrp = Base.extend({
-  constructor: function(values) {
-    this[_KEYS] = [];
-    this.merge(values);
-  },
-
-  exec: function(string) {
-    var items = this, keys = this[_KEYS];    
-    return String(string).replace(new RegExp(this, this.ignoreCase ? "gi" : "g"), function() {
-      var item, offset = 1, i = 0;
-      // Loop through the RegGrp items.
-      while ((item = items[_HASH + keys[i++]])) {
-        var next = offset + item.length + 1;
-        if (arguments[offset]) { // do we have a result?
-          var replacement = item.replacement;
-          switch (typeof replacement) {
-            case "function":
-              return replacement.apply(items, _slice.call(arguments, offset, next));
-            case "number":
-              return arguments[offset + replacement];
-            default:
-              return replacement;
-          }
-        }
-        offset = next;
-      }
-    });
-  },
-
-  add: function(expression, replacement) {
-    if (expression instanceof RegExp) {
-      expression = expression.source;
-    }
-    if (!this[_HASH + expression]) this[_KEYS].push(String(expression));
-    this[_HASH + expression] = new RegGrp.Item(expression, replacement);
-  },
-
-  merge: function(values) {
-    for (var i in values) this.add(i, values[i]);
-  },
-
-  toString: function() {
-    // back references not supported in simple RegGrp
-    return "(" + this[_KEYS].join(")|(") + ")";
-  }
-}, {
-  IGNORE: "$0",
-
-  Item: Base.extend({
-    constructor: function(expression, replacement) {
-      expression = expression instanceof RegExp ? expression.source : String(expression);
-
-      if (typeof replacement == "number") replacement = String(replacement);
-      else if (replacement == null) replacement = "";
-
-      // does the pattern use sub-expressions?
-      if (typeof replacement == "string" && /\$(\d+)/.test(replacement)) {
-        // a simple lookup? (e.g. "$2")
-        if (/^\$\d+$/.test(replacement)) {
-          // store the index (used for fast retrieval of matched strings)
-          replacement = parseInt(replacement.slice(1));
-        } else { // a complicated lookup (e.g. "Hello $2 $1")
-          // build a function to do the lookup
-          var Q = /'/.test(replacement.replace(/\\./g, "")) ? '"' : "'";
-          replacement = replacement.replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\$(\d+)/g, Q +
-            "+(arguments[$1]||" + Q+Q + ")+" + Q);
-          replacement = new Function("return " + Q + replacement.replace(/(['"])\1\+(.*)\+\1\1$/, "$1") + Q);
-        }
-      }
-
-      this.length = RegGrp.count(expression);
-      this.replacement = replacement;
-      this.toString = K(expression);
-    }
-  }),
-
-  count: function(expression) {
-    // Count the number of sub-expressions in a RegExp/RegGrp.Item.
-    expression = String(expression).replace(_RG_ESCAPE_CHARS, "").replace(_RG_ESCAPE_BRACKETS, "");
-    return match(expression, _RG_BRACKETS).length;
-  }
-});
-
-// =========================================================================
-// lang/extend.js
-// =========================================================================
-
-function extend(object, source) { // or extend(object, key, value)
-  if (object && source) {
-    var proto = (typeof source == "function" ? Function : Object).prototype;
-    // Add constructor, toString etc
-    var i = _HIDDEN.length, key;
-    if (prototyping) while (key = _HIDDEN[--i]) {
-      var value = source[key];
-      if (value != proto[key]) {
-        if (_BASE.test(value)) {
-          _override(object, key, value)
-        } else {
-          object[key] = value;
-        }
-      }
-    }
-    // Copy each of the source object's properties to the target object.
-    for (key in source) if (proto[key] === undefined) {
-      var value = source[key];
-      // Check for method overriding.
-      if (object[key] && typeof value == "function" && _BASE.test(value)) {
-        _override(object, key, value);
-      } else {
-        object[key] = value;
-      }
-    }
-  }
-  return object;
-};
-
-function _override(object, name, method) {
-  // Override an existing method.
-  var ancestor = object[name];
-  object[name] = function() {
-    var previous = this.base;
-    this.base = ancestor;
-    var returnValue = method.apply(this, arguments);
-    this.base = previous;
-    return returnValue;
-  };
-};
-
-function combine(keys, values) {
-  // Combine two arrays to make a hash.
-  if (!values) values = keys;
-  var hash = {};
-  for (var i in keys) hash[i] = values[i];
-  return hash;
-};
-
-function format(string) {
-  // Replace %n with arguments[n].
-  // e.g. format("%1 %2%3 %2a %1%3", "she", "se", "lls");
-  // ==> "she sells sea shells"
-  // Only %1 - %9 supported.
-  var args = arguments;
-  var _FORMAT = new RegExp("%([1-" + arguments.length + "])", "g");
-  return String(string).replace(_FORMAT, function(match, index) {
-    return index < args.length ? args[index] : match;
-  });
-};
-
-function match(string, expression) {
-  // Same as String.match() except that this function will return an empty
-  // array if there is no match.
-  return String(string).match(expression) || [];
-};
-
-function rescape(string) {
-  // Make a string safe for creating a RegExp.
-  return String(string).replace(_RESCAPE, "\\$1");
-};
-
-// http://blog.stevenlevithan.com/archives/faster-trim-javascript
-function trim(string) {
-  return String(string).replace(_LTRIM, "").replace(_RTRIM, "");
-};
-
-function K(k) {
-  return function() {
-    return k;
-  };
-};
-
-// -----------------------------------------------------------------------
-// parsing
-// -----------------------------------------------------------------------
-
-var Parser = RegGrp.extend({ignoreCase: true});
-
-var ENCODED = /\x01(\d+)/g,
-    QUOTES  = /'/g, 
-    STRING = /^\x01/,
-    UNICODE = /\\([\da-fA-F]{1,4})/g;
-
-var _strings = [];
-
-var encoder = new Parser({
-  // comments
-  "<!\\-\\-|\\-\\->": "",
-  "\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\/": "",
-  // get rid
-  "@(namespace|import)[^;\\n]+[;\\n]": "",
-  // strings
-  "'(\\\\.|[^'\\\\])*'": encodeString,
-  '"(\\\\.|[^"\\\\])*"': encodeString,
-  // white space
-  "\\s+": " "
-});
-
-function encode(cssText) {
-  return encoder.exec(cssText);
-};
-
-function decode(cssText) {
-  return cssText.replace(ENCODED, function(match, index) {
-    return _strings[index - 1];
-  });
-};
-
-function encodeString(string) {
-  return "\x01" + _strings.push(string.replace(UNICODE, function(match, chr) {
-    return eval("'\\u" + "0000".slice(chr.length) + chr + "'");
-  }).slice(1, -1).replace(QUOTES, "\\'"));
-};
-
-function getString(value) {
-  return STRING.test(value) ? _strings[value.slice(1) - 1] : value;
-};
-
-// clone a "width" function to create a "height" function
-var rotater = new RegGrp({
-  Width: "Height",
-  width: "height",
-  Left:  "Top",
-  left:  "top",
-  Right: "Bottom",
-  right: "bottom",
-  onX:   "onY"
-});
-
-function rotate(fn) {
-  return rotater.exec(fn);
-};
-
-// -----------------------------------------------------------------------
-// event handling
-// -----------------------------------------------------------------------
-
-var eventHandlers = [];
-
-function addResize(handler) {
-  addRecalc(handler);
-  addEventHandler(window, "onresize", handler);
-};
-
-// add an event handler (function) to an element
-function addEventHandler(element, type, handler) {
-  element.attachEvent(type, handler);
-  // store the handler so it can be detached later
-  eventHandlers.push(arguments);
-};
-
-// remove an event handler assigned to an element by IE7
-function removeEventHandler(element, type, handler) {
-try {
-  element.detachEvent(type, handler);
-} catch (ignore) {
-  // write a letter of complaint to microsoft..
-}};
-
-// remove event handlers (they eat memory)
-addEventHandler(window, "onunload", function() {
-  var handler;
-  while (handler = eventHandlers.pop()) {
-    removeEventHandler(handler[0], handler[1], handler[2]);
-  }
-});
-
-function register(handler, element, condition) { // -@DRE
-  //var set = handler[element.uniqueID];
-  if (!handler.elements) handler.elements = {};
-  if (condition) handler.elements[element.uniqueID] = element;
-  else delete handler.elements[element.uniqueID];
-  //return !set && condition;
-  return condition;
-};
-
-addEventHandler(window, "onbeforeprint", function() {
-  if (!IE7.CSS.print) new StyleSheet("print");
-  IE7.CSS.print.recalc();
-});
-
-// -----------------------------------------------------------------------
-// pixel conversion
-// -----------------------------------------------------------------------
-
-// this is handy because it means that web developers can mix and match
-//  measurement units in their style sheets. it is not uncommon to
-//  express something like padding in "em" units whilst border thickness
-//  is most often expressed in pixels.
-
-var PIXEL = /^\d+(px)?$/i;
-var PERCENT = /^\d+%$/;
-var getPixelValue = function(element, value) {
-  if (PIXEL.test(value)) return parseInt(value);
-  var style = element.style.left;
-  var runtimeStyle = element.runtimeStyle.left;
-  element.runtimeStyle.left = element.currentStyle.left;
-  element.style.left = value || 0;
-  value = element.style.pixelLeft;
-  element.style.left = style;
-  element.runtimeStyle.left = runtimeStyle;
-  return value;
-};
-
-// -----------------------------------------------------------------------
-// generic
-// -----------------------------------------------------------------------
-
-var $IE7 = "ie7-";
-
-var Fix = Base.extend({
-  constructor: function() {
-    this.fixes = [];
-    this.recalcs = [];
-  },
-  init: Undefined
-});
-
-// a store for functions that will be called when refreshing IE7
-var recalcs = [];
-function addRecalc(recalc) {
-  recalcs.push(recalc);
-};
-
-IE7.recalc = function() {
-  IE7.HTML.recalc();
-  // re-apply style sheet rules (re-calculate ie7 classes)
-  IE7.CSS.recalc();
-  // apply global fixes to the document
-  for (var i = 0; i < recalcs.length; i++) recalcs[i]();
-};
-
-function isFixed(element) {
-  return element.currentStyle["ie7-position"] == "fixed";
-};
-
-// original style
-function getDefinedStyle(element, propertyName) {
-  return element.currentStyle[$IE7 + propertyName] || element.currentStyle[propertyName];
-};
-
-function setOverrideStyle(element, propertyName, value) {
-  if (element.currentStyle[$IE7 + propertyName] == null) {
-    element.runtimeStyle[$IE7 + propertyName] = element.currentStyle[propertyName];
-  }
-  element.runtimeStyle[propertyName] = value;
-};
-
-// create a temporary element which is used to inherit styles
-//  from the target element. the temporary element can be resized
-//  to determine pixel widths/heights
-function createTempElement(tagName) {
-  var element = document.createElement(tagName || "object");
-  element.style.cssText = "position:absolute;padding:0;display:block;border:none;clip:rect(0 0 0 0);left:-9999";
-  element.ie7_anon = true;
-  return element;
-};
-
-
-// =========================================================================
-// ie7-cssQuery.js
-// =========================================================================
-
-function cssQuery(selector, context, single) {
-  if (!_cache[selector]) {
-    reg = []; // store for RegExp objects
-    var fn = "";
-    var selectors = cssParser.escape(selector).split(",");
-    for (var i = 0; i < selectors.length; i++) {
-      _wild = _index = _list = 0; // reset
-      _duplicate = selectors.length > 1 ? 2 : 0; // reset
-      var block = cssParser.exec(selectors[i]) || "if(0){";
-      if (_wild) { // IE's pesky comment nodes
-        block += format("if(e%1.nodeName!='!'){", _index);
-      }
-      // check for duplicates before storing results
-      var store = _duplicate > 1 ? _TEST : "";
-      block += format(store + _STORE, _index);
-      // add closing braces
-      block += Array(match(block, /\{/g).length + 1).join("}");
-      fn += block;
-    }
-    eval(format(_FN, reg) + cssParser.unescape(fn) + "return s?null:r}");
-    _cache[selector] = _selectorFunction;
-  }
-  return _cache[selector](context || document, single);
-};
-
-var _MSIE5 = appVersion < 6;
-
-var _EVALUATED = /^(href|src)$/;
-var _ATTRIBUTES = {
-  "class": "className",
-  "for": "htmlFor"
-};
-
-IE7._indexed = 1;
-
-IE7._byId = function(document, id) {
-  var result = document.all[id] || null;
-  // returns a single element or a collection
-  if (!result || result.id == id) return result;
-  // document.all has returned a collection of elements with name/id
-  for (var i = 0; i < result.length; i++) {
-    if (result[i].id == id) return result[i];
-  }
-  return null;
-};
-
-IE7._getAttribute = function(element, name) {
-  if (name == "src" && element.pngSrc) return element.pngSrc;
-  
-  var attribute = _MSIE5 ? (element.attributes[name] || element.attributes[_ATTRIBUTES[name.toLowerCase()]]) : element.getAttributeNode(name);
-  if (attribute && (attribute.specified || name == "value")) {
-    if (_EVALUATED.test(name)) {
-      return element.getAttribute(name, 2);
-    } else if (name == "class") {
-     return element.className.replace(/\sie7_\w+/g, "");
-    } else if (name == "style") {
-     return element.style.cssText;
-    } else {
-     return attribute.nodeValue;
-    }
-  }
-  return null;
-};
-
-var names = "colSpan,rowSpan,vAlign,dateTime,accessKey,tabIndex,encType,maxLength,readOnly,longDesc";
-// Convert the list of strings to a hash, mapping the lowercase name to the camelCase name.
-extend(_ATTRIBUTES, combine(names.toLowerCase().split(","), names.split(",")));
-
-IE7._getNextElementSibling = function(node) {
-  // return the next element to the supplied element
-  //  nextSibling is not good enough as it might return a text or comment node
-  while (node && (node = node.nextSibling) && (node.nodeType != 1 || node.nodeName == "!")) continue;
-  return node;
-};
-
-IE7._getPreviousElementSibling = function(node) {
-  // return the previous element to the supplied element
-  while (node && (node = node.previousSibling) && (node.nodeType != 1 || node.nodeName == "!")) continue;
-  return node;
-};
-
-// =========================================================================
-// CSSParser
-// =========================================================================
-
-var IMPLIED_ASTERISK = /([\s>+~,]|[^(]\+|^)([#.:\[])/g,
-    IMPLIED_SPACE =    /(^|,)([^\s>+~])/g,
-    WHITESPACE =       /\s*([\s>+~(),]|^|$)\s*/g,
-    WILD_CARD =        /\s\*\s/g;;
-
-var CSSParser = RegGrp.extend({
-  constructor: function(items) {
-    this.base(items);
-    this.sorter = new RegGrp;
-    this.sorter.add(/:not\([^)]*\)/, RegGrp.IGNORE);
-    this.sorter.add(/([ >](\*|[\w-]+))([^: >+~]*)(:\w+-child(\([^)]+\))?)([^: >+~]*)/, "$1$3$6$4");
-  },
-  
-  ignoreCase: true,
-
-  escape: function(selector) {
-    return this.optimise(this.format(selector));
-  },
-
-  format: function(selector) {
-    return selector
-      .replace(WHITESPACE, "$1")
-      .replace(IMPLIED_SPACE, "$1 $2")
-      .replace(IMPLIED_ASTERISK, "$1*$2");
-  },
-
-  optimise: function(selector) {
-    // optimise wild card descendant selectors
-    return this.sorter.exec(selector.replace(WILD_CARD, ">* "));
-  },
-
-  unescape: function(selector) {
-    return decode(selector);
-  }
-});
-
-// some constants
-var _OPERATORS = {
-  "":   "%1!=null",
-  "=":  "%1=='%2'",
-  "~=": /(^| )%1( |$)/,
-  "|=": /^%1(-|$)/,
-  "^=": /^%1/,
-  "$=": /%1$/,
-  "*=": /%1/
-};
-
-var _PSEUDO_CLASSES = {
-  "first-child": "!IE7._getPreviousElementSibling(e%1)",
-  "link":        "e%1.currentStyle['ie7-link']=='link'",
-  "visited":     "e%1.currentStyle['ie7-link']=='visited'"
-};
-
-var _VAR = "var p%2=0,i%2,e%2,n%2=e%1.";
-var _ID = "e%1.sourceIndex";
-var _TEST = "var g=" + _ID + ";if(!p[g]){p[g]=1;";
-var _STORE = "r[r.length]=e%1;if(s)return e%1;";
-var _FN = "var _selectorFunction=function(e0,s){IE7._indexed++;var r=[],p={},reg=[%1],d=document;";
-var reg; // a store for RexExp objects
-var _index;
-var _wild; // need to flag certain _wild card selectors as MSIE includes comment nodes
-var _list; // are we processing a node _list?
-var _duplicate; // possible duplicates?
-var _cache = {}; // store parsed selectors
-
-// a hideous parser
-var cssParser = new CSSParser({
-  " (\\*|[\\w-]+)#([\\w-]+)": function(match, tagName, id) { // descendant selector followed by ID
-    _wild = false;
-    var replacement = "var e%2=IE7._byId(d,'%4');if(e%2&&";
-    if (tagName != "*") replacement += "e%2.nodeName=='%3'&&";
-    replacement += "(e%1==d||e%1.contains(e%2))){";
-    if (_list) replacement += format("i%1=n%1.length;", _list);
-    return format(replacement, _index++, _index, tagName.toUpperCase(), id);
-  },
-  
-  " (\\*|[\\w-]+)": function(match, tagName) { // descendant selector
-    _duplicate++; // this selector may produce duplicates
-    _wild = tagName == "*";
-    var replacement = _VAR;
-    // IE5.x does not support getElementsByTagName("*");
-    replacement += (_wild && _MSIE5) ? "all" : "getElementsByTagName('%3')";
-    replacement += ";for(i%2=0;(e%2=n%2[i%2]);i%2++){";
-    return format(replacement, _index++, _list = _index, tagName.toUpperCase());
-  },
-  
-  ">(\\*|[\\w-]+)": function(match, tagName) { // child selector
-    var children = _list;
-    _wild = tagName == "*";
-    var replacement = _VAR;
-    // use the children property for MSIE as it does not contain text nodes
-    //  (but the children collection still includes comments).
-    // the document object does not have a children collection
-    replacement += children ? "children": "childNodes";
-    if (!_wild && children) replacement += ".tags('%3')";
-    replacement += ";for(i%2=0;(e%2=n%2[i%2]);i%2++){";
-    if (_wild) {
-      replacement += "if(e%2.nodeType==1){";
-      _wild = _MSIE5;
-    } else {
-      if (!children) replacement += "if(e%2.nodeName=='%3'){";
-    }
-    return format(replacement, _index++, _list = _index, tagName.toUpperCase());
-  },
-  
-  "\\+(\\*|[\\w-]+)": function(match, tagName) { // direct adjacent selector
-    var replacement = "";
-    if (_wild) replacement += "if(e%1.nodeName!='!'){";
-    _wild = false;
-    replacement += "e%1=IE7._getNextElementSibling(e%1);if(e%1";
-    if (tagName != "*") replacement += "&&e%1.nodeName=='%2'";
-    replacement += "){";
-    return format(replacement, _index, tagName.toUpperCase());
-  },
-  
-  "~(\\*|[\\w-]+)": function(match, tagName) { // indirect adjacent selector
-    var replacement = "";
-    if (_wild) replacement += "if(e%1.nodeName!='!'){";
-    _wild = false;
-    _duplicate = 2; // this selector may produce duplicates
-    replacement += "while(e%1=e%1.nextSibling){if(e%1.ie7_adjacent==IE7._indexed)break;if(";
-    if (tagName == "*") {
-      replacement += "e%1.nodeType==1";
-      if (_MSIE5) replacement += "&&e%1.nodeName!='!'";
-    } else replacement += "e%1.nodeName=='%2'";
-    replacement += "){e%1.ie7_adjacent=IE7._indexed;";
-    return format(replacement, _index, tagName.toUpperCase());
-  },
-  
-  "#([\\w-]+)": function(match, id) { // ID selector
-    _wild = false;
-    var replacement = "if(e%1.id=='%2'){";
-    if (_list) replacement += format("i%1=n%1.length;", _list);
-    return format(replacement, _index, id);
-  },
-  
-  "\\.([\\w-]+)": function(match, className) { // class selector
-    _wild = false;
-    // store RegExp objects - slightly faster on IE
-    reg.push(new RegExp("(^|\\s)" + rescape(className) + "(\\s|$)"));
-    return format("if(e%1.className&&reg[%2].test(e%1.className)){", _index, reg.length - 1);
-  },
-  
-  "\\[([\\w-]+)\\s*([^=]?=)?\\s*([^\\]]*)\\]": function(match, attr, operator, value) { // attribute selectors
-    var alias = _ATTRIBUTES[attr] || attr;
-    if (operator) {
-      var getAttribute = "e%1.getAttribute('%2',2)";
-      if (!_EVALUATED.test(attr)) {
-        getAttribute = "e%1.%3||" + getAttribute;
-      }
-      attr = format("(" + getAttribute + ")", _index, attr, alias);
-    } else {
-      attr = format("IE7._getAttribute(e%1,'%2')", _index, attr);
-    }
-    var replacement = _OPERATORS[operator || ""] || "0";
-    if (replacement && replacement.source) {
-      reg.push(new RegExp(format(replacement.source, rescape(cssParser.unescape(value)))));
-      replacement = "reg[%2].test(%1)";
-      value = reg.length - 1;
-    }
-    return "if(" + format(replacement, attr, value) + "){";
-  },
-  
-  ":+([\\w-]+)(\\(([^)]+)\\))?": function(match, pseudoClass, $2, args) { // pseudo class selectors
-    pseudoClass = _PSEUDO_CLASSES[pseudoClass];
-    return "if(" + (pseudoClass ? format(pseudoClass, _index, args || "")  : "0") + "){";
-  }
-});
-
-// =========================================================================
-// ie7-css.js
-// =========================================================================
-
-var HYPERLINK = /a(#[\w-]+)?(\.[\w-]+)?:(hover|active)/i;
-var BRACE1 = /\s*\{\s*/, BRACE2 = /\s*\}\s*/, COMMA = /\s*\,\s*/;
-var FIRST_LINE_LETTER = /(.*)(:first-(line|letter))/;
-
-//var UNKNOWN = /UNKNOWN|([:.])\w+\1/i;
-
-var styleSheets = document.styleSheets;
-
-IE7.CSS = new (Fix.extend({ // single instance
-  parser: new Parser,
-  screen: "",
-  print: "",
-  styles: [],
-  rules: [],
-  pseudoClasses: appVersion < 7 ? "first\\-child" : "",
-  dynamicPseudoClasses: {
-    toString: function() {
-      var strings = [];
-      for (var pseudoClass in this) strings.push(pseudoClass);
-      return strings.join("|");
-    }
-  },
-  
-  init: function() {
-    var NONE = "^\x01$";
-    var CLASS = "\\[class=?[^\\]]*\\]";
-    var pseudoClasses = [];
-    if (this.pseudoClasses) pseudoClasses.push(this.pseudoClasses);
-    var dynamicPseudoClasses = this.dynamicPseudoClasses.toString(); 
-    if (dynamicPseudoClasses) pseudoClasses.push(dynamicPseudoClasses);
-    pseudoClasses = pseudoClasses.join("|");
-    var unknown = appVersion < 7 ? ["[>+~[(]|([:.])\\w+\\1"] : [CLASS];
-    if (pseudoClasses) unknown.push(":(" + pseudoClasses + ")");
-    this.UNKNOWN = new RegExp(unknown.join("|") || NONE, "i");
-    var complex = appVersion < 7 ? ["\\[[^\\]]+\\]|[^\\s(\\[]+\\s*[+~]"] : [CLASS];
-    var complexRule = complex.concat();
-    if (pseudoClasses) complexRule.push(":(" + pseudoClasses + ")");
-    Rule.COMPLEX = new RegExp(complexRule.join("|") || NONE, "ig");
-    if (this.pseudoClasses) complex.push(":(" + this.pseudoClasses + ")");
-    DynamicRule.COMPLEX = new RegExp(complex.join("|") || NONE, "i");
-    DynamicRule.MATCH = new RegExp(dynamicPseudoClasses ? "(.*):(" + dynamicPseudoClasses + ")(.*)" : NONE, "i");
-    
-    this.createStyleSheet();
-    this.refresh();
-  },
-  
-	addEventHandler: function() {
-		addEventHandler.apply(null, arguments);
-	},
-  
-  addFix: function(expression, replacement) {
-    this.parser.add(expression, replacement);
-  },
-  
-  addRecalc: function(propertyName, test, handler, replacement) {
-    // recalcs occur whenever the document is refreshed using document.recalc()
-    test = new RegExp("([{;\\s])" + propertyName + "\\s*:\\s*" + test + "[^;}]*");
-    var id = this.recalcs.length;
-    if (replacement) replacement = propertyName + ":" + replacement;
-    this.addFix(test, function(match, $1) {
-      return (replacement ? $1 + replacement : match) + ";ie7-" + match.slice(1) + ";ie7_recalc" + id + ":1";
-    });
-    this.recalcs.push(arguments);
-    return id;
-  },
-  
-  apply: function() {
-    this.getInlineStyles();
-    new StyleSheet("screen");
-    this.trash();
-  },
-  
-  createStyleSheet: function() {
-    // create the IE7 style sheet
-    this.styleSheet = document.createStyleSheet();
-    // flag it so we can ignore it during parsing
-    this.styleSheet.ie7 = true;
-    this.styleSheet.owningElement.ie7 = true;
-    this.styleSheet.cssText = HEADER;
-  },
-  
-  getInlineStyles: function() {
-    // load inline styles
-    var styleSheets = document.getElementsByTagName("style"), styleSheet;
-    for (var i = styleSheets.length - 1; (styleSheet = styleSheets[i]); i--) {
-      if (!styleSheet.disabled && !styleSheet.ie7) {
-        this.styles.push(styleSheet.innerHTML);
-      }
-    }
-  },
-  
-  getText: function(styleSheet, path) {
-    // explorer will trash unknown selectors (it converts them to "UNKNOWN").
-    // so we must reload external style sheets (internal style sheets can have their text
-    //  extracted through the innerHTML property).
-      // load the style sheet text from an external file
-    try {
-      var cssText = styleSheet.cssText;
-    } catch (e) {
-      cssText = "";
-    }
-    if (httpRequest) cssText = loadFile(styleSheet.href, path) || cssText;
-    return cssText;
-  },
-  
-  recalc: function() {
-    this.screen.recalc();
-    // we're going to read through all style rules.
-    //  certain rules have had ie7 properties added to them.
-    //   e.g. p{top:0; ie7_recalc2:1; left:0}
-    //  this flags a property in the rule as needing a fix.
-    //  the selector text is then used to query the document.
-    //  we can then loop through the results of the query
-    //  and fix the elements.
-    // we ignore the IE7 rules - so count them in the header
-    var RECALCS = /ie7_recalc\d+/g;
-    var start = HEADER.match(/[{,]/g).length;
-    // only calculate screen fixes. print fixes don't show up anyway
-    var stop = start + (this.screen.cssText.match(/\{/g)||"").length;
-    var rules = this.styleSheet.rules, rule;
-    var calcs, calc, elements, element, i, j, k, id;
-    // loop through all rules
-    for (i = start; i < stop; i++) {
-      rule = rules[i];
-      var cssText = rule.style.cssText;
-      // search for the "ie7_recalc" flag (there may be more than one)
-      if (rule && (calcs = cssText.match(RECALCS))) {
-        // use the selector text to query the document
-        elements = cssQuery(rule.selectorText);
-        // if there are matching elements then loop
-        //  through the recalc functions and apply them
-        //  to each element
-        if (elements.length) for (j = 0; j < calcs.length; j++) {
-          // get the matching flag (e.g. ie7_recalc3)
-          id = calcs[j];
-          // extract the numeric id from the end of the flag
-          //  and use it to index the collection of recalc
-          //  functions
-          calc = IE7.CSS.recalcs[id.slice(10)][2];
-          for (k = 0; (element = elements[k]); k++) {
-            // apply the fix
-            if (element.currentStyle[id]) calc(element, cssText);
-          }
-        }
-      }
-    }
-  },
-  
-  refresh: function() {
-    this.styleSheet.cssText = HEADER + this.screen + this.print;
-  },
-  
-  trash: function() {
-    // trash the old style sheets
-    for (var i = 0; i < styleSheets.length; i++) {
-      if (!styleSheets[i].ie7) {
-        try {
-          var cssText = styleSheets[i].cssText;
-        } catch (e) {
-          cssText = "";
-        }
-        if (cssText) styleSheets[i].cssText = "";
-      }
-    }
-  }
-}));
-
-// -----------------------------------------------------------------------
-//  IE7 StyleSheet class
-// -----------------------------------------------------------------------
-
-var StyleSheet = Base.extend({
-  constructor: function(media) {
-    this.media = media;
-    this.load();
-    IE7.CSS[media] = this;
-    IE7.CSS.refresh();
-  },
-  
-  createRule: function(selector, cssText) {
-    if (IE7.CSS.UNKNOWN.test(selector)) {
-      var match;
-      if (PseudoElement && (match = selector.match(PseudoElement.MATCH))) {
-        return new PseudoElement(match[1], match[2], cssText);
-      } else if (match = selector.match(DynamicRule.MATCH)) {
-        if (!HYPERLINK.test(match[0]) || DynamicRule.COMPLEX.test(match[0])) {
-          return new DynamicRule(selector, match[1], match[2], match[3], cssText);
-        }
-      } else return new Rule(selector, cssText);
-    }
-    return selector + " {" + cssText + "}";
-  },
-  
-  getText: function() {
-    // store for style sheet text
-    var _inlineStyles = [].concat(IE7.CSS.styles);
-    // parse media decalarations
-    var MEDIA = /@media\s+([^{]*)\{([^@]+\})\s*\}/gi;
-    var ALL = /\ball\b|^$/i, SCREEN = /\bscreen\b/i, PRINT = /\bprint\b/i;
-    function _parseMedia(cssText, media) {
-      _filterMedia.value = media;
-      return cssText.replace(MEDIA, _filterMedia);
-    };
-    function _filterMedia(match, media, cssText) {
-      media = _simpleMedia(media);
-      switch (media) {
-        case "screen":
-        case "print":
-          if (media != _filterMedia.value) return "";
-        case "all":
-          return cssText;
-      }
-      return "";
-    };
-    function _simpleMedia(media) {
-      if (ALL.test(media)) return "all";
-      else if (SCREEN.test(media)) return (PRINT.test(media)) ? "all" : "screen";
-      else if (PRINT.test(media)) return "print";
-    };
-    var self = this;
-    function _getCSSText(styleSheet, path, media, level) {
-      var cssText = "";
-      if (!level) {
-        media = _simpleMedia(styleSheet.media);
-        level = 0;
-      }
-      if (media == "all" || media == self.media) {
-        // IE only allows importing style sheets three levels deep.
-        // it will crash if you try to access a level below this
-        if (level < 3) {
-          // loop through imported style sheets
-          for (var i = 0; i < styleSheet.imports.length; i++) {
-            // call this function recursively to get all imported style sheets
-            cssText += _getCSSText(styleSheet.imports[i], getPath(styleSheet.href, path), media, level + 1);
-          }
-        }
-        // retrieve inline style or load an external style sheet
-        cssText += encode(styleSheet.href ? _loadStyleSheet(styleSheet, path) : _inlineStyles.pop() || "");
-        cssText = _parseMedia(cssText, self.media);
-      }
-      return cssText;
-    };
-    // store loaded cssText URLs
-    var fileCache = {};
-    // load an external style sheet
-    function _loadStyleSheet(styleSheet, path) {
-      var url = makePath(styleSheet.href, path);
-      // if the style sheet has already loaded then don't duplicate it
-      if (fileCache[url]) return "";
-      // load from source
-      fileCache[url] = (styleSheet.disabled) ? "" :
-        _fixUrls(IE7.CSS.getText(styleSheet, path), getPath(styleSheet.href, path));
-      return fileCache[url];
-    };
-    // fix css paths
-    // we're lumping all css text into one big style sheet so relative
-    //  paths have to be fixed. this is necessary anyway because of other
-    //  explorer bugs.
-    var URL = /(url\s*\(\s*['"]?)([\w\.]+[^:\)]*['"]?\))/gi;
-    function _fixUrls(cssText, pathname) {
-      // hack & slash
-      return cssText.replace(URL, "$1" + pathname.slice(0, pathname.lastIndexOf("/") + 1) + "$2");
-    };
-
-    // load all style sheets in the document
-    for (var i = 0; i < styleSheets.length; i++) {
-      if (!styleSheets[i].disabled && !styleSheets[i].ie7) {
-        this.cssText += _getCSSText(styleSheets[i]);
-      }
-    }
-  },
-  
-  load: function() {
-    this.cssText = "";
-    this.getText();
-    this.parse();
-    this.cssText = decode(this.cssText);
-    fileCache = {};
-  },
-  
-  parse: function() {
-    this.cssText = IE7.CSS.parser.exec(this.cssText);
-    
-    // parse the style sheet
-    var offset = IE7.CSS.rules.length;
-    var rules = this.cssText.split(BRACE2), rule;
-    var selectors, cssText, i, j;
-    for (i = 0; i < rules.length; i++) {
-      rule = rules[i].split(BRACE1);
-      selectors = rule[0].split(COMMA);
-      cssText = rule[1];
-      for (j = 0; j < selectors.length; j++) {
-        selectors[j] = cssText ? this.createRule(selectors[j], cssText) : "";
-      }
-      rules[i] = selectors.join("\n");
-    }
-    this.cssText = rules.join("\n");
-    this.rules = IE7.CSS.rules.slice(offset);
-  },
-  
-  recalc: function() {
-    var rule, i;
-    for (i = 0; (rule = this.rules[i]); i++) rule.recalc();
-  },
-  
-  toString: function() {
-    return "@media " + this.media + "{" + this.cssText + "}";
-  }
-});
-
-var PseudoElement;
-
-// -----------------------------------------------------------------------
-// IE7 style rules
-// -----------------------------------------------------------------------
-
-var Rule = IE7.Rule = Base.extend({
-  // properties
-  constructor: function(selector, cssText) {
-    this.id = IE7.CSS.rules.length;
-    this.className = Rule.PREFIX + this.id;
-    selector = selector.match(FIRST_LINE_LETTER) || selector || "*";
-    this.selector = selector[1] || selector;
-    this.selectorText = this.parse(this.selector) + (selector[2] || "");
-    this.cssText = cssText;
-    this.MATCH = new RegExp("\\s" + this.className + "(\\s|$)", "g");
-    IE7.CSS.rules.push(this);
-    this.init();
-  },
-  
-  init: Undefined,
-  
-  add: function(element) {
-    // allocate this class
-    element.className += " " + this.className;
-  },
-  
-  recalc: function() {
-    // execute the underlying css query for this class
-    var match = cssQuery(this.selector);
-    // add the class name for all matching elements
-    for (var i = 0; i < match.length; i++) this.add(match[i]);
-  },
-
-  parse: function(selector) {
-    // attempt to preserve specificity for "loose" parsing by
-    //  removing unknown tokens from a css selector but keep as
-    //  much as we can..
-    var simple = selector.replace(Rule.CHILD, " ").replace(Rule.COMPLEX, "");
-    if (appVersion < 7) simple = simple.replace(Rule.MULTI, "");
-    var tags = match(simple, Rule.TAGS).length - match(selector, Rule.TAGS).length;
-    var classes = match(simple, Rule.CLASSES).length - match(selector, Rule.CLASSES).length + 1;
-    while (classes > 0 && Rule.CLASS.test(simple)) {
-      simple = simple.replace(Rule.CLASS, "");
-      classes--;
-    }
-    while (tags > 0 && Rule.TAG.test(simple)) {
-      simple = simple.replace(Rule.TAG, "$1*");
-      tags--;
-    }
-    simple += "." + this.className;
-    classes = Math.min(classes, 2);
-    tags = Math.min(tags, 2);
-    var score = -10 * classes - tags;
-    if (score > 0) {
-      simple = simple + "," + Rule.MAP[score] + " " + simple;
-    }
-    return simple;
-  },
-  
-  remove: function(element) {
-    // deallocate this class
-    element.className = element.className.replace(this.MATCH, "$1");
-  },
-  
-  toString: function() {
-    return format("%1 {%2}", this.selectorText, this.cssText);
-  }
-}, {
-  CHILD: />/g,
-  CLASS: /\.[\w-]+/,
-  CLASSES: /[.:\[]/g,
-  MULTI: /(\.[\w-]+)+/g,
-  PREFIX: "ie7_class",
-  TAG: /^\w+|([\s>+~])\w+/,
-  TAGS: /^\w|[\s>+~]\w/g,
-  MAP: {
-    1:  "html",
-    2:  "html body",
-    10: ".ie7_html",
-    11: "html.ie7_html",
-    12: "html.ie7_html body",
-    20: ".ie7_html .ie7_body",
-    21: "html.ie7_html .ie7_body",
-    22: "html.ie7_html body.ie7_body"
-  }
-});
-
-// -----------------------------------------------------------------------
-// IE7 dynamic style
-// -----------------------------------------------------------------------
-
-// object properties:
-// attach: the element that an event handler will be attached to
-// target: the element that will have the IE7 class applied
-
-var DynamicRule = Rule.extend({
-  // properties
-  constructor: function(selector, attach, dynamicPseudoClass, target, cssText) {
-    // initialise object properties
-    this.attach = attach || "*";
-    this.dynamicPseudoClass = IE7.CSS.dynamicPseudoClasses[dynamicPseudoClass];
-    this.target = target;
-    this.base(selector, cssText);
-  },
-  
-  recalc: function() {
-    // execute the underlying css query for this class
-    var attaches = cssQuery(this.attach), attach;
-    // process results
-    for (var i = 0; attach = attaches[i]; i++) {
-      // retrieve the event handler's target element(s)
-      var target = this.target ? cssQuery(this.target, attach) : [attach];
-      // attach event handlers for dynamic pseudo-classes
-      if (target.length) this.dynamicPseudoClass.apply(attach, target, this);
-    }
-  }
-});
-
-// -----------------------------------------------------------------------
-//  IE7 dynamic pseudo-classes
-// -----------------------------------------------------------------------
-
-var DynamicPseudoClass = Base.extend({
-  constructor: function(name, apply) {
-    this.name = name;
-    this.apply = apply;
-    this.instances = {};
-    IE7.CSS.dynamicPseudoClasses[name] = this;
-  },
-  
-  register: function(instance) {
-    // an "instance" is actually an Arguments object
-    var _class = instance[2];
-    instance.id = _class.id + instance[0].uniqueID;
-    if (!this.instances[instance.id]) {
-      var target = instance[1], j;
-      for (j = 0; j < target.length; j++) _class.add(target[j]);
-      this.instances[instance.id] = instance;
-    }
-  },
-  
-  unregister: function(instance) {
-    if (this.instances[instance.id]) {
-      var _class = instance[2];
-      var target = instance[1], j;
-      for (j = 0; j < target.length; j++) _class.remove(target[j]);
-      delete this.instances[instance.id];
-    }
-  }
-});
-  
-// -----------------------------------------------------------------------
-// dynamic pseudo-classes
-// -----------------------------------------------------------------------
-
-if (appVersion < 7) {
-  var Hover = new DynamicPseudoClass("hover", function(element) {
-    var instance = arguments;
-    IE7.CSS.addEventHandler(element, appVersion < 5.5 ? "onmouseover" : "onmouseenter", function() {
-      Hover.register(instance);
-    });
-    IE7.CSS.addEventHandler(element, appVersion < 5.5 ? "onmouseout" : "onmouseleave", function() {
-      Hover.unregister(instance);
-    });
-  });
-  
-  // globally trap the mouseup event (thanks Martijn!)
-  addEventHandler(document, "onmouseup", function() {
-    var instances = Hover.instances;
-    for (var i in instances)
-      if (!instances[i][0].contains(event.srcElement))
-        Hover.unregister(instances[i]);
-  });
-}
-
-// -----------------------------------------------------------------------
-// propertyName: inherit;
-// -----------------------------------------------------------------------
-
-IE7.CSS.addRecalc("[\\w-]+", "inherit", function(element, cssText) {
-  var inherited = cssText.match(/[\w-]+\s*:\s*inherit/g);
-  for (var i = 0; i < inherited.length; i++) {
-    var propertyName = inherited[i].replace(/ie7\-|\s*:\s*inherit/g, "").replace(/\-([a-z])/g, function(match, chr) {
-      return chr.toUpperCase()
-    });
-    element.runtimeStyle[propertyName] = element.parentElement.currentStyle[propertyName];
-  }
-});
-
-// =========================================================================
-// ie7-html.js
-// =========================================================================
-
-// default font-sizes
-//HEADER += "h1{font-size:2em}h2{font-size:1.5em;}h3{font-size:1.17em;}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.67em}";
-
-IE7.HTML = new (Fix.extend({ // single instance  
-  fixed: {},
-  
-  init: Undefined,
-  
-  addFix: function() {
-    // fixes are a one-off, they are applied when the document is loaded
-    this.fixes.push(arguments);
-  },
-  
-  apply: function() {
-    for (var i = 0; i < this.fixes.length; i++) {
-      var match = cssQuery(this.fixes[i][0]);
-      var fix = this.fixes[i][1];
-      for (var j = 0; j < match.length; j++) fix(match[j]);
-    }
-  },
-  
-  addRecalc: function() {
-    // recalcs occur whenever the document is refreshed using document.recalc()
-    this.recalcs.push(arguments);
-  },
-  
-  recalc: function() {
-    // loop through the fixes
-    for (var i = 0; i < this.recalcs.length; i++) {
-      var match = cssQuery(this.recalcs[i][0]);
-      var recalc = this.recalcs[i][1], element;
-      var key = Math.pow(2, i);
-      for (var j = 0; (element = match[j]); j++) {
-        var uniqueID = element.uniqueID;
-        if ((this.fixed[uniqueID] & key) == 0) {
-          element = recalc(element) || element;
-          this.fixed[uniqueID] |= key;
-        }
-      }
-    }
-  }
-}));
-
-if (appVersion < 7) {  
-  // provide support for the <abbr> tag.
-  //  this is a proper fix, it preserves the DOM structure and
-  //  <abbr> elements report the correct tagName & namespace prefix
-  document.createElement("abbr");
-  
-  // bind to the first child control
-  IE7.HTML.addRecalc("label", function(label) {
-    if (!label.htmlFor) {
-      var firstChildControl = cssQuery("input,textarea", label, true);
-      if (firstChildControl) {
-        addEventHandler(label, "onclick", function() {
-          firstChildControl.click();
-        });
-      }
-    }
-  });
-}
-
-// =========================================================================
-// ie7-layout.js
-// =========================================================================
-
-var NUMERIC = "[.\\d]";
-
-new function(_) {
-var layout = IE7.Layout = this;
-
-  // big, ugly box-model hack + min/max stuff
-  
-  // #tantek > #erik > #dean { voice-family: hacker; }
-  
-  // -----------------------------------------------------------------------
-  // "layout"
-  // -----------------------------------------------------------------------
-  
-  HEADER += "*{boxSizing:content-box}";
-  
-  // does an element have "layout" ?
-  IE7.hasLayout = appVersion < 5.5 ? function(element) {
-    // element.currentStyle.hasLayout doesn't work for IE5.0
-    return element.clientWidth;
-  } : function(element) {
-    return element.currentStyle.hasLayout;
-  };
-  
-  // give an element "layout"
-  layout.boxSizing = function(element) {
-    if (!IE7.hasLayout(element)) {
-    //#  element.runtimeStyle.fixedHeight =
-      element.style.height = "0cm";
-      if (element.currentStyle.verticalAlign == "auto")
-        element.runtimeStyle.verticalAlign = "top";
-      // when an element acquires "layout", margins no longer collapse correctly
-      collapseMargins(element);
-    }
-  };
-  
-  // -----------------------------------------------------------------------
-  // Margin Collapse
-  // -----------------------------------------------------------------------
-  
-  function collapseMargins(element) {
-    if (element != viewport && element.currentStyle.position != "absolute") {
-      collapseMargin(element, "marginTop");
-      collapseMargin(element, "marginBottom");
-    }
-  };
-  
-  function collapseMargin(element, type) {
-    if (!element.runtimeStyle[type]) {
-      var parentElement = element.parentElement;
-      if (parentElement && IE7.hasLayout(parentElement) && !IE7[type == "marginTop" ? "_getPreviousElementSibling" : "_getNextElementSibling"](element)) return;
-      var child = cssQuery(">*:" + (type == "marginTop" ? "first" : "last") + "-child", element, true);
-      if (child && child.currentStyle.styleFloat == "none" && IE7.hasLayout(child)) {
-        collapseMargin(child, type);
-        margin = _getMargin(element, element.currentStyle[type]);
-        childMargin = _getMargin(child, child.currentStyle[type]);
-        if (margin < 0 || childMargin < 0) {
-          element.runtimeStyle[type] = margin + childMargin;
-        } else {
-          element.runtimeStyle[type] = Math.max(childMargin, margin);
-        }
-        child.runtimeStyle[type] = "0px";
-      }
-    }
-  };
-  
-  function _getMargin(element, value) {
-    return value == "auto" ? 0 : getPixelValue(element, value);
-  };
-  
-  // -----------------------------------------------------------------------
-  // box-model
-  // -----------------------------------------------------------------------
-  
-  // constants
-  var UNIT = /^[.\d][\w%]*$/, AUTO = /^(auto|0cm)$/;
-  
-  var applyWidth, applyHeight;
-  IE7.Layout.borderBox = function(element){
-    applyWidth(element);
-    applyHeight(element);
-  };
-  
-  var fixWidth = function(HEIGHT) {
-    applyWidth = function(element) {
-      if (!PERCENT.test(element.currentStyle.width)) fixWidth(element);
-      collapseMargins(element);
-    };
-  
-    function fixWidth(element, value) {
-      if (!element.runtimeStyle.fixedWidth) {
-        if (!value) value = element.currentStyle.width;
-        element.runtimeStyle.fixedWidth = (UNIT.test(value)) ? Math.max(0, getFixedWidth(element, value)) : value;
-        setOverrideStyle(element, "width", element.runtimeStyle.fixedWidth);
-      }
-    };
-  
-    function layoutWidth(element) {
-      if (!isFixed(element)) {
-        var layoutParent = element.offsetParent;
-        while (layoutParent && !IE7.hasLayout(layoutParent)) layoutParent = layoutParent.offsetParent;
-      }
-      return (layoutParent || viewport).clientWidth;
-    };
-  
-    function getPixelWidth(element, value) {
-      if (PERCENT.test(value)) return parseInt(parseFloat(value) / 100 * layoutWidth(element));
-      return getPixelValue(element, value);
-    };
-  
-    var getFixedWidth = function(element, value) {
-      var borderBox = element.currentStyle["box-sizing"] == "border-box";
-      var adjustment = 0;
-      if (quirksMode && !borderBox)
-        adjustment += getBorderWidth(element) + getWidth(element, "padding");
-      else if (!quirksMode && borderBox)
-        adjustment -= getBorderWidth(element) + getWidth(element, "padding");
-      return getPixelWidth(element, value) + adjustment;
-    };
-  
-    // easy way to get border thickness for elements with "layout"
-    function getBorderWidth(element) {
-      return element.offsetWidth - element.clientWidth;
-    };
-  
-    // have to do some pixel conversion to get padding/margin thickness :-(
-    function getWidth(element, type) {
-      return getPixelWidth(element, element.currentStyle[type + "Left"]) + getPixelWidth(element, element.currentStyle[type + "Right"]);
-    };
-  
-    // -----------------------------------------------------------------------
-    // min/max
-    // -----------------------------------------------------------------------
-  
-    HEADER += "*{minWidth:none;maxWidth:none;min-width:none;max-width:none}";
-  
-    // handle min-width property
-    layout.minWidth = function(element) {
-      // IE6 supports min-height so we frig it here
-      //#if (element.currentStyle.minHeight == "auto") element.runtimeStyle.minHeight = 0;
-      if (element.currentStyle["min-width"] != null) {
-        element.style.minWidth = element.currentStyle["min-width"];
-      }
-      if (register(arguments.callee, element, element.currentStyle.minWidth != "none")) {
-        layout.boxSizing(element);
-        fixWidth(element);
-        resizeWidth(element);
-      }
-    };
-    
-    // clone the minWidth function to make a maxWidth function
-    eval("IE7.Layout.maxWidth=" + String(layout.minWidth).replace(/min/g, "max"));
-    
-    // apply min/max restrictions
-    function resizeWidth(element) {
-      // check boundaries
-      var rect = element.getBoundingClientRect();
-      var width = rect.right - rect.left;
-  
-      if (element.currentStyle.minWidth != "none" && width <= getFixedWidth(element, element.currentStyle.minWidth)) {
-        element.runtimeStyle.width = element.currentStyle.minWidth;
-      } else if (element.currentStyle.maxWidth != "none" && width >= getFixedWidth(element, element.currentStyle.maxWidth)) {
-        element.runtimeStyle.width = element.currentStyle.maxWidth;
-      } else {
-        element.runtimeStyle.width = element.runtimeStyle.fixedWidth; // || "auto";
-      }
-    };
-  
-    // -----------------------------------------------------------------------
-    // right/bottom
-    // -----------------------------------------------------------------------
-  
-    function fixRight(element) {
-      if (register(fixRight, element, /^(fixed|absolute)$/.test(element.currentStyle.position) &&
-        getDefinedStyle(element, "left") != "auto" &&
-        getDefinedStyle(element, "right") != "auto" &&
-        AUTO.test(getDefinedStyle(element, "width")))) {
-          resizeRight(element);
-          IE7.Layout.boxSizing(element);
-      }
-    };
-    IE7.Layout.fixRight = fixRight;
-  
-    function resizeRight(element) {
-      var left = getPixelWidth(element, element.runtimeStyle._left || element.currentStyle.left);
-      var width = layoutWidth(element) - getPixelWidth(element, element.currentStyle.right) -  left - getWidth(element, "margin");
-      if (parseInt(element.runtimeStyle.width) == width) return;
-      element.runtimeStyle.width = "";
-      if (isFixed(element) || HEIGHT || element.offsetWidth < width) {
-        if (!quirksMode) width -= getBorderWidth(element) + getWidth(element, "padding");
-        if (width < 0) width = 0;
-        element.runtimeStyle.fixedWidth = width;
-        setOverrideStyle(element, "width", width);
-      }
-    };
-  
-  // -----------------------------------------------------------------------
-  // window.onresize
-  // -----------------------------------------------------------------------
-  
-    // handle window resize
-    var clientWidth = 0;
-    addResize(function() {
-      if (!viewport) return;
-      var i, wider = (clientWidth < viewport.clientWidth);
-      clientWidth = viewport.clientWidth;
-      // resize elements with "min-width" set
-      var elements = layout.minWidth.elements;
-      for (i in elements) {
-        var element = elements[i];
-        var fixedWidth = (parseInt(element.runtimeStyle.width) == getFixedWidth(element, element.currentStyle.minWidth));
-        if (wider && fixedWidth) element.runtimeStyle.width = "";
-        if (wider == fixedWidth) resizeWidth(element);
-      }
-      // resize elements with "max-width" set
-      var elements = layout.maxWidth.elements;
-      for (i in elements) {
-        var element = elements[i];
-        var fixedWidth = (parseInt(element.runtimeStyle.width) == getFixedWidth(element, element.currentStyle.maxWidth));
-        if (!wider && fixedWidth) element.runtimeStyle.width = "";
-        if (wider != fixedWidth) resizeWidth(element);
-      }
-      // resize elements with "right" set
-      for (i in fixRight.elements) resizeRight(fixRight.elements[i]);
-    });
-  
-  // -----------------------------------------------------------------------
-  // fix CSS
-  // -----------------------------------------------------------------------
-    if (quirksMode) {
-      IE7.CSS.addRecalc("width", NUMERIC, applyWidth);
-    }
-    if (appVersion < 7) {
-      IE7.CSS.addRecalc("min-width", NUMERIC, layout.minWidth);
-      IE7.CSS.addRecalc("max-width", NUMERIC, layout.maxWidth);
-      IE7.CSS.addRecalc("right", NUMERIC, fixRight);
-    }
-  };
-  
-  eval("var fixHeight=" + rotate(fixWidth));
-  
-  // apply box-model + min/max fixes
-  fixWidth();
-  fixHeight(true);
-};
-
-// =========================================================================
-// ie7-graphics.js
-// =========================================================================
-
-// a small transparent image used as a placeholder
-var BLANK_GIF = makePath("blank.gif", path);
-
-var ALPHA_IMAGE_LOADER = "DXImageTransform.Microsoft.AlphaImageLoader";
-var PNG_FILTER = "progid:" + ALPHA_IMAGE_LOADER + "(src='%1',sizingMethod='%2')";
-  
-// regular expression version of the above
-var PNG;
-
-var filtered = [];
-
-function fixImage(element) {
-  if (PNG.test(element.src)) {
-    // we have to preserve width and height
-    var image = new Image(element.width, element.height);
-    image.onload = function() {
-      element.width = image.width;
-      element.height = image.height;
-      image = null;
-    };
-    image.src = element.src;
-    // store the original url (we'll put it back when it's printed)
-    element.pngSrc = element.src;
-    // add the AlphaImageLoader thingy
-    addFilter(element);
-  }
-};
-
-if (appVersion >= 5.5 && appVersion < 7) {
-  // ** IE7 VARIABLE
-  // e.g. only apply the hack to files ending in ".png"
-  // IE7_PNG_SUFFIX = ".png";
-
-  // replace background(-image): url(..) ..  with background(-image): .. ;filter: ..;
-  IE7.CSS.addFix(/background(-image)?\s*:\s*([^};]*)?url\(([^\)]+)\)([^;}]*)?/, function(match, $1, $2, url, $4) {
-    url = getString(url);
-    return PNG.test(url) ? "filter:" + format(PNG_FILTER, url, "crop") +
-      ";zoom:1;background" + ($1||"") + ":" + ($2||"") + "none" + ($4||"") : match;
-  });
-  
-  // -----------------------------------------------------------------------
-  //  fix PNG transparency (HTML images)
-  // -----------------------------------------------------------------------
-
-  IE7.HTML.addRecalc("img,input", function(element) {
-    if (element.tagName == "INPUT" && element.type != "image") return;
-    fixImage(element);
-    addEventHandler(element, "onpropertychange", function() {
-      if (!printing && event.propertyName == "src" &&
-        element.src.indexOf(BLANK_GIF) == -1) fixImage(element);
-    });
-  });
-
-  // assume that background images should not be printed
-  //  (if they are not transparent then they'll just obscure content)
-  // but we'll put foreground images back...
-  var printing = false;
-  addEventHandler(window, "onbeforeprint", function() {
-    printing = true;
-    for (var i = 0; i < filtered.length; i++) removeFilter(filtered[i]);
-  });
-  addEventHandler(window, "onafterprint", function() {
-    for (var i = 0; i < filtered.length; i++) addFilter(filtered[i]);
-    printing = false;
-  });
-}
-
-// apply a filter
-function addFilter(element, sizingMethod) {
-  var filter = element.filters[ALPHA_IMAGE_LOADER];
-  if (filter) {
-    filter.src = element.src;
-    filter.enabled = true;
-  } else {
-    element.runtimeStyle.filter = format(PNG_FILTER, element.src, sizingMethod || "scale");
-    filtered.push(element);
-  }
-  // remove the real image
-  element.src = BLANK_GIF;
-};
-
-function removeFilter(element) {
-  element.src = element.pngSrc;
-  element.filters[ALPHA_IMAGE_LOADER].enabled = false;
-};
-
-// =========================================================================
-// ie7-fixed.js
-// =========================================================================
-
-new function(_) {
-  if (appVersion >= 7) return;
-  
-  // some things to consider for this hack.
-  // the document body requires a fixed background. even if
-  //  it is just a blank image.
-  // you have to use setExpression instead of onscroll, this
-  //  together with a fixed body background helps avoid the
-  //  annoying screen flicker of other solutions.
-  
-  IE7.CSS.addRecalc("position", "fixed", _positionFixed, "absolute");
-  IE7.CSS.addRecalc("background(-attachment)?", "[^};]*fixed", _backgroundFixed);
-  
-  // scrolling is relative to the documentElement (HTML tag) when in
-  //  standards mode, otherwise it's relative to the document body
-  var $viewport = quirksMode ? "body" : "documentElement";
-  
-  function _fixBackground() {
-    // this is required by both position:fixed and background-attachment:fixed.
-    // it is necessary for the document to also have a fixed background image.
-    // we can fake this with a blank image if necessary
-    if (body.currentStyle.backgroundAttachment != "fixed") {
-      if (body.currentStyle.backgroundImage == "none") {
-        body.runtimeStyle.backgroundRepeat = "no-repeat";
-        body.runtimeStyle.backgroundImage = "url(" + BLANK_GIF + ")"; // dummy
-      }
-      body.runtimeStyle.backgroundAttachment = "fixed";
-    }
-    _fixBackground = Undefined;
-  };
-  
-  var _tmp = createTempElement("img");
-  
-  function _isFixed(element) {
-    return element ? isFixed(element) || _isFixed(element.parentElement) : false;
-  };
-  
-  function _setExpression(element, propertyName, expression) {
-    setTimeout("document.all." + element.uniqueID + ".runtimeStyle.setExpression('" + propertyName + "','" + expression + "')", 0);
-  };
-  
-  // -----------------------------------------------------------------------
-  //  backgroundAttachment: fixed
-  // -----------------------------------------------------------------------
-  
-  function _backgroundFixed(element) {
-    if (register(_backgroundFixed, element, element.currentStyle.backgroundAttachment == "fixed" && !element.contains(body))) {
-      _fixBackground();
-      bgLeft(element);
-      bgTop(element);
-      _backgroundPosition(element);
-    }
-  };
-  
-  function _backgroundPosition(element) {
-    _tmp.src = element.currentStyle.backgroundImage.slice(5, -2);
-    var parentElement = element.canHaveChildren ? element : element.parentElement;
-    parentElement.appendChild(_tmp);
-    setOffsetLeft(element);
-    setOffsetTop(element);
-    parentElement.removeChild(_tmp);
-  };
-  
-  function bgLeft(element) {
-    element.style.backgroundPositionX = element.currentStyle.backgroundPositionX;
-    if (!_isFixed(element)) {
-      _setExpression(element, "backgroundPositionX", "(parseInt(runtimeStyle.offsetLeft)+document." + $viewport + ".scrollLeft)||0");
-    }
-  };
-  eval(rotate(bgLeft));
-  
-  function setOffsetLeft(element) {
-    var propertyName = _isFixed(element) ? "backgroundPositionX" : "offsetLeft";
-    element.runtimeStyle[propertyName] =
-      getOffsetLeft(element, element.style.backgroundPositionX) -
-      element.getBoundingClientRect().left - element.clientLeft + 2;
-  };
-  eval(rotate(setOffsetLeft));
-  
-  function getOffsetLeft(element, position) {
-    switch (position) {
-      case "left":
-      case "top":
-        return 0;
-      case "right":
-      case "bottom":
-        return viewport.clientWidth - _tmp.offsetWidth;
-      case "center":
-        return (viewport.clientWidth - _tmp.offsetWidth) / 2;
-      default:
-        if (PERCENT.test(position)) {
-          return parseInt((viewport.clientWidth - _tmp.offsetWidth) * parseFloat(position) / 100);
-        }
-        _tmp.style.left = position;
-        return _tmp.offsetLeft;
-    }
-  };
-  eval(rotate(getOffsetLeft));
-  
-  // -----------------------------------------------------------------------
-  //  position: fixed
-  // -----------------------------------------------------------------------
-  
-  function _positionFixed(element) {
-    if (register(_positionFixed, element, isFixed(element))) {
-      setOverrideStyle(element, "position",  "absolute");
-      setOverrideStyle(element, "left",  element.currentStyle.left);
-      setOverrideStyle(element, "top",  element.currentStyle.top);
-      _fixBackground();
-      IE7.Layout.fixRight(element);
-      _foregroundPosition(element);
-    }
-  };
-  
-  function _foregroundPosition(element, recalc) {
-    positionTop(element, recalc);
-    positionLeft(element, recalc, true);
-    if (!element.runtimeStyle.autoLeft && element.currentStyle.marginLeft == "auto" &&
-      element.currentStyle.right != "auto") {
-      var left = viewport.clientWidth - getPixelWidth(element, element.currentStyle.right) -
-        getPixelWidth(element, element.runtimeStyle._left) - element.clientWidth;
-      if (element.currentStyle.marginRight == "auto") left = parseInt(left / 2);
-      if (_isFixed(element.offsetParent)) element.runtimeStyle.pixelLeft += left;
-      else element.runtimeStyle.shiftLeft = left;
-    }
-    clipWidth(element);
-    clipHeight(element);
-  };
-
-  function clipWidth(element) {
-    var fixWidth = element.runtimeStyle.fixWidth;
-    element.runtimeStyle.borderRightWidth = "";
-    element.runtimeStyle.width = fixWidth ? getPixelWidth(element, fixWidth) : "";
-    if (element.currentStyle.width != "auto") {
-      var rect = element.getBoundingClientRect();
-      var width = element.offsetWidth - viewport.clientWidth + rect.left - 2;
-      if (width >= 0) {
-        element.runtimeStyle.borderRightWidth = "0px";
-        width = Math.max(getPixelValue(element, element.currentStyle.width) - width, 0);
-        setOverrideStyle(element, "width",  width);
-        return width;
-      }
-    }
-  };
-  eval(rotate(clipWidth));
-  
-  function positionLeft(element, recalc) {
-    // if the element's width is in % units then it must be recalculated
-    //  with respect to the viewport
-    if (!recalc && PERCENT.test(element.currentStyle.width)) {
-      element.runtimeStyle.fixWidth = element.currentStyle.width;
-    }
-    if (element.runtimeStyle.fixWidth) {
-      element.runtimeStyle.width = getPixelWidth(element, element.runtimeStyle.fixWidth);
-    }
-    //if (recalc) {
-    //  // if the element is fixed on the right then no need to recalculate
-    //  if (!element.runtimeStyle.autoLeft) return;
-    //} else {
-      element.runtimeStyle.shiftLeft = 0;
-      element.runtimeStyle._left = element.currentStyle.left;
-      // is the element fixed on the right?
-      element.runtimeStyle.autoLeft = element.currentStyle.right != "auto" &&
-        element.currentStyle.left == "auto";
-    //}
-    // reset the element's "left" value and get it's natural position
-    element.runtimeStyle.left = "";
-    element.runtimeStyle.screenLeft = getScreenLeft(element);
-    element.runtimeStyle.pixelLeft = element.runtimeStyle.screenLeft;
-    // if the element is contained by another fixed element then there is no need to
-    //  continually recalculate it's left position
-    if (!recalc && !_isFixed(element.offsetParent)) {
-      // onsrcoll produces jerky movement, so we use an expression
-      _setExpression(element, "pixelLeft", "runtimeStyle.screenLeft+runtimeStyle.shiftLeft+document." + $viewport + ".scrollLeft");
-    }
-  };
-  // clone this function so we can do "top"
-  eval(rotate(positionLeft));
-  
-  // I've forgotten how this works...
-  function getScreenLeft(element) { // thanks to kevin newman (captainn)
-    var screenLeft = element.offsetLeft, nested = 1;
-    if (element.runtimeStyle.autoLeft) {
-      screenLeft = viewport.clientWidth - element.offsetWidth - getPixelWidth(element, element.currentStyle.right);
-    }
-    // accommodate margins
-    if (element.currentStyle.marginLeft != "auto") {
-      screenLeft -= getPixelWidth(element, element.currentStyle.marginLeft);
-    }
-    while (element = element.offsetParent) {
-      if (element.currentStyle.position != "static") nested = -1;
-      screenLeft += element.offsetLeft * nested;
-    }
-    return screenLeft;
-  };
-  eval(rotate(getScreenLeft));
-  
-  function getPixelWidth(element, value) {
-    return PERCENT.test(value) ? parseInt(parseFloat(value) / 100 * viewport.clientWidth) : getPixelValue(element, value);
-  };
-  eval(rotate(getPixelWidth));
-  
-  // -----------------------------------------------------------------------
-  //  capture window resize
-  // -----------------------------------------------------------------------
-  
-  function _resize() {
-    // if the window has been resized then some positions need to be
-    //  recalculated (especially those aligned to "right" or "top"
-    var elements = _backgroundFixed.elements;
-    for (var i in elements) _backgroundPosition(elements[i]);
-    elements = _positionFixed.elements;
-    for (i in elements) {
-      _foregroundPosition(elements[i], true);
-      // do this twice to be sure - hackish, I know :-)
-      _foregroundPosition(elements[i], true);
-    }
-    _timer = 0;
-  };
-  
-  // use a timer for some reason.
-  //  (sometimes this is a good way to prevent resize loops)
-  var _timer;
-  addResize(function() {
-    if (!_timer) _timer = setTimeout(_resize, 0);
-  });
-};
-
-// =========================================================================
-// ie7-oveflow.js
-// =========================================================================
-
-/* ---------------------------------------------------------------------
-
-  This module alters the structure of the document.
-  It may adversely affect other CSS rules. Be warned.
-
---------------------------------------------------------------------- */
-
-var WRAPPER_STYLE = {
-  backgroundColor: "transparent",
-  backgroundImage: "none",
-  backgroundPositionX: null,
-  backgroundPositionY: null,
-  backgroundRepeat: null,
-  borderTopWidth: 0,
-  borderRightWidth: 0,
-  borderBottomWidth: 0,
-  borderLeftStyle: "none",
-  borderTopStyle: "none",
-  borderRightStyle: "none",
-  borderBottomStyle: "none",
-  borderLeftWidth: 0,
-  height: null,
-  marginTop: 0,
-  marginBottom: 0,
-  marginRight: 0,
-  marginLeft: 0,
-  width: "100%"
-};
-
-IE7.CSS.addRecalc("overflow", "visible", function(element) {
-  // don't do this again
-  if (element.parentNode.ie7_wrapped) return;
-
-  // if max-height is applied, makes sure it gets applied first
-  if (IE7.Layout && element.currentStyle["max-height"] != "auto") {
-    IE7.Layout.maxHeight(element);
-  }
-
-  if (element.currentStyle.marginLeft == "auto") element.style.marginLeft = 0;
-  if (element.currentStyle.marginRight == "auto") element.style.marginRight = 0;
-
-  var wrapper = document.createElement(ANON);
-  wrapper.ie7_wrapped = element;
-  for (var propertyName in WRAPPER_STYLE) {
-    wrapper.style[propertyName] = element.currentStyle[propertyName];
-    if (WRAPPER_STYLE[propertyName] != null) {
-      element.runtimeStyle[propertyName] = WRAPPER_STYLE[propertyName];
-    }
-  }
-  wrapper.style.display = "block";
-  wrapper.style.position = "relative";
-  element.runtimeStyle.position = "absolute";
-  element.parentNode.insertBefore(wrapper, element);
-  wrapper.appendChild(element);
-});
-
-// =========================================================================
-// ie7-quirks.js
-// =========================================================================
-
-function ie7Quirks() {
-  var FONT_SIZES = "xx-small,x-small,small,medium,large,x-large,xx-large".split(",");
-  for (var i = 0; i < FONT_SIZES.length; i++) {
-    FONT_SIZES[FONT_SIZES[i]] = FONT_SIZES[i - 1] || "0.67em";
-  }
-  
-  IE7.CSS.addFix(/(font(-size)?\s*:\s*)([\w.-]+)/, function(match, label, size, value) {
-    return label + (FONT_SIZES[value] || value);
-  });
-  
-  if (appVersion < 6) {
-    var NEGATIVE = /^\-/, LENGTH = /(em|ex)$/i;
-    var EM = /em$/i, EX = /ex$/i;
-  
-    getPixelValue = function(element, value) {
-      if (PIXEL.test(value)) return parseInt(value)||0;
-      var scale = NEGATIVE.test(value)? -1 : 1;
-      if (LENGTH.test(value)) scale *= getFontScale(element);
-      temp.style.width = (scale < 0) ? value.slice(1) : value;
-      body.appendChild(temp);
-      // retrieve pixel width
-      value = scale * temp.offsetWidth;
-      // remove the temporary element
-      temp.removeNode();
-      return parseInt(value);
-    };
-
-    var temp = createTempElement();
-    function getFontScale(element) {
-      var scale = 1;
-      temp.style.fontFamily = element.currentStyle.fontFamily;
-      temp.style.lineHeight = element.currentStyle.lineHeight;
-      //temp.style.fontSize = "";
-      while (element != body) {
-        var fontSize = element.currentStyle["ie7-font-size"];
-        if (fontSize) {
-          if (EM.test(fontSize)) scale *= parseFloat(fontSize);
-          else if (PERCENT.test(fontSize)) scale *= (parseFloat(fontSize) / 100);
-          else if (EX.test(fontSize)) scale *= (parseFloat(fontSize) / 2);
-          else {
-            temp.style.fontSize = fontSize;
-            return 1;
-          }
-        }
-        element = element.parentElement;
-      }
-      return scale;
-    };
-
-    // cursor:pointer (IE5.x)
-    IE7.CSS.addFix(/cursor\s*:\s*pointer/, "cursor:hand");
-    // display:list-item (IE5.x)
-    IE7.CSS.addFix(/display\s*:\s*list-item/, "display:block");
-  }
-  
-  // -----------------------------------------------------------------------
-  //  margin:auto
-  // -----------------------------------------------------------------------
-  
-  function fixMargin(element) {
-    if (appVersion < 5.5) IE7.Layout.boxSizing(element.parentElement);
-    var parent = element.parentElement;
-    var margin = parent.offsetWidth - element.offsetWidth - getPaddingWidth(parent);
-    var autoRight = (element.currentStyle["ie7-margin"] && element.currentStyle.marginRight == "auto") ||
-      element.currentStyle["ie7-margin-right"] == "auto";
-    switch (parent.currentStyle.textAlign) {
-      case "right":
-        margin = autoRight ? parseInt(margin / 2) : 0;
-        element.runtimeStyle.marginRight = margin + "px";
-        break;
-      case "center":
-        if (autoRight) margin = 0;
-      default:
-        if (autoRight) margin /= 2;
-        element.runtimeStyle.marginLeft = parseInt(margin) + "px";
-    }
-  };
-
-  function getPaddingWidth(element) {
-    return getPixelValue(element, element.currentStyle.paddingLeft) +
-      getPixelValue(element, element.currentStyle.paddingRight);
-  };
-  
-  IE7.CSS.addRecalc("margin(-left|-right)?", "[^};]*auto", function(element) {
-    if (register(fixMargin, element,
-      element.parentElement &&
-      element.currentStyle.display == "block" &&
-      element.currentStyle.marginLeft == "auto" &&
-      element.currentStyle.position != "absolute")) {
-        fixMargin(element);
-    }
-  });
-  
-  addResize(function() {
-    for (var i in fixMargin.elements) {
-      var element = fixMargin.elements[i];
-      element.runtimeStyle.marginLeft =
-      element.runtimeStyle.marginRight = "";
-      fixMargin(element);
-    }
-  });
-};
-
-
-// =========================================================================
-// ie8-cssQuery.js
-// =========================================================================
-
-IE7._isEmpty = function(element) {
-  element = element.firstChild;
-  while (element) {
-    if (element.nodeType == 3 || (element.nodeType == 1 && element.nodeName != "!")) return false;
-    element = element.nextSibling;
-  }
-  return true;
-};
-
-IE7._isLang = function(element, code) {
-  while (element && !element.getAttribute("lang")) element = element.parentNode;
-  return element && new RegExp("^" + rescape(code), "i").test(element.getAttribute("lang"));
-};
-
-function _nthChild(match, args, position, last) {
-  // ugly but it works...
-  last = /last/i.test(match) ? last + "+1-" : "";
-  if (!isNaN(args)) args = "0n+" + args;
-  else if (args == "even") args = "2n";
-  else if (args == "odd") args = "2n+1";
-  args = args.split("n");
-  var a = args[0] ? (args[0] == "-") ? -1 : parseInt(args[0]) : 1;
-  var b = parseInt(args[1]) || 0;
-  var negate = a < 0;
-  if (negate) {
-    a = -a;
-    if (a == 1) b++;
-  }
-  var query = format(a == 0 ? "%3%7" + (last + b) : "(%4%3-%2)%6%1%70%5%4%3>=%2", a, b, position, last, "&&", "%", "==");
-  if (negate) query = "!(" + query + ")";
-  return query;
-};
-
-_PSEUDO_CLASSES = {
-  "link":          "e%1.currentStyle['ie7-link']=='link'",
-  "visited":       "e%1.currentStyle['ie7-link']=='visited'",
-  "checked":       "e%1.checked",
-  "contains":      "e%1.innerText.indexOf('%2')!=-1",
-  "disabled":      "e%1.isDisabled",
-  "empty":         "IE7._isEmpty(e%1)",
-  "enabled":       "e%1.disabled===false",
-  "first-child":   "!IE7._getPreviousElementSibling(e%1)",
-  "lang":          "IE7._isLang(e%1,'%2')",
-  "last-child":    "!IE7._getNextElementSibling(e%1)",
-  "only-child":    "!IE7._getPreviousElementSibling(e%1)&&!IE7._getNextElementSibling(e%1)",
-  "target":        "e%1.id==location.hash.slice(1)",
-  "indeterminate": "e%1.indeterminate"
-};
-
-
-// register a node and index its children
-IE7._register = function(element) {
-  if (element.rows) {
-    element.ie7_length = element.rows.length;
-    element.ie7_lookup = "rowIndex";
-  } else if (element.cells) {
-    element.ie7_length = element.cells.length;
-    element.ie7_lookup = "cellIndex";
-  } else if (element.ie7_indexed != IE7._indexed) {
-    var index = 0;
-    var child = element.firstChild;
-    while (child) {
-      if (child.nodeType == 1 && child.nodeName != "!") {
-        child.ie7_index = ++index;
-      }
-      child = child.nextSibling;
-    }
-    element.ie7_length = index;
-    element.ie7_lookup = "ie7_index";
-  }
-  element.ie7_indexed = IE7._indexed;
-  return element;
-};
-
-var keys = cssParser[_KEYS];
-var pseudoClass = keys[keys.length - 1];
-keys.length--;
-
-cssParser.merge({
-  ":not\\((\\*|[\\w-]+)?([^)]*)\\)": function(match, tagName, filters) { // :not pseudo class
-    var replacement = (tagName && tagName != "*") ? format("if(e%1.nodeName=='%2'){", _index, tagName.toUpperCase()) : "";
-    replacement += cssParser.exec(filters);
-    return "if(!" + replacement.slice(2, -1).replace(/\)\{if\(/g, "&&") + "){";
-  },
-  
-  ":nth(-last)?-child\\(([^)]+)\\)": function(match, last, args) { // :nth-child pseudo classes
-    _wild = false;
-    last = format("e%1.parentNode.ie7_length", _index);
-    var replacement = "if(p%1!==e%1.parentNode)p%1=IE7._register(e%1.parentNode);";
-    replacement += "var i=e%1[p%1.ie7_lookup];if(p%1.ie7_lookup!='ie7_index')i++;if(";
-    return format(replacement, _index) + _nthChild(match, args, "i", last) + "){";
-  }
-});
-
-keys.push(pseudoClass);
-
-// =========================================================================
-// ie8-css.js
-// =========================================================================
-
-var BRACKETS = "\\([^)]*\\)";
-
-if (IE7.CSS.pseudoClasses) IE7.CSS.pseudoClasses += "|";
-IE7.CSS.pseudoClasses += "before|after|last\\-child|only\\-child|empty|root|" +
-  "not|nth\\-child|nth\\-last\\-child|contains|lang".split("|").join(BRACKETS + "|") + BRACKETS;
-
-// pseudo-elements can be declared with a double colon
-encoder.add(/::/, ":");
-
-// -----------------------------------------------------------------------
-// dynamic pseudo-classes
-// -----------------------------------------------------------------------
-
-var Focus = new DynamicPseudoClass("focus", function(element) {
-  var instance = arguments;
-  
-  IE7.CSS.addEventHandler(element, "onfocus", function() {
-    Focus.unregister(instance); // in case it starts with focus
-    Focus.register(instance);
-  });
-  
-  IE7.CSS.addEventHandler(element, "onblur", function() {
-    Focus.unregister(instance);
-  });
-  
-  // check the active element for initial state
-  if (element == document.activeElement) {
-    Focus.register(instance)
-  }
-});
-
-var Active = new DynamicPseudoClass("active", function(element) {
-  var instance = arguments;
-  IE7.CSS.addEventHandler(element, "onmousedown", function() {
-    Active.register(instance);
-  });
-});
-
-// globally trap the mouseup event (thanks Martijn!)
-addEventHandler(document, "onmouseup", function() {
-  var instances = Active.instances;
-  for (var i in instances) Active.unregister(instances[i]);
-});
-
-// :checked
-var Checked = new DynamicPseudoClass("checked", function(element) {
-  if (typeof element.checked != "boolean") return;
-  var instance = arguments;
-  IE7.CSS.addEventHandler(element, "onpropertychange", function() {
-    if (event.propertyName == "checked") {
-      if (element.checked) Checked.register(instance);
-      else Checked.unregister(instance);
-    }
-  });
-  // check current checked state
-  if (element.checked) Checked.register(instance);
-});
-
-// :enabled
-var Enabled = new DynamicPseudoClass("enabled", function(element) {
-  if (typeof element.disabled != "boolean") return;
-  var instance = arguments;
-  IE7.CSS.addEventHandler(element, "onpropertychange", function() {
-    if (event.propertyName == "disabled") {
-      if (!element.isDisabled) Enabled.register(instance);
-      else Enabled.unregister(instance);
-    }
-  });
-  // check current disabled state
-  if (!element.isDisabled) Enabled.register(instance);
-});
-
-// :disabled
-var Disabled = new DynamicPseudoClass("disabled", function(element) {
-  if (typeof element.disabled != "boolean") return;
-  var instance = arguments;
-  IE7.CSS.addEventHandler(element, "onpropertychange", function() {
-    if (event.propertyName == "disabled") {
-      if (element.isDisabled) Disabled.register(instance);
-      else Disabled.unregister(instance);
-    }
-  });
-  // check current disabled state
-  if (element.isDisabled) Disabled.register(instance);
-});
-
-// :indeterminate (Kevin Newman)
-var Indeterminate = new DynamicPseudoClass("indeterminate", function(element) {
-  if (typeof element.indeterminate != "boolean") return;
-  var instance = arguments;
-  IE7.CSS.addEventHandler(element, "onpropertychange", function() {
-    if (event.propertyName == "indeterminate") {
-      if (element.indeterminate) Indeterminate.register(instance);
-      else Indeterminate.unregister(instance);
-    }
-  });
-  IE7.CSS.addEventHandler(element, "onclick", function() {
-    Indeterminate.unregister(instance);
-  });
-  // clever Kev says no need to check this up front
-});
-
-// :target
-var Target = new DynamicPseudoClass("target", function(element) {
-  var instance = arguments;
-  // if an element has a tabIndex then it can become "active".
-  //  The default is zero anyway but it works...
-  if (!element.tabIndex) element.tabIndex = 0;
-  // this doesn't detect the back button. I don't know how to do that :-(
-  IE7.CSS.addEventHandler(document, "onpropertychange", function() {
-    if (event.propertyName == "activeElement") {
-      if (element.id && element.id == location.hash.slice(1)) Target.register(instance);
-      else Target.unregister(instance);
-    }
-  });
-  // check the current location
-  if (element.id && element.id == location.hash.slice(1)) Target.register(instance);
-});
-
-// -----------------------------------------------------------------------
-// IE7 pseudo elements
-// -----------------------------------------------------------------------
-
-// constants
-var ATTR = /^attr/;
-var URL = /^url\s*\(\s*([^)]*)\)$/;
-var POSITION_MAP = {
-  before0: "beforeBegin",
-  before1: "afterBegin",
-  after0: "afterEnd",
-  after1: "beforeEnd"
-};
-
-var PseudoElement = IE7.PseudoElement = Rule.extend({
-  constructor: function(selector, position, cssText) {
-    // initialise object properties
-    this.position = position;
-    var content = cssText.match(PseudoElement.CONTENT), match, entity;
-    if (content) {
-      content = content[1];
-      match = content.split(/\s+/);
-      for (var i = 0; (entity = match[i]); i++) {
-        match[i] = ATTR.test(entity) ? {attr: entity.slice(5, -1)} :
-          (entity.charAt(0) == "'") ? getString(entity) : decode(entity);
-      }
-      content = match;
-    }
-    this.content = content;
-    // CSS text needs to be decoded immediately
-    this.base(selector, decode(cssText));
-  },
-  
-  init: function() {
-    // execute the underlying css query for this class
-    this.match = cssQuery(this.selector);
-    for (var i = 0; i < this.match.length; i++) {
-      var runtimeStyle = this.match[i].runtimeStyle;
-      if (!runtimeStyle[this.position]) runtimeStyle[this.position] = {cssText:""};
-      runtimeStyle[this.position].cssText += ";" + this.cssText;
-      if (this.content != null) runtimeStyle[this.position].content = this.content;
-    }
-  },
-  
-  create: function(target) {
-    var generated = target.runtimeStyle[this.position];
-    if (generated) {
-      // copy the array of values
-      var content = [].concat(generated.content || "");
-      for (var j = 0; j < content.length; j++) {
-        if (typeof content[j] == "object") {
-          content[j] = target.getAttribute(content[j].attr);
-        }
-      }
-      content = content.join("");
-      var url = content.match(URL);
-      var cssText = "overflow:hidden;" + generated.cssText.replace(/'/g, '"');
-      if (target.currentStyle.styleFloat != "none") {
-        //cssText = cssText.replace(/display\s*:\s*block/, "display:inline-block");
-      }
-      var position = POSITION_MAP[this.position + Number(target.canHaveChildren)];
-      var id = 'ie7_pseudo' + PseudoElement.count++;
-      target.insertAdjacentHTML(position, format(PseudoElement.ANON, this.className, id, cssText, url ? "" : content));
-      if (url) {
-        var pseudoElement = document.getElementById(id);
-        pseudoElement.src = getString(url[1]);
-        addFilter(pseudoElement, "crop");
-      }
-      target.runtimeStyle[this.position] = null;
-    }
-  },
-  
-  recalc: function() {
-    if (this.content == null) return;
-    for (var i = 0; i < this.match.length; i++) {
-      this.create(this.match[i]);
-    }
-  },
-
-  toString: function() {
-    return "." + this.className + "{display:inline}";
-  }
-}, {  
-  CONTENT: /content\s*:\s*([^;]*)(;|$)/,
-  ANON: "<ie7:! class='ie7_anon %1' id=%2 style='%3'>%4</ie7:!>",
-  MATCH: /(.*):(before|after).*/,
-  
-  count: 0
-});
-
-// =========================================================================
-// ie8-html.js
-// =========================================================================
-
-var UNSUCCESSFUL = /^(submit|reset|button)$/;
-
-// -----------------------------------------------------------------------
-// <button>
-// -----------------------------------------------------------------------
-
-// IE bug means that innerText is submitted instead of "value"
-IE7.HTML.addRecalc("button,input", function(button) {
-  if (button.tagName == "BUTTON") {
-    var match = button.outerHTML.match(/ value="([^"]*)"/i);
-    button.runtimeStyle.value = (match) ? match[1] : "";
-  }
-  // flag the button/input that was used to submit the form
-  if (button.type == "submit") {
-    addEventHandler(button, "onclick", function() {
-      button.runtimeStyle.clicked = true;
-      setTimeout("document.all." + button.uniqueID + ".runtimeStyle.clicked=false", 1);
-    });
-  }
-});
-
-// -----------------------------------------------------------------------
-// <form>
-// -----------------------------------------------------------------------
-
-// only submit "successful controls
-IE7.HTML.addRecalc("form", function(form) {
-  addEventHandler(form, "onsubmit", function() {
-    for (var element, i = 0; element = form[i]; i++) {
-      if (UNSUCCESSFUL.test(element.type) && !element.disabled && !element.runtimeStyle.clicked) {
-        element.disabled = true;
-        setTimeout("document.all." + element.uniqueID + ".disabled=false", 1);
-      } else if (element.tagName == "BUTTON" && element.type == "submit") {
-        setTimeout("document.all." + element.uniqueID + ".value='" +
-          element.value + "'", 1);
-        element.value = element.runtimeStyle.value;
-      }
-    }
-  });
-});
-
-// -----------------------------------------------------------------------
-// <img>
-// -----------------------------------------------------------------------
-
-// get rid of the spurious tooltip produced by the alt attribute on images
-IE7.HTML.addRecalc("img", function(img) {
-  if (img.alt && !img.title) img.title = "";
-});
-
-// =========================================================================
-// ie8-layout.js
-// =========================================================================
-
-IE7.CSS.addRecalc("border-spacing", NUMERIC, function(element) {
-  if (element.currentStyle.borderCollapse != "collapse") {
-    element.cellSpacing = getPixelValue(element, element.currentStyle["border-spacing"]);
-  }
-});
-IE7.CSS.addRecalc("box-sizing", "content-box", IE7.Layout.boxSizing);
-IE7.CSS.addRecalc("box-sizing", "border-box", IE7.Layout.borderBox);
-
-// =========================================================================
-// ie8-graphics.js
-// =========================================================================
-
-IE7.CSS.addFix(/opacity\s*:\s*([\d.]+)/, function(match, value) {
-  return "zoom:1;filter:Alpha(opacity=" + ((value * 100) || 1) + ")";
-});
-
-// fix object[type=image/*]
-var IMAGE = /^image/i;
-IE7.HTML.addRecalc("object", function(element) {
-  if (IMAGE.test(element.type)) {
-    element.body.style.cssText = "margin:0;padding:0;border:none;overflow:hidden";
-    return element;
-  }
-});
-
-// -----------------------------------------------------------------------
-// initialisation
-// -----------------------------------------------------------------------
-
-IE7.loaded = true;
-
-(function() {
-  try {
-    // http://javascript.nwbox.com/IEContentLoaded/
-    documentElement.doScroll("left");
-  } catch (e) {
-    setTimeout(arguments.callee, 1);
-    return;
-  }
-  // execute the inner text of the IE7 script
-  try {
-    eval(script.innerHTML);
-  } catch (e) {
-    // ignore errors
-  }
-  PNG = new RegExp(rescape(typeof IE7_PNG_SUFFIX == "string" ? IE7_PNG_SUFFIX : "-trans.png") + "$", "i");
-
-  // frequently used references
-  body = document.body;
-  viewport = quirksMode ? body : documentElement;
-
-  // classes
-  body.className += " ie7_body";
-  documentElement.className += " ie7_html";
-
-  if (quirksMode) ie7Quirks();
-
-  IE7.CSS.init();
-  IE7.HTML.init();
-
-  IE7.HTML.apply();
-  IE7.CSS.apply();
-
-  IE7.recalc();
-})();
-
-
-})();
Index: nc/admin/default-templates/js/ie7/ie7-recalc.js
===================================================================
--- inc/admin/default-templates/js/ie7/ie7-recalc.js	(revision 1056)
+++ 	(revision )
@@ -1,166 +1,0 @@
-
-// =========================================================================
-// ie7-recalc.js
-// =========================================================================
-
-(function() {
-  /* ---------------------------------------------------------------------
-  
-    This allows refreshing of IE7 style rules. If you modify the DOM
-    you can update IE7 by calling document.recalc().
-  
-    This should be the LAST module included.
-  
-  --------------------------------------------------------------------- */
-  
-  if (!IE7.loaded) return;
-  
-  // remove all IE7 classes from an element
-  CLASSES = /\sie7_class\d+/g;
-  
-  IE7.CSS.extend({
-    // store for elements that have style properties calculated
-    elements: {},
-    handlers: [],
-    
-    // clear IE7 classes and styles
-    reset: function() {
-      this.removeEventHandlers();
-      // reset IE7 classes here
-      var elements = this.elements;
-      for (var i in elements) elements[i].runtimeStyle.cssText = "";
-      this.elements = {};
-      // reset runtimeStyle here
-      var elements = IE7.Rule.elements;
-      for (var i in elements) {
-        with (elements[i]) className = className.replace(CLASSES, "");
-      }
-      IE7.Rule.elements = {};
-    },
-    
-    reload: function() {
-      this.rules = [];
-      this.getInlineStyles();
-      this.screen.load();
-      if (this.print) this.print.load();
-      this.refresh();
-      this.trash();
-    },
-    
-    addRecalc: function(propertyName, test, handler, replacement) {
-      // call the ancestor method to add a wrapped recalc method
-      this.base(propertyName, test, function(element) {
-        // execute the original recalc method
-        handler(element);
-        // store a reference to this element so we can clear its style later
-        IE7.CSS.elements[element.uniqueID] = element;
-      }, replacement);
-    },
-    
-    recalc: function() {
-      // clear IE7 styles and classes
-      this.reset();
-      // execute the ancestor method to perform recalculations
-      this.base();
-    },
-    
-    addEventHandler: function(element, type, handler) {
-      element.attachEvent(type, handler);
-      // store the handler so it can be detached later
-      this.handlers.push(arguments);
-    },
-    
-    removeEventHandlers: function() {
-      var handler;
-       while (handler = this.handlers.pop()) {
-         handler[0].detachEvent(handler[1], handler[2]);
-       }
-    },
-    
-    getInlineStyles: function() {
-      // load inline styles
-      var styleSheets = document.getElementsByTagName("style"), styleSheet;
-      for (var i = styleSheets.length - 1; (styleSheet = styleSheets[i]); i--) {
-        if (!styleSheet.disabled && !styleSheet.ie7) {
-          var cssText = styleSheet.cssText || styleSheet.innerHTML;
-          this.styles.push(cssText);
-          styleSheet.cssText = cssText;
-        }
-      }
-    },
-    
-    trash: function() {
-      // trash the old style sheets
-      var styleSheets = document.styleSheets, styleSheet, i;
-      for (i = 0; i < styleSheets.length; i++) {
-        styleSheet = styleSheets[i];
-        if (!styleSheet.ie7 && !styleSheet.cssText) {
-          styleSheet.cssText = styleSheet.cssText;
-        }
-      }
-      this.base();
-    },
-    
-    getText: function(styleSheet) {
-      return styleSheet.cssText || this.base(styleSheet);
-    }
-  });
-  
-  // remove event handlers (they eat memory)
-  IE7.CSS.addEventHandler(window, "onunload", function() {
-     IE7.CSS.removeEventHandlers();
-  });
-  
-  // store all elements with an IE7 class assigned
-  IE7.Rule.elements = {};
-
-  IE7.Rule.prototype.extend({
-    add: function(element) {
-      // execute the ancestor "add" method
-      this.base(element);
-      // store a reference to this element so we can clear its classes later
-      IE7.Rule.elements[element.uniqueID] = element;
-    }
-  });
-
-  // store created pseudo elements
-  if (IE7.PseudoElement) {
-    IE7.PseudoElement.hash = {};
-  
-    IE7.PseudoElement.prototype.extend({
-      create: function(target) {
-        var key = this.selector + ":" + target.uniqueID;
-        if (!IE7.PseudoElement.hash[key]) {
-          IE7.PseudoElement.hash[key] = true;
-          this.base(target);
-        }
-      }
-    });
-  }
-  
-  IE7.HTML.extend({
-    elements: {},
-    
-    addRecalc: function(selector, handler) {
-      // call the ancestor method to add a wrapped recalc method
-      this.base(selector, function(element) {
-        if (!this.elements[element.uniqueID]) {
-          // execute the original recalc method
-          handler(element);
-          // store a reference to this element so that
-          //  it is not "fixed" again
-          this.elements[element.uniqueID] = element;
-        }
-      });
-    }
-  });
-  
-  // allow refreshing of IE7 fixes
-  document.recalc = function(reload) {
-    if (IE7.CSS.screen) {
-      if (reload) IE7.CSS.reload();
-      IE7.recalc();
-    }
-  };
-
-})();
Index: nc/admin/default-templates/js/ie7/ie7-squish.js
===================================================================
--- inc/admin/default-templates/js/ie7/ie7-squish.js	(revision 1056)
+++ 	(revision )
@@ -1,36 +1,0 @@
-
-/* ---------------------------------------------------------------------
-
-  Squish some IE bugs!
-
-  Some of these bug fixes may have adverse effects so they are
-  not included in the standard library. Add your own if you want.
-
---------------------------------------------------------------------- */
-
-// @NOTE: ie7Layout.boxSizing is the same as the "Holly Hack"
-
-if (IE7.loaded && IE7.appVersion < 7) {
-
-  // "doubled margin" bug
-  // http://www.positioniseverything.net/explorer/doubled-margin.html
-  IE7.CSS.addFix(/(float\s*:\s*(left|right))/, "display:inline;$1");
-
-  // "peekaboo" bug
-  // http://www.positioniseverything.net/explorer/peekaboo.html
-  if (IE7.appVersion >= 6) IE7.CSS.addRecalc("float", "(left|right)", function(element) {
-  	IE7.Layout.boxSizing(element.parentElement); // assing "hasLayout" to parent element
-  	// "doubled margin" bug
-  	element.style.display = "inline";
-  });
-
-  // "unscrollable content" bug
-  // http://www.positioniseverything.net/explorer/unscrollable.html
-  IE7.CSS.addRecalc("position", "absolute|fixed", function(element) {
-  	if (element.offsetParent && element.offsetParent.currentStyle.position == "relative")
-  		IE7.Layout.boxSizing(element.offsetParent); // assing "hasLayout"
-  });
-}
-
-//# // get rid of Microsoft's pesky image toolbar
-//# document.write('<meta http-equiv="imagetoolbar" content="no">');
Index: nc/admin/default-templates/js/jquery/jquery-ui.custom.js
===================================================================
--- inc/admin/default-templates/js/jquery/jquery-ui.custom.js	(revision 1085)
+++ 	(revision )
@@ -1,2823 +1,0 @@
-/*! jQuery UI - v1.9.2 - 2012-11-29
-* http://jqueryui.com
-* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.sortable.js, jquery.ui.accordion.js
-* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
-
-(function( $, undefined ) {
-
-var uuid = 0,
-	runiqueId = /^ui-id-\d+$/;
-
-// prevent duplicate loading
-// this is only a problem because we proxy existing functions
-// and we don't want to double proxy them
-$.ui = $.ui || {};
-if ( $.ui.version ) {
-	return;
-}
-
-$.extend( $.ui, {
-	version: "1.9.2",
-
-	keyCode: {
-		BACKSPACE: 8,
-		COMMA: 188,
-		DELETE: 46,
-		DOWN: 40,
-		END: 35,
-		ENTER: 13,
-		ESCAPE: 27,
-		HOME: 36,
-		LEFT: 37,
-		NUMPAD_ADD: 107,
-		NUMPAD_DECIMAL: 110,
-		NUMPAD_DIVIDE: 111,
-		NUMPAD_ENTER: 108,
-		NUMPAD_MULTIPLY: 106,
-		NUMPAD_SUBTRACT: 109,
-		PAGE_DOWN: 34,
-		PAGE_UP: 33,
-		PERIOD: 190,
-		RIGHT: 39,
-		SPACE: 32,
-		TAB: 9,
-		UP: 38
-	}
-});
-
-// plugins
-$.fn.extend({
-	_focus: $.fn.focus,
-	focus: function( delay, fn ) {
-		return typeof delay === "number" ?
-			this.each(function() {
-				var elem = this;
-				setTimeout(function() {
-					$( elem ).focus();
-					if ( fn ) {
-						fn.call( elem );
-					}
-				}, delay );
-			}) :
-			this._focus.apply( this, arguments );
-	},
-
-	scrollParent: function() {
-		var scrollParent;
-		if (($.ui.ie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
-			scrollParent = this.parents().filter(function() {
-				return (/(relative|absolute|fixed)/).test($.css(this,'position')) && (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));
-			}).eq(0);
-		} else {
-			scrollParent = this.parents().filter(function() {
-				return (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));
-			}).eq(0);
-		}
-
-		return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
-	},
-
-	zIndex: function( zIndex ) {
-		if ( zIndex !== undefined ) {
-			return this.css( "zIndex", zIndex );
-		}
-
-		if ( this.length ) {
-			var elem = $( this[ 0 ] ), position, value;
-			while ( elem.length && elem[ 0 ] !== document ) {
-				// Ignore z-index if position is set to a value where z-index is ignored by the browser
-				// This makes behavior of this function consistent across browsers
-				// WebKit always returns auto if the element is positioned
-				position = elem.css( "position" );
-				if ( position === "absolute" || position === "relative" || position === "fixed" ) {
-					// IE returns 0 when zIndex is not specified
-					// other browsers return a string
-					// we ignore the case of nested elements with an explicit value of 0
-					// <div style="z-index: -10;"><div style="z-index: 0;"></div></div>
-					value = parseInt( elem.css( "zIndex" ), 10 );
-					if ( !isNaN( value ) && value !== 0 ) {
-						return value;
-					}
-				}
-				elem = elem.parent();
-			}
-		}
-
-		return 0;
-	},
-
-	uniqueId: function() {
-		return this.each(function() {
-			if ( !this.id ) {
-				this.id = "ui-id-" + (++uuid);
-			}
-		});
-	},
-
-	removeUniqueId: function() {
-		return this.each(function() {
-			if ( runiqueId.test( this.id ) ) {
-				$( this ).removeAttr( "id" );
-			}
-		});
-	}
-});
-
-// selectors
-function focusable( element, isTabIndexNotNaN ) {
-	var map, mapName, img,
-		nodeName = element.nodeName.toLowerCase();
-	if ( "area" === nodeName ) {
-		map = element.parentNode;
-		mapName = map.name;
-		if ( !element.href || !mapName || map.nodeName.toLowerCase() !== "map" ) {
-			return false;
-		}
-		img = $( "img[usemap=#" + mapName + "]" )[0];
-		return !!img && visible( img );
-	}
-	return ( /input|select|textarea|button|object/.test( nodeName ) ?
-		!element.disabled :
-		"a" === nodeName ?
-			element.href || isTabIndexNotNaN :
-			isTabIndexNotNaN) &&
-		// the element and all of its ancestors must be visible
-		visible( element );
-}
-
-function visible( element ) {
-	return $.expr.filters.visible( element ) &&
-		!$( element ).parents().andSelf().filter(function() {
-			return $.css( this, "visibility" ) === "hidden";
-		}).length;
-}
-
-$.extend( $.expr[ ":" ], {
-	data: $.expr.createPseudo ?
-		$.expr.createPseudo(function( dataName ) {
-			return function( elem ) {
-				return !!$.data( elem, dataName );
-			};
-		}) :
-		// support: jQuery <1.8
-		function( elem, i, match ) {
-			return !!$.data( elem, match[ 3 ] );
-		},
-
-	focusable: function( element ) {
-		return focusable( element, !isNaN( $.attr( element, "tabindex" ) ) );
-	},
-
-	tabbable: function( element ) {
-		var tabIndex = $.attr( element, "tabindex" ),
-			isTabIndexNaN = isNaN( tabIndex );
-		return ( isTabIndexNaN || tabIndex >= 0 ) && focusable( element, !isTabIndexNaN );
-	}
-});
-
-// support
-$(function() {
-	var body = document.body,
-		div = body.appendChild( div = document.createElement( "div" ) );
-
-	// access offsetHeight before setting the style to prevent a layout bug
-	// in IE 9 which causes the element to continue to take up space even
-	// after it is removed from the DOM (#8026)
-	div.offsetHeight;
-
-	$.extend( div.style, {
-		minHeight: "100px",
-		height: "auto",
-		padding: 0,
-		borderWidth: 0
-	});
-
-	$.support.minHeight = div.offsetHeight === 100;
-	$.support.selectstart = "onselectstart" in div;
-
-	// set display to none to avoid a layout bug in IE
-	// http://dev.jquery.com/ticket/4014
-	body.removeChild( div ).style.display = "none";
-});
-
-// support: jQuery <1.8
-if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
-	$.each( [ "Width", "Height" ], function( i, name ) {
-		var side = name === "Width" ? [ "Left", "Right" ] : [ "Top", "Bottom" ],
-			type = name.toLowerCase(),
-			orig = {
-				innerWidth: $.fn.innerWidth,
-				innerHeight: $.fn.innerHeight,
-				outerWidth: $.fn.outerWidth,
-				outerHeight: $.fn.outerHeight
-			};
-
-		function reduce( elem, size, border, margin ) {
-			$.each( side, function() {
-				size -= parseFloat( $.css( elem, "padding" + this ) ) || 0;
-				if ( border ) {
-					size -= parseFloat( $.css( elem, "border" + this + "Width" ) ) || 0;
-				}
-				if ( margin ) {
-					size -= parseFloat( $.css( elem, "margin" + this ) ) || 0;
-				}
-			});
-			return size;
-		}
-
-		$.fn[ "inner" + name ] = function( size ) {
-			if ( size === undefined ) {
-				return orig[ "inner" + name ].call( this );
-			}
-
-			return this.each(function() {
-				$( this ).css( type, reduce( this, size ) + "px" );
-			});
-		};
-
-		$.fn[ "outer" + name] = function( size, margin ) {
-			if ( typeof size !== "number" ) {
-				return orig[ "outer" + name ].call( this, size );
-			}
-
-			return this.each(function() {
-				$( this).css( type, reduce( this, size, true, margin ) + "px" );
-			});
-		};
-	});
-}
-
-// support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
-if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
-	$.fn.removeData = (function( removeData ) {
-		return function( key ) {
-			if ( arguments.length ) {
-				return removeData.call( this, $.camelCase( key ) );
-			} else {
-				return removeData.call( this );
-			}
-		};
-	})( $.fn.removeData );
-}
-
-
-
-
-
-// deprecated
-
-(function() {
-	var uaMatch = /msie ([\w.]+)/.exec( navigator.userAgent.toLowerCase() ) || [];
-	$.ui.ie = uaMatch.length ? true : false;
-	$.ui.ie6 = parseFloat( uaMatch[ 1 ], 10 ) === 6;
-})();
-
-$.fn.extend({
-	disableSelection: function() {
-		return this.bind( ( $.support.selectstart ? "selectstart" : "mousedown" ) +
-			".ui-disableSelection", function( event ) {
-				event.preventDefault();
-			});
-	},
-
-	enableSelection: function() {
-		return this.unbind( ".ui-disableSelection" );
-	}
-});
-
-$.extend( $.ui, {
-	// $.ui.plugin is deprecated.  Use the proxy pattern instead.
-	plugin: {
-		add: function( module, option, set ) {
-			var i,
-				proto = $.ui[ module ].prototype;
-			for ( i in set ) {
-				proto.plugins[ i ] = proto.plugins[ i ] || [];
-				proto.plugins[ i ].push( [ option, set[ i ] ] );
-			}
-		},
-		call: function( instance, name, args ) {
-			var i,
-				set = instance.plugins[ name ];
-			if ( !set || !instance.element[ 0 ].parentNode || instance.element[ 0 ].parentNode.nodeType === 11 ) {
-				return;
-			}
-
-			for ( i = 0; i < set.length; i++ ) {
-				if ( instance.options[ set[ i ][ 0 ] ] ) {
-					set[ i ][ 1 ].apply( instance.element, args );
-				}
-			}
-		}
-	},
-
-	contains: $.contains,
-
-	// only used by resizable
-	hasScroll: function( el, a ) {
-
-		//If overflow is hidden, the element might have extra content, but the user wants to hide it
-		if ( $( el ).css( "overflow" ) === "hidden") {
-			return false;
-		}
-
-		var scroll = ( a && a === "left" ) ? "scrollLeft" : "scrollTop",
-			has = false;
-
-		if ( el[ scroll ] > 0 ) {
-			return true;
-		}
-
-		// TODO: determine which cases actually cause this to happen
-		// if the element doesn't have the scroll set, see if it's possible to
-		// set the scroll
-		el[ scroll ] = 1;
-		has = ( el[ scroll ] > 0 );
-		el[ scroll ] = 0;
-		return has;
-	},
-
-	// these are odd functions, fix the API or move into individual plugins
-	isOverAxis: function( x, reference, size ) {
-		//Determines when x coordinate is over "b" element axis
-		return ( x > reference ) && ( x < ( reference + size ) );
-	},
-	isOver: function( y, x, top, left, height, width ) {
-		//Determines when x, y coordinates is over "b" element
-		return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );
-	}
-});
-
-})( jQuery );
-(function( $, undefined ) {
-
-var uuid = 0,
-	slice = Array.prototype.slice,
-	_cleanData = $.cleanData;
-$.cleanData = function( elems ) {
-	for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
-		try {
-			$( elem ).triggerHandler( "remove" );
-		// http://bugs.jquery.com/ticket/8235
-		} catch( e ) {}
-	}
-	_cleanData( elems );
-};
-
-$.widget = function( name, base, prototype ) {
-	var fullName, existingConstructor, constructor, basePrototype,
-		namespace = name.split( "." )[ 0 ];
-
-	name = name.split( "." )[ 1 ];
-	fullName = namespace + "-" + name;
-
-	if ( !prototype ) {
-		prototype = base;
-		base = $.Widget;
-	}
-
-	// create selector for plugin
-	$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
-		return !!$.data( elem, fullName );
-	};
-
-	$[ namespace ] = $[ namespace ] || {};
-	existingConstructor = $[ namespace ][ name ];
-	constructor = $[ namespace ][ name ] = function( options, element ) {
-		// allow instantiation without "new" keyword
-		if ( !this._createWidget ) {
-			return new constructor( options, element );
-		}
-
-		// allow instantiation without initializing for simple inheritance
-		// must use "new" keyword (the code above always passes args)
-		if ( arguments.length ) {
-			this._createWidget( options, element );
-		}
-	};
-	// extend with the existing constructor to carry over any static properties
-	$.extend( constructor, existingConstructor, {
-		version: prototype.version,
-		// copy the object used to create the prototype in case we need to
-		// redefine the widget later
-		_proto: $.extend( {}, prototype ),
-		// track widgets that inherit from this widget in case this widget is
-		// redefined after a widget inherits from it
-		_childConstructors: []
-	});
-
-	basePrototype = new base();
-	// we need to make the options hash a property directly on the new instance
-	// otherwise we'll modify the options hash on the prototype that we're
-	// inheriting from
-	basePrototype.options = $.widget.extend( {}, basePrototype.options );
-	$.each( prototype, function( prop, value ) {
-		if ( $.isFunction( value ) ) {
-			prototype[ prop ] = (function() {
-				var _super = function() {
-						return base.prototype[ prop ].apply( this, arguments );
-					},
-					_superApply = function( args ) {
-						return base.prototype[ prop ].apply( this, args );
-					};
-				return function() {
-					var __super = this._super,
-						__superApply = this._superApply,
-						returnValue;
-
-					this._super = _super;
-					this._superApply = _superApply;
-
-					returnValue = value.apply( this, arguments );
-
-					this._super = __super;
-					this._superApply = __superApply;
-
-					return returnValue;
-				};
-			})();
-		}
-	});
-	constructor.prototype = $.widget.extend( basePrototype, {
-		// TODO: remove support for widgetEventPrefix
-		// always use the name + a colon as the prefix, e.g., draggable:start
-		// don't prefix for widgets that aren't DOM-based
-		widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name
-	}, prototype, {
-		constructor: constructor,
-		namespace: namespace,
-		widgetName: name,
-		// TODO remove widgetBaseClass, see #8155
-		widgetBaseClass: fullName,
-		widgetFullName: fullName
-	});
-
-	// If this widget is being redefined then we need to find all widgets that
-	// are inheriting from it and redefine all of them so that they inherit from
-	// the new version of this widget. We're essentially trying to replace one
-	// level in the prototype chain.
-	if ( existingConstructor ) {
-		$.each( existingConstructor._childConstructors, function( i, child ) {
-			var childPrototype = child.prototype;
-
-			// redefine the child widget using the same prototype that was
-			// originally used, but inherit from the new version of the base
-			$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
-		});
-		// remove the list of existing child constructors from the old constructor
-		// so the old child constructors can be garbage collected
-		delete existingConstructor._childConstructors;
-	} else {
-		base._childConstructors.push( constructor );
-	}
-
-	$.widget.bridge( name, constructor );
-};
-
-$.widget.extend = function( target ) {
-	var input = slice.call( arguments, 1 ),
-		inputIndex = 0,
-		inputLength = input.length,
-		key,
-		value;
-	for ( ; inputIndex < inputLength; inputIndex++ ) {
-		for ( key in input[ inputIndex ] ) {
-			value = input[ inputIndex ][ key ];
-			if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
-				// Clone objects
-				if ( $.isPlainObject( value ) ) {
-					target[ key ] = $.isPlainObject( target[ key ] ) ?
-						$.widget.extend( {}, target[ key ], value ) :
-						// Don't extend strings, arrays, etc. with objects
-						$.widget.extend( {}, value );
-				// Copy everything else by reference
-				} else {
-					target[ key ] = value;
-				}
-			}
-		}
-	}
-	return target;
-};
-
-$.widget.bridge = function( name, object ) {
-	var fullName = object.prototype.widgetFullName || name;
-	$.fn[ name ] = function( options ) {
-		var isMethodCall = typeof options === "string",
-			args = slice.call( arguments, 1 ),
-			returnValue = this;
-
-		// allow multiple hashes to be passed on init
-		options = !isMethodCall && args.length ?
-			$.widget.extend.apply( null, [ options ].concat(args) ) :
-			options;
-
-		if ( isMethodCall ) {
-			this.each(function() {
-				var methodValue,
-					instance = $.data( this, fullName );
-				if ( !instance ) {
-					return $.error( "cannot call methods on " + name + " prior to initialization; " +
-						"attempted to call method '" + options + "'" );
-				}
-				if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
-					return $.error( "no such method '" + options + "' for " + name + " widget instance" );
-				}
-				methodValue = instance[ options ].apply( instance, args );
-				if ( methodValue !== instance && methodValue !== undefined ) {
-					returnValue = methodValue && methodValue.jquery ?
-						returnValue.pushStack( methodValue.get() ) :
-						methodValue;
-					return false;
-				}
-			});
-		} else {
-			this.each(function() {
-				var instance = $.data( this, fullName );
-				if ( instance ) {
-					instance.option( options || {} )._init();
-				} else {
-					$.data( this, fullName, new object( options, this ) );
-				}
-			});
-		}
-
-		return returnValue;
-	};
-};
-
-$.Widget = function( /* options, element */ ) {};
-$.Widget._childConstructors = [];
-
-$.Widget.prototype = {
-	widgetName: "widget",
-	widgetEventPrefix: "",
-	defaultElement: "<div>",
-	options: {
-		disabled: false,
-
-		// callbacks
-		create: null
-	},
-	_createWidget: function( options, element ) {
-		element = $( element || this.defaultElement || this )[ 0 ];
-		this.element = $( element );
-		this.uuid = uuid++;
-		this.eventNamespace = "." + this.widgetName + this.uuid;
-		this.options = $.widget.extend( {},
-			this.options,
-			this._getCreateOptions(),
-			options );
-
-		this.bindings = $();
-		this.hoverable = $();
-		this.focusable = $();
-
-		if ( element !== this ) {
-			// 1.9 BC for #7810
-			// TODO remove dual storage
-			$.data( element, this.widgetName, this );
-			$.data( element, this.widgetFullName, this );
-			this._on( true, this.element, {
-				remove: function( event ) {
-					if ( event.target === element ) {
-						this.destroy();
-					}
-				}
-			});
-			this.document = $( element.style ?
-				// element within the document
-				element.ownerDocument :
-				// element is window or document
-				element.document || element );
-			this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
-		}
-
-		this._create();
-		this._trigger( "create", null, this._getCreateEventData() );
-		this._init();
-	},
-	_getCreateOptions: $.noop,
-	_getCreateEventData: $.noop,
-	_create: $.noop,
-	_init: $.noop,
-
-	destroy: function() {
-		this._destroy();
-		// we can probably remove the unbind calls in 2.0
-		// all event bindings should go through this._on()
-		this.element
-			.unbind( this.eventNamespace )
-			// 1.9 BC for #7810
-			// TODO remove dual storage
-			.removeData( this.widgetName )
-			.removeData( this.widgetFullName )
-			// support: jquery <1.6.3
-			// http://bugs.jquery.com/ticket/9413
-			.removeData( $.camelCase( this.widgetFullName ) );
-		this.widget()
-			.unbind( this.eventNamespace )
-			.removeAttr( "aria-disabled" )
-			.removeClass(
-				this.widgetFullName + "-disabled " +
-				"ui-state-disabled" );
-
-		// clean up events and states
-		this.bindings.unbind( this.eventNamespace );
-		this.hoverable.removeClass( "ui-state-hover" );
-		this.focusable.removeClass( "ui-state-focus" );
-	},
-	_destroy: $.noop,
-
-	widget: function() {
-		return this.element;
-	},
-
-	option: function( key, value ) {
-		var options = key,
-			parts,
-			curOption,
-			i;
-
-		if ( arguments.length === 0 ) {
-			// don't return a reference to the internal hash
-			return $.widget.extend( {}, this.options );
-		}
-
-		if ( typeof key === "string" ) {
-			// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
-			options = {};
-			parts = key.split( "." );
-			key = parts.shift();
-			if ( parts.length ) {
-				curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
-				for ( i = 0; i < parts.length - 1; i++ ) {
-					curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
-					curOption = curOption[ parts[ i ] ];
-				}
-				key = parts.pop();
-				if ( value === undefined ) {
-					return curOption[ key ] === undefined ? null : curOption[ key ];
-				}
-				curOption[ key ] = value;
-			} else {
-				if ( value === undefined ) {
-					return this.options[ key ] === undefined ? null : this.options[ key ];
-				}
-				options[ key ] = value;
-			}
-		}
-
-		this._setOptions( options );
-
-		return this;
-	},
-	_setOptions: function( options ) {
-		var key;
-
-		for ( key in options ) {
-			this._setOption( key, options[ key ] );
-		}
-
-		return this;
-	},
-	_setOption: function( key, value ) {
-		this.options[ key ] = value;
-
-		if ( key === "disabled" ) {
-			this.widget()
-				.toggleClass( this.widgetFullName + "-disabled ui-state-disabled", !!value )
-				.attr( "aria-disabled", value );
-			this.hoverable.removeClass( "ui-state-hover" );
-			this.focusable.removeClass( "ui-state-focus" );
-		}
-
-		return this;
-	},
-
-	enable: function() {
-		return this._setOption( "disabled", false );
-	},
-	disable: function() {
-		return this._setOption( "disabled", true );
-	},
-
-	_on: function( suppressDisabledCheck, element, handlers ) {
-		var delegateElement,
-			instance = this;
-
-		// no suppressDisabledCheck flag, shuffle arguments
-		if ( typeof suppressDisabledCheck !== "boolean" ) {
-			handlers = element;
-			element = suppressDisabledCheck;
-			suppressDisabledCheck = false;
-		}
-
-		// no element argument, shuffle and use this.element
-		if ( !handlers ) {
-			handlers = element;
-			element = this.element;
-			delegateElement = this.widget();
-		} else {
-			// accept selectors, DOM elements
-			element = delegateElement = $( element );
-			this.bindings = this.bindings.add( element );
-		}
-
-		$.each( handlers, function( event, handler ) {
-			function handlerProxy() {
-				// allow widgets to customize the disabled handling
-				// - disabled as an array instead of boolean
-				// - disabled class as method for disabling individual parts
-				if ( !suppressDisabledCheck &&
-						( instance.options.disabled === true ||
-							$( this ).hasClass( "ui-state-disabled" ) ) ) {
-					return;
-				}
-				return ( typeof handler === "string" ? instance[ handler ] : handler )
-					.apply( instance, arguments );
-			}
-
-			// copy the guid so direct unbinding works
-			if ( typeof handler !== "string" ) {
-				handlerProxy.guid = handler.guid =
-					handler.guid || handlerProxy.guid || $.guid++;
-			}
-
-			var match = event.match( /^(\w+)\s*(.*)$/ ),
-				eventName = match[1] + instance.eventNamespace,
-				selector = match[2];
-			if ( selector ) {
-				delegateElement.delegate( selector, eventName, handlerProxy );
-			} else {
-				element.bind( eventName, handlerProxy );
-			}
-		});
-	},
-
-	_off: function( element, eventName ) {
-		eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) + this.eventNamespace;
-		element.unbind( eventName ).undelegate( eventName );
-	},
-
-	_delay: function( handler, delay ) {
-		function handlerProxy() {
-			return ( typeof handler === "string" ? instance[ handler ] : handler )
-				.apply( instance, arguments );
-		}
-		var instance = this;
-		return setTimeout( handlerProxy, delay || 0 );
-	},
-
-	_hoverable: function( element ) {
-		this.hoverable = this.hoverable.add( element );
-		this._on( element, {
-			mouseenter: function( event ) {
-				$( event.currentTarget ).addClass( "ui-state-hover" );
-			},
-			mouseleave: function( event ) {
-				$( event.currentTarget ).removeClass( "ui-state-hover" );
-			}
-		});
-	},
-
-	_focusable: function( element ) {
-		this.focusable = this.focusable.add( element );
-		this._on( element, {
-			focusin: function( event ) {
-				$( event.currentTarget ).addClass( "ui-state-focus" );
-			},
-			focusout: function( event ) {
-				$( event.currentTarget ).removeClass( "ui-state-focus" );
-			}
-		});
-	},
-
-	_trigger: function( type, event, data ) {
-		var prop, orig,
-			callback = this.options[ type ];
-
-		data = data || {};
-		event = $.Event( event );
-		event.type = ( type === this.widgetEventPrefix ?
-			type :
-			this.widgetEventPrefix + type ).toLowerCase();
-		// the original event may come from any element
-		// so we need to reset the target on the new event
-		event.target = this.element[ 0 ];
-
-		// copy original event properties over to the new event
-		orig = event.originalEvent;
-		if ( orig ) {
-			for ( prop in orig ) {
-				if ( !( prop in event ) ) {
-					event[ prop ] = orig[ prop ];
-				}
-			}
-		}
-
-		this.element.trigger( event, data );
-		return !( $.isFunction( callback ) &&
-			callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
-			event.isDefaultPrevented() );
-	}
-};
-
-$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
-	$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
-		if ( typeof options === "string" ) {
-			options = { effect: options };
-		}
-		var hasOptions,
-			effectName = !options ?
-				method :
-				options === true || typeof options === "number" ?
-					defaultEffect :
-					options.effect || defaultEffect;
-		options = options || {};
-		if ( typeof options === "number" ) {
-			options = { duration: options };
-		}
-		hasOptions = !$.isEmptyObject( options );
-		options.complete = callback;
-		if ( options.delay ) {
-			element.delay( options.delay );
-		}
-		if ( hasOptions && $.effects && ( $.effects.effect[ effectName ] || $.uiBackCompat !== false && $.effects[ effectName ] ) ) {
-			element[ method ]( options );
-		} else if ( effectName !== method && element[ effectName ] ) {
-			element[ effectName ]( options.duration, options.easing, callback );
-		} else {
-			element.queue(function( next ) {
-				$( this )[ method ]();
-				if ( callback ) {
-					callback.call( element[ 0 ] );
-				}
-				next();
-			});
-		}
-	};
-});
-
-// DEPRECATED
-if ( $.uiBackCompat !== false ) {
-	$.Widget.prototype._getCreateOptions = function() {
-		return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
-	};
-}
-
-})( jQuery );
-(function( $, undefined ) {
-
-var mouseHandled = false;
-$( document ).mouseup( function( e ) {
-	mouseHandled = false;
-});
-
-$.widget("ui.mouse", {
-	version: "1.9.2",
-	options: {
-		cancel: 'input,textarea,button,select,option',
-		distance: 1,
-		delay: 0
-	},
-	_mouseInit: function() {
-		var that = this;
-
-		this.element
-			.bind('mousedown.'+this.widgetName, function(event) {
-				return that._mouseDown(event);
-			})
-			.bind('click.'+this.widgetName, function(event) {
-				if (true === $.data(event.target, that.widgetName + '.preventClickEvent')) {
-					$.removeData(event.target, that.widgetName + '.preventClickEvent');
-					event.stopImmediatePropagation();
-					return false;
-				}
-			});
-
-		this.started = false;
-	},
-
-	// TODO: make sure destroying one instance of mouse doesn't mess with
-	// other instances of mouse
-	_mouseDestroy: function() {
-		this.element.unbind('.'+this.widgetName);
-		if ( this._mouseMoveDelegate ) {
-			$(document)
-				.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
-				.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-		}
-	},
-
-	_mouseDown: function(event) {
-		// don't let more than one widget handle mouseStart
-		if( mouseHandled ) { return; }
-
-		// we may have missed mouseup (out of window)
-		(this._mouseStarted && this._mouseUp(event));
-
-		this._mouseDownEvent = event;
-
-		var that = this,
-			btnIsLeft = (event.which === 1),
-			// event.target.nodeName works around a bug in IE 8 with
-			// disabled inputs (#7620)
-			elIsCancel = (typeof this.options.cancel === "string" && event.target.nodeName ? $(event.target).closest(this.options.cancel).length : false);
-		if (!btnIsLeft || elIsCancel || !this._mouseCapture(event)) {
-			return true;
-		}
-
-		this.mouseDelayMet = !this.options.delay;
-		if (!this.mouseDelayMet) {
-			this._mouseDelayTimer = setTimeout(function() {
-				that.mouseDelayMet = true;
-			}, this.options.delay);
-		}
-
-		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
-			this._mouseStarted = (this._mouseStart(event) !== false);
-			if (!this._mouseStarted) {
-				event.preventDefault();
-				return true;
-			}
-		}
-
-		// Click event may never have fired (Gecko & Opera)
-		if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) {
-			$.removeData(event.target, this.widgetName + '.preventClickEvent');
-		}
-
-		// these delegates are required to keep context
-		this._mouseMoveDelegate = function(event) {
-			return that._mouseMove(event);
-		};
-		this._mouseUpDelegate = function(event) {
-			return that._mouseUp(event);
-		};
-		$(document)
-			.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
-			.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
-		event.preventDefault();
-
-		mouseHandled = true;
-		return true;
-	},
-
-	_mouseMove: function(event) {
-		// IE mouseup check - mouseup happened when mouse was out of window
-		if ($.ui.ie && !(document.documentMode >= 9) && !event.button) {
-			return this._mouseUp(event);
-		}
-
-		if (this._mouseStarted) {
-			this._mouseDrag(event);
-			return event.preventDefault();
-		}
-
-		if (this._mouseDistanceMet(event) && this._mouseDelayMet(event)) {
-			this._mouseStarted =
-				(this._mouseStart(this._mouseDownEvent, event) !== false);
-			(this._mouseStarted ? this._mouseDrag(event) : this._mouseUp(event));
-		}
-
-		return !this._mouseStarted;
-	},
-
-	_mouseUp: function(event) {
-		$(document)
-			.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
-			.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
-
-		if (this._mouseStarted) {
-			this._mouseStarted = false;
-
-			if (event.target === this._mouseDownEvent.target) {
-				$.data(event.target, this.widgetName + '.preventClickEvent', true);
-			}
-
-			this._mouseStop(event);
-		}
-
-		return false;
-	},
-
-	_mouseDistanceMet: function(event) {
-		return (Math.max(
-				Math.abs(this._mouseDownEvent.pageX - event.pageX),
-				Math.abs(this._mouseDownEvent.pageY - event.pageY)
-			) >= this.options.distance
-		);
-	},
-
-	_mouseDelayMet: function(event) {
-		return this.mouseDelayMet;
-	},
-
-	// These are placeholder methods, to be overriden by extending plugin
-	_mouseStart: function(event) {},
-	_mouseDrag: function(event) {},
-	_mouseStop: function(event) {},
-	_mouseCapture: function(event) { return true; }
-});
-
-})(jQuery);
-(function( $, undefined ) {
-
-$.widget("ui.sortable", $.ui.mouse, {
-	version: "1.9.2",
-	widgetEventPrefix: "sort",
-	ready: false,
-	options: {
-		appendTo: "parent",
-		axis: false,
-		connectWith: false,
-		containment: false,
-		cursor: 'auto',
-		cursorAt: false,
-		dropOnEmpty: true,
-		forcePlaceholderSize: false,
-		forceHelperSize: false,
-		grid: false,
-		handle: false,
-		helper: "original",
-		items: '> *',
-		opacity: false,
-		placeholder: false,
-		revert: false,
-		scroll: true,
-		scrollSensitivity: 20,
-		scrollSpeed: 20,
-		scope: "default",
-		tolerance: "intersect",
-		zIndex: 1000
-	},
-	_create: function() {
-
-		var o = this.options;
-		this.containerCache = {};
-		this.element.addClass("ui-sortable");
-
-		//Get the items
-		this.refresh();
-
-		//Let's determine if the items are being displayed horizontally
-		this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false;
-
-		//Let's determine the parent's offset
-		this.offset = this.element.offset();
-
-		//Initialize mouse events for interaction
-		this._mouseInit();
-
-		//We're ready to go
-		this.ready = true
-
-	},
-
-	_destroy: function() {
-		this.element
-			.removeClass("ui-sortable ui-sortable-disabled");
-		this._mouseDestroy();
-
-		for ( var i = this.items.length - 1; i >= 0; i-- )
-			this.items[i].item.removeData(this.widgetName + "-item");
-
-		return this;
-	},
-
-	_setOption: function(key, value){
-		if ( key === "disabled" ) {
-			this.options[ key ] = value;
-
-			this.widget().toggleClass( "ui-sortable-disabled", !!value );
-		} else {
-			// Don't call widget base _setOption for disable as it adds ui-state-disabled class
-			$.Widget.prototype._setOption.apply(this, arguments);
-		}
-	},
-
-	_mouseCapture: function(event, overrideHandle) {
-		var that = this;
-
-		if (this.reverting) {
-			return false;
-		}
-
-		if(this.options.disabled || this.options.type == 'static') return false;
-
-		//We have to refresh the items data once first
-		this._refreshItems(event);
-
-		//Find out if the clicked node (or one of its parents) is a actual item in this.items
-		var currentItem = null, nodes = $(event.target).parents().each(function() {
-			if($.data(this, that.widgetName + '-item') == that) {
-				currentItem = $(this);
-				return false;
-			}
-		});
-		if($.data(event.target, that.widgetName + '-item') == that) currentItem = $(event.target);
-
-		if(!currentItem) return false;
-		if(this.options.handle && !overrideHandle) {
-			var validHandle = false;
-
-			$(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; });
-			if(!validHandle) return false;
-		}
-
-		this.currentItem = currentItem;
-		this._removeCurrentsFromItems();
-		return true;
-
-	},
-
-	_mouseStart: function(event, overrideHandle, noActivation) {
-
-		var o = this.options;
-		this.currentContainer = this;
-
-		//We only need to call refreshPositions, because the refreshItems call has been moved to mouseCapture
-		this.refreshPositions();
-
-		//Create and append the visible helper
-		this.helper = this._createHelper(event);
-
-		//Cache the helper size
-		this._cacheHelperProportions();
-
-		/*
-		 * - Position generation -
-		 * This block generates everything position related - it's the core of draggables.
-		 */
-
-		//Cache the margins of the original element
-		this._cacheMargins();
-
-		//Get the next scrolling parent
-		this.scrollParent = this.helper.scrollParent();
-
-		//The element's absolute position on the page minus margins
-		this.offset = this.currentItem.offset();
-		this.offset = {
-			top: this.offset.top - this.margins.top,
-			left: this.offset.left - this.margins.left
-		};
-
-		$.extend(this.offset, {
-			click: { //Where the click happened, relative to the element
-				left: event.pageX - this.offset.left,
-				top: event.pageY - this.offset.top
-			},
-			parent: this._getParentOffset(),
-			relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
-		});
-
-		// Only after we got the offset, we can change the helper's position to absolute
-		// TODO: Still need to figure out a way to make relative sorting possible
-		this.helper.css("position", "absolute");
-		this.cssPosition = this.helper.css("position");
-
-		//Generate the original position
-		this.originalPosition = this._generatePosition(event);
-		this.originalPageX = event.pageX;
-		this.originalPageY = event.pageY;
-
-		//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
-		(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
-
-		//Cache the former DOM position
-		this.domPosition = { prev: this.currentItem.prev()[0], parent: this.currentItem.parent()[0] };
-
-		//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
-		if(this.helper[0] != this.currentItem[0]) {
-			this.currentItem.hide();
-		}
-
-		//Create the placeholder
-		this._createPlaceholder();
-
-		//Set a containment if given in the options
-		if(o.containment)
-			this._setContainment();
-
-		if(o.cursor) { // cursor option
-			if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor");
-			$('body').css("cursor", o.cursor);
-		}
-
-		if(o.opacity) { // opacity option
-			if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity");
-			this.helper.css("opacity", o.opacity);
-		}
-
-		if(o.zIndex) { // zIndex option
-			if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex");
-			this.helper.css("zIndex", o.zIndex);
-		}
-
-		//Prepare scrolling
-		if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML')
-			this.overflowOffset = this.scrollParent.offset();
-
-		//Call callbacks
-		this._trigger("start", event, this._uiHash());
-
-		//Recache the helper size
-		if(!this._preserveHelperProportions)
-			this._cacheHelperProportions();
-
-
-		//Post 'activate' events to possible containers
-		if(!noActivation) {
-			 for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, this._uiHash(this)); }
-		}
-
-		//Prepare possible droppables
-		if($.ui.ddmanager)
-			$.ui.ddmanager.current = this;
-
-		if ($.ui.ddmanager && !o.dropBehaviour)
-			$.ui.ddmanager.prepareOffsets(this, event);
-
-		this.dragging = true;
-
-		this.helper.addClass("ui-sortable-helper");
-		this._mouseDrag(event); //Execute the drag once - this causes the helper not to be visible before getting its correct position
-		return true;
-
-	},
-
-	_mouseDrag: function(event) {
-
-		//Compute the helpers position
-		this.position = this._generatePosition(event);
-		this.positionAbs = this._convertPositionTo("absolute");
-
-		if (!this.lastPositionAbs) {
-			this.lastPositionAbs = this.positionAbs;
-		}
-
-		//Do scrolling
-		if(this.options.scroll) {
-			var o = this.options, scrolled = false;
-			if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {
-
-				if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
-					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
-				else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
-					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
-
-				if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
-					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
-				else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
-					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
-
-			} else {
-
-				if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
-					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
-				else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
-					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
-
-				if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
-					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
-				else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
-					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
-
-			}
-
-			if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
-				$.ui.ddmanager.prepareOffsets(this, event);
-		}
-
-		//Regenerate the absolute position used for position checks
-		this.positionAbs = this._convertPositionTo("absolute");
-
-		//Set the helper position
-		if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
-		if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
-
-		//Rearrange
-		for (var i = this.items.length - 1; i >= 0; i--) {
-
-			//Cache variables and intersection, continue if no intersection
-			var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);
-			if (!intersection) continue;
-
-			// Only put the placeholder inside the current Container, skip all
-			// items form other containers. This works because when moving
-			// an item from one container to another the
-			// currentContainer is switched before the placeholder is moved.
-			//
-			// Without this moving items in "sub-sortables" can cause the placeholder to jitter
-			// beetween the outer and inner container.
-			if (item.instance !== this.currentContainer) continue;
-
-			if (itemElement != this.currentItem[0] //cannot intersect with itself
-				&&	this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before
-				&&	!$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked
-				&& (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)
-				//&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container
-			) {
-
-				this.direction = intersection == 1 ? "down" : "up";
-
-				if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {
-					this._rearrange(event, item);
-				} else {
-					break;
-				}
-
-				this._trigger("change", event, this._uiHash());
-				break;
-			}
-		}
-
-		//Post events to containers
-		this._contactContainers(event);
-
-		//Interconnect with droppables
-		if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
-
-		//Call callbacks
-		this._trigger('sort', event, this._uiHash());
-
-		this.lastPositionAbs = this.positionAbs;
-		return false;
-
-	},
-
-	_mouseStop: function(event, noPropagation) {
-
-		if(!event) return;
-
-		//If we are using droppables, inform the manager about the drop
-		if ($.ui.ddmanager && !this.options.dropBehaviour)
-			$.ui.ddmanager.drop(this, event);
-
-		if(this.options.revert) {
-			var that = this;
-			var cur = this.placeholder.offset();
-
-			this.reverting = true;
-
-			$(this.helper).animate({
-				left: cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
-				top: cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)
-			}, parseInt(this.options.revert, 10) || 500, function() {
-				that._clear(event);
-			});
-		} else {
-			this._clear(event, noPropagation);
-		}
-
-		return false;
-
-	},
-
-	cancel: function() {
-
-		if(this.dragging) {
-
-			this._mouseUp({ target: null });
-
-			if(this.options.helper == "original")
-				this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
-			else
-				this.currentItem.show();
-
-			//Post deactivating events to containers
-			for (var i = this.containers.length - 1; i >= 0; i--){
-				this.containers[i]._trigger("deactivate", null, this._uiHash(this));
-				if(this.containers[i].containerCache.over) {
-					this.containers[i]._trigger("out", null, this._uiHash(this));
-					this.containers[i].containerCache.over = 0;
-				}
-			}
-
-		}
-
-		if (this.placeholder) {
-			//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
-			if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
-			if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove();
-
-			$.extend(this, {
-				helper: null,
-				dragging: false,
-				reverting: false,
-				_noFinalSort: null
-			});
-
-			if(this.domPosition.prev) {
-				$(this.domPosition.prev).after(this.currentItem);
-			} else {
-				$(this.domPosition.parent).prepend(this.currentItem);
-			}
-		}
-
-		return this;
-
-	},
-
-	serialize: function(o) {
-
-		var items = this._getItemsAsjQuery(o && o.connected);
-		var str = []; o = o || {};
-
-		$(items).each(function() {
-			var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
-			if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
-		});
-
-		if(!str.length && o.key) {
-			str.push(o.key + '=');
-		}
-
-		return str.join('&');
-
-	},
-
-	toArray: function(o) {
-
-		var items = this._getItemsAsjQuery(o && o.connected);
-		var ret = []; o = o || {};
-
-		items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });
-		return ret;
-
-	},
-
-	/* Be careful with the following core functions */
-	_intersectsWith: function(item) {
-
-		var x1 = this.positionAbs.left,
-			x2 = x1 + this.helperProportions.width,
-			y1 = this.positionAbs.top,
-			y2 = y1 + this.helperProportions.height;
-
-		var l = item.left,
-			r = l + item.width,
-			t = item.top,
-			b = t + item.height;
-
-		var dyClick = this.offset.click.top,
-			dxClick = this.offset.click.left;
-
-		var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;
-
-		if(	   this.options.tolerance == "pointer"
-			|| this.options.forcePointerForContainers
-			|| (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])
-		) {
-			return isOverElement;
-		} else {
-
-			return (l < x1 + (this.helperProportions.width / 2) // Right Half
-				&& x2 - (this.helperProportions.width / 2) < r // Left Half
-				&& t < y1 + (this.helperProportions.height / 2) // Bottom Half
-				&& y2 - (this.helperProportions.height / 2) < b ); // Top Half
-
-		}
-	},
-
-	_intersectsWithPointer: function(item) {
-
-		var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
-			isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
-			isOverElement = isOverElementHeight && isOverElementWidth,
-			verticalDirection = this._getDragVerticalDirection(),
-			horizontalDirection = this._getDragHorizontalDirection();
-
-		if (!isOverElement)
-			return false;
-
-		return this.floating ?
-			( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 )
-			: ( verticalDirection && (verticalDirection == "down" ? 2 : 1) );
-
-	},
-
-	_intersectsWithSides: function(item) {
-
-		var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
-			isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
-			verticalDirection = this._getDragVerticalDirection(),
-			horizontalDirection = this._getDragHorizontalDirection();
-
-		if (this.floating && horizontalDirection) {
-			return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf));
-		} else {
-			return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf));
-		}
-
-	},
-
-	_getDragVerticalDirection: function() {
-		var delta = this.positionAbs.top - this.lastPositionAbs.top;
-		return delta != 0 && (delta > 0 ? "down" : "up");
-	},
-
-	_getDragHorizontalDirection: function() {
-		var delta = this.positionAbs.left - this.lastPositionAbs.left;
-		return delta != 0 && (delta > 0 ? "right" : "left");
-	},
-
-	refresh: function(event) {
-		this._refreshItems(event);
-		this.refreshPositions();
-		return this;
-	},
-
-	_connectWith: function() {
-		var options = this.options;
-		return options.connectWith.constructor == String
-			? [options.connectWith]
-			: options.connectWith;
-	},
-
-	_getItemsAsjQuery: function(connected) {
-
-		var items = [];
-		var queries = [];
-		var connectWith = this._connectWith();
-
-		if(connectWith && connected) {
-			for (var i = connectWith.length - 1; i >= 0; i--){
-				var cur = $(connectWith[i]);
-				for (var j = cur.length - 1; j >= 0; j--){
-					var inst = $.data(cur[j], this.widgetName);
-					if(inst && inst != this && !inst.options.disabled) {
-						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]);
-					}
-				};
-			};
-		}
-
-		queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]);
-
-		for (var i = queries.length - 1; i >= 0; i--){
-			queries[i][0].each(function() {
-				items.push(this);
-			});
-		};
-
-		return $(items);
-
-	},
-
-	_removeCurrentsFromItems: function() {
-
-		var list = this.currentItem.find(":data(" + this.widgetName + "-item)");
-
-		this.items = $.grep(this.items, function (item) {
-			for (var j=0; j < list.length; j++) {
-				if(list[j] == item.item[0])
-					return false;
-			};
-			return true;
-		});
-
-	},
-
-	_refreshItems: function(event) {
-
-		this.items = [];
-		this.containers = [this];
-		var items = this.items;
-		var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];
-		var connectWith = this._connectWith();
-
-		if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
-			for (var i = connectWith.length - 1; i >= 0; i--){
-				var cur = $(connectWith[i]);
-				for (var j = cur.length - 1; j >= 0; j--){
-					var inst = $.data(cur[j], this.widgetName);
-					if(inst && inst != this && !inst.options.disabled) {
-						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
-						this.containers.push(inst);
-					}
-				};
-			};
-		}
-
-		for (var i = queries.length - 1; i >= 0; i--) {
-			var targetData = queries[i][1];
-			var _queries = queries[i][0];
-
-			for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) {
-				var item = $(_queries[j]);
-
-				item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager)
-
-				items.push({
-					item: item,
-					instance: targetData,
-					width: 0, height: 0,
-					left: 0, top: 0
-				});
-			};
-		};
-
-	},
-
-	refreshPositions: function(fast) {
-
-		//This has to be redone because due to the item being moved out/into the offsetParent, the offsetParent's position will change
-		if(this.offsetParent && this.helper) {
-			this.offset.parent = this._getParentOffset();
-		}
-
-		for (var i = this.items.length - 1; i >= 0; i--){
-			var item = this.items[i];
-
-			//We ignore calculating positions of all connected containers when we're not over them
-			if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])
-				continue;
-
-			var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
-
-			if (!fast) {
-				item.width = t.outerWidth();
-				item.height = t.outerHeight();
-			}
-
-			var p = t.offset();
-			item.left = p.left;
-			item.top = p.top;
-		};
-
-		if(this.options.custom && this.options.custom.refreshContainers) {
-			this.options.custom.refreshContainers.call(this);
-		} else {
-			for (var i = this.containers.length - 1; i >= 0; i--){
-				var p = this.containers[i].element.offset();
-				this.containers[i].containerCache.left = p.left;
-				this.containers[i].containerCache.top = p.top;
-				this.containers[i].containerCache.width	= this.containers[i].element.outerWidth();
-				this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
-			};
-		}
-
-		return this;
-	},
-
-	_createPlaceholder: function(that) {
-		that = that || this;
-		var o = that.options;
-
-		if(!o.placeholder || o.placeholder.constructor == String) {
-			var className = o.placeholder;
-			o.placeholder = {
-				element: function() {
-
-					var el = $(document.createElement(that.currentItem[0].nodeName))
-						.addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
-						.removeClass("ui-sortable-helper")[0];
-
-					if(!className)
-						el.style.visibility = "hidden";
-
-					return el;
-				},
-				update: function(container, p) {
-
-					// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
-					// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
-					if(className && !o.forcePlaceholderSize) return;
-
-					//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
-					if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css('paddingTop')||0, 10) - parseInt(that.currentItem.css('paddingBottom')||0, 10)); };
-					if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css('paddingLeft')||0, 10) - parseInt(that.currentItem.css('paddingRight')||0, 10)); };
-				}
-			};
-		}
-
-		//Create the placeholder
-		that.placeholder = $(o.placeholder.element.call(that.element, that.currentItem));
-
-		//Append it after the actual current item
-		that.currentItem.after(that.placeholder);
-
-		//Update the size of the placeholder (TODO: Logic to fuzzy, see line 316/317)
-		o.placeholder.update(that, that.placeholder);
-
-	},
-
-	_contactContainers: function(event) {
-
-		// get innermost container that intersects with item
-		var innermostContainer = null, innermostIndex = null;
-
-
-		for (var i = this.containers.length - 1; i >= 0; i--){
-
-			// never consider a container that's located within the item itself
-			if($.contains(this.currentItem[0], this.containers[i].element[0]))
-				continue;
-
-			if(this._intersectsWith(this.containers[i].containerCache)) {
-
-				// if we've already found a container and it's more "inner" than this, then continue
-				if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0]))
-					continue;
-
-				innermostContainer = this.containers[i];
-				innermostIndex = i;
-
-			} else {
-				// container doesn't intersect. trigger "out" event if necessary
-				if(this.containers[i].containerCache.over) {
-					this.containers[i]._trigger("out", event, this._uiHash(this));
-					this.containers[i].containerCache.over = 0;
-				}
-			}
-
-		}
-
-		// if no intersecting containers found, return
-		if(!innermostContainer) return;
-
-		// move the item into the container if it's not there already
-		if(this.containers.length === 1) {
-			this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
-			this.containers[innermostIndex].containerCache.over = 1;
-		} else {
-
-			//When entering a new container, we will find the item with the least distance and append our item near it
-			var dist = 10000; var itemWithLeastDistance = null;
-			var posProperty = this.containers[innermostIndex].floating ? 'left' : 'top';
-			var sizeProperty = this.containers[innermostIndex].floating ? 'width' : 'height';
-			var base = this.positionAbs[posProperty] + this.offset.click[posProperty];
-			for (var j = this.items.length - 1; j >= 0; j--) {
-				if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue;
-				if(this.items[j].item[0] == this.currentItem[0]) continue;
-				var cur = this.items[j].item.offset()[posProperty];
-				var nearBottom = false;
-				if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){
-					nearBottom = true;
-					cur += this.items[j][sizeProperty];
-				}
-
-				if(Math.abs(cur - base) < dist) {
-					dist = Math.abs(cur - base); itemWithLeastDistance = this.items[j];
-					this.direction = nearBottom ? "up": "down";
-				}
-			}
-
-			if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled
-				return;
-
-			this.currentContainer = this.containers[innermostIndex];
-			itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
-			this._trigger("change", event, this._uiHash());
-			this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
-
-			//Update the placeholder
-			this.options.placeholder.update(this.currentContainer, this.placeholder);
-
-			this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
-			this.containers[innermostIndex].containerCache.over = 1;
-		}
-
-
-	},
-
-	_createHelper: function(event) {
-
-		var o = this.options;
-		var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem);
-
-		if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already
-			$(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
-
-		if(helper[0] == this.currentItem[0])
-			this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };
-
-		if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());
-		if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());
-
-		return helper;
-
-	},
-
-	_adjustOffsetFromHelper: function(obj) {
-		if (typeof obj == 'string') {
-			obj = obj.split(' ');
-		}
-		if ($.isArray(obj)) {
-			obj = {left: +obj[0], top: +obj[1] || 0};
-		}
-		if ('left' in obj) {
-			this.offset.click.left = obj.left + this.margins.left;
-		}
-		if ('right' in obj) {
-			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
-		}
-		if ('top' in obj) {
-			this.offset.click.top = obj.top + this.margins.top;
-		}
-		if ('bottom' in obj) {
-			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
-		}
-	},
-
-	_getParentOffset: function() {
-
-
-		//Get the offsetParent and cache its position
-		this.offsetParent = this.helper.offsetParent();
-		var po = this.offsetParent.offset();
-
-		// This is a special case where we need to modify a offset calculated on start, since the following happened:
-		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
-		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
-		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
-		if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
-			po.left += this.scrollParent.scrollLeft();
-			po.top += this.scrollParent.scrollTop();
-		}
-
-		if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
-		|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix
-			po = { top: 0, left: 0 };
-
-		return {
-			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
-			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
-		};
-
-	},
-
-	_getRelativeOffset: function() {
-
-		if(this.cssPosition == "relative") {
-			var p = this.currentItem.position();
-			return {
-				top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
-				left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
-			};
-		} else {
-			return { top: 0, left: 0 };
-		}
-
-	},
-
-	_cacheMargins: function() {
-		this.margins = {
-			left: (parseInt(this.currentItem.css("marginLeft"),10) || 0),
-			top: (parseInt(this.currentItem.css("marginTop"),10) || 0)
-		};
-	},
-
-	_cacheHelperProportions: function() {
-		this.helperProportions = {
-			width: this.helper.outerWidth(),
-			height: this.helper.outerHeight()
-		};
-	},
-
-	_setContainment: function() {
-
-		var o = this.options;
-		if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
-		if(o.containment == 'document' || o.containment == 'window') this.containment = [
-			0 - this.offset.relative.left - this.offset.parent.left,
-			0 - this.offset.relative.top - this.offset.parent.top,
-			$(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
-			($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
-		];
-
-		if(!(/^(document|window|parent)$/).test(o.containment)) {
-			var ce = $(o.containment)[0];
-			var co = $(o.containment).offset();
-			var over = ($(ce).css("overflow") != 'hidden');
-
-			this.containment = [
-				co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
-				co.top + (parseInt($(ce).css("borderTopWidth"),10) || 0) + (parseInt($(ce).css("paddingTop"),10) || 0) - this.margins.top,
-				co.left+(over ? Math.max(ce.scrollWidth,ce.offsetWidth) : ce.offsetWidth) - (parseInt($(ce).css("borderLeftWidth"),10) || 0) - (parseInt($(ce).css("paddingRight"),10) || 0) - this.helperProportions.width - this.margins.left,
-				co.top+(over ? Math.max(ce.scrollHeight,ce.offsetHeight) : ce.offsetHeight) - (parseInt($(ce).css("borderTopWidth"),10) || 0) - (parseInt($(ce).css("paddingBottom"),10) || 0) - this.helperProportions.height - this.margins.top
-			];
-		}
-
-	},
-
-	_convertPositionTo: function(d, pos) {
-
-		if(!pos) pos = this.position;
-		var mod = d == "absolute" ? 1 : -1;
-		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
-
-		return {
-			top: (
-				pos.top																	// The absolute mouse position
-				+ this.offset.relative.top * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
-				+ this.offset.parent.top * mod											// The offsetParent's offset without borders (offset + border)
-				- ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
-			),
-			left: (
-				pos.left																// The absolute mouse position
-				+ this.offset.relative.left * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
-				+ this.offset.parent.left * mod											// The offsetParent's offset without borders (offset + border)
-				- ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
-			)
-		};
-
-	},
-
-	_generatePosition: function(event) {
-
-		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
-
-		// This is another very weird special case that only happens for relative elements:
-		// 1. If the css position is relative
-		// 2. and the scroll parent is the document or similar to the offset parent
-		// we have to refresh the relative offset during the scroll so there are no jumps
-		if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
-			this.offset.relative = this._getRelativeOffset();
-		}
-
-		var pageX = event.pageX;
-		var pageY = event.pageY;
-
-		/*
-		 * - Position constraining -
-		 * Constrain the position to a mix of grid, containment.
-		 */
-
-		if(this.originalPosition) { //If we are not dragging yet, we won't check for options
-
-			if(this.containment) {
-				if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
-				if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
-				if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
-				if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
-			}
-
-			if(o.grid) {
-				var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
-				pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
-
-				var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
-				pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
-			}
-
-		}
-
-		return {
-			top: (
-				pageY																// The absolute mouse position
-				- this.offset.click.top													// Click offset (relative to the element)
-				- this.offset.relative.top												// Only for relative positioned nodes: Relative offset from element to offset parent
-				- this.offset.parent.top												// The offsetParent's offset without borders (offset + border)
-				+ ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
-			),
-			left: (
-				pageX																// The absolute mouse position
-				- this.offset.click.left												// Click offset (relative to the element)
-				- this.offset.relative.left												// Only for relative positioned nodes: Relative offset from element to offset parent
-				- this.offset.parent.left												// The offsetParent's offset without borders (offset + border)
-				+ ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
-			)
-		};
-
-	},
-
-	_rearrange: function(event, i, a, hardRefresh) {
-
-		a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling));
-
-		//Various things done here to improve the performance:
-		// 1. we create a setTimeout, that calls refreshPositions
-		// 2. on the instance, we have a counter variable, that get's higher after every append
-		// 3. on the local scope, we copy the counter variable, and check in the timeout, if it's still the same
-		// 4. this lets only the last addition to the timeout stack through
-		this.counter = this.counter ? ++this.counter : 1;
-		var counter = this.counter;
-
-		this._delay(function() {
-			if(counter == this.counter) this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
-		});
-
-	},
-
-	_clear: function(event, noPropagation) {
-
-		this.reverting = false;
-		// We delay all events that have to be triggered to after the point where the placeholder has been removed and
-		// everything else normalized again
-		var delayedTriggers = [];
-
-		// We first have to update the dom position of the actual currentItem
-		// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
-		if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);
-		this._noFinalSort = null;
-
-		if(this.helper[0] == this.currentItem[0]) {
-			for(var i in this._storedCSS) {
-				if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = '';
-			}
-			this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
-		} else {
-			this.currentItem.show();
-		}
-
-		if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
-		if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
-
-		// Check if the items Container has Changed and trigger appropriate
-		// events.
-		if (this !== this.currentContainer) {
-			if(!noPropagation) {
-				delayedTriggers.push(function(event) { this._trigger("remove", event, this._uiHash()); });
-				delayedTriggers.push((function(c) { return function(event) { c._trigger("receive", event, this._uiHash(this)); };  }).call(this, this.currentContainer));
-				delayedTriggers.push((function(c) { return function(event) { c._trigger("update", event, this._uiHash(this));  }; }).call(this, this.currentContainer));
-			}
-		}
-
-
-		//Post events to containers
-		for (var i = this.containers.length - 1; i >= 0; i--){
-			if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
-			if(this.containers[i].containerCache.over) {
-				delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
-				this.containers[i].containerCache.over = 0;
-			}
-		}
-
-		//Do what was originally in plugins
-		if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor
-		if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity
-		if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index
-
-		this.dragging = false;
-		if(this.cancelHelperRemoval) {
-			if(!noPropagation) {
-				this._trigger("beforeStop", event, this._uiHash());
-				for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
-				this._trigger("stop", event, this._uiHash());
-			}
-
-			this.fromOutside = false;
-			return false;
-		}
-
-		if(!noPropagation) this._trigger("beforeStop", event, this._uiHash());
-
-		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
-		this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
-
-		if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;
-
-		if(!noPropagation) {
-			for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
-			this._trigger("stop", event, this._uiHash());
-		}
-
-		this.fromOutside = false;
-		return true;
-
-	},
-
-	_trigger: function() {
-		if ($.Widget.prototype._trigger.apply(this, arguments) === false) {
-			this.cancel();
-		}
-	},
-
-	_uiHash: function(_inst) {
-		var inst = _inst || this;
-		return {
-			helper: inst.helper,
-			placeholder: inst.placeholder || $([]),
-			position: inst.position,
-			originalPosition: inst.originalPosition,
-			offset: inst.positionAbs,
-			item: inst.currentItem,
-			sender: _inst ? _inst.element : null
-		};
-	}
-
-});
-
-})(jQuery);
-(function( $, undefined ) {
-
-var uid = 0,
-	hideProps = {},
-	showProps = {};
-
-hideProps.height = hideProps.paddingTop = hideProps.paddingBottom =
-	hideProps.borderTopWidth = hideProps.borderBottomWidth = "hide";
-showProps.height = showProps.paddingTop = showProps.paddingBottom =
-	showProps.borderTopWidth = showProps.borderBottomWidth = "show";
-
-$.widget( "ui.accordion", {
-	version: "1.9.2",
-	options: {
-		active: 0,
-		animate: {},
-		collapsible: false,
-		event: "click",
-		header: "> li > :first-child,> :not(li):even",
-		heightStyle: "auto",
-		icons: {
-			activeHeader: "ui-icon-triangle-1-s",
-			header: "ui-icon-triangle-1-e"
-		},
-
-		// callbacks
-		activate: null,
-		beforeActivate: null
-	},
-
-	_create: function() {
-		var accordionId = this.accordionId = "ui-accordion-" +
-				(this.element.attr( "id" ) || ++uid),
-			options = this.options;
-
-		this.prevShow = this.prevHide = $();
-		this.element.addClass( "ui-accordion ui-widget ui-helper-reset" );
-
-		this.headers = this.element.find( options.header )
-			.addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" );
-		this._hoverable( this.headers );
-		this._focusable( this.headers );
-
-		this.headers.next()
-			.addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
-			.hide();
-
-		// don't allow collapsible: false and active: false / null
-		if ( !options.collapsible && (options.active === false || options.active == null) ) {
-			options.active = 0;
-		}
-		// handle negative values
-		if ( options.active < 0 ) {
-			options.active += this.headers.length;
-		}
-		this.active = this._findActive( options.active )
-			.addClass( "ui-accordion-header-active ui-state-active" )
-			.toggleClass( "ui-corner-all ui-corner-top" );
-		this.active.next()
-			.addClass( "ui-accordion-content-active" )
-			.show();
-
-		this._createIcons();
-		this.refresh();
-
-		// ARIA
-		this.element.attr( "role", "tablist" );
-
-		this.headers
-			.attr( "role", "tab" )
-			.each(function( i ) {
-				var header = $( this ),
-					headerId = header.attr( "id" ),
-					panel = header.next(),
-					panelId = panel.attr( "id" );
-				if ( !headerId ) {
-					headerId = accordionId + "-header-" + i;
-					header.attr( "id", headerId );
-				}
-				if ( !panelId ) {
-					panelId = accordionId + "-panel-" + i;
-					panel.attr( "id", panelId );
-				}
-				header.attr( "aria-controls", panelId );
-				panel.attr( "aria-labelledby", headerId );
-			})
-			.next()
-				.attr( "role", "tabpanel" );
-
-		this.headers
-			.not( this.active )
-			.attr({
-				"aria-selected": "false",
-				tabIndex: -1
-			})
-			.next()
-				.attr({
-					"aria-expanded": "false",
-					"aria-hidden": "true"
-				})
-				.hide();
-
-		// make sure at least one header is in the tab order
-		if ( !this.active.length ) {
-			this.headers.eq( 0 ).attr( "tabIndex", 0 );
-		} else {
-			this.active.attr({
-				"aria-selected": "true",
-				tabIndex: 0
-			})
-			.next()
-				.attr({
-					"aria-expanded": "true",
-					"aria-hidden": "false"
-				});
-		}
-
-		this._on( this.headers, { keydown: "_keydown" });
-		this._on( this.headers.next(), { keydown: "_panelKeyDown" });
-		this._setupEvents( options.event );
-	},
-
-	_getCreateEventData: function() {
-		return {
-			header: this.active,
-			content: !this.active.length ? $() : this.active.next()
-		};
-	},
-
-	_createIcons: function() {
-		var icons = this.options.icons;
-		if ( icons ) {
-			$( "<span>" )
-				.addClass( "ui-accordion-header-icon ui-icon " + icons.header )
-				.prependTo( this.headers );
-			this.active.children( ".ui-accordion-header-icon" )
-				.removeClass( icons.header )
-				.addClass( icons.activeHeader );
-			this.headers.addClass( "ui-accordion-icons" );
-		}
-	},
-
-	_destroyIcons: function() {
-		this.headers
-			.removeClass( "ui-accordion-icons" )
-			.children( ".ui-accordion-header-icon" )
-				.remove();
-	},
-
-	_destroy: function() {
-		var contents;
-
-		// clean up main element
-		this.element
-			.removeClass( "ui-accordion ui-widget ui-helper-reset" )
-			.removeAttr( "role" );
-
-		// clean up headers
-		this.headers
-			.removeClass( "ui-accordion-header ui-accordion-header-active ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top" )
-			.removeAttr( "role" )
-			.removeAttr( "aria-selected" )
-			.removeAttr( "aria-controls" )
-			.removeAttr( "tabIndex" )
-			.each(function() {
-				if ( /^ui-accordion/.test( this.id ) ) {
-					this.removeAttribute( "id" );
-				}
-			});
-		this._destroyIcons();
-
-		// clean up content panels
-		contents = this.headers.next()
-			.css( "display", "" )
-			.removeAttr( "role" )
-			.removeAttr( "aria-expanded" )
-			.removeAttr( "aria-hidden" )
-			.removeAttr( "aria-labelledby" )
-			.removeClass( "ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-state-disabled" )
-			.each(function() {
-				if ( /^ui-accordion/.test( this.id ) ) {
-					this.removeAttribute( "id" );
-				}
-			});
-		if ( this.options.heightStyle !== "content" ) {
-			contents.css( "height", "" );
-		}
-	},
-
-	_setOption: function( key, value ) {
-		if ( key === "active" ) {
-			// _activate() will handle invalid values and update this.options
-			this._activate( value );
-			return;
-		}
-
-		if ( key === "event" ) {
-			if ( this.options.event ) {
-				this._off( this.headers, this.options.event );
-			}
-			this._setupEvents( value );
-		}
-
-		this._super( key, value );
-
-		// setting collapsible: false while collapsed; open first panel
-		if ( key === "collapsible" && !value && this.options.active === false ) {
-			this._activate( 0 );
-		}
-
-		if ( key === "icons" ) {
-			this._destroyIcons();
-			if ( value ) {
-				this._createIcons();
-			}
-		}
-
-		// #5332 - opacity doesn't cascade to positioned elements in IE
-		// so we need to add the disabled class to the headers and panels
-		if ( key === "disabled" ) {
-			this.headers.add( this.headers.next() )
-				.toggleClass( "ui-state-disabled", !!value );
-		}
-	},
-
-	_keydown: function( event ) {
-		if ( event.altKey || event.ctrlKey ) {
-			return;
-		}
-
-		var keyCode = $.ui.keyCode,
-			length = this.headers.length,
-			currentIndex = this.headers.index( event.target ),
-			toFocus = false;
-
-		switch ( event.keyCode ) {
-			case keyCode.RIGHT:
-			case keyCode.DOWN:
-				toFocus = this.headers[ ( currentIndex + 1 ) % length ];
-				break;
-			case keyCode.LEFT:
-			case keyCode.UP:
-				toFocus = this.headers[ ( currentIndex - 1 + length ) % length ];
-				break;
-			case keyCode.SPACE:
-			case keyCode.ENTER:
-				this._eventHandler( event );
-				break;
-			case keyCode.HOME:
-				toFocus = this.headers[ 0 ];
-				break;
-			case keyCode.END:
-				toFocus = this.headers[ length - 1 ];
-				break;
-		}
-
-		if ( toFocus ) {
-			$( event.target ).attr( "tabIndex", -1 );
-			$( toFocus ).attr( "tabIndex", 0 );
-			toFocus.focus();
-			event.preventDefault();
-		}
-	},
-
-	_panelKeyDown : function( event ) {
-		if ( event.keyCode === $.ui.keyCode.UP && event.ctrlKey ) {
-			$( event.currentTarget ).prev().focus();
-		}
-	},
-
-	refresh: function() {
-		var maxHeight, overflow,
-			heightStyle = this.options.heightStyle,
-			parent = this.element.parent();
-
-
-		if ( heightStyle === "fill" ) {
-			// IE 6 treats height like minHeight, so we need to turn off overflow
-			// in order to get a reliable height
-			// we use the minHeight support test because we assume that only
-			// browsers that don't support minHeight will treat height as minHeight
-			if ( !$.support.minHeight ) {
-				overflow = parent.css( "overflow" );
-				parent.css( "overflow", "hidden");
-			}
-			maxHeight = parent.height();
-			this.element.siblings( ":visible" ).each(function() {
-				var elem = $( this ),
-					position = elem.css( "position" );
-
-				if ( position === "absolute" || position === "fixed" ) {
-					return;
-				}
-				maxHeight -= elem.outerHeight( true );
-			});
-			if ( overflow ) {
-				parent.css( "overflow", overflow );
-			}
-
-			this.headers.each(function() {
-				maxHeight -= $( this ).outerHeight( true );
-			});
-
-			this.headers.next()
-				.each(function() {
-					$( this ).height( Math.max( 0, maxHeight -
-						$( this ).innerHeight() + $( this ).height() ) );
-				})
-				.css( "overflow", "auto" );
-		} else if ( heightStyle === "auto" ) {
-			maxHeight = 0;
-			this.headers.next()
-				.each(function() {
-					maxHeight = Math.max( maxHeight, $( this ).css( "height", "" ).height() );
-				})
-				.height( maxHeight );
-		}
-	},
-
-	_activate: function( index ) {
-		var active = this._findActive( index )[ 0 ];
-
-		// trying to activate the already active panel
-		if ( active === this.active[ 0 ] ) {
-			return;
-		}
-
-		// trying to collapse, simulate a click on the currently active header
-		active = active || this.active[ 0 ];
-
-		this._eventHandler({
-			target: active,
-			currentTarget: active,
-			preventDefault: $.noop
-		});
-	},
-
-	_findActive: function( selector ) {
-		return typeof selector === "number" ? this.headers.eq( selector ) : $();
-	},
-
-	_setupEvents: function( event ) {
-		var events = {};
-		if ( !event ) {
-			return;
-		}
-		$.each( event.split(" "), function( index, eventName ) {
-			events[ eventName ] = "_eventHandler";
-		});
-		this._on( this.headers, events );
-	},
-
-	_eventHandler: function( event ) {
-		var options = this.options,
-			active = this.active,
-			clicked = $( event.currentTarget ),
-			clickedIsActive = clicked[ 0 ] === active[ 0 ],
-			collapsing = clickedIsActive && options.collapsible,
-			toShow = collapsing ? $() : clicked.next(),
-			toHide = active.next(),
-			eventData = {
-				oldHeader: active,
-				oldPanel: toHide,
-				newHeader: collapsing ? $() : clicked,
-				newPanel: toShow
-			};
-
-		event.preventDefault();
-
-		if (
-				// click on active header, but not collapsible
-				( clickedIsActive && !options.collapsible ) ||
-				// allow canceling activation
-				( this._trigger( "beforeActivate", event, eventData ) === false ) ) {
-			return;
-		}
-
-		options.active = collapsing ? false : this.headers.index( clicked );
-
-		// when the call to ._toggle() comes after the class changes
-		// it causes a very odd bug in IE 8 (see #6720)
-		this.active = clickedIsActive ? $() : clicked;
-		this._toggle( eventData );
-
-		// switch classes
-		// corner classes on the previously active header stay after the animation
-		active.removeClass( "ui-accordion-header-active ui-state-active" );
-		if ( options.icons ) {
-			active.children( ".ui-accordion-header-icon" )
-				.removeClass( options.icons.activeHeader )
-				.addClass( options.icons.header );
-		}
-
-		if ( !clickedIsActive ) {
-			clicked
-				.removeClass( "ui-corner-all" )
-				.addClass( "ui-accordion-header-active ui-state-active ui-corner-top" );
-			if ( options.icons ) {
-				clicked.children( ".ui-accordion-header-icon" )
-					.removeClass( options.icons.header )
-					.addClass( options.icons.activeHeader );
-			}
-
-			clicked
-				.next()
-				.addClass( "ui-accordion-content-active" );
-		}
-	},
-
-	_toggle: function( data ) {
-		var toShow = data.newPanel,
-			toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
-
-		// handle activating a panel during the animation for another activation
-		this.prevShow.add( this.prevHide ).stop( true, true );
-		this.prevShow = toShow;
-		this.prevHide = toHide;
-
-		if ( this.options.animate ) {
-			this._animate( toShow, toHide, data );
-		} else {
-			toHide.hide();
-			toShow.show();
-			this._toggleComplete( data );
-		}
-
-		toHide.attr({
-			"aria-expanded": "false",
-			"aria-hidden": "true"
-		});
-		toHide.prev().attr( "aria-selected", "false" );
-		// if we're switching panels, remove the old header from the tab order
-		// if we're opening from collapsed state, remove the previous header from the tab order
-		// if we're collapsing, then keep the collapsing header in the tab order
-		if ( toShow.length && toHide.length ) {
-			toHide.prev().attr( "tabIndex", -1 );
-		} else if ( toShow.length ) {
-			this.headers.filter(function() {
-				return $( this ).attr( "tabIndex" ) === 0;
-			})
-			.attr( "tabIndex", -1 );
-		}
-
-		toShow
-			.attr({
-				"aria-expanded": "true",
-				"aria-hidden": "false"
-			})
-			.prev()
-				.attr({
-					"aria-selected": "true",
-					tabIndex: 0
-				});
-	},
-
-	_animate: function( toShow, toHide, data ) {
-		var total, easing, duration,
-			that = this,
-			adjust = 0,
-			down = toShow.length &&
-				( !toHide.length || ( toShow.index() < toHide.index() ) ),
-			animate = this.options.animate || {},
-			options = down && animate.down || animate,
-			complete = function() {
-				that._toggleComplete( data );
-			};
-
-		if ( typeof options === "number" ) {
-			duration = options;
-		}
-		if ( typeof options === "string" ) {
-			easing = options;
-		}
-		// fall back from options to animation in case of partial down settings
-		easing = easing || options.easing || animate.easing;
-		duration = duration || options.duration || animate.duration;
-
-		if ( !toHide.length ) {
-			return toShow.animate( showProps, duration, easing, complete );
-		}
-		if ( !toShow.length ) {
-			return toHide.animate( hideProps, duration, easing, complete );
-		}
-
-		total = toShow.show().outerHeight();
-		toHide.animate( hideProps, {
-			duration: duration,
-			easing: easing,
-			step: function( now, fx ) {
-				fx.now = Math.round( now );
-			}
-		});
-		toShow
-			.hide()
-			.animate( showProps, {
-				duration: duration,
-				easing: easing,
-				complete: complete,
-				step: function( now, fx ) {
-					fx.now = Math.round( now );
-					if ( fx.prop !== "height" ) {
-						adjust += fx.now;
-					} else if ( that.options.heightStyle !== "content" ) {
-						fx.now = Math.round( total - toHide.outerHeight() - adjust );
-						adjust = 0;
-					}
-				}
-			});
-	},
-
-	_toggleComplete: function( data ) {
-		var toHide = data.oldPanel;
-
-		toHide
-			.removeClass( "ui-accordion-content-active" )
-			.prev()
-				.removeClass( "ui-corner-top" )
-				.addClass( "ui-corner-all" );
-
-		// Work around for rendering bug in IE (#5421)
-		if ( toHide.length ) {
-			toHide.parent()[0].className = toHide.parent()[0].className;
-		}
-
-		this._trigger( "activate", null, data );
-	}
-});
-
-
-
-// DEPRECATED
-if ( $.uiBackCompat !== false ) {
-	// navigation options
-	(function( $, prototype ) {
-		$.extend( prototype.options, {
-			navigation: false,
-			navigationFilter: function() {
-				return this.href.toLowerCase() === location.href.toLowerCase();
-			}
-		});
-
-		var _create = prototype._create;
-		prototype._create = function() {
-			if ( this.options.navigation ) {
-				var that = this,
-					headers = this.element.find( this.options.header ),
-					content = headers.next(),
-					current = headers.add( content )
-						.find( "a" )
-						.filter( this.options.navigationFilter )
-						[ 0 ];
-				if ( current ) {
-					headers.add( content ).each( function( index ) {
-						if ( $.contains( this, current ) ) {
-							that.options.active = Math.floor( index / 2 );
-							return false;
-						}
-					});
-				}
-			}
-			_create.call( this );
-		};
-	}( jQuery, jQuery.ui.accordion.prototype ) );
-
-	// height options
-	(function( $, prototype ) {
-		$.extend( prototype.options, {
-			heightStyle: null, // remove default so we fall back to old values
-			autoHeight: true, // use heightStyle: "auto"
-			clearStyle: false, // use heightStyle: "content"
-			fillSpace: false // use heightStyle: "fill"
-		});
-
-		var _create = prototype._create,
-			_setOption = prototype._setOption;
-
-		$.extend( prototype, {
-			_create: function() {
-				this.options.heightStyle = this.options.heightStyle ||
-					this._mergeHeightStyle();
-
-				_create.call( this );
-			},
-
-			_setOption: function( key ) {
-				if ( key === "autoHeight" || key === "clearStyle" || key === "fillSpace" ) {
-					this.options.heightStyle = this._mergeHeightStyle();
-				}
-				_setOption.apply( this, arguments );
-			},
-
-			_mergeHeightStyle: function() {
-				var options = this.options;
-
-				if ( options.fillSpace ) {
-					return "fill";
-				}
-
-				if ( options.clearStyle ) {
-					return "content";
-				}
-
-				if ( options.autoHeight ) {
-					return "auto";
-				}
-			}
-		});
-	}( jQuery, jQuery.ui.accordion.prototype ) );
-
-	// icon options
-	(function( $, prototype ) {
-		$.extend( prototype.options.icons, {
-			activeHeader: null, // remove default so we fall back to old values
-			headerSelected: "ui-icon-triangle-1-s"
-		});
-
-		var _createIcons = prototype._createIcons;
-		prototype._createIcons = function() {
-			if ( this.options.icons ) {
-				this.options.icons.activeHeader = this.options.icons.activeHeader ||
-					this.options.icons.headerSelected;
-			}
-			_createIcons.call( this );
-		};
-	}( jQuery, jQuery.ui.accordion.prototype ) );
-
-	// expanded active option, activate method
-	(function( $, prototype ) {
-		prototype.activate = prototype._activate;
-
-		var _findActive = prototype._findActive;
-		prototype._findActive = function( index ) {
-			if ( index === -1 ) {
-				index = false;
-			}
-			if ( index && typeof index !== "number" ) {
-				index = this.headers.index( this.headers.filter( index ) );
-				if ( index === -1 ) {
-					index = false;
-				}
-			}
-			return _findActive.call( this, index );
-		};
-	}( jQuery, jQuery.ui.accordion.prototype ) );
-
-	// resize method
-	jQuery.ui.accordion.prototype.resize = jQuery.ui.accordion.prototype.refresh;
-
-	// change events
-	(function( $, prototype ) {
-		$.extend( prototype.options, {
-			change: null,
-			changestart: null
-		});
-
-		var _trigger = prototype._trigger;
-		prototype._trigger = function( type, event, data ) {
-			var ret = _trigger.apply( this, arguments );
-			if ( !ret ) {
-				return false;
-			}
-
-			if ( type === "beforeActivate" ) {
-				ret = _trigger.call( this, "changestart", event, {
-					oldHeader: data.oldHeader,
-					oldContent: data.oldPanel,
-					newHeader: data.newHeader,
-					newContent: data.newPanel
-				});
-			} else if ( type === "activate" ) {
-				ret = _trigger.call( this, "change", event, {
-					oldHeader: data.oldHeader,
-					oldContent: data.oldPanel,
-					newHeader: data.newHeader,
-					newContent: data.newPanel
-				});
-			}
-			return ret;
-		};
-	}( jQuery, jQuery.ui.accordion.prototype ) );
-
-	// animated option
-	// NOTE: this only provides support for "slide", "bounceslide", and easings
-	// not the full $.ui.accordion.animations API
-	(function( $, prototype ) {
-		$.extend( prototype.options, {
-			animate: null,
-			animated: "slide"
-		});
-
-		var _create = prototype._create;
-		prototype._create = function() {
-			var options = this.options;
-			if ( options.animate === null ) {
-				if ( !options.animated ) {
-					options.animate = false;
-				} else if ( options.animated === "slide" ) {
-					options.animate = 300;
-				} else if ( options.animated === "bounceslide" ) {
-					options.animate = {
-						duration: 200,
-						down: {
-							easing: "easeOutBounce",
-							duration: 1000
-						}
-					};
-				} else {
-					options.animate = options.animated;
-				}
-			}
-
-			_create.call( this );
-		};
-	}( jQuery, jQuery.ui.accordion.prototype ) );
-}
-
-})( jQuery );
Index: nc/admin/default-templates/js/jquery/jquery.autocomplete.js
===================================================================
--- inc/admin/default-templates/js/jquery/jquery.autocomplete.js	(revision 1085)
+++ 	(revision )
@@ -1,808 +1,0 @@
-/*
- * jQuery Autocomplete plugin 1.1
- *
- * Copyright (c) 2009 Jörn Zaefferer
- *
- * Dual licensed under the MIT and GPL licenses:
- *   http://www.opensource.org/licenses/mit-license.php
- *   http://www.gnu.org/licenses/gpl.html
- *
- * Revision: $Id: jquery.autocomplete.js 15 2009-08-22 10:30:27Z joern.zaefferer $
- */
-
-;(function($) {
-	
-$.fn.extend({
-	autocomplete: function(urlOrData, options) {
-		var isUrl = typeof urlOrData == "string";
-		options = $.extend({}, $.Autocompleter.defaults, {
-			url: isUrl ? urlOrData : null,
-			data: isUrl ? null : urlOrData,
-			delay: isUrl ? $.Autocompleter.defaults.delay : 10,
-			max: options && !options.scroll ? 10 : 150
-		}, options);
-		
-		// if highlight is set to false, replace it with a do-nothing function
-		options.highlight = options.highlight || function(value) { return value; };
-		
-		// if the formatMatch option is not specified, then use formatItem for backwards compatibility
-		options.formatMatch = options.formatMatch || options.formatItem;
-		
-		return this.each(function() {
-			new $.Autocompleter(this, options);
-		});
-	},
-	result: function(handler) {
-		return this.bind("result", handler);
-	},
-	search: function(handler) {
-		return this.trigger("search", [handler]);
-	},
-	flushCache: function() {
-		return this.trigger("flushCache");
-	},
-	setOptions: function(options){
-		return this.trigger("setOptions", [options]);
-	},
-	unautocomplete: function() {
-		return this.trigger("unautocomplete");
-	}
-});
-
-$.Autocompleter = function(input, options) {
-
-	var KEY = {
-		UP: 38,
-		DOWN: 40,
-		DEL: 46,
-		TAB: 9,
-		RETURN: 13,
-		ESC: 27,
-		COMMA: 188,
-		PAGEUP: 33,
-		PAGEDOWN: 34,
-		BACKSPACE: 8
-	};
-
-	// Create $ object for input element
-	var $input = $(input).attr("autocomplete", "off").addClass(options.inputClass);
-
-	var timeout;
-	var previousValue = "";
-	var cache = $.Autocompleter.Cache(options);
-	var hasFocus = 0;
-	var lastKeyPressCode;
-	var config = {
-		mouseDownOnSelect: false
-	};
-	var select = $.Autocompleter.Select(options, input, selectCurrent, config);
-	
-	var blockSubmit;
-	
-	// prevent form submit in opera when selecting with return key
-	$.browser.opera && $(input.form).bind("submit.autocomplete", function() {
-		if (blockSubmit) {
-			blockSubmit = false;
-			return false;
-		}
-	});
-	
-	// only opera doesn't trigger keydown multiple times while pressed, others don't work with keypress at all
-	$input.bind(($.browser.opera ? "keypress" : "keydown") + ".autocomplete", function(event) {
-		// a keypress means the input has focus
-		// avoids issue where input had focus before the autocomplete was applied
-		hasFocus = 1;
-		// track last key pressed
-		lastKeyPressCode = event.keyCode;
-		switch(event.keyCode) {
-		
-			case KEY.UP:
-				event.preventDefault();
-				if ( select.visible() ) {
-					select.prev();
-				} else {
-					onChange(0, true);
-				}
-				break;
-				
-			case KEY.DOWN:
-				event.preventDefault();
-				if ( select.visible() ) {
-					select.next();
-				} else {
-					onChange(0, true);
-				}
-				break;
-				
-			case KEY.PAGEUP:
-				event.preventDefault();
-				if ( select.visible() ) {
-					select.pageUp();
-				} else {
-					onChange(0, true);
-				}
-				break;
-				
-			case KEY.PAGEDOWN:
-				event.preventDefault();
-				if ( select.visible() ) {
-					select.pageDown();
-				} else {
-					onChange(0, true);
-				}
-				break;
-			
-			// matches also semicolon
-			case options.multiple && $.trim(options.multipleSeparator) == "," && KEY.COMMA:
-			case KEY.TAB:
-			case KEY.RETURN:
-				if( selectCurrent() ) {
-					// stop default to prevent a form submit, Opera needs special handling
-					event.preventDefault();
-					blockSubmit = true;
-					return false;
-				}
-				break;
-				
-			case KEY.ESC:
-				select.hide();
-				break;
-				
-			default:
-				clearTimeout(timeout);
-				timeout = setTimeout(onChange, options.delay);
-				break;
-		}
-	}).focus(function(){
-		// track whether the field has focus, we shouldn't process any
-		// results if the field no longer has focus
-		hasFocus++;
-	}).blur(function() {
-		hasFocus = 0;
-		if (!config.mouseDownOnSelect) {
-			hideResults();
-		}
-	}).click(function() {
-		// show select when clicking in a focused field
-		if ( hasFocus++ > 1 && !select.visible() ) {
-			onChange(0, true);
-		}
-	}).bind("search", function() {
-		// TODO why not just specifying both arguments?
-		var fn = (arguments.length > 1) ? arguments[1] : null;
-		function findValueCallback(q, data) {
-			var result;
-			if( data && data.length ) {
-				for (var i=0; i < data.length; i++) {
-					if( data[i].result.toLowerCase() == q.toLowerCase() ) {
-						result = data[i];
-						break;
-					}
-				}
-			}
-			if( typeof fn == "function" ) fn(result);
-			else $input.trigger("result", result && [result.data, result.value]);
-		}
-		$.each(trimWords($input.val()), function(i, value) {
-			request(value, findValueCallback, findValueCallback);
-		});
-	}).bind("flushCache", function() {
-		cache.flush();
-	}).bind("setOptions", function() {
-		$.extend(options, arguments[1]);
-		// if we've updated the data, repopulate
-		if ( "data" in arguments[1] )
-			cache.populate();
-	}).bind("unautocomplete", function() {
-		select.unbind();
-		$input.unbind();
-		$(input.form).unbind(".autocomplete");
-	});
-	
-	
-	function selectCurrent() {
-		var selected = select.selected();
-		if( !selected )
-			return false;
-		
-		var v = selected.result;
-		previousValue = v;
-		
-		if ( options.multiple ) {
-			var words = trimWords($input.val());
-			if ( words.length > 1 ) {
-				var seperator = options.multipleSeparator.length;
-				var cursorAt = $(input).selection().start;
-				var wordAt, progress = 0;
-				$.each(words, function(i, word) {
-					progress += word.length;
-					if (cursorAt <= progress) {
-						wordAt = i;
-						return false;
-					}
-					progress += seperator;
-				});
-				words[wordAt] = v;
-				// TODO this should set the cursor to the right position, but it gets overriden somewhere
-				//$.Autocompleter.Selection(input, progress + seperator, progress + seperator);
-				v = words.join( options.multipleSeparator );
-			}
-			v += options.multipleSeparator;
-		}
-		
-		$input.val(v);
-		hideResultsNow();
-		$input.trigger("result", [selected.data, selected.value]);
-		return true;
-	}
-	
-	function onChange(crap, skipPrevCheck) {
-		if( lastKeyPressCode == KEY.DEL ) {
-			select.hide();
-			return;
-		}
-		
-		var currentValue = $input.val();
-		
-		if ( !skipPrevCheck && currentValue == previousValue )
-			return;
-		
-		previousValue = currentValue;
-		
-		currentValue = lastWord(currentValue);
-		if ( currentValue.length >= options.minChars) {
-			$input.addClass(options.loadingClass);
-			if (!options.matchCase)
-				currentValue = currentValue.toLowerCase();
-			request(currentValue, receiveData, hideResultsNow);
-		} else {
-			stopLoading();
-			select.hide();
-		}
-	};
-	
-	function trimWords(value) {
-		if (!value)
-			return [""];
-		if (!options.multiple)
-			return [$.trim(value)];
-		return $.map(value.split(options.multipleSeparator), function(word) {
-			return $.trim(value).length ? $.trim(word) : null;
-		});
-	}
-	
-	function lastWord(value) {
-		if ( !options.multiple )
-			return value;
-		var words = trimWords(value);
-		if (words.length == 1) 
-			return words[0];
-		var cursorAt = $(input).selection().start;
-		if (cursorAt == value.length) {
-			words = trimWords(value)
-		} else {
-			words = trimWords(value.replace(value.substring(cursorAt), ""));
-		}
-		return words[words.length - 1];
-	}
-	
-	// fills in the input box w/the first match (assumed to be the best match)
-	// q: the term entered
-	// sValue: the first matching result
-	function autoFill(q, sValue){
-		// autofill in the complete box w/the first match as long as the user hasn't entered in more data
-		// if the last user key pressed was backspace, don't autofill
-		if( options.autoFill && (lastWord($input.val()).toLowerCase() == q.toLowerCase()) && lastKeyPressCode != KEY.BACKSPACE ) {
-			// fill in the value (keep the case the user has typed)
-			$input.val($input.val() + sValue.substring(lastWord(previousValue).length));
-			// select the portion of the value not typed by the user (so the next character will erase)
-			$(input).selection(previousValue.length, previousValue.length + sValue.length);
-		}
-	};
-
-	function hideResults() {
-		clearTimeout(timeout);
-		timeout = setTimeout(hideResultsNow, 200);
-	};
-
-	function hideResultsNow() {
-		var wasVisible = select.visible();
-		select.hide();
-		clearTimeout(timeout);
-		stopLoading();
-		if (options.mustMatch) {
-			// call search and run callback
-			$input.search(
-				function (result){
-					// if no value found, clear the input box
-					if( !result ) {
-						if (options.multiple) {
-							var words = trimWords($input.val()).slice(0, -1);
-							$input.val( words.join(options.multipleSeparator) + (words.length ? options.multipleSeparator : "") );
-						}
-						else {
-							$input.val( "" );
-							$input.trigger("result", null);
-						}
-					}
-				}
-			);
-		}
-	};
-
-	function receiveData(q, data) {
-		if ( data && data.length && hasFocus ) {
-			stopLoading();
-			select.display(data, q);
-			autoFill(q, data[0].value);
-			select.show();
-		} else {
-			hideResultsNow();
-		}
-	};
-
-	function request(term, success, failure) {
-		if (!options.matchCase)
-			term = term.toLowerCase();
-		var data = cache.load(term);
-		// recieve the cached data
-		if (data && data.length) {
-			success(term, data);
-		// if an AJAX url has been supplied, try loading the data now
-		} else if( (typeof options.url == "string") && (options.url.length > 0) ){
-			
-			var extraParams = {
-				timestamp: +new Date()
-			};
-			$.each(options.extraParams, function(key, param) {
-				extraParams[key] = typeof param == "function" ? param() : param;
-			});
-			
-			$.ajax({
-				// try to leverage ajaxQueue plugin to abort previous requests
-				mode: "abort",
-				// limit abortion to this input
-				port: "autocomplete" + input.name,
-				dataType: options.dataType,
-				url: options.url,
-				data: $.extend({
-					q: lastWord(term),
-					limit: options.max
-				}, extraParams),
-				success: function(data) {
-					var parsed = options.parse && options.parse(data) || parse(data);
-					cache.add(term, parsed);
-					success(term, parsed);
-				}
-			});
-		} else {
-			// if we have a failure, we need to empty the list -- this prevents the the [TAB] key from selecting the last successful match
-			select.emptyList();
-			failure(term);
-		}
-	};
-	
-	function parse(data) {
-		var parsed = [];
-		var rows = data.split("\n");
-		for (var i=0; i < rows.length; i++) {
-			var row = $.trim(rows[i]);
-			if (row) {
-				row = row.split("|");
-				parsed[parsed.length] = {
-					data: row,
-					value: row[0],
-					result: options.formatResult && options.formatResult(row, row[0]) || row[0]
-				};
-			}
-		}
-		return parsed;
-	};
-
-	function stopLoading() {
-		$input.removeClass(options.loadingClass);
-	};
-
-};
-
-$.Autocompleter.defaults = {
-	inputClass: "ac_input",
-	resultsClass: "ac_results",
-	loadingClass: "ac_loading",
-	minChars: 1,
-	delay: 400,
-	matchCase: false,
-	matchSubset: true,
-	matchContains: false,
-	cacheLength: 10,
-	max: 100,
-	mustMatch: false,
-	extraParams: {},
-	selectFirst: true,
-	formatItem: function(row) { return row[0]; },
-	formatMatch: null,
-	autoFill: false,
-	width: 0,
-	multiple: false,
-	multipleSeparator: ", ",
-	highlight: function(value, term) {
-		return value.replace(new RegExp("(?![^&;]+;)(?!<[^<>]*)(" + term.replace(/([\^\$\(\)\[\]\{\}\*\.\+\?\|\\])/gi, "\\$1") + ")(?![^<>]*>)(?![^&;]+;)", "gi"), "<strong>$1</strong>");
-	},
-    scroll: true,
-    scrollHeight: 180
-};
-
-$.Autocompleter.Cache = function(options) {
-
-	var data = {};
-	var length = 0;
-	
-	function matchSubset(s, sub) {
-		if (!options.matchCase) 
-			s = s.toLowerCase();
-		var i = s.indexOf(sub);
-		if (options.matchContains == "word"){
-			i = s.toLowerCase().search("\\b" + sub.toLowerCase());
-		}
-		if (i == -1) return false;
-		return i == 0 || options.matchContains;
-	};
-	
-	function add(q, value) {
-		if (length > options.cacheLength){
-			flush();
-		}
-		if (!data[q]){ 
-			length++;
-		}
-		data[q] = value;
-	}
-	
-	function populate(){
-		if( !options.data ) return false;
-		// track the matches
-		var stMatchSets = {},
-			nullData = 0;
-
-		// no url was specified, we need to adjust the cache length to make sure it fits the local data store
-		if( !options.url ) options.cacheLength = 1;
-		
-		// track all options for minChars = 0
-		stMatchSets[""] = [];
-		
-		// loop through the array and create a lookup structure
-		for ( var i = 0, ol = options.data.length; i < ol; i++ ) {
-			var rawValue = options.data[i];
-			// if rawValue is a string, make an array otherwise just reference the array
-			rawValue = (typeof rawValue == "string") ? [rawValue] : rawValue;
-			
-			var value = options.formatMatch(rawValue, i+1, options.data.length);
-			if ( value === false )
-				continue;
-				
-			var firstChar = value.charAt(0).toLowerCase();
-			// if no lookup array for this character exists, look it up now
-			if( !stMatchSets[firstChar] ) 
-				stMatchSets[firstChar] = [];
-
-			// if the match is a string
-			var row = {
-				value: value,
-				data: rawValue,
-				result: options.formatResult && options.formatResult(rawValue) || value
-			};
-			
-			// push the current match into the set list
-			stMatchSets[firstChar].push(row);
-
-			// keep track of minChars zero items
-			if ( nullData++ < options.max ) {
-				stMatchSets[""].push(row);
-			}
-		};
-
-		// add the data items to the cache
-		$.each(stMatchSets, function(i, value) {
-			// increase the cache size
-			options.cacheLength++;
-			// add to the cache
-			add(i, value);
-		});
-	}
-	
-	// populate any existing data
-	setTimeout(populate, 25);
-	
-	function flush(){
-		data = {};
-		length = 0;
-	}
-	
-	return {
-		flush: flush,
-		add: add,
-		populate: populate,
-		load: function(q) {
-			if (!options.cacheLength || !length)
-				return null;
-			/* 
-			 * if dealing w/local data and matchContains than we must make sure
-			 * to loop through all the data collections looking for matches
-			 */
-			if( !options.url && options.matchContains ){
-				// track all matches
-				var csub = [];
-				// loop through all the data grids for matches
-				for( var k in data ){
-					// don't search through the stMatchSets[""] (minChars: 0) cache
-					// this prevents duplicates
-					if( k.length > 0 ){
-						var c = data[k];
-						$.each(c, function(i, x) {
-							// if we've got a match, add it to the array
-							if (matchSubset(x.value, q)) {
-								csub.push(x);
-							}
-						});
-					}
-				}				
-				return csub;
-			} else 
-			// if the exact item exists, use it
-			if (data[q]){
-				return data[q];
-			} else
-			if (options.matchSubset) {
-				for (var i = q.length - 1; i >= options.minChars; i--) {
-					var c = data[q.substr(0, i)];
-					if (c) {
-						var csub = [];
-						$.each(c, function(i, x) {
-							if (matchSubset(x.value, q)) {
-								csub[csub.length] = x;
-							}
-						});
-						return csub;
-					}
-				}
-			}
-			return null;
-		}
-	};
-};
-
-$.Autocompleter.Select = function (options, input, select, config) {
-	var CLASSES = {
-		ACTIVE: "ac_over"
-	};
-	
-	var listItems,
-		active = -1,
-		data,
-		term = "",
-		needsInit = true,
-		element,
-		list;
-	
-	// Create results
-	function init() {
-		if (!needsInit)
-			return;
-		element = $("<div/>")
-		.hide()
-		.addClass(options.resultsClass)
-		.css("position", "absolute")
-		.appendTo(document.body);
-	
-		list = $("<ul/>").appendTo(element).mouseover( function(event) {
-			if(target(event).nodeName && target(event).nodeName.toUpperCase() == 'LI') {
-	            active = $("li", list).removeClass(CLASSES.ACTIVE).index(target(event));
-			    $(target(event)).addClass(CLASSES.ACTIVE);            
-	        }
-		}).click(function(event) {
-			$(target(event)).addClass(CLASSES.ACTIVE);
-			select();
-			// TODO provide option to avoid setting focus again after selection? useful for cleanup-on-focus
-			input.focus();
-			return false;
-		}).mousedown(function() {
-			config.mouseDownOnSelect = true;
-		}).mouseup(function() {
-			config.mouseDownOnSelect = false;
-		});
-		
-		if( options.width > 0 )
-			element.css("width", options.width);
-			
-		needsInit = false;
-	} 
-	
-	function target(event) {
-		var element = event.target;
-		while(element && element.tagName != "LI")
-			element = element.parentNode;
-		// more fun with IE, sometimes event.target is empty, just ignore it then
-		if(!element)
-			return [];
-		return element;
-	}
-
-	function moveSelect(step) {
-		listItems.slice(active, active + 1).removeClass(CLASSES.ACTIVE);
-		movePosition(step);
-        var activeItem = listItems.slice(active, active + 1).addClass(CLASSES.ACTIVE);
-        if(options.scroll) {
-            var offset = 0;
-            listItems.slice(0, active).each(function() {
-				offset += this.offsetHeight;
-			});
-            if((offset + activeItem[0].offsetHeight - list.scrollTop()) > list[0].clientHeight) {
-                list.scrollTop(offset + activeItem[0].offsetHeight - list.innerHeight());
-            } else if(offset < list.scrollTop()) {
-                list.scrollTop(offset);
-            }
-        }
-	};
-	
-	function movePosition(step) {
-		active += step;
-		if (active < 0) {
-			active = listItems.size() - 1;
-		} else if (active >= listItems.size()) {
-			active = 0;
-		}
-	}
-	
-	function limitNumberOfItems(available) {
-		return options.max && options.max < available
-			? options.max
-			: available;
-	}
-	
-	function fillList() {
-		list.empty();
-		var max = limitNumberOfItems(data.length);
-		for (var i=0; i < max; i++) {
-			if (!data[i])
-				continue;
-			var formatted = options.formatItem(data[i].data, i+1, max, data[i].value, term);
-			if ( formatted === false )
-				continue;
-			var li = $("<li/>").html( options.highlight(formatted, term) ).addClass(i%2 == 0 ? "ac_even" : "ac_odd").appendTo(list)[0];
-			$.data(li, "ac_data", data[i]);
-		}
-		listItems = list.find("li");
-		if ( options.selectFirst ) {
-			listItems.slice(0, 1).addClass(CLASSES.ACTIVE);
-			active = 0;
-		}
-		// apply bgiframe if available
-		if ( $.fn.bgiframe )
-			list.bgiframe();
-	}
-	
-	return {
-		display: function(d, q) {
-			init();
-			data = d;
-			term = q;
-			fillList();
-		},
-		next: function() {
-			moveSelect(1);
-		},
-		prev: function() {
-			moveSelect(-1);
-		},
-		pageUp: function() {
-			if (active != 0 && active - 8 < 0) {
-				moveSelect( -active );
-			} else {
-				moveSelect(-8);
-			}
-		},
-		pageDown: function() {
-			if (active != listItems.size() - 1 && active + 8 > listItems.size()) {
-				moveSelect( listItems.size() - 1 - active );
-			} else {
-				moveSelect(8);
-			}
-		},
-		hide: function() {
-			element && element.hide();
-			listItems && listItems.removeClass(CLASSES.ACTIVE);
-			active = -1;
-		},
-		visible : function() {
-			return element && element.is(":visible");
-		},
-		current: function() {
-			return this.visible() && (listItems.filter("." + CLASSES.ACTIVE)[0] || options.selectFirst && listItems[0]);
-		},
-		show: function() {
-			var offset = $(input).offset();
-			element.css({
-				width: typeof options.width == "string" || options.width > 0 ? options.width : $(input).width(),
-				top: offset.top + input.offsetHeight,
-				left: offset.left
-			}).show();
-            if(options.scroll) {
-                list.scrollTop(0);
-                list.css({
-					maxHeight: options.scrollHeight,
-					overflow: 'auto'
-				});
-				
-                if($.browser.msie && typeof document.body.style.maxHeight === "undefined") {
-					var listHeight = 0;
-					listItems.each(function() {
-						listHeight += this.offsetHeight;
-					});
-					var scrollbarsVisible = listHeight > options.scrollHeight;
-                    list.css('height', scrollbarsVisible ? options.scrollHeight : listHeight );
-					if (!scrollbarsVisible) {
-						// IE doesn't recalculate width when scrollbar disappears
-						listItems.width( list.width() - parseInt(listItems.css("padding-left")) - parseInt(listItems.css("padding-right")) );
-					}
-                }
-                
-            }
-		},
-		selected: function() {
-			var selected = listItems && listItems.filter("." + CLASSES.ACTIVE).removeClass(CLASSES.ACTIVE);
-			return selected && selected.length && $.data(selected[0], "ac_data");
-		},
-		emptyList: function (){
-			list && list.empty();
-		},
-		unbind: function() {
-			element && element.remove();
-		}
-	};
-};
-
-$.fn.selection = function(start, end) {
-	if (start !== undefined) {
-		return this.each(function() {
-			if( this.createTextRange ){
-				var selRange = this.createTextRange();
-				if (end === undefined || start == end) {
-					selRange.move("character", start);
-					selRange.select();
-				} else {
-					selRange.collapse(true);
-					selRange.moveStart("character", start);
-					selRange.moveEnd("character", end);
-					selRange.select();
-				}
-			} else if( this.setSelectionRange ){
-				this.setSelectionRange(start, end);
-			} else if( this.selectionStart ){
-				this.selectionStart = start;
-				this.selectionEnd = end;
-			}
-		});
-	}
-	var field = this[0];
-	if ( field.createTextRange ) {
-		var range = document.selection.createRange(),
-			orig = field.value,
-			teststring = "<->",
-			textLength = range.text.length;
-		range.text = teststring;
-		var caretAt = field.value.indexOf(teststring);
-		field.value = orig;
-		this.selection(caretAt, caretAt + textLength);
-		return {
-			start: caretAt,
-			end: caretAt + textLength
-		}
-	} else if( field.selectionStart !== undefined ){
-		return {
-			start: field.selectionStart,
-			end: field.selectionEnd
-		}
-	}
-};
-
-})(jQuery);
Index: nc/admin/default-templates/js/jquery/jquery.bgFade.js
===================================================================
--- inc/admin/default-templates/js/jquery/jquery.bgFade.js	(revision 1056)
+++ 	(revision )
@@ -1,70 +1,0 @@
-jQuery.fn.backgroundFade = function(s,callback) {
-	var defaults = {
-		sColor: [255,0,0],
-		eColor: [255,255,255],
-		fColor: null,
-		steps: 200,
-		intervals: 5,
-		powr: 4
-	},
-	
-	params = jQuery.extend(defaults,s);
-	
-	return this.each(function() {
-		this.bgFade_sColor = jQuery.backgroundFade.parseHexColor(params.sColor);
-		this.bgFade_eColor = jQuery.backgroundFade.parseHexColor(params.eColor);
-		this.bgFade_fColor = params.fColor ? params.fColor : jQuery(this).css('backgroundColor');
-		this.bgFade_steps = params.steps;
-		this.bgFade_intervals = params.intervals;
-		this.bgFade_powr = params.powr;
-		this.bgFade_fn = callback;
-		
-		jQuery.backgroundFade.doFade(this);
-	});
-};
-
-jQuery.backgroundFade = {
-	parseHexColor: function(c) {
-		if (c.constructor == String && c.substr(0,1) == '#') {
-			return [parseInt(c.substr(1,2),16),parseInt(c.substr(3,2),16),parseInt(c.substr(5,2),16)];
-		}
-		return c;
-	},
-	
-	easeInOut: function(minValue,maxValue,totalSteps,actualStep,powr) {
-		var delta = maxValue - minValue;
-		var stepp = minValue+(Math.pow(((1 / totalSteps)*actualStep),powr)*delta);
-		return Math.ceil(stepp);
-	},
-	
-	doFade: function(e) {
-		if (e.bgFadeInt) window.clearInterval(e.bgFadeInt);
-		var act_step = 0;
-		
-		e.bgFadeInt = window.setInterval(function() {
-			e.style.backgroundColor =
-			"rgb("+
-			jQuery.backgroundFade.easeInOut(e.bgFade_sColor[0],e.bgFade_eColor[0],
-				e.bgFade_steps,act_step,e.bgFade_powr)+","+
-			jQuery.backgroundFade.easeInOut(e.bgFade_sColor[1],e.bgFade_eColor[1],
-				e.bgFade_steps,act_step,e.bgFade_powr)+","+
-			jQuery.backgroundFade.easeInOut(e.bgFade_sColor[2],e.bgFade_eColor[2],
-				e.bgFade_steps,act_step,e.bgFade_powr)+")";
-			
-			act_step++;
-			if (act_step > e.bgFade_steps) {
-				window.clearInterval(e.bgFadeInt);
-				e.bgFade_sColor = undefined;
-				e.bgFade_eColor = undefined;
-				e.bgFade_fColor = undefined;
-				e.bgFade_steps = undefined;
-				e.bgFade_intervals = undefined;
-				e.bgFade_powr = undefined;
-				if (typeof(e.bgFade_fn) == 'function') {
-					e.bgFade_fn.call(e);
-				}
-				e.style.backgroundColor = e.bgFade_fColor;
-			}
-		},e.bgFade_intervals);
-	}
-};
Index: nc/admin/default-templates/js/jquery/jquery.biscuit.js
===================================================================
--- inc/admin/default-templates/js/jquery/jquery.biscuit.js	(revision 1056)
+++ 	(revision )
@@ -1,89 +1,0 @@
-/**
- * Cookie plugin
- *
- * Copyright (c) 2006 Klaus Hartl (stilbuero.de)
- * Dual licensed under the MIT and GPL licenses:
- * http://www.opensource.org/licenses/mit-license.php
- * http://www.gnu.org/licenses/gpl.html
- *
- */
-
-/**
- * Create a cookie with the given name and value and other optional parameters.
- *
- * @example $.cookie('the_cookie', 'the_value');
- * @desc Set the value of a cookie.
- * @example $.cookie('the_cookie', 'the_value', {expires: 7, path: '/', domain: 'jquery.com', secure: true});
- * @desc Create a cookie with all available options.
- * @example $.cookie('the_cookie', 'the_value');
- * @desc Create a session cookie.
- * @example $.cookie('the_cookie', '', {expires: -1});
- * @desc Delete a cookie by setting a date in the past.
- *
- * @param String name The name of the cookie.
- * @param String value The value of the cookie.
- * @param Object options An object literal containing key/value pairs to provide optional cookie attributes.
- * @option Number|Date expires Either an integer specifying the expiration date from now on in days or a Date object.
- *                             If a negative value is specified (e.g. a date in the past), the cookie will be deleted.
- *                             If set to null or omitted, the cookie will be a session cookie and will not be retained
- *                             when the the browser exits.
- * @option String path The value of the path atribute of the cookie (default: path of page that created the cookie).
- * @option String domain The value of the domain attribute of the cookie (default: domain of page that created the cookie).
- * @option Boolean secure If true, the secure attribute of the cookie will be set and the cookie transmission will
- *                        require a secure protocol (like HTTPS).
- * @type undefined
- *
- * @name $.cookie
- * @cat Plugins/Cookie
- * @author Klaus Hartl/klaus.hartl@stilbuero.de
- */
-
-/**
- * Get the value of a cookie with the given name.
- *
- * @example $.cookie('the_cookie');
- * @desc Get the value of a cookie.
- *
- * @param String name The name of the cookie.
- * @return The value of the cookie.
- * @type String
- *
- * @name $.cookie
- * @cat Plugins/Cookie
- * @author Klaus Hartl/klaus.hartl@stilbuero.de
- */
-jQuery.cookie = function(name, value, options) {
-    if (typeof value != 'undefined') { // name and value given, set cookie
-        options = options || {};
-        var expires = '';
-        if (options.expires && (typeof options.expires == 'number' || options.expires.toGMTString)) {
-            var date;
-            if (typeof options.expires == 'number') {
-                date = new Date();
-                date.setTime(date.getTime() + (options.expires * 24 * 60 * 60 * 1000));
-            } else {
-                date = options.expires;
-            }
-            expires = '; expires=' + date.toGMTString(); // use expires attribute, max-age is not supported by IE
-        }
-        var path = options.path ? '; path=' + options.path : '';
-        var domain = options.domain ? '; domain=' + options.domain : '';
-        var secure = options.secure ? '; secure' : '';
-        document.cookie = [name, '=', encodeURIComponent(value), expires, path, domain, secure].join('');
-	   return null;
-    } else { // only name given, get cookie
-        var cookieValue = null;
-        if (document.cookie && document.cookie != '') {
-            var cookies = document.cookie.split(';');
-            for (var i = 0; i < cookies.length; i++) {
-                var cookie = jQuery.trim(cookies[i]);
-                // Does this cookie string begin with the name we want?
-                if (cookie.substring(0, name.length + 1) == (name + '=')) {
-                    cookieValue = decodeURIComponent(cookie.substring(name.length + 1));
-                    break;
-                }
-            }
-        }
-        return cookieValue;
-    }
-};
Index: nc/admin/default-templates/js/jquery/jquery.candyUpload.js
===================================================================
--- inc/admin/default-templates/js/jquery/jquery.candyUpload.js	(revision 1056)
+++ 	(revision )
@@ -1,644 +1,0 @@
-(function($) {
-	// We need to create a global SWFUpload object to store instances
-	window.SWFUpload = {
-		instances: new Array(),
-		movieCount: 0,
-		version: "2.2.0 Beta 2",
-		QUEUE_ERROR: {
-			QUEUE_LIMIT_EXCEEDED:	-100,
-			FILE_EXCEEDS_SIZE_LIMIT:	-110,
-			ZERO_BYTE_FILE:		-120,
-			INVALID_FILETYPE:		-130
-		},
-		UPLOAD_ERROR: {
-			HTTP_ERROR:				-200,
-			MISSING_UPLOAD_URL:			-210,
-			IO_ERROR:					-220,
-			SECURITY_ERROR:			-230,
-			UPLOAD_LIMIT_EXCEEDED:		-240,
-			UPLOAD_FAILED:				-250,
-			SPECIFIED_FILE_ID_NOT_FOUND:	-260,
-			FILE_VALIDATION_FAILED:		-270,
-			FILE_CANCELLED:			-280,
-			UPLOAD_STOPPED:			-290
-		},
-		FILE_STATUS: {
-			QUEUED:		-1,
-			IN_PROGRESS:	-2,
-			ERROR:		-3,
-			COMPLETE:		-4,
-			CANCELLED:	-5
-		},
-		BUTTON_ACTION: {
-			SELECT_FILE:	-100,
-			SELECT_FILES:	-110,
-			START_UPLOAD:	-120
-		},
-		CURSOR: {
-			ARROW:	-1,
-			HAND:	-2
-		},
-		WINDOW_MODE: {
-			WINDOW:		'window',
-			TRANSPARENT:	'transparent',
-			OPAQUE:		'opaque'
-		}
-	};
-	
-	$.uploader = function(settings,callbacks) {
-		return new $._uploader(settings,callbacks);
-	};
-	
-	$._uploader = function(settings,callbacks) {
-		var defaults = {
-			debug: false,
-			upload_url: '',
-			flash_movie: '',
-			movie_name: null,
-			params: null,
-			use_query_string: null,
-			requeue_on_error: false,
-			file_types: '*.*',
-			file_types_description: 'All files',
-			file_size_limit: 0,
-			file_upload_limit: 0,
-			file_queue_limit: -1,
-			target_element: null
-		};
-		this.params = $.extend(defaults,settings);
-		
-		var default_callbacks = {
-			flashReady: function() {},
-			fileDialogComplete: function() {},
-			fileDialogStart: function() {},
-			fileQueued: function() {},
-			fileQueueError: function() {},
-			uploadStart: function() {},
-			uploadProgress: function() {},
-			uploadError: function() {},
-			uploadSuccess: function() {},
-			uploadComplete: function() {},
-			debug: function() {}
-		};
-		this.callbacks = $.extend(default_callbacks,callbacks);
-		
-		return this.build();
-	};
-	
-	$._uploader.prototype = {
-		log: function(msg) {
-			if (!this.params.debug) { return; }
-			try {
-				console.log(msg);
-			} catch(e) {}
-		},
-		
-		/* Constructor */
-		build: function(settings) {
-			if (!this.params.upload_url || !this.params.movie_name) {
-				throw('Configuration error. Please make sure you specified movie_name and upload_url options.');
-			}
-			
-			if ($.browser.opera) {
-				return this;
-			}
-			
-			// Get a real bytes size limit (if we want to reuse it somewhere)
-			this.params.file_size_limit = this.getFileSizeLimit(this.params.file_size_limit);
-			
-			// Flash vars
-			var fv = new Array();
-			this.addFlashVar(fv,'debugEnabled',this.params.debug);
-			this.addFlashVar(fv,'movieName',this.params.movie_name);
-			this.addFlashVar(fv,'uploadURL',this.params.upload_url);
-			this.addFlashVar(fv,'fileTypes',this.params.file_types);
-			this.addFlashVar(fv,'fileTypesDescription',this.params.file_types_description);
-			this.addFlashVar(fv,'params',this.params.params);
-			this.addFlashVar(fv,'fileSizeLimit',this.params.file_size_limit + 'b');
-			this.addFlashVar(fv,'fileUploadLimit',this.params.file_upload_limit);
-			this.addFlashVar(fv,'fileQueueLimit',this.params.file_queue_limit);
-			this.addFlashVar(fv,'requeueOnError',this.params.requeue_on_error);
-			this.addFlashVar(fv,'buttonImageURL','');
-			this.addFlashVar(fv,'buttonWidth',500);
-			this.addFlashVar(fv,'buttonHeight',500);
-			this.addFlashVar(fv,'buttonText','');
-			this.addFlashVar(fv,'buttonTextTopPadding',0);
-			this.addFlashVar(fv,'buttonTextLeftPadding',0);
-			this.addFlashVar(fv,'buttonTextStyle','');
-			this.addFlashVar(fv,'buttonAction',this.params.upload_limit == 1 ? -100 : -110);
-			this.addFlashVar(fv,'buttonDisabled',false);
-			this.addFlashVar(fv,'buttonCursor',-2);
-			this.addFlashVar(fv,'button_window_mode','window');
-			
-			// Create SWFUpload Instance
-			this.flashBind();
-			
-			// Flash object
-			var flash =
-			'<object id="' + this.params.movie_name + '" data="' + this.params.flash_movie + '" ' +
-			'type="application/x-shockwave-flash" width="10" height="10">' +
-			'<param name="movie" value="' + this.params.flash_movie + '" />'+
-			'<param name="wmode" value="transparent" />'+
-			'<param name="menu" value="false" />'+
-			'<param name="allowScriptAccess" value="always" />'+
-			'<param name="flashvars" value="' + fv.join('&amp;') + '" />'+
-			'</object>';
-			
-			// Flash container
-			this.container = $('<span></span>');
-			if (this.params.target_element == null) {
-				this.container.css({
-					display: 'block',
-					position: 'absolute',
-					left: $(document).scrollLeft()+'px',
-					top: $(document).scrollTop()+'px',
-					width: '30px',
-					height: '30px',
-					background: '#f00'
-				});
-				
-				$('body').append(this.container);
-			} else {
-				$(this.params.target_element).append(this.container);
-				this.container.css({
-					display: 'block',
-					position: 'absolute',
-					top: 0,
-					left: 0,
-					zIndex: 1
-				});
-			}
-			this.container[0].innerHTML = flash;
-			this.movie = document.getElementById(this.params.movie_name);
-			
-			return this;
-		},
-		
-		addFlashVar: function(fv,n,v) {
-			if (v != null) {
-				fv.push(n + '=' + encodeURIComponent(v));
-			}
-		},
-		
-		// Bind flash events to callbacks.events
-		flashBind: function() {
-			_this = this;
-			var events = {
-				flashReady: function() {
-					if (window[_this.params.movie_name] == undefined) {
-						window[_this.params.movie_name] = _this.movie;
-					}
-					_this.flashBindEvent('flashReady',arguments);
-				},
-				fileDialogComplete: function() { _this.flashBindEvent('fileDialogComplete',arguments); },
-				fileDialogStart: function() { _this.flashBindEvent('fileDialogStart',arguments); },
-				fileQueued: function(file_object) { _this.flashBindEvent('fileQueued',arguments); },
-				fileQueueError: function(file_object,error_code,error_msg) { _this.flashBindEvent('fileQueueError',arguments); },
-				uploadStart: function() { _this.flashBindEvent('uploadStart',arguments); },
-				uploadProgress: function() { _this.flashBindEvent('uploadProgress',arguments); },
-				uploadError: function() { _this.flashBindEvent('uploadError',arguments); },
-				uploadSuccess: function() { _this.flashBindEvent('uploadSuccess',arguments); },
-				uploadComplete: function() { _this.flashBindEvent('uploadComplete',arguments); },
-				debug: function() { _this.flashBindEvent('debug',arguments); }
-			};
-			window.SWFUpload.instances[this.params.movie_name] = events;
-			window.SWFUpload.movieCount++;
-		},
-		
-		// Each flash event is called as callbacks.events([arg],...) with this = uploader object
-		flashEventQueue: [],
-		flashBindEvent: function(evt,a) {
-			a = a || new Array();
-			
-			var _this = this;
-			if ($.isFunction(this.callbacks[evt])) {
-				// Queue the event
-				this.flashEventQueue.push(function () {
-						this.callbacks[evt].apply(this,a);
-				});
-				
-				// Execute the next queued event
-				setTimeout(function () {
-					_this.flashExecuteNextEvent();
-				},0);
-			} else if (this.callbacks[evt] !== null) {
-				throw 'Event handler ' + evt + ' is unknown or is not a function';
-			}
-
-		},
-		flashExecuteNextEvent: function() {
-			var f = this.flashEventQueue ? this.flashEventQueue.shift() : null;
-			if ($.isFunction(f)) {
-				f.apply(this);
-			}
-		},
-		
-		destroy: function() {
-			try {
-				this.StopUpload();
-				$(this.movie).remove();
-				SWFUpload.instances[this.params.movie_name] = null;
-				SWFUpload.movieCount--;
-				delete SWFUpload.instances[this.movieName];
-				delete window[this.movieName];
-				
-				return true;
-			} catch(e) {
-				return false;
-			}
-		},
-		
-		// Flash uploader functions
-		StartUpload: function(file_id) {
-			return this.movie.StartUpload(file_id);
-		},
-		ReturnUploadStart: function(value) {
-			return this.movie.ReturnUploadStart(value);
-		},
-		StopUpload: function() {
-			return this.movie.StopUpload();
-		},
-		CancelUpload: function(file_id) {
-			return this.movie.CancelUpload(file_id);
-		},
-		GetStats: function() {
-			return this.movie.GetStats();
-		},
-		SetStats: function(stats) {
-			return this.movie.SetStats(stats);
-		},
-		GetFile: function(file_id) {
-			return this.movie.GetFile(file_id);
-		},
-		GetFileByIndex: function(file_index) {
-			return this.movie.GetFileByIndex(file_index);
-		},
-		
-		// Size formater, that's better
-		getFileSizeLimit: function(size) {
-			var value = 0;
-			var unit = 'kb';
-			
-			size = $.trim(size.toLowerCase());
-			
-			var values = size.match(/^\d+/);
-			if (values != null && values.length > 0) {
-				value = parseInt(values[0]);
-			}
-			
-			var units = size.match(/(b|kb|mb|gb)/);
-			if (units != null && units.length > 0) {
-				unit = units[0];
-			}
-			
-			var multiplier = 1024;
-			if (unit === "b") {
-				multiplier = 1;
-			} else if (unit === "mb") {
-				multiplier = 1048576;
-			} else if (unit === "gb") {
-				multiplier = 1073741824;
-			}
-			
-			return value * multiplier;
-		}
-	};
-})(jQuery);
-
-(function($) {
-	$.fn.candyUpload = function(settings,callbacks) {
-		new $._candyUpload(this,settings,callbacks);
-		return this;
-	};
-	
-	$._candyUpload = function(target,settings,callbacks) {
-		var defaults = {
-			debug: false,
-			upload_url: '',
-			params: null,
-			flash_movie: '',
-			file_types: '*.*',
-			file_types_description: 'All files',
-			file_size_limit: 0,
-			file_upload_limit: 0,
-			file_queue_limit: -1,
-			
-			callbacks: {} // Put here all callbacks you want, named as in $.uploader events
-		};
-		this.params = $.extend(defaults,settings);
-		this.params.movie_name = 'SWFU-' + (window.SWFUpload.instances.length + 1);
-		this.target = target;
-		
-		// Create controls
-		this.createControls();
-		
-		this.target.hide().after(this.ctrl.block).hide();
-		this.params.target_element = this.ctrl.btn_browse.parent().get(0);
-		
-		// Uploader init
-		var _this = this;
-		this.upldr = $.uploader(this.params,{
-			debug: function(msg) {
-				$('body').append('<pre class="debug">' + msg + '</pre>');
-				_this.bindEvent('debug',arguments);
-			},
-			flashReady: function() {
-				_this.initControls(this);
-				_this.bindEvent('flashReady',arguments);
-				
-				this.movie.style.width = _this.ctrl.btn_browse.width()+'px';
-				this.movie.style.height = _this.ctrl.btn_browse.height()+'px';
-			},
-			fileDialogComplete: function(num_ref_files,num_queue_files) {
-				_this.bindEvent('fileDialogComplete',arguments);
-			},
-			fileDialogStart: function() {
-				_this.bindEvent('fileQueued',arguments);
-			},
-			fileQueued: function(o) {
-				_this.appendFile(this,o);
-				_this.refreshControls(this);
-				_this.bindEvent('fileQueued',arguments);
-			},
-			fileQueueError: function(o,code,msg) {
-				var codes = window.SWFUpload.QUEUE_ERROR;
-				switch (code) {
-					case codes.QUEUE_LIMIT_EXCEEDED:
-						_this.queueErrorMsg(_this.locales.limit_exceeded);
-						break;
-					case codes.FILE_EXCEEDS_SIZE_LIMIT:
-						_this.queueErrorMsg(_this.locales.size_limit_exceeded);
-						break;
-					case codes.ZERO_BYTE_FILE:
-					case codes.INVALID_FILETYPE:
-						_this.queueErrorMsg(msg);
-						break;
-				}
-				_this.bindEvent('fileQueueError',arguments);
-			},
-			uploadStart: function() {
-				this.ReturnUploadStart(true);
-				_this.bindEvent('uploadStart',arguments);
-			},
-			uploadProgress: function(o,bytes,total) {
-				_this.fileProgressBar(o.id,bytes,total);
-				_this.bindEvent('uploadProgress',arguments);
-			},
-			uploadError: function(o,code,msg) {
-				var codes = window.SWFUpload.UPLOAD_ERROR;
-				switch (code) {
-					case codes.FILE_CANCELLED:
-						_this.fileErrorMsg(o.id,_this.locales.canceled);
-						break;
-					case codes.HTTP_ERROR:
-						_this.fileErrorMsg(o.id,_this.locales.http_error + ' ' + msg);
-						break;
-					case codes.MISSING_UPLOAD_URL:
-					case codes.IO_ERROR:
-					case codes.SECURITY_ERROR:
-					case codes.UPLOAD_LIMIT_EXCEEDED:
-					case codes.UPLOAD_FAILED:
-					case codes.SPECIFIED_FILE_ID_NOT_FOUND:
-					case codes.FILE_VALIDATION_FAILED:
-					case codes.FILE_CANCELLED:
-					case codes.UPLOAD_STOPPED:
-						_this.fileErrorMsg(o.id,_this.locales.error + ' ' + msg);
-						break;
-				}
-				_this.refreshControls(this);
-				_this.removeFileCancel(o);
-				_this.bindEvent('uploadError',arguments);
-			},
-			uploadSuccess: function(o,data) {
-				_this.fileProgressBar(o.id,1,1);
-				_this.refreshControls(this);
-				_this.removeFileCancel(o);
-				_this.bindEvent('uploadSuccess',arguments);
-			},
-			uploadComplete: function(o) {
-				// Once completed, start next queued upload
-				this.StartUpload();
-				_this.refreshControls(this);
-				_this.bindEvent('uploadComplete',arguments);
-			}
-		});
-	};
-	
-	$._candyUpload.prototype = {
-		locales: {
-			max_file_size: 'Maximum file size allowed:',
-			limit_exceeded: 'Limit exceeded.',
-			size_limit_exceeded: 'File size exceeds allowed limit.',
-			canceled: 'Canceled.',
-			http_error: 'HTTP Error:',
-			error: 'Error:',
-			choose_file: 'Choose file',
-			choose_files: 'Choose files',
-			cancel: 'Cancel',
-			clean: 'Clean',
-			upload: 'Upload',
-			no_file_in_queue: 'No file in queue.',
-			file_in_queue: '1 file in queue.',
-			files_in_queue: '%d files in queue.',
-			queue_error: 'Queue error:'
-		},
-		ctrl: {
-			block: $('<div class="cu-ctrl"></div>'),
-			files: null
-		},
-		
-		createControls: function() {
-			this.ctrl.btn_browse = $('<a href="#" class="button">&nbsp;</a>').click(function() {
-				return false;
-			});
-			
-			this.ctrl.btn_cancel = $('<a href="#" class="button">' + this.locales.cancel + '</a>').click(function() {
-				return false;
-			});
-			
-			this.ctrl.btn_clean = $('<a href="#" class="button">' + this.locales.clean + '</a>').click(function() {
-				return false;
-			});
-			
-			this.ctrl.btn_upload = $('<a href="#" class="button">' + this.locales.upload + '</a>').click(function() {
-				return false;
-			});
-			
-			this.ctrl.msg = $('<div class="cu-msg">' + this.locales.no_file_in_queue + '</div>').appendTo(this.ctrl.block);
-			
-			var btn = $('<div class="cu-btn"></div>').appendTo(this.ctrl.block);
-			var brw = $('<span class="cu-btn-browse"></span>').append(this.ctrl.btn_browse).appendTo(btn);
-			$('<span class="cu-btn-upload"></span>').append(this.ctrl.btn_upload).appendTo(btn).hide();
-			$('<span class="cu-btn-cancel"></span>').append(this.ctrl.btn_cancel).appendTo(btn).hide();
-			$('<span class="cu-btn-clean"></span>').append(this.ctrl.btn_clean).appendTo(btn).hide();
-			
-			this.bindEvent('createControls');
-		},
-		
-		initControls: function(upldr) {
-			if (this.params.file_queue_limit == 1) {
-				this.ctrl.btn_browse.text(this.locales.choose_file);
-			} else {
-				this.ctrl.btn_browse.text(this.locales.choose_files);
-			}
-			
-			var _this = this;
-			
-			this.ctrl.btn_cancel.click(function() {
-				_this.cancelQueue(upldr);
-				return false;
-			});
-			
-			this.ctrl.btn_clean.click(function() {
-				_this.cleanQueue(upldr);
-				return false;
-			});
-			
-			this.ctrl.btn_upload.click(function() {
-				_this.uploadQueue(upldr);
-				return false;
-			});
-			
-			var size = this.formatSize(upldr.params.file_size_limit);
-			$('<p class="cu-maxsize form-note info">' + this.locales.max_file_size + ' ' + size + '</p>').appendTo(this.ctrl.block);
-		},
-		
-		refreshControls: function(upldr) {
-			if (!this.ctrl.files || this.ctrl.files.length == 0) {
-				return;
-			}
-			
-			var stats = upldr.GetStats();
-			
-			if (stats.files_queued > 0) {
-				this.ctrl.btn_cancel.parent().show();
-				this.ctrl.btn_upload.parent().show();
-				if (this.params.file_queue_limit > 0 && this.params.file_queue_limit == stats.files_queued) {
-					this.ctrl.btn_browse.hide();
-				} else {
-					this.ctrl.btn_browse.show();
-				}
-				if (stats.files_queued > 1) {
-					var msg = this.locales.files_in_queue.replace(/%d/,stats.files_queued);
-				} else {
-					var msg = this.locales.file_in_queue;
-				}
-			} else {
-				this.ctrl.btn_browse.show();
-				this.ctrl.btn_cancel.parent().hide();
-				this.ctrl.btn_upload.parent().hide();
-				var msg = this.locales.no_file_in_queue;
-			}
-			
-			this.ctrl.msg.removeClass('cu-error').text(msg);
-			
-			if (stats.successful_uploads > 0 || stats.upload_errors > 0 || stats.upload_cancelled > 0) {
-				this.ctrl.btn_clean.parent().show();
-			} else {
-				this.ctrl.btn_clean.parent().hide();
-			}
-		},
-		
-		removeFileCancel: function(o) {
-			$('#' + o.id + ' span.cu-filecancel',this.ctrl.files).remove();
-		},
-		
-		appendFile: function(upldr,o) {
-			if (!this.ctrl.files) {
-				this.ctrl.files = $('<div class="cu-files"></div>');
-				this.ctrl.msg.after(this.ctrl.files);
-			}
-			
-			var fileblock = $('<div class="cu-file" id="' + o.id + '">' +
-					'<div class="cu-fileinfo"><span class="cu-filename">' + o.name + '</span> ' + 
-					'<span class="cu-filesize">(' + this.formatSize(o.size) + ')</span> ' +
-					'<span class="cu-filecancel"><a href="#">cancel</a> </span> ' +
-					'<span class="cu-filemsg"></span>' +
-					'</div>');
-			
-			$('span.cu-filecancel a',fileblock).click(function() {
-				upldr.CancelUpload(o.id);
-				return false;
-			});
-			this.ctrl.files.append(fileblock);
-		},
-		
-		fileProgressBar: function(file_id,bytes,total) {
-			var bar = $('#' + file_id + ' div.cu-progress>div',this.ctrl.files);
-			if (bar.length == 0) {
-				$('#' + file_id,this.ctrl.files).append('<div class="cu-progress"><div>&nbsp;</div></div>');
-				bar = $('#' + file_id + ' div.cu-progress>div',this.ctrl.files);
-			}
-			
-			var percent = Math.round((bytes * 100) / total);
-			bar.css('width',percent+'%').text(percent + '%');
-		},
-		
-		fileMsg: function(file_id,msg,error) {
-			error = error || false;
-			var span = $('#' + file_id + ' span.cu-filemsg',this.ctrl.files).attr('class','cu-filemsg');
-			if (error) {
-				span.addClass('cu-error');
-			}
-			span.text(msg);
-		},
-		
-		fileErrorMsg: function(file_id,msg) {
-			this.fileMsg(file_id,msg,true);
-		},
-		
-		cancelQueue: function(upldr) {
-			if (!this.ctrl.files || this.ctrl.files.length == 0) {
-				return;
-			}
-			
-			this.ctrl.files.children('div').each(function() {
-				upldr.CancelUpload(this.id);
-			});
-		},
-		
-		uploadQueue: function(upldr) {
-			if (!this.ctrl.files || this.ctrl.files.length == 0) {
-				return;
-			}
-			
-			upldr.StartUpload();
-		},
-		
-		cleanQueue: function(upldr) {
-			var _this = this;
-			var e = $('div.cu-file',this.ctrl.files).not(':has(span.cu-filecancel a)');
-			
-			e.filter(':last').slideUp(200,function() {
-				$(this).remove();
-				if (e.length == 1) {
-					upldr.SetStats({successful_uploads:0, upload_errors:0, upload_cancelled:0});
-					_this.refreshControls(upldr);
-				} else if (e.length > 1) {
-					_this.cleanQueue(upldr);
-				}
-			});
-		},
-		
-		queueErrorMsg: function(msg) {
-			this.ctrl.msg.addClass('cu-error').text(this.locales.queue_error + ' ' + msg);
-		},
-		
-		formatSize: function(s) {
-			var a_size = Array('B', 'KB', 'MB', 'GB', 'TB');
-			var i_index = 0;
-			while (s > 1024) {
-				i_index++;
-				s/=1024;
-			}
-			return (Math.round(s * 100) /100) + ' ' + a_size[i_index];
-		},
-		
-		bindEvent: function(evt,a) {
-			if (this.params.callbacks[evt] != undefined && $.isFunction(this.params.callbacks[evt])) {
-				a = a || new Array();
-				this.params.callbacks[evt].apply(this,a);
-			}
-		}
-	};
-})(jQuery);
Index: nc/admin/default-templates/js/jquery/jquery.constantfooter.js
===================================================================
--- inc/admin/default-templates/js/jquery/jquery.constantfooter.js	(revision 1056)
+++ 	(revision )
@@ -1,66 +1,0 @@
-(function($)
-{
-	// This script was written by Steve Fenton
-	// http://www.stevefenton.co.uk/Content/Jquery-Constant-Footer/
-	// Feel free to use this jQuery Plugin
-	// Version: 3.0.3 - modified by DC Team
-    // Contributions by: 
-	
-	var classModifier = "";
-	
-	// Add padding to the bottom of the document so it can be scrolled past the footer
-	function PadDocument() {
-		var paddingRequired = $("." + classModifier).height();
-		$("#" + classModifier + "padding").css({ paddingTop: paddingRequired+"px"});
-	}
-	
-	$.fn.constantfooter = function (settings) {
-	
-		var config = {
-			classmodifier: "constantfooter",
-			opacity: 0.8,
-			showclose: false,
-			closebutton: "[x]"
-		};
-		
-		if (settings) {
-			$.extend(config, settings);
-		}
-
-		return this.each(function () {
-			
-			classModifier = config.classmodifier;
-			
-			// Make sure opacity is a number between 0.1 and 1
-			var opacity = parseFloat(config.opacity);
-			if (opacity > 1) {
-				opacity = 1;
-			} else if (opacity < 0.1) {
-				opacity = 0.1;
-			}
-			
-			$This = $(this);
-
-			// Hide it
-			$This.hide().addClass(classModifier).css({ position: "fixed", bottom: "0px", left: "0px", width: "100%" })
-			
-			// Show a close button if required
-			if (config.showclose) {
-				$(this).prepend("<div style=\"float: right;\" class=\"" + classModifier + "close\">" + config.closebutton + "</div>");
-				$("." + classModifier + "close").css({ cursor: "pointer" });
-				$("." + classModifier + "close").click( function () {
-					$(this).parent().fadeOut();
-					window.clearTimeout(feedTimer);
-				});
-			}
-			
-			// $This.append("<div class=\"content\"></div>");
-
-			// Show it
-			$This.fadeTo(1000, opacity);
-			
-			// Pad the bottom of the document
-			PadDocument();
-		});
-	};
-})(jQuery);
Index: nc/admin/default-templates/js/jquery/jquery.farbtastic.js
===================================================================
--- inc/admin/default-templates/js/jquery/jquery.farbtastic.js	(revision 1056)
+++ 	(revision )
@@ -1,331 +1,0 @@
-// $Id: farbtastic.js,v 1.2 2007/01/08 22:53:01 unconed Exp $
-// Farbtastic 1.2
-
-jQuery.fn.farbtastic = function (callback) {
-	$.farbtastic(this, callback);
-	return this;
-};
-
-jQuery.farbtastic = function (container, callback) {
-	var container = $(container).get(0);
-	return container.farbtastic || (container.farbtastic = new jQuery._farbtastic(container, callback));
-};
-
-jQuery._farbtastic = function (container, callback) {
-	// Store farbtastic object
-	var fb = this;
-	
-	// Insert markup
-	$(container).html('<div class="farbtastic"><div class="color"></div><div class="wheel"></div><div class="overlay"></div><div class="h-marker marker"></div><div class="sl-marker marker"></div></div>');
-	var e = $('.farbtastic', container);
-	fb.wheel = $('.wheel', container).get(0);
-	// Dimensions
-	fb.radius = 84;
-	fb.square = 100;
-	fb.width = 194;
-	
-	// Fix background PNGs in IE6
-	if (navigator.appVersion.match(/MSIE [0-6]\./)) {
-		$('*', e).each(function () {
-			if (this.currentStyle.backgroundImage != 'none') {
-				var image = this.currentStyle.backgroundImage;
-				image = this.currentStyle.backgroundImage.substring(5, image.length - 2);
-				$(this).css({
-					'backgroundImage': 'none',
-					'filter': "progid:DXImageTransform.Microsoft.AlphaImageLoader(enabled=true, sizingMethod=crop, src='" + image + "')"
-				});
-			}
-		});
-	}
-
-	/**
-	* Link to the given element(s) or callback.
-	*/
-	fb.linkTo = function (callback) {
-		// Unbind previous nodes
-		if (typeof fb.callback == 'object') {
-			$(fb.callback).unbind('keyup', fb.updateValue);
-		}
-		
-		// Reset color
-		fb.color = null;
-		
-		// Bind callback or elements
-		if (typeof callback == 'function') {
-			fb.callback = callback;
-		}
-		else if (typeof callback == 'object' || typeof callback == 'string') {
-			fb.callback = $(callback);
-			fb.callback.bind('keyup', fb.updateValue);
-			if (fb.callback.get(0).value) {
-				fb.setColor(fb.callback.get(0).value);
-			}
-		}
-		return this;
-	};
-	
-	fb.updateValue = function (event) {
-		if (this.value && this.value != fb.color) {
-			fb.setColor(this.value);
-		}
-	};
-	
-	/**
-	* Change color with HTML syntax #123456
-	*/
-	fb.setColor = function (color) {
-		var unpack = fb.unpack(color);
-		if (fb.color != color && unpack) {
-			fb.color = color;
-			fb.rgb = unpack;
-			fb.hsl = fb.RGBToHSL(fb.rgb);
-			fb.updateDisplay();
-		}
-		return this;
-	};
-	
-	/**
-	* Change color with HSL triplet [0..1, 0..1, 0..1]
-	*/
-	fb.setHSL = function (hsl) {
-		fb.hsl = hsl;
-		fb.rgb = fb.HSLToRGB(hsl);
-		fb.color = fb.pack(fb.rgb);
-		fb.updateDisplay();
-		return this;
-	};
-	
-	/////////////////////////////////////////////////////
-	
-	/**
-	* Retrieve the coordinates of the given event relative to the center
-	* of the widget.
-	*/
-	fb.widgetCoords = function (event) {
-		var x, y;
-		var el = event.target || event.srcElement;
-		var reference = fb.wheel;
-		
-		if (typeof event.offsetX != 'undefined') {
-			// Use offset coordinates and find common offsetParent
-			var pos = { x: event.offsetX, y: event.offsetY };
-			
-			// Send the coordinates upwards through the offsetParent chain.
-			var e = el;
-			while (e) {
-				e.mouseX = pos.x;
-				e.mouseY = pos.y;
-				pos.x += e.offsetLeft;
-				pos.y += e.offsetTop;
-				e = e.offsetParent;
-			}
-			
-			// Look for the coordinates starting from the wheel widget.
-			var e = reference;
-			var offset = { x: 0, y: 0 };
-			while (e) {
-				if (typeof e.mouseX != 'undefined') {
-					x = e.mouseX - offset.x;
-					y = e.mouseY - offset.y;
-					break;
-				}
-				offset.x += e.offsetLeft;
-				offset.y += e.offsetTop;
-				e = e.offsetParent;
-			}
-			
-			// Reset stored coordinates
-			e = el;
-			while (e) {
-				e.mouseX = undefined;
-				e.mouseY = undefined;
-				e = e.offsetParent;
-			}
-		}
-		else {
-		// Use absolute coordinates
-			var pos = fb.absolutePosition(reference);
-			x = (event.pageX || 0*(event.clientX + $('html').get(0).scrollLeft)) - pos.x;
-			y = (event.pageY || 0*(event.clientY + $('html').get(0).scrollTop)) - pos.y;
-		}
-		// Subtract distance to middle
-		return { x: x - fb.width / 2, y: y - fb.width / 2 };
-	};
-	
-	/**
-	* Mousedown handler
-	*/
-	fb.mousedown = function (event) {
-		// Capture mouse
-		if (!document.dragging) {
-			$(document).bind('mousemove', fb.mousemove).bind('mouseup', fb.mouseup);
-			document.dragging = true;
-		}
-		
-		// Check which area is being dragged
-		var pos = fb.widgetCoords(event);
-		fb.circleDrag = Math.max(Math.abs(pos.x), Math.abs(pos.y)) * 2 > fb.square;
-		
-		// Process
-		fb.mousemove(event);
-		return false;
-	};
-	
-	/**
-	* Mousemove handler
-	*/
-	fb.mousemove = function (event) {
-		// Get coordinates relative to color picker center
-		var pos = fb.widgetCoords(event);
-		
-		// Set new HSL parameters
-		if (fb.circleDrag) {
-			var hue = Math.atan2(pos.x, -pos.y) / 6.28;
-			if (hue < 0) hue += 1;
-			fb.setHSL([hue, fb.hsl[1], fb.hsl[2]]);
-		}
-		else {
-			var sat = Math.max(0, Math.min(1, -(pos.x / fb.square) + .5));
-			var lum = Math.max(0, Math.min(1, -(pos.y / fb.square) + .5));
-			fb.setHSL([fb.hsl[0], sat, lum]);
-		}
-		return false;
-	};
-	
-	/**
-	* Mouseup handler
-	*/
-	fb.mouseup = function () {
-		// Uncapture mouse
-		$(document).unbind('mousemove', fb.mousemove);
-		$(document).unbind('mouseup', fb.mouseup);
-		document.dragging = false;
-	};
-	
-	/**
-	* Update the markers and styles
-	*/
-	fb.updateDisplay = function () {
-		// Markers
-		var angle = fb.hsl[0] * 6.28;
-		$('.h-marker', e).css({
-			left: Math.round(Math.sin(angle) * fb.radius + fb.width / 2) + 'px',
-			top: Math.round(-Math.cos(angle) * fb.radius + fb.width / 2) + 'px'
-		});
-		
-		$('.sl-marker', e).css({
-			left: Math.round(fb.square * (.5 - fb.hsl[1]) + fb.width / 2) + 'px',
-			top: Math.round(fb.square * (.5 - fb.hsl[2]) + fb.width / 2) + 'px'
-		});
-		
-		// Saturation/Luminance gradient
-		$('.color', e).css('backgroundColor', fb.pack(fb.HSLToRGB([fb.hsl[0], 1, 0.5])));
-		
-		// Linked elements or callback
-		if (typeof fb.callback == 'object') {
-			// Set background/foreground color
-			$(fb.callback).css({
-				backgroundColor: fb.color,
-				color: fb.hsl[2] > 0.5 ? '#000' : '#fff'
-			});
-				
-			// Change linked value
-			$(fb.callback).each(function() {
-				if (this.value != fb.color) {
-					this.value = fb.color;
-				}
-			});
-			$(fb.callback).change();
-		}
-		else if (typeof fb.callback == 'function') {
-			fb.callback.call(fb, fb.color);
-		}
-	};
-	
-	/**
-	* Get absolute position of element
-	*/
-	fb.absolutePosition = function (el) {
-		var r = { x: el.offsetLeft, y: el.offsetTop };
-		// Resolve relative to offsetParent
-		if (el.offsetParent) {
-			var tmp = fb.absolutePosition(el.offsetParent);
-			r.x += tmp.x;
-			r.y += tmp.y;
-		}
-		return r;
-	};
-	
-	/* Various color utility functions */
-	fb.pack = function (rgb) {
-		var r = Math.round(rgb[0] * 255);
-		var g = Math.round(rgb[1] * 255);
-		var b = Math.round(rgb[2] * 255);
-		return '#' + (r < 16 ? '0' : '') + r.toString(16) +
-			(g < 16 ? '0' : '') + g.toString(16) +
-			(b < 16 ? '0' : '') + b.toString(16);
-	};
-	
-	fb.unpack = function (color) {
-		if (color.length == 7) {
-			return [parseInt('0x' + color.substring(1, 3)) / 255,
-				parseInt('0x' + color.substring(3, 5)) / 255,
-				parseInt('0x' + color.substring(5, 7)) / 255];
-		}
-		else if (color.length == 4) {
-			return [parseInt('0x' + color.substring(1, 2)) / 15,
-				parseInt('0x' + color.substring(2, 3)) / 15,
-				parseInt('0x' + color.substring(3, 4)) / 15];
-		}
-	};
-	
-	fb.HSLToRGB = function (hsl) {
-		var m1, m2, r, g, b;
-		var h = hsl[0], s = hsl[1], l = hsl[2];
-		m2 = (l <= 0.5) ? l * (s + 1) : l + s - l*s;
-		m1 = l * 2 - m2;
-		return [this.hueToRGB(m1, m2, h+0.33333),
-			this.hueToRGB(m1, m2, h),
-			this.hueToRGB(m1, m2, h-0.33333)];
-	};
-	
-	fb.hueToRGB = function (m1, m2, h) {
-		h = (h < 0) ? h + 1 : ((h > 1) ? h - 1 : h);
-		if (h * 6 < 1) return m1 + (m2 - m1) * h * 6;
-		if (h * 2 < 1) return m2;
-		if (h * 3 < 2) return m1 + (m2 - m1) * (0.66666 - h) * 6;
-		return m1;
-	};
-	
-	fb.RGBToHSL = function (rgb) {
-		var min, max, delta, h, s, l;
-		var r = rgb[0], g = rgb[1], b = rgb[2];
-		min = Math.min(r, Math.min(g, b));
-		max = Math.max(r, Math.max(g, b));
-		delta = max - min;
-		l = (min + max) / 2;
-		s = 0;
-		if (l > 0 && l < 1) {
-			s = delta / (l < 0.5 ? (2 * l) : (2 - 2 * l));
-		}
-		h = 0;
-		if (delta > 0) {
-			if (max == r && max != g) h += (g - b) / delta;
-			if (max == g && max != b) h += (2 + (b - r) / delta);
-			if (max == b && max != r) h += (4 + (r - g) / delta);
-			h /= 6;
-		}
-		return [h, s, l];
-	};
-	
-	// Install mousedown handler (the others are set on the document on-demand)
-	$('*', e).mousedown(fb.mousedown);
-	
-	// Init color
-	fb.setColor('#000000');
-	
-	// Set linked elements/callback
-	if (callback) {
-		fb.linkTo(callback);
-	}
-};
Index: nc/admin/default-templates/js/jquery/jquery.js
===================================================================
--- inc/admin/default-templates/js/jquery/jquery.js	(revision 1085)
+++ 	(revision )
@@ -1,9472 +1,0 @@
-/*!
- * jQuery JavaScript Library v1.8.3
- * http://jquery.com/
- *
- * Includes Sizzle.js
- * http://sizzlejs.com/
- *
- * Copyright 2012 jQuery Foundation and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: Tue Nov 13 2012 08:20:33 GMT-0500 (Eastern Standard Time)
- */
-(function( window, undefined ) {
-var
-	// A central reference to the root jQuery(document)
-	rootjQuery,
-
-	// The deferred used on DOM ready
-	readyList,
-
-	// Use the correct document accordingly with window argument (sandbox)
-	document = window.document,
-	location = window.location,
-	navigator = window.navigator,
-
-	// Map over jQuery in case of overwrite
-	_jQuery = window.jQuery,
-
-	// Map over the $ in case of overwrite
-	_$ = window.$,
-
-	// Save a reference to some core methods
-	core_push = Array.prototype.push,
-	core_slice = Array.prototype.slice,
-	core_indexOf = Array.prototype.indexOf,
-	core_toString = Object.prototype.toString,
-	core_hasOwn = Object.prototype.hasOwnProperty,
-	core_trim = String.prototype.trim,
-
-	// Define a local copy of jQuery
-	jQuery = function( selector, context ) {
-		// The jQuery object is actually just the init constructor 'enhanced'
-		return new jQuery.fn.init( selector, context, rootjQuery );
-	},
-
-	// Used for matching numbers
-	core_pnum = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,
-
-	// Used for detecting and trimming whitespace
-	core_rnotwhite = /\S/,
-	core_rspace = /\s+/,
-
-	// Make sure we trim BOM and NBSP (here's looking at you, Safari 5.0 and IE)
-	rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
-
-	// A simple way to check for HTML strings
-	// Prioritize #id over <tag> to avoid XSS via location.hash (#9521)
-	rquickExpr = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
-
-	// Match a standalone tag
-	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
-
-	// JSON RegExp
-	rvalidchars = /^[\],:{}\s]*$/,
-	rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
-	rvalidescape = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
-	rvalidtokens = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,
-
-	// Matches dashed string for camelizing
-	rmsPrefix = /^-ms-/,
-	rdashAlpha = /-([\da-z])/gi,
-
-	// Used by jQuery.camelCase as callback to replace()
-	fcamelCase = function( all, letter ) {
-		return ( letter + "" ).toUpperCase();
-	},
-
-	// The ready event handler and self cleanup method
-	DOMContentLoaded = function() {
-		if ( document.addEventListener ) {
-			document.removeEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-			jQuery.ready();
-		} else if ( document.readyState === "complete" ) {
-			// we're here because readyState === "complete" in oldIE
-			// which is good enough for us to call the dom ready!
-			document.detachEvent( "onreadystatechange", DOMContentLoaded );
-			jQuery.ready();
-		}
-	},
-
-	// [[Class]] -> type pairs
-	class2type = {};
-
-jQuery.fn = jQuery.prototype = {
-	constructor: jQuery,
-	init: function( selector, context, rootjQuery ) {
-		var match, elem, ret, doc;
-
-		// Handle $(""), $(null), $(undefined), $(false)
-		if ( !selector ) {
-			return this;
-		}
-
-		// Handle $(DOMElement)
-		if ( selector.nodeType ) {
-			this.context = this[0] = selector;
-			this.length = 1;
-			return this;
-		}
-
-		// Handle HTML strings
-		if ( typeof selector === "string" ) {
-			if ( selector.charAt(0) === "<" && selector.charAt( selector.length - 1 ) === ">" && selector.length >= 3 ) {
-				// Assume that strings that start and end with <> are HTML and skip the regex check
-				match = [ null, selector, null ];
-
-			} else {
-				match = rquickExpr.exec( selector );
-			}
-
-			// Match html or make sure no context is specified for #id
-			if ( match && (match[1] || !context) ) {
-
-				// HANDLE: $(html) -> $(array)
-				if ( match[1] ) {
-					context = context instanceof jQuery ? context[0] : context;
-					doc = ( context && context.nodeType ? context.ownerDocument || context : document );
-
-					// scripts is true for back-compat
-					selector = jQuery.parseHTML( match[1], doc, true );
-					if ( rsingleTag.test( match[1] ) && jQuery.isPlainObject( context ) ) {
-						this.attr.call( selector, context, true );
-					}
-
-					return jQuery.merge( this, selector );
-
-				// HANDLE: $(#id)
-				} else {
-					elem = document.getElementById( match[2] );
-
-					// Check parentNode to catch when Blackberry 4.6 returns
-					// nodes that are no longer in the document #6963
-					if ( elem && elem.parentNode ) {
-						// Handle the case where IE and Opera return items
-						// by name instead of ID
-						if ( elem.id !== match[2] ) {
-							return rootjQuery.find( selector );
-						}
-
-						// Otherwise, we inject the element directly into the jQuery object
-						this.length = 1;
-						this[0] = elem;
-					}
-
-					this.context = document;
-					this.selector = selector;
-					return this;
-				}
-
-			// HANDLE: $(expr, $(...))
-			} else if ( !context || context.jquery ) {
-				return ( context || rootjQuery ).find( selector );
-
-			// HANDLE: $(expr, context)
-			// (which is just equivalent to: $(context).find(expr)
-			} else {
-				return this.constructor( context ).find( selector );
-			}
-
-		// HANDLE: $(function)
-		// Shortcut for document ready
-		} else if ( jQuery.isFunction( selector ) ) {
-			return rootjQuery.ready( selector );
-		}
-
-		if ( selector.selector !== undefined ) {
-			this.selector = selector.selector;
-			this.context = selector.context;
-		}
-
-		return jQuery.makeArray( selector, this );
-	},
-
-	// Start with an empty selector
-	selector: "",
-
-	// The current version of jQuery being used
-	jquery: "1.8.3",
-
-	// The default length of a jQuery object is 0
-	length: 0,
-
-	// The number of elements contained in the matched element set
-	size: function() {
-		return this.length;
-	},
-
-	toArray: function() {
-		return core_slice.call( this );
-	},
-
-	// Get the Nth element in the matched element set OR
-	// Get the whole matched element set as a clean array
-	get: function( num ) {
-		return num == null ?
-
-			// Return a 'clean' array
-			this.toArray() :
-
-			// Return just the object
-			( num < 0 ? this[ this.length + num ] : this[ num ] );
-	},
-
-	// Take an array of elements and push it onto the stack
-	// (returning the new matched element set)
-	pushStack: function( elems, name, selector ) {
-
-		// Build a new jQuery matched element set
-		var ret = jQuery.merge( this.constructor(), elems );
-
-		// Add the old object onto the stack (as a reference)
-		ret.prevObject = this;
-
-		ret.context = this.context;
-
-		if ( name === "find" ) {
-			ret.selector = this.selector + ( this.selector ? " " : "" ) + selector;
-		} else if ( name ) {
-			ret.selector = this.selector + "." + name + "(" + selector + ")";
-		}
-
-		// Return the newly-formed element set
-		return ret;
-	},
-
-	// Execute a callback for every element in the matched set.
-	// (You can seed the arguments with an array of args, but this is
-	// only used internally.)
-	each: function( callback, args ) {
-		return jQuery.each( this, callback, args );
-	},
-
-	ready: function( fn ) {
-		// Add the callback
-		jQuery.ready.promise().done( fn );
-
-		return this;
-	},
-
-	eq: function( i ) {
-		i = +i;
-		return i === -1 ?
-			this.slice( i ) :
-			this.slice( i, i + 1 );
-	},
-
-	first: function() {
-		return this.eq( 0 );
-	},
-
-	last: function() {
-		return this.eq( -1 );
-	},
-
-	slice: function() {
-		return this.pushStack( core_slice.apply( this, arguments ),
-			"slice", core_slice.call(arguments).join(",") );
-	},
-
-	map: function( callback ) {
-		return this.pushStack( jQuery.map(this, function( elem, i ) {
-			return callback.call( elem, i, elem );
-		}));
-	},
-
-	end: function() {
-		return this.prevObject || this.constructor(null);
-	},
-
-	// For internal use only.
-	// Behaves like an Array's method, not like a jQuery method.
-	push: core_push,
-	sort: [].sort,
-	splice: [].splice
-};
-
-// Give the init function the jQuery prototype for later instantiation
-jQuery.fn.init.prototype = jQuery.fn;
-
-jQuery.extend = jQuery.fn.extend = function() {
-	var options, name, src, copy, copyIsArray, clone,
-		target = arguments[0] || {},
-		i = 1,
-		length = arguments.length,
-		deep = false;
-
-	// Handle a deep copy situation
-	if ( typeof target === "boolean" ) {
-		deep = target;
-		target = arguments[1] || {};
-		// skip the boolean and the target
-		i = 2;
-	}
-
-	// Handle case when target is a string or something (possible in deep copy)
-	if ( typeof target !== "object" && !jQuery.isFunction(target) ) {
-		target = {};
-	}
-
-	// extend jQuery itself if only one argument is passed
-	if ( length === i ) {
-		target = this;
-		--i;
-	}
-
-	for ( ; i < length; i++ ) {
-		// Only deal with non-null/undefined values
-		if ( (options = arguments[ i ]) != null ) {
-			// Extend the base object
-			for ( name in options ) {
-				src = target[ name ];
-				copy = options[ name ];
-
-				// Prevent never-ending loop
-				if ( target === copy ) {
-					continue;
-				}
-
-				// Recurse if we're merging plain objects or arrays
-				if ( deep && copy && ( jQuery.isPlainObject(copy) || (copyIsArray = jQuery.isArray(copy)) ) ) {
-					if ( copyIsArray ) {
-						copyIsArray = false;
-						clone = src && jQuery.isArray(src) ? src : [];
-
-					} else {
-						clone = src && jQuery.isPlainObject(src) ? src : {};
-					}
-
-					// Never move original objects, clone them
-					target[ name ] = jQuery.extend( deep, clone, copy );
-
-				// Don't bring in undefined values
-				} else if ( copy !== undefined ) {
-					target[ name ] = copy;
-				}
-			}
-		}
-	}
-
-	// Return the modified object
-	return target;
-};
-
-jQuery.extend({
-	noConflict: function( deep ) {
-		if ( window.$ === jQuery ) {
-			window.$ = _$;
-		}
-
-		if ( deep && window.jQuery === jQuery ) {
-			window.jQuery = _jQuery;
-		}
-
-		return jQuery;
-	},
-
-	// Is the DOM ready to be used? Set to true once it occurs.
-	isReady: false,
-
-	// A counter to track how many items to wait for before
-	// the ready event fires. See #6781
-	readyWait: 1,
-
-	// Hold (or release) the ready event
-	holdReady: function( hold ) {
-		if ( hold ) {
-			jQuery.readyWait++;
-		} else {
-			jQuery.ready( true );
-		}
-	},
-
-	// Handle when the DOM is ready
-	ready: function( wait ) {
-
-		// Abort if there are pending holds or we're already ready
-		if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) {
-			return;
-		}
-
-		// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
-		if ( !document.body ) {
-			return setTimeout( jQuery.ready, 1 );
-		}
-
-		// Remember that the DOM is ready
-		jQuery.isReady = true;
-
-		// If a normal DOM Ready event fired, decrement, and wait if need be
-		if ( wait !== true && --jQuery.readyWait > 0 ) {
-			return;
-		}
-
-		// If there are functions bound, to execute
-		readyList.resolveWith( document, [ jQuery ] );
-
-		// Trigger any bound ready events
-		if ( jQuery.fn.trigger ) {
-			jQuery( document ).trigger("ready").off("ready");
-		}
-	},
-
-	// See test/unit/core.js for details concerning isFunction.
-	// Since version 1.3, DOM methods and functions like alert
-	// aren't supported. They return false on IE (#2968).
-	isFunction: function( obj ) {
-		return jQuery.type(obj) === "function";
-	},
-
-	isArray: Array.isArray || function( obj ) {
-		return jQuery.type(obj) === "array";
-	},
-
-	isWindow: function( obj ) {
-		return obj != null && obj == obj.window;
-	},
-
-	isNumeric: function( obj ) {
-		return !isNaN( parseFloat(obj) ) && isFinite( obj );
-	},
-
-	type: function( obj ) {
-		return obj == null ?
-			String( obj ) :
-			class2type[ core_toString.call(obj) ] || "object";
-	},
-
-	isPlainObject: function( obj ) {
-		// Must be an Object.
-		// Because of IE, we also have to check the presence of the constructor property.
-		// Make sure that DOM nodes and window objects don't pass through, as well
-		if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
-			return false;
-		}
-
-		try {
-			// Not own constructor property must be Object
-			if ( obj.constructor &&
-				!core_hasOwn.call(obj, "constructor") &&
-				!core_hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
-				return false;
-			}
-		} catch ( e ) {
-			// IE8,9 Will throw exceptions on certain host objects #9897
-			return false;
-		}
-
-		// Own properties are enumerated firstly, so to speed up,
-		// if last one is own, then all properties are own.
-
-		var key;
-		for ( key in obj ) {}
-
-		return key === undefined || core_hasOwn.call( obj, key );
-	},
-
-	isEmptyObject: function( obj ) {
-		var name;
-		for ( name in obj ) {
-			return false;
-		}
-		return true;
-	},
-
-	error: function( msg ) {
-		throw new Error( msg );
-	},
-
-	// data: string of html
-	// context (optional): If specified, the fragment will be created in this context, defaults to document
-	// scripts (optional): If true, will include scripts passed in the html string
-	parseHTML: function( data, context, scripts ) {
-		var parsed;
-		if ( !data || typeof data !== "string" ) {
-			return null;
-		}
-		if ( typeof context === "boolean" ) {
-			scripts = context;
-			context = 0;
-		}
-		context = context || document;
-
-		// Single tag
-		if ( (parsed = rsingleTag.exec( data )) ) {
-			return [ context.createElement( parsed[1] ) ];
-		}
-
-		parsed = jQuery.buildFragment( [ data ], context, scripts ? null : [] );
-		return jQuery.merge( [],
-			(parsed.cacheable ? jQuery.clone( parsed.fragment ) : parsed.fragment).childNodes );
-	},
-
-	parseJSON: function( data ) {
-		if ( !data || typeof data !== "string") {
-			return null;
-		}
-
-		// Make sure leading/trailing whitespace is removed (IE can't handle it)
-		data = jQuery.trim( data );
-
-		// Attempt to parse using the native JSON parser first
-		if ( window.JSON && window.JSON.parse ) {
-			return window.JSON.parse( data );
-		}
-
-		// Make sure the incoming data is actual JSON
-		// Logic borrowed from http://json.org/json2.js
-		if ( rvalidchars.test( data.replace( rvalidescape, "@" )
-			.replace( rvalidtokens, "]" )
-			.replace( rvalidbraces, "")) ) {
-
-			return ( new Function( "return " + data ) )();
-
-		}
-		jQuery.error( "Invalid JSON: " + data );
-	},
-
-	// Cross-browser xml parsing
-	parseXML: function( data ) {
-		var xml, tmp;
-		if ( !data || typeof data !== "string" ) {
-			return null;
-		}
-		try {
-			if ( window.DOMParser ) { // Standard
-				tmp = new DOMParser();
-				xml = tmp.parseFromString( data , "text/xml" );
-			} else { // IE
-				xml = new ActiveXObject( "Microsoft.XMLDOM" );
-				xml.async = "false";
-				xml.loadXML( data );
-			}
-		} catch( e ) {
-			xml = undefined;
-		}
-		if ( !xml || !xml.documentElement || xml.getElementsByTagName( "parsererror" ).length ) {
-			jQuery.error( "Invalid XML: " + data );
-		}
-		return xml;
-	},
-
-	noop: function() {},
-
-	// Evaluates a script in a global context
-	// Workarounds based on findings by Jim Driscoll
-	// http://weblogs.java.net/blog/driscoll/archive/2009/09/08/eval-javascript-global-context
-	globalEval: function( data ) {
-		if ( data && core_rnotwhite.test( data ) ) {
-			// We use execScript on Internet Explorer
-			// We use an anonymous function so that context is window
-			// rather than jQuery in Firefox
-			( window.execScript || function( data ) {
-				window[ "eval" ].call( window, data );
-			} )( data );
-		}
-	},
-
-	// Convert dashed to camelCase; used by the css and data modules
-	// Microsoft forgot to hump their vendor prefix (#9572)
-	camelCase: function( string ) {
-		return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
-	},
-
-	nodeName: function( elem, name ) {
-		return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
-	},
-
-	// args is for internal usage only
-	each: function( obj, callback, args ) {
-		var name,
-			i = 0,
-			length = obj.length,
-			isObj = length === undefined || jQuery.isFunction( obj );
-
-		if ( args ) {
-			if ( isObj ) {
-				for ( name in obj ) {
-					if ( callback.apply( obj[ name ], args ) === false ) {
-						break;
-					}
-				}
-			} else {
-				for ( ; i < length; ) {
-					if ( callback.apply( obj[ i++ ], args ) === false ) {
-						break;
-					}
-				}
-			}
-
-		// A special, fast, case for the most common use of each
-		} else {
-			if ( isObj ) {
-				for ( name in obj ) {
-					if ( callback.call( obj[ name ], name, obj[ name ] ) === false ) {
-						break;
-					}
-				}
-			} else {
-				for ( ; i < length; ) {
-					if ( callback.call( obj[ i ], i, obj[ i++ ] ) === false ) {
-						break;
-					}
-				}
-			}
-		}
-
-		return obj;
-	},
-
-	// Use native String.trim function wherever possible
-	trim: core_trim && !core_trim.call("\uFEFF\xA0") ?
-		function( text ) {
-			return text == null ?
-				"" :
-				core_trim.call( text );
-		} :
-
-		// Otherwise use our own trimming functionality
-		function( text ) {
-			return text == null ?
-				"" :
-				( text + "" ).replace( rtrim, "" );
-		},
-
-	// results is for internal usage only
-	makeArray: function( arr, results ) {
-		var type,
-			ret = results || [];
-
-		if ( arr != null ) {
-			// The window, strings (and functions) also have 'length'
-			// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
-			type = jQuery.type( arr );
-
-			if ( arr.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( arr ) ) {
-				core_push.call( ret, arr );
-			} else {
-				jQuery.merge( ret, arr );
-			}
-		}
-
-		return ret;
-	},
-
-	inArray: function( elem, arr, i ) {
-		var len;
-
-		if ( arr ) {
-			if ( core_indexOf ) {
-				return core_indexOf.call( arr, elem, i );
-			}
-
-			len = arr.length;
-			i = i ? i < 0 ? Math.max( 0, len + i ) : i : 0;
-
-			for ( ; i < len; i++ ) {
-				// Skip accessing in sparse arrays
-				if ( i in arr && arr[ i ] === elem ) {
-					return i;
-				}
-			}
-		}
-
-		return -1;
-	},
-
-	merge: function( first, second ) {
-		var l = second.length,
-			i = first.length,
-			j = 0;
-
-		if ( typeof l === "number" ) {
-			for ( ; j < l; j++ ) {
-				first[ i++ ] = second[ j ];
-			}
-
-		} else {
-			while ( second[j] !== undefined ) {
-				first[ i++ ] = second[ j++ ];
-			}
-		}
-
-		first.length = i;
-
-		return first;
-	},
-
-	grep: function( elems, callback, inv ) {
-		var retVal,
-			ret = [],
-			i = 0,
-			length = elems.length;
-		inv = !!inv;
-
-		// Go through the array, only saving the items
-		// that pass the validator function
-		for ( ; i < length; i++ ) {
-			retVal = !!callback( elems[ i ], i );
-			if ( inv !== retVal ) {
-				ret.push( elems[ i ] );
-			}
-		}
-
-		return ret;
-	},
-
-	// arg is for internal usage only
-	map: function( elems, callback, arg ) {
-		var value, key,
-			ret = [],
-			i = 0,
-			length = elems.length,
-			// jquery objects are treated as arrays
-			isArray = elems instanceof jQuery || length !== undefined && typeof length === "number" && ( ( length > 0 && elems[ 0 ] && elems[ length -1 ] ) || length === 0 || jQuery.isArray( elems ) ) ;
-
-		// Go through the array, translating each of the items to their
-		if ( isArray ) {
-			for ( ; i < length; i++ ) {
-				value = callback( elems[ i ], i, arg );
-
-				if ( value != null ) {
-					ret[ ret.length ] = value;
-				}
-			}
-
-		// Go through every key on the object,
-		} else {
-			for ( key in elems ) {
-				value = callback( elems[ key ], key, arg );
-
-				if ( value != null ) {
-					ret[ ret.length ] = value;
-				}
-			}
-		}
-
-		// Flatten any nested arrays
-		return ret.concat.apply( [], ret );
-	},
-
-	// A global GUID counter for objects
-	guid: 1,
-
-	// Bind a function to a context, optionally partially applying any
-	// arguments.
-	proxy: function( fn, context ) {
-		var tmp, args, proxy;
-
-		if ( typeof context === "string" ) {
-			tmp = fn[ context ];
-			context = fn;
-			fn = tmp;
-		}
-
-		// Quick check to determine if target is callable, in the spec
-		// this throws a TypeError, but we will just return undefined.
-		if ( !jQuery.isFunction( fn ) ) {
-			return undefined;
-		}
-
-		// Simulated bind
-		args = core_slice.call( arguments, 2 );
-		proxy = function() {
-			return fn.apply( context, args.concat( core_slice.call( arguments ) ) );
-		};
-
-		// Set the guid of unique handler to the same of original handler, so it can be removed
-		proxy.guid = fn.guid = fn.guid || jQuery.guid++;
-
-		return proxy;
-	},
-
-	// Multifunctional method to get and set values of a collection
-	// The value/s can optionally be executed if it's a function
-	access: function( elems, fn, key, value, chainable, emptyGet, pass ) {
-		var exec,
-			bulk = key == null,
-			i = 0,
-			length = elems.length;
-
-		// Sets many values
-		if ( key && typeof key === "object" ) {
-			for ( i in key ) {
-				jQuery.access( elems, fn, i, key[i], 1, emptyGet, value );
-			}
-			chainable = 1;
-
-		// Sets one value
-		} else if ( value !== undefined ) {
-			// Optionally, function values get executed if exec is true
-			exec = pass === undefined && jQuery.isFunction( value );
-
-			if ( bulk ) {
-				// Bulk operations only iterate when executing function values
-				if ( exec ) {
-					exec = fn;
-					fn = function( elem, key, value ) {
-						return exec.call( jQuery( elem ), value );
-					};
-
-				// Otherwise they run against the entire set
-				} else {
-					fn.call( elems, value );
-					fn = null;
-				}
-			}
-
-			if ( fn ) {
-				for (; i < length; i++ ) {
-					fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
-				}
-			}
-
-			chainable = 1;
-		}
-
-		return chainable ?
-			elems :
-
-			// Gets
-			bulk ?
-				fn.call( elems ) :
-				length ? fn( elems[0], key ) : emptyGet;
-	},
-
-	now: function() {
-		return ( new Date() ).getTime();
-	}
-});
-
-jQuery.ready.promise = function( obj ) {
-	if ( !readyList ) {
-
-		readyList = jQuery.Deferred();
-
-		// Catch cases where $(document).ready() is called after the browser event has already occurred.
-		// we once tried to use readyState "interactive" here, but it caused issues like the one
-		// discovered by ChrisS here: http://bugs.jquery.com/ticket/12282#comment:15
-		if ( document.readyState === "complete" ) {
-			// Handle it asynchronously to allow scripts the opportunity to delay ready
-			setTimeout( jQuery.ready, 1 );
-
-		// Standards-based browsers support DOMContentLoaded
-		} else if ( document.addEventListener ) {
-			// Use the handy event callback
-			document.addEventListener( "DOMContentLoaded", DOMContentLoaded, false );
-
-			// A fallback to window.onload, that will always work
-			window.addEventListener( "load", jQuery.ready, false );
-
-		// If IE event model is used
-		} else {
-			// Ensure firing before onload, maybe late but safe also for iframes
-			document.attachEvent( "onreadystatechange", DOMContentLoaded );
-
-			// A fallback to window.onload, that will always work
-			window.attachEvent( "onload", jQuery.ready );
-
-			// If IE and not a frame
-			// continually check to see if the document is ready
-			var top = false;
-
-			try {
-				top = window.frameElement == null && document.documentElement;
-			} catch(e) {}
-
-			if ( top && top.doScroll ) {
-				(function doScrollCheck() {
-					if ( !jQuery.isReady ) {
-
-						try {
-							// Use the trick by Diego Perini
-							// http://javascript.nwbox.com/IEContentLoaded/
-							top.doScroll("left");
-						} catch(e) {
-							return setTimeout( doScrollCheck, 50 );
-						}
-
-						// and execute any waiting functions
-						jQuery.ready();
-					}
-				})();
-			}
-		}
-	}
-	return readyList.promise( obj );
-};
-
-// Populate the class2type map
-jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
-	class2type[ "[object " + name + "]" ] = name.toLowerCase();
-});
-
-// All jQuery objects should point back to these
-rootjQuery = jQuery(document);
-// String to Object options format cache
-var optionsCache = {};
-
-// Convert String-formatted options into Object-formatted ones and store in cache
-function createOptions( options ) {
-	var object = optionsCache[ options ] = {};
-	jQuery.each( options.split( core_rspace ), function( _, flag ) {
-		object[ flag ] = true;
-	});
-	return object;
-}
-
-/*
- * Create a callback list using the following parameters:
- *
- *	options: an optional list of space-separated options that will change how
- *			the callback list behaves or a more traditional option object
- *
- * By default a callback list will act like an event callback list and can be
- * "fired" multiple times.
- *
- * Possible options:
- *
- *	once:			will ensure the callback list can only be fired once (like a Deferred)
- *
- *	memory:			will keep track of previous values and will call any callback added
- *					after the list has been fired right away with the latest "memorized"
- *					values (like a Deferred)
- *
- *	unique:			will ensure a callback can only be added once (no duplicate in the list)
- *
- *	stopOnFalse:	interrupt callings when a callback returns false
- *
- */
-jQuery.Callbacks = function( options ) {
-
-	// Convert options from String-formatted to Object-formatted if needed
-	// (we check in cache first)
-	options = typeof options === "string" ?
-		( optionsCache[ options ] || createOptions( options ) ) :
-		jQuery.extend( {}, options );
-
-	var // Last fire value (for non-forgettable lists)
-		memory,
-		// Flag to know if list was already fired
-		fired,
-		// Flag to know if list is currently firing
-		firing,
-		// First callback to fire (used internally by add and fireWith)
-		firingStart,
-		// End of the loop when firing
-		firingLength,
-		// Index of currently firing callback (modified by remove if needed)
-		firingIndex,
-		// Actual callback list
-		list = [],
-		// Stack of fire calls for repeatable lists
-		stack = !options.once && [],
-		// Fire callbacks
-		fire = function( data ) {
-			memory = options.memory && data;
-			fired = true;
-			firingIndex = firingStart || 0;
-			firingStart = 0;
-			firingLength = list.length;
-			firing = true;
-			for ( ; list && firingIndex < firingLength; firingIndex++ ) {
-				if ( list[ firingIndex ].apply( data[ 0 ], data[ 1 ] ) === false && options.stopOnFalse ) {
-					memory = false; // To prevent further calls using add
-					break;
-				}
-			}
-			firing = false;
-			if ( list ) {
-				if ( stack ) {
-					if ( stack.length ) {
-						fire( stack.shift() );
-					}
-				} else if ( memory ) {
-					list = [];
-				} else {
-					self.disable();
-				}
-			}
-		},
-		// Actual Callbacks object
-		self = {
-			// Add a callback or a collection of callbacks to the list
-			add: function() {
-				if ( list ) {
-					// First, we save the current length
-					var start = list.length;
-					(function add( args ) {
-						jQuery.each( args, function( _, arg ) {
-							var type = jQuery.type( arg );
-							if ( type === "function" ) {
-								if ( !options.unique || !self.has( arg ) ) {
-									list.push( arg );
-								}
-							} else if ( arg && arg.length && type !== "string" ) {
-								// Inspect recursively
-								add( arg );
-							}
-						});
-					})( arguments );
-					// Do we need to add the callbacks to the
-					// current firing batch?
-					if ( firing ) {
-						firingLength = list.length;
-					// With memory, if we're not firing then
-					// we should call right away
-					} else if ( memory ) {
-						firingStart = start;
-						fire( memory );
-					}
-				}
-				return this;
-			},
-			// Remove a callback from the list
-			remove: function() {
-				if ( list ) {
-					jQuery.each( arguments, function( _, arg ) {
-						var index;
-						while( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) {
-							list.splice( index, 1 );
-							// Handle firing indexes
-							if ( firing ) {
-								if ( index <= firingLength ) {
-									firingLength--;
-								}
-								if ( index <= firingIndex ) {
-									firingIndex--;
-								}
-							}
-						}
-					});
-				}
-				return this;
-			},
-			// Control if a given callback is in the list
-			has: function( fn ) {
-				return jQuery.inArray( fn, list ) > -1;
-			},
-			// Remove all callbacks from the list
-			empty: function() {
-				list = [];
-				return this;
-			},
-			// Have the list do nothing anymore
-			disable: function() {
-				list = stack = memory = undefined;
-				return this;
-			},
-			// Is it disabled?
-			disabled: function() {
-				return !list;
-			},
-			// Lock the list in its current state
-			lock: function() {
-				stack = undefined;
-				if ( !memory ) {
-					self.disable();
-				}
-				return this;
-			},
-			// Is it locked?
-			locked: function() {
-				return !stack;
-			},
-			// Call all callbacks with the given context and arguments
-			fireWith: function( context, args ) {
-				args = args || [];
-				args = [ context, args.slice ? args.slice() : args ];
-				if ( list && ( !fired || stack ) ) {
-					if ( firing ) {
-						stack.push( args );
-					} else {
-						fire( args );
-					}
-				}
-				return this;
-			},
-			// Call all the callbacks with the given arguments
-			fire: function() {
-				self.fireWith( this, arguments );
-				return this;
-			},
-			// To know if the callbacks have already been called at least once
-			fired: function() {
-				return !!fired;
-			}
-		};
-
-	return self;
-};
-jQuery.extend({
-
-	Deferred: function( func ) {
-		var tuples = [
-				// action, add listener, listener list, final state
-				[ "resolve", "done", jQuery.Callbacks("once memory"), "resolved" ],
-				[ "reject", "fail", jQuery.Callbacks("once memory"), "rejected" ],
-				[ "notify", "progress", jQuery.Callbacks("memory") ]
-			],
-			state = "pending",
-			promise = {
-				state: function() {
-					return state;
-				},
-				always: function() {
-					deferred.done( arguments ).fail( arguments );
-					return this;
-				},
-				then: function( /* fnDone, fnFail, fnProgress */ ) {
-					var fns = arguments;
-					return jQuery.Deferred(function( newDefer ) {
-						jQuery.each( tuples, function( i, tuple ) {
-							var action = tuple[ 0 ],
-								fn = fns[ i ];
-							// deferred[ done | fail | progress ] for forwarding actions to newDefer
-							deferred[ tuple[1] ]( jQuery.isFunction( fn ) ?
-								function() {
-									var returned = fn.apply( this, arguments );
-									if ( returned && jQuery.isFunction( returned.promise ) ) {
-										returned.promise()
-											.done( newDefer.resolve )
-											.fail( newDefer.reject )
-											.progress( newDefer.notify );
-									} else {
-										newDefer[ action + "With" ]( this === deferred ? newDefer : this, [ returned ] );
-									}
-								} :
-								newDefer[ action ]
-							);
-						});
-						fns = null;
-					}).promise();
-				},
-				// Get a promise for this deferred
-				// If obj is provided, the promise aspect is added to the object
-				promise: function( obj ) {
-					return obj != null ? jQuery.extend( obj, promise ) : promise;
-				}
-			},
-			deferred = {};
-
-		// Keep pipe for back-compat
-		promise.pipe = promise.then;
-
-		// Add list-specific methods
-		jQuery.each( tuples, function( i, tuple ) {
-			var list = tuple[ 2 ],
-				stateString = tuple[ 3 ];
-
-			// promise[ done | fail | progress ] = list.add
-			promise[ tuple[1] ] = list.add;
-
-			// Handle state
-			if ( stateString ) {
-				list.add(function() {
-					// state = [ resolved | rejected ]
-					state = stateString;
-
-				// [ reject_list | resolve_list ].disable; progress_list.lock
-				}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );
-			}
-
-			// deferred[ resolve | reject | notify ] = list.fire
-			deferred[ tuple[0] ] = list.fire;
-			deferred[ tuple[0] + "With" ] = list.fireWith;
-		});
-
-		// Make the deferred a promise
-		promise.promise( deferred );
-
-		// Call given func if any
-		if ( func ) {
-			func.call( deferred, deferred );
-		}
-
-		// All done!
-		return deferred;
-	},
-
-	// Deferred helper
-	when: function( subordinate /* , ..., subordinateN */ ) {
-		var i = 0,
-			resolveValues = core_slice.call( arguments ),
-			length = resolveValues.length,
-
-			// the count of uncompleted subordinates
-			remaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,
-
-			// the master Deferred. If resolveValues consist of only a single Deferred, just use that.
-			deferred = remaining === 1 ? subordinate : jQuery.Deferred(),
-
-			// Update function for both resolve and progress values
-			updateFunc = function( i, contexts, values ) {
-				return function( value ) {
-					contexts[ i ] = this;
-					values[ i ] = arguments.length > 1 ? core_slice.call( arguments ) : value;
-					if( values === progressValues ) {
-						deferred.notifyWith( contexts, values );
-					} else if ( !( --remaining ) ) {
-						deferred.resolveWith( contexts, values );
-					}
-				};
-			},
-
-			progressValues, progressContexts, resolveContexts;
-
-		// add listeners to Deferred subordinates; treat others as resolved
-		if ( length > 1 ) {
-			progressValues = new Array( length );
-			progressContexts = new Array( length );
-			resolveContexts = new Array( length );
-			for ( ; i < length; i++ ) {
-				if ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {
-					resolveValues[ i ].promise()
-						.done( updateFunc( i, resolveContexts, resolveValues ) )
-						.fail( deferred.reject )
-						.progress( updateFunc( i, progressContexts, progressValues ) );
-				} else {
-					--remaining;
-				}
-			}
-		}
-
-		// if we're not waiting on anything, resolve the master
-		if ( !remaining ) {
-			deferred.resolveWith( resolveContexts, resolveValues );
-		}
-
-		return deferred.promise();
-	}
-});
-jQuery.support = (function() {
-
-	var support,
-		all,
-		a,
-		select,
-		opt,
-		input,
-		fragment,
-		eventName,
-		i,
-		isSupported,
-		clickFn,
-		div = document.createElement("div");
-
-	// Setup
-	div.setAttribute( "className", "t" );
-	div.innerHTML = "  <link/><table></table><a href='/a'>a</a><input type='checkbox'/>";
-
-	// Support tests won't run in some limited or non-browser environments
-	all = div.getElementsByTagName("*");
-	a = div.getElementsByTagName("a")[ 0 ];
-	if ( !all || !a || !all.length ) {
-		return {};
-	}
-
-	// First batch of tests
-	select = document.createElement("select");
-	opt = select.appendChild( document.createElement("option") );
-	input = div.getElementsByTagName("input")[ 0 ];
-
-	a.style.cssText = "top:1px;float:left;opacity:.5";
-	support = {
-		// IE strips leading whitespace when .innerHTML is used
-		leadingWhitespace: ( div.firstChild.nodeType === 3 ),
-
-		// Make sure that tbody elements aren't automatically inserted
-		// IE will insert them into empty tables
-		tbody: !div.getElementsByTagName("tbody").length,
-
-		// Make sure that link elements get serialized correctly by innerHTML
-		// This requires a wrapper element in IE
-		htmlSerialize: !!div.getElementsByTagName("link").length,
-
-		// Get the style information from getAttribute
-		// (IE uses .cssText instead)
-		style: /top/.test( a.getAttribute("style") ),
-
-		// Make sure that URLs aren't manipulated
-		// (IE normalizes it by default)
-		hrefNormalized: ( a.getAttribute("href") === "/a" ),
-
-		// Make sure that element opacity exists
-		// (IE uses filter instead)
-		// Use a regex to work around a WebKit issue. See #5145
-		opacity: /^0.5/.test( a.style.opacity ),
-
-		// Verify style float existence
-		// (IE uses styleFloat instead of cssFloat)
-		cssFloat: !!a.style.cssFloat,
-
-		// Make sure that if no value is specified for a checkbox
-		// that it defaults to "on".
-		// (WebKit defaults to "" instead)
-		checkOn: ( input.value === "on" ),
-
-		// Make sure that a selected-by-default option has a working selected property.
-		// (WebKit defaults to false instead of true, IE too, if it's in an optgroup)
-		optSelected: opt.selected,
-
-		// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
-		getSetAttribute: div.className !== "t",
-
-		// Tests for enctype support on a form (#6743)
-		enctype: !!document.createElement("form").enctype,
-
-		// Makes sure cloning an html5 element does not cause problems
-		// Where outerHTML is undefined, this still works
-		html5Clone: document.createElement("nav").cloneNode( true ).outerHTML !== "<:nav></:nav>",
-
-		// jQuery.support.boxModel DEPRECATED in 1.8 since we don't support Quirks Mode
-		boxModel: ( document.compatMode === "CSS1Compat" ),
-
-		// Will be defined later
-		submitBubbles: true,
-		changeBubbles: true,
-		focusinBubbles: false,
-		deleteExpando: true,
-		noCloneEvent: true,
-		inlineBlockNeedsLayout: false,
-		shrinkWrapBlocks: false,
-		reliableMarginRight: true,
-		boxSizingReliable: true,
-		pixelPosition: false
-	};
-
-	// Make sure checked status is properly cloned
-	input.checked = true;
-	support.noCloneChecked = input.cloneNode( true ).checked;
-
-	// Make sure that the options inside disabled selects aren't marked as disabled
-	// (WebKit marks them as disabled)
-	select.disabled = true;
-	support.optDisabled = !opt.disabled;
-
-	// Test to see if it's possible to delete an expando from an element
-	// Fails in Internet Explorer
-	try {
-		delete div.test;
-	} catch( e ) {
-		support.deleteExpando = false;
-	}
-
-	if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
-		div.attachEvent( "onclick", clickFn = function() {
-			// Cloning a node shouldn't copy over any
-			// bound event handlers (IE does this)
-			support.noCloneEvent = false;
-		});
-		div.cloneNode( true ).fireEvent("onclick");
-		div.detachEvent( "onclick", clickFn );
-	}
-
-	// Check if a radio maintains its value
-	// after being appended to the DOM
-	input = document.createElement("input");
-	input.value = "t";
-	input.setAttribute( "type", "radio" );
-	support.radioValue = input.value === "t";
-
-	input.setAttribute( "checked", "checked" );
-
-	// #11217 - WebKit loses check when the name is after the checked attribute
-	input.setAttribute( "name", "t" );
-
-	div.appendChild( input );
-	fragment = document.createDocumentFragment();
-	fragment.appendChild( div.lastChild );
-
-	// WebKit doesn't clone checked state correctly in fragments
-	support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
-
-	// Check if a disconnected checkbox will retain its checked
-	// value of true after appended to the DOM (IE6/7)
-	support.appendChecked = input.checked;
-
-	fragment.removeChild( input );
-	fragment.appendChild( div );
-
-	// Technique from Juriy Zaytsev
-	// http://perfectionkills.com/detecting-event-support-without-browser-sniffing/
-	// We only care about the case where non-standard event systems
-	// are used, namely in IE. Short-circuiting here helps us to
-	// avoid an eval call (in setAttribute) which can cause CSP
-	// to go haywire. See: https://developer.mozilla.org/en/Security/CSP
-	if ( div.attachEvent ) {
-		for ( i in {
-			submit: true,
-			change: true,
-			focusin: true
-		}) {
-			eventName = "on" + i;
-			isSupported = ( eventName in div );
-			if ( !isSupported ) {
-				div.setAttribute( eventName, "return;" );
-				isSupported = ( typeof div[ eventName ] === "function" );
-			}
-			support[ i + "Bubbles" ] = isSupported;
-		}
-	}
-
-	// Run tests that need a body at doc ready
-	jQuery(function() {
-		var container, div, tds, marginDiv,
-			divReset = "padding:0;margin:0;border:0;display:block;overflow:hidden;",
-			body = document.getElementsByTagName("body")[0];
-
-		if ( !body ) {
-			// Return for frameset docs that don't have a body
-			return;
-		}
-
-		container = document.createElement("div");
-		container.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px";
-		body.insertBefore( container, body.firstChild );
-
-		// Construct the test element
-		div = document.createElement("div");
-		container.appendChild( div );
-
-		// Check if table cells still have offsetWidth/Height when they are set
-		// to display:none and there are still other visible table cells in a
-		// table row; if so, offsetWidth/Height are not reliable for use when
-		// determining if an element has been hidden directly using
-		// display:none (it is still safe to use offsets if a parent element is
-		// hidden; don safety goggles and see bug #4512 for more information).
-		// (only IE 8 fails this test)
-		div.innerHTML = "<table><tr><td></td><td>t</td></tr></table>";
-		tds = div.getElementsByTagName("td");
-		tds[ 0 ].style.cssText = "padding:0;margin:0;border:0;display:none";
-		isSupported = ( tds[ 0 ].offsetHeight === 0 );
-
-		tds[ 0 ].style.display = "";
-		tds[ 1 ].style.display = "none";
-
-		// Check if empty table cells still have offsetWidth/Height
-		// (IE <= 8 fail this test)
-		support.reliableHiddenOffsets = isSupported && ( tds[ 0 ].offsetHeight === 0 );
-
-		// Check box-sizing and margin behavior
-		div.innerHTML = "";
-		div.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;";
-		support.boxSizing = ( div.offsetWidth === 4 );
-		support.doesNotIncludeMarginInBodyOffset = ( body.offsetTop !== 1 );
-
-		// NOTE: To any future maintainer, we've window.getComputedStyle
-		// because jsdom on node.js will break without it.
-		if ( window.getComputedStyle ) {
-			support.pixelPosition = ( window.getComputedStyle( div, null ) || {} ).top !== "1%";
-			support.boxSizingReliable = ( window.getComputedStyle( div, null ) || { width: "4px" } ).width === "4px";
-
-			// Check if div with explicit width and no margin-right incorrectly
-			// gets computed margin-right based on width of container. For more
-			// info see bug #3333
-			// Fails in WebKit before Feb 2011 nightlies
-			// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-			marginDiv = document.createElement("div");
-			marginDiv.style.cssText = div.style.cssText = divReset;
-			marginDiv.style.marginRight = marginDiv.style.width = "0";
-			div.style.width = "1px";
-			div.appendChild( marginDiv );
-			support.reliableMarginRight =
-				!parseFloat( ( window.getComputedStyle( marginDiv, null ) || {} ).marginRight );
-		}
-
-		if ( typeof div.style.zoom !== "undefined" ) {
-			// Check if natively block-level elements act like inline-block
-			// elements when setting their display to 'inline' and giving
-			// them layout
-			// (IE < 8 does this)
-			div.innerHTML = "";
-			div.style.cssText = divReset + "width:1px;padding:1px;display:inline;zoom:1";
-			support.inlineBlockNeedsLayout = ( div.offsetWidth === 3 );
-
-			// Check if elements with layout shrink-wrap their children
-			// (IE 6 does this)
-			div.style.display = "block";
-			div.style.overflow = "visible";
-			div.innerHTML = "<div></div>";
-			div.firstChild.style.width = "5px";
-			support.shrinkWrapBlocks = ( div.offsetWidth !== 3 );
-
-			container.style.zoom = 1;
-		}
-
-		// Null elements to avoid leaks in IE
-		body.removeChild( container );
-		container = div = tds = marginDiv = null;
-	});
-
-	// Null elements to avoid leaks in IE
-	fragment.removeChild( div );
-	all = a = select = opt = input = fragment = div = null;
-
-	return support;
-})();
-var rbrace = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
-	rmultiDash = /([A-Z])/g;
-
-jQuery.extend({
-	cache: {},
-
-	deletedIds: [],
-
-	// Remove at next major release (1.9/2.0)
-	uuid: 0,
-
-	// Unique for each copy of jQuery on the page
-	// Non-digits removed to match rinlinejQuery
-	expando: "jQuery" + ( jQuery.fn.jquery + Math.random() ).replace( /\D/g, "" ),
-
-	// The following elements throw uncatchable exceptions if you
-	// attempt to add expando properties to them.
-	noData: {
-		"embed": true,
-		// Ban all objects except for Flash (which handle expandos)
-		"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
-		"applet": true
-	},
-
-	hasData: function( elem ) {
-		elem = elem.nodeType ? jQuery.cache[ elem[jQuery.expando] ] : elem[ jQuery.expando ];
-		return !!elem && !isEmptyDataObject( elem );
-	},
-
-	data: function( elem, name, data, pvt /* Internal Use Only */ ) {
-		if ( !jQuery.acceptData( elem ) ) {
-			return;
-		}
-
-		var thisCache, ret,
-			internalKey = jQuery.expando,
-			getByName = typeof name === "string",
-
-			// We have to handle DOM nodes and JS objects differently because IE6-7
-			// can't GC object references properly across the DOM-JS boundary
-			isNode = elem.nodeType,
-
-			// Only DOM nodes need the global jQuery cache; JS object data is
-			// attached directly to the object so GC can occur automatically
-			cache = isNode ? jQuery.cache : elem,
-
-			// Only defining an ID for JS objects if its cache already exists allows
-			// the code to shortcut on the same path as a DOM node with no cache
-			id = isNode ? elem[ internalKey ] : elem[ internalKey ] && internalKey;
-
-		// Avoid doing any more work than we need to when trying to get data on an
-		// object that has no data at all
-		if ( (!id || !cache[id] || (!pvt && !cache[id].data)) && getByName && data === undefined ) {
-			return;
-		}
-
-		if ( !id ) {
-			// Only DOM nodes need a new unique ID for each element since their data
-			// ends up in the global cache
-			if ( isNode ) {
-				elem[ internalKey ] = id = jQuery.deletedIds.pop() || jQuery.guid++;
-			} else {
-				id = internalKey;
-			}
-		}
-
-		if ( !cache[ id ] ) {
-			cache[ id ] = {};
-
-			// Avoids exposing jQuery metadata on plain JS objects when the object
-			// is serialized using JSON.stringify
-			if ( !isNode ) {
-				cache[ id ].toJSON = jQuery.noop;
-			}
-		}
-
-		// An object can be passed to jQuery.data instead of a key/value pair; this gets
-		// shallow copied over onto the existing cache
-		if ( typeof name === "object" || typeof name === "function" ) {
-			if ( pvt ) {
-				cache[ id ] = jQuery.extend( cache[ id ], name );
-			} else {
-				cache[ id ].data = jQuery.extend( cache[ id ].data, name );
-			}
-		}
-
-		thisCache = cache[ id ];
-
-		// jQuery data() is stored in a separate object inside the object's internal data
-		// cache in order to avoid key collisions between internal data and user-defined
-		// data.
-		if ( !pvt ) {
-			if ( !thisCache.data ) {
-				thisCache.data = {};
-			}
-
-			thisCache = thisCache.data;
-		}
-
-		if ( data !== undefined ) {
-			thisCache[ jQuery.camelCase( name ) ] = data;
-		}
-
-		// Check for both converted-to-camel and non-converted data property names
-		// If a data property was specified
-		if ( getByName ) {
-
-			// First Try to find as-is property data
-			ret = thisCache[ name ];
-
-			// Test for null|undefined property data
-			if ( ret == null ) {
-
-				// Try to find the camelCased property
-				ret = thisCache[ jQuery.camelCase( name ) ];
-			}
-		} else {
-			ret = thisCache;
-		}
-
-		return ret;
-	},
-
-	removeData: function( elem, name, pvt /* Internal Use Only */ ) {
-		if ( !jQuery.acceptData( elem ) ) {
-			return;
-		}
-
-		var thisCache, i, l,
-
-			isNode = elem.nodeType,
-
-			// See jQuery.data for more information
-			cache = isNode ? jQuery.cache : elem,
-			id = isNode ? elem[ jQuery.expando ] : jQuery.expando;
-
-		// If there is already no cache entry for this object, there is no
-		// purpose in continuing
-		if ( !cache[ id ] ) {
-			return;
-		}
-
-		if ( name ) {
-
-			thisCache = pvt ? cache[ id ] : cache[ id ].data;
-
-			if ( thisCache ) {
-
-				// Support array or space separated string names for data keys
-				if ( !jQuery.isArray( name ) ) {
-
-					// try the string as a key before any manipulation
-					if ( name in thisCache ) {
-						name = [ name ];
-					} else {
-
-						// split the camel cased version by spaces unless a key with the spaces exists
-						name = jQuery.camelCase( name );
-						if ( name in thisCache ) {
-							name = [ name ];
-						} else {
-							name = name.split(" ");
-						}
-					}
-				}
-
-				for ( i = 0, l = name.length; i < l; i++ ) {
-					delete thisCache[ name[i] ];
-				}
-
-				// If there is no data left in the cache, we want to continue
-				// and let the cache object itself get destroyed
-				if ( !( pvt ? isEmptyDataObject : jQuery.isEmptyObject )( thisCache ) ) {
-					return;
-				}
-			}
-		}
-
-		// See jQuery.data for more information
-		if ( !pvt ) {
-			delete cache[ id ].data;
-
-			// Don't destroy the parent cache unless the internal data object
-			// had been the only thing left in it
-			if ( !isEmptyDataObject( cache[ id ] ) ) {
-				return;
-			}
-		}
-
-		// Destroy the cache
-		if ( isNode ) {
-			jQuery.cleanData( [ elem ], true );
-
-		// Use delete when supported for expandos or `cache` is not a window per isWindow (#10080)
-		} else if ( jQuery.support.deleteExpando || cache != cache.window ) {
-			delete cache[ id ];
-
-		// When all else fails, null
-		} else {
-			cache[ id ] = null;
-		}
-	},
-
-	// For internal use only.
-	_data: function( elem, name, data ) {
-		return jQuery.data( elem, name, data, true );
-	},
-
-	// A method for determining if a DOM node can handle the data expando
-	acceptData: function( elem ) {
-		var noData = elem.nodeName && jQuery.noData[ elem.nodeName.toLowerCase() ];
-
-		// nodes accept data unless otherwise specified; rejection can be conditional
-		return !noData || noData !== true && elem.getAttribute("classid") === noData;
-	}
-});
-
-jQuery.fn.extend({
-	data: function( key, value ) {
-		var parts, part, attr, name, l,
-			elem = this[0],
-			i = 0,
-			data = null;
-
-		// Gets all values
-		if ( key === undefined ) {
-			if ( this.length ) {
-				data = jQuery.data( elem );
-
-				if ( elem.nodeType === 1 && !jQuery._data( elem, "parsedAttrs" ) ) {
-					attr = elem.attributes;
-					for ( l = attr.length; i < l; i++ ) {
-						name = attr[i].name;
-
-						if ( !name.indexOf( "data-" ) ) {
-							name = jQuery.camelCase( name.substring(5) );
-
-							dataAttr( elem, name, data[ name ] );
-						}
-					}
-					jQuery._data( elem, "parsedAttrs", true );
-				}
-			}
-
-			return data;
-		}
-
-		// Sets multiple values
-		if ( typeof key === "object" ) {
-			return this.each(function() {
-				jQuery.data( this, key );
-			});
-		}
-
-		parts = key.split( ".", 2 );
-		parts[1] = parts[1] ? "." + parts[1] : "";
-		part = parts[1] + "!";
-
-		return jQuery.access( this, function( value ) {
-
-			if ( value === undefined ) {
-				data = this.triggerHandler( "getData" + part, [ parts[0] ] );
-
-				// Try to fetch any internally stored data first
-				if ( data === undefined && elem ) {
-					data = jQuery.data( elem, key );
-					data = dataAttr( elem, key, data );
-				}
-
-				return data === undefined && parts[1] ?
-					this.data( parts[0] ) :
-					data;
-			}
-
-			parts[1] = value;
-			this.each(function() {
-				var self = jQuery( this );
-
-				self.triggerHandler( "setData" + part, parts );
-				jQuery.data( this, key, value );
-				self.triggerHandler( "changeData" + part, parts );
-			});
-		}, null, value, arguments.length > 1, null, false );
-	},
-
-	removeData: function( key ) {
-		return this.each(function() {
-			jQuery.removeData( this, key );
-		});
-	}
-});
-
-function dataAttr( elem, key, data ) {
-	// If nothing was found internally, try to fetch any
-	// data from the HTML5 data-* attribute
-	if ( data === undefined && elem.nodeType === 1 ) {
-
-		var name = "data-" + key.replace( rmultiDash, "-$1" ).toLowerCase();
-
-		data = elem.getAttribute( name );
-
-		if ( typeof data === "string" ) {
-			try {
-				data = data === "true" ? true :
-				data === "false" ? false :
-				data === "null" ? null :
-				// Only convert to a number if it doesn't change the string
-				+data + "" === data ? +data :
-				rbrace.test( data ) ? jQuery.parseJSON( data ) :
-					data;
-			} catch( e ) {}
-
-			// Make sure we set the data so it isn't changed later
-			jQuery.data( elem, key, data );
-
-		} else {
-			data = undefined;
-		}
-	}
-
-	return data;
-}
-
-// checks a cache object for emptiness
-function isEmptyDataObject( obj ) {
-	var name;
-	for ( name in obj ) {
-
-		// if the public data object is empty, the private is still empty
-		if ( name === "data" && jQuery.isEmptyObject( obj[name] ) ) {
-			continue;
-		}
-		if ( name !== "toJSON" ) {
-			return false;
-		}
-	}
-
-	return true;
-}
-jQuery.extend({
-	queue: function( elem, type, data ) {
-		var queue;
-
-		if ( elem ) {
-			type = ( type || "fx" ) + "queue";
-			queue = jQuery._data( elem, type );
-
-			// Speed up dequeue by getting out quickly if this is just a lookup
-			if ( data ) {
-				if ( !queue || jQuery.isArray(data) ) {
-					queue = jQuery._data( elem, type, jQuery.makeArray(data) );
-				} else {
-					queue.push( data );
-				}
-			}
-			return queue || [];
-		}
-	},
-
-	dequeue: function( elem, type ) {
-		type = type || "fx";
-
-		var queue = jQuery.queue( elem, type ),
-			startLength = queue.length,
-			fn = queue.shift(),
-			hooks = jQuery._queueHooks( elem, type ),
-			next = function() {
-				jQuery.dequeue( elem, type );
-			};
-
-		// If the fx queue is dequeued, always remove the progress sentinel
-		if ( fn === "inprogress" ) {
-			fn = queue.shift();
-			startLength--;
-		}
-
-		if ( fn ) {
-
-			// Add a progress sentinel to prevent the fx queue from being
-			// automatically dequeued
-			if ( type === "fx" ) {
-				queue.unshift( "inprogress" );
-			}
-
-			// clear up the last queue stop function
-			delete hooks.stop;
-			fn.call( elem, next, hooks );
-		}
-
-		if ( !startLength && hooks ) {
-			hooks.empty.fire();
-		}
-	},
-
-	// not intended for public consumption - generates a queueHooks object, or returns the current one
-	_queueHooks: function( elem, type ) {
-		var key = type + "queueHooks";
-		return jQuery._data( elem, key ) || jQuery._data( elem, key, {
-			empty: jQuery.Callbacks("once memory").add(function() {
-				jQuery.removeData( elem, type + "queue", true );
-				jQuery.removeData( elem, key, true );
-			})
-		});
-	}
-});
-
-jQuery.fn.extend({
-	queue: function( type, data ) {
-		var setter = 2;
-
-		if ( typeof type !== "string" ) {
-			data = type;
-			type = "fx";
-			setter--;
-		}
-
-		if ( arguments.length < setter ) {
-			return jQuery.queue( this[0], type );
-		}
-
-		return data === undefined ?
-			this :
-			this.each(function() {
-				var queue = jQuery.queue( this, type, data );
-
-				// ensure a hooks for this queue
-				jQuery._queueHooks( this, type );
-
-				if ( type === "fx" && queue[0] !== "inprogress" ) {
-					jQuery.dequeue( this, type );
-				}
-			});
-	},
-	dequeue: function( type ) {
-		return this.each(function() {
-			jQuery.dequeue( this, type );
-		});
-	},
-	// Based off of the plugin by Clint Helfers, with permission.
-	// http://blindsignals.com/index.php/2009/07/jquery-delay/
-	delay: function( time, type ) {
-		time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time;
-		type = type || "fx";
-
-		return this.queue( type, function( next, hooks ) {
-			var timeout = setTimeout( next, time );
-			hooks.stop = function() {
-				clearTimeout( timeout );
-			};
-		});
-	},
-	clearQueue: function( type ) {
-		return this.queue( type || "fx", [] );
-	},
-	// Get a promise resolved when queues of a certain type
-	// are emptied (fx is the type by default)
-	promise: function( type, obj ) {
-		var tmp,
-			count = 1,
-			defer = jQuery.Deferred(),
-			elements = this,
-			i = this.length,
-			resolve = function() {
-				if ( !( --count ) ) {
-					defer.resolveWith( elements, [ elements ] );
-				}
-			};
-
-		if ( typeof type !== "string" ) {
-			obj = type;
-			type = undefined;
-		}
-		type = type || "fx";
-
-		while( i-- ) {
-			tmp = jQuery._data( elements[ i ], type + "queueHooks" );
-			if ( tmp && tmp.empty ) {
-				count++;
-				tmp.empty.add( resolve );
-			}
-		}
-		resolve();
-		return defer.promise( obj );
-	}
-});
-var nodeHook, boolHook, fixSpecified,
-	rclass = /[\t\r\n]/g,
-	rreturn = /\r/g,
-	rtype = /^(?:button|input)$/i,
-	rfocusable = /^(?:button|input|object|select|textarea)$/i,
-	rclickable = /^a(?:rea|)$/i,
-	rboolean = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
-	getSetAttribute = jQuery.support.getSetAttribute;
-
-jQuery.fn.extend({
-	attr: function( name, value ) {
-		return jQuery.access( this, jQuery.attr, name, value, arguments.length > 1 );
-	},
-
-	removeAttr: function( name ) {
-		return this.each(function() {
-			jQuery.removeAttr( this, name );
-		});
-	},
-
-	prop: function( name, value ) {
-		return jQuery.access( this, jQuery.prop, name, value, arguments.length > 1 );
-	},
-
-	removeProp: function( name ) {
-		name = jQuery.propFix[ name ] || name;
-		return this.each(function() {
-			// try/catch handles cases where IE balks (such as removing a property on window)
-			try {
-				this[ name ] = undefined;
-				delete this[ name ];
-			} catch( e ) {}
-		});
-	},
-
-	addClass: function( value ) {
-		var classNames, i, l, elem,
-			setClass, c, cl;
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).addClass( value.call(this, j, this.className) );
-			});
-		}
-
-		if ( value && typeof value === "string" ) {
-			classNames = value.split( core_rspace );
-
-			for ( i = 0, l = this.length; i < l; i++ ) {
-				elem = this[ i ];
-
-				if ( elem.nodeType === 1 ) {
-					if ( !elem.className && classNames.length === 1 ) {
-						elem.className = value;
-
-					} else {
-						setClass = " " + elem.className + " ";
-
-						for ( c = 0, cl = classNames.length; c < cl; c++ ) {
-							if ( setClass.indexOf( " " + classNames[ c ] + " " ) < 0 ) {
-								setClass += classNames[ c ] + " ";
-							}
-						}
-						elem.className = jQuery.trim( setClass );
-					}
-				}
-			}
-		}
-
-		return this;
-	},
-
-	removeClass: function( value ) {
-		var removes, className, elem, c, cl, i, l;
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( j ) {
-				jQuery( this ).removeClass( value.call(this, j, this.className) );
-			});
-		}
-		if ( (value && typeof value === "string") || value === undefined ) {
-			removes = ( value || "" ).split( core_rspace );
-
-			for ( i = 0, l = this.length; i < l; i++ ) {
-				elem = this[ i ];
-				if ( elem.nodeType === 1 && elem.className ) {
-
-					className = (" " + elem.className + " ").replace( rclass, " " );
-
-					// loop over each item in the removal list
-					for ( c = 0, cl = removes.length; c < cl; c++ ) {
-						// Remove until there is nothing to remove,
-						while ( className.indexOf(" " + removes[ c ] + " ") >= 0 ) {
-							className = className.replace( " " + removes[ c ] + " " , " " );
-						}
-					}
-					elem.className = value ? jQuery.trim( className ) : "";
-				}
-			}
-		}
-
-		return this;
-	},
-
-	toggleClass: function( value, stateVal ) {
-		var type = typeof value,
-			isBool = typeof stateVal === "boolean";
-
-		if ( jQuery.isFunction( value ) ) {
-			return this.each(function( i ) {
-				jQuery( this ).toggleClass( value.call(this, i, this.className, stateVal), stateVal );
-			});
-		}
-
-		return this.each(function() {
-			if ( type === "string" ) {
-				// toggle individual class names
-				var className,
-					i = 0,
-					self = jQuery( this ),
-					state = stateVal,
-					classNames = value.split( core_rspace );
-
-				while ( (className = classNames[ i++ ]) ) {
-					// check each className given, space separated list
-					state = isBool ? state : !self.hasClass( className );
-					self[ state ? "addClass" : "removeClass" ]( className );
-				}
-
-			} else if ( type === "undefined" || type === "boolean" ) {
-				if ( this.className ) {
-					// store className if set
-					jQuery._data( this, "__className__", this.className );
-				}
-
-				// toggle whole className
-				this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
-			}
-		});
-	},
-
-	hasClass: function( selector ) {
-		var className = " " + selector + " ",
-			i = 0,
-			l = this.length;
-		for ( ; i < l; i++ ) {
-			if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) >= 0 ) {
-				return true;
-			}
-		}
-
-		return false;
-	},
-
-	val: function( value ) {
-		var hooks, ret, isFunction,
-			elem = this[0];
-
-		if ( !arguments.length ) {
-			if ( elem ) {
-				hooks = jQuery.valHooks[ elem.type ] || jQuery.valHooks[ elem.nodeName.toLowerCase() ];
-
-				if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
-					return ret;
-				}
-
-				ret = elem.value;
-
-				return typeof ret === "string" ?
-					// handle most common string cases
-					ret.replace(rreturn, "") :
-					// handle cases where value is null/undef or number
-					ret == null ? "" : ret;
-			}
-
-			return;
-		}
-
-		isFunction = jQuery.isFunction( value );
-
-		return this.each(function( i ) {
-			var val,
-				self = jQuery(this);
-
-			if ( this.nodeType !== 1 ) {
-				return;
-			}
-
-			if ( isFunction ) {
-				val = value.call( this, i, self.val() );
-			} else {
-				val = value;
-			}
-
-			// Treat null/undefined as ""; convert numbers to string
-			if ( val == null ) {
-				val = "";
-			} else if ( typeof val === "number" ) {
-				val += "";
-			} else if ( jQuery.isArray( val ) ) {
-				val = jQuery.map(val, function ( value ) {
-					return value == null ? "" : value + "";
-				});
-			}
-
-			hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ];
-
-			// If set returns undefined, fall back to normal setting
-			if ( !hooks || !("set" in hooks) || hooks.set( this, val, "value" ) === undefined ) {
-				this.value = val;
-			}
-		});
-	}
-});
-
-jQuery.extend({
-	valHooks: {
-		option: {
-			get: function( elem ) {
-				// attributes.value is undefined in Blackberry 4.7 but
-				// uses .value. See #6932
-				var val = elem.attributes.value;
-				return !val || val.specified ? elem.value : elem.text;
-			}
-		},
-		select: {
-			get: function( elem ) {
-				var value, option,
-					options = elem.options,
-					index = elem.selectedIndex,
-					one = elem.type === "select-one" || index < 0,
-					values = one ? null : [],
-					max = one ? index + 1 : options.length,
-					i = index < 0 ?
-						max :
-						one ? index : 0;
-
-				// Loop through all the selected options
-				for ( ; i < max; i++ ) {
-					option = options[ i ];
-
-					// oldIE doesn't update selected after form reset (#2551)
-					if ( ( option.selected || i === index ) &&
-							// Don't return options that are disabled or in a disabled optgroup
-							( jQuery.support.optDisabled ? !option.disabled : option.getAttribute("disabled") === null ) &&
-							( !option.parentNode.disabled || !jQuery.nodeName( option.parentNode, "optgroup" ) ) ) {
-
-						// Get the specific value for the option
-						value = jQuery( option ).val();
-
-						// We don't need an array for one selects
-						if ( one ) {
-							return value;
-						}
-
-						// Multi-Selects return an array
-						values.push( value );
-					}
-				}
-
-				return values;
-			},
-
-			set: function( elem, value ) {
-				var values = jQuery.makeArray( value );
-
-				jQuery(elem).find("option").each(function() {
-					this.selected = jQuery.inArray( jQuery(this).val(), values ) >= 0;
-				});
-
-				if ( !values.length ) {
-					elem.selectedIndex = -1;
-				}
-				return values;
-			}
-		}
-	},
-
-	// Unused in 1.8, left in so attrFn-stabbers won't die; remove in 1.9
-	attrFn: {},
-
-	attr: function( elem, name, value, pass ) {
-		var ret, hooks, notxml,
-			nType = elem.nodeType;
-
-		// don't get/set attributes on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return;
-		}
-
-		if ( pass && jQuery.isFunction( jQuery.fn[ name ] ) ) {
-			return jQuery( elem )[ name ]( value );
-		}
-
-		// Fallback to prop when attributes are not supported
-		if ( typeof elem.getAttribute === "undefined" ) {
-			return jQuery.prop( elem, name, value );
-		}
-
-		notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
-		// All attributes are lowercase
-		// Grab necessary hook if one is defined
-		if ( notxml ) {
-			name = name.toLowerCase();
-			hooks = jQuery.attrHooks[ name ] || ( rboolean.test( name ) ? boolHook : nodeHook );
-		}
-
-		if ( value !== undefined ) {
-
-			if ( value === null ) {
-				jQuery.removeAttr( elem, name );
-				return;
-
-			} else if ( hooks && "set" in hooks && notxml && (ret = hooks.set( elem, value, name )) !== undefined ) {
-				return ret;
-
-			} else {
-				elem.setAttribute( name, value + "" );
-				return value;
-			}
-
-		} else if ( hooks && "get" in hooks && notxml && (ret = hooks.get( elem, name )) !== null ) {
-			return ret;
-
-		} else {
-
-			ret = elem.getAttribute( name );
-
-			// Non-existent attributes return null, we normalize to undefined
-			return ret === null ?
-				undefined :
-				ret;
-		}
-	},
-
-	removeAttr: function( elem, value ) {
-		var propName, attrNames, name, isBool,
-			i = 0;
-
-		if ( value && elem.nodeType === 1 ) {
-
-			attrNames = value.split( core_rspace );
-
-			for ( ; i < attrNames.length; i++ ) {
-				name = attrNames[ i ];
-
-				if ( name ) {
-					propName = jQuery.propFix[ name ] || name;
-					isBool = rboolean.test( name );
-
-					// See #9699 for explanation of this approach (setting first, then removal)
-					// Do not do this for boolean attributes (see #10870)
-					if ( !isBool ) {
-						jQuery.attr( elem, name, "" );
-					}
-					elem.removeAttribute( getSetAttribute ? name : propName );
-
-					// Set corresponding property to false for boolean attributes
-					if ( isBool && propName in elem ) {
-						elem[ propName ] = false;
-					}
-				}
-			}
-		}
-	},
-
-	attrHooks: {
-		type: {
-			set: function( elem, value ) {
-				// We can't allow the type property to be changed (since it causes problems in IE)
-				if ( rtype.test( elem.nodeName ) && elem.parentNode ) {
-					jQuery.error( "type property can't be changed" );
-				} else if ( !jQuery.support.radioValue && value === "radio" && jQuery.nodeName(elem, "input") ) {
-					// Setting the type on a radio button after the value resets the value in IE6-9
-					// Reset value to it's default in case type is set after value
-					// This is for element creation
-					var val = elem.value;
-					elem.setAttribute( "type", value );
-					if ( val ) {
-						elem.value = val;
-					}
-					return value;
-				}
-			}
-		},
-		// Use the value property for back compat
-		// Use the nodeHook for button elements in IE6/7 (#1954)
-		value: {
-			get: function( elem, name ) {
-				if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
-					return nodeHook.get( elem, name );
-				}
-				return name in elem ?
-					elem.value :
-					null;
-			},
-			set: function( elem, value, name ) {
-				if ( nodeHook && jQuery.nodeName( elem, "button" ) ) {
-					return nodeHook.set( elem, value, name );
-				}
-				// Does not return so that setAttribute is also used
-				elem.value = value;
-			}
-		}
-	},
-
-	propFix: {
-		tabindex: "tabIndex",
-		readonly: "readOnly",
-		"for": "htmlFor",
-		"class": "className",
-		maxlength: "maxLength",
-		cellspacing: "cellSpacing",
-		cellpadding: "cellPadding",
-		rowspan: "rowSpan",
-		colspan: "colSpan",
-		usemap: "useMap",
-		frameborder: "frameBorder",
-		contenteditable: "contentEditable"
-	},
-
-	prop: function( elem, name, value ) {
-		var ret, hooks, notxml,
-			nType = elem.nodeType;
-
-		// don't get/set properties on text, comment and attribute nodes
-		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
-			return;
-		}
-
-		notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
-
-		if ( notxml ) {
-			// Fix name and attach hooks
-			name = jQuery.propFix[ name ] || name;
-			hooks = jQuery.propHooks[ name ];
-		}
-
-		if ( value !== undefined ) {
-			if ( hooks && "set" in hooks && (ret = hooks.set( elem, value, name )) !== undefined ) {
-				return ret;
-
-			} else {
-				return ( elem[ name ] = value );
-			}
-
-		} else {
-			if ( hooks && "get" in hooks && (ret = hooks.get( elem, name )) !== null ) {
-				return ret;
-
-			} else {
-				return elem[ name ];
-			}
-		}
-	},
-
-	propHooks: {
-		tabIndex: {
-			get: function( elem ) {
-				// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
-				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
-				var attributeNode = elem.getAttributeNode("tabindex");
-
-				return attributeNode && attributeNode.specified ?
-					parseInt( attributeNode.value, 10 ) :
-					rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
-						0 :
-						undefined;
-			}
-		}
-	}
-});
-
-// Hook for boolean attributes
-boolHook = {
-	get: function( elem, name ) {
-		// Align boolean attributes with corresponding properties
-		// Fall back to attribute presence where some booleans are not supported
-		var attrNode,
-			property = jQuery.prop( elem, name );
-		return property === true || typeof property !== "boolean" && ( attrNode = elem.getAttributeNode(name) ) && attrNode.nodeValue !== false ?
-			name.toLowerCase() :
-			undefined;
-	},
-	set: function( elem, value, name ) {
-		var propName;
-		if ( value === false ) {
-			// Remove boolean attributes when set to false
-			jQuery.removeAttr( elem, name );
-		} else {
-			// value is true since we know at this point it's type boolean and not false
-			// Set boolean attributes to the same name and set the DOM property
-			propName = jQuery.propFix[ name ] || name;
-			if ( propName in elem ) {
-				// Only set the IDL specifically if it already exists on the element
-				elem[ propName ] = true;
-			}
-
-			elem.setAttribute( name, name.toLowerCase() );
-		}
-		return name;
-	}
-};
-
-// IE6/7 do not support getting/setting some attributes with get/setAttribute
-if ( !getSetAttribute ) {
-
-	fixSpecified = {
-		name: true,
-		id: true,
-		coords: true
-	};
-
-	// Use this for any attribute in IE6/7
-	// This fixes almost every IE6/7 issue
-	nodeHook = jQuery.valHooks.button = {
-		get: function( elem, name ) {
-			var ret;
-			ret = elem.getAttributeNode( name );
-			return ret && ( fixSpecified[ name ] ? ret.value !== "" : ret.specified ) ?
-				ret.value :
-				undefined;
-		},
-		set: function( elem, value, name ) {
-			// Set the existing or create a new attribute node
-			var ret = elem.getAttributeNode( name );
-			if ( !ret ) {
-				ret = document.createAttribute( name );
-				elem.setAttributeNode( ret );
-			}
-			return ( ret.value = value + "" );
-		}
-	};
-
-	// Set width and height to auto instead of 0 on empty string( Bug #8150 )
-	// This is for removals
-	jQuery.each([ "width", "height" ], function( i, name ) {
-		jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
-			set: function( elem, value ) {
-				if ( value === "" ) {
-					elem.setAttribute( name, "auto" );
-					return value;
-				}
-			}
-		});
-	});
-
-	// Set contenteditable to false on removals(#10429)
-	// Setting to empty string throws an error as an invalid value
-	jQuery.attrHooks.contenteditable = {
-		get: nodeHook.get,
-		set: function( elem, value, name ) {
-			if ( value === "" ) {
-				value = "false";
-			}
-			nodeHook.set( elem, value, name );
-		}
-	};
-}
-
-
-// Some attributes require a special call on IE
-if ( !jQuery.support.hrefNormalized ) {
-	jQuery.each([ "href", "src", "width", "height" ], function( i, name ) {
-		jQuery.attrHooks[ name ] = jQuery.extend( jQuery.attrHooks[ name ], {
-			get: function( elem ) {
-				var ret = elem.getAttribute( name, 2 );
-				return ret === null ? undefined : ret;
-			}
-		});
-	});
-}
-
-if ( !jQuery.support.style ) {
-	jQuery.attrHooks.style = {
-		get: function( elem ) {
-			// Return undefined in the case of empty string
-			// Normalize to lowercase since IE uppercases css property names
-			return elem.style.cssText.toLowerCase() || undefined;
-		},
-		set: function( elem, value ) {
-			return ( elem.style.cssText = value + "" );
-		}
-	};
-}
-
-// Safari mis-reports the default selected property of an option
-// Accessing the parent's selectedIndex property fixes it
-if ( !jQuery.support.optSelected ) {
-	jQuery.propHooks.selected = jQuery.extend( jQuery.propHooks.selected, {
-		get: function( elem ) {
-			var parent = elem.parentNode;
-
-			if ( parent ) {
-				parent.selectedIndex;
-
-				// Make sure that it also works with optgroups, see #5701
-				if ( parent.parentNode ) {
-					parent.parentNode.selectedIndex;
-				}
-			}
-			return null;
-		}
-	});
-}
-
-// IE6/7 call enctype encoding
-if ( !jQuery.support.enctype ) {
-	jQuery.propFix.enctype = "encoding";
-}
-
-// Radios and checkboxes getter/setter
-if ( !jQuery.support.checkOn ) {
-	jQuery.each([ "radio", "checkbox" ], function() {
-		jQuery.valHooks[ this ] = {
-			get: function( elem ) {
-				// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
-				return elem.getAttribute("value") === null ? "on" : elem.value;
-			}
-		};
-	});
-}
-jQuery.each([ "radio", "checkbox" ], function() {
-	jQuery.valHooks[ this ] = jQuery.extend( jQuery.valHooks[ this ], {
-		set: function( elem, value ) {
-			if ( jQuery.isArray( value ) ) {
-				return ( elem.checked = jQuery.inArray( jQuery(elem).val(), value ) >= 0 );
-			}
-		}
-	});
-});
-var rformElems = /^(?:textarea|input|select)$/i,
-	rtypenamespace = /^([^\.]*|)(?:\.(.+)|)$/,
-	rhoverHack = /(?:^|\s)hover(\.\S+|)\b/,
-	rkeyEvent = /^key/,
-	rmouseEvent = /^(?:mouse|contextmenu)|click/,
-	rfocusMorph = /^(?:focusinfocus|focusoutblur)$/,
-	hoverHack = function( events ) {
-		return jQuery.event.special.hover ? events : events.replace( rhoverHack, "mouseenter$1 mouseleave$1" );
-	};
-
-/*
- * Helper functions for managing events -- not part of the public interface.
- * Props to Dean Edwards' addEvent library for many of the ideas.
- */
-jQuery.event = {
-
-	add: function( elem, types, handler, data, selector ) {
-
-		var elemData, eventHandle, events,
-			t, tns, type, namespaces, handleObj,
-			handleObjIn, handlers, special;
-
-		// Don't attach events to noData or text/comment nodes (allow plain objects tho)
-		if ( elem.nodeType === 3 || elem.nodeType === 8 || !types || !handler || !(elemData = jQuery._data( elem )) ) {
-			return;
-		}
-
-		// Caller can pass in an object of custom data in lieu of the handler
-		if ( handler.handler ) {
-			handleObjIn = handler;
-			handler = handleObjIn.handler;
-			selector = handleObjIn.selector;
-		}
-
-		// Make sure that the handler has a unique ID, used to find/remove it later
-		if ( !handler.guid ) {
-			handler.guid = jQuery.guid++;
-		}
-
-		// Init the element's event structure and main handler, if this is the first
-		events = elemData.events;
-		if ( !events ) {
-			elemData.events = events = {};
-		}
-		eventHandle = elemData.handle;
-		if ( !eventHandle ) {
-			elemData.handle = eventHandle = function( e ) {
-				// Discard the second event of a jQuery.event.trigger() and
-				// when an event is called after a page has unloaded
-				return typeof jQuery !== "undefined" && (!e || jQuery.event.triggered !== e.type) ?
-					jQuery.event.dispatch.apply( eventHandle.elem, arguments ) :
-					undefined;
-			};
-			// Add elem as a property of the handle fn to prevent a memory leak with IE non-native events
-			eventHandle.elem = elem;
-		}
-
-		// Handle multiple events separated by a space
-		// jQuery(...).bind("mouseover mouseout", fn);
-		types = jQuery.trim( hoverHack(types) ).split( " " );
-		for ( t = 0; t < types.length; t++ ) {
-
-			tns = rtypenamespace.exec( types[t] ) || [];
-			type = tns[1];
-			namespaces = ( tns[2] || "" ).split( "." ).sort();
-
-			// If event changes its type, use the special event handlers for the changed type
-			special = jQuery.event.special[ type ] || {};
-
-			// If selector defined, determine special event api type, otherwise given type
-			type = ( selector ? special.delegateType : special.bindType ) || type;
-
-			// Update special based on newly reset type
-			special = jQuery.event.special[ type ] || {};
-
-			// handleObj is passed to all event handlers
-			handleObj = jQuery.extend({
-				type: type,
-				origType: tns[1],
-				data: data,
-				handler: handler,
-				guid: handler.guid,
-				selector: selector,
-				needsContext: selector && jQuery.expr.match.needsContext.test( selector ),
-				namespace: namespaces.join(".")
-			}, handleObjIn );
-
-			// Init the event handler queue if we're the first
-			handlers = events[ type ];
-			if ( !handlers ) {
-				handlers = events[ type ] = [];
-				handlers.delegateCount = 0;
-
-				// Only use addEventListener/attachEvent if the special events handler returns false
-				if ( !special.setup || special.setup.call( elem, data, namespaces, eventHandle ) === false ) {
-					// Bind the global event handler to the element
-					if ( elem.addEventListener ) {
-						elem.addEventListener( type, eventHandle, false );
-
-					} else if ( elem.attachEvent ) {
-						elem.attachEvent( "on" + type, eventHandle );
-					}
-				}
-			}
-
-			if ( special.add ) {
-				special.add.call( elem, handleObj );
-
-				if ( !handleObj.handler.guid ) {
-					handleObj.handler.guid = handler.guid;
-				}
-			}
-
-			// Add to the element's handler list, delegates in front
-			if ( selector ) {
-				handlers.splice( handlers.delegateCount++, 0, handleObj );
-			} else {
-				handlers.push( handleObj );
-			}
-
-			// Keep track of which events have ever been used, for event optimization
-			jQuery.event.global[ type ] = true;
-		}
-
-		// Nullify elem to prevent memory leaks in IE
-		elem = null;
-	},
-
-	global: {},
-
-	// Detach an event or set of events from an element
-	remove: function( elem, types, handler, selector, mappedTypes ) {
-
-		var t, tns, type, origType, namespaces, origCount,
-			j, events, special, eventType, handleObj,
-			elemData = jQuery.hasData( elem ) && jQuery._data( elem );
-
-		if ( !elemData || !(events = elemData.events) ) {
-			return;
-		}
-
-		// Once for each type.namespace in types; type may be omitted
-		types = jQuery.trim( hoverHack( types || "" ) ).split(" ");
-		for ( t = 0; t < types.length; t++ ) {
-			tns = rtypenamespace.exec( types[t] ) || [];
-			type = origType = tns[1];
-			namespaces = tns[2];
-
-			// Unbind all events (on this namespace, if provided) for the element
-			if ( !type ) {
-				for ( type in events ) {
-					jQuery.event.remove( elem, type + types[ t ], handler, selector, true );
-				}
-				continue;
-			}
-
-			special = jQuery.event.special[ type ] || {};
-			type = ( selector? special.delegateType : special.bindType ) || type;
-			eventType = events[ type ] || [];
-			origCount = eventType.length;
-			namespaces = namespaces ? new RegExp("(^|\\.)" + namespaces.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
-
-			// Remove matching events
-			for ( j = 0; j < eventType.length; j++ ) {
-				handleObj = eventType[ j ];
-
-				if ( ( mappedTypes || origType === handleObj.origType ) &&
-					 ( !handler || handler.guid === handleObj.guid ) &&
-					 ( !namespaces || namespaces.test( handleObj.namespace ) ) &&
-					 ( !selector || selector === handleObj.selector || selector === "**" && handleObj.selector ) ) {
-					eventType.splice( j--, 1 );
-
-					if ( handleObj.selector ) {
-						eventType.delegateCount--;
-					}
-					if ( special.remove ) {
-						special.remove.call( elem, handleObj );
-					}
-				}
-			}
-
-			// Remove generic event handler if we removed something and no more handlers exist
-			// (avoids potential for endless recursion during removal of special event handlers)
-			if ( eventType.length === 0 && origCount !== eventType.length ) {
-				if ( !special.teardown || special.teardown.call( elem, namespaces, elemData.handle ) === false ) {
-					jQuery.removeEvent( elem, type, elemData.handle );
-				}
-
-				delete events[ type ];
-			}
-		}
-
-		// Remove the expando if it's no longer used
-		if ( jQuery.isEmptyObject( events ) ) {
-			delete elemData.handle;
-
-			// removeData also checks for emptiness and clears the expando if empty
-			// so use it instead of delete
-			jQuery.removeData( elem, "events", true );
-		}
-	},
-
-	// Events that are safe to short-circuit if no handlers are attached.
-	// Native DOM events should not be added, they may have inline handlers.
-	customEvent: {
-		"getData": true,
-		"setData": true,
-		"changeData": true
-	},
-
-	trigger: function( event, data, elem, onlyHandlers ) {
-		// Don't do events on text and comment nodes
-		if ( elem && (elem.nodeType === 3 || elem.nodeType === 8) ) {
-			return;
-		}
-
-		// Event object or event type
-		var cache, exclusive, i, cur, old, ontype, special, handle, eventPath, bubbleType,
-			type = event.type || event,
-			namespaces = [];
-
-		// focus/blur morphs to focusin/out; ensure we're not firing them right now
-		if ( rfocusMorph.test( type + jQuery.event.triggered ) ) {
-			return;
-		}
-
-		if ( type.indexOf( "!" ) >= 0 ) {
-			// Exclusive events trigger only for the exact event (no namespaces)
-			type = type.slice(0, -1);
-			exclusive = true;
-		}
-
-		if ( type.indexOf( "." ) >= 0 ) {
-			// Namespaced trigger; create a regexp to match event type in handle()
-			namespaces = type.split(".");
-			type = namespaces.shift();
-			namespaces.sort();
-		}
-
-		if ( (!elem || jQuery.event.customEvent[ type ]) && !jQuery.event.global[ type ] ) {
-			// No jQuery handlers for this event type, and it can't have inline handlers
-			return;
-		}
-
-		// Caller can pass in an Event, Object, or just an event type string
-		event = typeof event === "object" ?
-			// jQuery.Event object
-			event[ jQuery.expando ] ? event :
-			// Object literal
-			new jQuery.Event( type, event ) :
-			// Just the event type (string)
-			new jQuery.Event( type );
-
-		event.type = type;
-		event.isTrigger = true;
-		event.exclusive = exclusive;
-		event.namespace = namespaces.join( "." );
-		event.namespace_re = event.namespace? new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.|)") + "(\\.|$)") : null;
-		ontype = type.indexOf( ":" ) < 0 ? "on" + type : "";
-
-		// Handle a global trigger
-		if ( !elem ) {
-
-			// TODO: Stop taunting the data cache; remove global events and always attach to document
-			cache = jQuery.cache;
-			for ( i in cache ) {
-				if ( cache[ i ].events && cache[ i ].events[ type ] ) {
-					jQuery.event.trigger( event, data, cache[ i ].handle.elem, true );
-				}
-			}
-			return;
-		}
-
-		// Clean up the event in case it is being reused
-		event.result = undefined;
-		if ( !event.target ) {
-			event.target = elem;
-		}
-
-		// Clone any incoming data and prepend the event, creating the handler arg list
-		data = data != null ? jQuery.makeArray( data ) : [];
-		data.unshift( event );
-
-		// Allow special events to draw outside the lines
-		special = jQuery.event.special[ type ] || {};
-		if ( special.trigger && special.trigger.apply( elem, data ) === false ) {
-			return;
-		}
-
-		// Determine event propagation path in advance, per W3C events spec (#9951)
-		// Bubble up to document, then to window; watch for a global ownerDocument var (#9724)
-		eventPath = [[ elem, special.bindType || type ]];
-		if ( !onlyHandlers && !special.noBubble && !jQuery.isWindow( elem ) ) {
-
-			bubbleType = special.delegateType || type;
-			cur = rfocusMorph.test( bubbleType + type ) ? elem : elem.parentNode;
-			for ( old = elem; cur; cur = cur.parentNode ) {
-				eventPath.push([ cur, bubbleType ]);
-				old = cur;
-			}
-
-			// Only add window if we got to document (e.g., not plain obj or detached DOM)
-			if ( old === (elem.ownerDocument || document) ) {
-				eventPath.push([ old.defaultView || old.parentWindow || window, bubbleType ]);
-			}
-		}
-
-		// Fire handlers on the event path
-		for ( i = 0; i < eventPath.length && !event.isPropagationStopped(); i++ ) {
-
-			cur = eventPath[i][0];
-			event.type = eventPath[i][1];
-
-			handle = ( jQuery._data( cur, "events" ) || {} )[ event.type ] && jQuery._data( cur, "handle" );
-			if ( handle ) {
-				handle.apply( cur, data );
-			}
-			// Note that this is a bare JS function and not a jQuery handler
-			handle = ontype && cur[ ontype ];
-			if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
-				event.preventDefault();
-			}
-		}
-		event.type = type;
-
-		// If nobody prevented the default action, do it now
-		if ( !onlyHandlers && !event.isDefaultPrevented() ) {
-
-			if ( (!special._default || special._default.apply( elem.ownerDocument, data ) === false) &&
-				!(type === "click" && jQuery.nodeName( elem, "a" )) && jQuery.acceptData( elem ) ) {
-
-				// Call a native DOM method on the target with the same name name as the event.
-				// Can't use an .isFunction() check here because IE6/7 fails that test.
-				// Don't do default actions on window, that's where global variables be (#6170)
-				// IE<9 dies on focus/blur to hidden element (#1486)
-				if ( ontype && elem[ type ] && ((type !== "focus" && type !== "blur") || event.target.offsetWidth !== 0) && !jQuery.isWindow( elem ) ) {
-
-					// Don't re-trigger an onFOO event when we call its FOO() method
-					old = elem[ ontype ];
-
-					if ( old ) {
-						elem[ ontype ] = null;
-					}
-
-					// Prevent re-triggering of the same event, since we already bubbled it above
-					jQuery.event.triggered = type;
-					elem[ type ]();
-					jQuery.event.triggered = undefined;
-
-					if ( old ) {
-						elem[ ontype ] = old;
-					}
-				}
-			}
-		}
-
-		return event.result;
-	},
-
-	dispatch: function( event ) {
-
-		// Make a writable jQuery.Event from the native event object
-		event = jQuery.event.fix( event || window.event );
-
-		var i, j, cur, ret, selMatch, matched, matches, handleObj, sel, related,
-			handlers = ( (jQuery._data( this, "events" ) || {} )[ event.type ] || []),
-			delegateCount = handlers.delegateCount,
-			args = core_slice.call( arguments ),
-			run_all = !event.exclusive && !event.namespace,
-			special = jQuery.event.special[ event.type ] || {},
-			handlerQueue = [];
-
-		// Use the fix-ed jQuery.Event rather than the (read-only) native event
-		args[0] = event;
-		event.delegateTarget = this;
-
-		// Call the preDispatch hook for the mapped type, and let it bail if desired
-		if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) {
-			return;
-		}
-
-		// Determine handlers that should run if there are delegated events
-		// Avoid non-left-click bubbling in Firefox (#3861)
-		if ( delegateCount && !(event.button && event.type === "click") ) {
-
-			for ( cur = event.target; cur != this; cur = cur.parentNode || this ) {
-
-				// Don't process clicks (ONLY) on disabled elements (#6911, #8165, #11382, #11764)
-				if ( cur.disabled !== true || event.type !== "click" ) {
-					selMatch = {};
-					matches = [];
-					for ( i = 0; i < delegateCount; i++ ) {
-						handleObj = handlers[ i ];
-						sel = handleObj.selector;
-
-						if ( selMatch[ sel ] === undefined ) {
-							selMatch[ sel ] = handleObj.needsContext ?
-								jQuery( sel, this ).index( cur ) >= 0 :
-								jQuery.find( sel, this, null, [ cur ] ).length;
-						}
-						if ( selMatch[ sel ] ) {
-							matches.push( handleObj );
-						}
-					}
-					if ( matches.length ) {
-						handlerQueue.push({ elem: cur, matches: matches });
-					}
-				}
-			}
-		}
-
-		// Add the remaining (directly-bound) handlers
-		if ( handlers.length > delegateCount ) {
-			handlerQueue.push({ elem: this, matches: handlers.slice( delegateCount ) });
-		}
-
-		// Run delegates first; they may want to stop propagation beneath us
-		for ( i = 0; i < handlerQueue.length && !event.isPropagationStopped(); i++ ) {
-			matched = handlerQueue[ i ];
-			event.currentTarget = matched.elem;
-
-			for ( j = 0; j < matched.matches.length && !event.isImmediatePropagationStopped(); j++ ) {
-				handleObj = matched.matches[ j ];
-
-				// Triggered event must either 1) be non-exclusive and have no namespace, or
-				// 2) have namespace(s) a subset or equal to those in the bound event (both can have no namespace).
-				if ( run_all || (!event.namespace && !handleObj.namespace) || event.namespace_re && event.namespace_re.test( handleObj.namespace ) ) {
-
-					event.data = handleObj.data;
-					event.handleObj = handleObj;
-
-					ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
-							.apply( matched.elem, args );
-
-					if ( ret !== undefined ) {
-						event.result = ret;
-						if ( ret === false ) {
-							event.preventDefault();
-							event.stopPropagation();
-						}
-					}
-				}
-			}
-		}
-
-		// Call the postDispatch hook for the mapped type
-		if ( special.postDispatch ) {
-			special.postDispatch.call( this, event );
-		}
-
-		return event.result;
-	},
-
-	// Includes some event props shared by KeyEvent and MouseEvent
-	// *** attrChange attrName relatedNode srcElement  are not normalized, non-W3C, deprecated, will be removed in 1.8 ***
-	props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
-
-	fixHooks: {},
-
-	keyHooks: {
-		props: "char charCode key keyCode".split(" "),
-		filter: function( event, original ) {
-
-			// Add which for key events
-			if ( event.which == null ) {
-				event.which = original.charCode != null ? original.charCode : original.keyCode;
-			}
-
-			return event;
-		}
-	},
-
-	mouseHooks: {
-		props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
-		filter: function( event, original ) {
-			var eventDoc, doc, body,
-				button = original.button,
-				fromElement = original.fromElement;
-
-			// Calculate pageX/Y if missing and clientX/Y available
-			if ( event.pageX == null && original.clientX != null ) {
-				eventDoc = event.target.ownerDocument || document;
-				doc = eventDoc.documentElement;
-				body = eventDoc.body;
-
-				event.pageX = original.clientX + ( doc && doc.scrollLeft || body && body.scrollLeft || 0 ) - ( doc && doc.clientLeft || body && body.clientLeft || 0 );
-				event.pageY = original.clientY + ( doc && doc.scrollTop  || body && body.scrollTop  || 0 ) - ( doc && doc.clientTop  || body && body.clientTop  || 0 );
-			}
-
-			// Add relatedTarget, if necessary
-			if ( !event.relatedTarget && fromElement ) {
-				event.relatedTarget = fromElement === event.target ? original.toElement : fromElement;
-			}
-
-			// Add which for click: 1 === left; 2 === middle; 3 === right
-			// Note: button is not normalized, so don't use it
-			if ( !event.which && button !== undefined ) {
-				event.which = ( button & 1 ? 1 : ( button & 2 ? 3 : ( button & 4 ? 2 : 0 ) ) );
-			}
-
-			return event;
-		}
-	},
-
-	fix: function( event ) {
-		if ( event[ jQuery.expando ] ) {
-			return event;
-		}
-
-		// Create a writable copy of the event object and normalize some properties
-		var i, prop,
-			originalEvent = event,
-			fixHook = jQuery.event.fixHooks[ event.type ] || {},
-			copy = fixHook.props ? this.props.concat( fixHook.props ) : this.props;
-
-		event = jQuery.Event( originalEvent );
-
-		for ( i = copy.length; i; ) {
-			prop = copy[ --i ];
-			event[ prop ] = originalEvent[ prop ];
-		}
-
-		// Fix target property, if necessary (#1925, IE 6/7/8 & Safari2)
-		if ( !event.target ) {
-			event.target = originalEvent.srcElement || document;
-		}
-
-		// Target should not be a text node (#504, Safari)
-		if ( event.target.nodeType === 3 ) {
-			event.target = event.target.parentNode;
-		}
-
-		// For mouse/key events, metaKey==false if it's undefined (#3368, #11328; IE6/7/8)
-		event.metaKey = !!event.metaKey;
-
-		return fixHook.filter? fixHook.filter( event, originalEvent ) : event;
-	},
-
-	special: {
-		load: {
-			// Prevent triggered image.load events from bubbling to window.load
-			noBubble: true
-		},
-
-		focus: {
-			delegateType: "focusin"
-		},
-		blur: {
-			delegateType: "focusout"
-		},
-
-		beforeunload: {
-			setup: function( data, namespaces, eventHandle ) {
-				// We only want to do this special case on windows
-				if ( jQuery.isWindow( this ) ) {
-					this.onbeforeunload = eventHandle;
-				}
-			},
-
-			teardown: function( namespaces, eventHandle ) {
-				if ( this.onbeforeunload === eventHandle ) {
-					this.onbeforeunload = null;
-				}
-			}
-		}
-	},
-
-	simulate: function( type, elem, event, bubble ) {
-		// Piggyback on a donor event to simulate a different one.
-		// Fake originalEvent to avoid donor's stopPropagation, but if the
-		// simulated event prevents default then we do the same on the donor.
-		var e = jQuery.extend(
-			new jQuery.Event(),
-			event,
-			{ type: type,
-				isSimulated: true,
-				originalEvent: {}
-			}
-		);
-		if ( bubble ) {
-			jQuery.event.trigger( e, null, elem );
-		} else {
-			jQuery.event.dispatch.call( elem, e );
-		}
-		if ( e.isDefaultPrevented() ) {
-			event.preventDefault();
-		}
-	}
-};
-
-// Some plugins are using, but it's undocumented/deprecated and will be removed.
-// The 1.7 special event interface should provide all the hooks needed now.
-jQuery.event.handle = jQuery.event.dispatch;
-
-jQuery.removeEvent = document.removeEventListener ?
-	function( elem, type, handle ) {
-		if ( elem.removeEventListener ) {
-			elem.removeEventListener( type, handle, false );
-		}
-	} :
-	function( elem, type, handle ) {
-		var name = "on" + type;
-
-		if ( elem.detachEvent ) {
-
-			// #8545, #7054, preventing memory leaks for custom events in IE6-8
-			// detachEvent needed property on element, by name of that event, to properly expose it to GC
-			if ( typeof elem[ name ] === "undefined" ) {
-				elem[ name ] = null;
-			}
-
-			elem.detachEvent( name, handle );
-		}
-	};
-
-jQuery.Event = function( src, props ) {
-	// Allow instantiation without the 'new' keyword
-	if ( !(this instanceof jQuery.Event) ) {
-		return new jQuery.Event( src, props );
-	}
-
-	// Event object
-	if ( src && src.type ) {
-		this.originalEvent = src;
-		this.type = src.type;
-
-		// Events bubbling up the document may have been marked as prevented
-		// by a handler lower down the tree; reflect the correct value.
-		this.isDefaultPrevented = ( src.defaultPrevented || src.returnValue === false ||
-			src.getPreventDefault && src.getPreventDefault() ) ? returnTrue : returnFalse;
-
-	// Event type
-	} else {
-		this.type = src;
-	}
-
-	// Put explicitly provided properties onto the event object
-	if ( props ) {
-		jQuery.extend( this, props );
-	}
-
-	// Create a timestamp if incoming event doesn't have one
-	this.timeStamp = src && src.timeStamp || jQuery.now();
-
-	// Mark it as fixed
-	this[ jQuery.expando ] = true;
-};
-
-function returnFalse() {
-	return false;
-}
-function returnTrue() {
-	return true;
-}
-
-// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
-// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
-jQuery.Event.prototype = {
-	preventDefault: function() {
-		this.isDefaultPrevented = returnTrue;
-
-		var e = this.originalEvent;
-		if ( !e ) {
-			return;
-		}
-
-		// if preventDefault exists run it on the original event
-		if ( e.preventDefault ) {
-			e.preventDefault();
-
-		// otherwise set the returnValue property of the original event to false (IE)
-		} else {
-			e.returnValue = false;
-		}
-	},
-	stopPropagation: function() {
-		this.isPropagationStopped = returnTrue;
-
-		var e = this.originalEvent;
-		if ( !e ) {
-			return;
-		}
-		// if stopPropagation exists run it on the original event
-		if ( e.stopPropagation ) {
-			e.stopPropagation();
-		}
-		// otherwise set the cancelBubble property of the original event to true (IE)
-		e.cancelBubble = true;
-	},
-	stopImmediatePropagation: function() {
-		this.isImmediatePropagationStopped = returnTrue;
-		this.stopPropagation();
-	},
-	isDefaultPrevented: returnFalse,
-	isPropagationStopped: returnFalse,
-	isImmediatePropagationStopped: returnFalse
-};
-
-// Create mouseenter/leave events using mouseover/out and event-time checks
-jQuery.each({
-	mouseenter: "mouseover",
-	mouseleave: "mouseout"
-}, function( orig, fix ) {
-	jQuery.event.special[ orig ] = {
-		delegateType: fix,
-		bindType: fix,
-
-		handle: function( event ) {
-			var ret,
-				target = this,
-				related = event.relatedTarget,
-				handleObj = event.handleObj,
-				selector = handleObj.selector;
-
-			// For mousenter/leave call the handler if related is outside the target.
-			// NB: No relatedTarget if the mouse left/entered the browser window
-			if ( !related || (related !== target && !jQuery.contains( target, related )) ) {
-				event.type = handleObj.origType;
-				ret = handleObj.handler.apply( this, arguments );
-				event.type = fix;
-			}
-			return ret;
-		}
-	};
-});
-
-// IE submit delegation
-if ( !jQuery.support.submitBubbles ) {
-
-	jQuery.event.special.submit = {
-		setup: function() {
-			// Only need this for delegated form submit events
-			if ( jQuery.nodeName( this, "form" ) ) {
-				return false;
-			}
-
-			// Lazy-add a submit handler when a descendant form may potentially be submitted
-			jQuery.event.add( this, "click._submit keypress._submit", function( e ) {
-				// Node name check avoids a VML-related crash in IE (#9807)
-				var elem = e.target,
-					form = jQuery.nodeName( elem, "input" ) || jQuery.nodeName( elem, "button" ) ? elem.form : undefined;
-				if ( form && !jQuery._data( form, "_submit_attached" ) ) {
-					jQuery.event.add( form, "submit._submit", function( event ) {
-						event._submit_bubble = true;
-					});
-					jQuery._data( form, "_submit_attached", true );
-				}
-			});
-			// return undefined since we don't need an event listener
-		},
-
-		postDispatch: function( event ) {
-			// If form was submitted by the user, bubble the event up the tree
-			if ( event._submit_bubble ) {
-				delete event._submit_bubble;
-				if ( this.parentNode && !event.isTrigger ) {
-					jQuery.event.simulate( "submit", this.parentNode, event, true );
-				}
-			}
-		},
-
-		teardown: function() {
-			// Only need this for delegated form submit events
-			if ( jQuery.nodeName( this, "form" ) ) {
-				return false;
-			}
-
-			// Remove delegated handlers; cleanData eventually reaps submit handlers attached above
-			jQuery.event.remove( this, "._submit" );
-		}
-	};
-}
-
-// IE change delegation and checkbox/radio fix
-if ( !jQuery.support.changeBubbles ) {
-
-	jQuery.event.special.change = {
-
-		setup: function() {
-
-			if ( rformElems.test( this.nodeName ) ) {
-				// IE doesn't fire change on a check/radio until blur; trigger it on click
-				// after a propertychange. Eat the blur-change in special.change.handle.
-				// This still fires onchange a second time for check/radio after blur.
-				if ( this.type === "checkbox" || this.type === "radio" ) {
-					jQuery.event.add( this, "propertychange._change", function( event ) {
-						if ( event.originalEvent.propertyName === "checked" ) {
-							this._just_changed = true;
-						}
-					});
-					jQuery.event.add( this, "click._change", function( event ) {
-						if ( this._just_changed && !event.isTrigger ) {
-							this._just_changed = false;
-						}
-						// Allow triggered, simulated change events (#11500)
-						jQuery.event.simulate( "change", this, event, true );
-					});
-				}
-				return false;
-			}
-			// Delegated event; lazy-add a change handler on descendant inputs
-			jQuery.event.add( this, "beforeactivate._change", function( e ) {
-				var elem = e.target;
-
-				if ( rformElems.test( elem.nodeName ) && !jQuery._data( elem, "_change_attached" ) ) {
-					jQuery.event.add( elem, "change._change", function( event ) {
-						if ( this.parentNode && !event.isSimulated && !event.isTrigger ) {
-							jQuery.event.simulate( "change", this.parentNode, event, true );
-						}
-					});
-					jQuery._data( elem, "_change_attached", true );
-				}
-			});
-		},
-
-		handle: function( event ) {
-			var elem = event.target;
-
-			// Swallow native change events from checkbox/radio, we already triggered them above
-			if ( this !== elem || event.isSimulated || event.isTrigger || (elem.type !== "radio" && elem.type !== "checkbox") ) {
-				return event.handleObj.handler.apply( this, arguments );
-			}
-		},
-
-		teardown: function() {
-			jQuery.event.remove( this, "._change" );
-
-			return !rformElems.test( this.nodeName );
-		}
-	};
-}
-
-// Create "bubbling" focus and blur events
-if ( !jQuery.support.focusinBubbles ) {
-	jQuery.each({ focus: "focusin", blur: "focusout" }, function( orig, fix ) {
-
-		// Attach a single capturing handler while someone wants focusin/focusout
-		var attaches = 0,
-			handler = function( event ) {
-				jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ), true );
-			};
-
-		jQuery.event.special[ fix ] = {
-			setup: function() {
-				if ( attaches++ === 0 ) {
-					document.addEventListener( orig, handler, true );
-				}
-			},
-			teardown: function() {
-				if ( --attaches === 0 ) {
-					document.removeEventListener( orig, handler, true );
-				}
-			}
-		};
-	});
-}
-
-jQuery.fn.extend({
-
-	on: function( types, selector, data, fn, /*INTERNAL*/ one ) {
-		var origFn, type;
-
-		// Types can be a map of types/handlers
-		if ( typeof types === "object" ) {
-			// ( types-Object, selector, data )
-			if ( typeof selector !== "string" ) { // && selector != null
-				// ( types-Object, data )
-				data = data || selector;
-				selector = undefined;
-			}
-			for ( type in types ) {
-				this.on( type, selector, data, types[ type ], one );
-			}
-			return this;
-		}
-
-		if ( data == null && fn == null ) {
-			// ( types, fn )
-			fn = selector;
-			data = selector = undefined;
-		} else if ( fn == null ) {
-			if ( typeof selector === "string" ) {
-				// ( types, selector, fn )
-				fn = data;
-				data = undefined;
-			} else {
-				// ( types, data, fn )
-				fn = data;
-				data = selector;
-				selector = undefined;
-			}
-		}
-		if ( fn === false ) {
-			fn = returnFalse;
-		} else if ( !fn ) {
-			return this;
-		}
-
-		if ( one === 1 ) {
-			origFn = fn;
-			fn = function( event ) {
-				// Can use an empty set, since event contains the info
-				jQuery().off( event );
-				return origFn.apply( this, arguments );
-			};
-			// Use same guid so caller can remove using origFn
-			fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ );
-		}
-		return this.each( function() {
-			jQuery.event.add( this, types, fn, data, selector );
-		});
-	},
-	one: function( types, selector, data, fn ) {
-		return this.on( types, selector, data, fn, 1 );
-	},
-	off: function( types, selector, fn ) {
-		var handleObj, type;
-		if ( types && types.preventDefault && types.handleObj ) {
-			// ( event )  dispatched jQuery.Event
-			handleObj = types.handleObj;
-			jQuery( types.delegateTarget ).off(
-				handleObj.namespace ? handleObj.origType + "." + handleObj.namespace : handleObj.origType,
-				handleObj.selector,
-				handleObj.handler
-			);
-			return this;
-		}
-		if ( typeof types === "object" ) {
-			// ( types-object [, selector] )
-			for ( type in types ) {
-				this.off( type, selector, types[ type ] );
-			}
-			return this;
-		}
-		if ( selector === false || typeof selector === "function" ) {
-			// ( types [, fn] )
-			fn = selector;
-			selector = undefined;
-		}
-		if ( fn === false ) {
-			fn = returnFalse;
-		}
-		return this.each(function() {
-			jQuery.event.remove( this, types, fn, selector );
-		});
-	},
-
-	bind: function( types, data, fn ) {
-		return this.on( types, null, data, fn );
-	},
-	unbind: function( types, fn ) {
-		return this.off( types, null, fn );
-	},
-
-	live: function( types, data, fn ) {
-		jQuery( this.context ).on( types, this.selector, data, fn );
-		return this;
-	},
-	die: function( types, fn ) {
-		jQuery( this.context ).off( types, this.selector || "**", fn );
-		return this;
-	},
-
-	delegate: function( selector, types, data, fn ) {
-		return this.on( types, selector, data, fn );
-	},
-	undelegate: function( selector, types, fn ) {
-		// ( namespace ) or ( selector, types [, fn] )
-		return arguments.length === 1 ? this.off( selector, "**" ) : this.off( types, selector || "**", fn );
-	},
-
-	trigger: function( type, data ) {
-		return this.each(function() {
-			jQuery.event.trigger( type, data, this );
-		});
-	},
-	triggerHandler: function( type, data ) {
-		if ( this[0] ) {
-			return jQuery.event.trigger( type, data, this[0], true );
-		}
-	},
-
-	toggle: function( fn ) {
-		// Save reference to arguments for access in closure
-		var args = arguments,
-			guid = fn.guid || jQuery.guid++,
-			i = 0,
-			toggler = function( event ) {
-				// Figure out which function to execute
-				var lastToggle = ( jQuery._data( this, "lastToggle" + fn.guid ) || 0 ) % i;
-				jQuery._data( this, "lastToggle" + fn.guid, lastToggle + 1 );
-
-				// Make sure that clicks stop
-				event.preventDefault();
-
-				// and execute the function
-				return args[ lastToggle ].apply( this, arguments ) || false;
-			};
-
-		// link all the functions, so any of them can unbind this click handler
-		toggler.guid = guid;
-		while ( i < args.length ) {
-			args[ i++ ].guid = guid;
-		}
-
-		return this.click( toggler );
-	},
-
-	hover: function( fnOver, fnOut ) {
-		return this.mouseenter( fnOver ).mouseleave( fnOut || fnOver );
-	}
-});
-
-jQuery.each( ("blur focus focusin focusout load resize scroll unload click dblclick " +
-	"mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave " +
-	"change select submit keydown keypress keyup error contextmenu").split(" "), function( i, name ) {
-
-	// Handle event binding
-	jQuery.fn[ name ] = function( data, fn ) {
-		if ( fn == null ) {
-			fn = data;
-			data = null;
-		}
-
-		return arguments.length > 0 ?
-			this.on( name, null, data, fn ) :
-			this.trigger( name );
-	};
-
-	if ( rkeyEvent.test( name ) ) {
-		jQuery.event.fixHooks[ name ] = jQuery.event.keyHooks;
-	}
-
-	if ( rmouseEvent.test( name ) ) {
-		jQuery.event.fixHooks[ name ] = jQuery.event.mouseHooks;
-	}
-});
-/*!
- * Sizzle CSS Selector Engine
- * Copyright 2012 jQuery Foundation and other contributors
- * Released under the MIT license
- * http://sizzlejs.com/
- */
-(function( window, undefined ) {
-
-var cachedruns,
-	assertGetIdNotName,
-	Expr,
-	getText,
-	isXML,
-	contains,
-	compile,
-	sortOrder,
-	hasDuplicate,
-	outermostContext,
-
-	baseHasDuplicate = true,
-	strundefined = "undefined",
-
-	expando = ( "sizcache" + Math.random() ).replace( ".", "" ),
-
-	Token = String,
-	document = window.document,
-	docElem = document.documentElement,
-	dirruns = 0,
-	done = 0,
-	pop = [].pop,
-	push = [].push,
-	slice = [].slice,
-	// Use a stripped-down indexOf if a native one is unavailable
-	indexOf = [].indexOf || function( elem ) {
-		var i = 0,
-			len = this.length;
-		for ( ; i < len; i++ ) {
-			if ( this[i] === elem ) {
-				return i;
-			}
-		}
-		return -1;
-	},
-
-	// Augment a function for special use by Sizzle
-	markFunction = function( fn, value ) {
-		fn[ expando ] = value == null || value;
-		return fn;
-	},
-
-	createCache = function() {
-		var cache = {},
-			keys = [];
-
-		return markFunction(function( key, value ) {
-			// Only keep the most recent entries
-			if ( keys.push( key ) > Expr.cacheLength ) {
-				delete cache[ keys.shift() ];
-			}
-
-			// Retrieve with (key + " ") to avoid collision with native Object.prototype properties (see Issue #157)
-			return (cache[ key + " " ] = value);
-		}, cache );
-	},
-
-	classCache = createCache(),
-	tokenCache = createCache(),
-	compilerCache = createCache(),
-
-	// Regex
-
-	// Whitespace characters http://www.w3.org/TR/css3-selectors/#whitespace
-	whitespace = "[\\x20\\t\\r\\n\\f]",
-	// http://www.w3.org/TR/css3-syntax/#characters
-	characterEncoding = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",
-
-	// Loosely modeled on CSS identifier characters
-	// An unquoted value should be a CSS identifier (http://www.w3.org/TR/css3-selectors/#attribute-selectors)
-	// Proper syntax: http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
-	identifier = characterEncoding.replace( "w", "w#" ),
-
-	// Acceptable operators http://www.w3.org/TR/selectors/#attribute-selectors
-	operators = "([*^$|!~]?=)",
-	attributes = "\\[" + whitespace + "*(" + characterEncoding + ")" + whitespace +
-		"*(?:" + operators + whitespace + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + identifier + ")|)|)" + whitespace + "*\\]",
-
-	// Prefer arguments not in parens/brackets,
-	//   then attribute selectors and non-pseudos (denoted by :),
-	//   then anything else
-	// These preferences are here to reduce the number of selectors
-	//   needing tokenize in the PSEUDO preFilter
-	pseudos = ":(" + characterEncoding + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + attributes + ")|[^:]|\\\\.)*|.*))\\)|)",
-
-	// For matchExpr.POS and matchExpr.needsContext
-	pos = ":(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace +
-		"*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)",
-
-	// Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
-	rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
-
-	rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
-	rcombinators = new RegExp( "^" + whitespace + "*([\\x20\\t\\r\\n\\f>+~])" + whitespace + "*" ),
-	rpseudo = new RegExp( pseudos ),
-
-	// Easily-parseable/retrievable ID or TAG or CLASS selectors
-	rquickExpr = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,
-
-	rnot = /^:not/,
-	rsibling = /[\x20\t\r\n\f]*[+~]/,
-	rendsWithNot = /:not\($/,
-
-	rheader = /h\d/i,
-	rinputs = /input|select|textarea|button/i,
-
-	rbackslash = /\\(?!\\)/g,
-
-	matchExpr = {
-		"ID": new RegExp( "^#(" + characterEncoding + ")" ),
-		"CLASS": new RegExp( "^\\.(" + characterEncoding + ")" ),
-		"NAME": new RegExp( "^\\[name=['\"]?(" + characterEncoding + ")['\"]?\\]" ),
-		"TAG": new RegExp( "^(" + characterEncoding.replace( "w", "w*" ) + ")" ),
-		"ATTR": new RegExp( "^" + attributes ),
-		"PSEUDO": new RegExp( "^" + pseudos ),
-		"POS": new RegExp( pos, "i" ),
-		"CHILD": new RegExp( "^:(only|nth|first|last)-child(?:\\(" + whitespace +
-			"*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
-			"*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
-		// For use in libraries implementing .is()
-		"needsContext": new RegExp( "^" + whitespace + "*[>+~]|" + pos, "i" )
-	},
-
-	// Support
-
-	// Used for testing something on an element
-	assert = function( fn ) {
-		var div = document.createElement("div");
-
-		try {
-			return fn( div );
-		} catch (e) {
-			return false;
-		} finally {
-			// release memory in IE
-			div = null;
-		}
-	},
-
-	// Check if getElementsByTagName("*") returns only elements
-	assertTagNameNoComments = assert(function( div ) {
-		div.appendChild( document.createComment("") );
-		return !div.getElementsByTagName("*").length;
-	}),
-
-	// Check if getAttribute returns normalized href attributes
-	assertHrefNotNormalized = assert(function( div ) {
-		div.innerHTML = "<a href='#'></a>";
-		return div.firstChild && typeof div.firstChild.getAttribute !== strundefined &&
-			div.firstChild.getAttribute("href") === "#";
-	}),
-
-	// Check if attributes should be retrieved by attribute nodes
-	assertAttributes = assert(function( div ) {
-		div.innerHTML = "<select></select>";
-		var type = typeof div.lastChild.getAttribute("multiple");
-		// IE8 returns a string for some attributes even when not present
-		return type !== "boolean" && type !== "string";
-	}),
-
-	// Check if getElementsByClassName can be trusted
-	assertUsableClassName = assert(function( div ) {
-		// Opera can't find a second classname (in 9.6)
-		div.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>";
-		if ( !div.getElementsByClassName || !div.getElementsByClassName("e").length ) {
-			return false;
-		}
-
-		// Safari 3.2 caches class attributes and doesn't catch changes
-		div.lastChild.className = "e";
-		return div.getElementsByClassName("e").length === 2;
-	}),
-
-	// Check if getElementById returns elements by name
-	// Check if getElementsByName privileges form controls or returns elements by ID
-	assertUsableName = assert(function( div ) {
-		// Inject content
-		div.id = expando + 0;
-		div.innerHTML = "<a name='" + expando + "'></a><div name='" + expando + "'></div>";
-		docElem.insertBefore( div, docElem.firstChild );
-
-		// Test
-		var pass = document.getElementsByName &&
-			// buggy browsers will return fewer than the correct 2
-			document.getElementsByName( expando ).length === 2 +
-			// buggy browsers will return more than the correct 0
-			document.getElementsByName( expando + 0 ).length;
-		assertGetIdNotName = !document.getElementById( expando );
-
-		// Cleanup
-		docElem.removeChild( div );
-
-		return pass;
-	});
-
-// If slice is not available, provide a backup
-try {
-	slice.call( docElem.childNodes, 0 )[0].nodeType;
-} catch ( e ) {
-	slice = function( i ) {
-		var elem,
-			results = [];
-		for ( ; (elem = this[i]); i++ ) {
-			results.push( elem );
-		}
-		return results;
-	};
-}
-
-function Sizzle( selector, context, results, seed ) {
-	results = results || [];
-	context = context || document;
-	var match, elem, xml, m,
-		nodeType = context.nodeType;
-
-	if ( !selector || typeof selector !== "string" ) {
-		return results;
-	}
-
-	if ( nodeType !== 1 && nodeType !== 9 ) {
-		return [];
-	}
-
-	xml = isXML( context );
-
-	if ( !xml && !seed ) {
-		if ( (match = rquickExpr.exec( selector )) ) {
-			// Speed-up: Sizzle("#ID")
-			if ( (m = match[1]) ) {
-				if ( nodeType === 9 ) {
-					elem = context.getElementById( m );
-					// Check parentNode to catch when Blackberry 4.6 returns
-					// nodes that are no longer in the document #6963
-					if ( elem && elem.parentNode ) {
-						// Handle the case where IE, Opera, and Webkit return items
-						// by name instead of ID
-						if ( elem.id === m ) {
-							results.push( elem );
-							return results;
-						}
-					} else {
-						return results;
-					}
-				} else {
-					// Context is not a document
-					if ( context.ownerDocument && (elem = context.ownerDocument.getElementById( m )) &&
-						contains( context, elem ) && elem.id === m ) {
-						results.push( elem );
-						return results;
-					}
-				}
-
-			// Speed-up: Sizzle("TAG")
-			} else if ( match[2] ) {
-				push.apply( results, slice.call(context.getElementsByTagName( selector ), 0) );
-				return results;
-
-			// Speed-up: Sizzle(".CLASS")
-			} else if ( (m = match[3]) && assertUsableClassName && context.getElementsByClassName ) {
-				push.apply( results, slice.call(context.getElementsByClassName( m ), 0) );
-				return results;
-			}
-		}
-	}
-
-	// All others
-	return select( selector.replace( rtrim, "$1" ), context, results, seed, xml );
-}
-
-Sizzle.matches = function( expr, elements ) {
-	return Sizzle( expr, null, null, elements );
-};
-
-Sizzle.matchesSelector = function( elem, expr ) {
-	return Sizzle( expr, null, null, [ elem ] ).length > 0;
-};
-
-// Returns a function to use in pseudos for input types
-function createInputPseudo( type ) {
-	return function( elem ) {
-		var name = elem.nodeName.toLowerCase();
-		return name === "input" && elem.type === type;
-	};
-}
-
-// Returns a function to use in pseudos for buttons
-function createButtonPseudo( type ) {
-	return function( elem ) {
-		var name = elem.nodeName.toLowerCase();
-		return (name === "input" || name === "button") && elem.type === type;
-	};
-}
-
-// Returns a function to use in pseudos for positionals
-function createPositionalPseudo( fn ) {
-	return markFunction(function( argument ) {
-		argument = +argument;
-		return markFunction(function( seed, matches ) {
-			var j,
-				matchIndexes = fn( [], seed.length, argument ),
-				i = matchIndexes.length;
-
-			// Match elements found at the specified indexes
-			while ( i-- ) {
-				if ( seed[ (j = matchIndexes[i]) ] ) {
-					seed[j] = !(matches[j] = seed[j]);
-				}
-			}
-		});
-	});
-}
-
-/**
- * Utility function for retrieving the text value of an array of DOM nodes
- * @param {Array|Element} elem
- */
-getText = Sizzle.getText = function( elem ) {
-	var node,
-		ret = "",
-		i = 0,
-		nodeType = elem.nodeType;
-
-	if ( nodeType ) {
-		if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) {
-			// Use textContent for elements
-			// innerText usage removed for consistency of new lines (see #11153)
-			if ( typeof elem.textContent === "string" ) {
-				return elem.textContent;
-			} else {
-				// Traverse its children
-				for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) {
-					ret += getText( elem );
-				}
-			}
-		} else if ( nodeType === 3 || nodeType === 4 ) {
-			return elem.nodeValue;
-		}
-		// Do not include comment or processing instruction nodes
-	} else {
-
-		// If no nodeType, this is expected to be an array
-		for ( ; (node = elem[i]); i++ ) {
-			// Do not traverse comment nodes
-			ret += getText( node );
-		}
-	}
-	return ret;
-};
-
-isXML = Sizzle.isXML = function( elem ) {
-	// documentElement is verified for cases where it doesn't yet exist
-	// (such as loading iframes in IE - #4833)
-	var documentElement = elem && (elem.ownerDocument || elem).documentElement;
-	return documentElement ? documentElement.nodeName !== "HTML" : false;
-};
-
-// Element contains another
-contains = Sizzle.contains = docElem.contains ?
-	function( a, b ) {
-		var adown = a.nodeType === 9 ? a.documentElement : a,
-			bup = b && b.parentNode;
-		return a === bup || !!( bup && bup.nodeType === 1 && adown.contains && adown.contains(bup) );
-	} :
-	docElem.compareDocumentPosition ?
-	function( a, b ) {
-		return b && !!( a.compareDocumentPosition( b ) & 16 );
-	} :
-	function( a, b ) {
-		while ( (b = b.parentNode) ) {
-			if ( b === a ) {
-				return true;
-			}
-		}
-		return false;
-	};
-
-Sizzle.attr = function( elem, name ) {
-	var val,
-		xml = isXML( elem );
-
-	if ( !xml ) {
-		name = name.toLowerCase();
-	}
-	if ( (val = Expr.attrHandle[ name ]) ) {
-		return val( elem );
-	}
-	if ( xml || assertAttributes ) {
-		return elem.getAttribute( name );
-	}
-	val = elem.getAttributeNode( name );
-	return val ?
-		typeof elem[ name ] === "boolean" ?
-			elem[ name ] ? name : null :
-			val.specified ? val.value : null :
-		null;
-};
-
-Expr = Sizzle.selectors = {
-
-	// Can be adjusted by the user
-	cacheLength: 50,
-
-	createPseudo: markFunction,
-
-	match: matchExpr,
-
-	// IE6/7 return a modified href
-	attrHandle: assertHrefNotNormalized ?
-		{} :
-		{
-			"href": function( elem ) {
-				return elem.getAttribute( "href", 2 );
-			},
-			"type": function( elem ) {
-				return elem.getAttribute("type");
-			}
-		},
-
-	find: {
-		"ID": assertGetIdNotName ?
-			function( id, context, xml ) {
-				if ( typeof context.getElementById !== strundefined && !xml ) {
-					var m = context.getElementById( id );
-					// Check parentNode to catch when Blackberry 4.6 returns
-					// nodes that are no longer in the document #6963
-					return m && m.parentNode ? [m] : [];
-				}
-			} :
-			function( id, context, xml ) {
-				if ( typeof context.getElementById !== strundefined && !xml ) {
-					var m = context.getElementById( id );
-
-					return m ?
-						m.id === id || typeof m.getAttributeNode !== strundefined && m.getAttributeNode("id").value === id ?
-							[m] :
-							undefined :
-						[];
-				}
-			},
-
-		"TAG": assertTagNameNoComments ?
-			function( tag, context ) {
-				if ( typeof context.getElementsByTagName !== strundefined ) {
-					return context.getElementsByTagName( tag );
-				}
-			} :
-			function( tag, context ) {
-				var results = context.getElementsByTagName( tag );
-
-				// Filter out possible comments
-				if ( tag === "*" ) {
-					var elem,
-						tmp = [],
-						i = 0;
-
-					for ( ; (elem = results[i]); i++ ) {
-						if ( elem.nodeType === 1 ) {
-							tmp.push( elem );
-						}
-					}
-
-					return tmp;
-				}
-				return results;
-			},
-
-		"NAME": assertUsableName && function( tag, context ) {
-			if ( typeof context.getElementsByName !== strundefined ) {
-				return context.getElementsByName( name );
-			}
-		},
-
-		"CLASS": assertUsableClassName && function( className, context, xml ) {
-			if ( typeof context.getElementsByClassName !== strundefined && !xml ) {
-				return context.getElementsByClassName( className );
-			}
-		}
-	},
-
-	relative: {
-		">": { dir: "parentNode", first: true },
-		" ": { dir: "parentNode" },
-		"+": { dir: "previousSibling", first: true },
-		"~": { dir: "previousSibling" }
-	},
-
-	preFilter: {
-		"ATTR": function( match ) {
-			match[1] = match[1].replace( rbackslash, "" );
-
-			// Move the given value to match[3] whether quoted or unquoted
-			match[3] = ( match[4] || match[5] || "" ).replace( rbackslash, "" );
-
-			if ( match[2] === "~=" ) {
-				match[3] = " " + match[3] + " ";
-			}
-
-			return match.slice( 0, 4 );
-		},
-
-		"CHILD": function( match ) {
-			/* matches from matchExpr["CHILD"]
-				1 type (only|nth|...)
-				2 argument (even|odd|\d*|\d*n([+-]\d+)?|...)
-				3 xn-component of xn+y argument ([+-]?\d*n|)
-				4 sign of xn-component
-				5 x of xn-component
-				6 sign of y-component
-				7 y of y-component
-			*/
-			match[1] = match[1].toLowerCase();
-
-			if ( match[1] === "nth" ) {
-				// nth-child requires argument
-				if ( !match[2] ) {
-					Sizzle.error( match[0] );
-				}
-
-				// numeric x and y parameters for Expr.filter.CHILD
-				// remember that false/true cast respectively to 0/1
-				match[3] = +( match[3] ? match[4] + (match[5] || 1) : 2 * ( match[2] === "even" || match[2] === "odd" ) );
-				match[4] = +( ( match[6] + match[7] ) || match[2] === "odd" );
-
-			// other types prohibit arguments
-			} else if ( match[2] ) {
-				Sizzle.error( match[0] );
-			}
-
-			return match;
-		},
-
-		"PSEUDO": function( match ) {
-			var unquoted, excess;
-			if ( matchExpr["CHILD"].test( match[0] ) ) {
-				return null;
-			}
-
-			if ( match[3] ) {
-				match[2] = match[3];
-			} else if ( (unquoted = match[4]) ) {
-				// Only check arguments that contain a pseudo
-				if ( rpseudo.test(unquoted) &&
-					// Get excess from tokenize (recursively)
-					(excess = tokenize( unquoted, true )) &&
-					// advance to the next closing parenthesis
-					(excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length) ) {
-
-					// excess is a negative index
-					unquoted = unquoted.slice( 0, excess );
-					match[0] = match[0].slice( 0, excess );
-				}
-				match[2] = unquoted;
-			}
-
-			// Return only captures needed by the pseudo filter method (type and argument)
-			return match.slice( 0, 3 );
-		}
-	},
-
-	filter: {
-		"ID": assertGetIdNotName ?
-			function( id ) {
-				id = id.replace( rbackslash, "" );
-				return function( elem ) {
-					return elem.getAttribute("id") === id;
-				};
-			} :
-			function( id ) {
-				id = id.replace( rbackslash, "" );
-				return function( elem ) {
-					var node = typeof elem.getAttributeNode !== strundefined && elem.getAttributeNode("id");
-					return node && node.value === id;
-				};
-			},
-
-		"TAG": function( nodeName ) {
-			if ( nodeName === "*" ) {
-				return function() { return true; };
-			}
-			nodeName = nodeName.replace( rbackslash, "" ).toLowerCase();
-
-			return function( elem ) {
-				return elem.nodeName && elem.nodeName.toLowerCase() === nodeName;
-			};
-		},
-
-		"CLASS": function( className ) {
-			var pattern = classCache[ expando ][ className + " " ];
-
-			return pattern ||
-				(pattern = new RegExp( "(^|" + whitespace + ")" + className + "(" + whitespace + "|$)" )) &&
-				classCache( className, function( elem ) {
-					return pattern.test( elem.className || (typeof elem.getAttribute !== strundefined && elem.getAttribute("class")) || "" );
-				});
-		},
-
-		"ATTR": function( name, operator, check ) {
-			return function( elem, context ) {
-				var result = Sizzle.attr( elem, name );
-
-				if ( result == null ) {
-					return operator === "!=";
-				}
-				if ( !operator ) {
-					return true;
-				}
-
-				result += "";
-
-				return operator === "=" ? result === check :
-					operator === "!=" ? result !== check :
-					operator === "^=" ? check && result.indexOf( check ) === 0 :
-					operator === "*=" ? check && result.indexOf( check ) > -1 :
-					operator === "$=" ? check && result.substr( result.length - check.length ) === check :
-					operator === "~=" ? ( " " + result + " " ).indexOf( check ) > -1 :
-					operator === "|=" ? result === check || result.substr( 0, check.length + 1 ) === check + "-" :
-					false;
-			};
-		},
-
-		"CHILD": function( type, argument, first, last ) {
-
-			if ( type === "nth" ) {
-				return function( elem ) {
-					var node, diff,
-						parent = elem.parentNode;
-
-					if ( first === 1 && last === 0 ) {
-						return true;
-					}
-
-					if ( parent ) {
-						diff = 0;
-						for ( node = parent.firstChild; node; node = node.nextSibling ) {
-							if ( node.nodeType === 1 ) {
-								diff++;
-								if ( elem === node ) {
-									break;
-								}
-							}
-						}
-					}
-
-					// Incorporate the offset (or cast to NaN), then check against cycle size
-					diff -= last;
-					return diff === first || ( diff % first === 0 && diff / first >= 0 );
-				};
-			}
-
-			return function( elem ) {
-				var node = elem;
-
-				switch ( type ) {
-					case "only":
-					case "first":
-						while ( (node = node.previousSibling) ) {
-							if ( node.nodeType === 1 ) {
-								return false;
-							}
-						}
-
-						if ( type === "first" ) {
-							return true;
-						}
-
-						node = elem;
-
-						/* falls through */
-					case "last":
-						while ( (node = node.nextSibling) ) {
-							if ( node.nodeType === 1 ) {
-								return false;
-							}
-						}
-
-						return true;
-				}
-			};
-		},
-
-		"PSEUDO": function( pseudo, argument ) {
-			// pseudo-class names are case-insensitive
-			// http://www.w3.org/TR/selectors/#pseudo-classes
-			// Prioritize by case sensitivity in case custom pseudos are added with uppercase letters
-			// Remember that setFilters inherits from pseudos
-			var args,
-				fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] ||
-					Sizzle.error( "unsupported pseudo: " + pseudo );
-
-			// The user may use createPseudo to indicate that
-			// arguments are needed to create the filter function
-			// just as Sizzle does
-			if ( fn[ expando ] ) {
-				return fn( argument );
-			}
-
-			// But maintain support for old signatures
-			if ( fn.length > 1 ) {
-				args = [ pseudo, pseudo, "", argument ];
-				return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ?
-					markFunction(function( seed, matches ) {
-						var idx,
-							matched = fn( seed, argument ),
-							i = matched.length;
-						while ( i-- ) {
-							idx = indexOf.call( seed, matched[i] );
-							seed[ idx ] = !( matches[ idx ] = matched[i] );
-						}
-					}) :
-					function( elem ) {
-						return fn( elem, 0, args );
-					};
-			}
-
-			return fn;
-		}
-	},
-
-	pseudos: {
-		"not": markFunction(function( selector ) {
-			// Trim the selector passed to compile
-			// to avoid treating leading and trailing
-			// spaces as combinators
-			var input = [],
-				results = [],
-				matcher = compile( selector.replace( rtrim, "$1" ) );
-
-			return matcher[ expando ] ?
-				markFunction(function( seed, matches, context, xml ) {
-					var elem,
-						unmatched = matcher( seed, null, xml, [] ),
-						i = seed.length;
-
-					// Match elements unmatched by `matcher`
-					while ( i-- ) {
-						if ( (elem = unmatched[i]) ) {
-							seed[i] = !(matches[i] = elem);
-						}
-					}
-				}) :
-				function( elem, context, xml ) {
-					input[0] = elem;
-					matcher( input, null, xml, results );
-					return !results.pop();
-				};
-		}),
-
-		"has": markFunction(function( selector ) {
-			return function( elem ) {
-				return Sizzle( selector, elem ).length > 0;
-			};
-		}),
-
-		"contains": markFunction(function( text ) {
-			return function( elem ) {
-				return ( elem.textContent || elem.innerText || getText( elem ) ).indexOf( text ) > -1;
-			};
-		}),
-
-		"enabled": function( elem ) {
-			return elem.disabled === false;
-		},
-
-		"disabled": function( elem ) {
-			return elem.disabled === true;
-		},
-
-		"checked": function( elem ) {
-			// In CSS3, :checked should return both checked and selected elements
-			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
-			var nodeName = elem.nodeName.toLowerCase();
-			return (nodeName === "input" && !!elem.checked) || (nodeName === "option" && !!elem.selected);
-		},
-
-		"selected": function( elem ) {
-			// Accessing this property makes selected-by-default
-			// options in Safari work properly
-			if ( elem.parentNode ) {
-				elem.parentNode.selectedIndex;
-			}
-
-			return elem.selected === true;
-		},
-
-		"parent": function( elem ) {
-			return !Expr.pseudos["empty"]( elem );
-		},
-
-		"empty": function( elem ) {
-			// http://www.w3.org/TR/selectors/#empty-pseudo
-			// :empty is only affected by element nodes and content nodes(including text(3), cdata(4)),
-			//   not comment, processing instructions, or others
-			// Thanks to Diego Perini for the nodeName shortcut
-			//   Greater than "@" means alpha characters (specifically not starting with "#" or "?")
-			var nodeType;
-			elem = elem.firstChild;
-			while ( elem ) {
-				if ( elem.nodeName > "@" || (nodeType = elem.nodeType) === 3 || nodeType === 4 ) {
-					return false;
-				}
-				elem = elem.nextSibling;
-			}
-			return true;
-		},
-
-		"header": function( elem ) {
-			return rheader.test( elem.nodeName );
-		},
-
-		"text": function( elem ) {
-			var type, attr;
-			// IE6 and 7 will map elem.type to 'text' for new HTML5 types (search, etc)
-			// use getAttribute instead to test this case
-			return elem.nodeName.toLowerCase() === "input" &&
-				(type = elem.type) === "text" &&
-				( (attr = elem.getAttribute("type")) == null || attr.toLowerCase() === type );
-		},
-
-		// Input types
-		"radio": createInputPseudo("radio"),
-		"checkbox": createInputPseudo("checkbox"),
-		"file": createInputPseudo("file"),
-		"password": createInputPseudo("password"),
-		"image": createInputPseudo("image"),
-
-		"submit": createButtonPseudo("submit"),
-		"reset": createButtonPseudo("reset"),
-
-		"button": function( elem ) {
-			var name = elem.nodeName.toLowerCase();
-			return name === "input" && elem.type === "button" || name === "button";
-		},
-
-		"input": function( elem ) {
-			return rinputs.test( elem.nodeName );
-		},
-
-		"focus": function( elem ) {
-			var doc = elem.ownerDocument;
-			return elem === doc.activeElement && (!doc.hasFocus || doc.hasFocus()) && !!(elem.type || elem.href || ~elem.tabIndex);
-		},
-
-		"active": function( elem ) {
-			return elem === elem.ownerDocument.activeElement;
-		},
-
-		// Positional types
-		"first": createPositionalPseudo(function() {
-			return [ 0 ];
-		}),
-
-		"last": createPositionalPseudo(function( matchIndexes, length ) {
-			return [ length - 1 ];
-		}),
-
-		"eq": createPositionalPseudo(function( matchIndexes, length, argument ) {
-			return [ argument < 0 ? argument + length : argument ];
-		}),
-
-		"even": createPositionalPseudo(function( matchIndexes, length ) {
-			for ( var i = 0; i < length; i += 2 ) {
-				matchIndexes.push( i );
-			}
-			return matchIndexes;
-		}),
-
-		"odd": createPositionalPseudo(function( matchIndexes, length ) {
-			for ( var i = 1; i < length; i += 2 ) {
-				matchIndexes.push( i );
-			}
-			return matchIndexes;
-		}),
-
-		"lt": createPositionalPseudo(function( matchIndexes, length, argument ) {
-			for ( var i = argument < 0 ? argument + length : argument; --i >= 0; ) {
-				matchIndexes.push( i );
-			}
-			return matchIndexes;
-		}),
-
-		"gt": createPositionalPseudo(function( matchIndexes, length, argument ) {
-			for ( var i = argument < 0 ? argument + length : argument; ++i < length; ) {
-				matchIndexes.push( i );
-			}
-			return matchIndexes;
-		})
-	}
-};
-
-function siblingCheck( a, b, ret ) {
-	if ( a === b ) {
-		return ret;
-	}
-
-	var cur = a.nextSibling;
-
-	while ( cur ) {
-		if ( cur === b ) {
-			return -1;
-		}
-
-		cur = cur.nextSibling;
-	}
-
-	return 1;
-}
-
-sortOrder = docElem.compareDocumentPosition ?
-	function( a, b ) {
-		if ( a === b ) {
-			hasDuplicate = true;
-			return 0;
-		}
-
-		return ( !a.compareDocumentPosition || !b.compareDocumentPosition ?
-			a.compareDocumentPosition :
-			a.compareDocumentPosition(b) & 4
-		) ? -1 : 1;
-	} :
-	function( a, b ) {
-		// The nodes are identical, we can exit early
-		if ( a === b ) {
-			hasDuplicate = true;
-			return 0;
-
-		// Fallback to using sourceIndex (in IE) if it's available on both nodes
-		} else if ( a.sourceIndex && b.sourceIndex ) {
-			return a.sourceIndex - b.sourceIndex;
-		}
-
-		var al, bl,
-			ap = [],
-			bp = [],
-			aup = a.parentNode,
-			bup = b.parentNode,
-			cur = aup;
-
-		// If the nodes are siblings (or identical) we can do a quick check
-		if ( aup === bup ) {
-			return siblingCheck( a, b );
-
-		// If no parents were found then the nodes are disconnected
-		} else if ( !aup ) {
-			return -1;
-
-		} else if ( !bup ) {
-			return 1;
-		}
-
-		// Otherwise they're somewhere else in the tree so we need
-		// to build up a full list of the parentNodes for comparison
-		while ( cur ) {
-			ap.unshift( cur );
-			cur = cur.parentNode;
-		}
-
-		cur = bup;
-
-		while ( cur ) {
-			bp.unshift( cur );
-			cur = cur.parentNode;
-		}
-
-		al = ap.length;
-		bl = bp.length;
-
-		// Start walking down the tree looking for a discrepancy
-		for ( var i = 0; i < al && i < bl; i++ ) {
-			if ( ap[i] !== bp[i] ) {
-				return siblingCheck( ap[i], bp[i] );
-			}
-		}
-
-		// We ended someplace up the tree so do a sibling check
-		return i === al ?
-			siblingCheck( a, bp[i], -1 ) :
-			siblingCheck( ap[i], b, 1 );
-	};
-
-// Always assume the presence of duplicates if sort doesn't
-// pass them to our comparison function (as in Google Chrome).
-[0, 0].sort( sortOrder );
-baseHasDuplicate = !hasDuplicate;
-
-// Document sorting and removing duplicates
-Sizzle.uniqueSort = function( results ) {
-	var elem,
-		duplicates = [],
-		i = 1,
-		j = 0;
-
-	hasDuplicate = baseHasDuplicate;
-	results.sort( sortOrder );
-
-	if ( hasDuplicate ) {
-		for ( ; (elem = results[i]); i++ ) {
-			if ( elem === results[ i - 1 ] ) {
-				j = duplicates.push( i );
-			}
-		}
-		while ( j-- ) {
-			results.splice( duplicates[ j ], 1 );
-		}
-	}
-
-	return results;
-};
-
-Sizzle.error = function( msg ) {
-	throw new Error( "Syntax error, unrecognized expression: " + msg );
-};
-
-function tokenize( selector, parseOnly ) {
-	var matched, match, tokens, type,
-		soFar, groups, preFilters,
-		cached = tokenCache[ expando ][ selector + " " ];
-
-	if ( cached ) {
-		return parseOnly ? 0 : cached.slice( 0 );
-	}
-
-	soFar = selector;
-	groups = [];
-	preFilters = Expr.preFilter;
-
-	while ( soFar ) {
-
-		// Comma and first run
-		if ( !matched || (match = rcomma.exec( soFar )) ) {
-			if ( match ) {
-				// Don't consume trailing commas as valid
-				soFar = soFar.slice( match[0].length ) || soFar;
-			}
-			groups.push( tokens = [] );
-		}
-
-		matched = false;
-
-		// Combinators
-		if ( (match = rcombinators.exec( soFar )) ) {
-			tokens.push( matched = new Token( match.shift() ) );
-			soFar = soFar.slice( matched.length );
-
-			// Cast descendant combinators to space
-			matched.type = match[0].replace( rtrim, " " );
-		}
-
-		// Filters
-		for ( type in Expr.filter ) {
-			if ( (match = matchExpr[ type ].exec( soFar )) && (!preFilters[ type ] ||
-				(match = preFilters[ type ]( match ))) ) {
-
-				tokens.push( matched = new Token( match.shift() ) );
-				soFar = soFar.slice( matched.length );
-				matched.type = type;
-				matched.matches = match;
-			}
-		}
-
-		if ( !matched ) {
-			break;
-		}
-	}
-
-	// Return the length of the invalid excess
-	// if we're just parsing
-	// Otherwise, throw an error or return tokens
-	return parseOnly ?
-		soFar.length :
-		soFar ?
-			Sizzle.error( selector ) :
-			// Cache the tokens
-			tokenCache( selector, groups ).slice( 0 );
-}
-
-function addCombinator( matcher, combinator, base ) {
-	var dir = combinator.dir,
-		checkNonElements = base && combinator.dir === "parentNode",
-		doneName = done++;
-
-	return combinator.first ?
-		// Check against closest ancestor/preceding element
-		function( elem, context, xml ) {
-			while ( (elem = elem[ dir ]) ) {
-				if ( checkNonElements || elem.nodeType === 1  ) {
-					return matcher( elem, context, xml );
-				}
-			}
-		} :
-
-		// Check against all ancestor/preceding elements
-		function( elem, context, xml ) {
-			// We can't set arbitrary data on XML nodes, so they don't benefit from dir caching
-			if ( !xml ) {
-				var cache,
-					dirkey = dirruns + " " + doneName + " ",
-					cachedkey = dirkey + cachedruns;
-				while ( (elem = elem[ dir ]) ) {
-					if ( checkNonElements || elem.nodeType === 1 ) {
-						if ( (cache = elem[ expando ]) === cachedkey ) {
-							return elem.sizset;
-						} else if ( typeof cache === "string" && cache.indexOf(dirkey) === 0 ) {
-							if ( elem.sizset ) {
-								return elem;
-							}
-						} else {
-							elem[ expando ] = cachedkey;
-							if ( matcher( elem, context, xml ) ) {
-								elem.sizset = true;
-								return elem;
-							}
-							elem.sizset = false;
-						}
-					}
-				}
-			} else {
-				while ( (elem = elem[ dir ]) ) {
-					if ( checkNonElements || elem.nodeType === 1 ) {
-						if ( matcher( elem, context, xml ) ) {
-							return elem;
-						}
-					}
-				}
-			}
-		};
-}
-
-function elementMatcher( matchers ) {
-	return matchers.length > 1 ?
-		function( elem, context, xml ) {
-			var i = matchers.length;
-			while ( i-- ) {
-				if ( !matchers[i]( elem, context, xml ) ) {
-					return false;
-				}
-			}
-			return true;
-		} :
-		matchers[0];
-}
-
-function condense( unmatched, map, filter, context, xml ) {
-	var elem,
-		newUnmatched = [],
-		i = 0,
-		len = unmatched.length,
-		mapped = map != null;
-
-	for ( ; i < len; i++ ) {
-		if ( (elem = unmatched[i]) ) {
-			if ( !filter || filter( elem, context, xml ) ) {
-				newUnmatched.push( elem );
-				if ( mapped ) {
-					map.push( i );
-				}
-			}
-		}
-	}
-
-	return newUnmatched;
-}
-
-function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) {
-	if ( postFilter && !postFilter[ expando ] ) {
-		postFilter = setMatcher( postFilter );
-	}
-	if ( postFinder && !postFinder[ expando ] ) {
-		postFinder = setMatcher( postFinder, postSelector );
-	}
-	return markFunction(function( seed, results, context, xml ) {
-		var temp, i, elem,
-			preMap = [],
-			postMap = [],
-			preexisting = results.length,
-
-			// Get initial elements from seed or context
-			elems = seed || multipleContexts( selector || "*", context.nodeType ? [ context ] : context, [] ),
-
-			// Prefilter to get matcher input, preserving a map for seed-results synchronization
-			matcherIn = preFilter && ( seed || !selector ) ?
-				condense( elems, preMap, preFilter, context, xml ) :
-				elems,
-
-			matcherOut = matcher ?
-				// If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results,
-				postFinder || ( seed ? preFilter : preexisting || postFilter ) ?
-
-					// ...intermediate processing is necessary
-					[] :
-
-					// ...otherwise use results directly
-					results :
-				matcherIn;
-
-		// Find primary matches
-		if ( matcher ) {
-			matcher( matcherIn, matcherOut, context, xml );
-		}
-
-		// Apply postFilter
-		if ( postFilter ) {
-			temp = condense( matcherOut, postMap );
-			postFilter( temp, [], context, xml );
-
-			// Un-match failing elements by moving them back to matcherIn
-			i = temp.length;
-			while ( i-- ) {
-				if ( (elem = temp[i]) ) {
-					matcherOut[ postMap[i] ] = !(matcherIn[ postMap[i] ] = elem);
-				}
-			}
-		}
-
-		if ( seed ) {
-			if ( postFinder || preFilter ) {
-				if ( postFinder ) {
-					// Get the final matcherOut by condensing this intermediate into postFinder contexts
-					temp = [];
-					i = matcherOut.length;
-					while ( i-- ) {
-						if ( (elem = matcherOut[i]) ) {
-							// Restore matcherIn since elem is not yet a final match
-							temp.push( (matcherIn[i] = elem) );
-						}
-					}
-					postFinder( null, (matcherOut = []), temp, xml );
-				}
-
-				// Move matched elements from seed to results to keep them synchronized
-				i = matcherOut.length;
-				while ( i-- ) {
-					if ( (elem = matcherOut[i]) &&
-						(temp = postFinder ? indexOf.call( seed, elem ) : preMap[i]) > -1 ) {
-
-						seed[temp] = !(results[temp] = elem);
-					}
-				}
-			}
-
-		// Add elements to results, through postFinder if defined
-		} else {
-			matcherOut = condense(
-				matcherOut === results ?
-					matcherOut.splice( preexisting, matcherOut.length ) :
-					matcherOut
-			);
-			if ( postFinder ) {
-				postFinder( null, results, matcherOut, xml );
-			} else {
-				push.apply( results, matcherOut );
-			}
-		}
-	});
-}
-
-function matcherFromTokens( tokens ) {
-	var checkContext, matcher, j,
-		len = tokens.length,
-		leadingRelative = Expr.relative[ tokens[0].type ],
-		implicitRelative = leadingRelative || Expr.relative[" "],
-		i = leadingRelative ? 1 : 0,
-
-		// The foundational matcher ensures that elements are reachable from top-level context(s)
-		matchContext = addCombinator( function( elem ) {
-			return elem === checkContext;
-		}, implicitRelative, true ),
-		matchAnyContext = addCombinator( function( elem ) {
-			return indexOf.call( checkContext, elem ) > -1;
-		}, implicitRelative, true ),
-		matchers = [ function( elem, context, xml ) {
-			return ( !leadingRelative && ( xml || context !== outermostContext ) ) || (
-				(checkContext = context).nodeType ?
-					matchContext( elem, context, xml ) :
-					matchAnyContext( elem, context, xml ) );
-		} ];
-
-	for ( ; i < len; i++ ) {
-		if ( (matcher = Expr.relative[ tokens[i].type ]) ) {
-			matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ];
-		} else {
-			matcher = Expr.filter[ tokens[i].type ].apply( null, tokens[i].matches );
-
-			// Return special upon seeing a positional matcher
-			if ( matcher[ expando ] ) {
-				// Find the next relative operator (if any) for proper handling
-				j = ++i;
-				for ( ; j < len; j++ ) {
-					if ( Expr.relative[ tokens[j].type ] ) {
-						break;
-					}
-				}
-				return setMatcher(
-					i > 1 && elementMatcher( matchers ),
-					i > 1 && tokens.slice( 0, i - 1 ).join("").replace( rtrim, "$1" ),
-					matcher,
-					i < j && matcherFromTokens( tokens.slice( i, j ) ),
-					j < len && matcherFromTokens( (tokens = tokens.slice( j )) ),
-					j < len && tokens.join("")
-				);
-			}
-			matchers.push( matcher );
-		}
-	}
-
-	return elementMatcher( matchers );
-}
-
-function matcherFromGroupMatchers( elementMatchers, setMatchers ) {
-	var bySet = setMatchers.length > 0,
-		byElement = elementMatchers.length > 0,
-		superMatcher = function( seed, context, xml, results, expandContext ) {
-			var elem, j, matcher,
-				setMatched = [],
-				matchedCount = 0,
-				i = "0",
-				unmatched = seed && [],
-				outermost = expandContext != null,
-				contextBackup = outermostContext,
-				// We must always have either seed elements or context
-				elems = seed || byElement && Expr.find["TAG"]( "*", expandContext && context.parentNode || context ),
-				// Nested matchers should use non-integer dirruns
-				dirrunsUnique = (dirruns += contextBackup == null ? 1 : Math.E);
-
-			if ( outermost ) {
-				outermostContext = context !== document && context;
-				cachedruns = superMatcher.el;
-			}
-
-			// Add elements passing elementMatchers directly to results
-			for ( ; (elem = elems[i]) != null; i++ ) {
-				if ( byElement && elem ) {
-					for ( j = 0; (matcher = elementMatchers[j]); j++ ) {
-						if ( matcher( elem, context, xml ) ) {
-							results.push( elem );
-							break;
-						}
-					}
-					if ( outermost ) {
-						dirruns = dirrunsUnique;
-						cachedruns = ++superMatcher.el;
-					}
-				}
-
-				// Track unmatched elements for set filters
-				if ( bySet ) {
-					// They will have gone through all possible matchers
-					if ( (elem = !matcher && elem) ) {
-						matchedCount--;
-					}
-
-					// Lengthen the array for every element, matched or not
-					if ( seed ) {
-						unmatched.push( elem );
-					}
-				}
-			}
-
-			// Apply set filters to unmatched elements
-			matchedCount += i;
-			if ( bySet && i !== matchedCount ) {
-				for ( j = 0; (matcher = setMatchers[j]); j++ ) {
-					matcher( unmatched, setMatched, context, xml );
-				}
-
-				if ( seed ) {
-					// Reintegrate element matches to eliminate the need for sorting
-					if ( matchedCount > 0 ) {
-						while ( i-- ) {
-							if ( !(unmatched[i] || setMatched[i]) ) {
-								setMatched[i] = pop.call( results );
-							}
-						}
-					}
-
-					// Discard index placeholder values to get only actual matches
-					setMatched = condense( setMatched );
-				}
-
-				// Add matches to results
-				push.apply( results, setMatched );
-
-				// Seedless set matches succeeding multiple successful matchers stipulate sorting
-				if ( outermost && !seed && setMatched.length > 0 &&
-					( matchedCount + setMatchers.length ) > 1 ) {
-
-					Sizzle.uniqueSort( results );
-				}
-			}
-
-			// Override manipulation of globals by nested matchers
-			if ( outermost ) {
-				dirruns = dirrunsUnique;
-				outermostContext = contextBackup;
-			}
-
-			return unmatched;
-		};
-
-	superMatcher.el = 0;
-	return bySet ?
-		markFunction( superMatcher ) :
-		superMatcher;
-}
-
-compile = Sizzle.compile = function( selector, group /* Internal Use Only */ ) {
-	var i,
-		setMatchers = [],
-		elementMatchers = [],
-		cached = compilerCache[ expando ][ selector + " " ];
-
-	if ( !cached ) {
-		// Generate a function of recursive functions that can be used to check each element
-		if ( !group ) {
-			group = tokenize( selector );
-		}
-		i = group.length;
-		while ( i-- ) {
-			cached = matcherFromTokens( group[i] );
-			if ( cached[ expando ] ) {
-				setMatchers.push( cached );
-			} else {
-				elementMatchers.push( cached );
-			}
-		}
-
-		// Cache the compiled function
-		cached = compilerCache( selector, matcherFromGroupMatchers( elementMatchers, setMatchers ) );
-	}
-	return cached;
-};
-
-function multipleContexts( selector, contexts, results ) {
-	var i = 0,
-		len = contexts.length;
-	for ( ; i < len; i++ ) {
-		Sizzle( selector, contexts[i], results );
-	}
-	return results;
-}
-
-function select( selector, context, results, seed, xml ) {
-	var i, tokens, token, type, find,
-		match = tokenize( selector ),
-		j = match.length;
-
-	if ( !seed ) {
-		// Try to minimize operations if there is only one group
-		if ( match.length === 1 ) {
-
-			// Take a shortcut and set the context if the root selector is an ID
-			tokens = match[0] = match[0].slice( 0 );
-			if ( tokens.length > 2 && (token = tokens[0]).type === "ID" &&
-					context.nodeType === 9 && !xml &&
-					Expr.relative[ tokens[1].type ] ) {
-
-				context = Expr.find["ID"]( token.matches[0].replace( rbackslash, "" ), context, xml )[0];
-				if ( !context ) {
-					return results;
-				}
-
-				selector = selector.slice( tokens.shift().length );
-			}
-
-			// Fetch a seed set for right-to-left matching
-			for ( i = matchExpr["POS"].test( selector ) ? -1 : tokens.length - 1; i >= 0; i-- ) {
-				token = tokens[i];
-
-				// Abort if we hit a combinator
-				if ( Expr.relative[ (type = token.type) ] ) {
-					break;
-				}
-				if ( (find = Expr.find[ type ]) ) {
-					// Search, expanding context for leading sibling combinators
-					if ( (seed = find(
-						token.matches[0].replace( rbackslash, "" ),
-						rsibling.test( tokens[0].type ) && context.parentNode || context,
-						xml
-					)) ) {
-
-						// If seed is empty or no tokens remain, we can return early
-						tokens.splice( i, 1 );
-						selector = seed.length && tokens.join("");
-						if ( !selector ) {
-							push.apply( results, slice.call( seed, 0 ) );
-							return results;
-						}
-
-						break;
-					}
-				}
-			}
-		}
-	}
-
-	// Compile and execute a filtering function
-	// Provide `match` to avoid retokenization if we modified the selector above
-	compile( selector, match )(
-		seed,
-		context,
-		xml,
-		results,
-		rsibling.test( selector )
-	);
-	return results;
-}
-
-if ( document.querySelectorAll ) {
-	(function() {
-		var disconnectedMatch,
-			oldSelect = select,
-			rescape = /'|\\/g,
-			rattributeQuotes = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
-
-			// qSa(:focus) reports false when true (Chrome 21), no need to also add to buggyMatches since matches checks buggyQSA
-			// A support test would require too much code (would include document ready)
-			rbuggyQSA = [ ":focus" ],
-
-			// matchesSelector(:active) reports false when true (IE9/Opera 11.5)
-			// A support test would require too much code (would include document ready)
-			// just skip matchesSelector for :active
-			rbuggyMatches = [ ":active" ],
-			matches = docElem.matchesSelector ||
-				docElem.mozMatchesSelector ||
-				docElem.webkitMatchesSelector ||
-				docElem.oMatchesSelector ||
-				docElem.msMatchesSelector;
-
-		// Build QSA regex
-		// Regex strategy adopted from Diego Perini
-		assert(function( div ) {
-			// Select is set to empty string on purpose
-			// This is to test IE's treatment of not explictly
-			// setting a boolean content attribute,
-			// since its presence should be enough
-			// http://bugs.jquery.com/ticket/12359
-			div.innerHTML = "<select><option selected=''></option></select>";
-
-			// IE8 - Some boolean attributes are not treated correctly
-			if ( !div.querySelectorAll("[selected]").length ) {
-				rbuggyQSA.push( "\\[" + whitespace + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)" );
-			}
-
-			// Webkit/Opera - :checked should return selected option elements
-			// http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked
-			// IE8 throws error here (do not put tests after this one)
-			if ( !div.querySelectorAll(":checked").length ) {
-				rbuggyQSA.push(":checked");
-			}
-		});
-
-		assert(function( div ) {
-
-			// Opera 10-12/IE9 - ^= $= *= and empty values
-			// Should not select anything
-			div.innerHTML = "<p test=''></p>";
-			if ( div.querySelectorAll("[test^='']").length ) {
-				rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:\"\"|'')" );
-			}
-
-			// FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled)
-			// IE8 throws error here (do not put tests after this one)
-			div.innerHTML = "<input type='hidden'/>";
-			if ( !div.querySelectorAll(":enabled").length ) {
-				rbuggyQSA.push(":enabled", ":disabled");
-			}
-		});
-
-		// rbuggyQSA always contains :focus, so no need for a length check
-		rbuggyQSA = /* rbuggyQSA.length && */ new RegExp( rbuggyQSA.join("|") );
-
-		select = function( selector, context, results, seed, xml ) {
-			// Only use querySelectorAll when not filtering,
-			// when this is not xml,
-			// and when no QSA bugs apply
-			if ( !seed && !xml && !rbuggyQSA.test( selector ) ) {
-				var groups, i,
-					old = true,
-					nid = expando,
-					newContext = context,
-					newSelector = context.nodeType === 9 && selector;
-
-				// qSA works strangely on Element-rooted queries
-				// We can work around this by specifying an extra ID on the root
-				// and working up from there (Thanks to Andrew Dupont for the technique)
-				// IE 8 doesn't work on object elements
-				if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
-					groups = tokenize( selector );
-
-					if ( (old = context.getAttribute("id")) ) {
-						nid = old.replace( rescape, "\\$&" );
-					} else {
-						context.setAttribute( "id", nid );
-					}
-					nid = "[id='" + nid + "'] ";
-
-					i = groups.length;
-					while ( i-- ) {
-						groups[i] = nid + groups[i].join("");
-					}
-					newContext = rsibling.test( selector ) && context.parentNode || context;
-					newSelector = groups.join(",");
-				}
-
-				if ( newSelector ) {
-					try {
-						push.apply( results, slice.call( newContext.querySelectorAll(
-							newSelector
-						), 0 ) );
-						return results;
-					} catch(qsaError) {
-					} finally {
-						if ( !old ) {
-							context.removeAttribute("id");
-						}
-					}
-				}
-			}
-
-			return oldSelect( selector, context, results, seed, xml );
-		};
-
-		if ( matches ) {
-			assert(function( div ) {
-				// Check to see if it's possible to do matchesSelector
-				// on a disconnected node (IE 9)
-				disconnectedMatch = matches.call( div, "div" );
-
-				// This should fail with an exception
-				// Gecko does not error, returns false instead
-				try {
-					matches.call( div, "[test!='']:sizzle" );
-					rbuggyMatches.push( "!=", pseudos );
-				} catch ( e ) {}
-			});
-
-			// rbuggyMatches always contains :active and :focus, so no need for a length check
-			rbuggyMatches = /* rbuggyMatches.length && */ new RegExp( rbuggyMatches.join("|") );
-
-			Sizzle.matchesSelector = function( elem, expr ) {
-				// Make sure that attribute selectors are quoted
-				expr = expr.replace( rattributeQuotes, "='$1']" );
-
-				// rbuggyMatches always contains :active, so no need for an existence check
-				if ( !isXML( elem ) && !rbuggyMatches.test( expr ) && !rbuggyQSA.test( expr ) ) {
-					try {
-						var ret = matches.call( elem, expr );
-
-						// IE 9's matchesSelector returns false on disconnected nodes
-						if ( ret || disconnectedMatch ||
-								// As well, disconnected nodes are said to be in a document
-								// fragment in IE 9
-								elem.document && elem.document.nodeType !== 11 ) {
-							return ret;
-						}
-					} catch(e) {}
-				}
-
-				return Sizzle( expr, null, null, [ elem ] ).length > 0;
-			};
-		}
-	})();
-}
-
-// Deprecated
-Expr.pseudos["nth"] = Expr.pseudos["eq"];
-
-// Back-compat
-function setFilters() {}
-Expr.filters = setFilters.prototype = Expr.pseudos;
-Expr.setFilters = new setFilters();
-
-// Override sizzle attribute retrieval
-Sizzle.attr = jQuery.attr;
-jQuery.find = Sizzle;
-jQuery.expr = Sizzle.selectors;
-jQuery.expr[":"] = jQuery.expr.pseudos;
-jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = Sizzle.getText;
-jQuery.isXMLDoc = Sizzle.isXML;
-jQuery.contains = Sizzle.contains;
-
-
-})( window );
-var runtil = /Until$/,
-	rparentsprev = /^(?:parents|prev(?:Until|All))/,
-	isSimple = /^.[^:#\[\.,]*$/,
-	rneedsContext = jQuery.expr.match.needsContext,
-	// methods guaranteed to produce a unique set when starting from a unique set
-	guaranteedUnique = {
-		children: true,
-		contents: true,
-		next: true,
-		prev: true
-	};
-
-jQuery.fn.extend({
-	find: function( selector ) {
-		var i, l, length, n, r, ret,
-			self = this;
-
-		if ( typeof selector !== "string" ) {
-			return jQuery( selector ).filter(function() {
-				for ( i = 0, l = self.length; i < l; i++ ) {
-					if ( jQuery.contains( self[ i ], this ) ) {
-						return true;
-					}
-				}
-			});
-		}
-
-		ret = this.pushStack( "", "find", selector );
-
-		for ( i = 0, l = this.length; i < l; i++ ) {
-			length = ret.length;
-			jQuery.find( selector, this[i], ret );
-
-			if ( i > 0 ) {
-				// Make sure that the results are unique
-				for ( n = length; n < ret.length; n++ ) {
-					for ( r = 0; r < length; r++ ) {
-						if ( ret[r] === ret[n] ) {
-							ret.splice(n--, 1);
-							break;
-						}
-					}
-				}
-			}
-		}
-
-		return ret;
-	},
-
-	has: function( target ) {
-		var i,
-			targets = jQuery( target, this ),
-			len = targets.length;
-
-		return this.filter(function() {
-			for ( i = 0; i < len; i++ ) {
-				if ( jQuery.contains( this, targets[i] ) ) {
-					return true;
-				}
-			}
-		});
-	},
-
-	not: function( selector ) {
-		return this.pushStack( winnow(this, selector, false), "not", selector);
-	},
-
-	filter: function( selector ) {
-		return this.pushStack( winnow(this, selector, true), "filter", selector );
-	},
-
-	is: function( selector ) {
-		return !!selector && (
-			typeof selector === "string" ?
-				// If this is a positional/relative selector, check membership in the returned set
-				// so $("p:first").is("p:last") won't return true for a doc with two "p".
-				rneedsContext.test( selector ) ?
-					jQuery( selector, this.context ).index( this[0] ) >= 0 :
-					jQuery.filter( selector, this ).length > 0 :
-				this.filter( selector ).length > 0 );
-	},
-
-	closest: function( selectors, context ) {
-		var cur,
-			i = 0,
-			l = this.length,
-			ret = [],
-			pos = rneedsContext.test( selectors ) || typeof selectors !== "string" ?
-				jQuery( selectors, context || this.context ) :
-				0;
-
-		for ( ; i < l; i++ ) {
-			cur = this[i];
-
-			while ( cur && cur.ownerDocument && cur !== context && cur.nodeType !== 11 ) {
-				if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
-					ret.push( cur );
-					break;
-				}
-				cur = cur.parentNode;
-			}
-		}
-
-		ret = ret.length > 1 ? jQuery.unique( ret ) : ret;
-
-		return this.pushStack( ret, "closest", selectors );
-	},
-
-	// Determine the position of an element within
-	// the matched set of elements
-	index: function( elem ) {
-
-		// No argument, return index in parent
-		if ( !elem ) {
-			return ( this[0] && this[0].parentNode ) ? this.prevAll().length : -1;
-		}
-
-		// index in selector
-		if ( typeof elem === "string" ) {
-			return jQuery.inArray( this[0], jQuery( elem ) );
-		}
-
-		// Locate the position of the desired element
-		return jQuery.inArray(
-			// If it receives a jQuery object, the first element is used
-			elem.jquery ? elem[0] : elem, this );
-	},
-
-	add: function( selector, context ) {
-		var set = typeof selector === "string" ?
-				jQuery( selector, context ) :
-				jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
-			all = jQuery.merge( this.get(), set );
-
-		return this.pushStack( isDisconnected( set[0] ) || isDisconnected( all[0] ) ?
-			all :
-			jQuery.unique( all ) );
-	},
-
-	addBack: function( selector ) {
-		return this.add( selector == null ?
-			this.prevObject : this.prevObject.filter(selector)
-		);
-	}
-});
-
-jQuery.fn.andSelf = jQuery.fn.addBack;
-
-// A painfully simple check to see if an element is disconnected
-// from a document (should be improved, where feasible).
-function isDisconnected( node ) {
-	return !node || !node.parentNode || node.parentNode.nodeType === 11;
-}
-
-function sibling( cur, dir ) {
-	do {
-		cur = cur[ dir ];
-	} while ( cur && cur.nodeType !== 1 );
-
-	return cur;
-}
-
-jQuery.each({
-	parent: function( elem ) {
-		var parent = elem.parentNode;
-		return parent && parent.nodeType !== 11 ? parent : null;
-	},
-	parents: function( elem ) {
-		return jQuery.dir( elem, "parentNode" );
-	},
-	parentsUntil: function( elem, i, until ) {
-		return jQuery.dir( elem, "parentNode", until );
-	},
-	next: function( elem ) {
-		return sibling( elem, "nextSibling" );
-	},
-	prev: function( elem ) {
-		return sibling( elem, "previousSibling" );
-	},
-	nextAll: function( elem ) {
-		return jQuery.dir( elem, "nextSibling" );
-	},
-	prevAll: function( elem ) {
-		return jQuery.dir( elem, "previousSibling" );
-	},
-	nextUntil: function( elem, i, until ) {
-		return jQuery.dir( elem, "nextSibling", until );
-	},
-	prevUntil: function( elem, i, until ) {
-		return jQuery.dir( elem, "previousSibling", until );
-	},
-	siblings: function( elem ) {
-		return jQuery.sibling( ( elem.parentNode || {} ).firstChild, elem );
-	},
-	children: function( elem ) {
-		return jQuery.sibling( elem.firstChild );
-	},
-	contents: function( elem ) {
-		return jQuery.nodeName( elem, "iframe" ) ?
-			elem.contentDocument || elem.contentWindow.document :
-			jQuery.merge( [], elem.childNodes );
-	}
-}, function( name, fn ) {
-	jQuery.fn[ name ] = function( until, selector ) {
-		var ret = jQuery.map( this, fn, until );
-
-		if ( !runtil.test( name ) ) {
-			selector = until;
-		}
-
-		if ( selector && typeof selector === "string" ) {
-			ret = jQuery.filter( selector, ret );
-		}
-
-		ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
-
-		if ( this.length > 1 && rparentsprev.test( name ) ) {
-			ret = ret.reverse();
-		}
-
-		return this.pushStack( ret, name, core_slice.call( arguments ).join(",") );
-	};
-});
-
-jQuery.extend({
-	filter: function( expr, elems, not ) {
-		if ( not ) {
-			expr = ":not(" + expr + ")";
-		}
-
-		return elems.length === 1 ?
-			jQuery.find.matchesSelector(elems[0], expr) ? [ elems[0] ] : [] :
-			jQuery.find.matches(expr, elems);
-	},
-
-	dir: function( elem, dir, until ) {
-		var matched = [],
-			cur = elem[ dir ];
-
-		while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
-			if ( cur.nodeType === 1 ) {
-				matched.push( cur );
-			}
-			cur = cur[dir];
-		}
-		return matched;
-	},
-
-	sibling: function( n, elem ) {
-		var r = [];
-
-		for ( ; n; n = n.nextSibling ) {
-			if ( n.nodeType === 1 && n !== elem ) {
-				r.push( n );
-			}
-		}
-
-		return r;
-	}
-});
-
-// Implement the identical functionality for filter and not
-function winnow( elements, qualifier, keep ) {
-
-	// Can't pass null or undefined to indexOf in Firefox 4
-	// Set to 0 to skip string check
-	qualifier = qualifier || 0;
-
-	if ( jQuery.isFunction( qualifier ) ) {
-		return jQuery.grep(elements, function( elem, i ) {
-			var retVal = !!qualifier.call( elem, i, elem );
-			return retVal === keep;
-		});
-
-	} else if ( qualifier.nodeType ) {
-		return jQuery.grep(elements, function( elem, i ) {
-			return ( elem === qualifier ) === keep;
-		});
-
-	} else if ( typeof qualifier === "string" ) {
-		var filtered = jQuery.grep(elements, function( elem ) {
-			return elem.nodeType === 1;
-		});
-
-		if ( isSimple.test( qualifier ) ) {
-			return jQuery.filter(qualifier, filtered, !keep);
-		} else {
-			qualifier = jQuery.filter( qualifier, filtered );
-		}
-	}
-
-	return jQuery.grep(elements, function( elem, i ) {
-		return ( jQuery.inArray( elem, qualifier ) >= 0 ) === keep;
-	});
-}
-function createSafeFragment( document ) {
-	var list = nodeNames.split( "|" ),
-	safeFrag = document.createDocumentFragment();
-
-	if ( safeFrag.createElement ) {
-		while ( list.length ) {
-			safeFrag.createElement(
-				list.pop()
-			);
-		}
-	}
-	return safeFrag;
-}
-
-var nodeNames = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|" +
-		"header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
-	rinlinejQuery = / jQuery\d+="(?:null|\d+)"/g,
-	rleadingWhitespace = /^\s+/,
-	rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
-	rtagName = /<([\w:]+)/,
-	rtbody = /<tbody/i,
-	rhtml = /<|&#?\w+;/,
-	rnoInnerhtml = /<(?:script|style|link)/i,
-	rnocache = /<(?:script|object|embed|option|style)/i,
-	rnoshimcache = new RegExp("<(?:" + nodeNames + ")[\\s/>]", "i"),
-	rcheckableType = /^(?:checkbox|radio)$/,
-	// checked="checked" or checked
-	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
-	rscriptType = /\/(java|ecma)script/i,
-	rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,
-	wrapMap = {
-		option: [ 1, "<select multiple='multiple'>", "</select>" ],
-		legend: [ 1, "<fieldset>", "</fieldset>" ],
-		thead: [ 1, "<table>", "</table>" ],
-		tr: [ 2, "<table><tbody>", "</tbody></table>" ],
-		td: [ 3, "<table><tbody><tr>", "</tr></tbody></table>" ],
-		col: [ 2, "<table><tbody></tbody><colgroup>", "</colgroup></table>" ],
-		area: [ 1, "<map>", "</map>" ],
-		_default: [ 0, "", "" ]
-	},
-	safeFragment = createSafeFragment( document ),
-	fragmentDiv = safeFragment.appendChild( document.createElement("div") );
-
-wrapMap.optgroup = wrapMap.option;
-wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead;
-wrapMap.th = wrapMap.td;
-
-// IE6-8 can't serialize link, script, style, or any html5 (NoScope) tags,
-// unless wrapped in a div with non-breaking characters in front of it.
-if ( !jQuery.support.htmlSerialize ) {
-	wrapMap._default = [ 1, "X<div>", "</div>" ];
-}
-
-jQuery.fn.extend({
-	text: function( value ) {
-		return jQuery.access( this, function( value ) {
-			return value === undefined ?
-				jQuery.text( this ) :
-				this.empty().append( ( this[0] && this[0].ownerDocument || document ).createTextNode( value ) );
-		}, null, value, arguments.length );
-	},
-
-	wrapAll: function( html ) {
-		if ( jQuery.isFunction( html ) ) {
-			return this.each(function(i) {
-				jQuery(this).wrapAll( html.call(this, i) );
-			});
-		}
-
-		if ( this[0] ) {
-			// The elements to wrap the target around
-			var wrap = jQuery( html, this[0].ownerDocument ).eq(0).clone(true);
-
-			if ( this[0].parentNode ) {
-				wrap.insertBefore( this[0] );
-			}
-
-			wrap.map(function() {
-				var elem = this;
-
-				while ( elem.firstChild && elem.firstChild.nodeType === 1 ) {
-					elem = elem.firstChild;
-				}
-
-				return elem;
-			}).append( this );
-		}
-
-		return this;
-	},
-
-	wrapInner: function( html ) {
-		if ( jQuery.isFunction( html ) ) {
-			return this.each(function(i) {
-				jQuery(this).wrapInner( html.call(this, i) );
-			});
-		}
-
-		return this.each(function() {
-			var self = jQuery( this ),
-				contents = self.contents();
-
-			if ( contents.length ) {
-				contents.wrapAll( html );
-
-			} else {
-				self.append( html );
-			}
-		});
-	},
-
-	wrap: function( html ) {
-		var isFunction = jQuery.isFunction( html );
-
-		return this.each(function(i) {
-			jQuery( this ).wrapAll( isFunction ? html.call(this, i) : html );
-		});
-	},
-
-	unwrap: function() {
-		return this.parent().each(function() {
-			if ( !jQuery.nodeName( this, "body" ) ) {
-				jQuery( this ).replaceWith( this.childNodes );
-			}
-		}).end();
-	},
-
-	append: function() {
-		return this.domManip(arguments, true, function( elem ) {
-			if ( this.nodeType === 1 || this.nodeType === 11 ) {
-				this.appendChild( elem );
-			}
-		});
-	},
-
-	prepend: function() {
-		return this.domManip(arguments, true, function( elem ) {
-			if ( this.nodeType === 1 || this.nodeType === 11 ) {
-				this.insertBefore( elem, this.firstChild );
-			}
-		});
-	},
-
-	before: function() {
-		if ( !isDisconnected( this[0] ) ) {
-			return this.domManip(arguments, false, function( elem ) {
-				this.parentNode.insertBefore( elem, this );
-			});
-		}
-
-		if ( arguments.length ) {
-			var set = jQuery.clean( arguments );
-			return this.pushStack( jQuery.merge( set, this ), "before", this.selector );
-		}
-	},
-
-	after: function() {
-		if ( !isDisconnected( this[0] ) ) {
-			return this.domManip(arguments, false, function( elem ) {
-				this.parentNode.insertBefore( elem, this.nextSibling );
-			});
-		}
-
-		if ( arguments.length ) {
-			var set = jQuery.clean( arguments );
-			return this.pushStack( jQuery.merge( this, set ), "after", this.selector );
-		}
-	},
-
-	// keepData is for internal use only--do not document
-	remove: function( selector, keepData ) {
-		var elem,
-			i = 0;
-
-		for ( ; (elem = this[i]) != null; i++ ) {
-			if ( !selector || jQuery.filter( selector, [ elem ] ).length ) {
-				if ( !keepData && elem.nodeType === 1 ) {
-					jQuery.cleanData( elem.getElementsByTagName("*") );
-					jQuery.cleanData( [ elem ] );
-				}
-
-				if ( elem.parentNode ) {
-					elem.parentNode.removeChild( elem );
-				}
-			}
-		}
-
-		return this;
-	},
-
-	empty: function() {
-		var elem,
-			i = 0;
-
-		for ( ; (elem = this[i]) != null; i++ ) {
-			// Remove element nodes and prevent memory leaks
-			if ( elem.nodeType === 1 ) {
-				jQuery.cleanData( elem.getElementsByTagName("*") );
-			}
-
-			// Remove any remaining nodes
-			while ( elem.firstChild ) {
-				elem.removeChild( elem.firstChild );
-			}
-		}
-
-		return this;
-	},
-
-	clone: function( dataAndEvents, deepDataAndEvents ) {
-		dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
-		deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
-
-		return this.map( function () {
-			return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
-		});
-	},
-
-	html: function( value ) {
-		return jQuery.access( this, function( value ) {
-			var elem = this[0] || {},
-				i = 0,
-				l = this.length;
-
-			if ( value === undefined ) {
-				return elem.nodeType === 1 ?
-					elem.innerHTML.replace( rinlinejQuery, "" ) :
-					undefined;
-			}
-
-			// See if we can take a shortcut and just use innerHTML
-			if ( typeof value === "string" && !rnoInnerhtml.test( value ) &&
-				( jQuery.support.htmlSerialize || !rnoshimcache.test( value )  ) &&
-				( jQuery.support.leadingWhitespace || !rleadingWhitespace.test( value ) ) &&
-				!wrapMap[ ( rtagName.exec( value ) || ["", ""] )[1].toLowerCase() ] ) {
-
-				value = value.replace( rxhtmlTag, "<$1></$2>" );
-
-				try {
-					for (; i < l; i++ ) {
-						// Remove element nodes and prevent memory leaks
-						elem = this[i] || {};
-						if ( elem.nodeType === 1 ) {
-							jQuery.cleanData( elem.getElementsByTagName( "*" ) );
-							elem.innerHTML = value;
-						}
-					}
-
-					elem = 0;
-
-				// If using innerHTML throws an exception, use the fallback method
-				} catch(e) {}
-			}
-
-			if ( elem ) {
-				this.empty().append( value );
-			}
-		}, null, value, arguments.length );
-	},
-
-	replaceWith: function( value ) {
-		if ( !isDisconnected( this[0] ) ) {
-			// Make sure that the elements are removed from the DOM before they are inserted
-			// this can help fix replacing a parent with child elements
-			if ( jQuery.isFunction( value ) ) {
-				return this.each(function(i) {
-					var self = jQuery(this), old = self.html();
-					self.replaceWith( value.call( this, i, old ) );
-				});
-			}
-
-			if ( typeof value !== "string" ) {
-				value = jQuery( value ).detach();
-			}
-
-			return this.each(function() {
-				var next = this.nextSibling,
-					parent = this.parentNode;
-
-				jQuery( this ).remove();
-
-				if ( next ) {
-					jQuery(next).before( value );
-				} else {
-					jQuery(parent).append( value );
-				}
-			});
-		}
-
-		return this.length ?
-			this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
-			this;
-	},
-
-	detach: function( selector ) {
-		return this.remove( selector, true );
-	},
-
-	domManip: function( args, table, callback ) {
-
-		// Flatten any nested arrays
-		args = [].concat.apply( [], args );
-
-		var results, first, fragment, iNoClone,
-			i = 0,
-			value = args[0],
-			scripts = [],
-			l = this.length;
-
-		// We can't cloneNode fragments that contain checked, in WebKit
-		if ( !jQuery.support.checkClone && l > 1 && typeof value === "string" && rchecked.test( value ) ) {
-			return this.each(function() {
-				jQuery(this).domManip( args, table, callback );
-			});
-		}
-
-		if ( jQuery.isFunction(value) ) {
-			return this.each(function(i) {
-				var self = jQuery(this);
-				args[0] = value.call( this, i, table ? self.html() : undefined );
-				self.domManip( args, table, callback );
-			});
-		}
-
-		if ( this[0] ) {
-			results = jQuery.buildFragment( args, this, scripts );
-			fragment = results.fragment;
-			first = fragment.firstChild;
-
-			if ( fragment.childNodes.length === 1 ) {
-				fragment = first;
-			}
-
-			if ( first ) {
-				table = table && jQuery.nodeName( first, "tr" );
-
-				// Use the original fragment for the last item instead of the first because it can end up
-				// being emptied incorrectly in certain situations (#8070).
-				// Fragments from the fragment cache must always be cloned and never used in place.
-				for ( iNoClone = results.cacheable || l - 1; i < l; i++ ) {
-					callback.call(
-						table && jQuery.nodeName( this[i], "table" ) ?
-							findOrAppend( this[i], "tbody" ) :
-							this[i],
-						i === iNoClone ?
-							fragment :
-							jQuery.clone( fragment, true, true )
-					);
-				}
-			}
-
-			// Fix #11809: Avoid leaking memory
-			fragment = first = null;
-
-			if ( scripts.length ) {
-				jQuery.each( scripts, function( i, elem ) {
-					if ( elem.src ) {
-						if ( jQuery.ajax ) {
-							jQuery.ajax({
-								url: elem.src,
-								type: "GET",
-								dataType: "script",
-								async: false,
-								global: false,
-								"throws": true
-							});
-						} else {
-							jQuery.error("no ajax");
-						}
-					} else {
-						jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "" ) );
-					}
-
-					if ( elem.parentNode ) {
-						elem.parentNode.removeChild( elem );
-					}
-				});
-			}
-		}
-
-		return this;
-	}
-});
-
-function findOrAppend( elem, tag ) {
-	return elem.getElementsByTagName( tag )[0] || elem.appendChild( elem.ownerDocument.createElement( tag ) );
-}
-
-function cloneCopyEvent( src, dest ) {
-
-	if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
-		return;
-	}
-
-	var type, i, l,
-		oldData = jQuery._data( src ),
-		curData = jQuery._data( dest, oldData ),
-		events = oldData.events;
-
-	if ( events ) {
-		delete curData.handle;
-		curData.events = {};
-
-		for ( type in events ) {
-			for ( i = 0, l = events[ type ].length; i < l; i++ ) {
-				jQuery.event.add( dest, type, events[ type ][ i ] );
-			}
-		}
-	}
-
-	// make the cloned public data object a copy from the original
-	if ( curData.data ) {
-		curData.data = jQuery.extend( {}, curData.data );
-	}
-}
-
-function cloneFixAttributes( src, dest ) {
-	var nodeName;
-
-	// We do not need to do anything for non-Elements
-	if ( dest.nodeType !== 1 ) {
-		return;
-	}
-
-	// clearAttributes removes the attributes, which we don't want,
-	// but also removes the attachEvent events, which we *do* want
-	if ( dest.clearAttributes ) {
-		dest.clearAttributes();
-	}
-
-	// mergeAttributes, in contrast, only merges back on the
-	// original attributes, not the events
-	if ( dest.mergeAttributes ) {
-		dest.mergeAttributes( src );
-	}
-
-	nodeName = dest.nodeName.toLowerCase();
-
-	if ( nodeName === "object" ) {
-		// IE6-10 improperly clones children of object elements using classid.
-		// IE10 throws NoModificationAllowedError if parent is null, #12132.
-		if ( dest.parentNode ) {
-			dest.outerHTML = src.outerHTML;
-		}
-
-		// This path appears unavoidable for IE9. When cloning an object
-		// element in IE9, the outerHTML strategy above is not sufficient.
-		// If the src has innerHTML and the destination does not,
-		// copy the src.innerHTML into the dest.innerHTML. #10324
-		if ( jQuery.support.html5Clone && (src.innerHTML && !jQuery.trim(dest.innerHTML)) ) {
-			dest.innerHTML = src.innerHTML;
-		}
-
-	} else if ( nodeName === "input" && rcheckableType.test( src.type ) ) {
-		// IE6-8 fails to persist the checked state of a cloned checkbox
-		// or radio button. Worse, IE6-7 fail to give the cloned element
-		// a checked appearance if the defaultChecked value isn't also set
-
-		dest.defaultChecked = dest.checked = src.checked;
-
-		// IE6-7 get confused and end up setting the value of a cloned
-		// checkbox/radio button to an empty string instead of "on"
-		if ( dest.value !== src.value ) {
-			dest.value = src.value;
-		}
-
-	// IE6-8 fails to return the selected option to the default selected
-	// state when cloning options
-	} else if ( nodeName === "option" ) {
-		dest.selected = src.defaultSelected;
-
-	// IE6-8 fails to set the defaultValue to the correct value when
-	// cloning other types of input fields
-	} else if ( nodeName === "input" || nodeName === "textarea" ) {
-		dest.defaultValue = src.defaultValue;
-
-	// IE blanks contents when cloning scripts
-	} else if ( nodeName === "script" && dest.text !== src.text ) {
-		dest.text = src.text;
-	}
-
-	// Event data gets referenced instead of copied if the expando
-	// gets copied too
-	dest.removeAttribute( jQuery.expando );
-}
-
-jQuery.buildFragment = function( args, context, scripts ) {
-	var fragment, cacheable, cachehit,
-		first = args[ 0 ];
-
-	// Set context from what may come in as undefined or a jQuery collection or a node
-	// Updated to fix #12266 where accessing context[0] could throw an exception in IE9/10 &
-	// also doubles as fix for #8950 where plain objects caused createDocumentFragment exception
-	context = context || document;
-	context = !context.nodeType && context[0] || context;
-	context = context.ownerDocument || context;
-
-	// Only cache "small" (1/2 KB) HTML strings that are associated with the main document
-	// Cloning options loses the selected state, so don't cache them
-	// IE 6 doesn't like it when you put <object> or <embed> elements in a fragment
-	// Also, WebKit does not clone 'checked' attributes on cloneNode, so don't cache
-	// Lastly, IE6,7,8 will not correctly reuse cached fragments that were created from unknown elems #10501
-	if ( args.length === 1 && typeof first === "string" && first.length < 512 && context === document &&
-		first.charAt(0) === "<" && !rnocache.test( first ) &&
-		(jQuery.support.checkClone || !rchecked.test( first )) &&
-		(jQuery.support.html5Clone || !rnoshimcache.test( first )) ) {
-
-		// Mark cacheable and look for a hit
-		cacheable = true;
-		fragment = jQuery.fragments[ first ];
-		cachehit = fragment !== undefined;
-	}
-
-	if ( !fragment ) {
-		fragment = context.createDocumentFragment();
-		jQuery.clean( args, context, fragment, scripts );
-
-		// Update the cache, but only store false
-		// unless this is a second parsing of the same content
-		if ( cacheable ) {
-			jQuery.fragments[ first ] = cachehit && fragment;
-		}
-	}
-
-	return { fragment: fragment, cacheable: cacheable };
-};
-
-jQuery.fragments = {};
-
-jQuery.each({
-	appendTo: "append",
-	prependTo: "prepend",
-	insertBefore: "before",
-	insertAfter: "after",
-	replaceAll: "replaceWith"
-}, function( name, original ) {
-	jQuery.fn[ name ] = function( selector ) {
-		var elems,
-			i = 0,
-			ret = [],
-			insert = jQuery( selector ),
-			l = insert.length,
-			parent = this.length === 1 && this[0].parentNode;
-
-		if ( (parent == null || parent && parent.nodeType === 11 && parent.childNodes.length === 1) && l === 1 ) {
-			insert[ original ]( this[0] );
-			return this;
-		} else {
-			for ( ; i < l; i++ ) {
-				elems = ( i > 0 ? this.clone(true) : this ).get();
-				jQuery( insert[i] )[ original ]( elems );
-				ret = ret.concat( elems );
-			}
-
-			return this.pushStack( ret, name, insert.selector );
-		}
-	};
-});
-
-function getAll( elem ) {
-	if ( typeof elem.getElementsByTagName !== "undefined" ) {
-		return elem.getElementsByTagName( "*" );
-
-	} else if ( typeof elem.querySelectorAll !== "undefined" ) {
-		return elem.querySelectorAll( "*" );
-
-	} else {
-		return [];
-	}
-}
-
-// Used in clean, fixes the defaultChecked property
-function fixDefaultChecked( elem ) {
-	if ( rcheckableType.test( elem.type ) ) {
-		elem.defaultChecked = elem.checked;
-	}
-}
-
-jQuery.extend({
-	clone: function( elem, dataAndEvents, deepDataAndEvents ) {
-		var srcElements,
-			destElements,
-			i,
-			clone;
-
-		if ( jQuery.support.html5Clone || jQuery.isXMLDoc(elem) || !rnoshimcache.test( "<" + elem.nodeName + ">" ) ) {
-			clone = elem.cloneNode( true );
-
-		// IE<=8 does not properly clone detached, unknown element nodes
-		} else {
-			fragmentDiv.innerHTML = elem.outerHTML;
-			fragmentDiv.removeChild( clone = fragmentDiv.firstChild );
-		}
-
-		if ( (!jQuery.support.noCloneEvent || !jQuery.support.noCloneChecked) &&
-				(elem.nodeType === 1 || elem.nodeType === 11) && !jQuery.isXMLDoc(elem) ) {
-			// IE copies events bound via attachEvent when using cloneNode.
-			// Calling detachEvent on the clone will also remove the events
-			// from the original. In order to get around this, we use some
-			// proprietary methods to clear the events. Thanks to MooTools
-			// guys for this hotness.
-
-			cloneFixAttributes( elem, clone );
-
-			// Using Sizzle here is crazy slow, so we use getElementsByTagName instead
-			srcElements = getAll( elem );
-			destElements = getAll( clone );
-
-			// Weird iteration because IE will replace the length property
-			// with an element if you are cloning the body and one of the
-			// elements on the page has a name or id of "length"
-			for ( i = 0; srcElements[i]; ++i ) {
-				// Ensure that the destination node is not null; Fixes #9587
-				if ( destElements[i] ) {
-					cloneFixAttributes( srcElements[i], destElements[i] );
-				}
-			}
-		}
-
-		// Copy the events from the original to the clone
-		if ( dataAndEvents ) {
-			cloneCopyEvent( elem, clone );
-
-			if ( deepDataAndEvents ) {
-				srcElements = getAll( elem );
-				destElements = getAll( clone );
-
-				for ( i = 0; srcElements[i]; ++i ) {
-					cloneCopyEvent( srcElements[i], destElements[i] );
-				}
-			}
-		}
-
-		srcElements = destElements = null;
-
-		// Return the cloned set
-		return clone;
-	},
-
-	clean: function( elems, context, fragment, scripts ) {
-		var i, j, elem, tag, wrap, depth, div, hasBody, tbody, len, handleScript, jsTags,
-			safe = context === document && safeFragment,
-			ret = [];
-
-		// Ensure that context is a document
-		if ( !context || typeof context.createDocumentFragment === "undefined" ) {
-			context = document;
-		}
-
-		// Use the already-created safe fragment if context permits
-		for ( i = 0; (elem = elems[i]) != null; i++ ) {
-			if ( typeof elem === "number" ) {
-				elem += "";
-			}
-
-			if ( !elem ) {
-				continue;
-			}
-
-			// Convert html string into DOM nodes
-			if ( typeof elem === "string" ) {
-				if ( !rhtml.test( elem ) ) {
-					elem = context.createTextNode( elem );
-				} else {
-					// Ensure a safe container in which to render the html
-					safe = safe || createSafeFragment( context );
-					div = context.createElement("div");
-					safe.appendChild( div );
-
-					// Fix "XHTML"-style tags in all browsers
-					elem = elem.replace(rxhtmlTag, "<$1></$2>");
-
-					// Go to html and back, then peel off extra wrappers
-					tag = ( rtagName.exec( elem ) || ["", ""] )[1].toLowerCase();
-					wrap = wrapMap[ tag ] || wrapMap._default;
-					depth = wrap[0];
-					div.innerHTML = wrap[1] + elem + wrap[2];
-
-					// Move to the right depth
-					while ( depth-- ) {
-						div = div.lastChild;
-					}
-
-					// Remove IE's autoinserted <tbody> from table fragments
-					if ( !jQuery.support.tbody ) {
-
-						// String was a <table>, *may* have spurious <tbody>
-						hasBody = rtbody.test(elem);
-							tbody = tag === "table" && !hasBody ?
-								div.firstChild && div.firstChild.childNodes :
-
-								// String was a bare <thead> or <tfoot>
-								wrap[1] === "<table>" && !hasBody ?
-									div.childNodes :
-									[];
-
-						for ( j = tbody.length - 1; j >= 0 ; --j ) {
-							if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
-								tbody[ j ].parentNode.removeChild( tbody[ j ] );
-							}
-						}
-					}
-
-					// IE completely kills leading whitespace when innerHTML is used
-					if ( !jQuery.support.leadingWhitespace && rleadingWhitespace.test( elem ) ) {
-						div.insertBefore( context.createTextNode( rleadingWhitespace.exec(elem)[0] ), div.firstChild );
-					}
-
-					elem = div.childNodes;
-
-					// Take out of fragment container (we need a fresh div each time)
-					div.parentNode.removeChild( div );
-				}
-			}
-
-			if ( elem.nodeType ) {
-				ret.push( elem );
-			} else {
-				jQuery.merge( ret, elem );
-			}
-		}
-
-		// Fix #11356: Clear elements from safeFragment
-		if ( div ) {
-			elem = div = safe = null;
-		}
-
-		// Reset defaultChecked for any radios and checkboxes
-		// about to be appended to the DOM in IE 6/7 (#8060)
-		if ( !jQuery.support.appendChecked ) {
-			for ( i = 0; (elem = ret[i]) != null; i++ ) {
-				if ( jQuery.nodeName( elem, "input" ) ) {
-					fixDefaultChecked( elem );
-				} else if ( typeof elem.getElementsByTagName !== "undefined" ) {
-					jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
-				}
-			}
-		}
-
-		// Append elements to a provided document fragment
-		if ( fragment ) {
-			// Special handling of each script element
-			handleScript = function( elem ) {
-				// Check if we consider it executable
-				if ( !elem.type || rscriptType.test( elem.type ) ) {
-					// Detach the script and store it in the scripts array (if provided) or the fragment
-					// Return truthy to indicate that it has been handled
-					return scripts ?
-						scripts.push( elem.parentNode ? elem.parentNode.removeChild( elem ) : elem ) :
-						fragment.appendChild( elem );
-				}
-			};
-
-			for ( i = 0; (elem = ret[i]) != null; i++ ) {
-				// Check if we're done after handling an executable script
-				if ( !( jQuery.nodeName( elem, "script" ) && handleScript( elem ) ) ) {
-					// Append to fragment and handle embedded scripts
-					fragment.appendChild( elem );
-					if ( typeof elem.getElementsByTagName !== "undefined" ) {
-						// handleScript alters the DOM, so use jQuery.merge to ensure snapshot iteration
-						jsTags = jQuery.grep( jQuery.merge( [], elem.getElementsByTagName("script") ), handleScript );
-
-						// Splice the scripts into ret after their former ancestor and advance our index beyond them
-						ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
-						i += jsTags.length;
-					}
-				}
-			}
-		}
-
-		return ret;
-	},
-
-	cleanData: function( elems, /* internal */ acceptData ) {
-		var data, id, elem, type,
-			i = 0,
-			internalKey = jQuery.expando,
-			cache = jQuery.cache,
-			deleteExpando = jQuery.support.deleteExpando,
-			special = jQuery.event.special;
-
-		for ( ; (elem = elems[i]) != null; i++ ) {
-
-			if ( acceptData || jQuery.acceptData( elem ) ) {
-
-				id = elem[ internalKey ];
-				data = id && cache[ id ];
-
-				if ( data ) {
-					if ( data.events ) {
-						for ( type in data.events ) {
-							if ( special[ type ] ) {
-								jQuery.event.remove( elem, type );
-
-							// This is a shortcut to avoid jQuery.event.remove's overhead
-							} else {
-								jQuery.removeEvent( elem, type, data.handle );
-							}
-						}
-					}
-
-					// Remove cache only if it was not already removed by jQuery.event.remove
-					if ( cache[ id ] ) {
-
-						delete cache[ id ];
-
-						// IE does not allow us to delete expando properties from nodes,
-						// nor does it have a removeAttribute function on Document nodes;
-						// we must handle all of these cases
-						if ( deleteExpando ) {
-							delete elem[ internalKey ];
-
-						} else if ( elem.removeAttribute ) {
-							elem.removeAttribute( internalKey );
-
-						} else {
-							elem[ internalKey ] = null;
-						}
-
-						jQuery.deletedIds.push( id );
-					}
-				}
-			}
-		}
-	}
-});
-// Limit scope pollution from any deprecated API
-(function() {
-
-var matched, browser;
-
-// Use of jQuery.browser is frowned upon.
-// More details: http://api.jquery.com/jQuery.browser
-// jQuery.uaMatch maintained for back-compat
-jQuery.uaMatch = function( ua ) {
-	ua = ua.toLowerCase();
-
-	var match = /(chrome)[ \/]([\w.]+)/.exec( ua ) ||
-		/(webkit)[ \/]([\w.]+)/.exec( ua ) ||
-		/(opera)(?:.*version|)[ \/]([\w.]+)/.exec( ua ) ||
-		/(msie) ([\w.]+)/.exec( ua ) ||
-		ua.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec( ua ) ||
-		[];
-
-	return {
-		browser: match[ 1 ] || "",
-		version: match[ 2 ] || "0"
-	};
-};
-
-matched = jQuery.uaMatch( navigator.userAgent );
-browser = {};
-
-if ( matched.browser ) {
-	browser[ matched.browser ] = true;
-	browser.version = matched.version;
-}
-
-// Chrome is Webkit, but Webkit is also Safari.
-if ( browser.chrome ) {
-	browser.webkit = true;
-} else if ( browser.webkit ) {
-	browser.safari = true;
-}
-
-jQuery.browser = browser;
-
-jQuery.sub = function() {
-	function jQuerySub( selector, context ) {
-		return new jQuerySub.fn.init( selector, context );
-	}
-	jQuery.extend( true, jQuerySub, this );
-	jQuerySub.superclass = this;
-	jQuerySub.fn = jQuerySub.prototype = this();
-	jQuerySub.fn.constructor = jQuerySub;
-	jQuerySub.sub = this.sub;
-	jQuerySub.fn.init = function init( selector, context ) {
-		if ( context && context instanceof jQuery && !(context instanceof jQuerySub) ) {
-			context = jQuerySub( context );
-		}
-
-		return jQuery.fn.init.call( this, selector, context, rootjQuerySub );
-	};
-	jQuerySub.fn.init.prototype = jQuerySub.fn;
-	var rootjQuerySub = jQuerySub(document);
-	return jQuerySub;
-};
-
-})();
-var curCSS, iframe, iframeDoc,
-	ralpha = /alpha\([^)]*\)/i,
-	ropacity = /opacity=([^)]*)/,
-	rposition = /^(top|right|bottom|left)$/,
-	// swappable if display is none or starts with table except "table", "table-cell", or "table-caption"
-	// see here for display values: https://developer.mozilla.org/en-US/docs/CSS/display
-	rdisplayswap = /^(none|table(?!-c[ea]).+)/,
-	rmargin = /^margin/,
-	rnumsplit = new RegExp( "^(" + core_pnum + ")(.*)$", "i" ),
-	rnumnonpx = new RegExp( "^(" + core_pnum + ")(?!px)[a-z%]+$", "i" ),
-	rrelNum = new RegExp( "^([-+])=(" + core_pnum + ")", "i" ),
-	elemdisplay = { BODY: "block" },
-
-	cssShow = { position: "absolute", visibility: "hidden", display: "block" },
-	cssNormalTransform = {
-		letterSpacing: 0,
-		fontWeight: 400
-	},
-
-	cssExpand = [ "Top", "Right", "Bottom", "Left" ],
-	cssPrefixes = [ "Webkit", "O", "Moz", "ms" ],
-
-	eventsToggle = jQuery.fn.toggle;
-
-// return a css property mapped to a potentially vendor prefixed property
-function vendorPropName( style, name ) {
-
-	// shortcut for names that are not vendor prefixed
-	if ( name in style ) {
-		return name;
-	}
-
-	// check for vendor prefixed names
-	var capName = name.charAt(0).toUpperCase() + name.slice(1),
-		origName = name,
-		i = cssPrefixes.length;
-
-	while ( i-- ) {
-		name = cssPrefixes[ i ] + capName;
-		if ( name in style ) {
-			return name;
-		}
-	}
-
-	return origName;
-}
-
-function isHidden( elem, el ) {
-	elem = el || elem;
-	return jQuery.css( elem, "display" ) === "none" || !jQuery.contains( elem.ownerDocument, elem );
-}
-
-function showHide( elements, show ) {
-	var elem, display,
-		values = [],
-		index = 0,
-		length = elements.length;
-
-	for ( ; index < length; index++ ) {
-		elem = elements[ index ];
-		if ( !elem.style ) {
-			continue;
-		}
-		values[ index ] = jQuery._data( elem, "olddisplay" );
-		if ( show ) {
-			// Reset the inline display of this element to learn if it is
-			// being hidden by cascaded rules or not
-			if ( !values[ index ] && elem.style.display === "none" ) {
-				elem.style.display = "";
-			}
-
-			// Set elements which have been overridden with display: none
-			// in a stylesheet to whatever the default browser style is
-			// for such an element
-			if ( elem.style.display === "" && isHidden( elem ) ) {
-				values[ index ] = jQuery._data( elem, "olddisplay", css_defaultDisplay(elem.nodeName) );
-			}
-		} else {
-			display = curCSS( elem, "display" );
-
-			if ( !values[ index ] && display !== "none" ) {
-				jQuery._data( elem, "olddisplay", display );
-			}
-		}
-	}
-
-	// Set the display of most of the elements in a second loop
-	// to avoid the constant reflow
-	for ( index = 0; index < length; index++ ) {
-		elem = elements[ index ];
-		if ( !elem.style ) {
-			continue;
-		}
-		if ( !show || elem.style.display === "none" || elem.style.display === "" ) {
-			elem.style.display = show ? values[ index ] || "" : "none";
-		}
-	}
-
-	return elements;
-}
-
-jQuery.fn.extend({
-	css: function( name, value ) {
-		return jQuery.access( this, function( elem, name, value ) {
-			return value !== undefined ?
-				jQuery.style( elem, name, value ) :
-				jQuery.css( elem, name );
-		}, name, value, arguments.length > 1 );
-	},
-	show: function() {
-		return showHide( this, true );
-	},
-	hide: function() {
-		return showHide( this );
-	},
-	toggle: function( state, fn2 ) {
-		var bool = typeof state === "boolean";
-
-		if ( jQuery.isFunction( state ) && jQuery.isFunction( fn2 ) ) {
-			return eventsToggle.apply( this, arguments );
-		}
-
-		return this.each(function() {
-			if ( bool ? state : isHidden( this ) ) {
-				jQuery( this ).show();
-			} else {
-				jQuery( this ).hide();
-			}
-		});
-	}
-});
-
-jQuery.extend({
-	// Add in style property hooks for overriding the default
-	// behavior of getting and setting a style property
-	cssHooks: {
-		opacity: {
-			get: function( elem, computed ) {
-				if ( computed ) {
-					// We should always get a number back from opacity
-					var ret = curCSS( elem, "opacity" );
-					return ret === "" ? "1" : ret;
-
-				}
-			}
-		}
-	},
-
-	// Exclude the following css properties to add px
-	cssNumber: {
-		"fillOpacity": true,
-		"fontWeight": true,
-		"lineHeight": true,
-		"opacity": true,
-		"orphans": true,
-		"widows": true,
-		"zIndex": true,
-		"zoom": true
-	},
-
-	// Add in properties whose names you wish to fix before
-	// setting or getting the value
-	cssProps: {
-		// normalize float css property
-		"float": jQuery.support.cssFloat ? "cssFloat" : "styleFloat"
-	},
-
-	// Get and set the style property on a DOM Node
-	style: function( elem, name, value, extra ) {
-		// Don't set styles on text and comment nodes
-		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) {
-			return;
-		}
-
-		// Make sure that we're working with the right name
-		var ret, type, hooks,
-			origName = jQuery.camelCase( name ),
-			style = elem.style;
-
-		name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( style, origName ) );
-
-		// gets hook for the prefixed version
-		// followed by the unprefixed version
-		hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
-		// Check if we're setting a value
-		if ( value !== undefined ) {
-			type = typeof value;
-
-			// convert relative number strings (+= or -=) to relative numbers. #7345
-			if ( type === "string" && (ret = rrelNum.exec( value )) ) {
-				value = ( ret[1] + 1 ) * ret[2] + parseFloat( jQuery.css( elem, name ) );
-				// Fixes bug #9237
-				type = "number";
-			}
-
-			// Make sure that NaN and null values aren't set. See: #7116
-			if ( value == null || type === "number" && isNaN( value ) ) {
-				return;
-			}
-
-			// If a number was passed in, add 'px' to the (except for certain CSS properties)
-			if ( type === "number" && !jQuery.cssNumber[ origName ] ) {
-				value += "px";
-			}
-
-			// If a hook was provided, use that value, otherwise just set the specified value
-			if ( !hooks || !("set" in hooks) || (value = hooks.set( elem, value, extra )) !== undefined ) {
-				// Wrapped to prevent IE from throwing errors when 'invalid' values are provided
-				// Fixes bug #5509
-				try {
-					style[ name ] = value;
-				} catch(e) {}
-			}
-
-		} else {
-			// If a hook was provided get the non-computed value from there
-			if ( hooks && "get" in hooks && (ret = hooks.get( elem, false, extra )) !== undefined ) {
-				return ret;
-			}
-
-			// Otherwise just get the value from the style object
-			return style[ name ];
-		}
-	},
-
-	css: function( elem, name, numeric, extra ) {
-		var val, num, hooks,
-			origName = jQuery.camelCase( name );
-
-		// Make sure that we're working with the right name
-		name = jQuery.cssProps[ origName ] || ( jQuery.cssProps[ origName ] = vendorPropName( elem.style, origName ) );
-
-		// gets hook for the prefixed version
-		// followed by the unprefixed version
-		hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ];
-
-		// If a hook was provided get the computed value from there
-		if ( hooks && "get" in hooks ) {
-			val = hooks.get( elem, true, extra );
-		}
-
-		// Otherwise, if a way to get the computed value exists, use that
-		if ( val === undefined ) {
-			val = curCSS( elem, name );
-		}
-
-		//convert "normal" to computed value
-		if ( val === "normal" && name in cssNormalTransform ) {
-			val = cssNormalTransform[ name ];
-		}
-
-		// Return, converting to number if forced or a qualifier was provided and val looks numeric
-		if ( numeric || extra !== undefined ) {
-			num = parseFloat( val );
-			return numeric || jQuery.isNumeric( num ) ? num || 0 : val;
-		}
-		return val;
-	},
-
-	// A method for quickly swapping in/out CSS properties to get correct calculations
-	swap: function( elem, options, callback ) {
-		var ret, name,
-			old = {};
-
-		// Remember the old values, and insert the new ones
-		for ( name in options ) {
-			old[ name ] = elem.style[ name ];
-			elem.style[ name ] = options[ name ];
-		}
-
-		ret = callback.call( elem );
-
-		// Revert the old values
-		for ( name in options ) {
-			elem.style[ name ] = old[ name ];
-		}
-
-		return ret;
-	}
-});
-
-// NOTE: To any future maintainer, we've window.getComputedStyle
-// because jsdom on node.js will break without it.
-if ( window.getComputedStyle ) {
-	curCSS = function( elem, name ) {
-		var ret, width, minWidth, maxWidth,
-			computed = window.getComputedStyle( elem, null ),
-			style = elem.style;
-
-		if ( computed ) {
-
-			// getPropertyValue is only needed for .css('filter') in IE9, see #12537
-			ret = computed.getPropertyValue( name ) || computed[ name ];
-
-			if ( ret === "" && !jQuery.contains( elem.ownerDocument, elem ) ) {
-				ret = jQuery.style( elem, name );
-			}
-
-			// A tribute to the "awesome hack by Dean Edwards"
-			// Chrome < 17 and Safari 5.0 uses "computed value" instead of "used value" for margin-right
-			// Safari 5.1.7 (at least) returns percentage for a larger set of values, but width seems to be reliably pixels
-			// this is against the CSSOM draft spec: http://dev.w3.org/csswg/cssom/#resolved-values
-			if ( rnumnonpx.test( ret ) && rmargin.test( name ) ) {
-				width = style.width;
-				minWidth = style.minWidth;
-				maxWidth = style.maxWidth;
-
-				style.minWidth = style.maxWidth = style.width = ret;
-				ret = computed.width;
-
-				style.width = width;
-				style.minWidth = minWidth;
-				style.maxWidth = maxWidth;
-			}
-		}
-
-		return ret;
-	};
-} else if ( document.documentElement.currentStyle ) {
-	curCSS = function( elem, name ) {
-		var left, rsLeft,
-			ret = elem.currentStyle && elem.currentStyle[ name ],
-			style = elem.style;
-
-		// Avoid setting ret to empty string here
-		// so we don't default to auto
-		if ( ret == null && style && style[ name ] ) {
-			ret = style[ name ];
-		}
-
-		// From the awesome hack by Dean Edwards
-		// http://erik.eae.net/archives/2007/07/27/18.54.15/#comment-102291
-
-		// If we're not dealing with a regular pixel number
-		// but a number that has a weird ending, we need to convert it to pixels
-		// but not position css attributes, as those are proportional to the parent element instead
-		// and we can't measure the parent instead because it might trigger a "stacking dolls" problem
-		if ( rnumnonpx.test( ret ) && !rposition.test( name ) ) {
-
-			// Remember the original values
-			left = style.left;
-			rsLeft = elem.runtimeStyle && elem.runtimeStyle.left;
-
-			// Put in the new values to get a computed value out
-			if ( rsLeft ) {
-				elem.runtimeStyle.left = elem.currentStyle.left;
-			}
-			style.left = name === "fontSize" ? "1em" : ret;
-			ret = style.pixelLeft + "px";
-
-			// Revert the changed values
-			style.left = left;
-			if ( rsLeft ) {
-				elem.runtimeStyle.left = rsLeft;
-			}
-		}
-
-		return ret === "" ? "auto" : ret;
-	};
-}
-
-function setPositiveNumber( elem, value, subtract ) {
-	var matches = rnumsplit.exec( value );
-	return matches ?
-			Math.max( 0, matches[ 1 ] - ( subtract || 0 ) ) + ( matches[ 2 ] || "px" ) :
-			value;
-}
-
-function augmentWidthOrHeight( elem, name, extra, isBorderBox ) {
-	var i = extra === ( isBorderBox ? "border" : "content" ) ?
-		// If we already have the right measurement, avoid augmentation
-		4 :
-		// Otherwise initialize for horizontal or vertical properties
-		name === "width" ? 1 : 0,
-
-		val = 0;
-
-	for ( ; i < 4; i += 2 ) {
-		// both box models exclude margin, so add it if we want it
-		if ( extra === "margin" ) {
-			// we use jQuery.css instead of curCSS here
-			// because of the reliableMarginRight CSS hook!
-			val += jQuery.css( elem, extra + cssExpand[ i ], true );
-		}
-
-		// From this point on we use curCSS for maximum performance (relevant in animations)
-		if ( isBorderBox ) {
-			// border-box includes padding, so remove it if we want content
-			if ( extra === "content" ) {
-				val -= parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0;
-			}
-
-			// at this point, extra isn't border nor margin, so remove border
-			if ( extra !== "margin" ) {
-				val -= parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
-			}
-		} else {
-			// at this point, extra isn't content, so add padding
-			val += parseFloat( curCSS( elem, "padding" + cssExpand[ i ] ) ) || 0;
-
-			// at this point, extra isn't content nor padding, so add border
-			if ( extra !== "padding" ) {
-				val += parseFloat( curCSS( elem, "border" + cssExpand[ i ] + "Width" ) ) || 0;
-			}
-		}
-	}
-
-	return val;
-}
-
-function getWidthOrHeight( elem, name, extra ) {
-
-	// Start with offset property, which is equivalent to the border-box value
-	var val = name === "width" ? elem.offsetWidth : elem.offsetHeight,
-		valueIsBorderBox = true,
-		isBorderBox = jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box";
-
-	// some non-html elements return undefined for offsetWidth, so check for null/undefined
-	// svg - https://bugzilla.mozilla.org/show_bug.cgi?id=649285
-	// MathML - https://bugzilla.mozilla.org/show_bug.cgi?id=491668
-	if ( val <= 0 || val == null ) {
-		// Fall back to computed then uncomputed css if necessary
-		val = curCSS( elem, name );
-		if ( val < 0 || val == null ) {
-			val = elem.style[ name ];
-		}
-
-		// Computed unit is not pixels. Stop here and return.
-		if ( rnumnonpx.test(val) ) {
-			return val;
-		}
-
-		// we need the check for style in case a browser which returns unreliable values
-		// for getComputedStyle silently falls back to the reliable elem.style
-		valueIsBorderBox = isBorderBox && ( jQuery.support.boxSizingReliable || val === elem.style[ name ] );
-
-		// Normalize "", auto, and prepare for extra
-		val = parseFloat( val ) || 0;
-	}
-
-	// use the active box-sizing model to add/subtract irrelevant styles
-	return ( val +
-		augmentWidthOrHeight(
-			elem,
-			name,
-			extra || ( isBorderBox ? "border" : "content" ),
-			valueIsBorderBox
-		)
-	) + "px";
-}
-
-
-// Try to determine the default display value of an element
-function css_defaultDisplay( nodeName ) {
-	if ( elemdisplay[ nodeName ] ) {
-		return elemdisplay[ nodeName ];
-	}
-
-	var elem = jQuery( "<" + nodeName + ">" ).appendTo( document.body ),
-		display = elem.css("display");
-	elem.remove();
-
-	// If the simple way fails,
-	// get element's real default display by attaching it to a temp iframe
-	if ( display === "none" || display === "" ) {
-		// Use the already-created iframe if possible
-		iframe = document.body.appendChild(
-			iframe || jQuery.extend( document.createElement("iframe"), {
-				frameBorder: 0,
-				width: 0,
-				height: 0
-			})
-		);
-
-		// Create a cacheable copy of the iframe document on first call.
-		// IE and Opera will allow us to reuse the iframeDoc without re-writing the fake HTML
-		// document to it; WebKit & Firefox won't allow reusing the iframe document.
-		if ( !iframeDoc || !iframe.createElement ) {
-			iframeDoc = ( iframe.contentWindow || iframe.contentDocument ).document;
-			iframeDoc.write("<!doctype html><html><body>");
-			iframeDoc.close();
-		}
-
-		elem = iframeDoc.body.appendChild( iframeDoc.createElement(nodeName) );
-
-		display = curCSS( elem, "display" );
-		document.body.removeChild( iframe );
-	}
-
-	// Store the correct default display
-	elemdisplay[ nodeName ] = display;
-
-	return display;
-}
-
-jQuery.each([ "height", "width" ], function( i, name ) {
-	jQuery.cssHooks[ name ] = {
-		get: function( elem, computed, extra ) {
-			if ( computed ) {
-				// certain elements can have dimension info if we invisibly show them
-				// however, it must have a current display style that would benefit from this
-				if ( elem.offsetWidth === 0 && rdisplayswap.test( curCSS( elem, "display" ) ) ) {
-					return jQuery.swap( elem, cssShow, function() {
-						return getWidthOrHeight( elem, name, extra );
-					});
-				} else {
-					return getWidthOrHeight( elem, name, extra );
-				}
-			}
-		},
-
-		set: function( elem, value, extra ) {
-			return setPositiveNumber( elem, value, extra ?
-				augmentWidthOrHeight(
-					elem,
-					name,
-					extra,
-					jQuery.support.boxSizing && jQuery.css( elem, "boxSizing" ) === "border-box"
-				) : 0
-			);
-		}
-	};
-});
-
-if ( !jQuery.support.opacity ) {
-	jQuery.cssHooks.opacity = {
-		get: function( elem, computed ) {
-			// IE uses filters for opacity
-			return ropacity.test( (computed && elem.currentStyle ? elem.currentStyle.filter : elem.style.filter) || "" ) ?
-				( 0.01 * parseFloat( RegExp.$1 ) ) + "" :
-				computed ? "1" : "";
-		},
-
-		set: function( elem, value ) {
-			var style = elem.style,
-				currentStyle = elem.currentStyle,
-				opacity = jQuery.isNumeric( value ) ? "alpha(opacity=" + value * 100 + ")" : "",
-				filter = currentStyle && currentStyle.filter || style.filter || "";
-
-			// IE has trouble with opacity if it does not have layout
-			// Force it by setting the zoom level
-			style.zoom = 1;
-
-			// if setting opacity to 1, and no other filters exist - attempt to remove filter attribute #6652
-			if ( value >= 1 && jQuery.trim( filter.replace( ralpha, "" ) ) === "" &&
-				style.removeAttribute ) {
-
-				// Setting style.filter to null, "" & " " still leave "filter:" in the cssText
-				// if "filter:" is present at all, clearType is disabled, we want to avoid this
-				// style.removeAttribute is IE Only, but so apparently is this code path...
-				style.removeAttribute( "filter" );
-
-				// if there there is no filter style applied in a css rule, we are done
-				if ( currentStyle && !currentStyle.filter ) {
-					return;
-				}
-			}
-
-			// otherwise, set new filter values
-			style.filter = ralpha.test( filter ) ?
-				filter.replace( ralpha, opacity ) :
-				filter + " " + opacity;
-		}
-	};
-}
-
-// These hooks cannot be added until DOM ready because the support test
-// for it is not run until after DOM ready
-jQuery(function() {
-	if ( !jQuery.support.reliableMarginRight ) {
-		jQuery.cssHooks.marginRight = {
-			get: function( elem, computed ) {
-				// WebKit Bug 13343 - getComputedStyle returns wrong value for margin-right
-				// Work around by temporarily setting element display to inline-block
-				return jQuery.swap( elem, { "display": "inline-block" }, function() {
-					if ( computed ) {
-						return curCSS( elem, "marginRight" );
-					}
-				});
-			}
-		};
-	}
-
-	// Webkit bug: https://bugs.webkit.org/show_bug.cgi?id=29084
-	// getComputedStyle returns percent when specified for top/left/bottom/right
-	// rather than make the css module depend on the offset module, we just check for it here
-	if ( !jQuery.support.pixelPosition && jQuery.fn.position ) {
-		jQuery.each( [ "top", "left" ], function( i, prop ) {
-			jQuery.cssHooks[ prop ] = {
-				get: function( elem, computed ) {
-					if ( computed ) {
-						var ret = curCSS( elem, prop );
-						// if curCSS returns percentage, fallback to offset
-						return rnumnonpx.test( ret ) ? jQuery( elem ).position()[ prop ] + "px" : ret;
-					}
-				}
-			};
-		});
-	}
-
-});
-
-if ( jQuery.expr && jQuery.expr.filters ) {
-	jQuery.expr.filters.hidden = function( elem ) {
-		return ( elem.offsetWidth === 0 && elem.offsetHeight === 0 ) || (!jQuery.support.reliableHiddenOffsets && ((elem.style && elem.style.display) || curCSS( elem, "display" )) === "none");
-	};
-
-	jQuery.expr.filters.visible = function( elem ) {
-		return !jQuery.expr.filters.hidden( elem );
-	};
-}
-
-// These hooks are used by animate to expand properties
-jQuery.each({
-	margin: "",
-	padding: "",
-	border: "Width"
-}, function( prefix, suffix ) {
-	jQuery.cssHooks[ prefix + suffix ] = {
-		expand: function( value ) {
-			var i,
-
-				// assumes a single number if not a string
-				parts = typeof value === "string" ? value.split(" ") : [ value ],
-				expanded = {};
-
-			for ( i = 0; i < 4; i++ ) {
-				expanded[ prefix + cssExpand[ i ] + suffix ] =
-					parts[ i ] || parts[ i - 2 ] || parts[ 0 ];
-			}
-
-			return expanded;
-		}
-	};
-
-	if ( !rmargin.test( prefix ) ) {
-		jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber;
-	}
-});
-var r20 = /%20/g,
-	rbracket = /\[\]$/,
-	rCRLF = /\r?\n/g,
-	rinput = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
-	rselectTextarea = /^(?:select|textarea)/i;
-
-jQuery.fn.extend({
-	serialize: function() {
-		return jQuery.param( this.serializeArray() );
-	},
-	serializeArray: function() {
-		return this.map(function(){
-			return this.elements ? jQuery.makeArray( this.elements ) : this;
-		})
-		.filter(function(){
-			return this.name && !this.disabled &&
-				( this.checked || rselectTextarea.test( this.nodeName ) ||
-					rinput.test( this.type ) );
-		})
-		.map(function( i, elem ){
-			var val = jQuery( this ).val();
-
-			return val == null ?
-				null :
-				jQuery.isArray( val ) ?
-					jQuery.map( val, function( val, i ){
-						return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-					}) :
-					{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
-		}).get();
-	}
-});
-
-//Serialize an array of form elements or a set of
-//key/values into a query string
-jQuery.param = function( a, traditional ) {
-	var prefix,
-		s = [],
-		add = function( key, value ) {
-			// If value is a function, invoke it and return its value
-			value = jQuery.isFunction( value ) ? value() : ( value == null ? "" : value );
-			s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
-		};
-
-	// Set traditional to true for jQuery <= 1.3.2 behavior.
-	if ( traditional === undefined ) {
-		traditional = jQuery.ajaxSettings && jQuery.ajaxSettings.traditional;
-	}
-
-	// If an array was passed in, assume that it is an array of form elements.
-	if ( jQuery.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) {
-		// Serialize the form elements
-		jQuery.each( a, function() {
-			add( this.name, this.value );
-		});
-
-	} else {
-		// If traditional, encode the "old" way (the way 1.3.2 or older
-		// did it), otherwise encode params recursively.
-		for ( prefix in a ) {
-			buildParams( prefix, a[ prefix ], traditional, add );
-		}
-	}
-
-	// Return the resulting serialization
-	return s.join( "&" ).replace( r20, "+" );
-};
-
-function buildParams( prefix, obj, traditional, add ) {
-	var name;
-
-	if ( jQuery.isArray( obj ) ) {
-		// Serialize array item.
-		jQuery.each( obj, function( i, v ) {
-			if ( traditional || rbracket.test( prefix ) ) {
-				// Treat each array item as a scalar.
-				add( prefix, v );
-
-			} else {
-				// If array item is non-scalar (array or object), encode its
-				// numeric index to resolve deserialization ambiguity issues.
-				// Note that rack (as of 1.0.0) can't currently deserialize
-				// nested arrays properly, and attempting to do so may cause
-				// a server error. Possible fixes are to modify rack's
-				// deserialization algorithm or to provide an option or flag
-				// to force array serialization to be shallow.
-				buildParams( prefix + "[" + ( typeof v === "object" ? i : "" ) + "]", v, traditional, add );
-			}
-		});
-
-	} else if ( !traditional && jQuery.type( obj ) === "object" ) {
-		// Serialize object item.
-		for ( name in obj ) {
-			buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
-		}
-
-	} else {
-		// Serialize scalar item.
-		add( prefix, obj );
-	}
-}
-var
-	// Document location
-	ajaxLocParts,
-	ajaxLocation,
-
-	rhash = /#.*$/,
-	rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
-	// #7653, #8125, #8152: local protocol detection
-	rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
-	rnoContent = /^(?:GET|HEAD)$/,
-	rprotocol = /^\/\//,
-	rquery = /\?/,
-	rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
-	rts = /([?&])_=[^&]*/,
-	rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
-
-	// Keep a copy of the old load method
-	_load = jQuery.fn.load,
-
-	/* Prefilters
-	 * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example)
-	 * 2) These are called:
-	 *    - BEFORE asking for a transport
-	 *    - AFTER param serialization (s.data is a string if s.processData is true)
-	 * 3) key is the dataType
-	 * 4) the catchall symbol "*" can be used
-	 * 5) execution will start with transport dataType and THEN continue down to "*" if needed
-	 */
-	prefilters = {},
-
-	/* Transports bindings
-	 * 1) key is the dataType
-	 * 2) the catchall symbol "*" can be used
-	 * 3) selection will start with transport dataType and THEN go to "*" if needed
-	 */
-	transports = {},
-
-	// Avoid comment-prolog char sequence (#10098); must appease lint and evade compression
-	allTypes = ["*/"] + ["*"];
-
-// #8138, IE may throw an exception when accessing
-// a field from window.location if document.domain has been set
-try {
-	ajaxLocation = location.href;
-} catch( e ) {
-	// Use the href attribute of an A element
-	// since IE will modify it given document.location
-	ajaxLocation = document.createElement( "a" );
-	ajaxLocation.href = "";
-	ajaxLocation = ajaxLocation.href;
-}
-
-// Segment location into parts
-ajaxLocParts = rurl.exec( ajaxLocation.toLowerCase() ) || [];
-
-// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport
-function addToPrefiltersOrTransports( structure ) {
-
-	// dataTypeExpression is optional and defaults to "*"
-	return function( dataTypeExpression, func ) {
-
-		if ( typeof dataTypeExpression !== "string" ) {
-			func = dataTypeExpression;
-			dataTypeExpression = "*";
-		}
-
-		var dataType, list, placeBefore,
-			dataTypes = dataTypeExpression.toLowerCase().split( core_rspace ),
-			i = 0,
-			length = dataTypes.length;
-
-		if ( jQuery.isFunction( func ) ) {
-			// For each dataType in the dataTypeExpression
-			for ( ; i < length; i++ ) {
-				dataType = dataTypes[ i ];
-				// We control if we're asked to add before
-				// any existing element
-				placeBefore = /^\+/.test( dataType );
-				if ( placeBefore ) {
-					dataType = dataType.substr( 1 ) || "*";
-				}
-				list = structure[ dataType ] = structure[ dataType ] || [];
-				// then we add to the structure accordingly
-				list[ placeBefore ? "unshift" : "push" ]( func );
-			}
-		}
-	};
-}
-
-// Base inspection function for prefilters and transports
-function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR,
-		dataType /* internal */, inspected /* internal */ ) {
-
-	dataType = dataType || options.dataTypes[ 0 ];
-	inspected = inspected || {};
-
-	inspected[ dataType ] = true;
-
-	var selection,
-		list = structure[ dataType ],
-		i = 0,
-		length = list ? list.length : 0,
-		executeOnly = ( structure === prefilters );
-
-	for ( ; i < length && ( executeOnly || !selection ); i++ ) {
-		selection = list[ i ]( options, originalOptions, jqXHR );
-		// If we got redirected to another dataType
-		// we try there if executing only and not done already
-		if ( typeof selection === "string" ) {
-			if ( !executeOnly || inspected[ selection ] ) {
-				selection = undefined;
-			} else {
-				options.dataTypes.unshift( selection );
-				selection = inspectPrefiltersOrTransports(
-						structure, options, originalOptions, jqXHR, selection, inspected );
-			}
-		}
-	}
-	// If we're only executing or nothing was selected
-	// we try the catchall dataType if not done already
-	if ( ( executeOnly || !selection ) && !inspected[ "*" ] ) {
-		selection = inspectPrefiltersOrTransports(
-				structure, options, originalOptions, jqXHR, "*", inspected );
-	}
-	// unnecessary when only executing (prefilters)
-	// but it'll be ignored by the caller in that case
-	return selection;
-}
-
-// A special extend for ajax options
-// that takes "flat" options (not to be deep extended)
-// Fixes #9887
-function ajaxExtend( target, src ) {
-	var key, deep,
-		flatOptions = jQuery.ajaxSettings.flatOptions || {};
-	for ( key in src ) {
-		if ( src[ key ] !== undefined ) {
-			( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ];
-		}
-	}
-	if ( deep ) {
-		jQuery.extend( true, target, deep );
-	}
-}
-
-jQuery.fn.load = function( url, params, callback ) {
-	if ( typeof url !== "string" && _load ) {
-		return _load.apply( this, arguments );
-	}
-
-	// Don't do a request if no elements are being requested
-	if ( !this.length ) {
-		return this;
-	}
-
-	var selector, type, response,
-		self = this,
-		off = url.indexOf(" ");
-
-	if ( off >= 0 ) {
-		selector = url.slice( off, url.length );
-		url = url.slice( 0, off );
-	}
-
-	// If it's a function
-	if ( jQuery.isFunction( params ) ) {
-
-		// We assume that it's the callback
-		callback = params;
-		params = undefined;
-
-	// Otherwise, build a param string
-	} else if ( params && typeof params === "object" ) {
-		type = "POST";
-	}
-
-	// Request the remote document
-	jQuery.ajax({
-		url: url,
-
-		// if "type" variable is undefined, then "GET" method will be used
-		type: type,
-		dataType: "html",
-		data: params,
-		complete: function( jqXHR, status ) {
-			if ( callback ) {
-				self.each( callback, response || [ jqXHR.responseText, status, jqXHR ] );
-			}
-		}
-	}).done(function( responseText ) {
-
-		// Save response for use in complete callback
-		response = arguments;
-
-		// See if a selector was specified
-		self.html( selector ?
-
-			// Create a dummy div to hold the results
-			jQuery("<div>")
-
-				// inject the contents of the document in, removing the scripts
-				// to avoid any 'Permission Denied' errors in IE
-				.append( responseText.replace( rscript, "" ) )
-
-				// Locate the specified elements
-				.find( selector ) :
-
-			// If not, just inject the full result
-			responseText );
-
-	});
-
-	return this;
-};
-
-// Attach a bunch of functions for handling common AJAX events
-jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
-	jQuery.fn[ o ] = function( f ){
-		return this.on( o, f );
-	};
-});
-
-jQuery.each( [ "get", "post" ], function( i, method ) {
-	jQuery[ method ] = function( url, data, callback, type ) {
-		// shift arguments if data argument was omitted
-		if ( jQuery.isFunction( data ) ) {
-			type = type || callback;
-			callback = data;
-			data = undefined;
-		}
-
-		return jQuery.ajax({
-			type: method,
-			url: url,
-			data: data,
-			success: callback,
-			dataType: type
-		});
-	};
-});
-
-jQuery.extend({
-
-	getScript: function( url, callback ) {
-		return jQuery.get( url, undefined, callback, "script" );
-	},
-
-	getJSON: function( url, data, callback ) {
-		return jQuery.get( url, data, callback, "json" );
-	},
-
-	// Creates a full fledged settings object into target
-	// with both ajaxSettings and settings fields.
-	// If target is omitted, writes into ajaxSettings.
-	ajaxSetup: function( target, settings ) {
-		if ( settings ) {
-			// Building a settings object
-			ajaxExtend( target, jQuery.ajaxSettings );
-		} else {
-			// Extending ajaxSettings
-			settings = target;
-			target = jQuery.ajaxSettings;
-		}
-		ajaxExtend( target, settings );
-		return target;
-	},
-
-	ajaxSettings: {
-		url: ajaxLocation,
-		isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
-		global: true,
-		type: "GET",
-		contentType: "application/x-www-form-urlencoded; charset=UTF-8",
-		processData: true,
-		async: true,
-		/*
-		timeout: 0,
-		data: null,
-		dataType: null,
-		username: null,
-		password: null,
-		cache: null,
-		throws: false,
-		traditional: false,
-		headers: {},
-		*/
-
-		accepts: {
-			xml: "application/xml, text/xml",
-			html: "text/html",
-			text: "text/plain",
-			json: "application/json, text/javascript",
-			"*": allTypes
-		},
-
-		contents: {
-			xml: /xml/,
-			html: /html/,
-			json: /json/
-		},
-
-		responseFields: {
-			xml: "responseXML",
-			text: "responseText"
-		},
-
-		// List of data converters
-		// 1) key format is "source_type destination_type" (a single space in-between)
-		// 2) the catchall symbol "*" can be used for source_type
-		converters: {
-
-			// Convert anything to text
-			"* text": window.String,
-
-			// Text to html (true = no transformation)
-			"text html": true,
-
-			// Evaluate text as a json expression
-			"text json": jQuery.parseJSON,
-
-			// Parse text as xml
-			"text xml": jQuery.parseXML
-		},
-
-		// For options that shouldn't be deep extended:
-		// you can add your own custom options here if
-		// and when you create one that shouldn't be
-		// deep extended (see ajaxExtend)
-		flatOptions: {
-			context: true,
-			url: true
-		}
-	},
-
-	ajaxPrefilter: addToPrefiltersOrTransports( prefilters ),
-	ajaxTransport: addToPrefiltersOrTransports( transports ),
-
-	// Main method
-	ajax: function( url, options ) {
-
-		// If url is an object, simulate pre-1.5 signature
-		if ( typeof url === "object" ) {
-			options = url;
-			url = undefined;
-		}
-
-		// Force options to be an object
-		options = options || {};
-
-		var // ifModified key
-			ifModifiedKey,
-			// Response headers
-			responseHeadersString,
-			responseHeaders,
-			// transport
-			transport,
-			// timeout handle
-			timeoutTimer,
-			// Cross-domain detection vars
-			parts,
-			// To know if global events are to be dispatched
-			fireGlobals,
-			// Loop variable
-			i,
-			// Create the final options object
-			s = jQuery.ajaxSetup( {}, options ),
-			// Callbacks context
-			callbackContext = s.context || s,
-			// Context for global events
-			// It's the callbackContext if one was provided in the options
-			// and if it's a DOM node or a jQuery collection
-			globalEventContext = callbackContext !== s &&
-				( callbackContext.nodeType || callbackContext instanceof jQuery ) ?
-						jQuery( callbackContext ) : jQuery.event,
-			// Deferreds
-			deferred = jQuery.Deferred(),
-			completeDeferred = jQuery.Callbacks( "once memory" ),
-			// Status-dependent callbacks
-			statusCode = s.statusCode || {},
-			// Headers (they are sent all at once)
-			requestHeaders = {},
-			requestHeadersNames = {},
-			// The jqXHR state
-			state = 0,
-			// Default abort message
-			strAbort = "canceled",
-			// Fake xhr
-			jqXHR = {
-
-				readyState: 0,
-
-				// Caches the header
-				setRequestHeader: function( name, value ) {
-					if ( !state ) {
-						var lname = name.toLowerCase();
-						name = requestHeadersNames[ lname ] = requestHeadersNames[ lname ] || name;
-						requestHeaders[ name ] = value;
-					}
-					return this;
-				},
-
-				// Raw string
-				getAllResponseHeaders: function() {
-					return state === 2 ? responseHeadersString : null;
-				},
-
-				// Builds headers hashtable if needed
-				getResponseHeader: function( key ) {
-					var match;
-					if ( state === 2 ) {
-						if ( !responseHeaders ) {
-							responseHeaders = {};
-							while( ( match = rheaders.exec( responseHeadersString ) ) ) {
-								responseHeaders[ match[1].toLowerCase() ] = match[ 2 ];
-							}
-						}
-						match = responseHeaders[ key.toLowerCase() ];
-					}
-					return match === undefined ? null : match;
-				},
-
-				// Overrides response content-type header
-				overrideMimeType: function( type ) {
-					if ( !state ) {
-						s.mimeType = type;
-					}
-					return this;
-				},
-
-				// Cancel the request
-				abort: function( statusText ) {
-					statusText = statusText || strAbort;
-					if ( transport ) {
-						transport.abort( statusText );
-					}
-					done( 0, statusText );
-					return this;
-				}
-			};
-
-		// Callback for when everything is done
-		// It is defined here because jslint complains if it is declared
-		// at the end of the function (which would be more logical and readable)
-		function done( status, nativeStatusText, responses, headers ) {
-			var isSuccess, success, error, response, modified,
-				statusText = nativeStatusText;
-
-			// Called once
-			if ( state === 2 ) {
-				return;
-			}
-
-			// State is "done" now
-			state = 2;
-
-			// Clear timeout if it exists
-			if ( timeoutTimer ) {
-				clearTimeout( timeoutTimer );
-			}
-
-			// Dereference transport for early garbage collection
-			// (no matter how long the jqXHR object will be used)
-			transport = undefined;
-
-			// Cache response headers
-			responseHeadersString = headers || "";
-
-			// Set readyState
-			jqXHR.readyState = status > 0 ? 4 : 0;
-
-			// Get response data
-			if ( responses ) {
-				response = ajaxHandleResponses( s, jqXHR, responses );
-			}
-
-			// If successful, handle type chaining
-			if ( status >= 200 && status < 300 || status === 304 ) {
-
-				// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-				if ( s.ifModified ) {
-
-					modified = jqXHR.getResponseHeader("Last-Modified");
-					if ( modified ) {
-						jQuery.lastModified[ ifModifiedKey ] = modified;
-					}
-					modified = jqXHR.getResponseHeader("Etag");
-					if ( modified ) {
-						jQuery.etag[ ifModifiedKey ] = modified;
-					}
-				}
-
-				// If not modified
-				if ( status === 304 ) {
-
-					statusText = "notmodified";
-					isSuccess = true;
-
-				// If we have data
-				} else {
-
-					isSuccess = ajaxConvert( s, response );
-					statusText = isSuccess.state;
-					success = isSuccess.data;
-					error = isSuccess.error;
-					isSuccess = !error;
-				}
-			} else {
-				// We extract error from statusText
-				// then normalize statusText and status for non-aborts
-				error = statusText;
-				if ( !statusText || status ) {
-					statusText = "error";
-					if ( status < 0 ) {
-						status = 0;
-					}
-				}
-			}
-
-			// Set data for the fake xhr object
-			jqXHR.status = status;
-			jqXHR.statusText = ( nativeStatusText || statusText ) + "";
-
-			// Success/Error
-			if ( isSuccess ) {
-				deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] );
-			} else {
-				deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] );
-			}
-
-			// Status-dependent callbacks
-			jqXHR.statusCode( statusCode );
-			statusCode = undefined;
-
-			if ( fireGlobals ) {
-				globalEventContext.trigger( "ajax" + ( isSuccess ? "Success" : "Error" ),
-						[ jqXHR, s, isSuccess ? success : error ] );
-			}
-
-			// Complete
-			completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] );
-
-			if ( fireGlobals ) {
-				globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] );
-				// Handle the global AJAX counter
-				if ( !( --jQuery.active ) ) {
-					jQuery.event.trigger( "ajaxStop" );
-				}
-			}
-		}
-
-		// Attach deferreds
-		deferred.promise( jqXHR );
-		jqXHR.success = jqXHR.done;
-		jqXHR.error = jqXHR.fail;
-		jqXHR.complete = completeDeferred.add;
-
-		// Status-dependent callbacks
-		jqXHR.statusCode = function( map ) {
-			if ( map ) {
-				var tmp;
-				if ( state < 2 ) {
-					for ( tmp in map ) {
-						statusCode[ tmp ] = [ statusCode[tmp], map[tmp] ];
-					}
-				} else {
-					tmp = map[ jqXHR.status ];
-					jqXHR.always( tmp );
-				}
-			}
-			return this;
-		};
-
-		// Remove hash character (#7531: and string promotion)
-		// Add protocol if not provided (#5866: IE7 issue with protocol-less urls)
-		// We also use the url parameter if available
-		s.url = ( ( url || s.url ) + "" ).replace( rhash, "" ).replace( rprotocol, ajaxLocParts[ 1 ] + "//" );
-
-		// Extract dataTypes list
-		s.dataTypes = jQuery.trim( s.dataType || "*" ).toLowerCase().split( core_rspace );
-
-		// A cross-domain request is in order when we have a protocol:host:port mismatch
-		if ( s.crossDomain == null ) {
-			parts = rurl.exec( s.url.toLowerCase() );
-			s.crossDomain = !!( parts &&
-				( parts[ 1 ] !== ajaxLocParts[ 1 ] || parts[ 2 ] !== ajaxLocParts[ 2 ] ||
-					( parts[ 3 ] || ( parts[ 1 ] === "http:" ? 80 : 443 ) ) !=
-						( ajaxLocParts[ 3 ] || ( ajaxLocParts[ 1 ] === "http:" ? 80 : 443 ) ) )
-			);
-		}
-
-		// Convert data if not already a string
-		if ( s.data && s.processData && typeof s.data !== "string" ) {
-			s.data = jQuery.param( s.data, s.traditional );
-		}
-
-		// Apply prefilters
-		inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
-
-		// If request was aborted inside a prefilter, stop there
-		if ( state === 2 ) {
-			return jqXHR;
-		}
-
-		// We can fire global events as of now if asked to
-		fireGlobals = s.global;
-
-		// Uppercase the type
-		s.type = s.type.toUpperCase();
-
-		// Determine if request has content
-		s.hasContent = !rnoContent.test( s.type );
-
-		// Watch for a new set of requests
-		if ( fireGlobals && jQuery.active++ === 0 ) {
-			jQuery.event.trigger( "ajaxStart" );
-		}
-
-		// More options handling for requests with no content
-		if ( !s.hasContent ) {
-
-			// If data is available, append data to url
-			if ( s.data ) {
-				s.url += ( rquery.test( s.url ) ? "&" : "?" ) + s.data;
-				// #9682: remove data so that it's not used in an eventual retry
-				delete s.data;
-			}
-
-			// Get ifModifiedKey before adding the anti-cache parameter
-			ifModifiedKey = s.url;
-
-			// Add anti-cache in url if needed
-			if ( s.cache === false ) {
-
-				var ts = jQuery.now(),
-					// try replacing _= if it is there
-					ret = s.url.replace( rts, "$1_=" + ts );
-
-				// if nothing was replaced, add timestamp to the end
-				s.url = ret + ( ( ret === s.url ) ? ( rquery.test( s.url ) ? "&" : "?" ) + "_=" + ts : "" );
-			}
-		}
-
-		// Set the correct header, if data is being sent
-		if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) {
-			jqXHR.setRequestHeader( "Content-Type", s.contentType );
-		}
-
-		// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-		if ( s.ifModified ) {
-			ifModifiedKey = ifModifiedKey || s.url;
-			if ( jQuery.lastModified[ ifModifiedKey ] ) {
-				jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ ifModifiedKey ] );
-			}
-			if ( jQuery.etag[ ifModifiedKey ] ) {
-				jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ ifModifiedKey ] );
-			}
-		}
-
-		// Set the Accepts header for the server, depending on the dataType
-		jqXHR.setRequestHeader(
-			"Accept",
-			s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[0] ] ?
-				s.accepts[ s.dataTypes[0] ] + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) :
-				s.accepts[ "*" ]
-		);
-
-		// Check for headers option
-		for ( i in s.headers ) {
-			jqXHR.setRequestHeader( i, s.headers[ i ] );
-		}
-
-		// Allow custom headers/mimetypes and early abort
-		if ( s.beforeSend && ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || state === 2 ) ) {
-				// Abort if not done already and return
-				return jqXHR.abort();
-
-		}
-
-		// aborting is no longer a cancellation
-		strAbort = "abort";
-
-		// Install callbacks on deferreds
-		for ( i in { success: 1, error: 1, complete: 1 } ) {
-			jqXHR[ i ]( s[ i ] );
-		}
-
-		// Get transport
-		transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR );
-
-		// If no transport, we auto-abort
-		if ( !transport ) {
-			done( -1, "No Transport" );
-		} else {
-			jqXHR.readyState = 1;
-			// Send global event
-			if ( fireGlobals ) {
-				globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] );
-			}
-			// Timeout
-			if ( s.async && s.timeout > 0 ) {
-				timeoutTimer = setTimeout( function(){
-					jqXHR.abort( "timeout" );
-				}, s.timeout );
-			}
-
-			try {
-				state = 1;
-				transport.send( requestHeaders, done );
-			} catch (e) {
-				// Propagate exception as error if not done
-				if ( state < 2 ) {
-					done( -1, e );
-				// Simply rethrow otherwise
-				} else {
-					throw e;
-				}
-			}
-		}
-
-		return jqXHR;
-	},
-
-	// Counter for holding the number of active queries
-	active: 0,
-
-	// Last-Modified header cache for next request
-	lastModified: {},
-	etag: {}
-
-});
-
-/* Handles responses to an ajax request:
- * - sets all responseXXX fields accordingly
- * - finds the right dataType (mediates between content-type and expected dataType)
- * - returns the corresponding response
- */
-function ajaxHandleResponses( s, jqXHR, responses ) {
-
-	var ct, type, finalDataType, firstDataType,
-		contents = s.contents,
-		dataTypes = s.dataTypes,
-		responseFields = s.responseFields;
-
-	// Fill responseXXX fields
-	for ( type in responseFields ) {
-		if ( type in responses ) {
-			jqXHR[ responseFields[type] ] = responses[ type ];
-		}
-	}
-
-	// Remove auto dataType and get content-type in the process
-	while( dataTypes[ 0 ] === "*" ) {
-		dataTypes.shift();
-		if ( ct === undefined ) {
-			ct = s.mimeType || jqXHR.getResponseHeader( "content-type" );
-		}
-	}
-
-	// Check if we're dealing with a known content-type
-	if ( ct ) {
-		for ( type in contents ) {
-			if ( contents[ type ] && contents[ type ].test( ct ) ) {
-				dataTypes.unshift( type );
-				break;
-			}
-		}
-	}
-
-	// Check to see if we have a response for the expected dataType
-	if ( dataTypes[ 0 ] in responses ) {
-		finalDataType = dataTypes[ 0 ];
-	} else {
-		// Try convertible dataTypes
-		for ( type in responses ) {
-			if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[0] ] ) {
-				finalDataType = type;
-				break;
-			}
-			if ( !firstDataType ) {
-				firstDataType = type;
-			}
-		}
-		// Or just use first one
-		finalDataType = finalDataType || firstDataType;
-	}
-
-	// If we found a dataType
-	// We add the dataType to the list if needed
-	// and return the corresponding response
-	if ( finalDataType ) {
-		if ( finalDataType !== dataTypes[ 0 ] ) {
-			dataTypes.unshift( finalDataType );
-		}
-		return responses[ finalDataType ];
-	}
-}
-
-// Chain conversions given the request and the original response
-function ajaxConvert( s, response ) {
-
-	var conv, conv2, current, tmp,
-		// Work with a copy of dataTypes in case we need to modify it for conversion
-		dataTypes = s.dataTypes.slice(),
-		prev = dataTypes[ 0 ],
-		converters = {},
-		i = 0;
-
-	// Apply the dataFilter if provided
-	if ( s.dataFilter ) {
-		response = s.dataFilter( response, s.dataType );
-	}
-
-	// Create converters map with lowercased keys
-	if ( dataTypes[ 1 ] ) {
-		for ( conv in s.converters ) {
-			converters[ conv.toLowerCase() ] = s.converters[ conv ];
-		}
-	}
-
-	// Convert to each sequential dataType, tolerating list modification
-	for ( ; (current = dataTypes[++i]); ) {
-
-		// There's only work to do if current dataType is non-auto
-		if ( current !== "*" ) {
-
-			// Convert response if prev dataType is non-auto and differs from current
-			if ( prev !== "*" && prev !== current ) {
-
-				// Seek a direct converter
-				conv = converters[ prev + " " + current ] || converters[ "* " + current ];
-
-				// If none found, seek a pair
-				if ( !conv ) {
-					for ( conv2 in converters ) {
-
-						// If conv2 outputs current
-						tmp = conv2.split(" ");
-						if ( tmp[ 1 ] === current ) {
-
-							// If prev can be converted to accepted input
-							conv = converters[ prev + " " + tmp[ 0 ] ] ||
-								converters[ "* " + tmp[ 0 ] ];
-							if ( conv ) {
-								// Condense equivalence converters
-								if ( conv === true ) {
-									conv = converters[ conv2 ];
-
-								// Otherwise, insert the intermediate dataType
-								} else if ( converters[ conv2 ] !== true ) {
-									current = tmp[ 0 ];
-									dataTypes.splice( i--, 0, current );
-								}
-
-								break;
-							}
-						}
-					}
-				}
-
-				// Apply converter (if not an equivalence)
-				if ( conv !== true ) {
-
-					// Unless errors are allowed to bubble, catch and return them
-					if ( conv && s["throws"] ) {
-						response = conv( response );
-					} else {
-						try {
-							response = conv( response );
-						} catch ( e ) {
-							return { state: "parsererror", error: conv ? e : "No conversion from " + prev + " to " + current };
-						}
-					}
-				}
-			}
-
-			// Update prev for next iteration
-			prev = current;
-		}
-	}
-
-	return { state: "success", data: response };
-}
-var oldCallbacks = [],
-	rquestion = /\?/,
-	rjsonp = /(=)\?(?=&|$)|\?\?/,
-	nonce = jQuery.now();
-
-// Default jsonp settings
-jQuery.ajaxSetup({
-	jsonp: "callback",
-	jsonpCallback: function() {
-		var callback = oldCallbacks.pop() || ( jQuery.expando + "_" + ( nonce++ ) );
-		this[ callback ] = true;
-		return callback;
-	}
-});
-
-// Detect, normalize options and install callbacks for jsonp requests
-jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
-
-	var callbackName, overwritten, responseContainer,
-		data = s.data,
-		url = s.url,
-		hasCallback = s.jsonp !== false,
-		replaceInUrl = hasCallback && rjsonp.test( url ),
-		replaceInData = hasCallback && !replaceInUrl && typeof data === "string" &&
-			!( s.contentType || "" ).indexOf("application/x-www-form-urlencoded") &&
-			rjsonp.test( data );
-
-	// Handle iff the expected data type is "jsonp" or we have a parameter to set
-	if ( s.dataTypes[ 0 ] === "jsonp" || replaceInUrl || replaceInData ) {
-
-		// Get callback name, remembering preexisting value associated with it
-		callbackName = s.jsonpCallback = jQuery.isFunction( s.jsonpCallback ) ?
-			s.jsonpCallback() :
-			s.jsonpCallback;
-		overwritten = window[ callbackName ];
-
-		// Insert callback into url or form data
-		if ( replaceInUrl ) {
-			s.url = url.replace( rjsonp, "$1" + callbackName );
-		} else if ( replaceInData ) {
-			s.data = data.replace( rjsonp, "$1" + callbackName );
-		} else if ( hasCallback ) {
-			s.url += ( rquestion.test( url ) ? "&" : "?" ) + s.jsonp + "=" + callbackName;
-		}
-
-		// Use data converter to retrieve json after script execution
-		s.converters["script json"] = function() {
-			if ( !responseContainer ) {
-				jQuery.error( callbackName + " was not called" );
-			}
-			return responseContainer[ 0 ];
-		};
-
-		// force json dataType
-		s.dataTypes[ 0 ] = "json";
-
-		// Install callback
-		window[ callbackName ] = function() {
-			responseContainer = arguments;
-		};
-
-		// Clean-up function (fires after converters)
-		jqXHR.always(function() {
-			// Restore preexisting value
-			window[ callbackName ] = overwritten;
-
-			// Save back as free
-			if ( s[ callbackName ] ) {
-				// make sure that re-using the options doesn't screw things around
-				s.jsonpCallback = originalSettings.jsonpCallback;
-
-				// save the callback name for future use
-				oldCallbacks.push( callbackName );
-			}
-
-			// Call if it was a function and we have a response
-			if ( responseContainer && jQuery.isFunction( overwritten ) ) {
-				overwritten( responseContainer[ 0 ] );
-			}
-
-			responseContainer = overwritten = undefined;
-		});
-
-		// Delegate to script
-		return "script";
-	}
-});
-// Install script dataType
-jQuery.ajaxSetup({
-	accepts: {
-		script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
-	},
-	contents: {
-		script: /javascript|ecmascript/
-	},
-	converters: {
-		"text script": function( text ) {
-			jQuery.globalEval( text );
-			return text;
-		}
-	}
-});
-
-// Handle cache's special case and global
-jQuery.ajaxPrefilter( "script", function( s ) {
-	if ( s.cache === undefined ) {
-		s.cache = false;
-	}
-	if ( s.crossDomain ) {
-		s.type = "GET";
-		s.global = false;
-	}
-});
-
-// Bind script tag hack transport
-jQuery.ajaxTransport( "script", function(s) {
-
-	// This transport only deals with cross domain requests
-	if ( s.crossDomain ) {
-
-		var script,
-			head = document.head || document.getElementsByTagName( "head" )[0] || document.documentElement;
-
-		return {
-
-			send: function( _, callback ) {
-
-				script = document.createElement( "script" );
-
-				script.async = "async";
-
-				if ( s.scriptCharset ) {
-					script.charset = s.scriptCharset;
-				}
-
-				script.src = s.url;
-
-				// Attach handlers for all browsers
-				script.onload = script.onreadystatechange = function( _, isAbort ) {
-
-					if ( isAbort || !script.readyState || /loaded|complete/.test( script.readyState ) ) {
-
-						// Handle memory leak in IE
-						script.onload = script.onreadystatechange = null;
-
-						// Remove the script
-						if ( head && script.parentNode ) {
-							head.removeChild( script );
-						}
-
-						// Dereference the script
-						script = undefined;
-
-						// Callback if not abort
-						if ( !isAbort ) {
-							callback( 200, "success" );
-						}
-					}
-				};
-				// Use insertBefore instead of appendChild  to circumvent an IE6 bug.
-				// This arises when a base node is used (#2709 and #4378).
-				head.insertBefore( script, head.firstChild );
-			},
-
-			abort: function() {
-				if ( script ) {
-					script.onload( 0, 1 );
-				}
-			}
-		};
-	}
-});
-var xhrCallbacks,
-	// #5280: Internet Explorer will keep connections alive if we don't abort on unload
-	xhrOnUnloadAbort = window.ActiveXObject ? function() {
-		// Abort all pending requests
-		for ( var key in xhrCallbacks ) {
-			xhrCallbacks[ key ]( 0, 1 );
-		}
-	} : false,
-	xhrId = 0;
-
-// Functions to create xhrs
-function createStandardXHR() {
-	try {
-		return new window.XMLHttpRequest();
-	} catch( e ) {}
-}
-
-function createActiveXHR() {
-	try {
-		return new window.ActiveXObject( "Microsoft.XMLHTTP" );
-	} catch( e ) {}
-}
-
-// Create the request object
-// (This is still attached to ajaxSettings for backward compatibility)
-jQuery.ajaxSettings.xhr = window.ActiveXObject ?
-	/* Microsoft failed to properly
-	 * implement the XMLHttpRequest in IE7 (can't request local files),
-	 * so we use the ActiveXObject when it is available
-	 * Additionally XMLHttpRequest can be disabled in IE7/IE8 so
-	 * we need a fallback.
-	 */
-	function() {
-		return !this.isLocal && createStandardXHR() || createActiveXHR();
-	} :
-	// For all other browsers, use the standard XMLHttpRequest object
-	createStandardXHR;
-
-// Determine support properties
-(function( xhr ) {
-	jQuery.extend( jQuery.support, {
-		ajax: !!xhr,
-		cors: !!xhr && ( "withCredentials" in xhr )
-	});
-})( jQuery.ajaxSettings.xhr() );
-
-// Create transport if the browser can provide an xhr
-if ( jQuery.support.ajax ) {
-
-	jQuery.ajaxTransport(function( s ) {
-		// Cross domain only allowed if supported through XMLHttpRequest
-		if ( !s.crossDomain || jQuery.support.cors ) {
-
-			var callback;
-
-			return {
-				send: function( headers, complete ) {
-
-					// Get a new xhr
-					var handle, i,
-						xhr = s.xhr();
-
-					// Open the socket
-					// Passing null username, generates a login popup on Opera (#2865)
-					if ( s.username ) {
-						xhr.open( s.type, s.url, s.async, s.username, s.password );
-					} else {
-						xhr.open( s.type, s.url, s.async );
-					}
-
-					// Apply custom fields if provided
-					if ( s.xhrFields ) {
-						for ( i in s.xhrFields ) {
-							xhr[ i ] = s.xhrFields[ i ];
-						}
-					}
-
-					// Override mime type if needed
-					if ( s.mimeType && xhr.overrideMimeType ) {
-						xhr.overrideMimeType( s.mimeType );
-					}
-
-					// X-Requested-With header
-					// For cross-domain requests, seeing as conditions for a preflight are
-					// akin to a jigsaw puzzle, we simply never set it to be sure.
-					// (it can always be set on a per-request basis or even using ajaxSetup)
-					// For same-domain requests, won't change header if already provided.
-					if ( !s.crossDomain && !headers["X-Requested-With"] ) {
-						headers[ "X-Requested-With" ] = "XMLHttpRequest";
-					}
-
-					// Need an extra try/catch for cross domain requests in Firefox 3
-					try {
-						for ( i in headers ) {
-							xhr.setRequestHeader( i, headers[ i ] );
-						}
-					} catch( _ ) {}
-
-					// Do send the request
-					// This may raise an exception which is actually
-					// handled in jQuery.ajax (so no try/catch here)
-					xhr.send( ( s.hasContent && s.data ) || null );
-
-					// Listener
-					callback = function( _, isAbort ) {
-
-						var status,
-							statusText,
-							responseHeaders,
-							responses,
-							xml;
-
-						// Firefox throws exceptions when accessing properties
-						// of an xhr when a network error occurred
-						// http://helpful.knobs-dials.com/index.php/Component_returned_failure_code:_0x80040111_(NS_ERROR_NOT_AVAILABLE)
-						try {
-
-							// Was never called and is aborted or complete
-							if ( callback && ( isAbort || xhr.readyState === 4 ) ) {
-
-								// Only called once
-								callback = undefined;
-
-								// Do not keep as active anymore
-								if ( handle ) {
-									xhr.onreadystatechange = jQuery.noop;
-									if ( xhrOnUnloadAbort ) {
-										delete xhrCallbacks[ handle ];
-									}
-								}
-
-								// If it's an abort
-								if ( isAbort ) {
-									// Abort it manually if needed
-									if ( xhr.readyState !== 4 ) {
-										xhr.abort();
-									}
-								} else {
-									status = xhr.status;
-									responseHeaders = xhr.getAllResponseHeaders();
-									responses = {};
-									xml = xhr.responseXML;
-
-									// Construct response list
-									if ( xml && xml.documentElement /* #4958 */ ) {
-										responses.xml = xml;
-									}
-
-									// When requesting binary data, IE6-9 will throw an exception
-									// on any attempt to access responseText (#11426)
-									try {
-										responses.text = xhr.responseText;
-									} catch( e ) {
-									}
-
-									// Firefox throws an exception when accessing
-									// statusText for faulty cross-domain requests
-									try {
-										statusText = xhr.statusText;
-									} catch( e ) {
-										// We normalize with Webkit giving an empty statusText
-										statusText = "";
-									}
-
-									// Filter status for non standard behaviors
-
-									// If the request is local and we have data: assume a success
-									// (success with no data won't get notified, that's the best we
-									// can do given current implementations)
-									if ( !status && s.isLocal && !s.crossDomain ) {
-										status = responses.text ? 200 : 404;
-									// IE - #1450: sometimes returns 1223 when it should be 204
-									} else if ( status === 1223 ) {
-										status = 204;
-									}
-								}
-							}
-						} catch( firefoxAccessException ) {
-							if ( !isAbort ) {
-								complete( -1, firefoxAccessException );
-							}
-						}
-
-						// Call complete if needed
-						if ( responses ) {
-							complete( status, statusText, responses, responseHeaders );
-						}
-					};
-
-					if ( !s.async ) {
-						// if we're in sync mode we fire the callback
-						callback();
-					} else if ( xhr.readyState === 4 ) {
-						// (IE6 & IE7) if it's in cache and has been
-						// retrieved directly we need to fire the callback
-						setTimeout( callback, 0 );
-					} else {
-						handle = ++xhrId;
-						if ( xhrOnUnloadAbort ) {
-							// Create the active xhrs callbacks list if needed
-							// and attach the unload handler
-							if ( !xhrCallbacks ) {
-								xhrCallbacks = {};
-								jQuery( window ).unload( xhrOnUnloadAbort );
-							}
-							// Add to list of active xhrs callbacks
-							xhrCallbacks[ handle ] = callback;
-						}
-						xhr.onreadystatechange = callback;
-					}
-				},
-
-				abort: function() {
-					if ( callback ) {
-						callback(0,1);
-					}
-				}
-			};
-		}
-	});
-}
-var fxNow, timerId,
-	rfxtypes = /^(?:toggle|show|hide)$/,
-	rfxnum = new RegExp( "^(?:([-+])=|)(" + core_pnum + ")([a-z%]*)$", "i" ),
-	rrun = /queueHooks$/,
-	animationPrefilters = [ defaultPrefilter ],
-	tweeners = {
-		"*": [function( prop, value ) {
-			var end, unit,
-				tween = this.createTween( prop, value ),
-				parts = rfxnum.exec( value ),
-				target = tween.cur(),
-				start = +target || 0,
-				scale = 1,
-				maxIterations = 20;
-
-			if ( parts ) {
-				end = +parts[2];
-				unit = parts[3] || ( jQuery.cssNumber[ prop ] ? "" : "px" );
-
-				// We need to compute starting value
-				if ( unit !== "px" && start ) {
-					// Iteratively approximate from a nonzero starting point
-					// Prefer the current property, because this process will be trivial if it uses the same units
-					// Fallback to end or a simple constant
-					start = jQuery.css( tween.elem, prop, true ) || end || 1;
-
-					do {
-						// If previous iteration zeroed out, double until we get *something*
-						// Use a string for doubling factor so we don't accidentally see scale as unchanged below
-						scale = scale || ".5";
-
-						// Adjust and apply
-						start = start / scale;
-						jQuery.style( tween.elem, prop, start + unit );
-
-					// Update scale, tolerating zero or NaN from tween.cur()
-					// And breaking the loop if scale is unchanged or perfect, or if we've just had enough
-					} while ( scale !== (scale = tween.cur() / target) && scale !== 1 && --maxIterations );
-				}
-
-				tween.unit = unit;
-				tween.start = start;
-				// If a +=/-= token was provided, we're doing a relative animation
-				tween.end = parts[1] ? start + ( parts[1] + 1 ) * end : end;
-			}
-			return tween;
-		}]
-	};
-
-// Animations created synchronously will run synchronously
-function createFxNow() {
-	setTimeout(function() {
-		fxNow = undefined;
-	}, 0 );
-	return ( fxNow = jQuery.now() );
-}
-
-function createTweens( animation, props ) {
-	jQuery.each( props, function( prop, value ) {
-		var collection = ( tweeners[ prop ] || [] ).concat( tweeners[ "*" ] ),
-			index = 0,
-			length = collection.length;
-		for ( ; index < length; index++ ) {
-			if ( collection[ index ].call( animation, prop, value ) ) {
-
-				// we're done with this property
-				return;
-			}
-		}
-	});
-}
-
-function Animation( elem, properties, options ) {
-	var result,
-		index = 0,
-		tweenerIndex = 0,
-		length = animationPrefilters.length,
-		deferred = jQuery.Deferred().always( function() {
-			// don't match elem in the :animated selector
-			delete tick.elem;
-		}),
-		tick = function() {
-			var currentTime = fxNow || createFxNow(),
-				remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ),
-				// archaic crash bug won't allow us to use 1 - ( 0.5 || 0 ) (#12497)
-				temp = remaining / animation.duration || 0,
-				percent = 1 - temp,
-				index = 0,
-				length = animation.tweens.length;
-
-			for ( ; index < length ; index++ ) {
-				animation.tweens[ index ].run( percent );
-			}
-
-			deferred.notifyWith( elem, [ animation, percent, remaining ]);
-
-			if ( percent < 1 && length ) {
-				return remaining;
-			} else {
-				deferred.resolveWith( elem, [ animation ] );
-				return false;
-			}
-		},
-		animation = deferred.promise({
-			elem: elem,
-			props: jQuery.extend( {}, properties ),
-			opts: jQuery.extend( true, { specialEasing: {} }, options ),
-			originalProperties: properties,
-			originalOptions: options,
-			startTime: fxNow || createFxNow(),
-			duration: options.duration,
-			tweens: [],
-			createTween: function( prop, end, easing ) {
-				var tween = jQuery.Tween( elem, animation.opts, prop, end,
-						animation.opts.specialEasing[ prop ] || animation.opts.easing );
-				animation.tweens.push( tween );
-				return tween;
-			},
-			stop: function( gotoEnd ) {
-				var index = 0,
-					// if we are going to the end, we want to run all the tweens
-					// otherwise we skip this part
-					length = gotoEnd ? animation.tweens.length : 0;
-
-				for ( ; index < length ; index++ ) {
-					animation.tweens[ index ].run( 1 );
-				}
-
-				// resolve when we played the last frame
-				// otherwise, reject
-				if ( gotoEnd ) {
-					deferred.resolveWith( elem, [ animation, gotoEnd ] );
-				} else {
-					deferred.rejectWith( elem, [ animation, gotoEnd ] );
-				}
-				return this;
-			}
-		}),
-		props = animation.props;
-
-	propFilter( props, animation.opts.specialEasing );
-
-	for ( ; index < length ; index++ ) {
-		result = animationPrefilters[ index ].call( animation, elem, props, animation.opts );
-		if ( result ) {
-			return result;
-		}
-	}
-
-	createTweens( animation, props );
-
-	if ( jQuery.isFunction( animation.opts.start ) ) {
-		animation.opts.start.call( elem, animation );
-	}
-
-	jQuery.fx.timer(
-		jQuery.extend( tick, {
-			anim: animation,
-			queue: animation.opts.queue,
-			elem: elem
-		})
-	);
-
-	// attach callbacks from options
-	return animation.progress( animation.opts.progress )
-		.done( animation.opts.done, animation.opts.complete )
-		.fail( animation.opts.fail )
-		.always( animation.opts.always );
-}
-
-function propFilter( props, specialEasing ) {
-	var index, name, easing, value, hooks;
-
-	// camelCase, specialEasing and expand cssHook pass
-	for ( index in props ) {
-		name = jQuery.camelCase( index );
-		easing = specialEasing[ name ];
-		value = props[ index ];
-		if ( jQuery.isArray( value ) ) {
-			easing = value[ 1 ];
-			value = props[ index ] = value[ 0 ];
-		}
-
-		if ( index !== name ) {
-			props[ name ] = value;
-			delete props[ index ];
-		}
-
-		hooks = jQuery.cssHooks[ name ];
-		if ( hooks && "expand" in hooks ) {
-			value = hooks.expand( value );
-			delete props[ name ];
-
-			// not quite $.extend, this wont overwrite keys already present.
-			// also - reusing 'index' from above because we have the correct "name"
-			for ( index in value ) {
-				if ( !( index in props ) ) {
-					props[ index ] = value[ index ];
-					specialEasing[ index ] = easing;
-				}
-			}
-		} else {
-			specialEasing[ name ] = easing;
-		}
-	}
-}
-
-jQuery.Animation = jQuery.extend( Animation, {
-
-	tweener: function( props, callback ) {
-		if ( jQuery.isFunction( props ) ) {
-			callback = props;
-			props = [ "*" ];
-		} else {
-			props = props.split(" ");
-		}
-
-		var prop,
-			index = 0,
-			length = props.length;
-
-		for ( ; index < length ; index++ ) {
-			prop = props[ index ];
-			tweeners[ prop ] = tweeners[ prop ] || [];
-			tweeners[ prop ].unshift( callback );
-		}
-	},
-
-	prefilter: function( callback, prepend ) {
-		if ( prepend ) {
-			animationPrefilters.unshift( callback );
-		} else {
-			animationPrefilters.push( callback );
-		}
-	}
-});
-
-function defaultPrefilter( elem, props, opts ) {
-	var index, prop, value, length, dataShow, toggle, tween, hooks, oldfire,
-		anim = this,
-		style = elem.style,
-		orig = {},
-		handled = [],
-		hidden = elem.nodeType && isHidden( elem );
-
-	// handle queue: false promises
-	if ( !opts.queue ) {
-		hooks = jQuery._queueHooks( elem, "fx" );
-		if ( hooks.unqueued == null ) {
-			hooks.unqueued = 0;
-			oldfire = hooks.empty.fire;
-			hooks.empty.fire = function() {
-				if ( !hooks.unqueued ) {
-					oldfire();
-				}
-			};
-		}
-		hooks.unqueued++;
-
-		anim.always(function() {
-			// doing this makes sure that the complete handler will be called
-			// before this completes
-			anim.always(function() {
-				hooks.unqueued--;
-				if ( !jQuery.queue( elem, "fx" ).length ) {
-					hooks.empty.fire();
-				}
-			});
-		});
-	}
-
-	// height/width overflow pass
-	if ( elem.nodeType === 1 && ( "height" in props || "width" in props ) ) {
-		// Make sure that nothing sneaks out
-		// Record all 3 overflow attributes because IE does not
-		// change the overflow attribute when overflowX and
-		// overflowY are set to the same value
-		opts.overflow = [ style.overflow, style.overflowX, style.overflowY ];
-
-		// Set display property to inline-block for height/width
-		// animations on inline elements that are having width/height animated
-		if ( jQuery.css( elem, "display" ) === "inline" &&
-				jQuery.css( elem, "float" ) === "none" ) {
-
-			// inline-level elements accept inline-block;
-			// block-level elements need to be inline with layout
-			if ( !jQuery.support.inlineBlockNeedsLayout || css_defaultDisplay( elem.nodeName ) === "inline" ) {
-				style.display = "inline-block";
-
-			} else {
-				style.zoom = 1;
-			}
-		}
-	}
-
-	if ( opts.overflow ) {
-		style.overflow = "hidden";
-		if ( !jQuery.support.shrinkWrapBlocks ) {
-			anim.done(function() {
-				style.overflow = opts.overflow[ 0 ];
-				style.overflowX = opts.overflow[ 1 ];
-				style.overflowY = opts.overflow[ 2 ];
-			});
-		}
-	}
-
-
-	// show/hide pass
-	for ( index in props ) {
-		value = props[ index ];
-		if ( rfxtypes.exec( value ) ) {
-			delete props[ index ];
-			toggle = toggle || value === "toggle";
-			if ( value === ( hidden ? "hide" : "show" ) ) {
-				continue;
-			}
-			handled.push( index );
-		}
-	}
-
-	length = handled.length;
-	if ( length ) {
-		dataShow = jQuery._data( elem, "fxshow" ) || jQuery._data( elem, "fxshow", {} );
-		if ( "hidden" in dataShow ) {
-			hidden = dataShow.hidden;
-		}
-
-		// store state if its toggle - enables .stop().toggle() to "reverse"
-		if ( toggle ) {
-			dataShow.hidden = !hidden;
-		}
-		if ( hidden ) {
-			jQuery( elem ).show();
-		} else {
-			anim.done(function() {
-				jQuery( elem ).hide();
-			});
-		}
-		anim.done(function() {
-			var prop;
-			jQuery.removeData( elem, "fxshow", true );
-			for ( prop in orig ) {
-				jQuery.style( elem, prop, orig[ prop ] );
-			}
-		});
-		for ( index = 0 ; index < length ; index++ ) {
-			prop = handled[ index ];
-			tween = anim.createTween( prop, hidden ? dataShow[ prop ] : 0 );
-			orig[ prop ] = dataShow[ prop ] || jQuery.style( elem, prop );
-
-			if ( !( prop in dataShow ) ) {
-				dataShow[ prop ] = tween.start;
-				if ( hidden ) {
-					tween.end = tween.start;
-					tween.start = prop === "width" || prop === "height" ? 1 : 0;
-				}
-			}
-		}
-	}
-}
-
-function Tween( elem, options, prop, end, easing ) {
-	return new Tween.prototype.init( elem, options, prop, end, easing );
-}
-jQuery.Tween = Tween;
-
-Tween.prototype = {
-	constructor: Tween,
-	init: function( elem, options, prop, end, easing, unit ) {
-		this.elem = elem;
-		this.prop = prop;
-		this.easing = easing || "swing";
-		this.options = options;
-		this.start = this.now = this.cur();
-		this.end = end;
-		this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" );
-	},
-	cur: function() {
-		var hooks = Tween.propHooks[ this.prop ];
-
-		return hooks && hooks.get ?
-			hooks.get( this ) :
-			Tween.propHooks._default.get( this );
-	},
-	run: function( percent ) {
-		var eased,
-			hooks = Tween.propHooks[ this.prop ];
-
-		if ( this.options.duration ) {
-			this.pos = eased = jQuery.easing[ this.easing ](
-				percent, this.options.duration * percent, 0, 1, this.options.duration
-			);
-		} else {
-			this.pos = eased = percent;
-		}
-		this.now = ( this.end - this.start ) * eased + this.start;
-
-		if ( this.options.step ) {
-			this.options.step.call( this.elem, this.now, this );
-		}
-
-		if ( hooks && hooks.set ) {
-			hooks.set( this );
-		} else {
-			Tween.propHooks._default.set( this );
-		}
-		return this;
-	}
-};
-
-Tween.prototype.init.prototype = Tween.prototype;
-
-Tween.propHooks = {
-	_default: {
-		get: function( tween ) {
-			var result;
-
-			if ( tween.elem[ tween.prop ] != null &&
-				(!tween.elem.style || tween.elem.style[ tween.prop ] == null) ) {
-				return tween.elem[ tween.prop ];
-			}
-
-			// passing any value as a 4th parameter to .css will automatically
-			// attempt a parseFloat and fallback to a string if the parse fails
-			// so, simple values such as "10px" are parsed to Float.
-			// complex values such as "rotate(1rad)" are returned as is.
-			result = jQuery.css( tween.elem, tween.prop, false, "" );
-			// Empty strings, null, undefined and "auto" are converted to 0.
-			return !result || result === "auto" ? 0 : result;
-		},
-		set: function( tween ) {
-			// use step hook for back compat - use cssHook if its there - use .style if its
-			// available and use plain properties where available
-			if ( jQuery.fx.step[ tween.prop ] ) {
-				jQuery.fx.step[ tween.prop ]( tween );
-			} else if ( tween.elem.style && ( tween.elem.style[ jQuery.cssProps[ tween.prop ] ] != null || jQuery.cssHooks[ tween.prop ] ) ) {
-				jQuery.style( tween.elem, tween.prop, tween.now + tween.unit );
-			} else {
-				tween.elem[ tween.prop ] = tween.now;
-			}
-		}
-	}
-};
-
-// Remove in 2.0 - this supports IE8's panic based approach
-// to setting things on disconnected nodes
-
-Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = {
-	set: function( tween ) {
-		if ( tween.elem.nodeType && tween.elem.parentNode ) {
-			tween.elem[ tween.prop ] = tween.now;
-		}
-	}
-};
-
-jQuery.each([ "toggle", "show", "hide" ], function( i, name ) {
-	var cssFn = jQuery.fn[ name ];
-	jQuery.fn[ name ] = function( speed, easing, callback ) {
-		return speed == null || typeof speed === "boolean" ||
-			// special check for .toggle( handler, handler, ... )
-			( !i && jQuery.isFunction( speed ) && jQuery.isFunction( easing ) ) ?
-			cssFn.apply( this, arguments ) :
-			this.animate( genFx( name, true ), speed, easing, callback );
-	};
-});
-
-jQuery.fn.extend({
-	fadeTo: function( speed, to, easing, callback ) {
-
-		// show any hidden elements after setting opacity to 0
-		return this.filter( isHidden ).css( "opacity", 0 ).show()
-
-			// animate to the value specified
-			.end().animate({ opacity: to }, speed, easing, callback );
-	},
-	animate: function( prop, speed, easing, callback ) {
-		var empty = jQuery.isEmptyObject( prop ),
-			optall = jQuery.speed( speed, easing, callback ),
-			doAnimation = function() {
-				// Operate on a copy of prop so per-property easing won't be lost
-				var anim = Animation( this, jQuery.extend( {}, prop ), optall );
-
-				// Empty animations resolve immediately
-				if ( empty ) {
-					anim.stop( true );
-				}
-			};
-
-		return empty || optall.queue === false ?
-			this.each( doAnimation ) :
-			this.queue( optall.queue, doAnimation );
-	},
-	stop: function( type, clearQueue, gotoEnd ) {
-		var stopQueue = function( hooks ) {
-			var stop = hooks.stop;
-			delete hooks.stop;
-			stop( gotoEnd );
-		};
-
-		if ( typeof type !== "string" ) {
-			gotoEnd = clearQueue;
-			clearQueue = type;
-			type = undefined;
-		}
-		if ( clearQueue && type !== false ) {
-			this.queue( type || "fx", [] );
-		}
-
-		return this.each(function() {
-			var dequeue = true,
-				index = type != null && type + "queueHooks",
-				timers = jQuery.timers,
-				data = jQuery._data( this );
-
-			if ( index ) {
-				if ( data[ index ] && data[ index ].stop ) {
-					stopQueue( data[ index ] );
-				}
-			} else {
-				for ( index in data ) {
-					if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) {
-						stopQueue( data[ index ] );
-					}
-				}
-			}
-
-			for ( index = timers.length; index--; ) {
-				if ( timers[ index ].elem === this && (type == null || timers[ index ].queue === type) ) {
-					timers[ index ].anim.stop( gotoEnd );
-					dequeue = false;
-					timers.splice( index, 1 );
-				}
-			}
-
-			// start the next in the queue if the last step wasn't forced
-			// timers currently will call their complete callbacks, which will dequeue
-			// but only if they were gotoEnd
-			if ( dequeue || !gotoEnd ) {
-				jQuery.dequeue( this, type );
-			}
-		});
-	}
-});
-
-// Generate parameters to create a standard animation
-function genFx( type, includeWidth ) {
-	var which,
-		attrs = { height: type },
-		i = 0;
-
-	// if we include width, step value is 1 to do all cssExpand values,
-	// if we don't include width, step value is 2 to skip over Left and Right
-	includeWidth = includeWidth? 1 : 0;
-	for( ; i < 4 ; i += 2 - includeWidth ) {
-		which = cssExpand[ i ];
-		attrs[ "margin" + which ] = attrs[ "padding" + which ] = type;
-	}
-
-	if ( includeWidth ) {
-		attrs.opacity = attrs.width = type;
-	}
-
-	return attrs;
-}
-
-// Generate shortcuts for custom animations
-jQuery.each({
-	slideDown: genFx("show"),
-	slideUp: genFx("hide"),
-	slideToggle: genFx("toggle"),
-	fadeIn: { opacity: "show" },
-	fadeOut: { opacity: "hide" },
-	fadeToggle: { opacity: "toggle" }
-}, function( name, props ) {
-	jQuery.fn[ name ] = function( speed, easing, callback ) {
-		return this.animate( props, speed, easing, callback );
-	};
-});
-
-jQuery.speed = function( speed, easing, fn ) {
-	var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : {
-		complete: fn || !fn && easing ||
-			jQuery.isFunction( speed ) && speed,
-		duration: speed,
-		easing: fn && easing || easing && !jQuery.isFunction( easing ) && easing
-	};
-
-	opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
-		opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[ opt.duration ] : jQuery.fx.speeds._default;
-
-	// normalize opt.queue - true/undefined/null -> "fx"
-	if ( opt.queue == null || opt.queue === true ) {
-		opt.queue = "fx";
-	}
-
-	// Queueing
-	opt.old = opt.complete;
-
-	opt.complete = function() {
-		if ( jQuery.isFunction( opt.old ) ) {
-			opt.old.call( this );
-		}
-
-		if ( opt.queue ) {
-			jQuery.dequeue( this, opt.queue );
-		}
-	};
-
-	return opt;
-};
-
-jQuery.easing = {
-	linear: function( p ) {
-		return p;
-	},
-	swing: function( p ) {
-		return 0.5 - Math.cos( p*Math.PI ) / 2;
-	}
-};
-
-jQuery.timers = [];
-jQuery.fx = Tween.prototype.init;
-jQuery.fx.tick = function() {
-	var timer,
-		timers = jQuery.timers,
-		i = 0;
-
-	fxNow = jQuery.now();
-
-	for ( ; i < timers.length; i++ ) {
-		timer = timers[ i ];
-		// Checks the timer has not already been removed
-		if ( !timer() && timers[ i ] === timer ) {
-			timers.splice( i--, 1 );
-		}
-	}
-
-	if ( !timers.length ) {
-		jQuery.fx.stop();
-	}
-	fxNow = undefined;
-};
-
-jQuery.fx.timer = function( timer ) {
-	if ( timer() && jQuery.timers.push( timer ) && !timerId ) {
-		timerId = setInterval( jQuery.fx.tick, jQuery.fx.interval );
-	}
-};
-
-jQuery.fx.interval = 13;
-
-jQuery.fx.stop = function() {
-	clearInterval( timerId );
-	timerId = null;
-};
-
-jQuery.fx.speeds = {
-	slow: 600,
-	fast: 200,
-	// Default speed
-	_default: 400
-};
-
-// Back Compat <1.8 extension point
-jQuery.fx.step = {};
-
-if ( jQuery.expr && jQuery.expr.filters ) {
-	jQuery.expr.filters.animated = function( elem ) {
-		return jQuery.grep(jQuery.timers, function( fn ) {
-			return elem === fn.elem;
-		}).length;
-	};
-}
-var rroot = /^(?:body|html)$/i;
-
-jQuery.fn.offset = function( options ) {
-	if ( arguments.length ) {
-		return options === undefined ?
-			this :
-			this.each(function( i ) {
-				jQuery.offset.setOffset( this, options, i );
-			});
-	}
-
-	var docElem, body, win, clientTop, clientLeft, scrollTop, scrollLeft,
-		box = { top: 0, left: 0 },
-		elem = this[ 0 ],
-		doc = elem && elem.ownerDocument;
-
-	if ( !doc ) {
-		return;
-	}
-
-	if ( (body = doc.body) === elem ) {
-		return jQuery.offset.bodyOffset( elem );
-	}
-
-	docElem = doc.documentElement;
-
-	// Make sure it's not a disconnected DOM node
-	if ( !jQuery.contains( docElem, elem ) ) {
-		return box;
-	}
-
-	// If we don't have gBCR, just use 0,0 rather than error
-	// BlackBerry 5, iOS 3 (original iPhone)
-	if ( typeof elem.getBoundingClientRect !== "undefined" ) {
-		box = elem.getBoundingClientRect();
-	}
-	win = getWindow( doc );
-	clientTop  = docElem.clientTop  || body.clientTop  || 0;
-	clientLeft = docElem.clientLeft || body.clientLeft || 0;
-	scrollTop  = win.pageYOffset || docElem.scrollTop;
-	scrollLeft = win.pageXOffset || docElem.scrollLeft;
-	return {
-		top: box.top  + scrollTop  - clientTop,
-		left: box.left + scrollLeft - clientLeft
-	};
-};
-
-jQuery.offset = {
-
-	bodyOffset: function( body ) {
-		var top = body.offsetTop,
-			left = body.offsetLeft;
-
-		if ( jQuery.support.doesNotIncludeMarginInBodyOffset ) {
-			top  += parseFloat( jQuery.css(body, "marginTop") ) || 0;
-			left += parseFloat( jQuery.css(body, "marginLeft") ) || 0;
-		}
-
-		return { top: top, left: left };
-	},
-
-	setOffset: function( elem, options, i ) {
-		var position = jQuery.css( elem, "position" );
-
-		// set position first, in-case top/left are set even on static elem
-		if ( position === "static" ) {
-			elem.style.position = "relative";
-		}
-
-		var curElem = jQuery( elem ),
-			curOffset = curElem.offset(),
-			curCSSTop = jQuery.css( elem, "top" ),
-			curCSSLeft = jQuery.css( elem, "left" ),
-			calculatePosition = ( position === "absolute" || position === "fixed" ) && jQuery.inArray("auto", [curCSSTop, curCSSLeft]) > -1,
-			props = {}, curPosition = {}, curTop, curLeft;
-
-		// need to be able to calculate position if either top or left is auto and position is either absolute or fixed
-		if ( calculatePosition ) {
-			curPosition = curElem.position();
-			curTop = curPosition.top;
-			curLeft = curPosition.left;
-		} else {
-			curTop = parseFloat( curCSSTop ) || 0;
-			curLeft = parseFloat( curCSSLeft ) || 0;
-		}
-
-		if ( jQuery.isFunction( options ) ) {
-			options = options.call( elem, i, curOffset );
-		}
-
-		if ( options.top != null ) {
-			props.top = ( options.top - curOffset.top ) + curTop;
-		}
-		if ( options.left != null ) {
-			props.left = ( options.left - curOffset.left ) + curLeft;
-		}
-
-		if ( "using" in options ) {
-			options.using.call( elem, props );
-		} else {
-			curElem.css( props );
-		}
-	}
-};
-
-
-jQuery.fn.extend({
-
-	position: function() {
-		if ( !this[0] ) {
-			return;
-		}
-
-		var elem = this[0],
-
-		// Get *real* offsetParent
-		offsetParent = this.offsetParent(),
-
-		// Get correct offsets
-		offset       = this.offset(),
-		parentOffset = rroot.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset();
-
-		// Subtract element margins
-		// note: when an element has margin: auto the offsetLeft and marginLeft
-		// are the same in Safari causing offset.left to incorrectly be 0
-		offset.top  -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
-		offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
-
-		// Add offsetParent borders
-		parentOffset.top  += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
-		parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
-
-		// Subtract the two offsets
-		return {
-			top:  offset.top  - parentOffset.top,
-			left: offset.left - parentOffset.left
-		};
-	},
-
-	offsetParent: function() {
-		return this.map(function() {
-			var offsetParent = this.offsetParent || document.body;
-			while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
-				offsetParent = offsetParent.offsetParent;
-			}
-			return offsetParent || document.body;
-		});
-	}
-});
-
-
-// Create scrollLeft and scrollTop methods
-jQuery.each( {scrollLeft: "pageXOffset", scrollTop: "pageYOffset"}, function( method, prop ) {
-	var top = /Y/.test( prop );
-
-	jQuery.fn[ method ] = function( val ) {
-		return jQuery.access( this, function( elem, method, val ) {
-			var win = getWindow( elem );
-
-			if ( val === undefined ) {
-				return win ? (prop in win) ? win[ prop ] :
-					win.document.documentElement[ method ] :
-					elem[ method ];
-			}
-
-			if ( win ) {
-				win.scrollTo(
-					!top ? val : jQuery( win ).scrollLeft(),
-					 top ? val : jQuery( win ).scrollTop()
-				);
-
-			} else {
-				elem[ method ] = val;
-			}
-		}, method, val, arguments.length, null );
-	};
-});
-
-function getWindow( elem ) {
-	return jQuery.isWindow( elem ) ?
-		elem :
-		elem.nodeType === 9 ?
-			elem.defaultView || elem.parentWindow :
-			false;
-}
-// Create innerHeight, innerWidth, height, width, outerHeight and outerWidth methods
-jQuery.each( { Height: "height", Width: "width" }, function( name, type ) {
-	jQuery.each( { padding: "inner" + name, content: type, "": "outer" + name }, function( defaultExtra, funcName ) {
-		// margin is only for outerHeight, outerWidth
-		jQuery.fn[ funcName ] = function( margin, value ) {
-			var chainable = arguments.length && ( defaultExtra || typeof margin !== "boolean" ),
-				extra = defaultExtra || ( margin === true || value === true ? "margin" : "border" );
-
-			return jQuery.access( this, function( elem, type, value ) {
-				var doc;
-
-				if ( jQuery.isWindow( elem ) ) {
-					// As of 5/8/2012 this will yield incorrect results for Mobile Safari, but there
-					// isn't a whole lot we can do. See pull request at this URL for discussion:
-					// https://github.com/jquery/jquery/pull/764
-					return elem.document.documentElement[ "client" + name ];
-				}
-
-				// Get document width or height
-				if ( elem.nodeType === 9 ) {
-					doc = elem.documentElement;
-
-					// Either scroll[Width/Height] or offset[Width/Height] or client[Width/Height], whichever is greatest
-					// unfortunately, this causes bug #3838 in IE6/8 only, but there is currently no good, small way to fix it.
-					return Math.max(
-						elem.body[ "scroll" + name ], doc[ "scroll" + name ],
-						elem.body[ "offset" + name ], doc[ "offset" + name ],
-						doc[ "client" + name ]
-					);
-				}
-
-				return value === undefined ?
-					// Get width or height on the element, requesting but not forcing parseFloat
-					jQuery.css( elem, type, value, extra ) :
-
-					// Set width or height on the element
-					jQuery.style( elem, type, value, extra );
-			}, type, chainable ? margin : undefined, chainable, null );
-		};
-	});
-});
-// Expose jQuery to the global object
-window.jQuery = window.$ = jQuery;
-
-// Expose jQuery as an AMD module, but only for AMD loaders that
-// understand the issues with loading multiple versions of jQuery
-// in a page that all might call define(). The loader will indicate
-// they have special allowances for multiple jQuery versions by
-// specifying define.amd.jQuery = true. Register as a named module,
-// since jQuery can be concatenated with other files that may use define,
-// but not use a proper concatenation script that understands anonymous
-// AMD modules. A named AMD is safest and most robust way to register.
-// Lowercase jquery is used because AMD module names are derived from
-// file names, and jQuery is normally delivered in a lowercase file name.
-// Do this after creating the global so that if an AMD module wants to call
-// noConflict to hide this version of jQuery, it will work.
-if ( typeof define === "function" && define.amd && define.amd.jQuery ) {
-	define( "jquery", [], function () { return jQuery; } );
-}
-
-})( window );
Index: nc/admin/default-templates/js/jquery/jquery.modal.js
===================================================================
--- inc/admin/default-templates/js/jquery/jquery.modal.js	(revision 1056)
+++ 	(revision )
@@ -1,324 +1,0 @@
-(function($) {
-	if (/^1\.(0|1)\./.test($.fn.jquery) || /^1\.2\.(0|1|2|3|4|5)/.test($.fn.jquery)) {
-		throw('Modal requieres jQuery v1.2.6 or later. You are using v'+$.fn.jquery);
-		return;
-	}
-	
-	$.modal = function(data,params) {
-		this.params = $.extend(this.params,params);
-		return this.build(data);
-	};
-	$.modal.version = '1.0';
-	
-	$.modal.prototype = {
-		params: {
-			width: null,
-			height: null,
-			speed: 300,
-			opacity: 0.9,
-			loader_img: 'loader.gif',
-			loader_txt: 'loading...',
-			close_img: 'close.png',
-			close_txt: 'close',
-			on_close: function() {}
-		},
-		ctrl: {
-			box: $(),
-			loader: $(),
-			overlay: $('<div id="jq-modal-overlay"></div>'),
-			hidden: $()
-		},
-		
-		build: function(data) {
-			this.ctrl.loader = $('<div class="jq-modal-load"><img src="' + this.params.loader_img + '" alt="' + this.params.loader_txt + '" /></div>');
-			this.addOverlay();
-			var size = this.getBoxSize(this.ctrl.loading);
-			
-			this.ctrl.box = this.getBox(this.ctrl.loading,{
-				top: Math.round($(window).height()/2 + $(window).scrollTop() - size.h/2),
-				left: Math.round($(window).width()/2 + $(window).scrollLeft() - size.w/2),
-				visibility: 'hidden'
-			});
-			this.ctrl.overlay.after(this.ctrl.box);
-			if (data != undefined) {
-				this.updateBox(data);
-				this.data = data;
-			}
-			return this;
-		},
-		updateBox: function(data,fn) {
-			var This = this;
-			this.hideCloser();
-			fn = $.isFunction(fn) ? fn : function() {};
-			var content = $('div.jq-modal-content',this.ctrl.box);
-			content.empty().append(this.ctrl.loader);
-			var size = this.getBoxSize(data,this.params.width,this.params.height);
-			
-			var top = Math.round($(window).height()/2 + $(window).scrollTop() - size.h/2);
-			var left = Math.round($(window).width()/2 + $(window).scrollLeft() - size.w/2);
-			
-			this.ctrl.box.css('visibility','visible').animate({
-				top: top < 0 ? 0 : top,
-				left: left < 0 ? 0 : left,
-				width: size.w,
-				height: size.h
-			},this.params.speed,function() {
-				This.setContentSize(content,This.params.width,This.params.height);
-				content.empty().append(data).css('opacity',0)
-				.fadeTo(This.params.speed,1,function() {
-					fn.call(This,content);
-				});
-				This.showCloser();
-			});
-		},
-		getBox: function(data,css,content_w,content_h) {
-			var box = $(
-				'<div class="jq-modal">'+
-				'<div class="jq-modal-container"><div class="jq-modal-content">'+
-				'</div></div></div>'
-				).css($.extend({
-					position: 'absolute',
-					top: 0,
-					left: 0,
-					zIndex: 100
-				},css));
-			
-			if (data != undefined) {
-				$('div.jq-modal-content',box).append(data);
-			}
-			
-			this.setContentSize($('div.jq-modal-content',box),content_w,content_h);
-			return box;
-		},
-		getBoxSize: function(data,content_w,content_h) {
-			var box = this.getBox(data,{ visibility: 'hidden' },content_w,content_h);
-			this.ctrl.overlay.after(box);
-			var size = { w: box.width(), h: box.height() };
-			box.remove();
-			box = null;
-			return size;
-		},
-		setContentSize: function(content,w,h) {
-			content.css({
-				width: w > 0 ? w : 'auto',
-				height: h > 0 ? h : 'auto'
-			});
-		},
-		showCloser: function() {
-			if ($('div.jq-modal-closer',this.ctrl.box).length > 0) {
-				$('div.jq-modal-closer',this.ctrl.box).show();
-				return;
-			}
-			
-			$('div.jq-modal-container',this.ctrl.box).append(
-				'<div class="jq-modal-closer"><a href="#">' + this.params.close_txt + '</a></div>'
-			);
-			var This = this;
-			var close = $('div.jq-modal-closer a',this.ctrl.box)
-			close.css({
-				background: 'transparent url(' + this.params.close_img + ') no-repeat'
-			})
-			.click(function() {
-				This.removeOverlay();
-				return false;
-			});
-			
-			if (document.all) {
-				close[0].runtimeStyle.filter = 'progid:DXImageTransform.Microsoft.AlphaImageLoader(src="' + this.params.close_img + '", sizingMethod="crop")';
-				close[0].runtimeStyle.backgroundImage = "none"
-			}
-		},
-		hideCloser: function() {
-			$('div.jq-modal-closer',this.ctrl.box).hide();
-		},
-		
-		addOverlay: function() {
-			var This = this;
-			if (document.all) {
-				this.ctrl.hidden = $('select:visible, object:visible, embed:visible').
-				css('visibility','hidden');
-			}
-			this.ctrl.overlay.css({
-				backgroundColor: '#000',
-				position: 'absolute',
-				top: 0,
-				left: 0,
-				zIndex: 90,
-				opacity: this.params.opacity
-			})
-			.appendTo('body')
-			.dblclick(function() { This.removeOverlay(); });
-			
-			this.resizeOverlay({data:this.ctrl});
-			
-			$(window).bind('resize.modal',this.ctrl,this.resizeOverlay);
-			$(document).bind('keypress.modal',this,this.keyRemove);
-		},
-		resizeOverlay: function(e) {
-			e.data.overlay.css({
-				width: $(window).width(),
-				height: $(document).height()
-			});
-			if (e.data.box.parents('body').length > 0) {
-				var top = Math.round($(window).height()/2 + $(window).scrollTop() - e.data.box.height()/2);
-				var left = Math.round($(window).width()/2 + $(window).scrollLeft() - e.data.box.width()/2);
-				e.data.box.css({
-					top: top < 0 ? 0 : top,
-					left: left < 0 ? 0 : left
-				});
-			}
-		},
-		keyRemove: function(e) {
-			if (e.keyCode == 27) {
-				e.data.removeOverlay();
-			}
-			return true;
-		},
-		removeOverlay: function() {
-			$(window).unbind('resize.modal');
-			$(document).unbind('keypress');
-			this.params.on_close.apply(this);
-			this.ctrl.overlay.remove();
-			this.ctrl.hidden.css('visibility','visible');
-			this.ctrl.box.remove();
-			this.ctrl.box = $();
-		}
-	};
-})(jQuery);
-
-(function($) {
-	$.fn.modalImages = function(params) {
-		params = $.extend(this.params,params);
-		var links = new Array();
-		this.each(function() {
-			if ($(this).attr('href') == '' || $(this).attr('href') == undefined || $(this).attr('href') == '#') {
-				return false;
-			}
-			var index = links.length;
-			links.push($(this));
-			$(this).click(function() {
-				new $.modalImages(index,links,params);
-				return false;
-			});
-			return true;
-		});
-		
-		return this;
-	};
-	
-	$.modalImages = function(index,links,params) {
-		this.links = links;
-		this.modal = new $.modal(null,params);
-		this.showImage(index);
-	};
-	
-	$.modalImages.prototype = {
-		params: {
-			prev_txt: 'previous',
-			next_txt: 'next',
-			prev_img: 'prev.png',
-			next_img: 'next.png',
-			blank_img: 'blank.gif'
-		},
-		showImage: function(index) {
-			var This = this;
-			$(document).unbind('keypress.modalImage');
-			if (this.links[index] == undefined) {
-				this.modal.removeOverlay();
-			}
-			var link = this.links[index];
-			var modal = this.modal;
-			
-			var res = $('<div></div>');
-			res.append('<img src="' + link.attr('href') + '" alt="" />');
-			
-			var thumb = $('img:first',link);
-			if (thumb.length > 0 && thumb.attr('title')) {
-				res.append('<span class="jq-modal-legend">' + thumb.attr('title') + '</span>');
-			} else if (link.attr('title')) {
-				res.append('<span class="jq-modal-legend">' + link.attr('title') + '</span>');
-			}
-			
-			// Add prev/next buttons
-			if (index != 0) {
-				$('<a class="jq-modal-prev" href="#">prev</a>').appendTo(res);
-			}
-			if (index+1 < this.links.length) {
-				$('<a class="jq-modal-next" href="#">next</a>').appendTo(res);
-			}
-			
-			var img = new Image();
-			
-			// Display loader while loading image
-			if (this.modal.ctrl.box.css('visibility') == 'visible') {
-				$('div.jq-modal-content',this.modal.ctrl.box)
-				.empty().append(this.modal.ctrl.loader);
-			} else {
-				this.modal.updateBox(this.modal.ctrl.loader);
-			}
-			
-			img.onload = function() {
-				modal.updateBox(res,function() {
-					var Img = $('div.jq-modal-content img',this.ctrl.box);
-					This.navBtnStyle($('a.jq-modal-next',this.ctrl.box),true).css('height',Img.height()).bind('click',index+1,navClick);
-					This.navBtnStyle($('a.jq-modal-prev',this.ctrl.box),false).css('height',Img.height()).bind('click',index-1,navClick);
-					Img.click(function() {
-						This.modal.removeOverlay();
-					});
-					$(document).bind('keypress.modalImage',navKey);
-				});
-				this.onload = function() {};
-			};
-			img.src = link.attr('href');
-			
-			var navClick = function(e) {
-				This.showImage(e.data);
-				return false;
-			};
-			var navKey = function(e) {
-				var key = String.fromCharCode(e.which).toLowerCase();
-				if ((key == 'n' || e.keyCode == 39) && index+1 < This.links.length) { // Press "n"
-					This.showImage(index+1);
-				}
-				if ((key == 'p' || e.keyCode == 37) && index != 0) { // Press "p"
-					This.showImage(index-1);
-				}
-			};
-		},
-		navBtnStyle: function(btn,next) {
-			var default_bg = 'transparent url(' + this.modal.params.blank_img + ') repeat';
-			var over_bg_i = next ? this.modal.params.next_img : this.modal.params.prev_img;
-			var over_bg_p = next ? 'right' : 'left';
-			
-			btn.css('background',default_bg)
-			.bind('mouseenter',function() {
-				$(this).css('background','transparent url(' + over_bg_i + ') no-repeat center ' + over_bg_p).css('z-index',110);
-			})
-			.bind('mouseleave',function() {
-				$(this).css('background',default_bg);
-			});
-			
-			return btn;
-		}
-	};
-})(jQuery);
-
-(function($) {
-	$.modalWeb = function(url,w,h) {
-		iframe = $('<iframe src="' + url + '" frameborder="0">').css({
-			border: 'none',
-			width: w,
-			height: h
-		});
-		return new $.modal(iframe);
-	};
-	
-	$.fn.modalWeb = function(w,h) {
-		this.click(function() {
-			if (this.href != undefined) {
-				$.modalWeb(this.href,w,h);
-			}
-			return false;
-		});
-	};
-})(jQuery);
Index: nc/admin/default-templates/js/jquery/jquery.pageTabs.js
===================================================================
--- inc/admin/default-templates/js/jquery/jquery.pageTabs.js	(revision 1056)
+++ 	(revision )
@@ -1,116 +1,0 @@
-jQuery.pageTabs = function(start_tab,settings) {
-	return new jQuery._pageTabs(start_tab,settings);
-};
-
-jQuery._pageTabs = function(start_tab,settings) {
-	var defaults = {
-		className: 'multi-part',
-		listClassName: 'part-tabs',
-		breakerClassName: 'clear'
-	};
-
-	var index = start_tab ? start_tab : 0;
-
-	this.params = jQuery.extend(defaults,settings);
-	this.divs = jQuery('div.'+this.params.className);
-	this.createList();
-	this.showDiv(index);
-};
-
-jQuery._pageTabs.prototype = {
-	items: new Array(),
-
-	createList: function() {
-		if (this.divs.length <= 0) {
-			return;
-		}
-
-		this.block = document.createElement('div');
-		this.block.className = this.params.listClassName;
-		this.list = document.createElement('ul');
-		//this.list.className = this.params.listClassName;
-		this.block.appendChild(this.list);
-		var li, a;
-
-		var This = this;
-		var i=0;
-		jQuery('.'+this.params.className).each(function() {
-			if (this.tagName == "DIV") {
-				li = document.createElement('li');
-				a = document.createElement('a');
-				a.appendChild(document.createTextNode(this.title));
-				this.title = '';
-				a.href = '#';
-				a.fn = This.showDiv;
-				a.index = this.id || i;
-				a.obj = This;
-				jQuery(a).click(function() { this.fn.call(this.obj,this.index); return false; });
-				li.appendChild(a);
-				This.list.appendChild(li);
-				This.items[i] = li;
-				i++;
-			} else {
-				li = document.createElement('li');
-				li.className = This.params.listClassName+'-link';
-				li.appendChild(this);
-				This.list.appendChild(li);
-			}
-		});
-
-		this.breaker = document.createElement('br');
-		this.breaker.className = this.params.breakerClassName;
-
-		jQuery(this.divs.get(0)).before(this.block);
-		jQuery(this.block).after(this.breaker);
-	},
-
-	showDiv: function(index) {
-		var This = this;
-		var i = 0;
-		var to_trigger = null;
-
-		this.divs.each(function() {
-			if ((this.id != '' && this.id == index) || i == index) {
-				jQuery(this).show(0, positionFooter);
-				This.items[i].className = This.params.listClassName+'-active';
-				to_trigger = i;
-			} else {
-				jQuery(this).hide(0, positionFooter);
-				This.items[i].className = '';
-			}
-
-			i++;
-		});
-
-		if (to_trigger != null) {
-			jQuery(this.divs[to_trigger]).onetabload();
-			jQuery(this.divs[to_trigger]).tabload();
-		}
-	}
-};
-
-jQuery.fn.tabload = function(f) {
-	this.each(function() {
-		if (f) {
-			chainHandler(this,'tabload',f)
-		} else {
-			var h = this.tabload;
-			if (h) { h.apply(this); }
-		}
-	});
-	return this;
-};
-jQuery.fn.onetabload = function(f) {
-	this.each(function() {
-		if (f) {
-			chainHandler(this,'onetabload',f);
-		} else {
-			var h = this.onetabload;
-			if (h != null) {
-				h.apply(this);
-				this.onetabload = null;
-			}
-		}
-	});
-	return this;
-};
Index: nc/admin/default-templates/js/jsToolBar/jsToolBar.dotclear.js
===================================================================
--- inc/admin/default-templates/js/jsToolBar/jsToolBar.dotclear.js	(revision 1056)
+++ 	(revision )
@@ -1,379 +1,0 @@
-/* Change link button actions
--------------------------------------------------------- */
-jsToolBar.prototype.elements.link.data = {};
-jsToolBar.prototype.elements.link.fncall = {};
-jsToolBar.prototype.elements.link.open_url = 'popup_link.php';
-
-jsToolBar.prototype.elements.link.popup = function (args) {
-	window.the_toolbar = this;
-	args = args || '';
-	
-	this.elements.link.data = {};
-	var url = this.elements.link.open_url+args;
-	
-	var p_win = window.open(url,'dc_popup',
-	'alwaysRaised=yes,dependent=yes,toolbar=yes,height=420,width=520,'+
-	'menubar=no,resizable=yes,scrollbars=yes,status=no');
-};
-
-jsToolBar.prototype.elements.link.fn.wiki = function() {
-	this.elements.link.popup.call(this,'?hreflang='+this.elements.link.default_hreflang);
-};
-jsToolBar.prototype.elements.link.fncall.wiki = function() {
-	var data = this.elements.link.data;
-	
-	if (data.href == '') { return; }
-	
-	var etag = '|'+data.href;
-	if (data.hreflang) { etag += '|'+data.hreflang; }
-	
-	if (data.title) {
-		if (!data.hreflang) { etag += '|'; }
-		etag += '|'+data.title;
-	}
-	
-	if (data.content) {
-		this.encloseSelection('['+data.content,etag+']');
-	} else {
-		this.encloseSelection('[',etag+']');
-	}
-};
-
-jsToolBar.prototype.elements.link.fn.xhtml = function() {
-	this.elements.link.popup.call(this,'?hreflang='+this.elements.link.default_hreflang);
-};
-jsToolBar.prototype.elements.link.fncall.xhtml = function() {
-	var data = this.elements.link.data;
-	
-	if (data.href == '') { return; }
-	
-	var stag = '<a href="'+data.href+'"';
-	
-	if (data.hreflang) { stag += ' hreflang="'+data.hreflang+'"'; }
-	if (data.title) { stag += ' title="'+data.title+'"'; }
-	stag += '>';
-	var etag = '</a>';
-	
-	if (data.content) {
-		this.encloseSelection('','',function() {
-			return stag + data.content + etag;
-		});
-	} else {
-		this.encloseSelection(stag,etag);
-	}
-};
-
-jsToolBar.prototype.elements.link.fn.wysiwyg = function() {
-	var href, title, hreflang;
-	href = title = hreflang = '';
-	hreflang = this.elements.link.default_hreflang;
-	
-	var a = this.getAncestor();
-	
-	if (a.tagName == 'a') {
-		href= a.tag.href || '';
-		title = a.tag.title || '';
-		hreflang = a.tag.hreflang || '';
-	}
-	
-	this.elements.link.popup.call(this,'?href='+href+'&hreflang='+hreflang+'&title='+title);
-};
-jsToolBar.prototype.elements.link.fncall.wysiwyg = function() {
-	var data = this.elements.link.data;
-	
-	var a = this.getAncestor();
-	
-	if (a.tagName == 'a') {
-		if (data.href == '') {
-			// Remove link
-			this.replaceNodeByContent(a.tag);
-			this.iwin.focus();
-			return;
-		} else {
-			// Update link
-			a.tag.href = data.href;
-			if (data.hreflang) {
-				a.tag.setAttribute('hreflang',data.hreflang);
-			} else {
-				a.tag.removeAttribute('hreflang');
-			}
-			if (data.title) {
-				a.tag.setAttribute('title',data.title);
-			} else {
-				a.tag.removeAttribute('title');
-			}
-			return;
-		}
-	}
-	
-	// Create link
-	if (data.content) {
-		var n = document.createTextNode(data.content);
-	} else {
-		var n = this.getSelectedNode();
-	}
-	var a = this.iwin.document.createElement('a');
-	a.href = data.href;
-	if (data.hreflang) a.setAttribute('hreflang',data.hreflang);
-	if (data.title) a.setAttribute('title',data.title);
-	a.appendChild(n);
-	this.insertNode(a);
-};
-jsToolBar.prototype.getAncestor = function() {
-	var res = {};
-	var range, commonAncestorContainer;
-	
-	if (this.iwin.getSelection) { //gecko
-		var selection = this.iwin.getSelection();
-		range = selection.getRangeAt(0);
-		commonAncestorContainer = range.commonAncestorContainer;
-		while (commonAncestorContainer.nodeType != 1) {
-			commonAncestorContainer = commonAncestorContainer.parentNode;
-		}
-	} else { //ie
-		range = this.iwin.document.selection.createRange();
-		commonAncestorContainer = range.parentElement();
-	}
-	
-	var ancestorTagName = commonAncestorContainer.tagName.toLowerCase();
-	while (ancestorTagName!='a' && ancestorTagName!='body') {
-		commonAncestorContainer = commonAncestorContainer.parentNode;
-		ancestorTagName = commonAncestorContainer.tagName.toLowerCase();
-	}
-	
-	res.tag = commonAncestorContainer;
-	res.tagName = ancestorTagName;
-	
-	return res;
-};
-
-/* Image selector
--------------------------------------------------------- */
-jsToolBar.prototype.elements.img_select = {
-	type: 'button',
-	title: 'Image chooser',
-	fn: {},
-	fncall: {},
-	open_url: 'media.php?popup=1',
-	data: {},
-	popup: function() {
-		window.the_toolbar = this;
-		this.elements.img_select.data = {};
-		
-		var p_win = window.open(this.elements.img_select.open_url,'dc_popup',
-		'alwaysRaised=yes,dependent=yes,toolbar=yes,height=500,width=760,'+
-		'menubar=no,resizable=yes,scrollbars=yes,status=no');
-	}
-};
-jsToolBar.prototype.elements.img_select.fn.wiki = function() {
-	this.elements.img_select.popup.call(this);
-};
-jsToolBar.prototype.elements.img_select.fncall.wiki = function() {
-	var d = this.elements.img_select.data;
-	if (d.src == undefined) { return; }
-	
-	this.encloseSelection('','',function(str) {
-		var alt = (str) ? str : d.title;
-		var res = '(('+d.src+'|'+alt;
-		
-		if (d.alignment == 'left') {
-			res += '|L';
-		} else if (d.alignment == 'right') {
-			res += '|R';
-		} else if (d.alignment == 'center') {
-			res += '|C';
-		} else if (d.description) {
-			res += '|';
-		}
-		
-		if (d.description) {
-			res += '|'+d.description;
-		}
-		
-		res += '))';
-		
-		if (d.link) {
-			var ltitle = (alt) ? '||'+alt : '';
-			res = '['+res+'|'+d.url+ltitle+']';
-		}
-		
-		return res;
-	});
-};
-jsToolBar.prototype.elements.img_select.fn.xhtml = function() {
-	this.elements.img_select.popup.call(this);
-};
-jsToolBar.prototype.elements.img_select.fncall.xhtml = function() {
-	var d = this.elements.img_select.data;
-	if (d.src == undefined) { return; }
-	
-	this.encloseSelection('','',function(str) {
-		var alt = (str) ? str : d.title;
-		var res = '<img src="'+d.src+'" alt="'+alt.replace('&','&amp;').replace('>','&gt;').replace('<','&lt;').replace('"','&quot;')+'"';
-		
-		if (d.alignment == 'left') {
-			res += ' style="float: left; margin: 0 1em 1em 0;"';
-		} else if (d.alignment == 'right') {
-			res += ' style="float: right; margin: 0 0 1em 1em;"';
-		} else if (d.alignment == 'center') {
-			res += ' style="margin: 0 auto; display: block;"';
-		}
-		
-		if (d.description) {
-			res += ' title="'+d.description.replace('&','&amp;').replace('>','&gt;').replace('<','&lt;').replace('"','&quot;')+'"';
-		}
-		
-		res += ' />';
-		
-		if (d.link) {
-			var ltitle = (alt) ? ' title="'+alt.replace('&','&amp;').replace('>','&gt;').replace('<','&lt;').replace('"','&quot;')+'"' : '';
-			res = '<a href="'+d.url+'"'+ltitle+'>'+res+'</a>';
-		}
-		
-		return res;
-	});
-};
-
-jsToolBar.prototype.elements.img.fn.wysiwyg = function() {
-	var src = this.elements.img.prompt.call(this);
-	if (!src) { return; }
-	
-	var img = this.iwin.document.createElement('img');
-	img.src = src;
-	img.setAttribute('alt',this.getSelectedText());
-	
-	this.insertNode(img);
-};
-
-jsToolBar.prototype.elements.img_select.fn.wysiwyg = function() {
-	this.elements.img_select.popup.call(this);
-};
-jsToolBar.prototype.elements.img_select.fncall.wysiwyg = function() {
-	var d = this.elements.img_select.data;
-	var alt = (this.getSelectedText()) ? this.getSelectedText() : d.title;
-	if (d.src == undefined) { return; }
-	
-	var img = this.iwin.document.createElement('img');
-	img.src = d.src;
-	img.setAttribute('alt',alt);
-	
-	
-	if (d.alignment == 'left') {
-		if (img.style.styleFloat != undefined) {
-			img.style.styleFloat = 'left';
-		} else {
-			img.style.cssFloat = 'left';
-		}
-		img.style.marginTop = 0;
-		img.style.marginRight = '1em';
-		img.style.marginBottom = '1em';
-		img.style.marginLeft = 0;
-	} else if (d.alignment == 'right') {
-		if (img.style.styleFloat != undefined) {
-			img.style.styleFloat = 'right';
-		} else {
-			img.style.cssFloat = 'right';
-		}
-		img.style.marginTop = 0;
-		img.style.marginRight = 0;
-		img.style.marginBottom = '1em';
-		img.style.marginLeft = '1em';
-	} else if (d.alignment == 'center') {
-		img.style.marginTop = 0;
-		img.style.marginRight = 'auto';
-		img.style.marginBottom = 0;
-		img.style.marginLeft = 'auto';
-		img.style.display = 'block';
-	}
-	
-	if (d.description) {
-		img.setAttribute('title',d.description);
-	}
-	
-	if (d.link) {
-		var a = this.iwin.document.createElement('a');
-		a.href = d.url;
-		if (alt) {
-			a.setAttribute('title',alt);
-		}
-		a.appendChild(img);
-		this.insertNode(a);
-	} else {
-		this.insertNode(img);
-	}
-};
-
-// MP3 helpers
-jsToolBar.prototype.elements.mp3_insert = { fncall: {}, data: {} };
-jsToolBar.prototype.elements.mp3_insert.fncall.wiki = function() {
-	var d = this.elements.mp3_insert.data;
-	if (d.player == undefined) { return; }
-	
-	this.encloseSelection('','',function(str) {
-		return '\n///html\n' + d.player + '///\n';
-	});
-};
-jsToolBar.prototype.elements.mp3_insert.fncall.xhtml = function() {
-	var d = this.elements.mp3_insert.data;
-	if (d.player == undefined) { return; }
-	
-	this.encloseSelection('','',function(str) {
-		return '\n' + d.player + '\n';
-	});
-};
-jsToolBar.prototype.elements.mp3_insert.fncall.wysiwyg = function() {
-	return;
-};
-
-// FLV helpers
-jsToolBar.prototype.elements.flv_insert = { fncall: {}, data: {} };
-jsToolBar.prototype.elements.flv_insert.fncall.wiki = function() {
-	var d = this.elements.flv_insert.data;
-	if (d.player == undefined) { return; }
-	
-	this.encloseSelection('','',function(str) {
-		return '\n///html\n' + d.player + '///\n';
-	});
-};
-jsToolBar.prototype.elements.flv_insert.fncall.xhtml = function() {
-	var d = this.elements.flv_insert.data;
-	if (d.player == undefined) { return; }
-	
-	this.encloseSelection('','',function(str) {
-		return '\n' + d.player + '\n';
-	});
-};
-jsToolBar.prototype.elements.flv_insert.fncall.wysiwyg = function() {
-	return;
-};
-
-
-/* Posts selector
--------------------------------------------------------- */
-jsToolBar.prototype.elements.post_link = {
-	type: 'button',
-	title: 'Link to an entry',
-	fn: {},
-	open_url: 'popup_posts.php',
-	data: {},
-	popup: function() {
-		window.the_toolbar = this;
-		this.elements.img_select.data = {};
-		
-		var p_win = window.open(this.elements.post_link.open_url,'dc_popup',
-		'alwaysRaised=yes,dependent=yes,toolbar=yes,height=500,width=760,'+
-		'menubar=no,resizable=yes,scrollbars=yes,status=no');
-	}
-};
-jsToolBar.prototype.elements.post_link.fn.wiki = function() {
-	this.elements.post_link.popup.call(this);
-};
-jsToolBar.prototype.elements.post_link.fn.xhtml = function() {
-	this.elements.post_link.popup.call(this);
-};
-jsToolBar.prototype.elements.post_link.fn.wysiwyg = function() {
-	this.elements.post_link.popup.call(this);
-};
-
-// Last space element
-jsToolBar.prototype.elements.space3 = {type: 'space'};
Index: nc/admin/default-templates/js/jsToolBar/jsToolBar.js
===================================================================
--- inc/admin/default-templates/js/jsToolBar/jsToolBar.js	(revision 1085)
+++ 	(revision )
@@ -1,577 +1,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * This file is part of DotClear.
- * Copyright (c) 2005 Nicolas Martin & Olivier Meunier and contributors. All
- * rights reserved.
- *
- * DotClear is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * DotClear is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with DotClear; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * ***** END LICENSE BLOCK *****
-*/
-
-function jsToolBar(textarea) {
-	if (!document.createElement) { return; }
-	
-	if (!textarea) { return; }
-	
-	if ((typeof(document["selection"]) == "undefined")
-	&& (typeof(textarea["setSelectionRange"]) == "undefined")) {
-		return;
-	}
-	
-	this.textarea = textarea;
-	
-	this.editor = document.createElement('div');
-	this.editor.className = 'jstEditor';
-	
-	this.textarea.parentNode.insertBefore(this.editor,this.textarea);
-	this.editor.appendChild(this.textarea);
-	
-	this.toolbar = document.createElement("div");
-	this.toolbar.className = 'jstElements';
-	this.editor.parentNode.insertBefore(this.toolbar,this.editor);
-	
-	// Dragable resizing (only for gecko)
-	if (navigator.appName == 'Microsoft Internet Explorer')
-	{
-		if (this.editor.addEventListener)
-		{		
-			this.handle = document.createElement('div');
-			this.handle.className = 'jstHandle';
-			var dragStart = this.resizeDragStart;
-			var This = this;
-			this.handle.addEventListener('mousedown',function(event) { dragStart.call(This,event); },false);
-			this.editor.parentNode.insertBefore(this.handle,this.editor.nextSibling);
-		}
-	}
-	
-	this.context = null;
-	this.toolNodes = {}; // lorsque la toolbar est dessinée , cet objet est garni 
-					// de raccourcis vers les éléments DOM correspondants aux outils.
-};
-
-function jsButton(title, fn, scope, className) {
-	this.title = title || null;
-	this.fn = fn || function(){};
-	this.scope = scope || null;
-	this.className = className || null;
-};
-jsButton.prototype.draw = function() {
-	if (!this.scope) return null;
-	
-	var button = document.createElement('button');
-	button.setAttribute('type','button');
-	if (this.className) button.className = this.className;
-	button.title = this.title;
-	var span = document.createElement('span');
-	span.appendChild(document.createTextNode(this.title));
-	button.appendChild(span);
-	
-	if (this.icon != undefined) {
-		button.style.backgroundImage = 'url('+this.icon+')';
-	}
-	if (typeof(this.fn) == 'function') {
-		var This = this;
-		button.onclick = function() { try { This.fn.apply(This.scope, arguments) } catch (e) {} return false; };
-	}
-	return button;
-};
-
-function jsSpace(id) {
-	this.id = id || null;
-	this.width = null;
-};
-jsSpace.prototype.draw = function() {
-	var span = document.createElement('span');
-	if (this.id) span.id = this.id;
-	span.appendChild(document.createTextNode(String.fromCharCode(160)));
-	span.className = 'jstSpacer';
-	if (this.width) span.style.marginRight = this.width+'px';
-	
-	return span;
-};
-
-function jsCombo(title, options, scope, fn, className) {
-	this.title = title || null;
-	this.options = options || null;
-	this.scope = scope || null;
-	this.fn = fn || function(){};
-	this.className = className || null;
-};
-jsCombo.prototype.draw = function() {
-	if (!this.scope || !this.options) return null;
-	
-	var select = document.createElement('select');
-	if (this.className) select.className = className;
-	select.title = this.title;
-	
-	for (var o in this.options) {
-		//var opt = this.options[o];
-		var option = document.createElement('option');
-		option.value = o;
-		option.appendChild(document.createTextNode(this.options[o]));
-		select.appendChild(option);
-	}
-	
-	var This = this;
-	select.onchange = function() {
-		try { 
-			This.fn.call(This.scope, this.value);
-		} catch (e) { alert(e); }
-		
-		return false;
-	};
-	
-	return select;
-};
-
-
-jsToolBar.prototype = {
-	base_url: '',
-	mode: 'xhtml',
-	elements: {},
-	
-	getMode: function() {
-		return this.mode;
-	},
-	
-	setMode: function(mode) {
-		this.mode = mode || 'xhtml';
-	},
-	
-	switchMode: function(mode) {
-		mode = mode || 'xhtml';
-		this.draw(mode);
-	},
-	
-	button: function(toolName) {
-		var tool = this.elements[toolName];
-		if (typeof tool.fn[this.mode] != 'function') return null;
-		var b = new jsButton(tool.title, tool.fn[this.mode], this, 'jstb_'+toolName);
-		if (tool.icon != undefined) {
-			b.icon = tool.icon;
-		}
-		return b;
-	},
-	space: function(toolName) {
-		var tool = new jsSpace(toolName);
-		if (this.elements[toolName].width !== undefined) {
-			tool.width = this.elements[toolName].width;
-		}
-		return tool;
-	},
-	combo: function(toolName) {
-		var tool = this.elements[toolName];
-		var length = tool[this.mode].list.length;
-		
-		if (typeof tool[this.mode].fn != 'function' || length == 0) {
-			return null;
-		} else {
-			var options = {};
-			for (var i=0; i < length; i++) {
-				var opt = tool[this.mode].list[i];
-				options[opt] = tool.options[opt];
-			}
-			return new jsCombo(tool.title, options, this, tool[this.mode].fn);
-		}
-	},
-	draw: function(mode) {
-		this.setMode(mode);
-		
-		// Empty toolbar
-		while (this.toolbar.hasChildNodes()) {
-			this.toolbar.removeChild(this.toolbar.firstChild)
-		}
-		this.toolNodes = {}; // vide les raccourcis DOM/**/
-		
-		// Draw toolbar elements
-		var b, tool, newTool;
-		
-		for (var i in this.elements) {
-			b = this.elements[i];
-			
-			var disabled =
-			b.type == undefined || b.type == ''
-			|| (b.disabled != undefined && b.disabled)
-			|| (b.context != undefined && b.context != null && b.context != this.context);
-			
-			if (!disabled && typeof this[b.type] == 'function') {
-				tool = this[b.type](i);
-				if (tool) newTool = tool.draw();
-				if (newTool) {
-					this.toolNodes[i] = newTool; //mémorise l'accès DOM pour usage éventuel ultérieur
-					this.toolbar.appendChild(newTool);
-				}
-			}
-		}
-	},
-	
-	singleTag: function(stag,etag) {
-		stag = stag || null;
-		etag = etag || stag;
-		
-		if (!stag || !etag) { return; }
-		
-		this.encloseSelection(stag,etag);
-	},
-	
-	encloseSelection: function(prefix, suffix, fn) {
-		this.textarea.focus();
-		
-		prefix = prefix || '';
-		suffix = suffix || '';
-		
-		var start, end, sel, scrollPos, subst, res;
-		
-		if (typeof(document["selection"]) != "undefined") {
-			sel = document.selection.createRange().text;
-		} else if (typeof(this.textarea["setSelectionRange"]) != "undefined") {
-			start = this.textarea.selectionStart;
-			end = this.textarea.selectionEnd;
-			scrollPos = this.textarea.scrollTop;
-			sel = this.textarea.value.substring(start, end);
-		}
-		
-		if (sel.match(/ $/)) { // exclude ending space char, if any
-			sel = sel.substring(0, sel.length - 1);
-			suffix = suffix + " ";
-		}
-		
-		if (typeof(fn) == 'function') {
-			res = (sel) ? fn.call(this,sel) : fn('');
-		} else {
-			res = (sel) ? sel : '';
-		}
-		
-		subst = prefix + res + suffix;
-		
-		if (typeof(document["selection"]) != "undefined") {
-			var range = document.selection.createRange().text = subst;
-			this.textarea.caretPos -= suffix.length;
-		} else if (typeof(this.textarea["setSelectionRange"]) != "undefined") {
-			this.textarea.value = this.textarea.value.substring(0, start) + subst +
-			this.textarea.value.substring(end);
-			if (sel) {
-				this.textarea.setSelectionRange(start + subst.length, start + subst.length);
-			} else {
-				this.textarea.setSelectionRange(start + prefix.length, start + prefix.length);
-			}
-			this.textarea.scrollTop = scrollPos;
-		}
-	},
-	
-	stripBaseURL: function(url) {
-		if (this.base_url != '') {
-			var pos = url.indexOf(this.base_url);
-			if (pos == 0) {
-				url = url.substr(this.base_url.length);
-			}
-		}
-		
-		return url;
-	}
-};
-
-/** Resizer
--------------------------------------------------------- */
-jsToolBar.prototype.resizeSetStartH = function() {
-	this.dragStartH = this.textarea.offsetHeight + 0;
-};
-jsToolBar.prototype.resizeDragStart = function(event) {
-	var This = this;
-	this.dragStartY = event.clientY;
-	this.resizeSetStartH();
-	document.addEventListener('mousemove', this.dragMoveHdlr=function(event){This.resizeDragMove(event);}, false);
-	document.addEventListener('mouseup', this.dragStopHdlr=function(event){This.resizeDragStop(event);}, false);
-};
-
-jsToolBar.prototype.resizeDragMove = function(event) {
-	this.textarea.style.height = (this.dragStartH+event.clientY-this.dragStartY)+'px';
-};
-
-jsToolBar.prototype.resizeDragStop = function(event) {
-	document.removeEventListener('mousemove', this.dragMoveHdlr, false);
-	document.removeEventListener('mouseup', this.dragStopHdlr, false);
-};
-
-// Elements definition ------------------------------------
-// block format (paragraph, headers)
-jsToolBar.prototype.elements.blocks = {
-	type: 'combo',
-	title: 'block format',
-	options: {
-		none: '-- none --', // only for wysiwyg mode
-		nonebis: '- block format -', // only for xhtml mode
-		p: 'Paragraph',
-		h1: 'Header 1',
-		h2: 'Header 2',
-		h3: 'Header 3',
-		h4: 'Header 4',
-		h5: 'Header 5',
-		h6: 'Header 6'
-	},
-	xhtml: {
-		list: ['nonebis','p','h1','h2','h3','h4','h5','h6'],
-		fn: function(opt) {
-			if (opt=='nonebis')
-				this.textarea.focus();
-			else
-				try {this.singleTag('<'+opt+'>','</'+opt+'>');} catch(e){};
-			this.toolNodes.blocks.value = 'nonebis';
-		}
-	},
-	wiki: {
-		list: ['nonebis','h3','h4','h5'],
-		fn: function(opt) {
-			switch (opt) {
-				case 'nonebis': this.textarea.focus(); break;
-				case 'h3': this.encloseSelection('!!!'); break;
-				case 'h4': this.encloseSelection('!!'); break;
-				case 'h5': this.encloseSelection('!'); break;
-			}
-			this.toolNodes.blocks.value = 'nonebis';
-		}
-	}
-};
-
-// spacer
-jsToolBar.prototype.elements.space0 = {type: 'space'};
-
-// strong
-jsToolBar.prototype.elements.strong = {
-	type: 'button',
-	title: 'Strong emphasis',
-	fn: {
-		wiki: function() { this.singleTag('__') },
-		xhtml: function() { this.singleTag('<strong>','</strong>') }
-	}
-};
-
-// em
-jsToolBar.prototype.elements.em = {
-	type: 'button',
-	title: 'Emphasis',
-	fn: {
-		wiki: function() { this.singleTag("''") },
-		xhtml: function() { this.singleTag('<em>','</em>') }
-	}
-};
-
-// ins
-jsToolBar.prototype.elements.ins = {
-	type: 'button',
-	title: 'Inserted',
-	fn: {
-		wiki: function() { this.singleTag('++') },
-		xhtml: function() { this.singleTag('<ins>','</ins>') }
-	}
-};
-
-// del
-jsToolBar.prototype.elements.del = {
-	type: 'button',
-	title: 'Deleted',
-	fn: {
-		wiki: function() { this.singleTag('--') },
-		xhtml: function() { this.singleTag('<del>','</del>') }
-	}
-};
-
-// quote
-jsToolBar.prototype.elements.quote = {
-	type: 'button',
-	title: 'Inline quote',
-	fn: {
-		wiki: function() { this.singleTag('{{','}}') },
-		xhtml: function() { this.singleTag('<q>','</q>') }
-	}
-};
-
-// code
-jsToolBar.prototype.elements.code = {
-	type: 'button',
-	title: 'Code',
-	fn: {
-		wiki: function() { this.singleTag('@@') },
-		xhtml: function() { this.singleTag('<code>','</code>')}
-	}
-};
-
-// spacer
-jsToolBar.prototype.elements.space1 = {type: 'space'};
-
-// br
-jsToolBar.prototype.elements.br = {
-	type: 'button',
-	title: 'Line break',
-	fn: {
-		wiki: function() { this.encloseSelection("%%%\n",'') },
-		xhtml: function() { this.encloseSelection("<br />\n",'')}
-	}
-};
-
-// spacer
-jsToolBar.prototype.elements.space2 = {type: 'space'};
-
-// blockquote
-jsToolBar.prototype.elements.blockquote = {
-	type: 'button',
-	title: 'Blockquote',
-	fn: {
-		xhtml: function() { this.singleTag('<blockquote>','</blockquote>') },
-		wiki: function() {
-			this.encloseSelection("\n",'',
-			function(str) {
-				str = str.replace(/\r/g,'');
-				return '> '+str.replace(/\n/g,"\n> ");
-			});
-		}
-	}
-};
-
-// pre
-jsToolBar.prototype.elements.pre = {
-	type: 'button',
-	title: 'Preformated text',
-	fn: {
-		wiki: function() { this.singleTag("///\n","\n///") },
-		xhtml: function() { this.singleTag('<pre>','</pre>') }
-	}
-};
-
-// ul
-jsToolBar.prototype.elements.ul = {
-	type: 'button',
-	title: 'Unordered list',
-	fn: {
-		wiki: function() {
-			this.encloseSelection('','',function(str) {
-				str = str.replace(/\r/g,'');
-				return '* '+str.replace(/\n/g,"\n* ");
-			});
-		},
-		xhtml: function() {
-			this.encloseSelection('','',function(str) {
-				str = str.replace(/\r/g,'');
-				str = str.replace(/\n/g,"</li>\n <li>");
-				return "<ul>\n <li>"+str+"</li>\n</ul>";
-			});
-		}
-	}
-};
-
-// ol
-jsToolBar.prototype.elements.ol = {
-	type: 'button',
-	title: 'Ordered list',
-	fn: {
-		wiki: function() {
-			this.encloseSelection('','',function(str) {
-				str = str.replace(/\r/g,'');
-				return '# '+str.replace(/\n/g,"\n# ");
-			});
-		},
-		xhtml: function() {
-			this.encloseSelection('','',function(str) {
-				str = str.replace(/\r/g,'');
-				str = str.replace(/\n/g,"</li>\n <li>");
-				return "<ol>\n <li>"+str+"</li>\n</ol>";
-			});
-		}
-	}
-};
-
-// spacer
-jsToolBar.prototype.elements.space3 = {type: 'space'};
-
-// link
-jsToolBar.prototype.elements.link = {
-	type: 'button',
-	title: 'Link',
-	fn: {},
-	href_prompt: 'Please give page URL:',
-	hreflang_prompt: 'Language of this page:',
-	default_hreflang: '',
-	prompt: function(href,hreflang) {
-		href = href || '';
-		hreflang = hreflang || this.elements.link.default_hreflang;
-		
-		href = window.prompt(this.elements.link.href_prompt,href);
-		if (!href) { return false; }
-		
-		hreflang = window.prompt(this.elements.link.hreflang_prompt,
-		hreflang);
-		
-		return { href: this.stripBaseURL(href), hreflang: hreflang };
-	}
-};
-
-jsToolBar.prototype.elements.link.fn.xhtml = function() {
-	var link = this.elements.link.prompt.call(this);
-	if (link) {
-		var stag = '<a href="'+link.href+'"';
-		if (link.hreflang) { stag = stag+' hreflang="'+link.hreflang+'"'; }
-		stag = stag+'>';
-		var etag = '</a>';
-		
-		this.encloseSelection(stag,etag);
-	}
-};
-jsToolBar.prototype.elements.link.fn.wiki = function() {
-	var link = this.elements.link.prompt.call(this);
-	if (link) {
-		var stag = '[';
-		var etag = '|'+link.href;
-		if (link.hreflang) { etag = etag+'|'+link.hreflang; }
-		etag = etag+']';
-		
-		this.encloseSelection(stag,etag);
-	}
-};
-
-// img
-jsToolBar.prototype.elements.img = {
-		type: 'button',
-		title: 'External image',
-		src_prompt: 'Please give image URL:',
-		fn: {},
-		prompt: function(src) {
-			src = src || '';
-			return this.stripBaseURL(window.prompt(this.elements.img.src_prompt,src));
-		}
-};
-jsToolBar.prototype.elements.img.fn.xhtml = function() {
-	var src = this.elements.img.prompt.call(this);
-	if (src) {
-		this.encloseSelection('','',function(str) {
-			if (str) {
-				return '<img src="'+src+'" alt="'+str+'" />';
-			} else {
-				return '<img src="'+src+'" alt="" />';
-			}
-		});
-	}
-};
-jsToolBar.prototype.elements.img.fn.wiki = function() {
-	var src = this.elements.img.prompt.call(this);
-	if (src) {
-		this.encloseSelection('','',function(str) {
-			if (str) {
-				return '(('+src+'|'+str+'))';
-			} else {
-				return '(('+src+'))';
-			}
-		});
-	}
-};
Index: nc/admin/default-templates/js/jsToolBar/jsToolBar.wysiwyg.js
===================================================================
--- inc/admin/default-templates/js/jsToolBar/jsToolBar.wysiwyg.js	(revision 1056)
+++ 	(revision )
@@ -1,799 +1,0 @@
-/* ***** BEGIN LICENSE BLOCK *****
- * This file is part of DotClear.
- * Copyright (c) 2005 Nicolas Martin & Olivier Meunier and contributors. All
- * rights reserved.
- *
- * DotClear is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- * 
- * DotClear is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- * 
- * You should have received a copy of the GNU General Public License
- * along with DotClear; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * ***** END LICENSE BLOCK *****
-*/
-
-jsToolBar.prototype.can_wwg = (document.designMode != undefined);
-jsToolBar.prototype.iframe = null;
-jsToolBar.prototype.iwin = null;
-jsToolBar.prototype.ibody = null;
-jsToolBar.prototype.iframe_css = null;
-
-/* Editor methods
--------------------------------------------------------- */
-jsToolBar.prototype.drawToolBar = jsToolBar.prototype.draw;
-jsToolBar.prototype.draw = function(mode) {
-	mode = mode || 'xhtml';
-	
-	if (this.can_wwg) {
-		this.mode = 'wysiwyg';
-		this.drawToolBar('wysiwyg');
-		this.initWindow();
-	} else {
-		this.drawToolBar(mode);
-	}
-};
-
-jsToolBar.prototype.switchMode = function(mode) {
-	mode = mode || 'xhtml';
-	
-	if (mode == 'xhtml') {
-		this.draw(mode);
-	} else {
-		if (this.wwg_mode) {
-			this.syncContents('iframe');
-		}
-		this.removeEditor();
-		this.textarea.style.display = '';
-		this.drawToolBar(mode);
-	}
-};
-
-jsToolBar.prototype.syncContents = function(from) {
-	from = from || 'textarea';
-	var This = this;
-	if (from == 'textarea') {
-		initContent();
-	} else {
-		this.validBlockquote();
-		var html = this.applyHtmlFilters(this.ibody.innerHTML);
-		if (html == '<br />') { html = '<p></p>'; }
-		this.textarea.value = html;
-	}
-	
-	function initContent() {
-		if (!This.iframe.contentWindow.document || !This.iframe.contentWindow.document.body) {
-			setTimeout(initContent, 1);
-			return;
-		}
-		This.ibody = This.iframe.contentWindow.document.body;
-		
-		if (This.textarea.value != '' && This.textarea.value != '<p></p>') {
-			This.ibody.innerHTML = This.applyWysiwygFilters(This.textarea.value);
-			if (This.ibody.createTextRange) { //cursor at the begin for IE
-				var IErange = This.ibody.createTextRange();
-				IErange.execCommand("SelectAll");
-				IErange.collapse();
-				IErange.select();
-			}
-		} else if (window.navigator.product != undefined && 
-							 window.navigator.product == 'Gecko') {
-			This.ibody.innerHTML = '<p><br _moz_editor_blogus_node="TRUE" _moz_dirty=""></p>';
-		} else {
-			var idoc = This.iwin.document;
-			var para = idoc.createElement('p');
-			para.appendChild(idoc.createTextNode(''));
-			while (idoc.body.hasChildNodes()) {
-				idoc.body.removeChild(idoc.body.lastChild);
-			}
-			idoc.body.appendChild(para);
-		}
-	}
-};
-jsToolBar.prototype.htmlFilters = {
-	tagsoup: function(str){
-		return this.tagsoup2xhtml(str);
-	}
-};
-jsToolBar.prototype.applyHtmlFilters = function(str) {
-	for (var fn in this.htmlFilters) {
-		 str = this.htmlFilters[fn].call(this, str);
-	}
-	return str;
-};
-jsToolBar.prototype.wysiwygFilters = {};
-jsToolBar.prototype.applyWysiwygFilters = function( str) {
-	for (var fn in this.wysiwygFilters) {
-		 str = this.wysiwygFilters[fn].call(this, str);
-	}
-	return str;
-};
-
-jsToolBar.prototype.switchEdit = function() {
-	if (this.wwg_mode) {
-		this.textarea.style.display = '';
-		this.iframe.style.display = 'none';
-		this.syncContents('iframe');
-		this.drawToolBar('xhtml');
-		this.wwg_mode = false;
-		this.focusEditor();
-	} else {
-		this.iframe.style.display = '';
-		this.textarea.style.display = 'none';
-		this.syncContents('textarea');
-		this.drawToolBar('wysiwyg');
-		this.wwg_mode = true;
-		this.focusEditor();
-	}
-	this.setSwitcher();
-};
-
-/** Creates iframe for editor, inits a blank document
-*/
-jsToolBar.prototype.initWindow = function() {
-	var This = this;
-	
-	this.iframe = document.createElement('iframe');
-	this.textarea.parentNode.insertBefore(this.iframe,this.textarea.nextSibling);
-	
-	this.switcher = document.createElement('ul');
-	this.switcher.className = 'jstSwitcher';
-	this.editor.appendChild(this.switcher);
-	
-	this.iframe.height = this.textarea.offsetHeight + 0;
-	this.iframe.width = this.textarea.offsetWidth + 0;
-	
-	if (this.textarea.tabIndex != undefined) {
-		this.iframe.tabIndex = this.textarea.tabIndex;
-	}
-	
-	function initIframe() {
-		var doc = This.iframe.contentWindow.document;
-		if (!doc) {
-			setTimeout(initIframe,1);
-			return false;
-		}
-		
-		doc.open();
-		var html =
-		'<html>\n'+
-		'<head>\n'+
-		'<style type="text/css">'+This.iframe_css+'</style>\n'+
-		(This.base_url != '' ? '<base href="'+This.base_url+'" />' : '')+
-		'</head>\n'+
-		'<body>\n'+
-		'</body>\n'+
-		'</html>';
-		
-		doc.write(html);
-		doc.close();
-		if (document.all) { // for IE
-			doc.designMode = 'on';
-			// warning : doc is now inaccessible for IE6 sp1
-		}
-		
-		This.iwin = This.iframe.contentWindow;
-		
-		This.syncContents('textarea');
-		
-		if (This.wwg_mode == undefined) {
-			This.wwg_mode = true;
-		}
-		
-		if (This.wwg_mode) {
-			This.textarea.style.display = 'none';
-		} else {
-			This.iframe.style.display = 'none';
-		}
-		
-		// update textarea on submit
-		if (This.textarea.form) {
-			chainHandler(This.textarea.form,'onsubmit', function() {
-				if (This.wwg_mode) {
-					This.syncContents('iframe');
-				}
-			});
-		}
-		
-		for (var evt in This.iwinEvents) {
-			var event = This.iwinEvents[evt];
-			This.addIwinEvent(This.iframe.contentWindow.document, event.type, event.fn, This);
-		}
-		
-		This.setSwitcher();
-		setTimeout(function(){This.focusEditor();},1);
-		
-		return true;
-	}
-	initIframe();
-};
-jsToolBar.prototype.addIwinEvent = function(target, type, fn, scope) {
-	var myFn = function(e){fn.call(scope, e)};
-	addEvent(target, type, myFn, true);
-	// fix memory leak
-	addEvent(scope.iwin, 'unload', function(){
-		removeEvent(target, type, myFn, true);
-	}, true);
-};
-jsToolBar.prototype.iwinEvents = {
-	block1: {
-		type: 'mouseup',
-		fn: function(){ this.adjustBlockLevelCombo() }
-	},
-	block2: {
-		type: 'keyup',
-		fn: function(){ this.adjustBlockLevelCombo() }
-	}
-};
-
-/** Insert a mode switcher after editor area
-*/
-jsToolBar.prototype.switcher_visual_title = 'visual';
-jsToolBar.prototype.switcher_source_title = 'source';
-jsToolBar.prototype.setSwitcher = function() {
-	while (this.switcher.hasChildNodes()) {
-		this.switcher.removeChild(this.switcher.firstChild);
-	}
-	
-	var This = this;
-	function setLink(title,link) {
-		var li = document.createElement('li');
-		if (link) {
-			var a = document.createElement('a');
-			a.href = '#';
-			a.editor = This;
-			a.onclick = function() { this.editor.switchEdit(); return false; };
-			a.appendChild(document.createTextNode(title));
-		} else {
-			li.className = 'jstSwitcherCurrent';
-			a = document.createTextNode(title);
-		}
-		
-		li.appendChild(a);
-		This.switcher.appendChild(li);
-	}
-	
-	setLink(this.switcher_visual_title,!this.wwg_mode);
-	setLink(this.switcher_source_title,this.wwg_mode);
-};
-
-/** Removes editor area and mode switcher
-*/
-jsToolBar.prototype.removeEditor = function() {
-	if (this.iframe != null) {
-		this.iframe.parentNode.removeChild(this.iframe);
-		this.iframe = null;
-	}
-	
-	if (this.switcher != undefined && this.switcher.parentNode != undefined) {
-		this.switcher.parentNode.removeChild(this.switcher);
-	}
-};
-
-/** Focus on the editor area
-*/
-jsToolBar.prototype.focusEditor = function() {
-	if (this.wwg_mode) {
-		try { this.iwin.document.designMode = 'on'; } catch (e) {}; // Firefox needs this
-		var This = this;
-		setTimeout(function() {This.iframe.contentWindow.focus()},1);
-	} else {
-		this.textarea.focus();
-	}
-};
-
-/** Resizer
-*/
-jsToolBar.prototype.resizeSetStartH = function() {
-	if (this.wwg_mode && this.iframe != undefined) {
-		this.dragStartH = this.iframe.offsetHeight;
-		return;
-	}
-	this.dragStartH = this.textarea.offsetHeight + 0;
-};
-jsToolBar.prototype.resizeDragMove = function(event) {
-	var new_height = (this.dragStartH+event.clientY-this.dragStartY)+'px';
-	if (this.iframe != undefined) {
-		this.iframe.style.height = new_height;
-	}
-	this.textarea.style.height = new_height;
-};
-
-/* Editing methods
--------------------------------------------------------- */
-/** Replaces current selection by given node
-*/
-jsToolBar.prototype.insertNode = function(node) {
-	var range;
-	
-	if (this.iwin.getSelection) { // Gecko
-		var sel = this.iwin.getSelection();
-		range = sel.getRangeAt(0);
-		
-		// deselect all ranges
-		sel.removeAllRanges();
-		
-		// empty range
-		range.deleteContents();
-		
-		// Insert node
-		range.insertNode(node);
-		
-		range.selectNodeContents(node);
-		range.setEndAfter(node);
-		if (range.endContainer.childNodes.length > range.endOffset &&
-		range.endContainer.nodeType != Node.TEXT_NODE) {
-			range.setEnd(range.endContainer.childNodes[range.endOffset], 0);
-		} else {
-			range.setEnd(range.endContainer.childNodes[0]);
-		}
-		sel.addRange(range);
-		
-		sel.collapseToEnd();
-	} else { // IE
-		// lambda element
-		var p = this.iwin.document.createElement('div');
-		p.appendChild(node);
-		range = this.iwin.document.selection.createRange();
-		range.execCommand('delete');
-		// insert innerHTML from element
-		range.pasteHTML(p.innerHTML);
-		range.collapse(false);
-		range.select();
-	}
-	this.iwin.focus();
-};
-
-/** Returns a document fragment with selected nodes
-*/
-jsToolBar.prototype.getSelectedNode = function() {
-	if (this.iwin.getSelection) { // Gecko
-		var sel = this.iwin.getSelection();
-		var range = sel.getRangeAt(0);
-		var content = range.cloneContents();
-	} else { // IE
-		var sel = this.iwin.document.selection;
-		var d = this.iwin.document.createElement('div');
-		d.innerHTML = sel.createRange().htmlText;
-		var content = this.iwin.document.createDocumentFragment();
-		for (var i=0; i < d.childNodes.length; i++) {
-			content.appendChild(d.childNodes[i].cloneNode(true));
-		}
-	}
-	return content;
-};
-
-/** Returns string representation for selected node
-*/
-jsToolBar.prototype.getSelectedText = function() {
-	if (this.iwin.getSelection) { // Gecko
-		return this.iwin.getSelection().toString();
-	} else { // IE
-		var range = this.iwin.document.selection.createRange();
-		return range.text;
-	}
-};
-
-jsToolBar.prototype.replaceNodeByContent = function(node) {
-	var content = this.iwin.document.createDocumentFragment();
-	for (var i=0; i < node.childNodes.length; i++) {
-		content.appendChild(node.childNodes[i].cloneNode(true));
-	}
-	node.parentNode.replaceChild(content, node);
-};
-
-jsToolBar.prototype.getBlockLevel = function() {
-	var blockElts = ['p','h1','h2','h3','h4','h5','h6'];
-	
-	var range, commonAncestorContainer;
-	if (this.iwin.getSelection) { //gecko
-		var selection = this.iwin.getSelection();
-		range = selection.getRangeAt(0);
-		commonAncestorContainer = range.commonAncestorContainer;
-		while (commonAncestorContainer.nodeType != 1) {
-			commonAncestorContainer = commonAncestorContainer.parentNode;
-		}
-	} else { //ie
-		range = this.iwin.document.selection.createRange();
-		commonAncestorContainer = range.parentElement();
-	}
-	
-	var ancestorTagName = commonAncestorContainer.tagName.toLowerCase();
-	while (arrayIndexOf(blockElts, ancestorTagName)==-1 && ancestorTagName!='body') {
-		commonAncestorContainer = commonAncestorContainer.parentNode;
-		ancestorTagName = commonAncestorContainer.tagName.toLowerCase();
-	}
-	if (ancestorTagName == 'body') return null;
-	else return commonAncestorContainer;
-};
-jsToolBar.prototype.adjustBlockLevelCombo = function() {
-	var blockLevel = this.getBlockLevel();
-	if (blockLevel !== null)
-		this.toolNodes.blocks.value = blockLevel.tagName.toLowerCase();
-	else {
-		if (this.mode == 'wysiwyg') this.toolNodes.blocks.value = 'none';
-		if (this.mode == 'xhtml') this.toolNodes.blocks.value = 'nonebis';
-	}
-};
-
-/** HTML code cleanup
--------------------------------------------------------- */
-jsToolBar.prototype.simpleCleanRegex = new Array(
-	/* Remove every tags we don't need */
-	[/<meta[\w\W]*?>/gim,''],
-	[/<style[\w\W]*?>[\w\W]*?<\/style>/gim, ''],
-	[/<\/?font[\w\W]*?>/gim, ''],
-	
-	
-	/* Replacements */
-	[/<(\/?)(B|b|STRONG)([\s>\/])/g, "<$1strong$3"],
-	[/<(\/?)(I|i|EM)([\s>\/])/g, "<$1em$3"],
-	[/<IMG ([^>]*?[^\/])>/gi, "<img $1 />"],
-	[/<INPUT ([^>]*?[^\/])>/gi, "<input $1 />"],
-	[/<COL ([^>]*?[^\/])>/gi, "<col $1 />"],
-	[/<AREA ([^>]*?[^\/])>/gi, "<area $1 />"],
-	[/<PARAM ([^>]*?[^\/])>/gi, "<param $1 />"],
-	[/<HR ([^>]*?[^\/])>/gi, "<hr $1/>"],
-	[/<BR ([^>]*?[^\/])>/gi, "<br $1/>"],
-	[/<(\/?)U([\s>\/])/gi, "<$1ins$2"],
-	[/<(\/?)STRIKE([\s>\/])/gi, "<$1del$2"],
-	[/<span style="font-weight: normal;">([\w\W]*?)<\/span>/gm, "$1"],
-	[/<span style="font-weight: bold;">([\w\W]*?)<\/span>/gm, "<strong>$1</strong>"],
-	[/<span style="font-style: italic;">([\w\W]*?)<\/span>/gm, "<em>$1</em>"],
-	[/<span style="text-decoration: underline;">([\w\W]*?)<\/span>/gm, "<ins>$1</ins>"],
-	[/<span style="text-decoration: line-through;">([\w\W]*?)<\/span>/gm, "<del>$1</del>"],
-	[/<span style="text-decoration: underline line-through;">([\w\W]*?)<\/span>/gm, "<del><ins>$1</ins></del>"],
-	[/<span style="(font-weight: bold; ?|font-style: italic; ?){2}">([\w\W]*?)<\/span>/gm, "<strong><em>$2</em></strong>"],
-	[/<span style="(font-weight: bold; ?|text-decoration: underline; ?){2}">([\w\W]*?)<\/span>/gm, "<ins><strong>$2</strong></ins>"],
-	[/<span style="(font-weight: italic; ?|text-decoration: underline; ?){2}">([\w\W]*?)<\/span>/gm, "<ins><em>$2</em></ins>"],
-	[/<span style="(font-weight: bold; ?|text-decoration: line-through; ?){2}">([\w\W]*?)<\/span>/gm, "<del><strong>$2</strong></del>"],
-	[/<span style="(font-weight: italic; ?|text-decoration: line-through; ?){2}">([\w\W]*?)<\/span>/gm, "<del><em>$2</em></del>"],
-	[/<span style="(font-weight: bold; ?|font-style: italic; ?|text-decoration: underline; ?){3}">([\w\W]*?)<\/span>/gm, "<ins><strong><em>$2</em></strong></ins>"],
-	[/<span style="(font-weight: bold; ?|font-style: italic; ?|text-decoration: line-through; ?){3}">([\w\W]*?)<\/span>/gm, "<del><strong><em>$2</em></strong></del>"],
-	[/<span style="(font-weight: bold; ?|font-style: italic; ?|text-decoration: underline line-through; ?){3}">([\w\W]*?)<\/span>/gm, "<del><ins><strong><em>$2</em></strong></ins></del>"],
-	[/<strong style="font-weight: normal;">([\w\W]*?)<\/strong>/gm, "$1"],
-	[/<([a-z]+) style="font-weight: normal;">([\w\W]*?)<\/\1>/gm, "<$1>$2</$1>"],
-	[/<([a-z]+) style="font-weight: bold;">([\w\W]*?)<\/\1>/gm, "<$1><strong>$2</strong></$1>"],
-	[/<([a-z]+) style="font-style: italic;">([\w\W]*?)<\/\1>/gm, "<$1><em>$2</em></$1>"],
-	[/<([a-z]+) style="text-decoration: underline;">([\w\W]*?)<\/\1>/gm, "<ins><$1>$2</$1></ins>"],
-	[/<([a-z]+) style="text-decoration: line-through;">([\w\W]*?)<\/\1>/gm, "<del><$1>$2</$1></del>"],
-	[/<([a-z]+) style="text-decoration: underline line-through;">([\w\W]*?)<\/\1>/gm, "<del><ins><$1>$2</$1></ins></del>"],
-	[/<([a-z]+) style="(font-weight: bold; ?|font-style: italic; ?){2}">([\w\W]*?)<\/\1>/gm, "<$1><strong><em>$3</em></strong></$1>"],
-	[/<([a-z]+) style="(font-weight: bold; ?|text-decoration: underline; ?){2}">([\w\W]*?)<\/\1>/gm, "<ins><$1><strong>$3</strong></$1></ins>"],
-	[/<([a-z]+) style="(font-weight: italic; ?|text-decoration: underline; ?){2}">([\w\W]*?)<\/\1>/gm, "<ins><$1><em>$3</em></$1></ins>"],
-	[/<([a-z]+) style="(font-weight: bold; ?|text-decoration: line-through; ?){2}">([\w\W]*?)<\/\1>/gm, "<del><$1><strong>$3</strong></$1></del>"],
-	[/<([a-z]+) style="(font-weight: italic; ?|text-decoration: line-through; ?){2}">([\w\W]*?)<\/\1>/gm, "<del><$1><em>$3</em></$1></del>"],
-	[/<([a-z]+) style="(font-weight: bold; ?|font-style: italic; ?|text-decoration: underline; ?){3}">([\w\W]*?)<\/\1>/gm, "<ins><$1><strong><em>$3</em></strong></$1></ins>"],
-	[/<([a-z]+) style="(font-weight: bold; ?|font-style: italic; ?|text-decoration: line-through; ?){3}">([\w\W]*?)<\/\1>/gm, "<del><$1><strong><em>$3</em></strong></$1></del>"],
-	[/<([a-z]+) style="(font-weight: bold; ?|font-style: italic; ?|text-decoration: underline line-through; ?){3}">([\w\W]*?)<\/\1>/gm, "<del><ins><$1><strong><em>$3</em></strong></$1></ins></del>"],
-	[/<p><blockquote>(.*)(\n)+<\/blockquote><\/p>/i,"<blockquote>$1</blockquote>\n"],
-	/* mise en forme identique contigue */
-	[/<\/(strong|em|ins|del|q|code)>(\s*?)<\1>/gim, "$2"],
-	[/<(br|BR)>/g, "<br />"],
-	[/<(hr|HR)>/g, "<hr />"],
-	/* opera est trop strict ;)) */
-	[/([^\s])\/>/g, "$1 />"],
-	/* br intempestifs de fin de block */
-	[/<br \/>\s*<\/(h1|h2|h3|h4|h5|h6|ul|ol|li|p|blockquote|div)/gi, "</$1"],
-	[/<\/(h1|h2|h3|h4|h5|h6|ul|ol|li|p|blockquote)>([^\n\u000B\r\f])/gi, "</$1>\n$2"],
-	[/<hr style="width: 100%; height: 2px;" \/>/g, "<hr />"]
-);
-
-/** Cleanup HTML code
-*/
-jsToolBar.prototype.tagsoup2xhtml = function(html) {
-	for (var reg in this.simpleCleanRegex) {
-		html = html.replace(this.simpleCleanRegex[reg][0], this.simpleCleanRegex[reg][1]);
-	}
-	/* tags vides */
-	/* note : on tente de ne pas tenir compte des commentaires html, ceux-ci
-	   permettent entre autre d'inserer des commentaires conditionnels pour ie */
-	while ( /(<[^\/!]>|<[^\/!][^>]*[^\/]>)\s*<\/[^>]*[^-]>/.test(html) ) {
-		html = html.replace(/(<[^\/!]>|<[^\/!][^>]*[^\/]>)\s*<\/[^>]*[^-]>/g, "");
-	}
-	
-	/* tous les tags en minuscule */
-	html = html.replace(/<(\/?)([A-Z0-9]+)/g,
-			function(match0, match1, match2) {
-				return "<" + match1 + match2.toLowerCase();
-			});
-	
-	/* IE laisse souvent des attributs sans guillemets */
-	var myRegexp = /<[^>]+((\s+\w+\s*=\s*)([^"'][\w~@+$,%\/:.#?=&;!*()-]*))[^>]*?>/;
-	while ( myRegexp.test(html)) {
-		html = html.replace(
-			myRegexp,
-			function (str, val1, val2, val3){
-				var tamponRegex = new RegExp(regexpEscape(val1));
-				return str.replace(tamponRegex, val2+'"'+val3+'"');
-			}
-		)
-	}
-	
-	/* les navigateurs rajoutent une unite aux longueurs css nulles */
-	/* note: a ameliorer ! */
-	while ( /(<[^>]+style=(["'])[^>]+[\s:]+)0(pt|px)(\2|\s|;)/.test(html)) {
-		html = html.replace(/(<[^>]+style=(["'])[^>]+[\s:]+)0(pt|px)(\2|\s|;)/gi, "$1"+"0$4");
-	}
-	
-	/* correction des fins de lignes : le textarea edite contient des \n
-	* le wysiwyg des \r\n , et le textarea mis a jour SANS etre affiche des \r\n ! */
-	html = html.replace(/\r\n/g,"\n");
-	
-	/* Trim */
-	html = html.replace(/^\s+/gm,'');
-	html = html.replace(/\s+$/gm,'');
-	
-	return html;
-};
-jsToolBar.prototype.validBlockquote = function() {
-	var blockElts = ['address','blockquote','dl','div','fieldset','form','h1',
-	                 'h2','h3','h4','h5','h6','hr','ol','p','pre','table','ul'];
-	var BQs = this.iwin.document.getElementsByTagName('blockquote');
-	var bqChilds;
-	
-	for (var bq = 0; bq < BQs.length; bq++) {
-		bqChilds = BQs[bq].childNodes;
-		var frag = this.iwin.document.createDocumentFragment();
-		for (var i = (bqChilds.length-1); i >= 0; i--) {
-			if (bqChilds[i].nodeType == 1 && // Node.ELEMENT_NODE
-			    arrayIndexOf(blockElts, bqChilds[i].tagName.toLowerCase()) >= 0)
-			{
-				if (frag.childNodes.length > 0) {
-					var p = this.iwin.document.createElement('p');
-					p.appendChild(frag);
-					BQs[bq].replaceChild(p, bqChilds[i+1]);
-					frag = this.iwin.document.createDocumentFragment();
-				}
-			} else {
-				if (frag.childNodes.length > 0) BQs[bq].removeChild(bqChilds[i+1]);
-				frag.insertBefore(bqChilds[i].cloneNode(true), frag.firstChild);
-			}
-		}
-		if (frag.childNodes.length > 0) {
-			var p = this.iwin.document.createElement('p');
-			p.appendChild(frag);
-			BQs[bq].replaceChild(p, bqChilds[0]);
-		}
-	}
-};
-
-/* Removing text formating */
-jsToolBar.prototype.removeFormatRegexp = new Array(
-	[/(<[a-z][^>]*)margin\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)margin-bottom\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)margin-left\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)margin-right\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)margin-top\s*:[^;]*;/mg, "$1"],
-	
-	[/(<[a-z][^>]*)padding\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)padding-bottom\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)padding-left\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)padding-right\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)padding-top\s*:[^;]*;/mg, "$1"],
-	
-	[/(<[a-z][^>]*)font\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)font-family\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)font-size\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)font-style\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)font-variant\s*:[^;]*;/mg, "$1"],
-	[/(<[a-z][^>]*)font-weight\s*:[^;]*;/mg, "$1"],
-	
-	[/(<[a-z][^>]*)color\s*:[^;]*;/mg, "$1"]
-);
-
-jsToolBar.prototype.removeTextFormating = function(html) {
-	for (var reg in this.removeFormatRegexp) {
-		html = html.replace(this.removeFormatRegexp[reg][0], this.removeFormatRegexp[reg][1]);
-	}
-	
-	html = this.tagsoup2xhtml(html);
-	html = html.replace(/style="\s*?"/mgi,'');
-	return html;
-};
-
-/** Toolbar elements
--------------------------------------------------------- */
-jsToolBar.prototype.elements.blocks.wysiwyg = {
-	list: ['none','p','h1','h2','h3','h4','h5','h6'],
-	fn: function(opt) {
-		if (opt=='none') {
-			var blockLevel = this.getBlockLevel();
-			if (blockLevel !== null) {
-				this.replaceNodeByContent(blockLevel);
-			}
-			this.iwin.focus();
-		} else {
-			try { this.iwin.document.execCommand('formatblock',false,'<'+opt+'>');
-			} catch(e){};
-			this.iwin.focus();
-		}
-	}
-};
-
-jsToolBar.prototype.elements.strong.fn.wysiwyg = function() {
-	this.iwin.document.execCommand('bold', false, null);
-	this.iwin.focus();
-};
-
-jsToolBar.prototype.elements.em.fn.wysiwyg = function() {
-	this.iwin.document.execCommand('italic', false, null);
-	this.iwin.focus();
-};
-
-jsToolBar.prototype.elements.ins.fn.wysiwyg = function() {
-	this.iwin.document.execCommand('underline', false, null);
-	this.iwin.focus();
-};
-
-jsToolBar.prototype.elements.del.fn.wysiwyg = function() {
-	this.iwin.document.execCommand('strikethrough', false, null);
-	this.iwin.focus();
-};
-
-jsToolBar.prototype.elements.quote.fn.wysiwyg = function() {
-	var n = this.getSelectedNode();
-	var q = this.iwin.document.createElement('q');
-	q.appendChild(n);
-	this.insertNode(q);
-};
-
-jsToolBar.prototype.elements.code.fn.wysiwyg = function() {
-	var n = this.getSelectedNode();
-	var code = this.iwin.document.createElement('code');
-	code.appendChild(n);
-	this.insertNode(code);
-};
-
-jsToolBar.prototype.elements.br.fn.wysiwyg = function() {
-	var n = this.iwin.document.createElement('br');
-	this.insertNode(n);
-};
-
-jsToolBar.prototype.elements.blockquote.fn.wysiwyg = function() {
-	var n = this.getSelectedNode();
-	var q = this.iwin.document.createElement('blockquote');
-	q.appendChild(n);
-	this.insertNode(q);
-};
-
-jsToolBar.prototype.elements.pre.fn.wysiwyg = function() {
-	this.iwin.document.execCommand('formatblock',false,'<pre>');
-	this.iwin.focus();
-};
-
-jsToolBar.prototype.elements.ul.fn.wysiwyg = function() {
-	this.iwin.document.execCommand('insertunorderedlist',false,null);
-	this.iwin.focus();
-};
-
-jsToolBar.prototype.elements.ol.fn.wysiwyg = function() {
-	this.iwin.document.execCommand('insertorderedlist',false,null);
-	this.iwin.focus();
-};
-
-jsToolBar.prototype.elements.link.fn.wysiwyg = function() {
-	var href, hreflang;
-	var range, commonAncestorContainer;
-	if (this.iwin.getSelection) { //gecko
-		var selection = this.iwin.getSelection();
-		range = selection.getRangeAt(0);
-		commonAncestorContainer = range.commonAncestorContainer;
-		while (commonAncestorContainer.nodeType != 1) {
-			commonAncestorContainer = commonAncestorContainer.parentNode;
-		}
-	} else { //ie
-		range = this.iwin.document.selection.createRange();
-		commonAncestorContainer = range.parentElement();
-	}
-	
-	var ancestorTagName = commonAncestorContainer.tagName.toLowerCase();
-	while (ancestorTagName!='a' && ancestorTagName!='body') {
-		commonAncestorContainer = commonAncestorContainer.parentNode;
-		ancestorTagName = commonAncestorContainer.tagName.toLowerCase();
-	}
-	
-	// Update or remove link?
-	if (ancestorTagName == 'a') {
-		href = commonAncestorContainer.href || '';
-		hreflang = commonAncestorContainer.hreflang || '';
-	}
-	
-	href = window.prompt(this.elements.link.href_prompt,href);
-	
-	// Remove link
-	if (ancestorTagName == 'a' && href=='') {
-		this.replaceNodeByContent(commonAncestorContainer);
-	}
-	if (!href) return; // user cancel
-	
-	hreflang = window.prompt(this.elements.link.hreflang_prompt, hreflang);
-	
-	// Update link
-	if (ancestorTagName == 'a' && href) {
-		commonAncestorContainer.setAttribute('href', href);
-		if (hreflang) {
-			commonAncestorContainer.setAttribute('hreflang', hreflang);
-		} else {
-			commonAncestorContainer.removeAttribute('hreflang');
-		}
-		return;
-	}
-	
-	// Create link
-	var n = this.getSelectedNode();
-	var a = this.iwin.document.createElement('a');
-	a.href = href;
-	if (hreflang) a.setAttribute('hreflang',hreflang);
-	a.appendChild(n);
-	this.insertNode(a);
-};
-
-
-
-// Remove format and Toggle
-jsToolBar.prototype.elements.removeFormat = {
-	type: 'button',
-	title: 'Remove text formating',
-	fn: {}
-};
-jsToolBar.prototype.elements.removeFormat.disabled = !jsToolBar.prototype.can_wwg;
-jsToolBar.prototype.elements.removeFormat.fn.xhtml = function() {
-	var html = this.textarea.value;
-	html = this.removeTextFormating(html);
-	this.textarea.value = html;
-};
-jsToolBar.prototype.elements.removeFormat.fn.wysiwyg = function() {
-	var html = this.iwin.document.body.innerHTML;
-	html = this.removeTextFormating(html);
-	this.iwin.document.body.innerHTML = html;
-};
-/** Utilities
--------------------------------------------------------- */
-function arrayIndexOf(aArray, aValue){
-	if (typeof Array.indexOf == 'function') {
-		return aArray.indexOf(aValue);
-	} else {
-		var index = -1;
-		var l = aArray.length;
-		for (var i = 0; i < l ; i++) {
-			if (aArray[i] === aValue) {
-				index = i;
-				break;
-			}
-		}
-		return index;
-	}
-};
-function addEvent(obj, evType, fn, useCapture) {
-	if (obj.addEventListener){
-		obj.addEventListener(evType, fn, useCapture);
-		return true;
-	} else if (obj.attachEvent){
-		var r = obj.attachEvent("on"+evType, fn);
-		return r;
-	} else {
-		return false;
-	}
-};
-function removeEvent(obj, evType, fn, useCapture) {
-	if (obj.removeEventListener){
-		obj.removeEventListener(evType, fn, useCapture);
-		return true;
-	} else if (obj.detachEvent){
-		var r = obj.detachEvent("on"+evType, fn);
-		return r;
-	} else {
-		return false;
-  }
-};
-function regexpEscape(s) {
-	return s.replace(/([\\\^\$*+[\]?{}.=!:(|)])/g,"\\$1")
-};
Index: nc/admin/default-templates/js/jsToolBar/popup_link.js
===================================================================
--- inc/admin/default-templates/js/jsToolBar/popup_link.js	(revision 1056)
+++ 	(revision )
@@ -1,23 +1,0 @@
-$(function() {
-	$('#link-insert-cancel').click(function() {
-		window.close();
-	});
-	
-	$('#link-insert-ok').click(function() {
-		sendClose();
-		window.close();
-	});
-	
-	function sendClose() {
-		var insert_form = $('#link-insert-form').get(0);
-		if (insert_form == undefined) { return; }
-		
-		var tb = window.opener.the_toolbar;
-		var data = tb.elements.link.data;
-		
-		data.href = tb.stripBaseURL(insert_form.elements.href.value);
-		data.title = insert_form.elements.title.value;
-		data.hreflang = insert_form.elements.hreflang.value;
-		tb.elements.link.fncall[tb.mode].call(tb);
-	};
-});
Index: nc/admin/default-templates/js/jsToolBar/popup_media.js
===================================================================
--- inc/admin/default-templates/js/jsToolBar/popup_media.js	(revision 1056)
+++ 	(revision )
@@ -1,92 +1,0 @@
-$(function() {
-	var toolBar = window.opener.the_toolbar.textarea;
-	
-	$('#media-insert').onetabload(function() {
-		$('#media-insert-cancel').click(function() {
-			window.close();
-		});
-		
-		$('#media-insert-ok').click(function() {
-			sendClose();
-			window.close();
-		});
-	});
-	
-	function sendClose() {
-		var insert_form = $('#media-insert-form').get(0);
-		if (insert_form == undefined) { return; }
-		
-		var tb = window.opener.the_toolbar;
-		var type = insert_form.elements.type.value;
-		
-		var media_align_grid = {
-			left: 'float: left; margin: 0 1em 1em 0;',
-			right: 'float: right; margin: 0 0 1em 1em;',
-			center: 'text-align: center;'
-		};
-		
-		if (type == 'image')
-		{
-			tb.elements.img_select.data.src = tb.stripBaseURL($('input[name="src"]:checked',insert_form).val());
-			tb.elements.img_select.data.alignment = $('input[name="alignment"]:checked',insert_form).val();
-			tb.elements.img_select.data.link = $('input[name="insertion"]:checked',insert_form).val() == 'link';
-			
-			tb.elements.img_select.data.title = insert_form.elements.title.value;
-			tb.elements.img_select.data.description = $('input[name="description"]',insert_form).val();
-			tb.elements.img_select.data.url = tb.stripBaseURL(insert_form.elements.url.value);
-			tb.elements.img_select.fncall[tb.mode].call(tb);
-		}
-		else if (type == 'mp3')
-		{
-			var player = $('#public_player').val();
-			var align = $('input[name="alignment"]:checked',insert_form).val();
-			
-			if (align != undefined && align != 'none') {
-				player = '<div style="' + media_align_grid[align] + '">' + player + '</div>';
-			}
-			
-			tb.elements.mp3_insert.data.player = player.replace(/>/g,'>\n');
-			tb.elements.mp3_insert.fncall[tb.mode].call(tb);
-		}
-		else if (type == 'flv')
-		{
-			var oplayer = $('<div>'+$('#public_player').val()+'</div>');
-			var flashvars = $("[name=FlashVars]",oplayer).val();
-			
-			var align = $('input[name="alignment"]:checked',insert_form).val();
-			var title = insert_form.elements.title.value;
-			
-			if (title) {
-				flashvars = 'title='+encodeURI(title)+'&amp;'+flashvars;
-			}
-			$('object',oplayer).attr('width',$('#video_w').val());
-			$('object',oplayer).attr('height',$('#video_h').val());
-			flashvars = flashvars.replace(/(width=\d*)/,'width='+$('#video_w').val());
-			flashvars = flashvars.replace(/(height=\d*)/,'height='+$('#video_h').val());
-			
-			$("[name=FlashVars]",oplayer).val(flashvars);
-			var player = oplayer.html();	
-			
-			if (align != undefined && align != 'none') {
-				player = '<div style="' + media_align_grid[align] + '">' + player + '</div>';
-			}
-			
-			tb.elements.flv_insert.data.player = player.replace(/>/g,'>\n');
-			tb.elements.flv_insert.fncall[tb.mode].call(tb);
-		}
-		else
-		{
-			tb.elements.link.data.href = tb.stripBaseURL(insert_form.elements.url.value);
-			tb.elements.link.data.content = insert_form.elements.title.value;
-			tb.elements.link.fncall[tb.mode].call(tb);
-		}
-	};
-	
-	function playerFormat(s) {
-		s = s.replace(/&lt;/g,'<');
-		s = s.replace(/&gt;/g,'>\n');
-		s = s.replace(/&amp;/g,'&');
-		
-		return s;
-	};
-});
Index: nc/admin/default-templates/js/jsToolBar/popup_posts.js
===================================================================
--- inc/admin/default-templates/js/jsToolBar/popup_posts.js	(revision 1056)
+++ 	(revision )
@@ -1,16 +1,0 @@
-$(function() {
-	$('#link-insert-cancel').click(function() {
-		window.close();
-	});
-	
-	$('#form-entries tr>td.maximal>a').click(function() {
-		// Get post_id
-		var tb = window.opener.the_toolbar;
-		var data = tb.elements.link.data;
-		
-		data.href = tb.stripBaseURL($(this).attr('title'));
-		
-		tb.elements.link.fncall[tb.mode].call(tb);
-		window.close();
-	});
-});
Index: nc/admin/default-templates/js/meta-editor.js
===================================================================
--- inc/admin/default-templates/js/meta-editor.js	(revision 1056)
+++ 	(revision )
@@ -1,273 +1,0 @@
-//~ metaEditor & metaEditor.prototype should go to the core.
-function metaEditor(target,meta_field,meta_type) {
-	this.target = target;
-	this.meta_field = meta_field;
-	this.meta_type = meta_type;
-};
-
-metaEditor.prototype = {
-	meta_url: '',
-	text_confirm_remove: 'Are you sure you want to remove this %s?',
-	text_add_meta: 'Add a %s to this entry',
-	text_choose: 'Choose from list',
-	text_all: 'all',
-	text_separation: 'Separate each %s by comas',
-	
-	target: null,
-	meta_type: null,
-	meta_dialog: null,
-	meta_field: null,
-	submit_button: null,
-	post_id: false,
-	
-	service_uri: 'services.php',
-	
-	displayMeta: function(type,post_id) {
-		this.meta_type = type;
-		this.post_id = post_id;
-		this.target.empty();
-		
-		this.meta_dialog = $('<input type="text" />');
-		this.meta_dialog.attr('title',this.text_add_meta.replace(/%s/,this.meta_type));
-		this.meta_dialog.attr('id','post_meta_input');
-		// Meta dialog input
-		this.meta_dialog.keypress(function(evt) { // We don't want to submit form!
-			if (evt.keyCode == 13) {
-				This.addMeta(this.value);
-				return false;
-			}
-			return true;
-		});
-		
-		var This = this;
-		
-		this.submit_button = $('<input type="button" value="ok" />');
-		this.submit_button.click(function() {
-			var v = This.meta_dialog.val();
-			This.addMeta(v);
-			return false;
-		});
-		
-		this.addMetaDialog();
-		
-		if (this.post_id == false) {
-			this.target.append(this.meta_field);
-		}
-		this.displayMetaList();
-	},
-	
-	displayMetaList: function() {
-		var li;
-		if (this.meta_list == undefined) {
-			this.meta_list = $('<ul class="metaList"></ul>');
-			this.target.prepend(this.meta_list);
-		}
-		
-		if (this.post_id == false) {
-			var meta = this.splitMetaValues(this.meta_field.val());
-			
-			this.meta_list.empty();
-			for (var i=0; i<meta.length; i++) {
-				li = $('<li>'+meta[i]+'</li>');
-				a_remove = $('<a class="metaRemove" href="#">[x]</a>');
-				a_remove.get(0).caller = this;
-				a_remove.get(0).meta_id = meta[i];
-				a_remove.click(function() {
-					this.caller.removeMeta(this.meta_id);
-					return false;
-				});
-				li.append('&nbsp;').append(a_remove);
-				this.meta_list.append(li);
-			}
-		} else {
-			var This = this;
-			var params = {
-				f: 'getMeta',
-				metaType: this.meta_type,
-				sortby: 'metaId,asc',
-				postId: this.post_id
-			};
-			
-			$.get(this.service_uri,params,function(data) {
-				data = $(data);
-				
-				if (data.find('rsp').attr('status') != 'ok') { return; }
-				
-				This.meta_list.empty();
-				data.find('meta').each(function() {
-					var meta_id = $(this).text();
-					li = $('<li><a href="' + This.meta_url + $(this).attr('uri') + '">'+meta_id+'</a></li>');
-					a_remove = $('<a class="metaRemove" href="#">[x]</a>');
-					a_remove.get(0).caller = This;
-					a_remove.get(0).meta_id = meta_id;
-					a_remove.click(function() {
-						this.caller.removeMeta(this.meta_id);
-						return false;
-					});
-					li.append('&nbsp;').append(a_remove);
-					This.meta_list.append(li);
-				});
-			});
-		}
-	},
-	
-	addMetaDialog: function() {
-		var This = this;
-		
-		if (this.submit_button == null) {
-			this.target.append($('<p></p>').append(this.meta_dialog));
-		} else {
-			this.target.append($('<p></p>').append(this.meta_dialog).append(' ').append(this.submit_button));
-		}
-		
-		// View meta list
-		var a = $('<a href="#">' + this.text_choose + '</a>');
-		a.click(function() {
-			This.showMetaList(metaEditor.prototype.meta_type,$(this).parent());
-			return false;
-		});
-		if (this.text_separation != '') {
-			this.target.append($('<p></p>').addClass('form-note').append(this.text_separation.replace(/%s/,this.meta_type)));
-		}
-		this.target.append($('<p></p>').append(a));
-	},
-	
-	showMetaList: function(type,target) {
-		target.empty();
-		target.append('...');
-		target.addClass('addMeta');
-		
-		var params = {
-			f: 'getMeta',
-			metaType: this.meta_type,
-			sortby: 'metaId,asc'
-		};
-		
-		if (type == 'more') {
-			params.limit = '30';
-		}
-		
-		var This = this;
-		
-		$.get(this.service_uri,params,function(data) {
-			if ($(data).find('meta').length > 0) {
-				target.empty();
-				var meta_link;
-				
-				$(data).find('meta').each(function(i) {
-					meta_link = $('<a href="#">' + $(this).text() + '</a>');
-					meta_link.get(0).meta_id = $(this).text();
-					meta_link.click(function() {
-						var v = This.splitMetaValues(This.meta_dialog.val() + ',' + this.meta_id);
-						This.meta_dialog.val(v.join(','));
-						return false;
-					});
-					
-					if (i>0) {
-						target.append(', ');
-					}
-					target.append(meta_link);
-				});
-				
-				if (type == 'more') {
-					var a_more = $('<a href="#" class="metaGetMore"></a>');
-					a_more.append(This.text_all + String.fromCharCode(160)+String.fromCharCode(187));
-					a_more.click(function() {
-						This.showMetaList('all',target);
-						return false;
-					});
-					target.append(', ').append(a_more);
-				}
-			} else {
-				target.empty();
-			}
-		});
-	},
-	
-	addMeta: function(str) {
-		str = this.splitMetaValues(str).join(',');
-		if (this.post_id == false) {
-			str = this.splitMetaValues(this.meta_field.val() + ',' + str);
-			this.meta_field.val(str);
-			
-			this.meta_dialog.val('');
-			this.displayMetaList();
-		} else {
-			var params = {
-				xd_check: dotclear.nonce,
-				f: 'setPostMeta',
-				postId: this.post_id,
-				metaType: this.meta_type,
-				meta: str
-			};
-			
-			var This = this;
-			$.post(this.service_uri,params,function(data) {
-				if ($(data).find('rsp').attr('status') == 'ok') {
-					This.meta_dialog.val('');
-					This.displayMetaList();
-				} else {
-					alert($(data).find('message').text());
-				}
-			});
-		}
-	},
-	
-	removeMeta: function(meta_id) {
-		if (this.post_id == false) {
-			var meta = this.splitMetaValues(this.meta_field.val());
-			for (var i=0; i<meta.length; i++) {
-				if (meta[i] == meta_id) {
-					meta.splice(i,1);
-					break;
-				}
-			}
-			this.meta_field.val(meta.join(','));
-			this.displayMetaList();
-		} else {
-			var text_confirm_msg = this.text_confirm_remove.replace(/%s/,this.meta_type);
-			
-			if (window.confirm(text_confirm_msg)) {
-				var This = this;
-				var params = {
-					xd_check: dotclear.nonce,
-					f: 'delMeta',
-					postId: this.post_id,
-					metaId: meta_id,
-					metaType: this.meta_type
-				};
-				
-				$.post(this.service_uri,params,function(data) {
-					if ($(data).find('rsp').attr('status') == 'ok') {
-						This.displayMetaList();
-					} else {
-						alert($(data).find('message').text());
-					}
-				});
-			}
-		}
-	},
-	
-	splitMetaValues: function(str) {
-		function inArray(needle,stack) {
-			for (var i=0; i<stack.length; i++) {
-				if (stack[i] == needle) {
-					return true;
-				}
-			}
-			return false;
-		}
-		
-		var res = new Array();
-		var v = str.split(',');
-		v.sort();
-		for (var i=0; i<v.length; i++) {
-			v[i] = v[i].replace(/^\s*/,'').replace(/\s*$/,'');
-			if (v[i] != '' && !inArray(v[i],res)) {
-				res.push(v[i]);
-			}
-		}
-		res.sort();
-		return res;
-	}
-};
Index: nc/admin/default-templates/js/prelude.js
===================================================================
--- inc/admin/default-templates/js/prelude.js	(revision 1056)
+++ 	(revision )
@@ -1,20 +1,0 @@
-// Accessibility links thks to vie-publique.fr
-aFocus = function() {
-	if(document.getElementById("prelude")) {
-		var aElts = document.getElementById("prelude").getElementsByTagName("A");
-		for (var i=0; i<aElts.length; i++) {
-			aElts[i].className="hidden";
-			aElts[i].onfocus=function() {
-				this.className="";
-			}
-		}
-	}
-}
-// events onload
-function addLoadEvent(func) {
-	if (window.addEventListener)
-		window.addEventListener("load", func, false);
-	else if (window.attachEvent)
-		window.attachEvent("onload", func);
-}
-addLoadEvent(aFocus);
Index: nc/admin/default-templates/js/tool-man/cookies.js
===================================================================
--- inc/admin/default-templates/js/tool-man/cookies.js	(revision 1056)
+++ 	(revision )
@@ -1,34 +1,0 @@
-/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt)
-
-based on http://www.quirksmode.org/js/cookies.html
-*/
-
-ToolMan._cookieOven = {
-	
-	set : function(name, value, expirationInDays) {
-		if (expirationInDays) {
-			var date = new Date()
-			date.setTime(date.getTime() + (expirationInDays * 24 * 60 * 60 * 1000))
-			var expires = "; expires=" + date.toGMTString()
-		} else {
-			var expires = ""
-		}
-		document.cookie = name + "=" + value + expires + "; path=/"
-	},
-	
-	get : function(name) {
-		var namePattern = name + "="
-		var cookies = document.cookie.split(';')
-		for(var i = 0, n = cookies.length; i < n; i++) {
-			var c = cookies[i]
-			while (c.charAt(0) == ' ') c = c.substring(1, c.length)
-			if (c.indexOf(namePattern) == 0)
-				return c.substring(namePattern.length, c.length)
-		}
-		return null
-	},
-	
-	eraseCookie : function(name) {
-		createCookie(name, "", -1)
-	}
-};
Index: nc/admin/default-templates/js/tool-man/coordinates.js
===================================================================
--- inc/admin/default-templates/js/tool-man/coordinates.js	(revision 1056)
+++ 	(revision )
@@ -1,154 +1,0 @@
-/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */
-
-/* FIXME: assumes position styles are specified in 'px' */
-
-ToolMan._coordinatesFactory = {
-	
-	create : function(x, y) {
-		// FIXME: Safari won't parse 'throw' and aborts trying to do anything with this file
-		//if (isNaN(x) || isNaN(y)) throw "invalid x,y: " + x + "," + y
-		return new _ToolManCoordinate(this, x, y)
-	},
-	
-	origin : function() {
-		return this.create(0, 0)
-	},
-	
-	/*
-	 * FIXME: Safari 1.2, returns (0,0) on absolutely positioned elements
-	 */
-	topLeftPosition : function(element) {
-		var left = parseInt(ToolMan.css().readStyle(element, "left"))
-		var left = isNaN(left) ? 0 : left
-		var top = parseInt(ToolMan.css().readStyle(element, "top"))
-		var top = isNaN(top) ? 0 : top
-		
-		return this.create(left, top)
-	},
-	
-	bottomRightPosition : function(element) {
-		return this.topLeftPosition(element).plus(this._size(element))
-	},
-	
-	topLeftOffset : function(element) {
-		var offset = this._offset(element) 
-		
-		var parent = element.offsetParent
-		while (parent) {
-			offset = offset.plus(this._offset(parent))
-			parent = parent.offsetParent
-		}
-		return offset
-	},
-	
-	bottomRightOffset : function(element) {
-		return this.topLeftOffset(element).plus(
-				this.create(element.offsetWidth, element.offsetHeight))
-	},
-	
-	scrollOffset : function() {
-		if (window.pageXOffset) {
-			return this.create(window.pageXOffset, window.pageYOffset)
-		} else if (document.documentElement) {
-			return this.create(
-					document.body.scrollLeft + document.documentElement.scrollLeft, 
-					document.body.scrollTop + document.documentElement.scrollTop)
-		} else if (document.body.scrollLeft >= 0) {
-			return this.create(document.body.scrollLeft, document.body.scrollTop)
-		} else {
-			return this.create(0, 0)
-		}
-	},
-	
-	clientSize : function() {
-		if (window.innerHeight >= 0) {
-			return this.create(window.innerWidth, window.innerHeight)
-		} else if (document.documentElement) {
-			return this.create(document.documentElement.clientWidth,
-					document.documentElement.clientHeight)
-		} else if (document.body.clientHeight >= 0) {
-			return this.create(document.body.clientWidth,
-					document.body.clientHeight)
-		} else {
-			return this.create(0, 0)
-		}
-	},
-	
-	/**
-	 * mouse coordinate relative to the window (technically the
-	 * browser client area) i.e. the part showing your page
-	 *
-	 * NOTE: in Safari the coordinate is relative to the document
-	 */
-	mousePosition : function(event) {
-		event = ToolMan.events().fix(event)
-		return this.create(event.clientX, event.clientY)
-	},
-	
-	/**
-	 * mouse coordinate relative to the document
-	 */
-	mouseOffset : function(event) {
-		event = ToolMan.events().fix(event)
-		if (event.pageX >= 0 || event.pageX < 0) {
-			return this.create(event.pageX, event.pageY)
-		} else if (event.clientX >= 0 || event.clientX < 0) {
-			return this.mousePosition(event).plus(this.scrollOffset())
-		}
-	},
-	
-	_size : function(element) {
-	/* TODO: move to a Dimension class */
-		return this.create(element.offsetWidth, element.offsetHeight)
-	},
-	
-	_offset : function(element) {
-		return this.create(element.offsetLeft, element.offsetTop)
-	}
-}
-
-function _ToolManCoordinate(factory, x, y) {
-	this.factory = factory
-	this.x = isNaN(x) ? 0 : x
-	this.y = isNaN(y) ? 0 : y
-}
-
-_ToolManCoordinate.prototype = {
-	toString : function() {
-		return "(" + this.x + "," + this.y + ")"
-	},
-	
-	plus : function(that) {
-		return this.factory.create(this.x + that.x, this.y + that.y)
-	},
-	
-	minus : function(that) {
-		return this.factory.create(this.x - that.x, this.y - that.y)
-	},
-	
-	min : function(that) {
-		return this.factory.create(
-				Math.min(this.x , that.x), Math.min(this.y , that.y))
-	},
-	
-	max : function(that) {
-		return this.factory.create(
-				Math.max(this.x , that.x), Math.max(this.y , that.y))
-	},
-	
-	constrainTo : function (one, two) {
-		var min = one.min(two)
-		var max = one.max(two)
-		
-		return this.max(min).min(max)
-	},
-	
-	distance : function (that) {
-		return Math.sqrt(Math.pow(this.x - that.x, 2) + Math.pow(this.y - that.y, 2))
-	},
-	
-	reposition : function(element) {
-		element.style["top"] = this.y + "px"
-		element.style["left"] = this.x + "px"
-	}
-}
Index: nc/admin/default-templates/js/tool-man/core.js
===================================================================
--- inc/admin/default-templates/js/tool-man/core.js	(revision 1056)
+++ 	(revision )
@@ -1,170 +1,0 @@
-/*
-Copyright (c) 2005 Tim Taylor Consulting <http://tool-man.org/>
-
-Permission is hereby granted, free of charge, to any person obtaining a
-copy of this software and associated documentation files (the "Software"),
-to deal in the Software without restriction, including without limitation
-the rights to use, copy, modify, merge, publish, distribute, sublicense,
-and/or sell copies of the Software, and to permit persons to whom the
-Software is furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included
-in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
-*/
-
-var ToolMan = {
-	events : function() {
-		if (!ToolMan._eventsFactory) throw "ToolMan Events module isn't loaded";
-		return ToolMan._eventsFactory
-	},
-	
-	css : function() {
-		if (!ToolMan._cssFactory) throw "ToolMan CSS module isn't loaded";
-		return ToolMan._cssFactory
-	},
-	
-	coordinates : function() {
-		if (!ToolMan._coordinatesFactory) throw "ToolMan Coordinates module isn't loaded";
-		return ToolMan._coordinatesFactory
-	},
-	
-	drag : function() {
-		if (!ToolMan._dragFactory) throw "ToolMan Drag module isn't loaded";
-		return ToolMan._dragFactory
-	},
-	
-	dragsort : function() {
-		if (!ToolMan._dragsortFactory) throw "ToolMan DragSort module isn't loaded";
-		return ToolMan._dragsortFactory
-	},
-	
-	helpers : function() {
-		return ToolMan._helpers
-	},
-	
-	cookies : function() {
-		if (!ToolMan._cookieOven) throw "ToolMan Cookie module isn't loaded";
-		return ToolMan._cookieOven
-	},
-	
-	junkdrawer : function() {
-		return ToolMan._junkdrawer
-	}
-	
-}
-
-ToolMan._helpers = {
-	map : function(array, func) {
-		for (var i = 0, n = array.length; i < n; i++) func(array[i])
-	},
-	
-	nextItem : function(item, nodeName) {
-		if (item == null) return false;
-		var next = item.nextSibling
-		while (next != null) {
-			if (next.nodeName == nodeName) return next
-			next = next.nextSibling
-		}
-		return null
-	},
-	
-	previousItem : function(item, nodeName) {
-		var previous = item.previousSibling
-		while (previous != null) {
-			if (previous.nodeName == nodeName) return previous
-			previous = previous.previousSibling
-		}
-		return null
-	},
-	
-	moveBefore : function(item1, item2) {
-		var parent = item1.parentNode
-		parent.removeChild(item1)
-		parent.insertBefore(item1, item2)
-	},
-	
-	moveAfter : function(item1, item2) {
-		var parent = item1.parentNode
-		parent.removeChild(item1)
-		parent.insertBefore(item1, item2 ? item2.nextSibling : null)
-	}
-}
-
-/** 
- * scripts without a proper home
- *
- * stuff here is subject to change unapologetically and without warning
- */
-ToolMan._junkdrawer = {
-	serializeList : function(list) {
-		var items = list.getElementsByTagName("li")
-		var array = new Array()
-		for (var i = 0, n = items.length; i < n; i++) {
-			var item = items[i]
-			
-			array.push(ToolMan.junkdrawer()._identifier(item))
-		}
-		return array.join('|')
-	},
-	
-	inspectListOrder : function(id) {
-		alert(ToolMan.junkdrawer().serializeList(document.getElementById(id)))
-	},
-	
-	restoreListOrder : function(listID) {
-		var list = document.getElementById(listID)
-		if (list == null) return
-		
-		var cookie = ToolMan.cookies().get("list-" + listID)
-		if (!cookie) return;
-		
-		var IDs = cookie.split('|')
-		var items = ToolMan.junkdrawer()._itemsByID(list)
-		
-		for (var i = 0, n = IDs.length; i < n; i++) {
-			var itemID = IDs[i]
-			if (itemID in items) {
-				var item = items[itemID]
-				list.removeChild(item)
-				list.insertBefore(item, null)
-			}
-		}
-	},
-	
-	_identifier : function(item) {
-		var trim = ToolMan.junkdrawer().trim
-		var identifier
-		
-		identifier = trim(item.getAttribute("id"))
-		if (identifier != null && identifier.length > 0) return identifier;
-		
-		identifier = trim(item.getAttribute("itemID"))
-		if (identifier != null && identifier.length > 0) return identifier;
-		
-		// FIXME: strip out special chars or make this an MD5 hash or something
-		return trim(item.innerHTML)
-	},
-	
-	_itemsByID : function(list) {
-		var array = new Array()
-		var items = list.getElementsByTagName('li')
-		for (var i = 0, n = items.length; i < n; i++) {
-			var item = items[i]
-			array[ToolMan.junkdrawer()._identifier(item)] = item
-		}
-		return array
-	},
-	
-	trim : function(text) {
-		if (text == null) return null
-		return text.replace(/^(\s+)?(.*\S)(\s+)?$/, '$2')
-	}
-}
Index: nc/admin/default-templates/js/tool-man/css.js
===================================================================
--- inc/admin/default-templates/js/tool-man/css.js	(revision 1056)
+++ 	(revision )
@@ -1,17 +1,0 @@
-/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */
-
-// TODO: write unit tests
-ToolMan._cssFactory = {
-	readStyle : function(element, property) {
-		if (element.style[property]) {
-			return element.style[property]
-		} else if (element.currentStyle) {
-			return element.currentStyle[property]
-		} else if (document.defaultView && document.defaultView.getComputedStyle) {
-			var style = document.defaultView.getComputedStyle(element, null)
-			return style.getPropertyValue(property)
-		} else {
-			return null
-		}
-	}
-}
Index: nc/admin/default-templates/js/tool-man/drag.js
===================================================================
--- inc/admin/default-templates/js/tool-man/drag.js	(revision 1056)
+++ 	(revision )
@@ -1,249 +1,0 @@
-/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */
-
-ToolMan._dragFactory = {
-	createSimpleGroup : function(element, handle) {
-		handle = handle ? handle : element
-		var group = this.createGroup(element)
-		group.setHandle(handle)
-		//group.transparentDrag()
-		group.onTopWhileDragging()
-		return group
-	},
-	
-	createGroup : function(element) {
-		var group = new _ToolManDragGroup(this, element)
-		
-		var position = ToolMan.css().readStyle(element, 'position')
-		if (position == 'static') {
-			element.style["position"] = 'relative'
-		} else if (position == 'absolute') {
-			/* for Safari 1.2 */
-			ToolMan.coordinates().topLeftOffset(element).reposition(element)
-		}
-		
-		// TODO: only if ToolMan.isDebugging()
-		group.register('draginit', this._showDragEventStatus)
-		group.register('dragmove', this._showDragEventStatus)
-		group.register('dragend', this._showDragEventStatus)
-		
-		return group
-	},
-	
-	_showDragEventStatus : function(dragEvent) {
-		window.status = dragEvent.toString()
-	},
-	
-	constraints : function() {
-		return this._constraintFactory
-	},
-	
-	_createEvent : function(type, event, group) {
-		return new _ToolManDragEvent(type, event, group)
-	}
-}
-
-function _ToolManDragGroup(factory, element) {
-	this.factory = factory
-	this.element = element
-	this._handle = null
-	this._thresholdDistance = 0
-	this._transforms = new Array()
-	// TODO: refactor into a helper object, move into events.js
-	this._listeners = new Array()
-	this._listeners['draginit'] = new Array()
-	this._listeners['dragstart'] = new Array()
-	this._listeners['dragmove'] = new Array()
-	this._listeners['dragend'] = new Array()
-}
-
-_ToolManDragGroup.prototype = {
-	/*
-	 * TODO:
-	 *   - unregister(type, func)
-	 *   - move custom event listener stuff into Event library
-	 *   - keyboard nudging of "selected" group
-	 */
-	
-	setHandle : function(handle) {
-		var events = ToolMan.events()
-		
-		handle.toolManDragGroup = this
-		events.register(handle, 'mousedown', this._dragInit)
-		//handle.onmousedown = function() { return false }
-		
-		if (this.element != handle)
-			events.unregister(this.element, 'mousedown', this._dragInit)
-	},
-	
-	register : function(type, func) {
-		this._listeners[type].push(func)
-	},
-	
-	addTransform : function(transformFunc) {
-		this._transforms.push(transformFunc)
-	},
-	
-	verticalOnly : function() {
-		this.addTransform(this.factory.constraints().vertical())
-	},
-	
-	horizontalOnly : function() {
-		this.addTransform(this.factory.constraints().horizontal())
-	},
-	
-	setThreshold : function(thresholdDistance) {
-		this._thresholdDistance = thresholdDistance
-	},
-	
-	transparentDrag : function(opacity) {
-		if (typeof(opacity) == "undefined") {
-			opacity = 0.75;
-		}
-		var originalOpacity = ToolMan.css().readStyle(this.element, "opacity")
-		
-		this.register('dragstart', function(dragEvent) {
-			var element = dragEvent.group.element
-			element.style.opacity = opacity
-			element.style.filter = 'alpha(opacity=' + (opacity * 100) + ')'
-		})
-		this.register('dragend', function(dragEvent) {
-			var element = dragEvent.group.element
-			element.style.opacity = originalOpacity
-			element.style.filter = 'alpha(opacity=100)'
-		})
-	},
-	
-	onTopWhileDragging : function(zIndex) {
-		if (typeof(zIndex) == "undefined") {
-			zIndex = 100000;
-		}
-		
-		var originalZIndex = ToolMan.css().readStyle(this.element, "z-index")
-		
-		this.register('dragstart', function(dragEvent) {
-			dragEvent.group.element.style.zIndex = zIndex
-		})
-		this.register('dragend', function(dragEvent) {
-			if (typeof(originalZIndex) != "undefined") {
-				dragEvent.group.element.style.zIndex = originalZIndex
-			}
-			//dragEvent.group.element.style.backgroundColor = '#f00';
-		})
-	},
-	
-	_dragInit : function(event) {
-		event = ToolMan.events().fix(event)
-		var group = document.toolManDragGroup = this.toolManDragGroup
-		var dragEvent = group.factory._createEvent('draginit', event, group)
-		
-		group._isThresholdExceeded = false
-		group._initialMouseOffset = dragEvent.mouseOffset
-		group._grabOffset = dragEvent.mouseOffset.minus(dragEvent.topLeftOffset)
-		ToolMan.events().register(document, 'mousemove', group._drag)
-		document.onmousemove = function() { return false }
-		ToolMan.events().register(document, 'mouseup', group._dragEnd)
-		
-		ToolMan.events().register(document, 'mousedown',group._drag);
-		document.onmousedown = function() { return false; };
-		
-		group._notifyListeners(dragEvent)
-	},
-	
-	_drag : function(event) {
-		event = ToolMan.events().fix(event)
-		var coordinates = ToolMan.coordinates()
-		var group = this.toolManDragGroup
-		if (!group) return
-		var dragEvent = group.factory._createEvent('dragmove', event, group)
-		
-		var newTopLeftOffset = dragEvent.mouseOffset.minus(group._grabOffset)
-		
-		// TODO: replace with DragThreshold object
-		if (!group._isThresholdExceeded) {
-			var distance = 
-					dragEvent.mouseOffset.distance(group._initialMouseOffset)
-			if (distance < group._thresholdDistance) return
-			group._isThresholdExceeded = true
-			group._notifyListeners(
-					group.factory._createEvent('dragstart', event, group))
-		}
-		
-		for (i in group._transforms) {
-			var transform = group._transforms[i]
-			newTopLeftOffset = transform(newTopLeftOffset, dragEvent)
-		}
-		
-		var dragDelta = newTopLeftOffset.minus(dragEvent.topLeftOffset)
-		var newTopLeftPosition = dragEvent.topLeftPosition.plus(dragDelta)
-		newTopLeftPosition.reposition(group.element)
-		dragEvent.transformedMouseOffset = newTopLeftOffset.plus(group._grabOffset)
-		
-		group._notifyListeners(dragEvent)
-		
-		var errorDelta = newTopLeftOffset.minus(coordinates.topLeftOffset(group.element))
-		if (errorDelta.x != 0 || errorDelta.y != 0) {
-			coordinates.topLeftPosition(group.element).plus(errorDelta).reposition(group.element)
-		}
-	},
-	
-	_dragEnd : function(event) {
-		event = ToolMan.events().fix(event)
-		var group = this.toolManDragGroup
-		var dragEvent = group.factory._createEvent('dragend', event, group)
-		
-		group._notifyListeners(dragEvent)
-		
-		this.toolManDragGroup = null
-		ToolMan.events().unregister(document, 'mousemove', group._drag)
-		document.onmousemove = null
-		ToolMan.events().unregister(document, 'mouseup', group._dragEnd)
-		
-		ToolMan.events().register(document, 'mousedown', group._drag);
-		document.onmousedown = function() { return true };
-	},
-	
-	_notifyListeners : function(dragEvent) {
-		var listeners = this._listeners[dragEvent.type]
-		for (i in listeners) {
-			listeners[i](dragEvent)
-		}
-	}
-}
-
-function _ToolManDragEvent(type, event, group) {
-	this.type = type
-	this.group = group
-	this.mousePosition = ToolMan.coordinates().mousePosition(event)
-	this.mouseOffset = ToolMan.coordinates().mouseOffset(event)
-	this.transformedMouseOffset = this.mouseOffset
-	this.topLeftPosition = ToolMan.coordinates().topLeftPosition(group.element)
-	this.topLeftOffset = ToolMan.coordinates().topLeftOffset(group.element)
-}
-
-_ToolManDragEvent.prototype = {
-	toString : function() {
-		return "mouse: " + this.mousePosition + this.mouseOffset + "    " +
-				"xmouse: " + this.transformedMouseOffset + "    " +
-				"left,top: " + this.topLeftPosition + this.topLeftOffset
-	}
-}
-
-ToolMan._dragFactory._constraintFactory = {
-	vertical : function() {
-		return function(coordinate, dragEvent) {
-			var x = dragEvent.topLeftOffset.x
-			return coordinate.x != x
-					? coordinate.factory.create(x, coordinate.y) 
-					: coordinate
-		}
-	},
-	
-	horizontal : function() {
-		return function(coordinate, dragEvent) {
-			var y = dragEvent.topLeftOffset.y
-			return coordinate.y != y
-					? coordinate.factory.create(coordinate.x, y) 
-					: coordinate
-		}
-	}
-}
Index: nc/admin/default-templates/js/tool-man/dragsort.js
===================================================================
--- inc/admin/default-templates/js/tool-man/dragsort.js	(revision 1056)
+++ 	(revision )
@@ -1,87 +1,0 @@
-/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */
-
-ToolMan._dragsortFactory = {
-	makeSortable : function(item) {
-		var group = ToolMan.drag().createSimpleGroup(item)
-		
-		group.register('dragstart', this._onDragStart)
-		group.register('dragmove', this._onDragMove)
-		group.register('dragend', this._onDragEnd)
-		
-		return group
-	},
-	
-	/** 
-	 * Iterates over a list's items, making them sortable, applying
-	 * optional functions to each item.
-	 *
-	 * example: makeListSortable(myList, myFunc1, myFunc2, ... , myFuncN)
-	 */
-	makeListSortable : function(list) {
-		var helpers = ToolMan.helpers()
-		var coordinates = ToolMan.coordinates()
-		var items = list.getElementsByTagName("li")
-		
-		helpers.map(items, function(item) {
-			var dragGroup = dragsort.makeSortable(item)
-			dragGroup.setThreshold(4)
-			var min, max
-			dragGroup.addTransform(function(coordinate, dragEvent) {
-				return coordinate.constrainTo(min, max)
-			})
-			dragGroup.register('dragstart', function() {
-				var items = list.getElementsByTagName("li")
-				min = max = coordinates.topLeftOffset(items[0])
-				for (var i = 1, n = items.length; i < n; i++) {
-					var offset = coordinates.topLeftOffset(items[i])
-					min = min.min(offset)
-					max = max.max(offset)
-				}
-			})
-		})
-		for (var i = 1, n = arguments.length; i < n; i++)
-			helpers.map(items, arguments[i])
-	},
-	
-	_onDragStart : function(dragEvent) {
-	},
-	
-	_onDragMove : function(dragEvent) {
-		var helpers = ToolMan.helpers()
-		var coordinates = ToolMan.coordinates()
-		
-		var item = dragEvent.group.element
-		var xmouse = dragEvent.transformedMouseOffset
-		var moveTo = null
-		
-		var previous = helpers.previousItem(item, item.nodeName)
-		while (previous != null) {
-			var bottomRight = coordinates.bottomRightOffset(previous)
-			if (xmouse.y <= bottomRight.y && xmouse.x <= bottomRight.x) {
-				moveTo = previous
-			}
-			previous = helpers.previousItem(previous, item.nodeName)
-		}
-		if (moveTo != null) {
-			helpers.moveBefore(item, moveTo)
-			return
-		}
-		
-		var next = helpers.nextItem(item, item.nodeName)
-		while (next != null) {
-			var topLeft = coordinates.topLeftOffset(next)
-			if (topLeft.y <= xmouse.y && topLeft.x <= xmouse.x) {
-				moveTo = next
-			}
-			next = helpers.nextItem(next, item.nodeName)
-		}
-		if (moveTo != null) {
-			helpers.moveBefore(item, helpers.nextItem(moveTo, item.nodeName))
-			return
-		}
-	},
-	
-	_onDragEnd : function(dragEvent) {
-		ToolMan.coordinates().create(0, 0).reposition(dragEvent.group.element)
-	}
-}
Index: nc/admin/default-templates/js/tool-man/events.js
===================================================================
--- inc/admin/default-templates/js/tool-man/events.js	(revision 1056)
+++ 	(revision )
@@ -1,43 +1,0 @@
-/* Copyright (c) 2005 Tim Taylor Consulting (see LICENSE.txt) */
-
-ToolMan._eventsFactory = {
-	fix : function(event) {
-		if (!event) event = window.event
-		
-		if (event.target) {
-			if (event.target.nodeType == 3) event.target = event.target.parentNode
-		} else if (event.srcElement) {
-			event.target = event.srcElement
-		}
-		
-		return event
-	},
-	
-	register : function(element, type, func) {
-		if (element.addEventListener) {
-			element.addEventListener(type, func, false)
-		} else if (element.attachEvent) {
-			if (!element._listeners) element._listeners = new Array()
-			if (!element._listeners[type]) element._listeners[type] = new Array()
-			var workaroundFunc = function() {
-				func.apply(element, new Array())
-			}
-			element._listeners[type][func] = workaroundFunc
-			element.attachEvent('on' + type, workaroundFunc)
-		}
-	},
-	
-	unregister : function(element, type, func) {
-		if (element.removeEventListener) {
-			element.removeEventListener(type, func, false)
-		} else if (element.detachEvent) {
-			if (element._listeners 
-					&& element._listeners[type] 
-					&& element._listeners[type][func]) {
-						
-				element.detachEvent('on' + type, 
-						element._listeners[type][func])
-			}
-		}
-	}
-}
Index: nc/admin/default-templates/js_helpers.html.twig
===================================================================
--- inc/admin/default-templates/js_helpers.html.twig	(revision 1091)
+++ 	(revision )
@@ -1,273 +1,0 @@
-{# JS Helpers #}
-
-{% macro load(src,type) -%}
-	{% if not memorized('jsload',src) -%}
-		{{ memorize('jsload',src) -}}
-		{% set type = type|default('text/javascript') -%}
-		<script type="{{ type }}" src="{{ theme_url }}{{ src }}"></script>
-	{%- endif %}
-{%- endmacro %}
-
-{% macro common() %}
-	<!-- jsCommon -->
-	{{ _self.load('js/jquery/jquery.js') }}
-	{{ _self.load('js/jquery/jquery.biscuit.js') }}
-	{{ _self.load('js/jquery/jquery.bgFade.js') }}
-	{{ _self.load('js/jquery/jquery.constantfooter.js') }}
-	{{ _self.load('js/common.js') }}
-	{{ _self.load('js/prelude.js') }}
-	<script type="text/javascript">
-	//<![CDATA[
-		dotclear.nonce = '{{session.nonce}}';
-		dotclear.img_plus_src = '{{theme_url}}images/expand.png';
-		dotclear.img_plus_alt = '{{__('uncover')}}';
-		dotclear.img_minus_src = '{{theme_url}}images/hide.png';
-		dotclear.img_minus_alt = '{{__('hide')}}';
-		dotclear.img_menu_on = '{{theme_url}}images/menu_on.png';
-		dotclear.img_menu_off = '{{theme_url}}images/menu_off.png';
-		dotclear.msg.help = '{{__('help')}}';
-		dotclear.msg.no_selection = '{{__('no selection')}}';
-		dotclear.msg.select_all = '{{__('select all')}}';
-		dotclear.msg.invert_sel = '{{__('invert selection')}}';
-		dotclear.msg.website = '{{__('Web site:')}}';
-		dotclear.msg.email = '{{__('Email:')}}';
-		dotclear.msg.ip_address = '{{__('IP address:')}}';
-		dotclear.msg.error = '{{__('Error:')}}';
-		dotclear.msg.entry_created = '{{__('Entry has been successfully created.')}}';
-		dotclear.msg.edit_entry = '{{__('Edit entry')}}';
-		dotclear.msg.view_entry = '{{__('view entry')}}';
-		dotclear.msg.confirm_delete_posts = '{{__("Are you sure you want to delete selected entries (%s)?")}}';
-		dotclear.msg.confirm_delete_post = '{{__("Are you sure you want to delete this entry?")}}';
-		dotclear.msg.confirm_spam_delete = '{{__('Are you sure you want to delete all spams?')}}';
-		dotclear.msg.confirm_delete_comments = '{{__('Are you sure you want to delete selected comments (%s)?')}}';
-		dotclear.msg.confirm_delete_comment = '{{__('Are you sure you want to delete this comment?')}}';
-		dotclear.msg.cannot_delete_users = '{{__('Users with posts cannot be deleted.')}}';
-		dotclear.msg.confirm_delete_user = '{{__('Are you sure you want to delete selected users (%s)?')}}';
-		dotclear.msg.confirm_delete_category = '{{__('Are you sure you want to delete category "%s"?')}}';
-		dotclear.msg.confirm_reorder_categories = '{{__('Are you sure you want to reorder all categories?')}}';
-		dotclear.msg.confirm_delete_media = '{{__('Are you sure you want to remove media "%s"?')}}';
-		dotclear.msg.confirm_extract_current = '{{__('Are you sure you want to extract archive in current directory?')}}';
-		dotclear.msg.confirm_remove_attachment = '{{__('Are you sure you want to remove attachment "%s"?')}}';
-		dotclear.msg.confirm_delete_lang = '{{__('Are you sure you want to delete "%s" language?')}}';
-		dotclear.msg.confirm_delete_plugin = '{{__('Are you sure you want to delete "%s" plugin?')}}';
-		dotclear.msg.use_this_theme = '{{__('Use this theme')}}';
-		dotclear.msg.remove_this_theme = '{{__('Remove this theme')}}';
-		dotclear.msg.confirm_delete_theme = '{{__('Are you sure you want to delete "%s" theme?')}}';
-		dotclear.msg.zip_file_content = '{{__('Zip file content')}}';
-		dotclear.msg.xhtml_validator = '{{__('XHTML markup validator')}}';
-		dotclear.msg.xhtml_valid = '{{__('XHTML content is valid.')}}';
-		dotclear.msg.xhtml_not_valid = '{{__('There are XHTML markup errors.')}}';
-		dotclear.msg.confirm_change_post_format = '{{__('You have unsaved changes. Switch post format will loose these changes. Proceed anyway?')}}';
-		dotclear.msg.load_enhanced_uploader = '{{__('Loading enhanced uploader =>please wait.')}}';
-	//]]>
-	</script>
-{% endmacro %}
-
-{% macro load_IE7() %}
-	<!--[if lt IE 8]>
-	{{ _self.load('ie7/IE8.js') }}
-	<link rel="stylesheet" type="text/css" href="{{theme_url}}style/iesucks.css" />
-	<![endif]-->
-{% endmacro %}
-
-{% macro confirm_close(values) %}
-	{% if values is not iterable %}{% set values = [values] %} {% endif %}
-	<!-- jsConfirmClose -->
-	{{ _self.load('js/confirm-close.js') }}
-	<script type="text/javascript">
-	//<![CDATA[
-		confirmClosePage = new confirmClose({% for value in values %}'{{value}}'{%if not loop.last %},{% endif %}{% endfor %});
-		confirmClose.prototype.prompt = '{{__('You have unsaved changes.')}}';
-	//]]>
-	</script>
-{% endmacro %}
-
-{% macro page_tabs(default_tab) %}
-	<!-- jsPageTabs -->
-	{{ _self.load('js/jquery/jquery.pageTabs.js') }}
-	<script type="text/javascript">
-	//<![CDATA[
-		$(function() {
-			$.pageTabs('{{default_tab}}');
-		});
-	//]]>
-	</script>
-{% endmacro %}
-
-{% macro modal() %}
-	<!-- jsModal -->
-	<link rel="stylesheet" href="{{theme_url}}style/modal/modal.css" type="text/css" media="screen" />
-	{{ _self.load('js/jquery/jquery.modal.js') }}
-	<script type="text/javascript">
-	//<![CDATA[
-		$.modal.prototype.params.loader_img = '{{theme_url}}style/modal/loader.gif';
-		$.modal.prototype.params.close_img = '{{theme_url}}style/modal/close.png';
-	//]]>
-	</script>
-{% endmacro %}
-
-{% macro color_picker() %}
-	<!-- jsColorPicker -->
-	<link rel="stylesheet" href="{{theme_url}}style/farbtastic/farbtastic.css" type="text/css" media="screen" />
-	{{ _self.load('js/jquery/jquery.farbtastic.js') }}
-	{{ _self.load('js/color-picker.js') }}
-{% endmacro %}
-
-{% macro date_picker() %}
-	<!-- jsDatePicker -->
-	<link rel="stylesheet" href="{{theme_url}}style/date-picker.css" type="text/css" media="screen" />
-	{{ _self.load('js/date-picker.js') }}
-	<script type="text/javascript">
-	//<![CDATA[
-		datePicker.prototype.months[0] = '{{__('January')}}';
-		datePicker.prototype.months[1] = '{{__('February')}}';
-		datePicker.prototype.months[2] = '{{__('March')}}';
-		datePicker.prototype.months[3] = '{{__('April')}}';
-		datePicker.prototype.months[4] = '{{__('May')}}';
-		datePicker.prototype.months[5] = '{{__('June')}}';
-		datePicker.prototype.months[6] = '{{__('July')}}';
-		datePicker.prototype.months[7] = '{{__('August')}}';
-		datePicker.prototype.months[8] = '{{__('September')}}';
-		datePicker.prototype.months[9] = '{{__('October')}}';
-		datePicker.prototype.months[10] = '{{__('November')}}';
-		datePicker.prototype.months[11] = '{{__('December')}}';
-		datePicker.prototype.days[0] = '{{__('Monday')}}';
-		datePicker.prototype.days[1] = '{{__('Tuesday')}}';
-		datePicker.prototype.days[2] = '{{__('Wednesday')}}';
-		datePicker.prototype.days[3] = '{{__('Thursday')}}';
-		datePicker.prototype.days[4] = '{{__('Friday')}}';
-		datePicker.prototype.days[5] = '{{__('Saturday')}}';
-		datePicker.prototype.days[6] = '{{__('Sunday')}}';
-		datePicker.prototype.img_src = '{{theme_url}}images/date-picker.png';
-		datePicker.prototype.close_msg = '{{__('close')}}';
-		datePicker.prototype.now_msg = '{{__('now')}}';
-	//]]>
-	</script>
-{% endmacro %}
-
-{% macro tool_bar() %}
-	<!-- jsToolBar -->
-	<link rel="stylesheet" type="text/css" href="{{theme_url}}style/jsToolBar/jsToolBar.css" />
-	{{ _self.load('js/jsToolBar/jsToolBar.js') }}
-	
-	{% if current_user.options.enable_wysiwyg %}
-		{{ _self.load('js/jsToolBar/jsToolBar.wysiwyg.js') }}
-	{% endif %}
-	
-	{{ _self.load('js/jsToolBar/jsToolBar.dotclear.js') }}
-	<script type="text/javascript">
-	//<![CDATA[
-		jsToolBar.prototype.dialog_url = 'popup.php'; 
-		jsToolBar.prototype.iframe_css = 
-		'	body{'+
-		'		font: 12px "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;'+
-		'		color : #000;'+
-		'		background: #f9f9f9;'+
-		'		margin: 0;'+
-		'		padding : 2px;'+
-		'		border: none;'+
-		'		{% if rtl %}direction:rtl;{% endif %}'+
-		'	}'+
-		'	pre, code, kbd, samp {'+
-		'		font-family:"Courier New",Courier,monospace;'+
-		'		font-size : 1.1em;'+
-		'	}'+
-		'	code {'+
-		'		color : #666;'+
-		'		font-weight : bold;'+
-		'	}'+
-		'	body > p:first-child {'+
-		'		margin-top: 0;'+
-		'	}'+
-		''; 
-		jsToolBar.prototype.base_url = '{{blog.host}}';
-		jsToolBar.prototype.switcher_visual_title = '{{__('visual')}}';
-		jsToolBar.prototype.switcher_source_title = '{{__('source')}}';
-		jsToolBar.prototype.legend_msg = '{{__('You can use the following shortcuts to format your text.')}}';
-		jsToolBar.prototype.elements.blocks.options.none = '{{__('-- none --')}}';
-		jsToolBar.prototype.elements.blocks.options.nonebis = '{{__('-- block format --')}}';
-		jsToolBar.prototype.elements.blocks.options.p = '{{__('Paragraph')}}';
-		jsToolBar.prototype.elements.blocks.options.h1 = '{{__('Level 1 header')}}';
-		jsToolBar.prototype.elements.blocks.options.h2 = '{{__('Level 2 header')}}';
-		jsToolBar.prototype.elements.blocks.options.h3 = '{{__('Level 3 header')}}';
-		jsToolBar.prototype.elements.blocks.options.h4 = '{{__('Level 4 header')}}';
-		jsToolBar.prototype.elements.blocks.options.h5 = '{{__('Level 5 header')}}';
-		jsToolBar.prototype.elements.blocks.options.h6 = '{{__('Level 6 header')}}';
-		jsToolBar.prototype.elements.strong.title = '{{__('Strong emphasis')}}';
-		jsToolBar.prototype.elements.em.title = '{{__('Emphasis')}}';
-		jsToolBar.prototype.elements.ins.title = '{{__('Inserted')}}';
-		jsToolBar.prototype.elements.del.title = '{{__('Deleted')}}';
-		jsToolBar.prototype.elements.quote.title = '{{__('Inline quote')}}';
-		jsToolBar.prototype.elements.code.title = '{{__('Code')}}';
-		jsToolBar.prototype.elements.br.title = '{{__('Line break')}}';
-		jsToolBar.prototype.elements.blockquote.title = '{{__('Blockquote')}}';
-		jsToolBar.prototype.elements.pre.title = '{{__('Preformated text')}}';
-		jsToolBar.prototype.elements.ul.title = '{{__('Unordered list')}}';
-		jsToolBar.prototype.elements.ol.title = '{{__('Ordered list')}}';
-		
-		jsToolBar.prototype.elements.link.title = '{{__('Link')}}';
-		jsToolBar.prototype.elements.link.href_prompt = '{{__('URL?')}}';
-		jsToolBar.prototype.elements.link.hreflang_prompt = '{{__('Language?')}}';
-		
-		jsToolBar.prototype.elements.img.title = '{{__('External image')}}';
-		jsToolBar.prototype.elements.img.src_prompt = '{{__('URL?')}}';
-		
-		jsToolBar.prototype.elements.img_select.title = '{{__('Media chooser')}}';
-		jsToolBar.prototype.elements.post_link.title = '{{__('Link to an entry')}}';
-		
-		{% if current_user.rights.media %}
-			jsToolBar.prototype.elements.img_select.disabled = true;
-		{% endif %}
-	//]]>
-	</script>
-{% endmacro %}
-
-{% macro candy_upload(params) %}
-	{% if params is empty %}{% set params = {} %} {% endif %}
-	{% set params = params|merge(['sess_id={{session.id}}','sess_uid={{session.uid}}','xd_check={{session.nonce}}']) %}
-	<!-- jsCandyUpload -->
-	<link rel="stylesheet" href="{{theme_url}}style/candyUpload/style.css" type="text/css" media="screen" />
-	{{ _self.load('js/jquery/jquery.candyUpload.js') }}
-	<script type="text/javascript">
-	//<![CDATA[
-		dotclear.candyUpload = {};
-		dotclear.msg.activate_enhanced_uploader = '{{__('Temporarily activate enhanced uploader')}}';
-		dotclear.msg.disable_enhanced_uploader = '{{__('Temporarily disable enhanced uploader')}}';
-		$._candyUpload.prototype.locales.file_uploaded = '{{__('File successfully uploaded.')}}';
-		$._candyUpload.prototype.locales.max_file_size = '{{__('Maximum file size allowed:')}}';
-		$._candyUpload.prototype.locales.limit_exceeded = '{{__('Limit exceeded.')}}';
-		$._candyUpload.prototype.locales.size_limit_exceeded = '{{__('File size exceeds allowed limit.')}}';
-		$._candyUpload.prototype.locales.canceled = '{{__('Canceled.')}}';
-		$._candyUpload.prototype.locales.http_error = '{{__('HTTP Error:')}}';
-		$._candyUpload.prototype.locales.error = '{{__('Error:')}}';
-		$._candyUpload.prototype.locales.choose_file = '{{__('Choose file')}}';
-		$._candyUpload.prototype.locales.choose_files = '{{__('Choose files')}}';
-		$._candyUpload.prototype.locales.cancel = '{{__('Cancel')}}';
-		$._candyUpload.prototype.locales.clean = '{{__('Clean')}}';
-		$._candyUpload.prototype.locales.upload = '{{__('Upload')}}';
-		$._candyUpload.prototype.locales.no_file_in_queue = '{{__('No file in queue.')}}';
-		$._candyUpload.prototype.locales.file_in_queue = '{{__('1 file in queue.')}}';
-		$._candyUpload.prototype.locales.files_in_queue = '{{__('%d files in queue.')}}';
-		$._candyUpload.prototype.locales.queue_error = '{{__('Queue error:')}}';
-		dotclear.candyUpload.base_url = '{{admin_url}}';
-		dotclear.candyUpload.movie_url = '{{theme_url}}swfupload.swf';
-		dotclear.candyUpload.params = '{{params|join('&')}}';
-	//]]>
-	</script>
-{% endmacro %}
-
-{% macro tool_man() %}
-	<!-- jsToolMan -->
-	{{ _self.load('js/tool-man/core.js') }}
-	{{ _self.load('js/tool-man/events.js') }}
-	{{ _self.load('js/tool-man/css.js') }}
-	{{ _self.load('js/tool-man/coordinates.js') }}
-	{{ _self.load('js/tool-man/drag.js') }}
-	{{ _self.load('js/tool-man/dragsort.js') }}
-	{{ _self.load('js/dragsort-tablerows.js') }}
-{% endmacro %}
-
-{% macro meta_editor() %}
-	<!-- jsMetaEditor -->
-	{{ _self.load('js/meta-editor.js') }}
-{% endmacro %}
Index: nc/admin/default-templates/layout.html.twig
===================================================================
--- inc/admin/default-templates/layout.html.twig	(revision 1089)
+++ 	(revision )
@@ -1,140 +1,0 @@
-{% import "js_helpers.html.twig" as js %}
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{current_user.lang}}" lang="{{current_user.lang}}">
-<head>
-	{% block header %}
-	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-	<title>{% block title %}{% for part in page_title %}{{ part.title }} - {% endfor %}{% if current_blog.name is not empty %}{{current_blog.name}} - {% endif %}{{vendor_name}} - {{version}}{% endblock %}</title>
-	<meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />
-	<meta name="GOOGLEBOT" content="NOSNIPPET" />
-	<link rel="stylesheet" href="{{theme_url}}style/default.css" type="text/css" media="screen" />
-	{% if rtl is not empty %}
-	<link rel="stylesheet" href="{{theme_url}}style/default-rtl.css" type="text/css" media="screen" />
-	{% endif %}
-	{{ js.load_IE7 }}
-	{{ js.common }}
-	{% endblock %}
-</head>
-
-<body id="dotclear-admin{% if safe_mode %} safe-mode{% endif %}">
-	<div id="header">
-		<ul id="prelude">
-			<li><a href="#content">{{__('To content')}}</a></li>
-			<li><a href="#main-menu">{{__('To menu')}}</a></li>
-		</ul>
-		<div id="top"><h1><a href="index.php">{{vendor_name}}</a></h1></div>
-		<div id="info-boxes">
-			<div id="info-box1">
-			  {% form switchblog_menu %}
-				{% if blog_count > 1 and blog_count < 20 %}
-					<p>{{ form_field('switchblog') }}</p>
-					<noscript><p>{{ form_field('switchblog_submit') }}</p></noscript>
-				{% else %}
-					<p>{{__('Blog:')}} <strong title="{{current_blog.url}}">{{current_blog.name}}</strong>
-					{% if blogs is not empty %} - <a href="blogs.php">{{__('Change blog')}}</a>{% endif %}</p>
-				{% endif %}
-				<p><a href="{{current_blog.url}}" onclick="window.open(this.href);return false;" title="{{__('Go to site')}} ({{__('new window')}})">{{__('Go to site')}} <img src="{{theme_url}}images/outgoing.png" alt="" /></a></p>
-			  {% endform %}
-			</div>
-			<div id="info-box2">
-				<a {%if current_page == 'index' %}class="active" {% endif %}href="index.php">{{__('My dashboard')}}</a><span> | </span>
-				<a {%if current_page == 'preferences' %}class="active" {% endif %}href="preferences.php">{{__('My preferences')}}</a><span> | </span>
-				<a href="index.php?logout=1" class="logout">{{__('Logout %s')|format(current_user.id)}} <img src="{{theme_url}}images/logout.png" alt="" /></a>
-			</div>
-		</div>
-	</div>
-	<div id="wrapper">
-		<div id="main">
-			<div id="content">
-				{% block content %}
-				{% if safe_mode %}
-					<div class="error"><h3>{{__('Safe mode')}}</h3>
-					<p>{{__('You are in safe mode. All plugins have been temporarily disabled. Remind to log out then log in again normally to get back all functionalities')}}</p>
-					</div>
-				{% endif %}
-				<h2>
-					{%- if not page_global %}{{current_blog.name}} &rsaquo; {% endif %}
-					{%- for part in page_title %}
-						{%- if loop.last %}<span class="page-title">{% endif %}
-						{%- if part.link is not empty %}<a href="{{ part.link }}">{{ part.title }}</a>{% else %}{{ part.title }}{% endif %}
-						{%- if loop.last %}</span>{% else %} &rsaquo; {% endif %}
-					{%- endfor -%}
-				</h2>
-				{% if messages.static is not empty %}
-					{% for message in messages.static %}
-						<p class="static-msg">{{ message }}</p>
-					{% endfor %}
-				{% endif %}
-				{% if messages.lists is not empty %}
-					{% for title,messages in messages.lists %}
-						<div class="static-msg">{{ title }}<ul>
-						{% for message in messages %}
-							<li>{{ message }}</li>
-						{% endfor %}
-						</ul></div>
-					{% endfor %}
-				{% endif %}
-				{% if messages.alert is not empty %}
-					<p class="message">{{ messages.alert }}</p>
-				{% endif %}
-				{% if messages.errors is not empty %}
-					<div class="error">
-						<p><strong>Errors :</strong></p>
-						<ul>
-						{% for error in messages.errors %}
-							<li>{{ error }}</li>
-						{% endfor %}
-						</ul>
-					</div>
-				{% endif %}
-				{% endblock %}
-
-			</div>
-		</div>
-		<div id="main-menu">
-			{% block menus %}
-			{% for menu in menus %}
-			{% if menu.items is not empty %}
-			<div id="{{menu.id}}">
-				{% if menu.title is not empty %}<h3>{{menu.title}}</h3>{% endif %}
-				<ul>
-				{% for item in menu.items %}
-				{% spaceless %}
-				<li {% if item.active or item.class is not empty %} class="{% if item.active %}active {% endif %}{{item.class}}"{% endif %}
-				{% if item.id is not empty %}id="{{item.id}}" {% endif %}
-				{% if item.img is not empty %} style="background-image: url({{item.img}});"{% endif %}
-				><a href="{{item.link}}"{{item.ahtml}}>{{item.title}}</a>
-				{% if loop.last %}{{menu.separator}}{% endif %}</li>
-				{% endspaceless %}
-				{% endfor %}
-				</ul>
-			</div>
-			{% endif %}
-			{% endfor %}
-			{% endblock %}
-		</div>
-		<div id="footer">
-			{% block footer %}
-			<p>{{ __('Thank you for using %s.')|format(vendor_name) }}</p>
-			{% endblock %}
-		</div>
-	</div>
-	{% block debug %}
-	  {% set debug_info = debug_info() %}
-	  {% if debug_info is not empty %}
-		<div id="debug"><div>
-		<p>memory usage: {{ debug_info.memory.usage }} ({{ debug_info.memory.size }})</p>
-		{% if debug_info.xdebug is not empty %}
-		  <p>Elapsed time: {{ debug_info.xdebug.elapse_time }} seconds</p>
-		  {% if debug_info.xdebug.profiler_file is not empty %}
-			<p>Profiler file : {{ debug_info.xdebug.profiler_file }}</p>
-		  {% else %}
-			<p><a href="{{ debug_info.xdebug.profiler_url }}">Trigger profiler</a></p>
-		  {% endif %}
-		{% endif %}
-		<p>Global vars: {{ debug_info.global_vars }}</p>
-		</div></div>
-	  {% endif %}
-	{% endblock %}
-	</body>
-</html>
Index: nc/admin/default-templates/page_layout.html.twig
===================================================================
--- inc/admin/default-templates/page_layout.html.twig	(revision 1074)
+++ 	(revision )
@@ -1,11 +1,0 @@
-{# Layout for backward compatibility with scripts which use dcPage #}
-{% extends (popup ? "popup" : "layout") ~ ".html.twig" %}
-
-{% block header %}
-{{ parent() }}
-{{ page_header|raw }}
-{% endblock %}
-
-{% block content %}
-{{ page_content|raw }}
-{% endblock %}
Index: nc/admin/default-templates/plugin.html.twig
===================================================================
--- inc/admin/default-templates/plugin.html.twig	(revision 1070)
+++ 	(revision )
@@ -1,5 +1,0 @@
-{% extends "layout.html.twig" %}
-
-{% block content %}
-{{ parent() }}
-{% endblock %}
Index: nc/admin/default-templates/popup.html.twig
===================================================================
--- inc/admin/default-templates/popup.html.twig	(revision 1089)
+++ 	(revision )
@@ -1,49 +1,0 @@
-{% import "js_helpers.html.twig" as js %}
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{{current_user.lang}}" lang="{{current_user.lang}}">
-<head>
-	{% block header %}
-	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
-	<title>{% block title %}{{page_title}} - {% if current_blog.name is not empty %}{{current_blog.name}} - {% endif %}{{vendor_name}} - {{version}}{% endblock %}</title>
-	<meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />
-	<meta name="GOOGLEBOT" content="NOSNIPPET" />
-	<link rel="stylesheet" href="{{theme_url}}style/default.css" type="text/css" media="screen" />
-	{% if rtl is not empty %}
-	<link rel="stylesheet" href="{{theme_url}}style/default-rtl.css" type="text/css" media="screen" />
-	{% endif %}
-	{{ js.load_IE7 }}
-	{{ js.common }}
-	{% endblock %}
-</head>
-
-<body id="dotclear-admin" class="popup">
-	<div id="top"><h1>{{ vendor_name }}</h1></div>
-	<div id="wrapper">
-		<div id="main">
-			<div id="content">
-				{% block content %}
-				<h2>{{current_blog.name}} &rsaquo; <span class="page-title">{{page_title}}</span></h2>
-				{% if messages.alert is not empty %}
-					<p class="message">{{ messages.alert }}</p>
-				{% endif %}
-				{% if messages.errors is not empty %}
-					<div class="error">
-						<p><strong>Errors :</strong></p>
-						<ul>
-						{% for error in messages.errors %}
-							<li>{{ error }}</li>
-						{% endfor %}
-						</ul>
-					</div>
-				{% endif %}
-				{% endblock %}
-			</div>
-		</div>
-		<div id="footer">
-			{% block footer %}
-			<p>&nbsp;</p>
-			{% endblock %}
-		</div>
-	</div>
-	</body>
-</html>
Index: nc/admin/default-templates/post.html.twig
===================================================================
--- inc/admin/default-templates/post.html.twig	(revision 1088)
+++ 	(revision )
@@ -1,43 +1,0 @@
-{% extends "layout.html.twig" %}
-{% import "js_helpers.html.twig" as js %}
-{% block header %}
-	{{ parent() }}
-	{{ js.date_picker }}
-	{{ js.tool_bar }}
-	{{ js.modal }}
-	{{ js.meta_editor }}
-	<script type="text/javascript" src="{{theme_url}}js/_post.js"></script>
-	{{ js.confirm_close(['entry-form','comment-form']) }}
-	{{ js.page_tabs(default_tab) }}
-{% endblock %}
-
-{% block content %}
-{{ parent() }}
-
-<div class="multi-part" title="{{__('Edit entry')}}" id="edit-entry">
-{% form post %}
-<div id="entry-wrapper">
-	<div id="entry-content">
-		<div class="constrained">
-			<p class="col">{{ form_field('post_title',{'class':'maximal'}) }}</p>
-			<p class="area" id="excerpt-area">{{ form_field('post_excerpt',{'rows':5,'cols':50}) }}</p>
-			<p class="area" id="content-area">{{ form_field('post_content',{'rows':current_user.options.edit_size,'cols':5}) }}</p>
-			<p class="area" id="notes-area">{{ form_field('post_notes',{'rows':5,'cols':50}) }}</p>
-			<p>{{ form_field('save')}} {{form_field('delete',{'class':'delete'})}}</p>
-		</div>
-	</div>
-</div>
-<div id="entry-sidebar">
-	<p>{{ form_field('cat_id',{'class':'maximal'})}}</p>
-	<p>{{ form_field('post_status')}}</p>
-	<p>{{ form_field('post_dt')}}</p>
-	<p>{{ form_field('post_format')}}</p>
-	<p>{{ form_field('post_open_comment')}}</p>
-	<p>{{ form_field('post_open_tb')}}</p>
-	<p>{{ form_field('post_selected')}}</p>
-	<p>{{ form_field('post_lang')}}</p>
-</div>
-{% endform %}
-</div>
-{% endblock %}
-
Index: nc/admin/default-templates/style/candyUpload/style.css
===================================================================
--- inc/admin/default-templates/style/candyUpload/style.css	(revision 1085)
+++ 	(revision )
@@ -1,113 +1,0 @@
-
-.cu-ctrl {
-	background: #f5f5f5;
-	padding: .5em 0 0 0;
-	margin: 0 0 1em 0;
-	overflow: hidden;
-}
-.cu-msg {
-	font-weight: bold;
-}
-.cu-msg.cu-error {
-	color: #c00;
-}
-.cu-files {
-	padding: 0 0.5em;
-	margin: 10px 0;
-}
-.cu-file {
-	margin: 0 0 8px 0;
-	position: relative;
-}
-.cu-fileinfo {
-	margin-left: 16px;
-}
-.cu-fileinfo span.cu-filecancel {
-	display: block;
-	position: absolute;
-	top: 2px;
-	left: 0px !important;
-	left: -16px;
-}
-.cu-filecancel a {
-	display: block;
-	width: 12px;
-	height: 12px;
-	background: transparent url(cancel.png) no-repeat top left;
-	border: none;
-	text-indent: -5000px;
-	outline: none;
-}
-.cu-filemsg {
-	font-weight: bold;
-	color: green;
-}
-span.cu-filemsg.cu-error {
-	color: #c00;
-}
-.cu-progress {
-	margin-left: 16px;
-}
-.cu-progress div {
-	height: 10px;
-	width: 0;
-	font-size: 0.8em;
-	line-height: 1em;
-	height: 1em;
-	padding: .2em 0;
-	text-align: right;
-	background: green url(loader.png) repeat-x top left;
-	color: white;
-	font-weight: bold;
-	border-radius: 2px;
-}
-.cu-btn {
-	padding: 0 0.5em;
-	line-height: 1.2em;
-	height: 1.5em;
-	margin-top: 1em;
-	position: relative;
-}
-.cu-btn span {
-	display: block;
-	margin: 0 1em 0 0;
-	float: right;
-}
-.cu-btn span a {
-	display: block;
-	padding: .3em 1.5em;
-}
-span.cu-btn-browse {
-	float: none;
-	position: absolute;
-	left: 0;
-	margin: 0;
-}
-span.cu-btn-upload, span.cu-btn-clean {
-	margin-right: 0;
-}
-span.cu-btn-upload a.button {
-	color: #fff;
-	border: 1px solid #2373A8;
-	background: #2373A8;
-	background: -webkit-gradient(linear, left top, left bottom, from(#2C8FD1), to(#2373A8));
-	background: -moz-linear-gradient(top,  #2C8FD1,  #2373A8);
-}
-span.cu-btn-upload a.button:hover, 
-span.cu-btn-upload a.button:focus {
-	color: #fff;
-	border: 1px solid #2C8FD1;
-	background: #2C8FD1;
-	background: -webkit-gradient(linear, left top, left bottom, from(#2373A8), to(#2C8FD1));
-	background: -moz-linear-gradient(top,  #2373A8,  #2C8FD1);
-	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#2373A8', endColorstr='#2C8FD1');
-}
-.cu-maxsize.form-note {
-	clear: both;
-	margin: 1.5em 0 0;
-	font-style: italic;
-}
-.cu-disable {
-	margin: 1em 0;
-	padding: 0 0 0.5em 0.5em;
-}
Index: nc/admin/default-templates/style/date-picker.css
===================================================================
--- inc/admin/default-templates/style/date-picker.css	(revision 1056)
+++ 	(revision )
@@ -1,35 +1,0 @@
-.date-picker {
-	border-collapse : collapse;
-	background : #fff;
-	color : #fff;
-	border: 1px solid #666;
-	border-width : 1px 2px 2px 1px;
-}
-.date-picker th {
-	border : none;
-	color : #000;
-	text-align : center;
-}
-.date-picker td {
-	border : 1px solid #666;
-	text-align : center;
-	padding : 4px 6px;
-}
-th.date-picker-month {
-	text-align : left;
-}
-th.date-picker-year {
-	text-align : right;
-}
-.date-picker-control, th.date-picker-control {
-	color : #06c;
-	cursor : pointer;
-}
-.date-picker-day, .date-picker-today {
-	color : #000;
-	background : #eee;
-	cursor : pointer;
-}
-.date-picker-today {
-	background : #ccc;
-}
Index: nc/admin/default-templates/style/default-rtl.css
===================================================================
--- inc/admin/default-templates/style/default-rtl.css	(revision 1056)
+++ 	(revision )
@@ -1,11 +1,0 @@
-body {
-	direction: rtl;
-}
-
-.right {
-	text-align: left;
-}
-
-th {
-	text-align: left;
-}
Index: nc/admin/default-templates/style/default.css
===================================================================
--- inc/admin/default-templates/style/default.css	(revision 1085)
+++ 	(revision )
@@ -1,1390 +1,0 @@
-/*
-# -- BEGIN LICENSE BLOCK ---------------------------------------
-#
-# This file is part of Dotclear 2.
-#
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
-# Licensed under the GPL version 2.0 license.
-# See LICENSE file or
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-#
-# -- END LICENSE BLOCK -----------------------------------------
-*/
-
-/* ------------------------------------------------------------------ html */
-body {
-	font: 75%/1.5em Helvetica,Arial,sans-serif;
-	color: #333;
-	background: #f5f5f5;
-	margin: 0;
-	padding: 0;
-}
-body.auth {
-	background: #fff;
-}
-
-a, a:link, a:visited {
-	color: #2373A8;
-	text-decoration: none;
-	border-bottom: 1px dotted #f90;
-}
-a:hover, a:active, a:focus {
-	text-decoration: underline;
-}
-a img, a:link img, a:visited img { 
-	border:none;
-}
-
-h1, h2, h3, h4, h5, h6, p {
-	margin-top: 0;
-	margin-bottom: 0.6em;
-}
-h2 {
-	color: #666;
-	font-size: 1.4em;
-	padding: 4px 0;
-}
-.page-title {
-	color: #d30e60;
-}
-h3 {
-	color: #333;
-	font-size: 1.2em;
-}
-p, div.p {
-	margin: 0 0 1em 0;
-}
-hr {
-	height: 1px;
-	border-width: 1px 0 0 0;
-	border-color: #999;
-	border-style: solid;
-}
-pre, code {
-	font: 100% "Andale Mono","Courier New",monospace;
-}
-pre {
-	white-space: pre;
-	white-space: -moz-pre-wrap;
-	white-space: -hp-pre-wrap;
-	white-space: -o-pre-wrap;
-	white-space: -pre-wrap;
-	white-space: pre-wrap;
-	white-space: pre-line;
-	word-wrap: break-word;
-}
-abbr {
-	cursor: help;
-}
-
-/* LAYOUT
--------------------------------------------------------- */
-/* header */
-#header {
-	background: #575859;
-	height: 3em;
-	position: relative;
-}
-#prelude {
-	background: #575859;
-	line-height: 1.5em;
-	margin: 0;
-	padding: 0 1.7em 0 1em;
-	overflow: hidden;
-	position: absolute;
-	top: 1.2em;
-	left: 0;
-	}
-#prelude li {
-	list-style-type: none;
-	margin: 0 1em 0 0;
-	background:transparent;
-	}
-#prelude li a {
-	color:#fff;
-	}
-#top {
-	margin: 0;
-	padding: 0;
-	width: 13em;
-	float: left;
-}
-#top h1 {
-	padding: 0;
-	margin: 0;
-	height: 3em;
-	text-indent: -1000px;
-	background: transparent url(dc_logo.png) no-repeat 0 50%;
-}
-#top h1 a {
-	position: absolute;
-	top: 3px;
-	left: 0;
-	width: 130px;
-	height: 60px;
-	border: none;
-	outline: none;
-	color: #fff;
-}
-#info-boxes {
-	background: #575859;
-	font-size: .95em;
-	height: 3em;
-}
-#info-box1 {
-	margin: 0;
-	padding: .5em 3px 4px 0;
-	color: #fff;
-	float: left;
-	background: #575859;
-}
-#info-box2 {
-	margin: .1em 0 0 0;
-	padding: .5em 1.3em 4px 0;
-	color: #fff;
-	float: right;
-	text-align: right;
-	background: #575859;
-	height: 2em;
-}
-#info-box1 p {
-	margin: 0;
-	display: inline;
-}
-#info-box1 label {
-	display: inline;
-}
-#info-box1 select {
-	width: 15em;
-}
-#info-box1 a img, #info-box2 a img {
-	vertical-align: middle;
-	padding-left: .3em;
-	}
-#info-box1 a, #info-box2 a {
-	background: #575859;
-	font-weight: bold;
-	color: #fff;
-	border-bottom-color: #ccc;
-	margin-left: .3em;
-	margin-right: .3em;
-	white-space: nowrap;
-	font-weight: normal;
-}
-#info-box1 a {
-	margin-left: 1.33em;
-}
-#info-box2 a.active {
-	border-bottom-color: #f5f5f5;
-	margin: 0;
-	padding: 1.2em .5em;
-	background-color: #f5f5f5;
-	color: #333;
-	font-weight: bold;
-}
-#info-box2 span {
-	color: #575859;
-}
-/* prelude */
-#wrapper {
-	width: 100%;
-}
-#main {
-	width: 100%;
-	float: right;
-	margin-left: -13em;
-	margin-top: 0;
-}
-#content {
-	margin: 1.5em 1.5em 4em 13em;
-	padding: 1em;
-	background: #fff;
-	border-radius: .5em;
-	border: 1px solid #ddd;
-}
-	/* Micro clearfix thx to Nicolas Gallagher */
-	#content:before, #content:after {content:"";display:table;}
-	#content:after {clear:both;}
-/* -------------------------------------------------- layout - multipart */
-.three-cols {
-}
-.three-cols .col {
-	width: 32.3%;
-	float: left;
-	margin-left: 1%;
-}
-.three-cols .col:first-child {
-	width: 33.3%;
-	margin-left: 0;
-}
-.two-cols {
-	position: static;
-}
-.two-cols .col {
-	width: 49%;
-	margin-left: 2%;
-	float: left;
-}
-.two-cols .col:first-child {
-	width: 49%;
-	margin-left: 0;
-}
-.two-cols .col70{
-	width: 69%;
-	margin-left: 0;
-	float: left;
-}
-.two-cols .col30 {
-	width: 28%;
-	margin-left: 2%;
-	float: left;
-}
-/* -------------------------------------------------------------- layout - onglets */
-.part-tabs ul {
-	padding: .3em 0 1px 1em;
-	border-bottom: 1px solid #999;
-}
-.part-tabs li {
-	list-style: none;
-	margin: 0;
-	display: inline;
-}
-.part-tabs li a {
-	padding: .3em 0.5em;
-	margin-right: .5em;
-	border: 1px solid #999;
-	border-bottom: none;
-	background: #dfdfdf;
-	text-decoration: none;
-	border-top-left-radius: .3em;
-	border-top-right-radius: .3em;
-	color: #000;
-}
-.part-tabs li.part-tabs-link a {
-	background: #ffe;
-}
-.part-tabs li a:hover, .part-tabs li a:focus {
-	color: #000;
-	background: #fff;
-	border-bottom-color: #fff;
-}
-.part-tabs li.part-tabs-active a {
-	background: #fff;
-	border-bottom: 1px solid #fff;
-	color: #000;
-	font-weight: bold;
-}
-/* ------------------------------------------------------------------ main-menu */
-#main-menu {
-	width: 13em;
-	float: left;
-	margin-top: 1.2em;
-	margin-bottom: 3em;
-}
-#main-menu h3 {
-	margin: 0 0 0.5em;
-	padding: .5em 0 0 .5em;
-	text-transform: uppercase;
-	color: #666;
-	font-size: 1.1em;
-}
-#main-menu ul {
-	font-size: .95em;
-	margin: 0 0 1em 0;
-	padding: 0;
-	list-style: none;
-}
-#main-menu li {
-	display: block;
-	margin: 0.5em 0 0;
-	padding: .2em 0 0 32px;
-	background-repeat: no-repeat;
-	background-position: 12px .4em;
-}
-#main-menu a {
-	font-weight: bold;
-}
-#main-menu .active a {
-	border-bottom: none;
-	color: #333;
-}
-#main-menu .active {
-	background-color: #fff;
-	padding: .4em 0 .1em 32px;
-	background-position: 12px .4em;
-	border-top: 1px solid #ddd;
-	border-bottom: 1px solid #ddd;
-	margin-right: -1px;
-}
-#favorites-menu {
-	margin: 0 0 2em;
-}
-#favorites-menu h3 {
-	color: #333;
-	text-transform: none;
-}
-#favorites-menu a {
-	color: #333;
-}
-#favorites-menu .active {
-	background-color: transparent;
-	border: none;
-}
-#favorites-menu .active a {
-	font-weight: bold;
-	color: #666;
-}
-/* ------------------------------------------------------------------ footer */
-#footer {
-	clear: both;
-	padding: .75em 0;
-	background: #575859 url(dc_logo_small.png) no-repeat 8px bottom;
-	color: #fff;
-}
-#footer p {
-	margin: 0;
-	padding: 0 1em;
-	text-align: center;
-	font-size: 1.1em;
-}
-#footer a {
-	color: #f5f5f5;
-}
-#footer p span.credit {
-	font-size: .85em;
-	font-weight: normal;
-}
-/* ---------------------------------------------------------------------------- auth.php */
-#login-screen {
-	display: block;
-	width: 18em;
-	margin: 1.5em auto 0;
-	font-size: 1.1em;
-}
-#login-screen h1 {
-	text-indent: -2000px;
-	background: transparent url(dotclear-logo2.png) no-repeat top left;
-	height: 50px;
-	margin-bottom: .5em;
-	margin-left: .5em;
-}
-#login-screen fieldset, #login-screen .fieldset {
-	border: 1px solid #999;
-	padding: 1em 1em 0 1em;
-	border-radius: 4px;
-}
-#login-screen input[type=text], #login-screen input[type=password], #login-screen input[type=submit] {
-	width: 100%;
-}
-#login-screen #issue {
-	margin-left: 1em;
-	font-size: 1em;
-}
-#login-screen #issue strong {font-weight: normal;}
-
-
-/* ------------------------------------------------------------------ dashboard */
-#dashboard-main {
-	float: left;
-	overflow: hidden;
-	padding: 1em 2% 1em 0;
-	width: 70%;
-}
-#dashboard-main.fullwidth {
-	width: 100%;
-	padding: 1em 0;
-	float: none;
-}
-#icons {
-	overflow: hidden;
-	padding-bottom: 1em;
-	text-align: center;
-}
-#icons p {
-	width: 210px;
-	text-align: center;
-	margin: 2em 0 0 0;
-	display:inline-block;
-}
-#icons a,
-#icons a:link,
-#icons a:visited,
-#icons a:hover,
-#icons a:focus {
-	border-bottom-width: 0px;
-	text-decoration: none;
-}
-#icons a span {
-	border-bottom: 1px dotted #f90;
-}
-#icons a:focus span, #icons a:hover span {
-	text-decoration: underline;
-}
-#quick {
-	clear: left;
-	margin-top: 2em;
-}
-#quick h3 {
-	margin-bottom: 0.2em;
-	font-size: 1.2em;
-}
-#quick p.qinfo {
-	margin: -.7em -1em 1em;
-	background: #eef url(info.png) no-repeat .2em .2em;
-	border: 1px solid #99f;
-	padding: .2em 1em .1em 24px;
-	color: #666;
-}
-#dashboard-items {
-	float: left;
-	width: 27%;
-	overflow: hidden;
-	padding-bottom: 1em;
-	padding-top: 3em;
-}
-#dashboard-items img {
-	vertical-align: middle;
-}
-#dashboard-items ul {
-	display: block;
-	padding-left: 1.5em;
-	list-style: square;
-}
-#dashboard-items li {
-	margin: 0.25em 0 0 0;
-	color: #666;
-}
-#news dt {
-	font-weight: bold;
-	margin: 0 0 0.4em 0;
-}
-#news dd {
-	margin: 0 0 1em 0;
-}
-#news dd p {
-	margin: 0.2em 0 0 0;
-}
-
-#upg-notify {
-}
-#upg-notify ul {
-	padding-left: 15px;
-}
-#upg-notify li {
-	color: #fff;
-}
-/* ------------------------------------------------------------------ post */
-#entry-wrapper {
-	float: left;
-	width: 100%;
-	margin-right: -18em;
-}
-#entry-content {
-	margin-right: 18em;
-}
-#entry-sidebar {
-	width: 17em;
-	float: right;
-}
-#comments {
-	clear: both;
-}
-/* ------------------------------------------------------------------ categories */
-#categories {
-	margin: 1em 0 2em;
-}
-#categories ul {
-	list-style: none;
-	margin: 0;
-	padding: 0;
-}
-#categories li {
-	margin: .5em 0;
-	padding: .3em 1.5em;
-	border: 1px solid #ccc;
-	border-left: 1em solid #E5E3DA;
-	border-radius: .3em;
-}
-#categories h4 {
-	margin: 0;
-}
-#categories h4 span {
-	font-weight: normal;
-}
-#categories li p {
-	margin: 0;
-}
-select#del_cat {
-	width: 100%;
-}
-/* ------------------------------------------------------------------ media */
-#media-icon {
-	float: left;
-}
-#media-details {
-	margin-left: 70px;
-}
-#media-details ul {
-	display: block;
-	margin-left: 0;
-	padding: 0;
-}
-#media-details li {
-	list-style: square inside;
-	margin: 0;
-	padding: 0;
-}
-#media-original-image {
-	overflow: auto;
-}
-#media-original-image.overheight {
-	height: 500px;
-}
-#add-file-f {
-	position: relative;
-}
-#add-file-f .more-file {
-	position:absolute;
-	right: 0.5em;
-	background: #999;
-	color: #fff;
-	border: none;
-}
-.media-list {
-	position: static;
-}
-.media-col-0 {
-	clear: left;
-}
-.media-item {
-	position: relative;
-	border-top: 1px solid #ccc;
-	margin-bottom: 1em;
-	padding: 5px 0;
-}
-div.media-list .media-item {
-	width: 49%;
-	float: left;
-	margin-right: 1%;
-}
-a.media-icon {
-	display: block;
-	border-bottom: none;
-	float: left;
-}
-.media-icon img {
-	display: block;
-}
-.media-item ul {
-	display: block;
-	list-style: none;
-	margin: 0 0 0 60px;
-	padding: 0;
-}
-li.media-action {
-	display: block;
-	position: absolute;
-	top: 5px;
-	right: 5px;
-	height: 16px;
-}
-li.media-action a {
-	border: none;
-}
-li.media-action form {
-	display: inline;
-}
-li.media-action input {
-	border: none;
-}
-/* ------------------------------------------------------------------ preferences */
-#my-favs ul {
-	list-style-type: none;
-	margin-left: 0;
-	padding-left: 0;
-	line-height: 1.2;
-}
-#my-favs li {
-	display: block;
-	float: left;
-	width: 164px;
-	margin-top: 1em;
-	margin-bottom: 1.5em;
-}
-#my-favs label {height: 2.5em;width:140px;margin-top:.3em;}
-#my-favs label input {display:inline;}
-#my-favs img {
-	display: block;
-}
-#my-favs input.position {
-	margin: 0 0 .4em .2em;
-}
-#available-favs input, #available-favs label, #available-favs label span {
-	white-space: normal;
-	display: inline;
-}
-#default-favs h3 {
-	margin-top: 2em;
-	margin-bottom: 1em;
-}
-.fav-list {
-	list-style-type: none;
-	margin-left: 0;
-	padding-left: 0;
-}
-.fav-list li {
-	line-height: 2;
-	margin-left: 0;
-	padding-left: 0;
-	position: relative;
-}
-.fav-list img {
-	vertical-align: middle;
-	margin-right: .2em;
-}
-#available-favs label span.zoom {
-	display: none;
-}
-#available-favs li:hover label span.zoom {
-	display: block;
-	position: absolute;
-	bottom: 0;
-	left: 10em;
-	background-color: #f5f5f5;
-	border: 1px solid #ddd;
-	padding: .2em;
-	border-radius: .5em;
-}
-/* -------------------------------------------------------------------- Themes */
-#themes {
-	border-bottom: 1px solid #ccc;
-	margin: 1em 0;
-}
-#themes div.theme-details {
-	clear: left;
-	border-top: 1px solid #ccc;
-	padding: 1em 0;
-}
-#themes div.theme-details:hover {
-	background: #eee;
-}
-#themes div.theme-details div.theme-shot {
-	float: left;
-}
-#themes div.theme-details div.theme-shot img {
-	display: block;
-	width: 57px;
-	height: 50px;
-	border: 1px solid #ccc;
-}
-#themes div.theme-details div.theme-info {
-	margin-left: 67px;
-}
-#themes div.theme-details div.theme-info span.theme-desc {
-	display: block;
-}
-#themes div.theme-details div.theme-info span.theme-version {
-	color: #666;
-}
-#themes div.theme-details div.theme-actions {
-	margin-left: 67px;
-}
-/* Themes list, JS version */
-#themes-wrapper {
-}
-#theme-box {
-	border: 1px solid #999;
-	border-left: none;
-	padding: 5px;
-	float: right;
-	height: 420px;
-	width: 320px;
-	overflow: auto;
-}
-#theme-box div.theme-shot img {
-	display: block;
-	margin: 0 0 0 10px;
-	width: 280px;
-	height: 245px;
-	border: 1px solid #ccc;
-}
-#theme-box div.theme-info {
-	margin: 1em 0 0 10px;
-}
-#theme-box h3 {
-	margin: 0;
-}
-#theme-box div.theme-info span {
-	display: block;
-}
-#theme-box span.theme-version {
-	color: #666;
-}
-#theme-box span.theme-parent-ok {
-	color: #666;
-}
-#theme-box span.theme-parent-missing {
-	color: #c00;
-	font-weight:bold;
-}
-#theme-box div.theme-actions {
-	margin-left: 10px;
-}
-#themes-wrapper #themes {
-	border: 1px solid #999;
-	overflow: auto;
-	height: 420px;
-	padding: 5px;
-	margin: 0;
-}
-#themes div.theme-details-js {
-	float: left;
-	width: 120px;
-	height: 150px;
-	margin: 0 10px 20px;
-	padding: 10px 10px 0;
-	text-align: center;
-	background: #f3f3f3;
-	border: 1px solid #f3f3f3;
-	cursor: pointer;
-	border-radius: 4px;
-}
-#themes div.theme-details-js label {
-	cursor: pointer;
-}
-#themes div.theme-details-js.theme-selected {
-	background: #E5E3DA;
-	border: 1px solid #999;
-}
-#themes div.theme-details-js div.theme-shot img {
-	width: 120px;
-	height: 105px;
-	border: 1px solid #fff;
-}
-#themes div.theme-details-js h3 {
-	font-family: inherit;
-	font-weight: normal;
-	margin: 0;
-	padding: 0;
-}
-/* ----------------------------------------------------------  Plugins list */
-#plugins td.action {
-	vertical-align: middle;
-}
-
-select.l10n option {
-	padding-left: 16px;
-}
-option.avail10n {
-	background: transparent url(../images/check-on.png) no-repeat 0 50%;
-}
-/* ------------------------------------------------------------------ contextual help */
-#help {
-	margin-top: 2em;
-	background: #f5f5f5;
-	z-index: 100;
-}
-#help-button {
-	position: fixed;
-	top: 3.2em;
-	right: 0px;
-	cursor: pointer;
-	background: #fc3;
-	border: 1px solid #dde;
-	border-right: none;
-	font-size: 1.1em;
-	font-weight: bold;
-	text-transform: capitalize;
-	padding: .33em .75em .33em 1em;
-	border-radius: 1em 0 0 1em;
-	color: #444;
-}
-.help-box {
-	display: none;
-}
-.help-box ul {
-	padding-left: 20px;
-	margin-left: 0;
-}
-#content.with-help #help-button {
-	right: 282px;
-}
-#content.with-help #help {
-	display: block;
-	position: absolute;
-	top: 40px;
-	right: 0;
-	width: 280px;
-	border-left: 2px solid #fc3;
-	margin-top: 0;
-	padding: 10px 0 0 0;
-	overflow: auto;
-}
-#content.with-help .help-content {
-	padding: 0 5px 1em 5px;
-}
-.help-content dt {
-	font-weight: bold;
-	color: #626262;
-	margin: 0;
-}
-.help-content dd {
-	margin: 0.3em 0 1.5em 0;
-}
-/* ------------------------------------------------------------------ popups */
-body.popup #wrapper, body.popup #top {
-	margin-top: -1.5em;
-	float: none;
-}
-body.popup #top h1 {
-	background: transparent;
-}
-body.popup #main {
-	margin-left: -35px;
-	margin-bottom: 1em;
-}
-body.popup #content {
-	margin-left: 35px;
-	margin-left: 2em;  /* 3.2 */
-}
-body.popup #footer {
-	display: none; /* 3.2 */
-}
-body.popup #footer p {
-	margin-left: 35px;
-	border: none;
-}
-/* ------------------------------------------------------------------ messages */
-div.error, p.error, 
-div.message, p.message, 
-div.static-msg, p.static-msg {
-	padding: 0.5em 0.5em 0.5em 48px;
-	margin-bottom: 1em;
-	border-radius: 8px;
-}
-p.error, p.message, p.static-msg {
-	padding-top: 1em;
-	padding-bottom: 1em;
-}
-div.error, p.error {
-	background: #ffdec8 url(msg-error.png) no-repeat .7em .7em;
-	color: #000;
-}
-div.message, p.message, 
-div.static-msg, p.static-msg {
-	background: #666 url(msg-std.png) no-repeat .7em .7em;
-	color: #fff;
-}
-div.message a, p.message a, 
-div.static-msg a, p.static-msg a {
-	color: #fff;
-}
-/* ------------------------------------------------------------------ debug */
-#debug {
-	position: absolute;
-	top: 0;
-	width: 100%;
-	height: 4px;
-	background: #d99;
-}
-#debug div {
-	display: none;
-	padding: 3px 0.5em 2px;
-}
-#debug p {
-	margin: 0.5em 0;
-}
-#debug:hover {
-	height: auto;
-}
-#debug:hover div {
-	display: block;
-}
-/* -------------------------------------------------------------------- CLASSES COMMUNES */
-
-.no-margin {
-	margin: 0;
-}
-
-/* paragraphe pour bouton Nouveau bidule */
-p.top-add {
-	text-align: right;
-	margin: 0;
-	}
-p.top-add a {
-	padding: .3em 1em .3em .5em;
-	font-weight: bold;
-}
-p.top-add a img {
-	padding-right: .3em;
-	vertical-align: middle;
-}
-/* Si quelque chose a besoin d'être caché sauf pour les revues d'écran */
-.hidden {
-    position: absolute !important;
-    clip: rect(1px 1px 1px 1px); /* IE6, IE7 */
-    clip: rect(1px, 1px, 1px, 1px);
-    padding: 0 !important;
-    border: 0 !important;
-    height: 1px !important;
-    width: 1px !important;
-    overflow: hidden;
-    }
-.clear {
-	clear: both;
-}
-.lclear {
-	clear: left;
-}
-div.clearer {
-	height: 1px;
-	font-size: 1px;
-}
-.hide {
-	display: none;
-}
-.right {
-	text-align: right;
-}
-.frame-shrink {
-	border: 1px solid #666;
-	padding: 0.5em;
-	margin-bottom: 1em;
-	height: 120px;
-	overflow: auto;
-}
-.grid {
-	background: transparent repeat url('grid.png') 0 0;
-}
-.line p {
-	margin: 0;
-}
-.offline {
-	color: #666;
-}
-ul.nice {
-	margin: 1em 0;
-	padding: 0 0 0 2em;
-	list-style: square;
-}
-ul.nice li {
-	margin:0;
-	padding: 0;
-}
-.zip-dl {
-	background: transparent url(package.png) no-repeat 0 50%;
-	padding: 5px 0 5px 20px;
-}
-/* pas trouvé dans le code */
-.comment {
-	border-top: 2px solid #ccc;
-	margin-bottom: 1em;
-	padding: 2em 0 1em 0;
-	position: relative;
-}
-.comment form p {
-	margin: 0;
-	position: absolute;
-	top: 2px;
-	right: 0;
-}
-.distrib img {
-	display: block;
-	float: right;
-	margin-top: -1em;
-}
-/* TABLES
--------------------------------------------------------- */
-table {
-	font-size: 1em;
-	border-collapse: collapse;
-	margin: 0 0 1em 0;
-}
-tr.line:hover {
-	background: #ddd;
-}
-caption {
-	color: #333;
-	font-size: 1.2em;
-	font-weight: bold;
-	text-align: left;
-	margin-bottom: .5em;
-}
-
-th, td {
-	border-width: 0 0 1px 0;
-	border-style: solid;
-	border-color: #ccc;
-	padding: 3px 5px;
-	vertical-align: top;
-}
-th {
-	text-align: left;
-	border-bottom-color: #666;
-}
-.noborder td, td.noborder, .noborder th, th.noborder {
-	border-width: 0;
-}
-table .maximal, table.maximal {
-	width: 100%;
-}
-table .minimal {
-	width: 1px;
-}
-table .nowrap {
-	white-space: nowrap;
-	vertical-align: top;
-}
-table.settings, table.prefs {
-	width: 80%;
-}
-table.settings th:first-child, table.prefs th:first-child {
-	width: 20%;
-}
-table.settings th + th, table.prefs th + th {
-	width: 30%;
-}
-table.settings th + th + th, table.prefs th + th + th {
-	width: 10%;
-}
-table.settings th:last-child, table.prefs th:last-child {
-	width: 40%;
-}
-
-td.status {
-	vertical-align: middle;
-}
-td.status img {
-	margin-bottom: -2px;
-}
-td.status a {
-	border: none;
-}
-
-tr.line img.expand {
-	margin-right: 10px;
-	margin-bottom: -2px;
-}
-tr.line input {
-	vertical-align: middle;
-}
-tr.expand td {
-	border-bottom: none;
-}
-td.expand {
-	padding: 1em;
-}
-
-.dragable {
-	border-collapse: separate;
-}
-.dragable tbody td {
-
-}
-.handle {
-	padding: 0;
-}
-.handler {
-	cursor: move;
-	background: transparent url(drag.png) no-repeat 0 50%;
-	padding-left: 15px;
-}
-
-/* ----------------------------------------------------------------- FORMS */
-form {
-	display: block;
-	margin: 0;
-	padding: 0;
-}
-fieldset, .fieldset {
-	display: block;
-	margin: 0 0 1em 0;
-	padding: 1em 0.5em;
-	border-width: 1px 0;
-	border-style: solid;
-	border-color: #ccc;
-	background: #f5f5f5;
-}
-legend {
-	font-weight: bold;
-	padding: 0.2em 0.6em;
-	border-width: 1px;
-	border-style: solid;
-	border-color: #ccc;
-	background: #f5f5f5;
-	margin-bottom: 0.5em;
-}
-optgroup {
-	font-weight: bold;
-	font-style: normal;
-}
-option {
-	font-weight: normal;
-}
-input, textarea, select {
-	background: #f9f9f9;
-	color: #000;
-	border-width: 1px;
-	border-style: solid;
-	border-color: #000 #ccc #ccc #000;
-}
-input.invalid, textarea.invalid, select.invalid {
-	border: 1px solid red;
-	background: #fff; 
-	color: red;
-	box-shadow: 0 0 0 1px rgba(218, 62, 90, 0.3)
-}
-input, textarea, select, option {
-	font: 1em "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;
-}
-input[type=text], input[type=password], textarea {
-	padding: 2px 0;
-	margin-right: .3em;
-}
-input[type=checkbox], input[type=radio] {
-	border: none;
-}
-textarea {
-	padding: 2px 0;
-}
-
-input[type=checkbox], input[type=radio] {
-	margin: 0;
-	padding: 0;
-	background: transparent;
-}
-label {
-	display: block;
-}
-label input, label select, label span {
-	display: block;
-}
-p.form-note {
-	font-style:italic;
-	margin-top: -.7em;
-	color: #666;
-}
-span.form-note {
-	font-style:italic;
-	font-weight: normal;
-	color: #666;
-}
-p.form-note.warn, p.form-note.info, p.warning {
-	font-style: normal;
-	padding: .2em 1em .1em 24px;
-}
-p.form-note.warn, p.warning {
-	background: #ffd url(warning.png) no-repeat .3em .3em;
-	border: 1px solid #f0c020;
-}
-p.form-note.info {
-	background: #eef url(info.png) no-repeat .3em .2em;
-	border: 1px solid #99f;
-}
-.form-note a {border-bottom: 1px solid #99f;}
-
-label.classic {
-	display: inline;
-}
-label.classic input, label span input, label.classic select, label span select {
-	display: inline;
-}
-
-label.area, p.area {
-	width: inherit !important;
-}
-.area textarea {
-	display: block;
-	width: 100%;
-	resize: vertical;
-}
-label.required {
-	font-weight: bold;
-}
-label.required abbr {
-	color: #dd0000;
-	font-size: 1.3em;
-}
-label.inline {
-	display: inline;
-}
-p.field {
-	position: relative;
-	
-}
-p.field label {
-	display: block;
-	width: 14em;
-}
-p.field input, p.field select {
-	display: inline;
-	position: absolute;
-	left: 15em;
-	top: 0;
-}
-label .maximal, textarea.maximal, input.maximal {
-	width: 100%;
-}
-textarea.maximal {
-	resize: vertical;
-}
-
-a.form-control {
-	display: none;
-	font-weight: bold;
-	background: url(magnifier.png) no-repeat 0 0;
-	color: green;
-	padding-left: 20px;
-}
-.constrained {
-	margin: 0;
-	padding: 0;
-	border: none;
-	background: transparent;
-}
-
-/* --------------------------------------------------------------- buttons */
-h2 a.button {
-	color: #333;
-	font-weight: normal;
-	font-size: .75em;
-	vertical-align: middle;
-}
-/* commun */
-input[type=submit],
-input[type=reset],
-input[type=button],
-a.button,
-a.back,
-a.submit {
-	display: inline-block;
-	outline: none;
-	cursor: pointer;
-	text-align: center;
-	text-decoration: none;
-	padding: .1em .5em 0 .5em;
-	text-shadow: 0 1px 1px rgba(0,0,0,.3);
-	border-radius: .2em;
-	margin-bottom: .1em;
-}
-/* validation */
-input[type=submit],
-input[type=button],
-a.submit {
-	color: #fff;
-	border: 1px solid #2373A8;
-	background: #2373A8;
-	background: -webkit-gradient(linear, left top, left bottom, from(#2C8FD1), to(#2373A8));
-	background: -moz-linear-gradient(top,  #2C8FD1,  #2373A8);
-}
-input[type=submit]:hover,
-input[type=button]:hover,
-a.submit:hover,
-input[type=submit]:focus,
-input[type=button]:focus,
-a.submit:focus {
-	background: #2373A8;
-	background: -webkit-gradient(linear, left top, left bottom, from(#2373A8), to(#2C8FD1));
-	background: -moz-linear-gradient(top,  #2373A8,  #2C8FD1);
-	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#2373A8', endColorstr='#2C8FD1');
-	border: 1px solid #2C8FD1;
-}
-/* suppression et reset */
-a.button,
-a.back,
-input[type=submit].reset,
-input[type=submit].delete {
-	border: 1px solid #ccc;
-	background: #f5f5f5;
-	color: #000;
-	background: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#dfdfdf));
-	background: -moz-linear-gradient(top,  #f5f5f5,  #dfdfdf);
-	text-shadow: none;
-	}
-a.button:hover,
-a.back:hover,
-input[type=reset]:hover,
-input[type=submit].reset:hover,
-input[type=submit].delete:hover,
-a.button:focus,
-a.back:focus,
-input[type=reset]:focus,
-input[type=submit].reset:focus,
-input[type=submit].delete:focus {
-	background: #dfdfdf;
-	background: -webkit-gradient(linear, left top, left bottom, from(#dfdfdf), to(#f5f5f5));
-	background: -moz-linear-gradient(top,  #dfdfdf,  #f5f5f5);
-	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#e5e5e5', endColorstr='#f5f5f5');
-	}
-a.delete,
-input.delete,
-input[type=submit].delete {
-	color: #c00;
-	padding-bottom: .1em;
-}
-#entry-content .delete {
-	margin-left: 1em;
-}
-a.delete:hover,
-input.delete:hover,
-input[type=submit].delete:hover,
-a.delete:focus,
-input.delete:focus,
-input[type=submit].delete:focus {
-	border-color: #c00;
-}
-/* finasseries */
-input[type=button] {
-	padding: .1em;
-}
-#info-box a.button {
-	padding: 0 .5em;
-	margin-left: 2em;
-}
-a.back:before {
-	content: "\ab\a0";
-}
-a.button.add {
-	border-radius: .5em;
-	margin-bottom: .1em;	
-	background: #2C8FD1 url(../images/add.png) no-repeat 6px center;
-	color: #fff;
-	padding: .2em 16px .2em 30px;
-	border: 1px solid #2373A8;
-}
-a.button.add:hover, a.button.add:focus {
-	background-color: #2373A8;
-}
-
-/* jQuery Autocomplete plugin */
-.ac_results {
-	padding: 0px;
-	border: 1px dotted #f90;
-	background-color: white;
-	overflow: hidden;
-	z-index: 99999;
-}
-.ac_results ul {
-	width: 100%;
-	list-style-position: outside;
-	list-style: none;
-	padding: 0;
-	margin: 0;
-}
-.ac_results li {
-	margin: 0px;
-	padding: 2px 5px;
-	cursor: default;
-	display: block;
-	font: menu;
-	font-size: 1em;
-	line-height: 16px;
-	overflow: hidden;
-}
-.ac_loading {
-	background: transparent url('loader.gif') right center no-repeat;
-}
-.ac_over {
-	background-color: #06c;
-	color: white;
-}
Index: nc/admin/default-templates/style/farbtastic/farbtastic.css
===================================================================
--- inc/admin/default-templates/style/farbtastic/farbtastic.css	(revision 1056)
+++ 	(revision )
@@ -1,33 +1,0 @@
-.farbtastic {
-  position: relative;
-}
-.farbtastic * {
-  position: absolute;
-  cursor: crosshair;
-}
-.farbtastic, .farbtastic .wheel {
-  width: 195px;
-  height: 195px;
-}
-.farbtastic .color, .farbtastic .overlay {
-  top: 47px;
-  left: 47px;
-  width: 101px;
-  height: 101px;
-}
-.farbtastic .wheel {
-  background: url(wheel.png) no-repeat;
-  width: 195px;
-  height: 195px;
-}
-.farbtastic .overlay {
-  background: url(mask.png) no-repeat;
-}
-.farbtastic .marker {
-  width: 17px;
-  height: 17px;
-  margin: -8px 0 0 -8px;
-  overflow: hidden; 
-  background: url(marker.png) no-repeat;
-}
-
Index: nc/admin/default-templates/style/iesucks.css
===================================================================
--- inc/admin/default-templates/style/iesucks.css	(revision 1056)
+++ 	(revision )
@@ -1,46 +1,0 @@
-#content {zoom:1;}
-label .maximal, textarea.maximal, input.maximal {
-	width : 98% !important;
-}
-.area textarea {
-	width : 98% !important;
-}
-textarea {
-	padding : 0 !important;
-}
-legend {
-	margin-bottom: 1em !important;
-}
-
-p.area {
-	width: 98% !important;
-}
-p.area textarea {
-	width: 100% !important;
-}
-
-tr.line input {
-	vertical-align: baseline !important;
-}
-
-#dashboard .col {
-	width: 48% !important;
-}
-
-td.status img, tr.line img.expand {
-	margin-bottom: 0 !important;
-}
-
-.wysiwygIframe {
-	width: 98% !important;
-}
-
-div.media-list .media-item {
-	width: 48% !important;
-}
-a.media-icon {
-	border-bottom:none !important;
-}
-#dashboard-main #icons p {
-	display: inline;
-}
Index: nc/admin/default-templates/style/install.css
===================================================================
--- inc/admin/default-templates/style/install.css	(revision 1085)
+++ 	(revision )
@@ -1,155 +1,0 @@
-/*
-	loader.css
-	Simple CSS rules for NetInstall
-	
-	(c) 2008 - Olivier Meunier & contributors - All rights reserved.
-	Please see http://dotclear.net/ for more details.
-*/
-body.install {
-	font: 0.875em Helvetica,Arial,sans-serif;
-	color: #000;
-	background-color: #fff;
-	line-height: 1.5em;
-}
-body.install #content {
-	width:32em;
-	margin:1em auto;
-}
-body.install #main {
-	padding:1em 2em;
-	border:1px #ccc solid;
-	border-radius: 8px;
-}
-body.install h1,h2 {
-	font-family: Helvetica,arial,sans-serif;
-}
-body.install h1 {
-	background: url(install/w-logo.png) no-repeat top center;
-	font-size:1.8em;
-	font-weight:normal;
-	text-align:center;
-	color: #666;
-	padding-top: 70px;
-	margin: 0 0 0.75em 0;
-}
-body.install h2 {
-	color: #ff6000;
-}
-body.install h3 {
-	margin-top:0;
-}
-body.install label {
-	color: #555;
-}
-
-body.install .msg {
-	padding:10px 10px 10px 60px;
-	border-radius:8px;
-}
-body.install .warning {
-	background: #ffc url(install/important.png) no-repeat 10px 10px;
-}
-body.install .notice {
-	background: #eef url(install/note.png) no-repeat 10px 10px;
-}
-a, a:link, a:visited {
-	color: #2373A8;
-	text-decoration: none;
-	border-bottom: 1px dotted #f90;
-}
-a:hover, a:active, a:focus {
-	text-decoration: underline;
-}
-
-div.error, p.error, div.message, p.message, div.static-msg, p.static-msg {
-	padding: 0.5em 0.5em 0.5em 60px;
-	margin-bottom: 1em;
-	border-radius: 8px;
-}
-p.error, p.message, p.static-msg {
-	padding-top: 1em;
-	padding-bottom: 1em;
-}
-div.error, p.error {
-	background: #e5bfbf url(install/process_warning.png) no-repeat 5px 5px;
-	color: #600;
-}
-div.message, p.message, div.static-msg, p.static-msg {
-	background: #666 url(install/note.png) no-repeat 5px 5px;
-	color: #fff;
-}
-div.message a, p.message a, div.static-msg a, p.static-msg a {
-	color: #fff;
-}
-label {
-	display : block;
-}
-label input, label select, label span {
-	display : block;
-}
-
-label.required {
-	font-weight : bold;
-}
-label.required abbr {
-	color: #dd0000;
-	font-size: 1.3em;
-}
-
-form {
-	display : block;
-	margin : 0;
-	padding : 0;
-}
-
-fieldset {
-	display : block;
-	margin : 0 0 1em 0;
-	padding : 1em 0.5em;
-	border-width : 1px 0;
-	border-style: solid;
-	border-color: #ccc;
-	background: #f5f5f5;
-}
-legend {
-	font-weight : bold;
-	padding: 0.2em 0.6em;
-	border-width: 1px;
-	border-style: solid;
-	border-color: #ccc;
-	background: #f5f5f5;
-	margin-bottom: 0.5em;
-}
-a#obfus {
-	color: #fff;
-	background-color: #666;
-	padding: 0 10px;
-	border-radius: 2px;
-}
-
-input[type=submit]{
-	font-size: 1.05em;
-	display: inline-block;
-	outline: none;
-	cursor: pointer;
-	text-align: center;
-	text-decoration: none;
-	padding: .1em .5em;
-	text-shadow: 0 1px 1px rgba(0,0,0,.3);
-	border-radius: .2em;
-	margin-bottom: .1em;
-	color: #fff;
-	border: 1px solid #2373A8;
-	background: #2373A8;
-	background: -webkit-gradient(linear, left top, left bottom, from(#2C8FD1), to(#2373A8));
-	background: -moz-linear-gradient(top,  #2C8FD1,  #2373A8);
-	width: 100%;
-}
-input[type=submit]:hover,
-input[type=submit]:focus {
-	background: #2373A8;
-	background: -webkit-gradient(linear, left top, left bottom, from(#2373A8), to(#2C8FD1));
-	background: -moz-linear-gradient(top,  #2373A8,  #2C8FD1);
-	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#2373A8', endColorstr='#2C8FD1');
-	border: 1px solid #2C8FD1;
-}
Index: nc/admin/default-templates/style/jsToolBar/jsToolBar.css
===================================================================
--- inc/admin/default-templates/style/jsToolBar/jsToolBar.css	(revision 1085)
+++ 	(revision )
@@ -1,173 +1,0 @@
-.jstEditor {
-	border-width : 0 1px 1px 1px;
-	border-style : solid;
-	border-color : #000 #ccc #ccc #000;
-	padding-left: 5px;
-	background : #f9f9f9;
-}
-.jstEditor textarea, .jstEditor iframe {
-  margin: 0;
-  border: 0;
-}
-
-.jstHandle {
-	height: 8px;
-	background: #ccc url(resize.png) no-repeat center center;
-	font-size: 0.1em;
-	cursor: s-resize;
-	border-color: #ccc #ccc #ccc #000;
-	border-width: 0 1px 1px 1px;
-	border-style: solid;
-}
-
-.jstElements {
-	padding: 3px 3px;
-	border-width: 1px 1px 0 1px;
-	border-style: solid;
-	border-color: #000 #ccc #ccc #000;
-	background: #dfdfdf;
-}
-
-.jstElements select, .jstElements button {
-	vertical-align: middle;
-}
-.jstElements select {
-	width: 12em;
-}
-.jstElements button {
-	margin-right : 2px;
-	width : 20px;
-	height: 20px;
-	padding: 0;
-	border-style: solid;
-	border-width: 1px;
-	border-color: #dfdfdf;
-	background-color : transparent;
-	background-position : 50% 50%;
-	background-repeat: no-repeat;
-}
-.jstElements button:hover {
-	border-color : #ccc;
-	background-color: #fff;
-}
-.jstElements button span {
-	display : none;	
-}
-.jstElements span {
-	display : inline;
-}
-
-.jstSpacer {
-	width : 0px;
-	font-size: 1px;
-	margin-right: 4px;
-}
-
-.jstSwitcher {
-	display: block;
-	list-style: none;
-	margin: 0 0 0 -5px;
-	padding: 0 0 5px 0;
-	background: #dfdfdf;
-	border-top: 1px solid #999;
-	font-size: 90%;
-	font-weight: bold;
-}
-.jstSwitcher li {
-	display: inline;
-	margin: 0 0 0 5px;
-	padding: 2px 4px;
-}
-.jstSwitcher li.jstSwitcherCurrent {
-	color: #fff;
-	background: #999;
-	border-radius: 0 0 2px 2px;
-}
-.jstSwitcher a {
-	font-weight: normal;
-	border-bottom: none !important;
-}
-
-/* Buttons
--------------------------------------------------------- */
-.jstb_strong {
-	background-image: url(bt_strong.png);
-}
-.jstb_em {
-	background-image: url(bt_em.png);
-}
-.jstb_ins {
-	background-image: url(bt_ins.png);
-}
-.jstb_del {
-	background-image: url(bt_del.png);
-}
-.jstb_quote {
-	background-image: url(bt_quote.png);
-}
-.jstb_code {
-	background-image: url(bt_code.png);
-}
-.jstb_paragraph {
-	background-image: url(bt_paragraph.png);
-}
-.jstb_br {
-	background-image: url(bt_br.png);
-}
-.jstb_blockquote {
-	background-image: url(bt_bquote.png);
-}
-.jstb_pre {
-	background-image: url(bt_pre.png);
-}
-.jstb_ul {
-	background-image: url(bt_ul.png);
-}
-.jstb_ol {
-	background-image: url(bt_ol.png);
-}
-.jstb_link {
-	background-image: url(bt_link.png);
-}
-.jstb_img {
-	background-image: url(bt_img.png);
-}
-.jstb_img_select {
-	background-image: url(bt_img_select.png);
-}
-.jstb_post_link {
-	background-image: url(bt_post.png);
-}
-.jstb_removeFormat {
-	background-image: url(bt_clean.png);
-}
-
-
-/* WYSIWYG Iframe */
-.wysiwygIframe {
-	border-width : 1px;
-	border-style : solid;
-	border-color : #000 #ccc #ccc #000;
-	width : 100%;
-}
-
-/* WYSIWYG Document */
-body.wysiwygDoc {
-	font: 12px "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;
-	color : #000;
-	background: #f9f9f9;
-	margin: 0;
-	padding : 2px;
-	border: none;
-}
-.wysiwygDoc pre, .wysiwygDoc code, .wysiwygDoc kbd, .wysiwygDoc samp {
-	font-family:"Courier New",Courier,monospace;
-	font-size : 1.1em;
-}
-.wysiwygDoc code {
-	color : #666;
-	font-weight : bold;
-}
-body.wysiwygDoc  > p:first-child {
-	margin-top: 0;
-}
Index: nc/admin/default-templates/style/modal/modal.css
===================================================================
--- inc/admin/default-templates/style/modal/modal.css	(revision 1056)
+++ 	(revision )
@@ -1,52 +1,0 @@
-div.jq-modal {
-	line-height: 1;
-	background: #fff;
-}
-div.jq-modal-container {
-	padding: 1px;
-	position: relative;
-}
-div.jq-modal-content {
-	position: relative;
-	overflow: auto;
-}
-div.jq-modal-closer {
-	position: absolute;
-	top: -12px;
-	right: -12px;
-	width: 25px;
-	height: 25px;
-}
-div.jq-modal-closer a {
-	display: block;
-	text-indent: -5000px;
-	width: 25px;
-	height: 25px;
-	outline: none;
-	border: none;
-}
-
-/* modalImage */
-div.jq-modal-content img {
-	display: block;
-}
-span.jq-modal-legend {
-	display: block;
-	padding: 3px 0;
-}
-a.jq-modal-next, a.jq-modal-prev {
-	display: block;
-	position: absolute;
-	top: 0;
-	width: 50%;
-	bottom: 0;
-	outline: none;
-	border: none;
-	text-indent: -5000px;
-}
-a.jq-modal-next {
-	right: 0;
-}
-a.jq-modal-prev {
-	left: 0;
-}
Index: nc/admin/default-templates/tab_layout.html.twig
===================================================================
--- inc/admin/default-templates/tab_layout.html.twig	(revision 1092)
+++ 	(revision )
@@ -1,24 +1,0 @@
-{# Page tabs #}
-
-{# Add page header for tabs with {{ init_tabs() }} in your page header #}
-{% block page_tab_head %}
-	{% import "js_helpers.html.twig" as js %}
-	{{ js.page_tabs(default_tab) }}
-{% endblock %}
-
-{# Begin an existing tab with {% tab a_tab_name %} #}
-{# Create/overwrite one with {% tab a_tab_name(a_tab_id,a_tab_title) %} #}
-{% block page_tab_begin %}
-	<div class="multi-part" title="{{ title }}" id="{{ id }}">
-{% endblock %}
-
-{# End a tab with {% endtab %} #}
-{% block page_tab_end %}
-	</div>
-{% endblock %}
-
-{# Add fake tab with {{ faketab(a_tab_name) }} #}
-{# Create/overwrite one with {{ faketab(a_tab_name,a_tab_id,a_tab_title,a_tab_url) }} #}
-{% block page_tab_fake %}
-	<a class="multi-part" href="{{ url }}" title="{{ title }}">{{ title }}</a>
-{% endblock %}
Index: inc/admin/lib.dc.page.php
===================================================================
--- inc/admin/lib.dc.page.php	(revision 1089)
+++ inc/admin/lib.dc.page.php	(revision 1049)
@@ -49,39 +49,215 @@
 	
 	# Top of admin page
-	public static function open($title='',$head='',$popup=false)
-	{
-		global $core, $_ctx;
-		
-		$_ctx->popup = (boolean) $popup;
-		$_ctx->page_header = $head;
-		$_ctx->fillPageTitle($title);
-		
-		ob_start();
+	public static function open($title='', $head='')
+	{
+		global $core;
+		
+		# List of user's blogs
+		if ($core->auth->blog_count == 1 || $core->auth->blog_count > 20)
+		{
+			$blog_box =
+			'<p>'.__('Blog:').' <strong title="'.html::escapeHTML($core->blog->url).'">'.
+			html::escapeHTML($core->blog->name).'</strong>';
+			
+			if ($core->auth->blog_count > 20) {
+				$blog_box .= ' - <a href="blogs.php">'.__('Change blog').'</a>';
+			}
+			$blog_box .= '</p>';
+		}
+		else
+		{
+			$rs_blogs = $core->getBlogs(array('order'=>'LOWER(blog_name)','limit'=>20));
+			$blogs = array();
+			while ($rs_blogs->fetch()) {
+				$blogs[html::escapeHTML($rs_blogs->blog_name.' - '.$rs_blogs->blog_url)] = $rs_blogs->blog_id;
+			}
+			$blog_box =
+			'<p><label for="switchblog" class="classic">'.
+			__('Blogs:').' '.
+			$core->formNonce().
+			form::combo('switchblog',$blogs,$core->blog->id).
+			'</label></p>'.
+			'<noscript><p><input type="submit" value="'.__('ok').'" /></p></noscript>';
+		}
+		
+		$safe_mode = isset($_SESSION['sess_safe_mode']) && $_SESSION['sess_safe_mode'];
+		
+		# Display
+		header('Content-Type: text/html; charset=UTF-8');
+		echo
+		'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" '.
+		' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n".
+		'<html xmlns="http://www.w3.org/1999/xhtml" '.
+		'xml:lang="'.$core->auth->getInfo('user_lang').'" '.
+		'lang="'.$core->auth->getInfo('user_lang').'">'."\n".
+		"<head>\n".
+		'  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'."\n".
+		'  <title>'.$title.' - '.html::escapeHTML($core->blog->name).' - '.html::escapeHTML(DC_VENDOR_NAME).' - '.DC_VERSION.'</title>'."\n".
+		
+		'  <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />'."\n".
+		'  <meta name="GOOGLEBOT" content="NOSNIPPET" />'."\n".
+		
+		self::jsLoadIE7().
+		'  	<link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />'."\n"; 
+		if (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl') {
+			echo
+		'  	<link rel="stylesheet" href="style/default-rtl.css" type="text/css" media="screen" />'."\n"; 
+		}
+
+		$core->auth->user_prefs->addWorkspace('interface');
+		$user_ui_hide_std_favicon = $core->auth->user_prefs->interface->hide_std_favicon;
+		if (!$user_ui_hide_std_favicon) {
+			echo '<link rel="icon" type="image/png" href="images/favicon.png" />';
+		}
+		
+		echo
+		self::jsCommon().
+		$head;
+		
+		# --BEHAVIOR-- adminPageHTMLHead
+		$core->callBehavior('adminPageHTMLHead');
+		
+		echo
+		"</head>\n".
+		'<body id="dotclear-admin'.
+		($safe_mode ? ' safe-mode' : '').
+		'">'."\n".
+		
+		'<div id="header">'.
+		'<ul id="prelude"><li><a href="#content">'.__('Go to the content').'</a></li><li><a href="#main-menu">'.__('Go to the menu').'</a></li></ul>'."\n".
+		'<div id="top"><h1><a href="index.php">'.DC_VENDOR_NAME.'</a></h1></div>'."\n";	
+		
+		echo
+		'<div id="info-boxes">'.
+		'<div id="info-box1">'.
+		'<form action="index.php" method="post">'.
+		$blog_box.
+		'<p><a href="'.$core->blog->url.'" onclick="window.open(this.href);return false;" title="'.__('Go to site').' ('.__('new window').')'.'">'.__('Go to site').' <img src="images/outgoing.png" alt="" /></a>'.
+		'</p></form>'.
+		'</div>'.
+		'<div id="info-box2">'.
+		'<a'.(preg_match('/index.php$/',$_SERVER['REQUEST_URI']) ? ' class="active"' : '').' href="index.php">'.__('My dashboard').'</a>'.
+		'<span> | </span><a'.(preg_match('/preferences.php(\?.*)?$/',$_SERVER['REQUEST_URI']) ? ' class="active"' : '').' href="preferences.php">'.__('My preferences').'</a>'.
+		'<span> | </span><a href="index.php?logout=1" class="logout">'.sprintf(__('Logout %s'),$core->auth->userID()).' <img src="images/logout.png" alt="" /></a>'.
+		'</div>'.
+		'</div>'.
+		'</div>';
+		
+		echo
+		'<div id="wrapper">'."\n".
+		'<div id="main">'."\n".
+		'<div id="content">'."\n";
+		
+		# Safe mode
+		if ($safe_mode)
+		{
+			echo
+			'<div class="error"><h3>'.__('Safe mode').'</h3>'.
+			'<p>'.__('You are in safe mode. All plugins have been temporarily disabled. Remind to log out then log in again normally to get back all functionalities').'</p>'.
+			'</div>';
+		}
+		
+		if ($core->error->flag()) {
+			echo
+			'<div class="error"><p><strong>'.(count($core->error->getErrors()) > 1 ? __('Errors:') : __('Error:')).'</p></strong>'.
+			$core->error->toHTML().
+			'</div>';
+		}
 	}
 	
 	public static function close()
 	{
-		$res = ob_get_contents();
-		ob_end_clean();
-		
-		global $core, $_ctx;
+		global $core;
+
+		$menu =& $GLOBALS['_menu'];
+		
+		echo
+		"</div>\n".		// End of #content
+		"</div>\n".		// End of #main
+		
+		'<div id="main-menu">'."\n";
+		
+		foreach ($menu as $k => $v) {
+			echo $menu[$k]->draw();
+		}
+		
+		$text = sprintf(__('Thank you for using %s.'),'<a href="http://dotclear.org/">Dotclear '.DC_VERSION.'</a>');
+
+		# --BEHAVIOR-- adminPageFooter
+		$textAlt = $core->callBehavior('adminPageFooter',$core,$text);
+
+		echo
+		'</div>'."\n".		// End of #main-menu
+		'<div id="footer"><p>'.($textAlt != '' ? $textAlt : $text).'</p></div>'."\n".
+		"</div>\n";		// End of #wrapper
+		
+		if (defined('DC_DEV') && DC_DEV === true) {
+			echo self::debugInfo();
+		}
+		
+		echo
+		'</body></html>';
+	}
+	
+	public static function openPopup($title='', $head='')
+	{
+		global $core;
+		
+		# Display
+		header('Content-Type: text/html; charset=UTF-8');
+		echo
+		'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" '.
+		' "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n".
+		'<html xmlns="http://www.w3.org/1999/xhtml" '.
+		'xml:lang="'.$core->auth->getInfo('user_lang').'" '.
+		'lang="'.$core->auth->getInfo('user_lang').'">'."\n".
+		"<head>\n".
+		'  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />'."\n".
+		'  <title>'.$title.' - '.html::escapeHTML($core->blog->name).' - '.html::escapeHTML(DC_VENDOR_NAME).' - '.DC_VERSION.'</title>'."\n".
+		
+		'  <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />'."\n".
+		'  <meta name="GOOGLEBOT" content="NOSNIPPET" />'."\n".
+		
+		self::jsLoadIE7().
+		'  	<link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />'."\n"; 
+		if (l10n::getTextDirection($GLOBALS['_lang']) == 'rtl') {
+			echo
+			'  	<link rel="stylesheet" href="style/default-rtl.css" type="text/css" media="screen" />'."\n"; 
+		}
+		
+		echo
+		self::jsCommon().
+		$head;
+		
+		# --BEHAVIOR-- adminPageHTMLHead
+		$core->callBehavior('adminPageHTMLHead');
+		
+		echo
+		"</head>\n".
+		'<body id="dotclear-admin" class="popup">'."\n".
+		
+		'<div id="top"><h1>'.DC_VENDOR_NAME.'</h1></div>'."\n";
+		
+		echo
+		'<div id="wrapper">'."\n".
+		'<div id="main">'."\n".
+		'<div id="content">'."\n";
 		
 		if ($core->error->flag()) {
-			foreach($core->error->getErrors() as $e) {
-				$_ctx->addError($e);
-			}
-		}
-		$_ctx->page_content = $res;
-		$core->tpl->display('page_layout.html.twig');
-	}
-	
-	public static function openPopup($title='',$head='')
-	{
-		self::open($title,$head,true);
+			echo
+			'<div class="error"><strong>'.__('Errors:').'</strong>'.
+			$core->error->toHTML().
+			'</div>';
+		}
 	}
 	
 	public static function closePopup()
 	{
-		self::close();
+		echo
+		"</div>\n".		// End of #content
+		"</div>\n".		// End of #main
+		'<div id="footer"><p>&nbsp;</p></div>'."\n".
+		"</div>\n".		// End of #wrapper
+		'</body></html>';
 	}
 
@@ -99,4 +275,47 @@
 			}
 		}
+		return $res;
+	}
+	
+	private static function debugInfo()
+	{
+		$global_vars = implode(', ',array_keys($GLOBALS));
+		
+		$res =
+		'<div id="debug"><div>'.
+		'<p>memory usage: '.memory_get_usage().' ('.files::size(memory_get_usage()).')</p>';
+		
+		if (function_exists('xdebug_get_profiler_filename'))
+		{
+			$res .= '<p>Elapsed time: '.xdebug_time_index().' seconds</p>';
+			
+			$prof_file = xdebug_get_profiler_filename();
+			if ($prof_file) {
+				$res .= '<p>Profiler file : '.xdebug_get_profiler_filename().'</p>';
+			} else {
+				$prof_url = http::getSelfURI();
+				$prof_url .= (strpos($prof_url,'?') === false) ? '?' : '&';
+				$prof_url .= 'XDEBUG_PROFILE';
+				$res .= '<p><a href="'.html::escapeURL($prof_url).'">Trigger profiler</a></p>';
+			}
+			
+			/* xdebug configuration:
+			zend_extension = /.../xdebug.so
+			xdebug.auto_trace = On
+			xdebug.trace_format = 0
+			xdebug.trace_options = 1
+			xdebug.show_mem_delta = On
+			xdebug.profiler_enable = 0
+			xdebug.profiler_enable_trigger = 1
+			xdebug.profiler_output_dir = /tmp
+			xdebug.profiler_append = 0
+			xdebug.profiler_output_name = timestamp
+			*/
+		}
+		
+		$res .=
+		'<p>Global vars: '.$global_vars.'</p>'.
+		'</div></div>';
+		
 		return $res;
 	}
Index: inc/admin/prepend.php
===================================================================
--- inc/admin/prepend.php	(revision 1080)
+++ inc/admin/prepend.php	(revision 1069)
@@ -375,12 +375,3 @@
 	}
 }
-
-# Add admin default templates path
-$core->tpl->getLoader()->addPath(dirname(__FILE__).'/default-templates');
-# Set admin context
-$_ctx = new dcAdminContext($core);
-$core->tpl->addExtension($_ctx);
-
-# --BEHAVIOR-- adminPrepend
-$core->callBehavior('adminPrepend',$core,$_ctx);
 ?>
Index: inc/core/class.dc.core.php
===================================================================
--- inc/core/class.dc.core.php	(revision 1092)
+++ inc/core/class.dc.core.php	(revision 706)
@@ -39,5 +39,4 @@
 	public $rest;		///< <b>dcRestServer</b>	dcRestServer object
 	public $log;		///< <b>dcLog</b>			dcLog object
-	public $tpl;		///< <b>Twig_Environment</b>	Twig_Environment object
 	
 	private $versions = null;
@@ -96,6 +95,4 @@
 		$this->addFormater('xhtml', create_function('$s','return $s;'));
 		$this->addFormater('wiki', array($this,'wikiTransform'));
-		
-		$this->loadTemplateEnvironment();
 	}
 	
@@ -121,40 +118,4 @@
 	}
 	
-	/**
-	Create template environment (Twig_Environment instance)
-	
-	default-templates path must be added from admin|public/prepend.php with:
-	$core->tpl->getLoader()->addPath('PATH_TO/default-templates');
-	Selected theme path must be added with:
-	$core->tpl->getLoader()->prependPath('PATH_TO/MY_THEME');
-	*/
-	protected function loadTemplateEnvironment()
-	{
-		# If cache dir is writable, use it.
-		$cache_dir = path::real(DC_TPL_CACHE.'/twtpl',false);
-		if (!is_dir($cache_dir)) {
-			try {
-				files::makeDir($cache_dir);
-			} catch (Exception $e) {
-				$cache_dir = false;
-			}
-		}
-		
-		$this->tpl = new Twig_Environment(
-			new Twig_Loader_Filesystem(dirname(__FILE__).'/../swf'),
-			array(
-				'auto_reload' => true,
-				'autoescape' => 'html',
-				'base_template_class' => 'Twig_Template',
-				'cache' => $cache_dir, 
-				'charset' => 'UTF-8',
-				'debug' => DC_DEBUG,
-				'optimizations' => -1,
-				'strict_variables' => 0 //DC_DEBUG // Please fix undefined variables!
-			)
-		);
-		$this->tpl->addExtension(new dcFormExtension($this));
-		$this->tpl->addExtension(new dcTabExtension($this));
-	}
 	
 	/// @name Blog init methods
Index: nc/core/class.dc.twig.page.php
===================================================================
--- inc/core/class.dc.twig.page.php	(revision 1014)
+++ 	(revision )
@@ -1,65 +1,0 @@
-<?php
-
-// common to public and admin sides @see inc/admin/prepend.php
-class dcTwigPage extends Twig_Environment
-{
-	protected $core;
-	protected $context = null;
-	
-	public function __construct($default_tpl_dir,$cache_dir,$context,$core)
-	{
-		$this->core =& $core;
-		
-		# Twig Loader
-		$loader = new Twig_Loader_Filesystem($this->checkDefaultTemplateDir($default_tpl_dir));
-		
-		# Twig Environment options
-		$options = array(
-			'auto_reload' => true,
-			'base_template_class' => 'Twig_Template',
-			'cache' => $this->setCacheDir($cache_dir),
-			'charset' => 'UTF-8',
-			'debug' => DC_DEBUG,
-			'optimizations' => -1
-		);
-		
-		# Twig Environment
-		parent::__construct($loader,$options);
-		
-		# Add context helper (public vs admin)
-		if ($context instanceof Twig_ExtensionInterface) {
-			$this->context = $context;
-			$this->addExtension($context);
-		}
-		
-		# Add form helper
-		$this->addExtension(new dcFormExtension($core));
-		
-		$this->clearCacheFiles();
-	}
-	
-	protected function checkDefaultTemplateDir($dir)
-	{
-		$dir = path::real($dir,false);
-		
-		return is_dir($dir) ? $dir : false;
-	}
-	
-	protected function setCacheDir($dir)
-	{
-		try {
-			$dir = path::real($dir,false);
-			files::makeDir($dir,true);
-			return $dir;
-		}
-		catch(Exception $e) { }
-		
-		return false;
-	}
-	
-	public function getContext()
-	{
-		return $this->context;
-	}
-}
-?>
Index: inc/dbschema/upgrade.php
===================================================================
--- inc/dbschema/upgrade.php	(revision 706)
+++ inc/dbschema/upgrade.php	(revision 1083)
@@ -305,4 +305,34 @@
 				$core->con->execute($strReq);
 			}
+
+			if (version_compare($version,'2.5','<='))
+			{
+				# Try to disable daInstaller plugin if it has been installed outside the default plugins directory
+				$path = explode(PATH_SEPARATOR,DC_PLUGINS_ROOT);
+				$default = path::real(dirname(__FILE__).'/../../plugins/');
+				foreach ($path as $root)
+				{
+					if (!is_dir($root) || !is_readable($root)) {
+						continue;
+					}
+					if (substr($root,-1) != '/') {
+						$root .= '/';
+					}
+					if (($p = @dir($root)) === false) {
+						continue;
+					}
+					if(path::real($root) == $default) {
+						continue;
+					}
+					if (($d = @dir($root.'daInstaller')) === false) {
+						continue;
+					}
+					$f = $root.'/daInstaller/_disabled';
+					if (!file_exists($f))
+					{
+						@file_put_contents($f,'');
+					}
+				}
+			}
 			
 			$core->setVersion('core',DC_VERSION);
Index: nc/libs/twig/AUTHORS
===================================================================
--- inc/libs/twig/AUTHORS	(revision 0)
+++ 	(revision )
@@ -1,9 +1,0 @@
-Twig is written and maintained by the Twig Team:
-
-Lead Developer:
-
-- Fabien Potencier <fabien.potencier@symfony-project.org>
-
-Project Founder:
-
-- Armin Ronacher <armin.ronacher@active-4.com>
Index: nc/libs/twig/Autoloader.php
===================================================================
--- inc/libs/twig/Autoloader.php	(revision 991)
+++ 	(revision )
@@ -1,44 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Autoloads Twig classes.
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Autoloader
-{
-    /**
-     * Registers Twig_Autoloader as an SPL autoloader.
-     */
-    public static function register()
-    {
-        ini_set('unserialize_callback_func', 'spl_autoload_call');
-        spl_autoload_register(array(new self, 'autoload'));
-    }
-
-    /**
-     * Handles autoloading of classes.
-     *
-     * @param string $class A class name.
-     */
-    public static function autoload($class)
-    {
-        if (0 !== strpos($class, 'Twig')) {
-            return;
-        }
-
-        if (is_file($file = dirname(__FILE__).'/../'.str_replace(array('_', "\0"), array('/', ''), $class).'.php')) {
-            require $file;
-        }
-    }
-}
Index: nc/libs/twig/CHANGELOG
===================================================================
--- inc/libs/twig/CHANGELOG	(revision 991)
+++ 	(revision )
@@ -1,579 +1,0 @@
-* 1.11.1 (2012-11-11)
-
- * fixed debug info line numbering (was off by 2)
- * fixed escaping when calling a macro inside another one (regression introduced in 1.9.1)
- * optimized variable access on PHP 5.4
- * fixed a crash of the C extension when an exception was thrown from a macro called without being imported (using _self.XXX)
-
-* 1.11.0 (2012-11-07)
-
- * fixed macro compilation when a variable name is a PHP reserved keyword
- * changed the date filter behavior to always apply the default timezone, except if false is passed as the timezone
- * fixed bitwise operator precedences
- * added the template_from_string function
- * fixed default timezone usage for the date function
- * optimized the way Twig exceptions are managed (to make them faster)
- * added Twig_ExistsLoaderInterface (implementing this interface in your loader make the chain loader much faster)
-
-* 1.10.3 (2012-10-19)
-
- * fixed wrong template location in some error messages
- * reverted a BC break introduced in 1.10.2
- * added a split filter
-
-* 1.10.2 (2012-10-15)
-
- * fixed macro calls on PHP 5.4
-
-* 1.10.1 (2012-10-15)
-
- * made a speed optimization to macro calls when imported via the "import" tag
- * fixed C extension compilation on Windows
- * fixed a segfault in the C extension when using DateTime objects
-
-* 1.10.0 (2012-09-28)
-
- * extracted functional tests framework to make it reusable for third-party extensions
- * added namespaced templates support in Twig_Loader_Filesystem
- * added Twig_Loader_Filesystem::prependPath()
- * fixed an error when a token parser pass a closure as a test to the subparse() method
-
-* 1.9.2 (2012-08-25)
-
- * fixed the in operator for objects that contain circular references
- * fixed the C extension when accessing a public property of an object implementing the \ArrayAccess interface
-
-* 1.9.1 (2012-07-22)
-
- * optimized macro calls when auto-escaping is on
- * fixed wrong parent class for Twig_Function_Node
- * made Twig_Loader_Chain more explicit about problems
-
-* 1.9.0 (2012-07-13)
-
- * made the parsing independent of the template loaders
- * fixed exception trace when an error occurs when rendering a child template
- * added escaping strategies for CSS, URL, and HTML attributes
- * fixed nested embed tag calls
- * added the date_modify filter
-
-* 1.8.3 (2012-06-17)
-
- * fixed paths in the filesystem loader when passing a path that ends with a slash or a backslash
- * fixed escaping when a project defines a function named html or js
- * fixed chmod mode to apply the umask correctly
-
-* 1.8.2 (2012-05-30)
-
- * added the abs filter
- * fixed a regression when using a number in template attributes
- * fixed compiler when mbstring.func_overload is set to 2
- * fixed DateTimeZone support in date filter
-
-* 1.8.1 (2012-05-17)
-
- * fixed a regression when dealing with SimpleXMLElement instances in templates
- * fixed "is_safe" value for the "dump" function when "html_errors" is not defined in php.ini
- * switched to use mbstring whenever possible instead of iconv (you might need to update your encoding as mbstring and iconv encoding names sometimes differ)
-
-* 1.8.0 (2012-05-08)
-
- * enforced interface when adding tests, filters, functions, and node visitors from extensions
- * fixed a side-effect of the date filter where the timezone might be changed
- * simplified usage of the autoescape tag; the only (optional) argument is now the escaping strategy or false (with a BC layer)
- * added a way to dynamically change the auto-escaping strategy according to the template "filename"
- * changed the autoescape option to also accept a supported escaping strategy (for BC, true is equivalent to html)
- * added an embed tag
-
-* 1.7.0 (2012-04-24)
-
- * fixed a PHP warning when using CIFS
- * fixed template line number in some exceptions
- * added an iterable test
- * added an error when defining two blocks with the same name in a template
- * added the preserves_safety option for filters
- * fixed a PHP notice when trying to access a key on a non-object/array variable
- * enhanced error reporting when the template file is an instance of SplFileInfo
- * added Twig_Environment::mergeGlobals()
- * added compilation checks to avoid misuses of the sandbox tag
- * fixed filesystem loader freshness logic for high traffic websites
- * fixed random function when charset is null
-
-* 1.6.5 (2012-04-11)
-
- * fixed a regression when a template only extends another one without defining any blocks
-
-* 1.6.4 (2012-04-02)
-
- * fixed PHP notice in Twig_Error::guessTemplateLine() introduced in 1.6.3
- * fixed performance when compiling large files
- * optimized parent template creation when the template does not use dynamic inheritance
-
-* 1.6.3 (2012-03-22)
-
- * fixed usage of Z_ADDREF_P for PHP 5.2 in the C extension
- * fixed compilation of numeric values used in templates when using a locale where the decimal separator is not a dot
- * made the strategy used to guess the real template file name and line number in exception messages much faster and more accurate
-
-* 1.6.2 (2012-03-18)
-
- * fixed sandbox mode when used with inheritance
- * added preserveKeys support for the slice filter
- * fixed the date filter when a DateTime instance is passed with a specific timezone
- * added a trim filter
-
-* 1.6.1 (2012-02-29)
-
- * fixed Twig C extension
- * removed the creation of Twig_Markup instances when not needed
- * added a way to set the default global timezone for dates
- * fixed the slice filter on strings when the length is not specified
- * fixed the creation of the cache directory in case of a race condition
-
-* 1.6.0 (2012-02-04)
-
- * fixed raw blocks when used with the whitespace trim option
- * made a speed optimization to macro calls when imported via the "from" tag
- * fixed globals, parsers, visitors, filters, tests, and functions management in Twig_Environment when a new one or new extension is added
- * fixed the attribute function when passing arguments
- * added slice notation support for the [] operator (syntactic sugar for the slice operator)
- * added a slice filter
- * added string support for the reverse filter
- * fixed the empty test and the length filter for Twig_Markup instances
- * added a date function to ease date comparison
- * fixed unary operators precedence
- * added recursive parsing support in the parser
- * added string and integer handling for the random function
-
-* 1.5.1 (2012-01-05)
-
- * fixed a regression when parsing strings
-
-* 1.5.0 (2012-01-04)
-
- * added Traversable objects support for the join filter
-
-* 1.5.0-RC2 (2011-12-30)
-
- * added a way to set the default global date interval format
- * fixed the date filter for DateInterval instances (setTimezone() does not exist for them)
- * refactored Twig_Template::display() to ease its extension
- * added a number_format filter
-
-* 1.5.0-RC1 (2011-12-26)
-
- * removed the need to quote hash keys
- * allowed hash keys to be any expression
- * added a do tag
- * added a flush tag
- * added support for dynamically named filters and functions
- * added a dump function to help debugging templates
- * added a nl2br filter
- * added a random function
- * added a way to change the default format for the date filter
- * fixed the lexer when an operator ending with a letter ends a line
- * added string interpolation support
- * enhanced exceptions for unknown filters, functions, tests, and tags
-
-* 1.4.0 (2011-12-07)
-
- * fixed lexer when using big numbers (> PHP_INT_MAX)
- * added missing preserveKeys argument to the reverse filter
- * fixed macros containing filter tag calls
-
-* 1.4.0-RC2 (2011-11-27)
-
- * removed usage of Reflection in Twig_Template::getAttribute()
- * added a C extension that can optionally replace Twig_Template::getAttribute()
- * added negative timestamp support to the date filter
-
-* 1.4.0-RC1 (2011-11-20)
-
- * optimized variable access when using PHP 5.4
- * changed the precedence of the .. operator to be more consistent with languages that implements such a feature like Ruby
- * added an Exception to Twig_Loader_Array::isFresh() method when the template does not exist to be consistent with other loaders
- * added Twig_Function_Node to allow more complex functions to have their own Node class
- * added Twig_Filter_Node to allow more complex filters to have their own Node class
- * added Twig_Test_Node to allow more complex tests to have their own Node class
- * added a better error message when a template is empty but contain a BOM
- * fixed "in" operator for empty strings
- * fixed the "defined" test and the "default" filter (now works with more than one call (foo.bar.foo) and for both values of the strict_variables option)
- * changed the way extensions are loaded (addFilter/addFunction/addGlobal/addTest/addNodeVisitor/addTokenParser/addExtension can now be called in any order)
- * added Twig_Environment::display()
- * made the escape filter smarter when the encoding is not supported by PHP
- * added a convert_encoding filter
- * moved all node manipulations outside the compile() Node method
- * made several speed optimizations
-
-* 1.3.0 (2011-10-08)
-
-no changes
-
-* 1.3.0-RC1 (2011-10-04)
-
- * added an optimization for the parent() function
- * added cache reloading when auto_reload is true and an extension has been modified
- * added the possibility to force the escaping of a string already marked as safe (instance of Twig_Markup)
- * allowed empty templates to be used as traits
- * added traits support for the "parent" function
-
-* 1.2.0 (2011-09-13)
-
-no changes
-
-* 1.2.0-RC1 (2011-09-10)
-
- * enhanced the exception when a tag remains unclosed
- * added support for empty Countable objects for the "empty" test
- * fixed algorithm that determines if a template using inheritance is valid (no output between block definitions)
- * added better support for encoding problems when escaping a string (available as of PHP 5.4)
- * added a way to ignore a missing template when using the "include" tag ({% include "foo" ignore missing %})
- * added support for an array of templates to the "include" and "extends" tags ({% include ['foo', 'bar'] %})
- * added support for bitwise operators in expressions
- * added the "attribute" function to allow getting dynamic attributes on variables
- * added Twig_Loader_Chain
- * added Twig_Loader_Array::setTemplate()
- * added an optimization for the set tag when used to capture a large chunk of static text
- * changed name regex to match PHP one "[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*" (works for blocks, tags, functions, filters, and macros)
- * removed the possibility to use the "extends" tag from a block
- * added "if" modifier support to "for" loops
-
-* 1.1.2 (2011-07-30)
-
- * fixed json_encode filter on PHP 5.2
- * fixed regression introduced in 1.1.1 ({{ block(foo|lower) }})
- * fixed inheritance when using conditional parents
- * fixed compilation of templates when the body of a child template is not empty
- * fixed output when a macro throws an exception
- * fixed a parsing problem when a large chunk of text is enclosed in a comment tag
- * added PHPDoc for all Token parsers and Core extension functions
-
-* 1.1.1 (2011-07-17)
-
- * added a performance optimization in the Optimizer (also helps to lower the number of nested level calls)
- * made some performance improvement for some edge cases
-
-* 1.1.0 (2011-06-28)
-
- * fixed json_encode filter
-
-* 1.1.0-RC3 (2011-06-24)
-
- * fixed method case-sensitivity when using the sandbox mode
- * added timezone support for the date filter
- * fixed possible security problems with NUL bytes
-
-* 1.1.0-RC2 (2011-06-16)
-
- * added an exception when the template passed to "use" is not a string
- * made 'a.b is defined' not throw an exception if a is not defined (in strict mode)
- * added {% line \d+ %} directive
-
-* 1.1.0-RC1 (2011-05-28)
-
-Flush your cache after upgrading.
-
- * fixed date filter when using a timestamp
- * fixed the defined test for some cases
- * fixed a parsing problem when a large chunk of text is enclosed in a raw tag
- * added support for horizontal reuse of template blocks (see docs for more information)
- * added whitespace control modifier to all tags (see docs for more information)
- * added null as an alias for none (the null test is also an alias for the none test now)
- * made TRUE, FALSE, NONE equivalent to their lowercase counterparts
- * wrapped all compilation and runtime exceptions with Twig_Error_Runtime and added logic to guess the template name and line
- * moved display() method to Twig_Template (generated templates should now use doDisplay() instead)
-
-* 1.0.0 (2011-03-27)
-
- * fixed output when using mbstring
- * fixed duplicate call of methods when using the sandbox
- * made the charset configurable for the escape filter
-
-* 1.0.0-RC2 (2011-02-21)
-
- * changed the way {% set %} works when capturing (the content is now marked as safe)
- * added support for macro name in the endmacro tag
- * make Twig_Error compatible with PHP 5.3.0 >
- * fixed an infinite loop on some Windows configurations
- * fixed the "length" filter for numbers
- * fixed Template::getAttribute() as properties in PHP are case sensitive
- * removed coupling between Twig_Node and Twig_Template
- * fixed the ternary operator precedence rule
-
-* 1.0.0-RC1 (2011-01-09)
-
-Backward incompatibilities:
-
- * the "items" filter, which has been deprecated for quite a long time now, has been removed
- * the "range" filter has been converted to a function: 0|range(10) -> range(0, 10)
- * the "constant" filter has been converted to a function: {{ some_date|date('DATE_W3C'|constant) }} -> {{ some_date|date(constant('DATE_W3C')) }}
- * the "cycle" filter has been converted to a function: {{ ['odd', 'even']|cycle(i) }} -> {{ cycle(['odd', 'even'], i) }}
- * the "for" tag does not support "joined by" anymore
- * the "autoescape" first argument is now "true"/"false" (instead of "on"/"off")
- * the "parent" tag has been replaced by a "parent" function ({{ parent() }} instead of {% parent %})
- * the "display" tag has been replaced by a "block" function ({{ block('title') }} instead of {% display title %})
- * removed the grammar and simple token parser (moved to the Twig Extensions repository)
-
-Changes:
-
- * added "needs_context" option for filters and functions (the context is then passed as a first argument)
- * added global variables support
- * made macros return their value instead of echoing directly (fixes calling a macro in sandbox mode)
- * added the "from" tag to import macros as functions
- * added support for functions (a function is just syntactic sugar for a getAttribute() call)
- * made macros callable when sandbox mode is enabled
- * added an exception when a macro uses a reserved name
- * the "default" filter now uses the "empty" test instead of just checking for null
- * added the "empty" test
-
-* 0.9.10 (2010-12-16)
-
-Backward incompatibilities:
-
- * The Escaper extension is enabled by default, which means that all displayed
-   variables are now automatically escaped. You can revert to the previous
-   behavior by removing the extension via $env->removeExtension('escaper')
-   or just set the 'autoescape' option to 'false'.
- * removed the "without loop" attribute for the "for" tag (not needed anymore
-   as the Optimizer take care of that for most cases)
- * arrays and hashes have now a different syntax
-     * arrays keep the same syntax with square brackets: [1, 2]
-     * hashes now use curly braces (["a": "b"] should now be written as {"a": "b"})
-     * support for "arrays with keys" and "hashes without keys" is not supported anymore ([1, "foo": "bar"] or {"foo": "bar", 1})
- * the i18n extension is now part of the Twig Extensions repository
-
-Changes:
-
- * added the merge filter
- * removed 'is_escaper' option for filters (a left over from the previous version) -- you must use 'is_safe' now instead
- * fixed usage of operators as method names (like is, in, and not)
- * changed the order of execution for node visitors
- * fixed default() filter behavior when used with strict_variables set to on
- * fixed filesystem loader compatibility with PHAR files
- * enhanced error messages when an unexpected token is parsed in an expression
- * fixed filename not being added to syntax error messages
- * added the autoescape option to enable/disable autoescaping
- * removed the newline after a comment (mimicks PHP behavior)
- * added a syntax error exception when parent block is used on a template that does not extend another one
- * made the Escaper extension enabled by default
- * fixed sandbox extension when used with auto output escaping
- * fixed escaper when wrapping a Twig_Node_Print (the original class must be preserved)
- * added an Optimizer extension (enabled by default; optimizes "for" loops and "raw" filters)
- * added priority to node visitors
-
-* 0.9.9 (2010-11-28)
-
-Backward incompatibilities:
- * the self special variable has been renamed to _self
- * the odd and even filters are now tests:
-     {{ foo|odd }} must now be written {{ foo is odd }}
- * the "safe" filter has been renamed to "raw"
- * in Node classes,
-        sub-nodes are now accessed via getNode() (instead of property access)
-        attributes via getAttribute() (instead of array access)
- * the urlencode filter had been renamed to url_encode
- * the include tag now merges the passed variables with the current context by default
-   (the old behavior is still possible by adding the "only" keyword)
- * moved Exceptions to Twig_Error_* (Twig_SyntaxError/Twig_RuntimeError are now Twig_Error_Syntax/Twig_Error_Runtime)
- * removed support for {{ 1 < i < 3 }} (use {{ i > 1 and i < 3 }} instead)
- * the "in" filter has been removed ({{ a|in(b) }} should now be written {{ a in b }})
-
-Changes:
- * added file and line to Twig_Error_Runtime exceptions thrown from Twig_Template
- * changed trans tag to accept any variable for the plural count
- * fixed sandbox mode (__toString() method check was not enforced if called implicitly from complex statements)
- * added the ** (power) operator
- * changed the algorithm used for parsing expressions
- * added the spaceless tag
- * removed trim_blocks option
- * added support for is*() methods for attributes (foo.bar now looks for foo->getBar() or foo->isBar())
- * changed all exceptions to extend Twig_Error
- * fixed unary expressions ({{ not(1 or 0) }})
- * fixed child templates (with an extend tag) that uses one or more imports
- * added support for {{ 1 not in [2, 3] }} (more readable than the current {{ not (1 in [2, 3]) }})
- * escaping has been rewritten
- * the implementation of template inheritance has been rewritten
-   (blocks can now be called individually and still work with inheritance)
- * fixed error handling for if tag when a syntax error occurs within a subparse process
- * added a way to implement custom logic for resolving token parsers given a tag name
- * fixed js escaper to be stricter (now uses a whilelist-based js escaper)
- * added the following filers: "constant", "trans", "replace", "json_encode"
- * added a "constant" test
- * fixed objects with __toString() not being autoescaped
- * fixed subscript expressions when calling __call() (methods now keep the case)
- * added "test" feature (accessible via the "is" operator)
- * removed the debug tag (should be done in an extension)
- * fixed trans tag when no vars are used in plural form
- * fixed race condition when writing template cache
- * added the special _charset variable to reference the current charset
- * added the special _context variable to reference the current context
- * renamed self to _self (to avoid conflict)
- * fixed Twig_Template::getAttribute() for protected properties
-
-* 0.9.8 (2010-06-28)
-
-Backward incompatibilities:
- * the trans tag plural count is now attached to the plural tag:
-    old: `{% trans count %}...{% plural %}...{% endtrans %}`
-    new: `{% trans %}...{% plural count %}...{% endtrans %}`
-
- * added a way to translate strings coming from a variable ({% trans var %})
- * fixed trans tag when used with the Escaper extension
- * fixed default cache umask
- * removed Twig_Template instances from the debug tag output
- * fixed objects with __isset() defined
- * fixed set tag when used with a capture
- * fixed type hinting for Twig_Environment::addFilter() method
-
-* 0.9.7 (2010-06-12)
-
-Backward incompatibilities:
- * changed 'as' to '=' for the set tag ({% set title as "Title" %} must now be {% set title = "Title" %})
- * removed the sandboxed attribute of the include tag (use the new sandbox tag instead)
- * refactored the Node system (if you have custom nodes, you will have to update them to use the new API)
-
- * added self as a special variable that refers to the current template (useful for importing macros from the current template)
- * added Twig_Template instance support to the include tag
- * added support for dynamic and conditional inheritance ({% extends some_var %} and {% extends standalone ? "minimum" : "base" %})
- * added a grammar sub-framework to ease the creation of custom tags
- * fixed the for tag for large arrays (some loop variables are now only available for arrays and objects that implement the Countable interface)
- * removed the Twig_Resource::resolveMissingFilter() method
- * fixed the filter tag which did not apply filtering to included files
- * added a bunch of unit tests
- * added a bunch of phpdoc
- * added a sandbox tag in the sandbox extension
- * changed the date filter to support any date format supported by DateTime
- * added strict_variable setting to throw an exception when an invalid variable is used in a template (disabled by default)
- * added the lexer, parser, and compiler as arguments to the Twig_Environment constructor
- * changed the cache option to only accepts an explicit path to a cache directory or false
- * added a way to add token parsers, filters, and visitors without creating an extension
- * added three interfaces: Twig_NodeInterface, Twig_TokenParserInterface, and Twig_FilterInterface
- * changed the generated code to match the new coding standards
- * fixed sandbox mode (__toString() method check was not enforced if called implicitly from a simple statement like {{ article }})
- * added an exception when a child template has a non-empty body (as it is always ignored when rendering)
-
-* 0.9.6 (2010-05-12)
-
- * fixed variables defined outside a loop and for which the value changes in a for loop
- * fixed the test suite for PHP 5.2 and older versions of PHPUnit
- * added support for __call() in expression resolution
- * fixed node visiting for macros (macros are now visited by visitors as any other node)
- * fixed nested block definitions with a parent call (rarely useful but nonetheless supported now)
- * added the cycle filter
- * fixed the Lexer when mbstring.func_overload is used with an mbstring.internal_encoding different from ASCII
- * added a long-syntax for the set tag ({% set foo %}...{% endset %})
- * unit tests are now powered by PHPUnit
- * added support for gettext via the `i18n` extension
- * fixed twig_capitalize_string_filter() and fixed twig_length_filter() when used with UTF-8 values
- * added a more useful exception if an if tag is not closed properly
- * added support for escaping strategy in the autoescape tag
- * fixed lexer when a template has a big chunk of text between/in a block
-
-* 0.9.5 (2010-01-20)
-
-As for any new release, don't forget to remove all cached templates after
-upgrading.
-
-If you have defined custom filters, you MUST upgrade them for this release. To
-upgrade, replace "array" with "new Twig_Filter_Function", and replace the
-environment constant by the "needs_environment" option:
-
-  // before
-  'even'   => array('twig_is_even_filter', false),
-  'escape' => array('twig_escape_filter', true),
-
-  // after
-  'even'   => new Twig_Filter_Function('twig_is_even_filter'),
-  'escape' => new Twig_Filter_Function('twig_escape_filter', array('needs_environment' => true)),
-
-If you have created NodeTransformer classes, you will need to upgrade them to
-the new interface (please note that the interface is not yet considered
-stable).
-
- * fixed list nodes that did not extend the Twig_NodeListInterface
- * added the "without loop" option to the for tag (it disables the generation of the loop variable)
- * refactored node transformers to node visitors
- * fixed automatic-escaping for blocks
- * added a way to specify variables to pass to an included template
- * changed the automatic-escaping rules to be more sensible and more configurable in custom filters (the documentation lists all the rules)
- * improved the filter system to allow object methods to be used as filters
- * changed the Array and String loaders to actually make use of the cache mechanism
- * included the default filter function definitions in the extension class files directly (Core, Escaper)
- * added the // operator (like the floor() PHP function)
- * added the .. operator (as a syntactic sugar for the range filter when the step is 1)
- * added the in operator (as a syntactic sugar for the in filter)
- * added the following filters in the Core extension: in, range
- * added support for arrays (same behavior as in PHP, a mix between lists and dictionaries, arrays and hashes)
- * enhanced some error messages to provide better feedback in case of parsing errors
-
-* 0.9.4 (2009-12-02)
-
-If you have custom loaders, you MUST upgrade them for this release: The
-Twig_Loader base class has been removed, and the Twig_LoaderInterface has also
-been changed (see the source code for more information or the documentation).
-
- * added support for DateTime instances for the date filter
- * fixed loop.last when the array only has one item
- * made it possible to insert newlines in tag and variable blocks
- * fixed a bug when a literal '\n' were present in a template text
- * fixed bug when the filename of a template contains */
- * refactored loaders
-
-* 0.9.3 (2009-11-11)
-
-This release is NOT backward compatible with the previous releases.
-
-  The loaders do not take the cache and autoReload arguments anymore. Instead,
-  the Twig_Environment class has two new options: cache and auto_reload.
-  Upgrading your code means changing this kind of code:
-
-      $loader = new Twig_Loader_Filesystem('/path/to/templates', '/path/to/compilation_cache', true);
-      $twig = new Twig_Environment($loader);
-
-  to something like this:
-
-      $loader = new Twig_Loader_Filesystem('/path/to/templates');
-      $twig = new Twig_Environment($loader, array(
-        'cache' => '/path/to/compilation_cache',
-        'auto_reload' => true,
-      ));
-
- * deprecated the "items" filter as it is not needed anymore
- * made cache and auto_reload options of Twig_Environment instead of arguments of Twig_Loader
- * optimized template loading speed
- * removed output when an error occurs in a template and render() is used
- * made major speed improvements for loops (up to 300% on even the smallest loops)
- * added properties as part of the sandbox mode
- * added public properties support (obj.item can now be the item property on the obj object)
- * extended set tag to support expression as value ({% set foo as 'foo' ~ 'bar' %} )
- * fixed bug when \ was used in HTML
-
-* 0.9.2 (2009-10-29)
-
- * made some speed optimizations
- * changed the cache extension to .php
- * added a js escaping strategy
- * added support for short block tag
- * changed the filter tag to allow chained filters
- * made lexer more flexible as you can now change the default delimiters
- * added set tag
- * changed default directory permission when cache dir does not exist (more secure)
- * added macro support
- * changed filters first optional argument to be a Twig_Environment instance instead of a Twig_Template instance
- * made Twig_Autoloader::autoload() a static method
- * avoid writing template file if an error occurs
- * added $ escaping when outputting raw strings
- * enhanced some error messages to ease debugging
- * fixed empty cache files when the template contains an error
-
-* 0.9.1 (2009-10-14)
-
-  * fixed a bug in PHP 5.2.6
-  * fixed numbers with one than one decimal
-  * added support for method calls with arguments ({{ foo.bar('a', 43) }})
-  * made small speed optimizations
-  * made minor tweaks to allow better extensibility and flexibility
-
-* 0.9.0 (2009-10-12)
-
- * Initial release
Index: nc/libs/twig/Compiler.php
===================================================================
--- inc/libs/twig/Compiler.php	(revision 991)
+++ 	(revision )
@@ -1,268 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Compiles a node to PHP code.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Compiler implements Twig_CompilerInterface
-{
-    protected $lastLine;
-    protected $source;
-    protected $indentation;
-    protected $env;
-    protected $debugInfo;
-    protected $sourceOffset;
-    protected $sourceLine;
-    protected $filename;
-
-    /**
-     * Constructor.
-     *
-     * @param Twig_Environment $env The twig environment instance
-     */
-    public function __construct(Twig_Environment $env)
-    {
-        $this->env = $env;
-        $this->debugInfo = array();
-    }
-
-    public function getFilename()
-    {
-        return $this->filename;
-    }
-
-    /**
-     * Returns the environment instance related to this compiler.
-     *
-     * @return Twig_Environment The environment instance
-     */
-    public function getEnvironment()
-    {
-        return $this->env;
-    }
-
-    /**
-     * Gets the current PHP code after compilation.
-     *
-     * @return string The PHP code
-     */
-    public function getSource()
-    {
-        return $this->source;
-    }
-
-    /**
-     * Compiles a node.
-     *
-     * @param Twig_NodeInterface $node        The node to compile
-     * @param integer            $indentation The current indentation
-     *
-     * @return Twig_Compiler The current compiler instance
-     */
-    public function compile(Twig_NodeInterface $node, $indentation = 0)
-    {
-        $this->lastLine = null;
-        $this->source = '';
-        $this->sourceOffset = 0;
-        // source code starts at 1 (as we then increment it when we encounter new lines)
-        $this->sourceLine = 1;
-        $this->indentation = $indentation;
-
-        if ($node instanceof Twig_Node_Module) {
-            $this->filename = $node->getAttribute('filename');
-        }
-
-        $node->compile($this);
-
-        return $this;
-    }
-
-    public function subcompile(Twig_NodeInterface $node, $raw = true)
-    {
-        if (false === $raw) {
-            $this->addIndentation();
-        }
-
-        $node->compile($this);
-
-        return $this;
-    }
-
-    /**
-     * Adds a raw string to the compiled code.
-     *
-     * @param string $string The string
-     *
-     * @return Twig_Compiler The current compiler instance
-     */
-    public function raw($string)
-    {
-        $this->source .= $string;
-
-        return $this;
-    }
-
-    /**
-     * Writes a string to the compiled code by adding indentation.
-     *
-     * @return Twig_Compiler The current compiler instance
-     */
-    public function write()
-    {
-        $strings = func_get_args();
-        foreach ($strings as $string) {
-            $this->addIndentation();
-            $this->source .= $string;
-        }
-
-        return $this;
-    }
-
-    /**
-     * Appends an indentation to the current PHP code after compilation.
-     *
-     * @return Twig_Compiler The current compiler instance
-     */
-    public function addIndentation()
-    {
-        $this->source .= str_repeat(' ', $this->indentation * 4);
-
-        return $this;
-    }
-
-    /**
-     * Adds a quoted string to the compiled code.
-     *
-     * @param string $value The string
-     *
-     * @return Twig_Compiler The current compiler instance
-     */
-    public function string($value)
-    {
-        $this->source .= sprintf('"%s"', addcslashes($value, "\0\t\"\$\\"));
-
-        return $this;
-    }
-
-    /**
-     * Returns a PHP representation of a given value.
-     *
-     * @param mixed $value The value to convert
-     *
-     * @return Twig_Compiler The current compiler instance
-     */
-    public function repr($value)
-    {
-        if (is_int($value) || is_float($value)) {
-            if (false !== $locale = setlocale(LC_NUMERIC, 0)) {
-                setlocale(LC_NUMERIC, 'C');
-            }
-
-            $this->raw($value);
-
-            if (false !== $locale) {
-                setlocale(LC_NUMERIC, $locale);
-            }
-        } elseif (null === $value) {
-            $this->raw('null');
-        } elseif (is_bool($value)) {
-            $this->raw($value ? 'true' : 'false');
-        } elseif (is_array($value)) {
-            $this->raw('array(');
-            $i = 0;
-            foreach ($value as $key => $value) {
-                if ($i++) {
-                    $this->raw(', ');
-                }
-                $this->repr($key);
-                $this->raw(' => ');
-                $this->repr($value);
-            }
-            $this->raw(')');
-        } else {
-            $this->string($value);
-        }
-
-        return $this;
-    }
-
-    /**
-     * Adds debugging information.
-     *
-     * @param Twig_NodeInterface $node The related twig node
-     *
-     * @return Twig_Compiler The current compiler instance
-     */
-    public function addDebugInfo(Twig_NodeInterface $node)
-    {
-        if ($node->getLine() != $this->lastLine) {
-            $this->write("// line {$node->getLine()}\n");
-
-            // when mbstring.func_overload is set to 2
-            // mb_substr_count() replaces substr_count()
-            // but they have different signatures!
-            if (((int) ini_get('mbstring.func_overload')) & 2) {
-                // this is much slower than the "right" version
-                $this->sourceLine += mb_substr_count(mb_substr($this->source, $this->sourceOffset), "\n");
-            } else {
-                $this->sourceLine += substr_count($this->source, "\n", $this->sourceOffset);
-            }
-            $this->sourceOffset = strlen($this->source);
-            $this->debugInfo[$this->sourceLine] = $node->getLine();
-
-            $this->lastLine = $node->getLine();
-        }
-
-        return $this;
-    }
-
-    public function getDebugInfo()
-    {
-        return $this->debugInfo;
-    }
-
-    /**
-     * Indents the generated code.
-     *
-     * @param integer $step The number of indentation to add
-     *
-     * @return Twig_Compiler The current compiler instance
-     */
-    public function indent($step = 1)
-    {
-        $this->indentation += $step;
-
-        return $this;
-    }
-
-    /**
-     * Outdents the generated code.
-     *
-     * @param integer $step The number of indentation to remove
-     *
-     * @return Twig_Compiler The current compiler instance
-     */
-    public function outdent($step = 1)
-    {
-        // can't outdent by more steps that the current indentation level
-        if ($this->indentation < $step) {
-            throw new LogicException('Unable to call outdent() as the indentation would become negative');
-        }
-
-        $this->indentation -= $step;
-
-        return $this;
-    }
-}
Index: nc/libs/twig/CompilerInterface.php
===================================================================
--- inc/libs/twig/CompilerInterface.php	(revision 991)
+++ 	(revision )
@@ -1,35 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Interface implemented by compiler classes.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-interface Twig_CompilerInterface
-{
-    /**
-     * Compiles a node.
-     *
-     * @param Twig_NodeInterface $node The node to compile
-     *
-     * @return Twig_CompilerInterface The current compiler instance
-     */
-    public function compile(Twig_NodeInterface $node);
-
-    /**
-     * Gets the current PHP code after compilation.
-     *
-     * @return string The PHP code
-     */
-    public function getSource();
-}
Index: nc/libs/twig/Environment.php
===================================================================
--- inc/libs/twig/Environment.php	(revision 991)
+++ 	(revision )
@@ -1,1105 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Stores the Twig configuration.
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Environment
-{
-    const VERSION = '1.11.1';
-
-    protected $charset;
-    protected $loader;
-    protected $debug;
-    protected $autoReload;
-    protected $cache;
-    protected $lexer;
-    protected $parser;
-    protected $compiler;
-    protected $baseTemplateClass;
-    protected $extensions;
-    protected $parsers;
-    protected $visitors;
-    protected $filters;
-    protected $tests;
-    protected $functions;
-    protected $globals;
-    protected $runtimeInitialized;
-    protected $loadedTemplates;
-    protected $strictVariables;
-    protected $unaryOperators;
-    protected $binaryOperators;
-    protected $templateClassPrefix = '__TwigTemplate_';
-    protected $functionCallbacks;
-    protected $filterCallbacks;
-    protected $staging;
-
-    /**
-     * Constructor.
-     *
-     * Available options:
-     *
-     *  * debug: When set to true, it automatically set "auto_reload" to true as
-     *           well (default to false).
-     *
-     *  * charset: The charset used by the templates (default to utf-8).
-     *
-     *  * base_template_class: The base template class to use for generated
-     *                         templates (default to Twig_Template).
-     *
-     *  * cache: An absolute path where to store the compiled templates, or
-     *           false to disable compilation cache (default).
-     *
-     *  * auto_reload: Whether to reload the template is the original source changed.
-     *                 If you don't provide the auto_reload option, it will be
-     *                 determined automatically base on the debug value.
-     *
-     *  * strict_variables: Whether to ignore invalid variables in templates
-     *                      (default to false).
-     *
-     *  * autoescape: Whether to enable auto-escaping (default to html):
-     *                  * false: disable auto-escaping
-     *                  * true: equivalent to html
-     *                  * html, js: set the autoescaping to one of the supported strategies
-     *                  * PHP callback: a PHP callback that returns an escaping strategy based on the template "filename"
-     *
-     *  * optimizations: A flag that indicates which optimizations to apply
-     *                   (default to -1 which means that all optimizations are enabled;
-     *                   set it to 0 to disable).
-     *
-     * @param Twig_LoaderInterface $loader  A Twig_LoaderInterface instance
-     * @param array                $options An array of options
-     */
-    public function __construct(Twig_LoaderInterface $loader = null, $options = array())
-    {
-        if (null !== $loader) {
-            $this->setLoader($loader);
-        }
-
-        $options = array_merge(array(
-            'debug'               => false,
-            'charset'             => 'UTF-8',
-            'base_template_class' => 'Twig_Template',
-            'strict_variables'    => false,
-            'autoescape'          => 'html',
-            'cache'               => false,
-            'auto_reload'         => null,
-            'optimizations'       => -1,
-        ), $options);
-
-        $this->debug              = (bool) $options['debug'];
-        $this->charset            = $options['charset'];
-        $this->baseTemplateClass  = $options['base_template_class'];
-        $this->autoReload         = null === $options['auto_reload'] ? $this->debug : (bool) $options['auto_reload'];
-        $this->extensions         = array(
-            'core'      => new Twig_Extension_Core(),
-            'escaper'   => new Twig_Extension_Escaper($options['autoescape']),
-            'optimizer' => new Twig_Extension_Optimizer($options['optimizations']),
-        );
-        $this->strictVariables    = (bool) $options['strict_variables'];
-        $this->runtimeInitialized = false;
-        $this->setCache($options['cache']);
-        $this->functionCallbacks = array();
-        $this->filterCallbacks = array();
-        $this->staging = array(
-            'functions'     => array(),
-            'filters'       => array(),
-            'tests'         => array(),
-            'token_parsers' => array(),
-            'visitors'      => array(),
-            'globals'       => array(),
-        );
-    }
-
-    /**
-     * Gets the base template class for compiled templates.
-     *
-     * @return string The base template class name
-     */
-    public function getBaseTemplateClass()
-    {
-        return $this->baseTemplateClass;
-    }
-
-    /**
-     * Sets the base template class for compiled templates.
-     *
-     * @param string $class The base template class name
-     */
-    public function setBaseTemplateClass($class)
-    {
-        $this->baseTemplateClass = $class;
-    }
-
-    /**
-     * Enables debugging mode.
-     */
-    public function enableDebug()
-    {
-        $this->debug = true;
-    }
-
-    /**
-     * Disables debugging mode.
-     */
-    public function disableDebug()
-    {
-        $this->debug = false;
-    }
-
-    /**
-     * Checks if debug mode is enabled.
-     *
-     * @return Boolean true if debug mode is enabled, false otherwise
-     */
-    public function isDebug()
-    {
-        return $this->debug;
-    }
-
-    /**
-     * Enables the auto_reload option.
-     */
-    public function enableAutoReload()
-    {
-        $this->autoReload = true;
-    }
-
-    /**
-     * Disables the auto_reload option.
-     */
-    public function disableAutoReload()
-    {
-        $this->autoReload = false;
-    }
-
-    /**
-     * Checks if the auto_reload option is enabled.
-     *
-     * @return Boolean true if auto_reload is enabled, false otherwise
-     */
-    public function isAutoReload()
-    {
-        return $this->autoReload;
-    }
-
-    /**
-     * Enables the strict_variables option.
-     */
-    public function enableStrictVariables()
-    {
-        $this->strictVariables = true;
-    }
-
-    /**
-     * Disables the strict_variables option.
-     */
-    public function disableStrictVariables()
-    {
-        $this->strictVariables = false;
-    }
-
-    /**
-     * Checks if the strict_variables option is enabled.
-     *
-     * @return Boolean true if strict_variables is enabled, false otherwise
-     */
-    public function isStrictVariables()
-    {
-        return $this->strictVariables;
-    }
-
-    /**
-     * Gets the cache directory or false if cache is disabled.
-     *
-     * @return string|false
-     */
-    public function getCache()
-    {
-        return $this->cache;
-    }
-
-     /**
-      * Sets the cache directory or false if cache is disabled.
-      *
-      * @param string|false $cache The absolute path to the compiled templates,
-      *                            or false to disable cache
-      */
-    public function setCache($cache)
-    {
-        $this->cache = $cache ? $cache : false;
-    }
-
-    /**
-     * Gets the cache filename for a given template.
-     *
-     * @param string $name The template name
-     *
-     * @return string The cache file name
-     */
-    public function getCacheFilename($name)
-    {
-        if (false === $this->cache) {
-            return false;
-        }
-
-        $class = substr($this->getTemplateClass($name), strlen($this->templateClassPrefix));
-
-        return $this->getCache().'/'.substr($class, 0, 2).'/'.substr($class, 2, 2).'/'.substr($class, 4).'.php';
-    }
-
-    /**
-     * Gets the template class associated with the given string.
-     *
-     * @param string  $name  The name for which to calculate the template class name
-     * @param integer $index The index if it is an embedded template
-     *
-     * @return string The template class name
-     */
-    public function getTemplateClass($name, $index = null)
-    {
-        return $this->templateClassPrefix.md5($this->loader->getCacheKey($name)).(null === $index ? '' : '_'.$index);
-    }
-
-    /**
-     * Gets the template class prefix.
-     *
-     * @return string The template class prefix
-     */
-    public function getTemplateClassPrefix()
-    {
-        return $this->templateClassPrefix;
-    }
-
-    /**
-     * Renders a template.
-     *
-     * @param string $name    The template name
-     * @param array  $context An array of parameters to pass to the template
-     *
-     * @return string The rendered template
-     */
-    public function render($name, array $context = array())
-    {
-        return $this->loadTemplate($name)->render($context);
-    }
-
-    /**
-     * Displays a template.
-     *
-     * @param string $name    The template name
-     * @param array  $context An array of parameters to pass to the template
-     */
-    public function display($name, array $context = array())
-    {
-        $this->loadTemplate($name)->display($context);
-    }
-
-    /**
-     * Loads a template by name.
-     *
-     * @param string  $name  The template name
-     * @param integer $index The index if it is an embedded template
-     *
-     * @return Twig_TemplateInterface A template instance representing the given template name
-     */
-    public function loadTemplate($name, $index = null)
-    {
-        $cls = $this->getTemplateClass($name, $index);
-
-        if (isset($this->loadedTemplates[$cls])) {
-            return $this->loadedTemplates[$cls];
-        }
-
-        if (!class_exists($cls, false)) {
-            if (false === $cache = $this->getCacheFilename($name)) {
-                eval('?>'.$this->compileSource($this->loader->getSource($name), $name));
-            } else {
-                if (!is_file($cache) || ($this->isAutoReload() && !$this->isTemplateFresh($name, filemtime($cache)))) {
-                    $this->writeCacheFile($cache, $this->compileSource($this->loader->getSource($name), $name));
-                }
-
-                require_once $cache;
-            }
-        }
-
-        if (!$this->runtimeInitialized) {
-            $this->initRuntime();
-        }
-
-        return $this->loadedTemplates[$cls] = new $cls($this);
-    }
-
-    /**
-     * Returns true if the template is still fresh.
-     *
-     * Besides checking the loader for freshness information,
-     * this method also checks if the enabled extensions have
-     * not changed.
-     *
-     * @param string    $name The template name
-     * @param timestamp $time The last modification time of the cached template
-     *
-     * @return Boolean true if the template is fresh, false otherwise
-     */
-    public function isTemplateFresh($name, $time)
-    {
-        foreach ($this->extensions as $extension) {
-            $r = new ReflectionObject($extension);
-            if (filemtime($r->getFileName()) > $time) {
-                return false;
-            }
-        }
-
-        return $this->loader->isFresh($name, $time);
-    }
-
-    public function resolveTemplate($names)
-    {
-        if (!is_array($names)) {
-            $names = array($names);
-        }
-
-        foreach ($names as $name) {
-            if ($name instanceof Twig_Template) {
-                return $name;
-            }
-
-            try {
-                return $this->loadTemplate($name);
-            } catch (Twig_Error_Loader $e) {
-            }
-        }
-
-        if (1 === count($names)) {
-            throw $e;
-        }
-
-        throw new Twig_Error_Loader(sprintf('Unable to find one of the following templates: "%s".', implode('", "', $names)));
-    }
-
-    /**
-     * Clears the internal template cache.
-     */
-    public function clearTemplateCache()
-    {
-        $this->loadedTemplates = array();
-    }
-
-    /**
-     * Clears the template cache files on the filesystem.
-     */
-    public function clearCacheFiles()
-    {
-        if (false === $this->cache) {
-            return;
-        }
-
-        foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->cache), RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
-            if ($file->isFile()) {
-                @unlink($file->getPathname());
-            }
-        }
-    }
-
-    /**
-     * Gets the Lexer instance.
-     *
-     * @return Twig_LexerInterface A Twig_LexerInterface instance
-     */
-    public function getLexer()
-    {
-        if (null === $this->lexer) {
-            $this->lexer = new Twig_Lexer($this);
-        }
-
-        return $this->lexer;
-    }
-
-    /**
-     * Sets the Lexer instance.
-     *
-     * @param Twig_LexerInterface A Twig_LexerInterface instance
-     */
-    public function setLexer(Twig_LexerInterface $lexer)
-    {
-        $this->lexer = $lexer;
-    }
-
-    /**
-     * Tokenizes a source code.
-     *
-     * @param string $source The template source code
-     * @param string $name   The template name
-     *
-     * @return Twig_TokenStream A Twig_TokenStream instance
-     */
-    public function tokenize($source, $name = null)
-    {
-        return $this->getLexer()->tokenize($source, $name);
-    }
-
-    /**
-     * Gets the Parser instance.
-     *
-     * @return Twig_ParserInterface A Twig_ParserInterface instance
-     */
-    public function getParser()
-    {
-        if (null === $this->parser) {
-            $this->parser = new Twig_Parser($this);
-        }
-
-        return $this->parser;
-    }
-
-    /**
-     * Sets the Parser instance.
-     *
-     * @param Twig_ParserInterface A Twig_ParserInterface instance
-     */
-    public function setParser(Twig_ParserInterface $parser)
-    {
-        $this->parser = $parser;
-    }
-
-    /**
-     * Parses a token stream.
-     *
-     * @param Twig_TokenStream $tokens A Twig_TokenStream instance
-     *
-     * @return Twig_Node_Module A Node tree
-     */
-    public function parse(Twig_TokenStream $tokens)
-    {
-        return $this->getParser()->parse($tokens);
-    }
-
-    /**
-     * Gets the Compiler instance.
-     *
-     * @return Twig_CompilerInterface A Twig_CompilerInterface instance
-     */
-    public function getCompiler()
-    {
-        if (null === $this->compiler) {
-            $this->compiler = new Twig_Compiler($this);
-        }
-
-        return $this->compiler;
-    }
-
-    /**
-     * Sets the Compiler instance.
-     *
-     * @param Twig_CompilerInterface $compiler A Twig_CompilerInterface instance
-     */
-    public function setCompiler(Twig_CompilerInterface $compiler)
-    {
-        $this->compiler = $compiler;
-    }
-
-    /**
-     * Compiles a Node.
-     *
-     * @param Twig_NodeInterface $node A Twig_NodeInterface instance
-     *
-     * @return string The compiled PHP source code
-     */
-    public function compile(Twig_NodeInterface $node)
-    {
-        return $this->getCompiler()->compile($node)->getSource();
-    }
-
-    /**
-     * Compiles a template source code.
-     *
-     * @param string $source The template source code
-     * @param string $name   The template name
-     *
-     * @return string The compiled PHP source code
-     */
-    public function compileSource($source, $name = null)
-    {
-        try {
-            return $this->compile($this->parse($this->tokenize($source, $name)));
-        } catch (Twig_Error $e) {
-            $e->setTemplateFile($name);
-            throw $e;
-        } catch (Exception $e) {
-            throw new Twig_Error_Runtime(sprintf('An exception has been thrown during the compilation of a template ("%s").', $e->getMessage()), -1, $name, $e);
-        }
-    }
-
-    /**
-     * Sets the Loader instance.
-     *
-     * @param Twig_LoaderInterface $loader A Twig_LoaderInterface instance
-     */
-    public function setLoader(Twig_LoaderInterface $loader)
-    {
-        $this->loader = $loader;
-    }
-
-    /**
-     * Gets the Loader instance.
-     *
-     * @return Twig_LoaderInterface A Twig_LoaderInterface instance
-     */
-    public function getLoader()
-    {
-        return $this->loader;
-    }
-
-    /**
-     * Sets the default template charset.
-     *
-     * @param string $charset The default charset
-     */
-    public function setCharset($charset)
-    {
-        $this->charset = $charset;
-    }
-
-    /**
-     * Gets the default template charset.
-     *
-     * @return string The default charset
-     */
-    public function getCharset()
-    {
-        return $this->charset;
-    }
-
-    /**
-     * Initializes the runtime environment.
-     */
-    public function initRuntime()
-    {
-        $this->runtimeInitialized = true;
-
-        foreach ($this->getExtensions() as $extension) {
-            $extension->initRuntime($this);
-        }
-    }
-
-    /**
-     * Returns true if the given extension is registered.
-     *
-     * @param string $name The extension name
-     *
-     * @return Boolean Whether the extension is registered or not
-     */
-    public function hasExtension($name)
-    {
-        return isset($this->extensions[$name]);
-    }
-
-    /**
-     * Gets an extension by name.
-     *
-     * @param string $name The extension name
-     *
-     * @return Twig_ExtensionInterface A Twig_ExtensionInterface instance
-     */
-    public function getExtension($name)
-    {
-        if (!isset($this->extensions[$name])) {
-            throw new Twig_Error_Runtime(sprintf('The "%s" extension is not enabled.', $name));
-        }
-
-        return $this->extensions[$name];
-    }
-
-    /**
-     * Registers an extension.
-     *
-     * @param Twig_ExtensionInterface $extension A Twig_ExtensionInterface instance
-     */
-    public function addExtension(Twig_ExtensionInterface $extension)
-    {
-        $this->extensions[$extension->getName()] = $extension;
-        $this->parsers = null;
-        $this->visitors = null;
-        $this->filters = null;
-        $this->tests = null;
-        $this->functions = null;
-        $this->globals = null;
-    }
-
-    /**
-     * Removes an extension by name.
-     *
-     * @param string $name The extension name
-     */
-    public function removeExtension($name)
-    {
-        unset($this->extensions[$name]);
-        $this->parsers = null;
-        $this->visitors = null;
-        $this->filters = null;
-        $this->tests = null;
-        $this->functions = null;
-        $this->globals = null;
-    }
-
-    /**
-     * Registers an array of extensions.
-     *
-     * @param array $extensions An array of extensions
-     */
-    public function setExtensions(array $extensions)
-    {
-        foreach ($extensions as $extension) {
-            $this->addExtension($extension);
-        }
-    }
-
-    /**
-     * Returns all registered extensions.
-     *
-     * @return array An array of extensions
-     */
-    public function getExtensions()
-    {
-        return $this->extensions;
-    }
-
-    /**
-     * Registers a Token Parser.
-     *
-     * @param Twig_TokenParserInterface $parser A Twig_TokenParserInterface instance
-     */
-    public function addTokenParser(Twig_TokenParserInterface $parser)
-    {
-        $this->staging['token_parsers'][] = $parser;
-        $this->parsers = null;
-    }
-
-    /**
-     * Gets the registered Token Parsers.
-     *
-     * @return Twig_TokenParserBrokerInterface A broker containing token parsers
-     */
-    public function getTokenParsers()
-    {
-        if (null === $this->parsers) {
-            $this->parsers = new Twig_TokenParserBroker();
-
-            if (isset($this->staging['token_parsers'])) {
-                foreach ($this->staging['token_parsers'] as $parser) {
-                    $this->parsers->addTokenParser($parser);
-                }
-            }
-
-            foreach ($this->getExtensions() as $extension) {
-                $parsers = $extension->getTokenParsers();
-                foreach ($parsers as $parser) {
-                    if ($parser instanceof Twig_TokenParserInterface) {
-                        $this->parsers->addTokenParser($parser);
-                    } elseif ($parser instanceof Twig_TokenParserBrokerInterface) {
-                        $this->parsers->addTokenParserBroker($parser);
-                    } else {
-                        throw new LogicException('getTokenParsers() must return an array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances');
-                    }
-                }
-            }
-        }
-
-        return $this->parsers;
-    }
-
-    /**
-     * Gets registered tags.
-     *
-     * Be warned that this method cannot return tags defined by Twig_TokenParserBrokerInterface classes.
-     *
-     * @return Twig_TokenParserInterface[] An array of Twig_TokenParserInterface instances
-     */
-    public function getTags()
-    {
-        $tags = array();
-        foreach ($this->getTokenParsers()->getParsers() as $parser) {
-            if ($parser instanceof Twig_TokenParserInterface) {
-                $tags[$parser->getTag()] = $parser;
-            }
-        }
-
-        return $tags;
-    }
-
-    /**
-     * Registers a Node Visitor.
-     *
-     * @param Twig_NodeVisitorInterface $visitor A Twig_NodeVisitorInterface instance
-     */
-    public function addNodeVisitor(Twig_NodeVisitorInterface $visitor)
-    {
-        $this->staging['visitors'][] = $visitor;
-        $this->visitors = null;
-    }
-
-    /**
-     * Gets the registered Node Visitors.
-     *
-     * @return Twig_NodeVisitorInterface[] An array of Twig_NodeVisitorInterface instances
-     */
-    public function getNodeVisitors()
-    {
-        if (null === $this->visitors) {
-            foreach ($this->getExtensions() as $extension) {
-                foreach ($extension->getNodeVisitors() as $visitor) {
-                    $this->addNodeVisitor($visitor);
-                }
-            }
-
-            $this->visitors = $this->staging['visitors'];
-        }
-
-        return $this->visitors;
-    }
-
-    /**
-     * Registers a Filter.
-     *
-     * @param string               $name   The filter name
-     * @param Twig_FilterInterface $filter A Twig_FilterInterface instance
-     */
-    public function addFilter($name, Twig_FilterInterface $filter)
-    {
-        $this->staging['filters'][$name] = $filter;
-        $this->filters = null;
-    }
-
-    /**
-     * Get a filter by name.
-     *
-     * Subclasses may override this method and load filters differently;
-     * so no list of filters is available.
-     *
-     * @param string $name The filter name
-     *
-     * @return Twig_Filter|false A Twig_Filter instance or false if the filter does not exists
-     */
-    public function getFilter($name)
-    {
-        if (null === $this->filters) {
-            $this->getFilters();
-        }
-
-        if (isset($this->filters[$name])) {
-            return $this->filters[$name];
-        }
-
-        foreach ($this->filters as $pattern => $filter) {
-            $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count);
-
-            if ($count) {
-                if (preg_match('#^'.$pattern.'$#', $name, $matches)) {
-                    array_shift($matches);
-                    $filter->setArguments($matches);
-
-                    return $filter;
-                }
-            }
-        }
-
-        foreach ($this->filterCallbacks as $callback) {
-            if (false !== $filter = call_user_func($callback, $name)) {
-                return $filter;
-            }
-        }
-
-        return false;
-    }
-
-    public function registerUndefinedFilterCallback($callable)
-    {
-        $this->filterCallbacks[] = $callable;
-    }
-
-    /**
-     * Gets the registered Filters.
-     *
-     * Be warned that this method cannot return filters defined with registerUndefinedFunctionCallback.
-     *
-     * @return Twig_FilterInterface[] An array of Twig_FilterInterface instances
-     *
-     * @see registerUndefinedFilterCallback
-     */
-    public function getFilters()
-    {
-        if (null === $this->filters) {
-            foreach ($this->getExtensions() as $extension) {
-                foreach ($extension->getFilters() as $name => $filter) {
-                    $this->addFilter($name, $filter);
-                }
-            }
-
-            $this->filters = $this->staging['filters'];
-        }
-
-        return $this->filters;
-    }
-
-    /**
-     * Registers a Test.
-     *
-     * @param string             $name The test name
-     * @param Twig_TestInterface $test A Twig_TestInterface instance
-     */
-    public function addTest($name, Twig_TestInterface $test)
-    {
-        $this->staging['tests'][$name] = $test;
-        $this->tests = null;
-    }
-
-    /**
-     * Gets the registered Tests.
-     *
-     * @return Twig_TestInterface[] An array of Twig_TestInterface instances
-     */
-    public function getTests()
-    {
-        if (null === $this->tests) {
-            foreach ($this->getExtensions() as $extension) {
-                foreach ($extension->getTests() as $name => $test) {
-                    $this->addTest($name, $test);
-                }
-            }
-
-            $this->tests = $this->staging['tests'];
-        }
-
-        return $this->tests;
-    }
-
-    /**
-     * Registers a Function.
-     *
-     * @param string                 $name     The function name
-     * @param Twig_FunctionInterface $function A Twig_FunctionInterface instance
-     */
-    public function addFunction($name, Twig_FunctionInterface $function)
-    {
-        $this->staging['functions'][$name] = $function;
-        $this->functions = null;
-    }
-
-    /**
-     * Get a function by name.
-     *
-     * Subclasses may override this method and load functions differently;
-     * so no list of functions is available.
-     *
-     * @param string $name function name
-     *
-     * @return Twig_Function|false A Twig_Function instance or false if the function does not exists
-     */
-    public function getFunction($name)
-    {
-        if (null === $this->functions) {
-            $this->getFunctions();
-        }
-
-        if (isset($this->functions[$name])) {
-            return $this->functions[$name];
-        }
-
-        foreach ($this->functions as $pattern => $function) {
-            $pattern = str_replace('\\*', '(.*?)', preg_quote($pattern, '#'), $count);
-
-            if ($count) {
-                if (preg_match('#^'.$pattern.'$#', $name, $matches)) {
-                    array_shift($matches);
-                    $function->setArguments($matches);
-
-                    return $function;
-                }
-            }
-        }
-
-        foreach ($this->functionCallbacks as $callback) {
-            if (false !== $function = call_user_func($callback, $name)) {
-                return $function;
-            }
-        }
-
-        return false;
-    }
-
-    public function registerUndefinedFunctionCallback($callable)
-    {
-        $this->functionCallbacks[] = $callable;
-    }
-
-    /**
-     * Gets registered functions.
-     *
-     * Be warned that this method cannot return functions defined with registerUndefinedFunctionCallback.
-     *
-     * @return Twig_FunctionInterface[] An array of Twig_FunctionInterface instances
-     *
-     * @see registerUndefinedFunctionCallback
-     */
-    public function getFunctions()
-    {
-        if (null === $this->functions) {
-            foreach ($this->getExtensions() as $extension) {
-                foreach ($extension->getFunctions() as $name => $function) {
-                    $this->addFunction($name, $function);
-                }
-            }
-
-            $this->functions = $this->staging['functions'];
-        }
-
-        return $this->functions;
-    }
-
-    /**
-     * Registers a Global.
-     *
-     * @param string $name  The global name
-     * @param mixed  $value The global value
-     */
-    public function addGlobal($name, $value)
-    {
-        $this->staging['globals'][$name] = $value;
-        $this->globals = null;
-    }
-
-    /**
-     * Gets the registered Globals.
-     *
-     * @return array An array of globals
-     */
-    public function getGlobals()
-    {
-        if (null === $this->globals) {
-            $this->globals = isset($this->staging['globals']) ? $this->staging['globals'] : array();
-            foreach ($this->getExtensions() as $extension) {
-                $this->globals = array_merge($this->globals, $extension->getGlobals());
-            }
-        }
-
-        return $this->globals;
-    }
-
-    /**
-     * Merges a context with the defined globals.
-     *
-     * @param array $context An array representing the context
-     *
-     * @return array The context merged with the globals
-     */
-    public function mergeGlobals(array $context)
-    {
-        // we don't use array_merge as the context being generally
-        // bigger than globals, this code is faster.
-        foreach ($this->getGlobals() as $key => $value) {
-            if (!array_key_exists($key, $context)) {
-                $context[$key] = $value;
-            }
-        }
-
-        return $context;
-    }
-
-    /**
-     * Gets the registered unary Operators.
-     *
-     * @return array An array of unary operators
-     */
-    public function getUnaryOperators()
-    {
-        if (null === $this->unaryOperators) {
-            $this->initOperators();
-        }
-
-        return $this->unaryOperators;
-    }
-
-    /**
-     * Gets the registered binary Operators.
-     *
-     * @return array An array of binary operators
-     */
-    public function getBinaryOperators()
-    {
-        if (null === $this->binaryOperators) {
-            $this->initOperators();
-        }
-
-        return $this->binaryOperators;
-    }
-
-    public function computeAlternatives($name, $items)
-    {
-        $alternatives = array();
-        foreach ($items as $item) {
-            $lev = levenshtein($name, $item);
-            if ($lev <= strlen($name) / 3 || false !== strpos($item, $name)) {
-                $alternatives[$item] = $lev;
-            }
-        }
-        asort($alternatives);
-
-        return array_keys($alternatives);
-    }
-
-    protected function initOperators()
-    {
-        $this->unaryOperators = array();
-        $this->binaryOperators = array();
-        foreach ($this->getExtensions() as $extension) {
-            $operators = $extension->getOperators();
-
-            if (!$operators) {
-                continue;
-            }
-
-            if (2 !== count($operators)) {
-                throw new InvalidArgumentException(sprintf('"%s::getOperators()" does not return a valid operators array.', get_class($extension)));
-            }
-
-            $this->unaryOperators = array_merge($this->unaryOperators, $operators[0]);
-            $this->binaryOperators = array_merge($this->binaryOperators, $operators[1]);
-        }
-    }
-
-    protected function writeCacheFile($file, $content)
-    {
-        $dir = dirname($file);
-        if (!is_dir($dir)) {
-            if (false === @mkdir($dir, 0777, true) && !is_dir($dir)) {
-                throw new RuntimeException(sprintf("Unable to create the cache directory (%s).", $dir));
-            }
-        } elseif (!is_writable($dir)) {
-            throw new RuntimeException(sprintf("Unable to write in the cache directory (%s).", $dir));
-        }
-
-        $tmpFile = tempnam(dirname($file), basename($file));
-        if (false !== @file_put_contents($tmpFile, $content)) {
-            // rename does not work on Win32 before 5.2.6
-            if (@rename($tmpFile, $file) || (@copy($tmpFile, $file) && unlink($tmpFile))) {
-                @chmod($file, 0666 & ~umask());
-
-                return;
-            }
-        }
-
-        throw new RuntimeException(sprintf('Failed to write cache file "%s".', $file));
-    }
-}
Index: nc/libs/twig/Error.php
===================================================================
--- inc/libs/twig/Error.php	(revision 991)
+++ 	(revision )
@@ -1,233 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Twig base exception.
- *
- * This exception class and its children must only be used when
- * an error occurs during the loading of a template, when a syntax error
- * is detected in a template, or when rendering a template. Other
- * errors must use regular PHP exception classes (like when the template
- * cache directory is not writable for instance).
- *
- * To help debugging template issues, this class tracks the original template
- * name and line where the error occurred.
- *
- * Whenever possible, you must set these information (original template name
- * and line number) yourself by passing them to the constructor. If some or all
- * these information are not available from where you throw the exception, then
- * this class will guess them automatically (when the line number is set to -1
- * and/or the filename is set to null). As this is a costly operation, this
- * can be disabled by passing false for both the filename and the line number
- * when creating a new instance of this class.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Error extends Exception
-{
-    protected $lineno;
-    protected $filename;
-    protected $rawMessage;
-    protected $previous;
-
-    /**
-     * Constructor.
-     *
-     * Set both the line number and the filename to false to
-     * disable automatic guessing of the original template name
-     * and line number.
-     *
-     * Set the line number to -1 to enable its automatic guessing.
-     * Set the filename to null to enable its automatic guessing.
-     *
-     * By default, automatic guessing is enabled.
-     *
-     * @param string    $message  The error message
-     * @param integer   $lineno   The template line where the error occurred
-     * @param string    $filename The template file name where the error occurred
-     * @param Exception $previous The previous exception
-     */
-    public function __construct($message, $lineno = -1, $filename = null, Exception $previous = null)
-    {
-        if (version_compare(PHP_VERSION, '5.3.0', '<')) {
-            $this->previous = $previous;
-            parent::__construct('');
-        } else {
-            parent::__construct('', 0, $previous);
-        }
-
-        $this->lineno = $lineno;
-        $this->filename = $filename;
-
-        if (-1 === $this->lineno || null === $this->filename) {
-            $this->guessTemplateInfo();
-        }
-
-        $this->rawMessage = $message;
-
-        $this->updateRepr();
-    }
-
-    /**
-     * Gets the raw message.
-     *
-     * @return string The raw message
-     */
-    public function getRawMessage()
-    {
-        return $this->rawMessage;
-    }
-
-    /**
-     * Gets the filename where the error occurred.
-     *
-     * @return string The filename
-     */
-    public function getTemplateFile()
-    {
-        return $this->filename;
-    }
-
-    /**
-     * Sets the filename where the error occurred.
-     *
-     * @param string $filename The filename
-     */
-    public function setTemplateFile($filename)
-    {
-        $this->filename = $filename;
-
-        $this->updateRepr();
-    }
-
-    /**
-     * Gets the template line where the error occurred.
-     *
-     * @return integer The template line
-     */
-    public function getTemplateLine()
-    {
-        return $this->lineno;
-    }
-
-    /**
-     * Sets the template line where the error occurred.
-     *
-     * @param integer $lineno The template line
-     */
-    public function setTemplateLine($lineno)
-    {
-        $this->lineno = $lineno;
-
-        $this->updateRepr();
-    }
-
-    public function guess()
-    {
-        $this->guessTemplateInfo();
-        $this->updateRepr();
-    }
-
-    /**
-     * For PHP < 5.3.0, provides access to the getPrevious() method.
-     *
-     * @param string $method    The method name
-     * @param array  $arguments The parameters to be passed to the method
-     *
-     * @return Exception The previous exception or null
-     *
-     * @throws BadMethodCallException
-     */
-    public function __call($method, $arguments)
-    {
-        if ('getprevious' == strtolower($method)) {
-            return $this->previous;
-        }
-
-        throw new BadMethodCallException(sprintf('Method "Twig_Error::%s()" does not exist.', $method));
-    }
-
-    protected function updateRepr()
-    {
-        $this->message = $this->rawMessage;
-
-        $dot = false;
-        if ('.' === substr($this->message, -1)) {
-            $this->message = substr($this->message, 0, -1);
-            $dot = true;
-        }
-
-        if ($this->filename) {
-            if (is_string($this->filename) || (is_object($this->filename) && method_exists($this->filename, '__toString'))) {
-                $filename = sprintf('"%s"', $this->filename);
-            } else {
-                $filename = json_encode($this->filename);
-            }
-            $this->message .= sprintf(' in %s', $filename);
-        }
-
-        if ($this->lineno && $this->lineno >= 0) {
-            $this->message .= sprintf(' at line %d', $this->lineno);
-        }
-
-        if ($dot) {
-            $this->message .= '.';
-        }
-    }
-
-    protected function guessTemplateInfo()
-    {
-        $template = null;
-        foreach (debug_backtrace() as $trace) {
-            if (isset($trace['object']) && $trace['object'] instanceof Twig_Template && 'Twig_Template' !== get_class($trace['object'])) {
-                if (null === $this->filename || $this->filename == $trace['object']->getTemplateName()) {
-                    $template = $trace['object'];
-                }
-            }
-        }
-
-        // update template filename
-        if (null !== $template && null === $this->filename) {
-            $this->filename = $template->getTemplateName();
-        }
-
-        if (null === $template || $this->lineno > -1) {
-            return;
-        }
-
-        $r = new ReflectionObject($template);
-        $file = $r->getFileName();
-
-        $exceptions = array($e = $this);
-        while (($e instanceof self || method_exists($e, 'getPrevious')) && $e = $e->getPrevious()) {
-            $exceptions[] = $e;
-        }
-
-        while ($e = array_pop($exceptions)) {
-            $traces = $e->getTrace();
-            while ($trace = array_shift($traces)) {
-                if (!isset($trace['file']) || !isset($trace['line']) || $file != $trace['file']) {
-                    continue;
-                }
-
-                foreach ($template->getDebugInfo() as $codeLine => $templateLine) {
-                    if ($codeLine <= $trace['line']) {
-                        // update template line
-                        $this->lineno = $templateLine;
-
-                        return;
-                    }
-                }
-            }
-        }
-    }
-}
Index: nc/libs/twig/Error/Loader.php
===================================================================
--- inc/libs/twig/Error/Loader.php	(revision 991)
+++ 	(revision )
@@ -1,32 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Exception thrown when an error occurs during template loading.
- *
- * Automatic template information guessing is always turned off as
- * if a template cannot be loaded, there is nothing to guess.
- * However, when a template is loaded from another one, then, we need
- * to find the current context and this is automatically done by
- * Twig_Template::displayWithErrorHandling().
- *
- * This strategy makes Twig_Environment::resolveTemplate() much faster.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Error_Loader extends Twig_Error
-{
-    public function __construct($message, $lineno = -1, $filename = null, Exception $previous = null)
-    {
-        parent::__construct($message, false, false, $previous);
-    }
-}
Index: nc/libs/twig/Error/Runtime.php
===================================================================
--- inc/libs/twig/Error/Runtime.php	(revision 991)
+++ 	(revision )
@@ -1,21 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Exception thrown when an error occurs at runtime.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Error_Runtime extends Twig_Error
-{
-}
Index: nc/libs/twig/Error/Syntax.php
===================================================================
--- inc/libs/twig/Error/Syntax.php	(revision 991)
+++ 	(revision )
@@ -1,21 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Exception thrown when a syntax error occurs during lexing or parsing of a template.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Error_Syntax extends Twig_Error
-{
-}
Index: nc/libs/twig/ExistsLoaderInterface.php
===================================================================
--- inc/libs/twig/ExistsLoaderInterface.php	(revision 991)
+++ 	(revision )
@@ -1,28 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Adds an exists() method for loaders.
- *
- * @package    twig
- * @author     Florin Patan <florinpatan@gmail.com>
- */
-interface Twig_ExistsLoaderInterface
-{
-    /**
-     * Check if we have the source code of a template, given its name.
-     *
-     * @param string $name The name of the template to check if we can load
-     *
-     * @return boolean If the template source code is handled by this loader or not
-     */
-    public function exists($name);
-}
Index: nc/libs/twig/ExpressionParser.php
===================================================================
--- inc/libs/twig/ExpressionParser.php	(revision 991)
+++ 	(revision )
@@ -1,495 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Parses expressions.
- *
- * This parser implements a "Precedence climbing" algorithm.
- *
- * @see http://www.engr.mun.ca/~theo/Misc/exp_parsing.htm
- * @see http://en.wikipedia.org/wiki/Operator-precedence_parser
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_ExpressionParser
-{
-    const OPERATOR_LEFT = 1;
-    const OPERATOR_RIGHT = 2;
-
-    protected $parser;
-    protected $unaryOperators;
-    protected $binaryOperators;
-
-    public function __construct(Twig_Parser $parser, array $unaryOperators, array $binaryOperators)
-    {
-        $this->parser = $parser;
-        $this->unaryOperators = $unaryOperators;
-        $this->binaryOperators = $binaryOperators;
-    }
-
-    public function parseExpression($precedence = 0)
-    {
-        $expr = $this->getPrimary();
-        $token = $this->parser->getCurrentToken();
-        while ($this->isBinary($token) && $this->binaryOperators[$token->getValue()]['precedence'] >= $precedence) {
-            $op = $this->binaryOperators[$token->getValue()];
-            $this->parser->getStream()->next();
-
-            if (isset($op['callable'])) {
-                $expr = call_user_func($op['callable'], $this->parser, $expr);
-            } else {
-                $expr1 = $this->parseExpression(self::OPERATOR_LEFT === $op['associativity'] ? $op['precedence'] + 1 : $op['precedence']);
-                $class = $op['class'];
-                $expr = new $class($expr, $expr1, $token->getLine());
-            }
-
-            $token = $this->parser->getCurrentToken();
-        }
-
-        if (0 === $precedence) {
-            return $this->parseConditionalExpression($expr);
-        }
-
-        return $expr;
-    }
-
-    protected function getPrimary()
-    {
-        $token = $this->parser->getCurrentToken();
-
-        if ($this->isUnary($token)) {
-            $operator = $this->unaryOperators[$token->getValue()];
-            $this->parser->getStream()->next();
-            $expr = $this->parseExpression($operator['precedence']);
-            $class = $operator['class'];
-
-            return $this->parsePostfixExpression(new $class($expr, $token->getLine()));
-        } elseif ($token->test(Twig_Token::PUNCTUATION_TYPE, '(')) {
-            $this->parser->getStream()->next();
-            $expr = $this->parseExpression();
-            $this->parser->getStream()->expect(Twig_Token::PUNCTUATION_TYPE, ')', 'An opened parenthesis is not properly closed');
-
-            return $this->parsePostfixExpression($expr);
-        }
-
-        return $this->parsePrimaryExpression();
-    }
-
-    protected function parseConditionalExpression($expr)
-    {
-        while ($this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, '?')) {
-            $this->parser->getStream()->next();
-            $expr2 = $this->parseExpression();
-            $this->parser->getStream()->expect(Twig_Token::PUNCTUATION_TYPE, ':', 'The ternary operator must have a default value');
-            $expr3 = $this->parseExpression();
-
-            $expr = new Twig_Node_Expression_Conditional($expr, $expr2, $expr3, $this->parser->getCurrentToken()->getLine());
-        }
-
-        return $expr;
-    }
-
-    protected function isUnary(Twig_Token $token)
-    {
-        return $token->test(Twig_Token::OPERATOR_TYPE) && isset($this->unaryOperators[$token->getValue()]);
-    }
-
-    protected function isBinary(Twig_Token $token)
-    {
-        return $token->test(Twig_Token::OPERATOR_TYPE) && isset($this->binaryOperators[$token->getValue()]);
-    }
-
-    public function parsePrimaryExpression()
-    {
-        $token = $this->parser->getCurrentToken();
-        switch ($token->getType()) {
-            case Twig_Token::NAME_TYPE:
-                $this->parser->getStream()->next();
-                switch ($token->getValue()) {
-                    case 'true':
-                    case 'TRUE':
-                        $node = new Twig_Node_Expression_Constant(true, $token->getLine());
-                        break;
-
-                    case 'false':
-                    case 'FALSE':
-                        $node = new Twig_Node_Expression_Constant(false, $token->getLine());
-                        break;
-
-                    case 'none':
-                    case 'NONE':
-                    case 'null':
-                    case 'NULL':
-                        $node = new Twig_Node_Expression_Constant(null, $token->getLine());
-                        break;
-
-                    default:
-                        if ('(' === $this->parser->getCurrentToken()->getValue()) {
-                            $node = $this->getFunctionNode($token->getValue(), $token->getLine());
-                        } else {
-                            $node = new Twig_Node_Expression_Name($token->getValue(), $token->getLine());
-                        }
-                }
-                break;
-
-            case Twig_Token::NUMBER_TYPE:
-                $this->parser->getStream()->next();
-                $node = new Twig_Node_Expression_Constant($token->getValue(), $token->getLine());
-                break;
-
-            case Twig_Token::STRING_TYPE:
-            case Twig_Token::INTERPOLATION_START_TYPE:
-                $node = $this->parseStringExpression();
-                break;
-
-            default:
-                if ($token->test(Twig_Token::PUNCTUATION_TYPE, '[')) {
-                    $node = $this->parseArrayExpression();
-                } elseif ($token->test(Twig_Token::PUNCTUATION_TYPE, '{')) {
-                    $node = $this->parseHashExpression();
-                } else {
-                    throw new Twig_Error_Syntax(sprintf('Unexpected token "%s" of value "%s"', Twig_Token::typeToEnglish($token->getType(), $token->getLine()), $token->getValue()), $token->getLine(), $this->parser->getFilename());
-                }
-        }
-
-        return $this->parsePostfixExpression($node);
-    }
-
-    public function parseStringExpression()
-    {
-        $stream = $this->parser->getStream();
-
-        $nodes = array();
-        // a string cannot be followed by another string in a single expression
-        $nextCanBeString = true;
-        while (true) {
-            if ($stream->test(Twig_Token::STRING_TYPE) && $nextCanBeString) {
-                $token = $stream->next();
-                $nodes[] = new Twig_Node_Expression_Constant($token->getValue(), $token->getLine());
-                $nextCanBeString = false;
-            } elseif ($stream->test(Twig_Token::INTERPOLATION_START_TYPE)) {
-                $stream->next();
-                $nodes[] = $this->parseExpression();
-                $stream->expect(Twig_Token::INTERPOLATION_END_TYPE);
-                $nextCanBeString = true;
-            } else {
-                break;
-            }
-        }
-
-        $expr = array_shift($nodes);
-        foreach ($nodes as $node) {
-            $expr = new Twig_Node_Expression_Binary_Concat($expr, $node, $node->getLine());
-        }
-
-        return $expr;
-    }
-
-    public function parseArrayExpression()
-    {
-        $stream = $this->parser->getStream();
-        $stream->expect(Twig_Token::PUNCTUATION_TYPE, '[', 'An array element was expected');
-
-        $node = new Twig_Node_Expression_Array(array(), $stream->getCurrent()->getLine());
-        $first = true;
-        while (!$stream->test(Twig_Token::PUNCTUATION_TYPE, ']')) {
-            if (!$first) {
-                $stream->expect(Twig_Token::PUNCTUATION_TYPE, ',', 'An array element must be followed by a comma');
-
-                // trailing ,?
-                if ($stream->test(Twig_Token::PUNCTUATION_TYPE, ']')) {
-                    break;
-                }
-            }
-            $first = false;
-
-            $node->addElement($this->parseExpression());
-        }
-        $stream->expect(Twig_Token::PUNCTUATION_TYPE, ']', 'An opened array is not properly closed');
-
-        return $node;
-    }
-
-    public function parseHashExpression()
-    {
-        $stream = $this->parser->getStream();
-        $stream->expect(Twig_Token::PUNCTUATION_TYPE, '{', 'A hash element was expected');
-
-        $node = new Twig_Node_Expression_Array(array(), $stream->getCurrent()->getLine());
-        $first = true;
-        while (!$stream->test(Twig_Token::PUNCTUATION_TYPE, '}')) {
-            if (!$first) {
-                $stream->expect(Twig_Token::PUNCTUATION_TYPE, ',', 'A hash value must be followed by a comma');
-
-                // trailing ,?
-                if ($stream->test(Twig_Token::PUNCTUATION_TYPE, '}')) {
-                    break;
-                }
-            }
-            $first = false;
-
-            // a hash key can be:
-            //
-            //  * a number -- 12
-            //  * a string -- 'a'
-            //  * a name, which is equivalent to a string -- a
-            //  * an expression, which must be enclosed in parentheses -- (1 + 2)
-            if ($stream->test(Twig_Token::STRING_TYPE) || $stream->test(Twig_Token::NAME_TYPE) || $stream->test(Twig_Token::NUMBER_TYPE)) {
-                $token = $stream->next();
-                $key = new Twig_Node_Expression_Constant($token->getValue(), $token->getLine());
-            } elseif ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) {
-                $key = $this->parseExpression();
-            } else {
-                $current = $stream->getCurrent();
-
-                throw new Twig_Error_Syntax(sprintf('A hash key must be a quoted string, a number, a name, or an expression enclosed in parentheses (unexpected token "%s" of value "%s"', Twig_Token::typeToEnglish($current->getType(), $current->getLine()), $current->getValue()), $current->getLine(), $this->parser->getFilename());
-            }
-
-            $stream->expect(Twig_Token::PUNCTUATION_TYPE, ':', 'A hash key must be followed by a colon (:)');
-            $value = $this->parseExpression();
-
-            $node->addElement($value, $key);
-        }
-        $stream->expect(Twig_Token::PUNCTUATION_TYPE, '}', 'An opened hash is not properly closed');
-
-        return $node;
-    }
-
-    public function parsePostfixExpression($node)
-    {
-        while (true) {
-            $token = $this->parser->getCurrentToken();
-            if ($token->getType() == Twig_Token::PUNCTUATION_TYPE) {
-                if ('.' == $token->getValue() || '[' == $token->getValue()) {
-                    $node = $this->parseSubscriptExpression($node);
-                } elseif ('|' == $token->getValue()) {
-                    $node = $this->parseFilterExpression($node);
-                } else {
-                    break;
-                }
-            } else {
-                break;
-            }
-        }
-
-        return $node;
-    }
-
-    public function getFunctionNode($name, $line)
-    {
-        $args = $this->parseArguments();
-        switch ($name) {
-            case 'parent':
-                if (!count($this->parser->getBlockStack())) {
-                    throw new Twig_Error_Syntax('Calling "parent" outside a block is forbidden', $line, $this->parser->getFilename());
-                }
-
-                if (!$this->parser->getParent() && !$this->parser->hasTraits()) {
-                    throw new Twig_Error_Syntax('Calling "parent" on a template that does not extend nor "use" another template is forbidden', $line, $this->parser->getFilename());
-                }
-
-                return new Twig_Node_Expression_Parent($this->parser->peekBlockStack(), $line);
-            case 'block':
-                return new Twig_Node_Expression_BlockReference($args->getNode(0), false, $line);
-            case 'attribute':
-                if (count($args) < 2) {
-                    throw new Twig_Error_Syntax('The "attribute" function takes at least two arguments (the variable and the attributes)', $line, $this->parser->getFilename());
-                }
-
-                return new Twig_Node_Expression_GetAttr($args->getNode(0), $args->getNode(1), count($args) > 2 ? $args->getNode(2) : new Twig_Node_Expression_Array(array(), $line), Twig_TemplateInterface::ANY_CALL, $line);
-            default:
-                if (null !== $alias = $this->parser->getImportedSymbol('function', $name)) {
-                    $arguments = new Twig_Node_Expression_Array(array(), $line);
-                    foreach ($args as $n) {
-                        $arguments->addElement($n);
-                    }
-
-                    $node = new Twig_Node_Expression_MethodCall($alias['node'], $alias['name'], $arguments, $line);
-                    $node->setAttribute('safe', true);
-
-                    return $node;
-                }
-
-                $class = $this->getFunctionNodeClass($name);
-
-                return new $class($name, $args, $line);
-        }
-    }
-
-    public function parseSubscriptExpression($node)
-    {
-        $stream = $this->parser->getStream();
-        $token = $stream->next();
-        $lineno = $token->getLine();
-        $arguments = new Twig_Node_Expression_Array(array(), $lineno);
-        $type = Twig_TemplateInterface::ANY_CALL;
-        if ($token->getValue() == '.') {
-            $token = $stream->next();
-            if (
-                $token->getType() == Twig_Token::NAME_TYPE
-                ||
-                $token->getType() == Twig_Token::NUMBER_TYPE
-                ||
-                ($token->getType() == Twig_Token::OPERATOR_TYPE && preg_match(Twig_Lexer::REGEX_NAME, $token->getValue()))
-            ) {
-                $arg = new Twig_Node_Expression_Constant($token->getValue(), $lineno);
-
-                if ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) {
-                    $type = Twig_TemplateInterface::METHOD_CALL;
-                    foreach ($this->parseArguments() as $n) {
-                        $arguments->addElement($n);
-                    }
-                }
-            } else {
-                throw new Twig_Error_Syntax('Expected name or number', $lineno, $this->parser->getFilename());
-            }
-        } else {
-            $type = Twig_TemplateInterface::ARRAY_CALL;
-
-            $arg = $this->parseExpression();
-
-            // slice?
-            if ($stream->test(Twig_Token::PUNCTUATION_TYPE, ':')) {
-                $stream->next();
-
-                if ($stream->test(Twig_Token::PUNCTUATION_TYPE, ']')) {
-                    $length = new Twig_Node_Expression_Constant(null, $token->getLine());
-                } else {
-                    $length = $this->parseExpression();
-                }
-
-                $class = $this->getFilterNodeClass('slice');
-                $arguments = new Twig_Node(array($arg, $length));
-                $filter = new $class($node, new Twig_Node_Expression_Constant('slice', $token->getLine()), $arguments, $token->getLine());
-
-                $stream->expect(Twig_Token::PUNCTUATION_TYPE, ']');
-
-                return $filter;
-            }
-
-            $stream->expect(Twig_Token::PUNCTUATION_TYPE, ']');
-        }
-
-        if ($node instanceof Twig_Node_Expression_Name && null !== $alias = $this->parser->getImportedSymbol('template', $node->getAttribute('name'))) {
-            $node = new Twig_Node_Expression_MethodCall($node, 'get'.$arg->getAttribute('value'), $arguments, $lineno);
-            $node->setAttribute('safe', true);
-
-            return $node;
-        }
-
-        return new Twig_Node_Expression_GetAttr($node, $arg, $arguments, $type, $lineno);
-    }
-
-    public function parseFilterExpression($node)
-    {
-        $this->parser->getStream()->next();
-
-        return $this->parseFilterExpressionRaw($node);
-    }
-
-    public function parseFilterExpressionRaw($node, $tag = null)
-    {
-        while (true) {
-            $token = $this->parser->getStream()->expect(Twig_Token::NAME_TYPE);
-
-            $name = new Twig_Node_Expression_Constant($token->getValue(), $token->getLine());
-            if (!$this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, '(')) {
-                $arguments = new Twig_Node();
-            } else {
-                $arguments = $this->parseArguments();
-            }
-
-            $class = $this->getFilterNodeClass($name->getAttribute('value'));
-
-            $node = new $class($node, $name, $arguments, $token->getLine(), $tag);
-
-            if (!$this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, '|')) {
-                break;
-            }
-
-            $this->parser->getStream()->next();
-        }
-
-        return $node;
-    }
-
-    public function parseArguments()
-    {
-        $args = array();
-        $stream = $this->parser->getStream();
-
-        $stream->expect(Twig_Token::PUNCTUATION_TYPE, '(', 'A list of arguments must be opened by a parenthesis');
-        while (!$stream->test(Twig_Token::PUNCTUATION_TYPE, ')')) {
-            if (!empty($args)) {
-                $stream->expect(Twig_Token::PUNCTUATION_TYPE, ',', 'Arguments must be separated by a comma');
-            }
-            $args[] = $this->parseExpression();
-        }
-        $stream->expect(Twig_Token::PUNCTUATION_TYPE, ')', 'A list of arguments must be closed by a parenthesis');
-
-        return new Twig_Node($args);
-    }
-
-    public function parseAssignmentExpression()
-    {
-        $targets = array();
-        while (true) {
-            $token = $this->parser->getStream()->expect(Twig_Token::NAME_TYPE, null, 'Only variables can be assigned to');
-            if (in_array($token->getValue(), array('true', 'false', 'none'))) {
-                throw new Twig_Error_Syntax(sprintf('You cannot assign a value to "%s"', $token->getValue()), $token->getLine(), $this->parser->getFilename());
-            }
-            $targets[] = new Twig_Node_Expression_AssignName($token->getValue(), $token->getLine());
-
-            if (!$this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, ',')) {
-                break;
-            }
-            $this->parser->getStream()->next();
-        }
-
-        return new Twig_Node($targets);
-    }
-
-    public function parseMultitargetExpression()
-    {
-        $targets = array();
-        while (true) {
-            $targets[] = $this->parseExpression();
-            if (!$this->parser->getStream()->test(Twig_Token::PUNCTUATION_TYPE, ',')) {
-                break;
-            }
-            $this->parser->getStream()->next();
-        }
-
-        return new Twig_Node($targets);
-    }
-
-    protected function getFunctionNodeClass($name)
-    {
-        $functionMap = $this->parser->getEnvironment()->getFunctions();
-        if (isset($functionMap[$name]) && $functionMap[$name] instanceof Twig_Function_Node) {
-            return $functionMap[$name]->getClass();
-        }
-
-        return 'Twig_Node_Expression_Function';
-    }
-
-    protected function getFilterNodeClass($name)
-    {
-        $filterMap = $this->parser->getEnvironment()->getFilters();
-        if (isset($filterMap[$name]) && $filterMap[$name] instanceof Twig_Filter_Node) {
-            return $filterMap[$name]->getClass();
-        }
-
-        return 'Twig_Node_Expression_Filter';
-    }
-}
Index: nc/libs/twig/Extension.php
===================================================================
--- inc/libs/twig/Extension.php	(revision 991)
+++ 	(revision )
@@ -1,93 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-abstract class Twig_Extension implements Twig_ExtensionInterface
-{
-    /**
-     * Initializes the runtime environment.
-     *
-     * This is where you can load some file that contains filter functions for instance.
-     *
-     * @param Twig_Environment $environment The current Twig_Environment instance
-     */
-    public function initRuntime(Twig_Environment $environment)
-    {
-    }
-
-    /**
-     * Returns the token parser instances to add to the existing list.
-     *
-     * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances
-     */
-    public function getTokenParsers()
-    {
-        return array();
-    }
-
-    /**
-     * Returns the node visitor instances to add to the existing list.
-     *
-     * @return array An array of Twig_NodeVisitorInterface instances
-     */
-    public function getNodeVisitors()
-    {
-        return array();
-    }
-
-    /**
-     * Returns a list of filters to add to the existing list.
-     *
-     * @return array An array of filters
-     */
-    public function getFilters()
-    {
-        return array();
-    }
-
-    /**
-     * Returns a list of tests to add to the existing list.
-     *
-     * @return array An array of tests
-     */
-    public function getTests()
-    {
-        return array();
-    }
-
-    /**
-     * Returns a list of functions to add to the existing list.
-     *
-     * @return array An array of functions
-     */
-    public function getFunctions()
-    {
-        return array();
-    }
-
-    /**
-     * Returns a list of operators to add to the existing list.
-     *
-     * @return array An array of operators
-     */
-    public function getOperators()
-    {
-        return array();
-    }
-
-    /**
-     * Returns a list of global variables to add to the existing list.
-     *
-     * @return array An array of global variables
-     */
-    public function getGlobals()
-    {
-        return array();
-    }
-}
Index: nc/libs/twig/Extension/Core.php
===================================================================
--- inc/libs/twig/Extension/Core.php	(revision 991)
+++ 	(revision )
@@ -1,1214 +1,0 @@
-<?php
-
-if (!defined('ENT_SUBSTITUTE')) {
-    define('ENT_SUBSTITUTE', 8);
-}
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Extension_Core extends Twig_Extension
-{
-    protected $dateFormats = array('F j, Y H:i', '%d days');
-    protected $numberFormat = array(0, '.', ',');
-    protected $timezone = null;
-
-    /**
-     * Sets the default format to be used by the date filter.
-     *
-     * @param string $format             The default date format string
-     * @param string $dateIntervalFormat The default date interval format string
-     */
-    public function setDateFormat($format = null, $dateIntervalFormat = null)
-    {
-        if (null !== $format) {
-            $this->dateFormats[0] = $format;
-        }
-
-        if (null !== $dateIntervalFormat) {
-            $this->dateFormats[1] = $dateIntervalFormat;
-        }
-    }
-
-    /**
-     * Gets the default format to be used by the date filter.
-     *
-     * @return array The default date format string and the default date interval format string
-     */
-    public function getDateFormat()
-    {
-        return $this->dateFormats;
-    }
-
-    /**
-     * Sets the default timezone to be used by the date filter.
-     *
-     * @param DateTimeZone|string $timezone The default timezone string or a DateTimeZone object
-     */
-    public function setTimezone($timezone)
-    {
-        $this->timezone = $timezone instanceof DateTimeZone ? $timezone : new DateTimeZone($timezone);
-    }
-
-    /**
-     * Gets the default timezone to be used by the date filter.
-     *
-     * @return DateTimeZone The default timezone currently in use
-     */
-    public function getTimezone()
-    {
-        if (null === $this->timezone) {
-            $this->timezone = new DateTimeZone(date_default_timezone_get());
-        }
-
-        return $this->timezone;
-    }
-
-    /**
-     * Sets the default format to be used by the number_format filter.
-     *
-     * @param integer $decimal      The number of decimal places to use.
-     * @param string  $decimalPoint The character(s) to use for the decimal point.
-     * @param string  $thousandSep  The character(s) to use for the thousands separator.
-     */
-    public function setNumberFormat($decimal, $decimalPoint, $thousandSep)
-    {
-        $this->numberFormat = array($decimal, $decimalPoint, $thousandSep);
-    }
-
-    /**
-     * Get the default format used by the number_format filter.
-     *
-     * @return array The arguments for number_format()
-     */
-    public function getNumberFormat()
-    {
-        return $this->numberFormat;
-    }
-
-    /**
-     * Returns the token parser instance to add to the existing list.
-     *
-     * @return array An array of Twig_TokenParser instances
-     */
-    public function getTokenParsers()
-    {
-        return array(
-            new Twig_TokenParser_For(),
-            new Twig_TokenParser_If(),
-            new Twig_TokenParser_Extends(),
-            new Twig_TokenParser_Include(),
-            new Twig_TokenParser_Block(),
-            new Twig_TokenParser_Use(),
-            new Twig_TokenParser_Filter(),
-            new Twig_TokenParser_Macro(),
-            new Twig_TokenParser_Import(),
-            new Twig_TokenParser_From(),
-            new Twig_TokenParser_Set(),
-            new Twig_TokenParser_Spaceless(),
-            new Twig_TokenParser_Flush(),
-            new Twig_TokenParser_Do(),
-            new Twig_TokenParser_Embed(),
-        );
-    }
-
-    /**
-     * Returns a list of filters to add to the existing list.
-     *
-     * @return array An array of filters
-     */
-    public function getFilters()
-    {
-        $filters = array(
-            // formatting filters
-            'date'          => new Twig_Filter_Function('twig_date_format_filter', array('needs_environment' => true)),
-            'date_modify'   => new Twig_Filter_Function('twig_date_modify_filter', array('needs_environment' => true)),
-            'format'        => new Twig_Filter_Function('sprintf'),
-            'replace'       => new Twig_Filter_Function('strtr'),
-            'number_format' => new Twig_Filter_Function('twig_number_format_filter', array('needs_environment' => true)),
-            'abs'           => new Twig_Filter_Function('abs'),
-
-            // encoding
-            'url_encode'       => new Twig_Filter_Function('twig_urlencode_filter'),
-            'json_encode'      => new Twig_Filter_Function('twig_jsonencode_filter'),
-            'convert_encoding' => new Twig_Filter_Function('twig_convert_encoding'),
-
-            // string filters
-            'title'      => new Twig_Filter_Function('twig_title_string_filter', array('needs_environment' => true)),
-            'capitalize' => new Twig_Filter_Function('twig_capitalize_string_filter', array('needs_environment' => true)),
-            'upper'      => new Twig_Filter_Function('strtoupper'),
-            'lower'      => new Twig_Filter_Function('strtolower'),
-            'striptags'  => new Twig_Filter_Function('strip_tags'),
-            'trim'       => new Twig_Filter_Function('trim'),
-            'nl2br'      => new Twig_Filter_Function('nl2br', array('pre_escape' => 'html', 'is_safe' => array('html'))),
-
-            // array helpers
-            'join'    => new Twig_Filter_Function('twig_join_filter'),
-            'split'   => new Twig_Filter_Function('twig_split_filter'),
-            'sort'    => new Twig_Filter_Function('twig_sort_filter'),
-            'merge'   => new Twig_Filter_Function('twig_array_merge'),
-
-            // string/array filters
-            'reverse' => new Twig_Filter_Function('twig_reverse_filter', array('needs_environment' => true)),
-            'length'  => new Twig_Filter_Function('twig_length_filter', array('needs_environment' => true)),
-            'slice'   => new Twig_Filter_Function('twig_slice', array('needs_environment' => true)),
-
-            // iteration and runtime
-            'default' => new Twig_Filter_Node('Twig_Node_Expression_Filter_Default'),
-            '_default' => new Twig_Filter_Function('_twig_default_filter'),
-
-            'keys'    => new Twig_Filter_Function('twig_get_array_keys_filter'),
-
-            // escaping
-            'escape' => new Twig_Filter_Function('twig_escape_filter', array('needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe')),
-            'e'      => new Twig_Filter_Function('twig_escape_filter', array('needs_environment' => true, 'is_safe_callback' => 'twig_escape_filter_is_safe')),
-        );
-
-        if (function_exists('mb_get_info')) {
-            $filters['upper'] = new Twig_Filter_Function('twig_upper_filter', array('needs_environment' => true));
-            $filters['lower'] = new Twig_Filter_Function('twig_lower_filter', array('needs_environment' => true));
-        }
-
-        return $filters;
-    }
-
-    /**
-     * Returns a list of global functions to add to the existing list.
-     *
-     * @return array An array of global functions
-     */
-    public function getFunctions()
-    {
-        return array(
-            'range'    => new Twig_Function_Function('range'),
-            'constant' => new Twig_Function_Function('constant'),
-            'cycle'    => new Twig_Function_Function('twig_cycle'),
-            'random'   => new Twig_Function_Function('twig_random', array('needs_environment' => true)),
-            'date'     => new Twig_Function_Function('twig_date_converter', array('needs_environment' => true)),
-        );
-    }
-
-    /**
-     * Returns a list of tests to add to the existing list.
-     *
-     * @return array An array of tests
-     */
-    public function getTests()
-    {
-        return array(
-            'even'        => new Twig_Test_Node('Twig_Node_Expression_Test_Even'),
-            'odd'         => new Twig_Test_Node('Twig_Node_Expression_Test_Odd'),
-            'defined'     => new Twig_Test_Node('Twig_Node_Expression_Test_Defined'),
-            'sameas'      => new Twig_Test_Node('Twig_Node_Expression_Test_Sameas'),
-            'none'        => new Twig_Test_Node('Twig_Node_Expression_Test_Null'),
-            'null'        => new Twig_Test_Node('Twig_Node_Expression_Test_Null'),
-            'divisibleby' => new Twig_Test_Node('Twig_Node_Expression_Test_Divisibleby'),
-            'constant'    => new Twig_Test_Node('Twig_Node_Expression_Test_Constant'),
-            'empty'       => new Twig_Test_Function('twig_test_empty'),
-            'iterable'    => new Twig_Test_Function('twig_test_iterable'),
-        );
-    }
-
-    /**
-     * Returns a list of operators to add to the existing list.
-     *
-     * @return array An array of operators
-     */
-    public function getOperators()
-    {
-        return array(
-            array(
-                'not' => array('precedence' => 50, 'class' => 'Twig_Node_Expression_Unary_Not'),
-                '-'   => array('precedence' => 500, 'class' => 'Twig_Node_Expression_Unary_Neg'),
-                '+'   => array('precedence' => 500, 'class' => 'Twig_Node_Expression_Unary_Pos'),
-            ),
-            array(
-                'or'     => array('precedence' => 10, 'class' => 'Twig_Node_Expression_Binary_Or', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                'and'    => array('precedence' => 15, 'class' => 'Twig_Node_Expression_Binary_And', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                'b-or'   => array('precedence' => 16, 'class' => 'Twig_Node_Expression_Binary_BitwiseOr', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                'b-xor'  => array('precedence' => 17, 'class' => 'Twig_Node_Expression_Binary_BitwiseXor', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                'b-and'  => array('precedence' => 18, 'class' => 'Twig_Node_Expression_Binary_BitwiseAnd', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                '=='     => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Equal', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                '!='     => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                '<'      => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Less', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                '>'      => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_Greater', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                '>='     => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_GreaterEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                '<='     => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_LessEqual', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                'not in' => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_NotIn', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                'in'     => array('precedence' => 20, 'class' => 'Twig_Node_Expression_Binary_In', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                '..'     => array('precedence' => 25, 'class' => 'Twig_Node_Expression_Binary_Range', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                '+'      => array('precedence' => 30, 'class' => 'Twig_Node_Expression_Binary_Add', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                '-'      => array('precedence' => 30, 'class' => 'Twig_Node_Expression_Binary_Sub', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                '~'      => array('precedence' => 40, 'class' => 'Twig_Node_Expression_Binary_Concat', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                '*'      => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mul', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                '/'      => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Div', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                '//'     => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_FloorDiv', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                '%'      => array('precedence' => 60, 'class' => 'Twig_Node_Expression_Binary_Mod', 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                'is'     => array('precedence' => 100, 'callable' => array($this, 'parseTestExpression'), 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                'is not' => array('precedence' => 100, 'callable' => array($this, 'parseNotTestExpression'), 'associativity' => Twig_ExpressionParser::OPERATOR_LEFT),
-                '**'     => array('precedence' => 200, 'class' => 'Twig_Node_Expression_Binary_Power', 'associativity' => Twig_ExpressionParser::OPERATOR_RIGHT),
-            ),
-        );
-    }
-
-    public function parseNotTestExpression(Twig_Parser $parser, $node)
-    {
-        return new Twig_Node_Expression_Unary_Not($this->parseTestExpression($parser, $node), $parser->getCurrentToken()->getLine());
-    }
-
-    public function parseTestExpression(Twig_Parser $parser, $node)
-    {
-        $stream = $parser->getStream();
-        $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue();
-        $arguments = null;
-        if ($stream->test(Twig_Token::PUNCTUATION_TYPE, '(')) {
-            $arguments = $parser->getExpressionParser()->parseArguments();
-        }
-
-        $class = $this->getTestNodeClass($parser->getEnvironment(), $name);
-
-        return new $class($node, $name, $arguments, $parser->getCurrentToken()->getLine());
-    }
-
-    protected function getTestNodeClass(Twig_Environment $env, $name)
-    {
-        $testMap = $env->getTests();
-        if (isset($testMap[$name]) && $testMap[$name] instanceof Twig_Test_Node) {
-            return $testMap[$name]->getClass();
-        }
-
-        return 'Twig_Node_Expression_Test';
-    }
-
-    /**
-     * Returns the name of the extension.
-     *
-     * @return string The extension name
-     */
-    public function getName()
-    {
-        return 'core';
-    }
-}
-
-/**
- * Cycles over a value.
- *
- * @param ArrayAccess|array $values An array or an ArrayAccess instance
- * @param integer           $i      The cycle value
- *
- * @return string The next value in the cycle
- */
-function twig_cycle($values, $i)
-{
-    if (!is_array($values) && !$values instanceof ArrayAccess) {
-        return $values;
-    }
-
-    return $values[$i % count($values)];
-}
-
-/**
- * Returns a random value depending on the supplied parameter type:
- * - a random item from a Traversable or array
- * - a random character from a string
- * - a random integer between 0 and the integer parameter
- *
- * @param Twig_Environment                 $env    A Twig_Environment instance
- * @param Traversable|array|integer|string $values The values to pick a random item from
- *
- * @throws Twig_Error_Runtime When $values is an empty array (does not apply to an empty string which is returned as is).
- *
- * @return mixed A random value from the given sequence
- */
-function twig_random(Twig_Environment $env, $values = null)
-{
-    if (null === $values) {
-        return mt_rand();
-    }
-
-    if (is_int($values) || is_float($values)) {
-        return $values < 0 ? mt_rand($values, 0) : mt_rand(0, $values);
-    }
-
-    if ($values instanceof Traversable) {
-        $values = iterator_to_array($values);
-    } elseif (is_string($values)) {
-        if ('' === $values) {
-            return '';
-        }
-        if (null !== $charset = $env->getCharset()) {
-            if ('UTF-8' != $charset) {
-                $values = twig_convert_encoding($values, 'UTF-8', $charset);
-            }
-
-            // unicode version of str_split()
-            // split at all positions, but not after the start and not before the end
-            $values = preg_split('/(?<!^)(?!$)/u', $values);
-
-            if ('UTF-8' != $charset) {
-                foreach ($values as $i => $value) {
-                    $values[$i] = twig_convert_encoding($value, $charset, 'UTF-8');
-                }
-            }
-        } else {
-            return $values[mt_rand(0, strlen($values) - 1)];
-        }
-    }
-
-    if (!is_array($values)) {
-        return $values;
-    }
-
-    if (0 === count($values)) {
-        throw new Twig_Error_Runtime('The random function cannot pick from an empty array.');
-    }
-
-    return $values[array_rand($values, 1)];
-}
-
-/**
- * Converts a date to the given format.
- *
- * <pre>
- *   {{ post.published_at|date("m/d/Y") }}
- * </pre>
- *
- * @param Twig_Environment             $env      A Twig_Environment instance
- * @param DateTime|DateInterval|string $date     A date
- * @param string                       $format   A format
- * @param DateTimeZone|string          $timezone A timezone
- *
- * @return string The formatted date
- */
-function twig_date_format_filter(Twig_Environment $env, $date, $format = null, $timezone = null)
-{
-    if (null === $format) {
-        $formats = $env->getExtension('core')->getDateFormat();
-        $format = $date instanceof DateInterval ? $formats[1] : $formats[0];
-    }
-
-    if ($date instanceof DateInterval) {
-        return $date->format($format);
-    }
-
-    return twig_date_converter($env, $date, $timezone)->format($format);
-}
-
-/**
- * Returns a new date object modified
- *
- * <pre>
- *   {{ post.published_at|modify("-1day")|date("m/d/Y") }}
- * </pre>
- *
- * @param Twig_Environment  $env      A Twig_Environment instance
- * @param DateTime|string   $date     A date
- * @param string            $modifier A modifier string
- *
- * @return DateTime A new date object
- */
-function twig_date_modify_filter(Twig_Environment $env, $date, $modifier)
-{
-    $date = twig_date_converter($env, $date, false);
-    $date->modify($modifier);
-
-    return $date;
-}
-
-/**
- * Converts an input to a DateTime instance.
- *
- * <pre>
- *    {% if date(user.created_at) < date('+2days') %}
- *      {# do something #}
- *    {% endif %}
- * </pre>
- *
- * @param Twig_Environment    $env      A Twig_Environment instance
- * @param DateTime|string     $date     A date
- * @param DateTimeZone|string $timezone A timezone
- *
- * @return DateTime A DateTime instance
- */
-function twig_date_converter(Twig_Environment $env, $date = null, $timezone = null)
-{
-    // determine the timezone
-    if (!$timezone) {
-        $defaultTimezone = $env->getExtension('core')->getTimezone();
-    } elseif (!$timezone instanceof DateTimeZone) {
-        $defaultTimezone = new DateTimeZone($timezone);
-    } else {
-        $defaultTimezone = $timezone;
-    }
-
-    if ($date instanceof DateTime) {
-        $date = clone $date;
-        if (false !== $timezone) {
-            $date->setTimezone($defaultTimezone);
-        }
-
-        return $date;
-    }
-
-    $asString = (string) $date;
-    if (ctype_digit($asString) || (!empty($asString) && '-' === $asString[0] && ctype_digit(substr($asString, 1)))) {
-        $date = new DateTime('@'.$date);
-        $date->setTimezone($defaultTimezone);
-
-        return $date;
-    }
-
-    return new DateTime($date, $defaultTimezone);
-}
-
-/**
- * Number format filter.
- *
- * All of the formatting options can be left null, in that case the defaults will
- * be used.  Supplying any of the parameters will override the defaults set in the
- * environment object.
- *
- * @param Twig_Environment    $env          A Twig_Environment instance
- * @param mixed               $number       A float/int/string of the number to format
- * @param integer             $decimal      The number of decimal points to display.
- * @param string              $decimalPoint The character(s) to use for the decimal point.
- * @param string              $thousandSep  The character(s) to use for the thousands separator.
- *
- * @return string The formatted number
- */
-function twig_number_format_filter(Twig_Environment $env, $number, $decimal = null, $decimalPoint = null, $thousandSep = null)
-{
-    $defaults = $env->getExtension('core')->getNumberFormat();
-    if (null === $decimal) {
-        $decimal = $defaults[0];
-    }
-
-    if (null === $decimalPoint) {
-        $decimalPoint = $defaults[1];
-    }
-
-    if (null === $thousandSep) {
-        $thousandSep = $defaults[2];
-    }
-
-    return number_format((float) $number, $decimal, $decimalPoint, $thousandSep);
-}
-
-/**
- * URL encodes a string.
- *
- * @param string $url A URL
- * @param bool   $raw true to use rawurlencode() instead of urlencode
- *
- * @return string The URL encoded value
- */
-function twig_urlencode_filter($url, $raw = false)
-{
-    if ($raw) {
-        return rawurlencode($url);
-    }
-
-    return urlencode($url);
-}
-
-if (version_compare(PHP_VERSION, '5.3.0', '<')) {
-    /**
-     * JSON encodes a variable.
-     *
-     * @param mixed   $value   The value to encode.
-     * @param integer $options Not used on PHP 5.2.x
-     *
-     * @return mixed The JSON encoded value
-     */
-    function twig_jsonencode_filter($value, $options = 0)
-    {
-        if ($value instanceof Twig_Markup) {
-            $value = (string) $value;
-        } elseif (is_array($value)) {
-            array_walk_recursive($value, '_twig_markup2string');
-        }
-
-        return json_encode($value);
-    }
-} else {
-    /**
-     * JSON encodes a variable.
-     *
-     * @param mixed   $value   The value to encode.
-     * @param integer $options Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT
-     *
-     * @return mixed The JSON encoded value
-     */
-    function twig_jsonencode_filter($value, $options = 0)
-    {
-        if ($value instanceof Twig_Markup) {
-            $value = (string) $value;
-        } elseif (is_array($value)) {
-            array_walk_recursive($value, '_twig_markup2string');
-        }
-
-        return json_encode($value, $options);
-    }
-}
-
-function _twig_markup2string(&$value)
-{
-    if ($value instanceof Twig_Markup) {
-        $value = (string) $value;
-    }
-}
-
-/**
- * Merges an array with another one.
- *
- * <pre>
- *  {% set items = { 'apple': 'fruit', 'orange': 'fruit' } %}
- *
- *  {% set items = items|merge({ 'peugeot': 'car' }) %}
- *
- *  {# items now contains { 'apple': 'fruit', 'orange': 'fruit', 'peugeot': 'car' } #}
- * </pre>
- *
- * @param array $arr1 An array
- * @param array $arr2 An array
- *
- * @return array The merged array
- */
-function twig_array_merge($arr1, $arr2)
-{
-    if (!is_array($arr1) || !is_array($arr2)) {
-        throw new Twig_Error_Runtime('The merge filter only works with arrays or hashes.');
-    }
-
-    return array_merge($arr1, $arr2);
-}
-
-/**
- * Slices a variable.
- *
- * @param Twig_Environment $env          A Twig_Environment instance
- * @param mixed            $item         A variable
- * @param integer          $start        Start of the slice
- * @param integer          $length       Size of the slice
- * @param Boolean          $preserveKeys Whether to preserve key or not (when the input is an array)
- *
- * @return mixed The sliced variable
- */
-function twig_slice(Twig_Environment $env, $item, $start, $length = null, $preserveKeys = false)
-{
-    if ($item instanceof Traversable) {
-        $item = iterator_to_array($item, false);
-    }
-
-    if (is_array($item)) {
-        return array_slice($item, $start, $length, $preserveKeys);
-    }
-
-    $item = (string) $item;
-
-    if (function_exists('mb_get_info') && null !== $charset = $env->getCharset()) {
-        return mb_substr($item, $start, null === $length ? mb_strlen($item, $charset) - $start : $length, $charset);
-    }
-
-    return null === $length ? substr($item, $start) : substr($item, $start, $length);
-}
-
-/**
- * Joins the values to a string.
- *
- * The separator between elements is an empty string per default, you can define it with the optional parameter.
- *
- * <pre>
- *  {{ [1, 2, 3]|join('|') }}
- *  {# returns 1|2|3 #}
- *
- *  {{ [1, 2, 3]|join }}
- *  {# returns 123 #}
- * </pre>
- *
- * @param array  $value An array
- * @param string $glue  The separator
- *
- * @return string The concatenated string
- */
-function twig_join_filter($value, $glue = '')
-{
-    if ($value instanceof Traversable) {
-        $value = iterator_to_array($value, false);
-    }
-
-    return implode($glue, (array) $value);
-}
-
-/**
- * Splits the string into an array.
- *
- * <pre>
- *  {{ "one,two,three"|split(',') }}
- *  {# returns [one, two, three] #}
- *
- *  {{ "one,two,three,four,five"|split(',', 3) }}
- *  {# returns [one, two, "three,four,five"] #}
- *
- *  {{ "123"|split('') }}
- *  {# returns [1, 2, 3] #}
- *
- *  {{ "aabbcc"|split('', 2) }}
- *  {# returns [aa, bb, cc] #}
- * </pre>
- *
- * @param string  $value     A string
- * @param string  $delimiter The delimiter
- * @param integer $limit     The limit
- *
- * @return array The split string as an array
- */
-function twig_split_filter($value, $delimiter, $limit = null)
-{
-    if (empty($delimiter)) {
-        return str_split($value, null === $limit ? 1 : $limit);
-    }
-
-    return null === $limit ? explode($delimiter, $value) : explode($delimiter, $value, $limit);
-}
-
-// The '_default' filter is used internally to avoid using the ternary operator
-// which costs a lot for big contexts (before PHP 5.4). So, on average,
-// a function call is cheaper.
-function _twig_default_filter($value, $default = '')
-{
-    if (twig_test_empty($value)) {
-        return $default;
-    }
-
-    return $value;
-}
-
-/**
- * Returns the keys for the given array.
- *
- * It is useful when you want to iterate over the keys of an array:
- *
- * <pre>
- *  {% for key in array|keys %}
- *      {# ... #}
- *  {% endfor %}
- * </pre>
- *
- * @param array $array An array
- *
- * @return array The keys
- */
-function twig_get_array_keys_filter($array)
-{
-    if (is_object($array) && $array instanceof Traversable) {
-        return array_keys(iterator_to_array($array));
-    }
-
-    if (!is_array($array)) {
-        return array();
-    }
-
-    return array_keys($array);
-}
-
-/**
- * Reverses a variable.
- *
- * @param Twig_Environment         $env          A Twig_Environment instance
- * @param array|Traversable|string $item         An array, a Traversable instance, or a string
- * @param Boolean                  $preserveKeys Whether to preserve key or not
- *
- * @return mixed The reversed input
- */
-function twig_reverse_filter(Twig_Environment $env, $item, $preserveKeys = false)
-{
-    if (is_object($item) && $item instanceof Traversable) {
-        return array_reverse(iterator_to_array($item), $preserveKeys);
-    }
-
-    if (is_array($item)) {
-        return array_reverse($item, $preserveKeys);
-    }
-
-    if (null !== $charset = $env->getCharset()) {
-        $string = (string) $item;
-
-        if ('UTF-8' != $charset) {
-            $item = twig_convert_encoding($string, 'UTF-8', $charset);
-        }
-
-        preg_match_all('/./us', $item, $matches);
-
-        $string = implode('', array_reverse($matches[0]));
-
-        if ('UTF-8' != $charset) {
-            $string = twig_convert_encoding($string, $charset, 'UTF-8');
-        }
-
-        return $string;
-    }
-
-    return strrev((string) $item);
-}
-
-/**
- * Sorts an array.
- *
- * @param array $array An array
- */
-function twig_sort_filter($array)
-{
-    asort($array);
-
-    return $array;
-}
-
-/* used internally */
-function twig_in_filter($value, $compare)
-{
-    $strict = is_object($value);
-
-    if (is_array($compare)) {
-        return in_array($value, $compare, $strict);
-    } elseif (is_string($compare)) {
-        if (!strlen((string) $value)) {
-            return empty($compare);
-        }
-
-        return false !== strpos($compare, (string) $value);
-    } elseif (is_object($compare) && $compare instanceof Traversable) {
-        return in_array($value, iterator_to_array($compare, false), $strict);
-    }
-
-    return false;
-}
-
-/**
- * Escapes a string.
- *
- * @param Twig_Environment $env        A Twig_Environment instance
- * @param string           $string     The value to be escaped
- * @param string           $strategy   The escaping strategy
- * @param string           $charset    The charset
- * @param Boolean          $autoescape Whether the function is called by the auto-escaping feature (true) or by the developer (false)
- */
-function twig_escape_filter(Twig_Environment $env, $string, $strategy = 'html', $charset = null, $autoescape = false)
-{
-    if ($autoescape && is_object($string) && $string instanceof Twig_Markup) {
-        return $string;
-    }
-
-    if (!is_string($string) && !(is_object($string) && method_exists($string, '__toString'))) {
-        return $string;
-    }
-
-    if (null === $charset) {
-        $charset = $env->getCharset();
-    }
-
-    $string = (string) $string;
-
-    switch ($strategy) {
-        case 'js':
-            // escape all non-alphanumeric characters
-            // into their \xHH or \uHHHH representations
-            if ('UTF-8' != $charset) {
-                $string = twig_convert_encoding($string, 'UTF-8', $charset);
-            }
-
-            if (0 == strlen($string) ? false : (1 == preg_match('/^./su', $string) ? false : true)) {
-                throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.');
-            }
-
-            $string = preg_replace_callback('#[^a-zA-Z0-9,\._]#Su', '_twig_escape_js_callback', $string);
-
-            if ('UTF-8' != $charset) {
-                $string = twig_convert_encoding($string, $charset, 'UTF-8');
-            }
-
-            return $string;
-
-        case 'css':
-            if ('UTF-8' != $charset) {
-                $string = twig_convert_encoding($string, 'UTF-8', $charset);
-            }
-
-            if (0 == strlen($string) ? false : (1 == preg_match('/^./su', $string) ? false : true)) {
-                throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.');
-            }
-
-            $string = preg_replace_callback('#[^a-zA-Z0-9]#Su', '_twig_escape_css_callback', $string);
-
-            if ('UTF-8' != $charset) {
-                $string = twig_convert_encoding($string, $charset, 'UTF-8');
-            }
-
-            return $string;
-
-        case 'html_attr':
-            if ('UTF-8' != $charset) {
-                $string = twig_convert_encoding($string, 'UTF-8', $charset);
-            }
-
-            if (0 == strlen($string) ? false : (1 == preg_match('/^./su', $string) ? false : true)) {
-                throw new Twig_Error_Runtime('The string to escape is not a valid UTF-8 string.');
-            }
-
-            $string = preg_replace_callback('#[^a-zA-Z0-9,\.\-_]#Su', '_twig_escape_html_attr_callback', $string);
-
-            if ('UTF-8' != $charset) {
-                $string = twig_convert_encoding($string, $charset, 'UTF-8');
-            }
-
-            return $string;
-
-        case 'html':
-            // see http://php.net/htmlspecialchars
-
-            // Using a static variable to avoid initializing the array
-            // each time the function is called. Moving the declaration on the
-            // top of the function slow downs other escaping strategies.
-            static $htmlspecialcharsCharsets = array(
-                'iso-8859-1' => true, 'iso8859-1' => true,
-                'iso-8859-15' => true, 'iso8859-15' => true,
-                'utf-8' => true,
-                'cp866' => true, 'ibm866' => true, '866' => true,
-                'cp1251' => true, 'windows-1251' => true, 'win-1251' => true,
-                '1251' => true,
-                'cp1252' => true, 'windows-1252' => true, '1252' => true,
-                'koi8-r' => true, 'koi8-ru' => true, 'koi8r' => true,
-                'big5' => true, '950' => true,
-                'gb2312' => true, '936' => true,
-                'big5-hkscs' => true,
-                'shift_jis' => true, 'sjis' => true, '932' => true,
-                'euc-jp' => true, 'eucjp' => true,
-                'iso8859-5' => true, 'iso-8859-5' => true, 'macroman' => true,
-            );
-
-            if (isset($htmlspecialcharsCharsets[strtolower($charset)])) {
-                return htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, $charset);
-            }
-
-            $string = twig_convert_encoding($string, 'UTF-8', $charset);
-            $string = htmlspecialchars($string, ENT_QUOTES | ENT_SUBSTITUTE, 'UTF-8');
-
-            return twig_convert_encoding($string, $charset, 'UTF-8');
-
-        case 'url':
-            if (version_compare(PHP_VERSION, '5.3.0', '<')) {
-                return str_replace('%7E', '~', rawurlencode($string));
-            }
-
-            return rawurlencode($string);
-
-        default:
-            throw new Twig_Error_Runtime(sprintf('Invalid escaping strategy "%s" (valid ones: html, js, url, css, and html_attr).', $strategy));
-    }
-}
-
-/* used internally */
-function twig_escape_filter_is_safe(Twig_Node $filterArgs)
-{
-    foreach ($filterArgs as $arg) {
-        if ($arg instanceof Twig_Node_Expression_Constant) {
-            return array($arg->getAttribute('value'));
-        }
-
-        return array();
-    }
-
-    return array('html');
-}
-
-if (function_exists('mb_convert_encoding')) {
-    function twig_convert_encoding($string, $to, $from)
-    {
-        return mb_convert_encoding($string, $to, $from);
-    }
-} elseif (function_exists('iconv')) {
-    function twig_convert_encoding($string, $to, $from)
-    {
-        return iconv($from, $to, $string);
-    }
-} else {
-    function twig_convert_encoding($string, $to, $from)
-    {
-        throw new Twig_Error_Runtime('No suitable convert encoding function (use UTF-8 as your encoding or install the iconv or mbstring extension).');
-    }
-}
-
-function _twig_escape_js_callback($matches)
-{
-    $char = $matches[0];
-
-    // \xHH
-    if (!isset($char[1])) {
-        return '\\x'.strtoupper(substr('00'.bin2hex($char), -2));
-    }
-
-    // \uHHHH
-    $char = twig_convert_encoding($char, 'UTF-16BE', 'UTF-8');
-
-    return '\\u'.strtoupper(substr('0000'.bin2hex($char), -4));
-}
-
-function _twig_escape_css_callback($matches)
-{
-    $char = $matches[0];
-
-    // \xHH
-    if (!isset($char[1])) {
-        $hex = ltrim(strtoupper(bin2hex($char)), '0');
-        if (0 === strlen($hex)) {
-            $hex = '0';
-        }
-
-        return '\\'.$hex.' ';
-    }
-
-    // \uHHHH
-    $char = twig_convert_encoding($char, 'UTF-16BE', 'UTF-8');
-
-    return '\\'.ltrim(strtoupper(bin2hex($char)), '0').' ';
-}
-
-/**
- * This function is adapted from code coming from Zend Framework.
- *
- * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
- * @license   http://framework.zend.com/license/new-bsd New BSD License
- */
-function _twig_escape_html_attr_callback($matches)
-{
-    /*
-     * While HTML supports far more named entities, the lowest common denominator
-     * has become HTML5's XML Serialisation which is restricted to the those named
-     * entities that XML supports. Using HTML entities would result in this error:
-     *     XML Parsing Error: undefined entity
-     */
-    static $entityMap = array(
-        34 => 'quot', /* quotation mark */
-        38 => 'amp',  /* ampersand */
-        60 => 'lt',   /* less-than sign */
-        62 => 'gt',   /* greater-than sign */
-    );
-
-    $chr = $matches[0];
-    $ord = ord($chr);
-
-    /**
-     * The following replaces characters undefined in HTML with the
-     * hex entity for the Unicode replacement character.
-     */
-    if (($ord <= 0x1f && $chr != "\t" && $chr != "\n" && $chr != "\r") || ($ord >= 0x7f && $ord <= 0x9f)) {
-        return '&#xFFFD;';
-    }
-
-    /**
-     * Check if the current character to escape has a name entity we should
-     * replace it with while grabbing the hex value of the character.
-     */
-    if (strlen($chr) == 1) {
-        $hex = strtoupper(substr('00'.bin2hex($chr), -2));
-    } else {
-        $chr = twig_convert_encoding($chr, 'UTF-16BE', 'UTF-8');
-        $hex = strtoupper(substr('0000'.bin2hex($chr), -4));
-    }
-
-    $int = hexdec($hex);
-    if (array_key_exists($int, $entityMap)) {
-        return sprintf('&%s;', $entityMap[$int]);
-    }
-
-    /**
-     * Per OWASP recommendations, we'll use hex entities for any other
-     * characters where a named entity does not exist.
-     */
-
-    return sprintf('&#x%s;', $hex);
-}
-
-// add multibyte extensions if possible
-if (function_exists('mb_get_info')) {
-    /**
-     * Returns the length of a variable.
-     *
-     * @param Twig_Environment $env   A Twig_Environment instance
-     * @param mixed            $thing A variable
-     *
-     * @return integer The length of the value
-     */
-    function twig_length_filter(Twig_Environment $env, $thing)
-    {
-        return is_scalar($thing) ? mb_strlen($thing, $env->getCharset()) : count($thing);
-    }
-
-    /**
-     * Converts a string to uppercase.
-     *
-     * @param Twig_Environment $env    A Twig_Environment instance
-     * @param string           $string A string
-     *
-     * @return string The uppercased string
-     */
-    function twig_upper_filter(Twig_Environment $env, $string)
-    {
-        if (null !== ($charset = $env->getCharset())) {
-            return mb_strtoupper($string, $charset);
-        }
-
-        return strtoupper($string);
-    }
-
-    /**
-     * Converts a string to lowercase.
-     *
-     * @param Twig_Environment $env    A Twig_Environment instance
-     * @param string           $string A string
-     *
-     * @return string The lowercased string
-     */
-    function twig_lower_filter(Twig_Environment $env, $string)
-    {
-        if (null !== ($charset = $env->getCharset())) {
-            return mb_strtolower($string, $charset);
-        }
-
-        return strtolower($string);
-    }
-
-    /**
-     * Returns a titlecased string.
-     *
-     * @param Twig_Environment $env    A Twig_Environment instance
-     * @param string           $string A string
-     *
-     * @return string The titlecased string
-     */
-    function twig_title_string_filter(Twig_Environment $env, $string)
-    {
-        if (null !== ($charset = $env->getCharset())) {
-            return mb_convert_case($string, MB_CASE_TITLE, $charset);
-        }
-
-        return ucwords(strtolower($string));
-    }
-
-    /**
-     * Returns a capitalized string.
-     *
-     * @param Twig_Environment $env    A Twig_Environment instance
-     * @param string           $string A string
-     *
-     * @return string The capitalized string
-     */
-    function twig_capitalize_string_filter(Twig_Environment $env, $string)
-    {
-        if (null !== ($charset = $env->getCharset())) {
-            return mb_strtoupper(mb_substr($string, 0, 1, $charset), $charset).
-                         mb_strtolower(mb_substr($string, 1, mb_strlen($string, $charset), $charset), $charset);
-        }
-
-        return ucfirst(strtolower($string));
-    }
-}
-// and byte fallback
-else {
-    /**
-     * Returns the length of a variable.
-     *
-     * @param Twig_Environment $env   A Twig_Environment instance
-     * @param mixed            $thing A variable
-     *
-     * @return integer The length of the value
-     */
-    function twig_length_filter(Twig_Environment $env, $thing)
-    {
-        return is_scalar($thing) ? strlen($thing) : count($thing);
-    }
-
-    /**
-     * Returns a titlecased string.
-     *
-     * @param Twig_Environment $env    A Twig_Environment instance
-     * @param string           $string A string
-     *
-     * @return string The titlecased string
-     */
-    function twig_title_string_filter(Twig_Environment $env, $string)
-    {
-        return ucwords(strtolower($string));
-    }
-
-    /**
-     * Returns a capitalized string.
-     *
-     * @param Twig_Environment $env    A Twig_Environment instance
-     * @param string           $string A string
-     *
-     * @return string The capitalized string
-     */
-    function twig_capitalize_string_filter(Twig_Environment $env, $string)
-    {
-        return ucfirst(strtolower($string));
-    }
-}
-
-/* used internally */
-function twig_ensure_traversable($seq)
-{
-    if ($seq instanceof Traversable || is_array($seq)) {
-        return $seq;
-    }
-
-    return array();
-}
-
-/**
- * Checks if a variable is empty.
- *
- * <pre>
- * {# evaluates to true if the foo variable is null, false, or the empty string #}
- * {% if foo is empty %}
- *     {# ... #}
- * {% endif %}
- * </pre>
- *
- * @param mixed $value A variable
- *
- * @return Boolean true if the value is empty, false otherwise
- */
-function twig_test_empty($value)
-{
-    if ($value instanceof Countable) {
-        return 0 == count($value);
-    }
-
-    return false === $value || (empty($value) && '0' != $value);
-}
-
-/**
- * Checks if a variable is traversable.
- *
- * <pre>
- * {# evaluates to true if the foo variable is an array or a traversable object #}
- * {% if foo is traversable %}
- *     {# ... #}
- * {% endif %}
- * </pre>
- *
- * @param mixed $value A variable
- *
- * @return Boolean true if the value is traversable
- */
-function twig_test_iterable($value)
-{
-    return $value instanceof Traversable || is_array($value);
-}
Index: nc/libs/twig/Extension/Debug.php
===================================================================
--- inc/libs/twig/Extension/Debug.php	(revision 991)
+++ 	(revision )
@@ -1,70 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Extension_Debug extends Twig_Extension
-{
-    /**
-     * Returns a list of global functions to add to the existing list.
-     *
-     * @return array An array of global functions
-     */
-    public function getFunctions()
-    {
-        // dump is safe if var_dump is overridden by xdebug
-        $isDumpOutputHtmlSafe = extension_loaded('xdebug')
-            // false means that it was not set (and the default is on) or it explicitly enabled
-            && (false === ini_get('xdebug.overload_var_dump') || ini_get('xdebug.overload_var_dump'))
-            // false means that it was not set (and the default is on) or it explicitly enabled
-            // xdebug.overload_var_dump produces HTML only when html_errors is also enabled
-            && (false === ini_get('html_errors') || ini_get('html_errors'))
-        ;
-
-        return array(
-            'dump' => new Twig_Function_Function('twig_var_dump', array('is_safe' => $isDumpOutputHtmlSafe ? array('html') : array(), 'needs_context' => true, 'needs_environment' => true)),
-        );
-    }
-
-    /**
-     * Returns the name of the extension.
-     *
-     * @return string The extension name
-     */
-    public function getName()
-    {
-        return 'debug';
-    }
-}
-
-function twig_var_dump(Twig_Environment $env, $context)
-{
-    if (!$env->isDebug()) {
-        return;
-    }
-
-    ob_start();
-
-    $count = func_num_args();
-    if (2 === $count) {
-        $vars = array();
-        foreach ($context as $key => $value) {
-            if (!$value instanceof Twig_Template) {
-                $vars[$key] = $value;
-            }
-        }
-
-        var_dump($vars);
-    } else {
-        for ($i = 2; $i < $count; $i++) {
-            var_dump(func_get_arg($i));
-        }
-    }
-
-    return ob_get_clean();
-}
Index: nc/libs/twig/Extension/Escaper.php
===================================================================
--- inc/libs/twig/Extension/Escaper.php	(revision 991)
+++ 	(revision )
@@ -1,107 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Extension_Escaper extends Twig_Extension
-{
-    protected $defaultStrategy;
-
-    public function __construct($defaultStrategy = 'html')
-    {
-        $this->setDefaultStrategy($defaultStrategy);
-    }
-
-    /**
-     * Returns the token parser instances to add to the existing list.
-     *
-     * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances
-     */
-    public function getTokenParsers()
-    {
-        return array(new Twig_TokenParser_AutoEscape());
-    }
-
-    /**
-     * Returns the node visitor instances to add to the existing list.
-     *
-     * @return array An array of Twig_NodeVisitorInterface instances
-     */
-    public function getNodeVisitors()
-    {
-        return array(new Twig_NodeVisitor_Escaper());
-    }
-
-    /**
-     * Returns a list of filters to add to the existing list.
-     *
-     * @return array An array of filters
-     */
-    public function getFilters()
-    {
-        return array(
-            'raw' => new Twig_Filter_Function('twig_raw_filter', array('is_safe' => array('all'))),
-        );
-    }
-
-    /**
-     * Sets the default strategy to use when not defined by the user.
-     *
-     * The strategy can be a valid PHP callback that takes the template
-     * "filename" as an argument and returns the strategy to use.
-     *
-     * @param mixed $defaultStrategy An escaping strategy
-     */
-    public function setDefaultStrategy($defaultStrategy)
-    {
-        // for BC
-        if (true === $defaultStrategy) {
-            $defaultStrategy = 'html';
-        }
-
-        $this->defaultStrategy = $defaultStrategy;
-    }
-
-    /**
-     * Gets the default strategy to use when not defined by the user.
-     *
-     * @param string $filename The template "filename"
-     *
-     * @return string The default strategy to use for the template
-     */
-    public function getDefaultStrategy($filename)
-    {
-        // disable string callables to avoid calling a function named html or js,
-        // or any other upcoming escaping strategy
-        if (!is_string($this->defaultStrategy) && is_callable($this->defaultStrategy)) {
-            return call_user_func($this->defaultStrategy, $filename);
-        }
-
-        return $this->defaultStrategy;
-    }
-
-    /**
-     * Returns the name of the extension.
-     *
-     * @return string The extension name
-     */
-    public function getName()
-    {
-        return 'escaper';
-    }
-}
-
-/**
- * Marks a variable as being safe.
- *
- * @param string $string A PHP variable
- */
-function twig_raw_filter($string)
-{
-    return $string;
-}
Index: nc/libs/twig/Extension/Optimizer.php
===================================================================
--- inc/libs/twig/Extension/Optimizer.php	(revision 0)
+++ 	(revision )
@@ -1,35 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Extension_Optimizer extends Twig_Extension
-{
-    protected $optimizers;
-
-    public function __construct($optimizers = -1)
-    {
-        $this->optimizers = $optimizers;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getNodeVisitors()
-    {
-        return array(new Twig_NodeVisitor_Optimizer($this->optimizers));
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getName()
-    {
-        return 'optimizer';
-    }
-}
Index: nc/libs/twig/Extension/Sandbox.php
===================================================================
--- inc/libs/twig/Extension/Sandbox.php	(revision 0)
+++ 	(revision )
@@ -1,112 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Extension_Sandbox extends Twig_Extension
-{
-    protected $sandboxedGlobally;
-    protected $sandboxed;
-    protected $policy;
-
-    public function __construct(Twig_Sandbox_SecurityPolicyInterface $policy, $sandboxed = false)
-    {
-        $this->policy            = $policy;
-        $this->sandboxedGlobally = $sandboxed;
-    }
-
-    /**
-     * Returns the token parser instances to add to the existing list.
-     *
-     * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances
-     */
-    public function getTokenParsers()
-    {
-        return array(new Twig_TokenParser_Sandbox());
-    }
-
-    /**
-     * Returns the node visitor instances to add to the existing list.
-     *
-     * @return array An array of Twig_NodeVisitorInterface instances
-     */
-    public function getNodeVisitors()
-    {
-        return array(new Twig_NodeVisitor_Sandbox());
-    }
-
-    public function enableSandbox()
-    {
-        $this->sandboxed = true;
-    }
-
-    public function disableSandbox()
-    {
-        $this->sandboxed = false;
-    }
-
-    public function isSandboxed()
-    {
-        return $this->sandboxedGlobally || $this->sandboxed;
-    }
-
-    public function isSandboxedGlobally()
-    {
-        return $this->sandboxedGlobally;
-    }
-
-    public function setSecurityPolicy(Twig_Sandbox_SecurityPolicyInterface $policy)
-    {
-        $this->policy = $policy;
-    }
-
-    public function getSecurityPolicy()
-    {
-        return $this->policy;
-    }
-
-    public function checkSecurity($tags, $filters, $functions)
-    {
-        if ($this->isSandboxed()) {
-            $this->policy->checkSecurity($tags, $filters, $functions);
-        }
-    }
-
-    public function checkMethodAllowed($obj, $method)
-    {
-        if ($this->isSandboxed()) {
-            $this->policy->checkMethodAllowed($obj, $method);
-        }
-    }
-
-    public function checkPropertyAllowed($obj, $method)
-    {
-        if ($this->isSandboxed()) {
-            $this->policy->checkPropertyAllowed($obj, $method);
-        }
-    }
-
-    public function ensureToStringAllowed($obj)
-    {
-        if (is_object($obj)) {
-            $this->policy->checkMethodAllowed($obj, '__toString');
-        }
-
-        return $obj;
-    }
-
-    /**
-     * Returns the name of the extension.
-     *
-     * @return string The extension name
-     */
-    public function getName()
-    {
-        return 'sandbox';
-    }
-}
Index: nc/libs/twig/Extension/StringLoader.php
===================================================================
--- inc/libs/twig/Extension/StringLoader.php	(revision 991)
+++ 	(revision )
@@ -1,64 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2012 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Extension_StringLoader extends Twig_Extension
-{
-    /**
-     * {@inheritdoc}
-     */
-    public function getFunctions()
-    {
-        return array(
-            'template_from_string' => new Twig_Function_Function('twig_template_from_string', array('needs_environment' => true)),
-        );
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getName()
-    {
-        return 'string_loader';
-    }
-}
-
-/**
- * Loads a template from a string.
- *
- * <pre>
- * {% include template_from_string("Hello {{ name }}") }}
- * </pre>
- *
- * @param Twig_Environment $env      A Twig_Environment instance
- * @param string           $template A template as a string
- *
- * @return Twig_Template A Twig_Template instance
- */
-function twig_template_from_string(Twig_Environment $env, $template)
-{
-    static $loader;
-
-    if (null === $loader) {
-        $loader = new Twig_Loader_String();
-    }
-
-    $current = $env->getLoader();
-    $env->setLoader($loader);
-    try {
-        $template = $env->loadTemplate($template);
-    } catch (Exception $e) {
-        $env->setLoader($current);
-
-        throw $e;
-    }
-    $env->setLoader($current);
-
-    return $template;
-}
Index: nc/libs/twig/ExtensionInterface.php
===================================================================
--- inc/libs/twig/ExtensionInterface.php	(revision 991)
+++ 	(revision )
@@ -1,84 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Interface implemented by extension classes.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-interface Twig_ExtensionInterface
-{
-    /**
-     * Initializes the runtime environment.
-     *
-     * This is where you can load some file that contains filter functions for instance.
-     *
-     * @param Twig_Environment $environment The current Twig_Environment instance
-     */
-    public function initRuntime(Twig_Environment $environment);
-
-    /**
-     * Returns the token parser instances to add to the existing list.
-     *
-     * @return array An array of Twig_TokenParserInterface or Twig_TokenParserBrokerInterface instances
-     */
-    public function getTokenParsers();
-
-    /**
-     * Returns the node visitor instances to add to the existing list.
-     *
-     * @return array An array of Twig_NodeVisitorInterface instances
-     */
-    public function getNodeVisitors();
-
-    /**
-     * Returns a list of filters to add to the existing list.
-     *
-     * @return array An array of filters
-     */
-    public function getFilters();
-
-    /**
-     * Returns a list of tests to add to the existing list.
-     *
-     * @return array An array of tests
-     */
-    public function getTests();
-
-    /**
-     * Returns a list of functions to add to the existing list.
-     *
-     * @return array An array of functions
-     */
-    public function getFunctions();
-
-    /**
-     * Returns a list of operators to add to the existing list.
-     *
-     * @return array An array of operators
-     */
-    public function getOperators();
-
-    /**
-     * Returns a list of global variables to add to the existing list.
-     *
-     * @return array An array of global variables
-     */
-    public function getGlobals();
-
-    /**
-     * Returns the name of the extension.
-     *
-     * @return string The extension name
-     */
-    public function getName();
-}
Index: nc/libs/twig/Filter.php
===================================================================
--- inc/libs/twig/Filter.php	(revision 991)
+++ 	(revision )
@@ -1,75 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a template filter.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-abstract class Twig_Filter implements Twig_FilterInterface
-{
-    protected $options;
-    protected $arguments = array();
-
-    public function __construct(array $options = array())
-    {
-        $this->options = array_merge(array(
-            'needs_environment' => false,
-            'needs_context'     => false,
-            'pre_escape'        => null,
-            'preserves_safety'  => null,
-        ), $options);
-    }
-
-    public function setArguments($arguments)
-    {
-        $this->arguments = $arguments;
-    }
-
-    public function getArguments()
-    {
-        return $this->arguments;
-    }
-
-    public function needsEnvironment()
-    {
-        return $this->options['needs_environment'];
-    }
-
-    public function needsContext()
-    {
-        return $this->options['needs_context'];
-    }
-
-    public function getSafe(Twig_Node $filterArgs)
-    {
-        if (isset($this->options['is_safe'])) {
-            return $this->options['is_safe'];
-        }
-
-        if (isset($this->options['is_safe_callback'])) {
-            return call_user_func($this->options['is_safe_callback'], $filterArgs);
-        }
-
-        return null;
-    }
-
-    public function getPreservesSafety()
-    {
-        return $this->options['preserves_safety'];
-    }
-
-    public function getPreEscape()
-    {
-        return $this->options['pre_escape'];
-    }
-}
Index: nc/libs/twig/Filter/Function.php
===================================================================
--- inc/libs/twig/Filter/Function.php	(revision 991)
+++ 	(revision )
@@ -1,33 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a function template filter.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Filter_Function extends Twig_Filter
-{
-    protected $function;
-
-    public function __construct($function, array $options = array())
-    {
-        parent::__construct($options);
-
-        $this->function = $function;
-    }
-
-    public function compile()
-    {
-        return $this->function;
-    }
-}
Index: nc/libs/twig/Filter/Method.php
===================================================================
--- inc/libs/twig/Filter/Method.php	(revision 991)
+++ 	(revision )
@@ -1,35 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a method template filter.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Filter_Method extends Twig_Filter
-{
-    protected $extension;
-    protected $method;
-
-    public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array())
-    {
-        parent::__construct($options);
-
-        $this->extension = $extension;
-        $this->method = $method;
-    }
-
-    public function compile()
-    {
-        return sprintf('$this->env->getExtension(\'%s\')->%s', $this->extension->getName(), $this->method);
-    }
-}
Index: nc/libs/twig/Filter/Node.php
===================================================================
--- inc/libs/twig/Filter/Node.php	(revision 991)
+++ 	(revision )
@@ -1,37 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a template filter as a node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Filter_Node extends Twig_Filter
-{
-    protected $class;
-
-    public function __construct($class, array $options = array())
-    {
-        parent::__construct($options);
-
-        $this->class = $class;
-    }
-
-    public function getClass()
-    {
-        return $this->class;
-    }
-
-    public function compile()
-    {
-    }
-}
Index: nc/libs/twig/FilterInterface.php
===================================================================
--- inc/libs/twig/FilterInterface.php	(revision 991)
+++ 	(revision )
@@ -1,40 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a template filter.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-interface Twig_FilterInterface
-{
-    /**
-     * Compiles a filter.
-     *
-     * @return string The PHP code for the filter
-     */
-    public function compile();
-
-    public function needsEnvironment();
-
-    public function needsContext();
-
-    public function getSafe(Twig_Node $filterArgs);
-
-    public function getPreservesSafety();
-
-    public function getPreEscape();
-
-    public function setArguments($arguments);
-
-    public function getArguments();
-}
Index: nc/libs/twig/Function.php
===================================================================
--- inc/libs/twig/Function.php	(revision 991)
+++ 	(revision )
@@ -1,63 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a template function.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-abstract class Twig_Function implements Twig_FunctionInterface
-{
-    protected $options;
-    protected $arguments = array();
-
-    public function __construct(array $options = array())
-    {
-        $this->options = array_merge(array(
-            'needs_environment' => false,
-            'needs_context'     => false,
-        ), $options);
-    }
-
-    public function setArguments($arguments)
-    {
-        $this->arguments = $arguments;
-    }
-
-    public function getArguments()
-    {
-        return $this->arguments;
-    }
-
-    public function needsEnvironment()
-    {
-        return $this->options['needs_environment'];
-    }
-
-    public function needsContext()
-    {
-        return $this->options['needs_context'];
-    }
-
-    public function getSafe(Twig_Node $functionArgs)
-    {
-        if (isset($this->options['is_safe'])) {
-            return $this->options['is_safe'];
-        }
-
-        if (isset($this->options['is_safe_callback'])) {
-            return call_user_func($this->options['is_safe_callback'], $functionArgs);
-        }
-
-        return array();
-    }
-}
Index: nc/libs/twig/Function/Function.php
===================================================================
--- inc/libs/twig/Function/Function.php	(revision 0)
+++ 	(revision )
@@ -1,34 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2010 Arnaud Le Blanc
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a function template function.
- *
- * @package    twig
- * @author     Arnaud Le Blanc <arnaud.lb@gmail.com>
- */
-class Twig_Function_Function extends Twig_Function
-{
-    protected $function;
-
-    public function __construct($function, array $options = array())
-    {
-        parent::__construct($options);
-
-        $this->function = $function;
-    }
-
-    public function compile()
-    {
-        return $this->function;
-    }
-}
Index: nc/libs/twig/Function/Method.php
===================================================================
--- inc/libs/twig/Function/Method.php	(revision 991)
+++ 	(revision )
@@ -1,36 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2010 Arnaud Le Blanc
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a method template function.
- *
- * @package    twig
- * @author     Arnaud Le Blanc <arnaud.lb@gmail.com>
- */
-class Twig_Function_Method extends Twig_Function
-{
-    protected $extension;
-    protected $method;
-
-    public function __construct(Twig_ExtensionInterface $extension, $method, array $options = array())
-    {
-        parent::__construct($options);
-
-        $this->extension = $extension;
-        $this->method = $method;
-    }
-
-    public function compile()
-    {
-        return sprintf('$this->env->getExtension(\'%s\')->%s', $this->extension->getName(), $this->method);
-    }
-}
Index: nc/libs/twig/Function/Node.php
===================================================================
--- inc/libs/twig/Function/Node.php	(revision 991)
+++ 	(revision )
@@ -1,37 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a template function as a node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Function_Node extends Twig_Function
-{
-    protected $class;
-
-    public function __construct($class, array $options = array())
-    {
-        parent::__construct($options);
-
-        $this->class = $class;
-    }
-
-    public function getClass()
-    {
-        return $this->class;
-    }
-
-    public function compile()
-    {
-    }
-}
Index: nc/libs/twig/FunctionInterface.php
===================================================================
--- inc/libs/twig/FunctionInterface.php	(revision 991)
+++ 	(revision )
@@ -1,37 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- * (c) 2010 Arnaud Le Blanc
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a template function.
- *
- * @package    twig
- * @author     Arnaud Le Blanc <arnaud.lb@gmail.com>
- */
-interface Twig_FunctionInterface
-{
-    /**
-     * Compiles a function.
-     *
-     * @return string The PHP code for the function
-     */
-    public function compile();
-
-    public function needsEnvironment();
-
-    public function needsContext();
-
-    public function getSafe(Twig_Node $filterArgs);
-
-    public function setArguments($arguments);
-
-    public function getArguments();
-}
Index: nc/libs/twig/LICENSE
===================================================================
--- inc/libs/twig/LICENSE	(revision 0)
+++ 	(revision )
@@ -1,31 +1,0 @@
-Copyright (c) 2009 by the Twig Team, see AUTHORS for more details.
-
-Some rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
-    * Redistributions of source code must retain the above copyright
-      notice, this list of conditions and the following disclaimer.
-
-    * Redistributions in binary form must reproduce the above
-      copyright notice, this list of conditions and the following
-      disclaimer in the documentation and/or other materials provided
-      with the distribution.
-
-    * The names of the contributors may not be used to endorse or
-      promote products derived from this software without specific
-      prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Index: nc/libs/twig/Lexer.php
===================================================================
--- inc/libs/twig/Lexer.php	(revision 991)
+++ 	(revision )
@@ -1,406 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Lexes a template string.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Lexer implements Twig_LexerInterface
-{
-    protected $tokens;
-    protected $code;
-    protected $cursor;
-    protected $lineno;
-    protected $end;
-    protected $state;
-    protected $states;
-    protected $brackets;
-    protected $env;
-    protected $filename;
-    protected $options;
-    protected $regexes;
-    protected $position;
-    protected $positions;
-
-    const STATE_DATA            = 0;
-    const STATE_BLOCK           = 1;
-    const STATE_VAR             = 2;
-    const STATE_STRING          = 3;
-    const STATE_INTERPOLATION   = 4;
-
-    const REGEX_NAME            = '/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/A';
-    const REGEX_NUMBER          = '/[0-9]+(?:\.[0-9]+)?/A';
-    const REGEX_STRING          = '/"([^#"\\\\]*(?:\\\\.[^#"\\\\]*)*)"|\'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\'/As';
-    const REGEX_DQ_STRING_DELIM = '/"/A';
-    const REGEX_DQ_STRING_PART  = '/[^#"\\\\]*(?:(?:\\\\.|#(?!\{))[^#"\\\\]*)*/As';
-    const PUNCTUATION           = '()[]{}?:.,|';
-
-    public function __construct(Twig_Environment $env, array $options = array())
-    {
-        $this->env = $env;
-
-        $this->options = array_merge(array(
-            'tag_comment'     => array('{#', '#}'),
-            'tag_block'       => array('{%', '%}'),
-            'tag_variable'    => array('{{', '}}'),
-            'whitespace_trim' => '-',
-            'interpolation'   => array('#{', '}'),
-        ), $options);
-
-        $this->regexes = array(
-            'lex_var'             => '/\s*'.preg_quote($this->options['whitespace_trim'].$this->options['tag_variable'][1], '/').'\s*|\s*'.preg_quote($this->options['tag_variable'][1], '/').'/A',
-            'lex_block'           => '/\s*(?:'.preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '/').'\s*|\s*'.preg_quote($this->options['tag_block'][1], '/').')\n?/A',
-            'lex_raw_data'        => '/('.preg_quote($this->options['tag_block'][0].$this->options['whitespace_trim'], '/').'|'.preg_quote($this->options['tag_block'][0], '/').')\s*endraw\s*(?:'.preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '/').'\s*|\s*'.preg_quote($this->options['tag_block'][1], '/').')/s',
-            'operator'            => $this->getOperatorRegex(),
-            'lex_comment'         => '/(?:'.preg_quote($this->options['whitespace_trim'], '/').preg_quote($this->options['tag_comment'][1], '/').'\s*|'.preg_quote($this->options['tag_comment'][1], '/').')\n?/s',
-            'lex_block_raw'       => '/\s*raw\s*(?:'.preg_quote($this->options['whitespace_trim'].$this->options['tag_block'][1], '/').'\s*|\s*'.preg_quote($this->options['tag_block'][1], '/').')/As',
-            'lex_block_line'      => '/\s*line\s+(\d+)\s*'.preg_quote($this->options['tag_block'][1], '/').'/As',
-            'lex_tokens_start'    => '/('.preg_quote($this->options['tag_variable'][0], '/').'|'.preg_quote($this->options['tag_block'][0], '/').'|'.preg_quote($this->options['tag_comment'][0], '/').')('.preg_quote($this->options['whitespace_trim'], '/').')?/s',
-            'interpolation_start' => '/'.preg_quote($this->options['interpolation'][0], '/').'\s*/A',
-            'interpolation_end'   => '/\s*'.preg_quote($this->options['interpolation'][1], '/').'/A',
-        );
-    }
-
-    /**
-     * Tokenizes a source code.
-     *
-     * @param string $code     The source code
-     * @param string $filename A unique identifier for the source code
-     *
-     * @return Twig_TokenStream A token stream instance
-     */
-    public function tokenize($code, $filename = null)
-    {
-        if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) {
-            $mbEncoding = mb_internal_encoding();
-            mb_internal_encoding('ASCII');
-        }
-
-        $this->code = str_replace(array("\r\n", "\r"), "\n", $code);
-        $this->filename = $filename;
-        $this->cursor = 0;
-        $this->lineno = 1;
-        $this->end = strlen($this->code);
-        $this->tokens = array();
-        $this->state = self::STATE_DATA;
-        $this->states = array();
-        $this->brackets = array();
-        $this->position = -1;
-
-        // find all token starts in one go
-        preg_match_all($this->regexes['lex_tokens_start'], $this->code, $matches, PREG_OFFSET_CAPTURE);
-        $this->positions = $matches;
-
-        while ($this->cursor < $this->end) {
-            // dispatch to the lexing functions depending
-            // on the current state
-            switch ($this->state) {
-                case self::STATE_DATA:
-                    $this->lexData();
-                    break;
-
-                case self::STATE_BLOCK:
-                    $this->lexBlock();
-                    break;
-
-                case self::STATE_VAR:
-                    $this->lexVar();
-                    break;
-
-                case self::STATE_STRING:
-                    $this->lexString();
-                    break;
-
-                case self::STATE_INTERPOLATION:
-                    $this->lexInterpolation();
-                    break;
-            }
-        }
-
-        $this->pushToken(Twig_Token::EOF_TYPE);
-
-        if (!empty($this->brackets)) {
-            list($expect, $lineno) = array_pop($this->brackets);
-            throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $expect), $lineno, $this->filename);
-        }
-
-        if (isset($mbEncoding)) {
-            mb_internal_encoding($mbEncoding);
-        }
-
-        return new Twig_TokenStream($this->tokens, $this->filename);
-    }
-
-    protected function lexData()
-    {
-        // if no matches are left we return the rest of the template as simple text token
-        if ($this->position == count($this->positions[0]) - 1) {
-            $this->pushToken(Twig_Token::TEXT_TYPE, substr($this->code, $this->cursor));
-            $this->cursor = $this->end;
-
-            return;
-        }
-
-        // Find the first token after the current cursor
-        $position = $this->positions[0][++$this->position];
-        while ($position[1] < $this->cursor) {
-            if ($this->position == count($this->positions[0]) - 1) {
-                return;
-            }
-            $position = $this->positions[0][++$this->position];
-        }
-
-        // push the template text first
-        $text = $textContent = substr($this->code, $this->cursor, $position[1] - $this->cursor);
-        if (isset($this->positions[2][$this->position][0])) {
-            $text = rtrim($text);
-        }
-        $this->pushToken(Twig_Token::TEXT_TYPE, $text);
-        $this->moveCursor($textContent.$position[0]);
-
-        switch ($this->positions[1][$this->position][0]) {
-            case $this->options['tag_comment'][0]:
-                $this->lexComment();
-                break;
-
-            case $this->options['tag_block'][0]:
-                // raw data?
-                if (preg_match($this->regexes['lex_block_raw'], $this->code, $match, null, $this->cursor)) {
-                    $this->moveCursor($match[0]);
-                    $this->lexRawData();
-                // {% line \d+ %}
-                } elseif (preg_match($this->regexes['lex_block_line'], $this->code, $match, null, $this->cursor)) {
-                    $this->moveCursor($match[0]);
-                    $this->lineno = (int) $match[1];
-                } else {
-                    $this->pushToken(Twig_Token::BLOCK_START_TYPE);
-                    $this->pushState(self::STATE_BLOCK);
-                }
-                break;
-
-            case $this->options['tag_variable'][0]:
-                $this->pushToken(Twig_Token::VAR_START_TYPE);
-                $this->pushState(self::STATE_VAR);
-                break;
-        }
-    }
-
-    protected function lexBlock()
-    {
-        if (empty($this->brackets) && preg_match($this->regexes['lex_block'], $this->code, $match, null, $this->cursor)) {
-            $this->pushToken(Twig_Token::BLOCK_END_TYPE);
-            $this->moveCursor($match[0]);
-            $this->popState();
-        } else {
-            $this->lexExpression();
-        }
-    }
-
-    protected function lexVar()
-    {
-        if (empty($this->brackets) && preg_match($this->regexes['lex_var'], $this->code, $match, null, $this->cursor)) {
-            $this->pushToken(Twig_Token::VAR_END_TYPE);
-            $this->moveCursor($match[0]);
-            $this->popState();
-        } else {
-            $this->lexExpression();
-        }
-    }
-
-    protected function lexExpression()
-    {
-        // whitespace
-        if (preg_match('/\s+/A', $this->code, $match, null, $this->cursor)) {
-            $this->moveCursor($match[0]);
-
-            if ($this->cursor >= $this->end) {
-                throw new Twig_Error_Syntax(sprintf('Unexpected end of file: Unclosed "%s"', $this->state === self::STATE_BLOCK ? 'block' : 'variable'), $this->lineno, $this->filename);
-            }
-        }
-
-        // operators
-        if (preg_match($this->regexes['operator'], $this->code, $match, null, $this->cursor)) {
-            $this->pushToken(Twig_Token::OPERATOR_TYPE, $match[0]);
-            $this->moveCursor($match[0]);
-        }
-        // names
-        elseif (preg_match(self::REGEX_NAME, $this->code, $match, null, $this->cursor)) {
-            $this->pushToken(Twig_Token::NAME_TYPE, $match[0]);
-            $this->moveCursor($match[0]);
-        }
-        // numbers
-        elseif (preg_match(self::REGEX_NUMBER, $this->code, $match, null, $this->cursor)) {
-            $number = (float) $match[0];  // floats
-            if (ctype_digit($match[0]) && $number <= PHP_INT_MAX) {
-                $number = (int) $match[0]; // integers lower than the maximum
-            }
-            $this->pushToken(Twig_Token::NUMBER_TYPE, $number);
-            $this->moveCursor($match[0]);
-        }
-        // punctuation
-        elseif (false !== strpos(self::PUNCTUATION, $this->code[$this->cursor])) {
-            // opening bracket
-            if (false !== strpos('([{', $this->code[$this->cursor])) {
-                $this->brackets[] = array($this->code[$this->cursor], $this->lineno);
-            }
-            // closing bracket
-            elseif (false !== strpos(')]}', $this->code[$this->cursor])) {
-                if (empty($this->brackets)) {
-                    throw new Twig_Error_Syntax(sprintf('Unexpected "%s"', $this->code[$this->cursor]), $this->lineno, $this->filename);
-                }
-
-                list($expect, $lineno) = array_pop($this->brackets);
-                if ($this->code[$this->cursor] != strtr($expect, '([{', ')]}')) {
-                    throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $expect), $lineno, $this->filename);
-                }
-            }
-
-            $this->pushToken(Twig_Token::PUNCTUATION_TYPE, $this->code[$this->cursor]);
-            ++$this->cursor;
-        }
-        // strings
-        elseif (preg_match(self::REGEX_STRING, $this->code, $match, null, $this->cursor)) {
-            $this->pushToken(Twig_Token::STRING_TYPE, stripcslashes(substr($match[0], 1, -1)));
-            $this->moveCursor($match[0]);
-        }
-        // opening double quoted string
-        elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) {
-            $this->brackets[] = array('"', $this->lineno);
-            $this->pushState(self::STATE_STRING);
-            $this->moveCursor($match[0]);
-        }
-        // unlexable
-        else {
-            throw new Twig_Error_Syntax(sprintf('Unexpected character "%s"', $this->code[$this->cursor]), $this->lineno, $this->filename);
-        }
-    }
-
-    protected function lexRawData()
-    {
-        if (!preg_match($this->regexes['lex_raw_data'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) {
-            throw new Twig_Error_Syntax(sprintf('Unexpected end of file: Unclosed "block"'), $this->lineno, $this->filename);
-        }
-
-        $text = substr($this->code, $this->cursor, $match[0][1] - $this->cursor);
-        $this->moveCursor($text.$match[0][0]);
-
-        if (false !== strpos($match[1][0], $this->options['whitespace_trim'])) {
-            $text = rtrim($text);
-        }
-
-        $this->pushToken(Twig_Token::TEXT_TYPE, $text);
-    }
-
-    protected function lexComment()
-    {
-        if (!preg_match($this->regexes['lex_comment'], $this->code, $match, PREG_OFFSET_CAPTURE, $this->cursor)) {
-            throw new Twig_Error_Syntax('Unclosed comment', $this->lineno, $this->filename);
-        }
-
-        $this->moveCursor(substr($this->code, $this->cursor, $match[0][1] - $this->cursor).$match[0][0]);
-    }
-
-    protected function lexString()
-    {
-        if (preg_match($this->regexes['interpolation_start'], $this->code, $match, null, $this->cursor)) {
-            $this->brackets[] = array($this->options['interpolation'][0], $this->lineno);
-            $this->pushToken(Twig_Token::INTERPOLATION_START_TYPE);
-            $this->moveCursor($match[0]);
-            $this->pushState(self::STATE_INTERPOLATION);
-
-        } elseif (preg_match(self::REGEX_DQ_STRING_PART, $this->code, $match, null, $this->cursor) && strlen($match[0]) > 0) {
-            $this->pushToken(Twig_Token::STRING_TYPE, stripcslashes($match[0]));
-            $this->moveCursor($match[0]);
-
-        } elseif (preg_match(self::REGEX_DQ_STRING_DELIM, $this->code, $match, null, $this->cursor)) {
-
-            list($expect, $lineno) = array_pop($this->brackets);
-            if ($this->code[$this->cursor] != '"') {
-                throw new Twig_Error_Syntax(sprintf('Unclosed "%s"', $expect), $lineno, $this->filename);
-            }
-
-            $this->popState();
-            ++$this->cursor;
-        }
-    }
-
-    protected function lexInterpolation()
-    {
-        $bracket = end($this->brackets);
-        if ($this->options['interpolation'][0] === $bracket[0] && preg_match($this->regexes['interpolation_end'], $this->code, $match, null, $this->cursor)) {
-            array_pop($this->brackets);
-            $this->pushToken(Twig_Token::INTERPOLATION_END_TYPE);
-            $this->moveCursor($match[0]);
-            $this->popState();
-        } else {
-            $this->lexExpression();
-        }
-    }
-
-    protected function pushToken($type, $value = '')
-    {
-        // do not push empty text tokens
-        if (Twig_Token::TEXT_TYPE === $type && '' === $value) {
-            return;
-        }
-
-        $this->tokens[] = new Twig_Token($type, $value, $this->lineno);
-    }
-
-    protected function moveCursor($text)
-    {
-        $this->cursor += strlen($text);
-        $this->lineno += substr_count($text, "\n");
-    }
-
-    protected function getOperatorRegex()
-    {
-        $operators = array_merge(
-            array('='),
-            array_keys($this->env->getUnaryOperators()),
-            array_keys($this->env->getBinaryOperators())
-        );
-
-        $operators = array_combine($operators, array_map('strlen', $operators));
-        arsort($operators);
-
-        $regex = array();
-        foreach ($operators as $operator => $length) {
-            // an operator that ends with a character must be followed by
-            // a whitespace or a parenthesis
-            if (ctype_alpha($operator[$length - 1])) {
-                $regex[] = preg_quote($operator, '/').'(?=[\s()])';
-            } else {
-                $regex[] = preg_quote($operator, '/');
-            }
-        }
-
-        return '/'.implode('|', $regex).'/A';
-    }
-
-    protected function pushState($state)
-    {
-        $this->states[] = $this->state;
-        $this->state = $state;
-    }
-
-    protected function popState()
-    {
-        if (0 === count($this->states)) {
-            throw new Exception('Cannot pop state without a previous state');
-        }
-
-        $this->state = array_pop($this->states);
-    }
-}
Index: nc/libs/twig/LexerInterface.php
===================================================================
--- inc/libs/twig/LexerInterface.php	(revision 991)
+++ 	(revision )
@@ -1,29 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Interface implemented by lexer classes.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-interface Twig_LexerInterface
-{
-    /**
-     * Tokenizes a source code.
-     *
-     * @param string $code     The source code
-     * @param string $filename A unique identifier for the source code
-     *
-     * @return Twig_TokenStream A token stream instance
-     */
-    public function tokenize($code, $filename = null);
-}
Index: nc/libs/twig/Loader/Array.php
===================================================================
--- inc/libs/twig/Loader/Array.php	(revision 991)
+++ 	(revision )
@@ -1,99 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Loads a template from an array.
- *
- * When using this loader with a cache mechanism, you should know that a new cache
- * key is generated each time a template content "changes" (the cache key being the
- * source code of the template). If you don't want to see your cache grows out of
- * control, you need to take care of clearing the old cache file by yourself.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Loader_Array implements Twig_LoaderInterface, Twig_ExistsLoaderInterface
-{
-    protected $templates;
-
-    /**
-     * Constructor.
-     *
-     * @param array $templates An array of templates (keys are the names, and values are the source code)
-     *
-     * @see Twig_Loader
-     */
-    public function __construct(array $templates)
-    {
-        $this->templates = array();
-        foreach ($templates as $name => $template) {
-            $this->templates[$name] = $template;
-        }
-    }
-
-    /**
-     * Adds or overrides a template.
-     *
-     * @param string $name     The template name
-     * @param string $template The template source
-     */
-    public function setTemplate($name, $template)
-    {
-        $this->templates[(string) $name] = $template;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getSource($name)
-    {
-        $name = (string) $name;
-        if (!isset($this->templates[$name])) {
-            throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name));
-        }
-
-        return $this->templates[$name];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function exists($name)
-    {
-        return isset($this->templates[(string) $name]);
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getCacheKey($name)
-    {
-        $name = (string) $name;
-        if (!isset($this->templates[$name])) {
-            throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name));
-        }
-
-        return $this->templates[$name];
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function isFresh($name, $time)
-    {
-        $name = (string) $name;
-        if (!isset($this->templates[$name])) {
-            throw new Twig_Error_Loader(sprintf('Template "%s" is not defined.', $name));
-        }
-
-        return true;
-    }
-}
Index: nc/libs/twig/Loader/Chain.php
===================================================================
--- inc/libs/twig/Loader/Chain.php	(revision 991)
+++ 	(revision )
@@ -1,136 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Loads templates from other loaders.
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Loader_Chain implements Twig_LoaderInterface, Twig_ExistsLoaderInterface
-{
-    private $hasSourceCache = array();
-    protected $loaders;
-
-    /**
-     * Constructor.
-     *
-     * @param Twig_LoaderInterface[] $loaders An array of loader instances
-     */
-    public function __construct(array $loaders = array())
-    {
-        $this->loaders = array();
-        foreach ($loaders as $loader) {
-            $this->addLoader($loader);
-        }
-    }
-
-    /**
-     * Adds a loader instance.
-     *
-     * @param Twig_LoaderInterface $loader A Loader instance
-     */
-    public function addLoader(Twig_LoaderInterface $loader)
-    {
-        $this->loaders[] = $loader;
-        $this->hasSourceCache = array();
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getSource($name)
-    {
-        $exceptions = array();
-        foreach ($this->loaders as $loader) {
-            if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) {
-                continue;
-            }
-
-            try {
-                return $loader->getSource($name);
-            } catch (Twig_Error_Loader $e) {
-                $exceptions[] = $e->getMessage();
-            }
-        }
-
-        throw new Twig_Error_Loader(sprintf('Template "%s" is not defined (%s).', $name, implode(', ', $exceptions)));
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function exists($name)
-    {
-        $name = (string) $name;
-
-        if (isset($this->hasSourceCache[$name])) {
-            return $this->hasSourceCache[$name];
-        }
-
-        foreach ($this->loaders as $loader) {
-            if ($loader instanceof Twig_ExistsLoaderInterface && $loader->exists($name)) {
-                return $this->hasSourceCache[$name] = true;
-            }
-
-            try {
-                $loader->getSource($name);
-
-                return $this->hasSourceCache[$name] = true;
-            } catch (Twig_Error_Loader $e) {
-            }
-        }
-
-        return $this->hasSourceCache[$name] = false;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getCacheKey($name)
-    {
-        $exceptions = array();
-        foreach ($this->loaders as $loader) {
-            if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) {
-                continue;
-            }
-
-            try {
-                return $loader->getCacheKey($name);
-            } catch (Twig_Error_Loader $e) {
-                $exceptions[] = get_class($loader).': '.$e->getMessage();
-            }
-        }
-
-        throw new Twig_Error_Loader(sprintf('Template "%s" is not defined (%s).', $name, implode(' ', $exceptions)));
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function isFresh($name, $time)
-    {
-        $exceptions = array();
-        foreach ($this->loaders as $loader) {
-            if ($loader instanceof Twig_ExistsLoaderInterface && !$loader->exists($name)) {
-                continue;
-            }
-
-            try {
-                return $loader->isFresh($name, $time);
-            } catch (Twig_Error_Loader $e) {
-                $exceptions[] = get_class($loader).': '.$e->getMessage();
-            }
-        }
-
-        throw new Twig_Error_Loader(sprintf('Template "%s" is not defined (%s).', $name, implode(' ', $exceptions)));
-    }
-}
Index: nc/libs/twig/Loader/Filesystem.php
===================================================================
--- inc/libs/twig/Loader/Filesystem.php	(revision 991)
+++ 	(revision )
@@ -1,221 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Loads template from the filesystem.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Loader_Filesystem implements Twig_LoaderInterface, Twig_ExistsLoaderInterface
-{
-    protected $paths;
-    protected $cache;
-
-    /**
-     * Constructor.
-     *
-     * @param string|array $paths A path or an array of paths where to look for templates
-     */
-    public function __construct($paths)
-    {
-        $this->setPaths($paths);
-    }
-
-    /**
-     * Returns the paths to the templates.
-     *
-     * @param string $namespace A path namespace
-     *
-     * @return array The array of paths where to look for templates
-     */
-    public function getPaths($namespace = '__main__')
-    {
-        return isset($this->paths[$namespace]) ? $this->paths[$namespace] : array();
-    }
-
-    /**
-     * Returns the path namespaces.
-     *
-     * The "__main__" namespace is always defined.
-     *
-     * @return array The array of defined namespaces
-     */
-    public function getNamespaces()
-    {
-        return array_keys($this->paths);
-    }
-
-    /**
-     * Sets the paths where templates are stored.
-     *
-     * @param string|array $paths     A path or an array of paths where to look for templates
-     * @param string       $namespace A path namespace
-     */
-    public function setPaths($paths, $namespace = '__main__')
-    {
-        if (!is_array($paths)) {
-            $paths = array($paths);
-        }
-
-        $this->paths[$namespace] = array();
-        foreach ($paths as $path) {
-            $this->addPath($path, $namespace);
-        }
-    }
-
-    /**
-     * Adds a path where templates are stored.
-     *
-     * @param string $path      A path where to look for templates
-     * @param string $namespace A path name
-     *
-     * @throws Twig_Error_Loader
-     */
-    public function addPath($path, $namespace = '__main__')
-    {
-        // invalidate the cache
-        $this->cache = array();
-
-        if (!is_dir($path)) {
-            throw new Twig_Error_Loader(sprintf('The "%s" directory does not exist.', $path));
-        }
-
-        $this->paths[$namespace][] = rtrim($path, '/\\');
-    }
-
-    /**
-     * Prepends a path where templates are stored.
-     *
-     * @param string $path      A path where to look for templates
-     * @param string $namespace A path name
-     *
-     * @throws Twig_Error_Loader
-     */
-    public function prependPath($path, $namespace = '__main__')
-    {
-        // invalidate the cache
-        $this->cache = array();
-
-        if (!is_dir($path)) {
-            throw new Twig_Error_Loader(sprintf('The "%s" directory does not exist.', $path));
-        }
-
-        $path = rtrim($path, '/\\');
-
-        if (!isset($this->paths[$namespace])) {
-            $this->paths[$namespace][] = $path;
-        } else {
-            array_unshift($this->paths[$namespace], $path);
-        }
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getSource($name)
-    {
-        return file_get_contents($this->findTemplate($name));
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getCacheKey($name)
-    {
-        return $this->findTemplate($name);
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function exists($name)
-    {
-        $name = (string) $name;
-        if (isset($this->cache[$name])) {
-            return true;
-        }
-
-        try {
-            $this->findTemplate($name);
-
-            return true;
-        } catch (Twig_Error_Loader $exception) {
-            return false;
-        }
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function isFresh($name, $time)
-    {
-        return filemtime($this->findTemplate($name)) <= $time;
-    }
-
-    protected function findTemplate($name)
-    {
-        $name = (string) $name;
-
-        // normalize name
-        $name = preg_replace('#/{2,}#', '/', strtr($name, '\\', '/'));
-
-        if (isset($this->cache[$name])) {
-            return $this->cache[$name];
-        }
-
-        $this->validateName($name);
-
-        $namespace = '__main__';
-        if (isset($name[0]) && '@' == $name[0]) {
-            if (false === $pos = strpos($name, '/')) {
-                throw new Twig_Error_Loader(sprintf('Malformed namespaced template name "%s" (expecting "@namespace/template_name").', $name));
-            }
-
-            $namespace = substr($name, 1, $pos - 1);
-
-            $name = substr($name, $pos + 1);
-        }
-
-        if (!isset($this->paths[$namespace])) {
-            throw new Twig_Error_Loader(sprintf('There are no registered paths for namespace "%s".', $namespace));
-        }
-
-        foreach ($this->paths[$namespace] as $path) {
-            if (is_file($path.'/'.$name)) {
-                return $this->cache[$name] = $path.'/'.$name;
-            }
-        }
-
-        throw new Twig_Error_Loader(sprintf('Unable to find template "%s" (looked into: %s).', $name, implode(', ', $this->paths[$namespace])));
-    }
-
-    protected function validateName($name)
-    {
-        if (false !== strpos($name, "\0")) {
-            throw new Twig_Error_Loader('A template name cannot contain NUL bytes.');
-        }
-
-        $parts = explode('/', $name);
-        $level = 0;
-        foreach ($parts as $part) {
-            if ('..' === $part) {
-                --$level;
-            } elseif ('.' !== $part) {
-                ++$level;
-            }
-
-            if ($level < 0) {
-                throw new Twig_Error_Loader(sprintf('Looks like you try to load a template outside configured directories (%s).', $name));
-            }
-        }
-    }
-}
Index: nc/libs/twig/Loader/String.php
===================================================================
--- inc/libs/twig/Loader/String.php	(revision 991)
+++ 	(revision )
@@ -1,60 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Loads a template from a string.
- *
- * This loader should only be used for unit testing as it has many limitations
- * (for instance, the include or extends tag does not make any sense for a string
- * loader).
- *
- * When using this loader with a cache mechanism, you should know that a new cache
- * key is generated each time a template content "changes" (the cache key being the
- * source code of the template). If you don't want to see your cache grows out of
- * control, you need to take care of clearing the old cache file by yourself.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Loader_String implements Twig_LoaderInterface, Twig_ExistsLoaderInterface
-{
-    /**
-     * {@inheritdoc}
-     */
-    public function getSource($name)
-    {
-        return $name;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function exists($name)
-    {
-        return true;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getCacheKey($name)
-    {
-        return $name;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function isFresh($name, $time)
-    {
-        return true;
-    }
-}
Index: nc/libs/twig/LoaderInterface.php
===================================================================
--- inc/libs/twig/LoaderInterface.php	(revision 991)
+++ 	(revision )
@@ -1,53 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Interface all loaders must implement.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-interface Twig_LoaderInterface
-{
-    /**
-     * Gets the source code of a template, given its name.
-     *
-     * @param string $name The name of the template to load
-     *
-     * @return string The template source code
-     *
-     * @throws Twig_Error_Loader When $name is not found
-     */
-    public function getSource($name);
-
-    /**
-     * Gets the cache key to use for the cache for a given template name.
-     *
-     * @param string $name The name of the template to load
-     *
-     * @return string The cache key
-     *
-     * @throws Twig_Error_Loader When $name is not found
-     */
-    public function getCacheKey($name);
-
-    /**
-     * Returns true if the template is still fresh.
-     *
-     * @param string    $name The template name
-     * @param timestamp $time The last modification time of the cached template
-     *
-     * @return Boolean true if the template is fresh, false otherwise
-     *
-     * @throws Twig_Error_Loader When $name is not found
-     */
-    public function isFresh($name, $time);
-}
Index: nc/libs/twig/Markup.php
===================================================================
--- inc/libs/twig/Markup.php	(revision 991)
+++ 	(revision )
@@ -1,38 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Marks a content as safe.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Markup implements Countable
-{
-    protected $content;
-    protected $charset;
-
-    public function __construct($content, $charset)
-    {
-        $this->content = (string) $content;
-        $this->charset = $charset;
-    }
-
-    public function __toString()
-    {
-        return $this->content;
-    }
-
-    public function count()
-    {
-        return function_exists('mb_get_info') ? mb_strlen($this->content, $this->charset) : strlen($this->content);
-    }
-}
Index: nc/libs/twig/Node.php
===================================================================
--- inc/libs/twig/Node.php	(revision 991)
+++ 	(revision )
@@ -1,227 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a node in the AST.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node implements Twig_NodeInterface
-{
-    protected $nodes;
-    protected $attributes;
-    protected $lineno;
-    protected $tag;
-
-    /**
-     * Constructor.
-     *
-     * The nodes are automatically made available as properties ($this->node).
-     * The attributes are automatically made available as array items ($this['name']).
-     *
-     * @param array   $nodes      An array of named nodes
-     * @param array   $attributes An array of attributes (should not be nodes)
-     * @param integer $lineno     The line number
-     * @param string  $tag        The tag name associated with the Node
-     */
-    public function __construct(array $nodes = array(), array $attributes = array(), $lineno = 0, $tag = null)
-    {
-        $this->nodes = $nodes;
-        $this->attributes = $attributes;
-        $this->lineno = $lineno;
-        $this->tag = $tag;
-    }
-
-    public function __toString()
-    {
-        $attributes = array();
-        foreach ($this->attributes as $name => $value) {
-            $attributes[] = sprintf('%s: %s', $name, str_replace("\n", '', var_export($value, true)));
-        }
-
-        $repr = array(get_class($this).'('.implode(', ', $attributes));
-
-        if (count($this->nodes)) {
-            foreach ($this->nodes as $name => $node) {
-                $len = strlen($name) + 4;
-                $noderepr = array();
-                foreach (explode("\n", (string) $node) as $line) {
-                    $noderepr[] = str_repeat(' ', $len).$line;
-                }
-
-                $repr[] = sprintf('  %s: %s', $name, ltrim(implode("\n", $noderepr)));
-            }
-
-            $repr[] = ')';
-        } else {
-            $repr[0] .= ')';
-        }
-
-        return implode("\n", $repr);
-    }
-
-    public function toXml($asDom = false)
-    {
-        $dom = new DOMDocument('1.0', 'UTF-8');
-        $dom->formatOutput = true;
-        $dom->appendChild($xml = $dom->createElement('twig'));
-
-        $xml->appendChild($node = $dom->createElement('node'));
-        $node->setAttribute('class', get_class($this));
-
-        foreach ($this->attributes as $name => $value) {
-            $node->appendChild($attribute = $dom->createElement('attribute'));
-            $attribute->setAttribute('name', $name);
-            $attribute->appendChild($dom->createTextNode($value));
-        }
-
-        foreach ($this->nodes as $name => $n) {
-            if (null === $n) {
-                continue;
-            }
-
-            $child = $n->toXml(true)->getElementsByTagName('node')->item(0);
-            $child = $dom->importNode($child, true);
-            $child->setAttribute('name', $name);
-
-            $node->appendChild($child);
-        }
-
-        return $asDom ? $dom : $dom->saveXml();
-    }
-
-    public function compile(Twig_Compiler $compiler)
-    {
-        foreach ($this->nodes as $node) {
-            $node->compile($compiler);
-        }
-    }
-
-    public function getLine()
-    {
-        return $this->lineno;
-    }
-
-    public function getNodeTag()
-    {
-        return $this->tag;
-    }
-
-    /**
-     * Returns true if the attribute is defined.
-     *
-     * @param  string  The attribute name
-     *
-     * @return Boolean true if the attribute is defined, false otherwise
-     */
-    public function hasAttribute($name)
-    {
-        return array_key_exists($name, $this->attributes);
-    }
-
-    /**
-     * Gets an attribute.
-     *
-     * @param  string The attribute name
-     *
-     * @return mixed The attribute value
-     */
-    public function getAttribute($name)
-    {
-        if (!array_key_exists($name, $this->attributes)) {
-            throw new LogicException(sprintf('Attribute "%s" does not exist for Node "%s".', $name, get_class($this)));
-        }
-
-        return $this->attributes[$name];
-    }
-
-    /**
-     * Sets an attribute.
-     *
-     * @param string The attribute name
-     * @param mixed  The attribute value
-     */
-    public function setAttribute($name, $value)
-    {
-        $this->attributes[$name] = $value;
-    }
-
-    /**
-     * Removes an attribute.
-     *
-     * @param string The attribute name
-     */
-    public function removeAttribute($name)
-    {
-        unset($this->attributes[$name]);
-    }
-
-    /**
-     * Returns true if the node with the given identifier exists.
-     *
-     * @param  string  The node name
-     *
-     * @return Boolean true if the node with the given name exists, false otherwise
-     */
-    public function hasNode($name)
-    {
-        return array_key_exists($name, $this->nodes);
-    }
-
-    /**
-     * Gets a node by name.
-     *
-     * @param  string The node name
-     *
-     * @return Twig_Node A Twig_Node instance
-     */
-    public function getNode($name)
-    {
-        if (!array_key_exists($name, $this->nodes)) {
-            throw new LogicException(sprintf('Node "%s" does not exist for Node "%s".', $name, get_class($this)));
-        }
-
-        return $this->nodes[$name];
-    }
-
-    /**
-     * Sets a node.
-     *
-     * @param string    The node name
-     * @param Twig_Node A Twig_Node instance
-     */
-    public function setNode($name, $node = null)
-    {
-        $this->nodes[$name] = $node;
-    }
-
-    /**
-     * Removes a node by name.
-     *
-     * @param string The node name
-     */
-    public function removeNode($name)
-    {
-        unset($this->nodes[$name]);
-    }
-
-    public function count()
-    {
-        return count($this->nodes);
-    }
-
-    public function getIterator()
-    {
-        return new ArrayIterator($this->nodes);
-    }
-}
Index: nc/libs/twig/Node/AutoEscape.php
===================================================================
--- inc/libs/twig/Node/AutoEscape.php	(revision 991)
+++ 	(revision )
@@ -1,40 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents an autoescape node.
- *
- * The value is the escaping strategy (can be html, js, ...)
- *
- * The true value is equivalent to html.
- *
- * If autoescaping is disabled, then the value is false.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_AutoEscape extends Twig_Node
-{
-    public function __construct($value, Twig_NodeInterface $body, $lineno, $tag = 'autoescape')
-    {
-        parent::__construct(array('body' => $body), array('value' => $value), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler->subcompile($this->getNode('body'));
-    }
-}
Index: nc/libs/twig/Node/Block.php
===================================================================
--- inc/libs/twig/Node/Block.php	(revision 991)
+++ 	(revision )
@@ -1,45 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a block node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Block extends Twig_Node
-{
-    public function __construct($name, Twig_NodeInterface $body, $lineno, $tag = null)
-    {
-        parent::__construct(array('body' => $body), array('name' => $name), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->addDebugInfo($this)
-            ->write(sprintf("public function block_%s(\$context, array \$blocks = array())\n", $this->getAttribute('name')), "{\n")
-            ->indent()
-        ;
-
-        $compiler
-            ->subcompile($this->getNode('body'))
-            ->outdent()
-            ->write("}\n\n")
-        ;
-    }
-}
Index: nc/libs/twig/Node/BlockReference.php
===================================================================
--- inc/libs/twig/Node/BlockReference.php	(revision 991)
+++ 	(revision )
@@ -1,38 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a block call node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_BlockReference extends Twig_Node implements Twig_NodeOutputInterface
-{
-    public function __construct($name, $lineno, $tag = null)
-    {
-        parent::__construct(array(), array('name' => $name), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->addDebugInfo($this)
-            ->write(sprintf("\$this->displayBlock('%s', \$context, \$blocks);\n", $this->getAttribute('name')))
-        ;
-    }
-}
Index: nc/libs/twig/Node/Body.php
===================================================================
--- inc/libs/twig/Node/Body.php	(revision 991)
+++ 	(revision )
@@ -1,20 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a body node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Body extends Twig_Node
-{
-}
Index: nc/libs/twig/Node/Do.php
===================================================================
--- inc/libs/twig/Node/Do.php	(revision 991)
+++ 	(revision )
@@ -1,39 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a do node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Do extends Twig_Node
-{
-    public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null)
-    {
-        parent::__construct(array('expr' => $expr), array(), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->addDebugInfo($this)
-            ->write('')
-            ->subcompile($this->getNode('expr'))
-            ->raw(";\n")
-        ;
-    }
-}
Index: nc/libs/twig/Node/Embed.php
===================================================================
--- inc/libs/twig/Node/Embed.php	(revision 991)
+++ 	(revision )
@@ -1,39 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2012 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents an embed node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Embed extends Twig_Node_Include
-{
-    // we don't inject the module to avoid node visitors to traverse it twice (as it will be already visited in the main module)
-    public function __construct($filename, $index, Twig_Node_Expression $variables = null, $only = false, $ignoreMissing = false, $lineno, $tag = null)
-    {
-        parent::__construct(new Twig_Node_Expression_Constant('not_used', $lineno), $variables, $only, $ignoreMissing, $lineno, $tag);
-
-        $this->setAttribute('filename', $filename);
-        $this->setAttribute('index', $index);
-    }
-
-    protected function addGetTemplate(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->write("\$this->env->loadTemplate(")
-            ->string($this->getAttribute('filename'))
-            ->raw(', ')
-            ->string($this->getAttribute('index'))
-            ->raw(")")
-        ;
-    }
-}
Index: nc/libs/twig/Node/Expression.php
===================================================================
--- inc/libs/twig/Node/Expression.php	(revision 991)
+++ 	(revision )
@@ -1,21 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Abstract class for all nodes that represents an expression.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-abstract class Twig_Node_Expression extends Twig_Node
-{
-}
Index: nc/libs/twig/Node/Expression/Array.php
===================================================================
--- inc/libs/twig/Node/Expression/Array.php	(revision 991)
+++ 	(revision )
@@ -1,86 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Array extends Twig_Node_Expression
-{
-    protected $index;
-
-    public function __construct(array $elements, $lineno)
-    {
-        parent::__construct($elements, array(), $lineno);
-
-        $this->index = -1;
-        foreach ($this->getKeyValuePairs() as $pair) {
-            if ($pair['key'] instanceof Twig_Node_Expression_Constant && ctype_digit((string) $pair['key']->getAttribute('value')) && $pair['key']->getAttribute('value') > $this->index) {
-                $this->index = $pair['key']->getAttribute('value');
-            }
-        }
-    }
-
-    public function getKeyValuePairs()
-    {
-        $pairs = array();
-
-        foreach (array_chunk($this->nodes, 2) as $pair) {
-            $pairs[] = array(
-                'key' => $pair[0],
-                'value' => $pair[1],
-            );
-        }
-
-        return $pairs;
-    }
-
-    public function hasElement(Twig_Node_Expression $key)
-    {
-        foreach ($this->getKeyValuePairs() as $pair) {
-            // we compare the string representation of the keys
-            // to avoid comparing the line numbers which are not relevant here.
-            if ((string) $key == (string) $pair['key']) {
-                return true;
-            }
-        }
-
-        return false;
-    }
-
-    public function addElement(Twig_Node_Expression $value, Twig_Node_Expression $key = null)
-    {
-        if (null === $key) {
-            $key = new Twig_Node_Expression_Constant(++$this->index, $value->getLine());
-        }
-
-        array_push($this->nodes, $key, $value);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler->raw('array(');
-        $first = true;
-        foreach ($this->getKeyValuePairs() as $pair) {
-            if (!$first) {
-                $compiler->raw(', ');
-            }
-            $first = false;
-
-            $compiler
-                ->subcompile($pair['key'])
-                ->raw(' => ')
-                ->subcompile($pair['value'])
-            ;
-        }
-        $compiler->raw(')');
-    }
-}
Index: nc/libs/twig/Node/Expression/AssignName.php
===================================================================
--- inc/libs/twig/Node/Expression/AssignName.php	(revision 991)
+++ 	(revision )
@@ -1,28 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-class Twig_Node_Expression_AssignName extends Twig_Node_Expression_Name
-{
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->raw('$context[')
-            ->string($this->getAttribute('name'))
-            ->raw(']')
-        ;
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary.php	(revision 0)
+++ 	(revision )
@@ -1,40 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-abstract class Twig_Node_Expression_Binary extends Twig_Node_Expression
-{
-    public function __construct(Twig_NodeInterface $left, Twig_NodeInterface $right, $lineno)
-    {
-        parent::__construct(array('left' => $left, 'right' => $right), array(), $lineno);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->raw('(')
-            ->subcompile($this->getNode('left'))
-            ->raw(' ')
-        ;
-        $this->operator($compiler);
-        $compiler
-            ->raw(' ')
-            ->subcompile($this->getNode('right'))
-            ->raw(')')
-        ;
-    }
-
-    abstract public function operator(Twig_Compiler $compiler);
-}
Index: nc/libs/twig/Node/Expression/Binary/Add.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/Add.php	(revision 0)
+++ 	(revision )
@@ -1,18 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_Add extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('+');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/And.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/And.php	(revision 0)
+++ 	(revision )
@@ -1,18 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_And extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('&&');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/BitwiseAnd.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/BitwiseAnd.php	(revision 991)
+++ 	(revision )
@@ -1,18 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_BitwiseAnd extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('&');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/BitwiseOr.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/BitwiseOr.php	(revision 991)
+++ 	(revision )
@@ -1,18 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_BitwiseOr extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('|');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/BitwiseXor.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/BitwiseXor.php	(revision 991)
+++ 	(revision )
@@ -1,18 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_BitwiseXor extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('^');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/Concat.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/Concat.php	(revision 0)
+++ 	(revision )
@@ -1,18 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_Concat extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('.');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/Div.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/Div.php	(revision 0)
+++ 	(revision )
@@ -1,18 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_Div extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('/');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/Equal.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/Equal.php	(revision 0)
+++ 	(revision )
@@ -1,17 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_Equal extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('==');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/FloorDiv.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/FloorDiv.php	(revision 991)
+++ 	(revision )
@@ -1,29 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_FloorDiv extends Twig_Node_Expression_Binary
-{
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler->raw('intval(floor(');
-        parent::compile($compiler);
-        $compiler->raw('))');
-    }
-
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('/');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/Greater.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/Greater.php	(revision 0)
+++ 	(revision )
@@ -1,17 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_Greater extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('>');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/GreaterEqual.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/GreaterEqual.php	(revision 0)
+++ 	(revision )
@@ -1,17 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_GreaterEqual extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('>=');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/In.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/In.php	(revision 0)
+++ 	(revision )
@@ -1,33 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_In extends Twig_Node_Expression_Binary
-{
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->raw('twig_in_filter(')
-            ->subcompile($this->getNode('left'))
-            ->raw(', ')
-            ->subcompile($this->getNode('right'))
-            ->raw(')')
-        ;
-    }
-
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('in');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/Less.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/Less.php	(revision 0)
+++ 	(revision )
@@ -1,17 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_Less extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('<');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/LessEqual.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/LessEqual.php	(revision 0)
+++ 	(revision )
@@ -1,17 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_LessEqual extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('<=');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/Mod.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/Mod.php	(revision 0)
+++ 	(revision )
@@ -1,18 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_Mod extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('%');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/Mul.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/Mul.php	(revision 0)
+++ 	(revision )
@@ -1,18 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_Mul extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('*');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/NotEqual.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/NotEqual.php	(revision 0)
+++ 	(revision )
@@ -1,17 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_NotEqual extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('!=');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/NotIn.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/NotIn.php	(revision 0)
+++ 	(revision )
@@ -1,33 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_NotIn extends Twig_Node_Expression_Binary
-{
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->raw('!twig_in_filter(')
-            ->subcompile($this->getNode('left'))
-            ->raw(', ')
-            ->subcompile($this->getNode('right'))
-            ->raw(')')
-        ;
-    }
-
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('not in');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/Or.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/Or.php	(revision 0)
+++ 	(revision )
@@ -1,18 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_Or extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('||');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/Power.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/Power.php	(revision 0)
+++ 	(revision )
@@ -1,33 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_Power extends Twig_Node_Expression_Binary
-{
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->raw('pow(')
-            ->subcompile($this->getNode('left'))
-            ->raw(', ')
-            ->subcompile($this->getNode('right'))
-            ->raw(')')
-        ;
-    }
-
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('**');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/Range.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/Range.php	(revision 0)
+++ 	(revision )
@@ -1,33 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_Range extends Twig_Node_Expression_Binary
-{
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->raw('range(')
-            ->subcompile($this->getNode('left'))
-            ->raw(', ')
-            ->subcompile($this->getNode('right'))
-            ->raw(')')
-        ;
-    }
-
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('..');
-    }
-}
Index: nc/libs/twig/Node/Expression/Binary/Sub.php
===================================================================
--- inc/libs/twig/Node/Expression/Binary/Sub.php	(revision 0)
+++ 	(revision )
@@ -1,18 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Binary_Sub extends Twig_Node_Expression_Binary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        return $compiler->raw('-');
-    }
-}
Index: nc/libs/twig/Node/Expression/BlockReference.php
===================================================================
--- inc/libs/twig/Node/Expression/BlockReference.php	(revision 991)
+++ 	(revision )
@@ -1,52 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a block call node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Expression_BlockReference extends Twig_Node_Expression
-{
-    public function __construct(Twig_NodeInterface $name, $asString = false, $lineno, $tag = null)
-    {
-        parent::__construct(array('name' => $name), array('as_string' => $asString, 'output' => false), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        if ($this->getAttribute('as_string')) {
-            $compiler->raw('(string) ');
-        }
-
-        if ($this->getAttribute('output')) {
-            $compiler
-                ->addDebugInfo($this)
-                ->write("\$this->displayBlock(")
-                ->subcompile($this->getNode('name'))
-                ->raw(", \$context, \$blocks);\n")
-            ;
-        } else {
-            $compiler
-                ->raw("\$this->renderBlock(")
-                ->subcompile($this->getNode('name'))
-                ->raw(", \$context, \$blocks)")
-            ;
-        }
-    }
-}
Index: nc/libs/twig/Node/Expression/Conditional.php
===================================================================
--- inc/libs/twig/Node/Expression/Conditional.php	(revision 0)
+++ 	(revision )
@@ -1,31 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Conditional extends Twig_Node_Expression
-{
-    public function __construct(Twig_Node_Expression $expr1, Twig_Node_Expression $expr2, Twig_Node_Expression $expr3, $lineno)
-    {
-        parent::__construct(array('expr1' => $expr1, 'expr2' => $expr2, 'expr3' => $expr3), array(), $lineno);
-    }
-
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->raw('((')
-            ->subcompile($this->getNode('expr1'))
-            ->raw(') ? (')
-            ->subcompile($this->getNode('expr2'))
-            ->raw(') : (')
-            ->subcompile($this->getNode('expr3'))
-            ->raw('))')
-        ;
-    }
-}
Index: nc/libs/twig/Node/Expression/Constant.php
===================================================================
--- inc/libs/twig/Node/Expression/Constant.php	(revision 0)
+++ 	(revision )
@@ -1,23 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Constant extends Twig_Node_Expression
-{
-    public function __construct($value, $lineno)
-    {
-        parent::__construct(array(), array('value' => $value), $lineno);
-    }
-
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler->repr($this->getAttribute('value'));
-    }
-}
Index: nc/libs/twig/Node/Expression/ExtensionReference.php
===================================================================
--- inc/libs/twig/Node/Expression/ExtensionReference.php	(revision 991)
+++ 	(revision )
@@ -1,34 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents an extension call node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Expression_ExtensionReference extends Twig_Node_Expression
-{
-    public function __construct($name, $lineno, $tag = null)
-    {
-        parent::__construct(array(), array('name' => $name), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler->raw(sprintf("\$this->env->getExtension('%s')", $this->getAttribute('name')));
-    }
-}
Index: nc/libs/twig/Node/Expression/Filter.php
===================================================================
--- inc/libs/twig/Node/Expression/Filter.php	(revision 991)
+++ 	(revision )
@@ -1,61 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Filter extends Twig_Node_Expression
-{
-    public function __construct(Twig_NodeInterface $node, Twig_Node_Expression_Constant $filterName, Twig_NodeInterface $arguments, $lineno, $tag = null)
-    {
-        parent::__construct(array('node' => $node, 'filter' => $filterName, 'arguments' => $arguments), array(), $lineno, $tag);
-    }
-
-    public function compile(Twig_Compiler $compiler)
-    {
-        $name = $this->getNode('filter')->getAttribute('value');
-
-        if (false === $filter = $compiler->getEnvironment()->getFilter($name)) {
-            $message = sprintf('The filter "%s" does not exist', $name);
-            if ($alternatives = $compiler->getEnvironment()->computeAlternatives($name, array_keys($compiler->getEnvironment()->getFilters()))) {
-                $message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives));
-            }
-
-            throw new Twig_Error_Syntax($message, $this->getLine(), $compiler->getFilename());
-        }
-
-        $this->compileFilter($compiler, $filter);
-    }
-
-    protected function compileFilter(Twig_Compiler $compiler, Twig_FilterInterface $filter)
-    {
-        $compiler
-            ->raw($filter->compile().'(')
-            ->raw($filter->needsEnvironment() ? '$this->env, ' : '')
-            ->raw($filter->needsContext() ? '$context, ' : '')
-        ;
-
-        foreach ($filter->getArguments() as $argument) {
-            $compiler
-                ->string($argument)
-                ->raw(', ')
-            ;
-        }
-
-        $compiler->subcompile($this->getNode('node'));
-
-        foreach ($this->getNode('arguments') as $node) {
-            $compiler
-                ->raw(', ')
-                ->subcompile($node)
-            ;
-        }
-
-        $compiler->raw(')');
-    }
-}
Index: nc/libs/twig/Node/Expression/Filter/Default.php
===================================================================
--- inc/libs/twig/Node/Expression/Filter/Default.php	(revision 991)
+++ 	(revision )
@@ -1,44 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Returns the value or the default value when it is undefined or empty.
- *
- * <pre>
- *  {{ var.foo|default('foo item on var is not defined') }}
- * </pre>
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Expression_Filter_Default extends Twig_Node_Expression_Filter
-{
-    public function __construct(Twig_NodeInterface $node, Twig_Node_Expression_Constant $filterName, Twig_NodeInterface $arguments, $lineno, $tag = null)
-    {
-        $default = new Twig_Node_Expression_Filter($node, new Twig_Node_Expression_Constant('_default', $node->getLine()), $arguments, $node->getLine());
-
-        if ('default' === $filterName->getAttribute('value') && ($node instanceof Twig_Node_Expression_Name || $node instanceof Twig_Node_Expression_GetAttr)) {
-            $test = new Twig_Node_Expression_Test_Defined(clone $node, 'defined', new Twig_Node(), $node->getLine());
-            $false = count($arguments) ? $arguments->getNode(0) : new Twig_Node_Expression_Constant('', $node->getLine());
-
-            $node = new Twig_Node_Expression_Conditional($test, $default, $false, $node->getLine());
-        } else {
-            $node = $default;
-        }
-
-        parent::__construct($node, $filterName, $arguments, $lineno, $tag);
-    }
-
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler->subcompile($this->getNode('node'));
-    }
-}
Index: nc/libs/twig/Node/Expression/Function.php
===================================================================
--- inc/libs/twig/Node/Expression/Function.php	(revision 991)
+++ 	(revision )
@@ -1,66 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Function extends Twig_Node_Expression
-{
-    public function __construct($name, Twig_NodeInterface $arguments, $lineno)
-    {
-        parent::__construct(array('arguments' => $arguments), array('name' => $name), $lineno);
-    }
-
-    public function compile(Twig_Compiler $compiler)
-    {
-        $name = $this->getAttribute('name');
-
-        if (false === $function = $compiler->getEnvironment()->getFunction($name)) {
-            $message = sprintf('The function "%s" does not exist', $name);
-            if ($alternatives = $compiler->getEnvironment()->computeAlternatives($name, array_keys($compiler->getEnvironment()->getFunctions()))) {
-                $message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives));
-            }
-
-            throw new Twig_Error_Syntax($message, $this->getLine(), $compiler->getFilename());
-        }
-
-        $compiler->raw($function->compile().'(');
-
-        $first = true;
-
-        if ($function->needsEnvironment()) {
-            $compiler->raw('$this->env');
-            $first = false;
-        }
-
-        if ($function->needsContext()) {
-            if (!$first) {
-                $compiler->raw(', ');
-            }
-            $compiler->raw('$context');
-            $first = false;
-        }
-
-        foreach ($function->getArguments() as $argument) {
-            if (!$first) {
-                $compiler->raw(', ');
-            }
-            $compiler->string($argument);
-            $first = false;
-        }
-
-        foreach ($this->getNode('arguments') as $node) {
-            if (!$first) {
-                $compiler->raw(', ');
-            }
-            $compiler->subcompile($node);
-            $first = false;
-        }
-
-        $compiler->raw(')');
-    }
-}
Index: nc/libs/twig/Node/Expression/GetAttr.php
===================================================================
--- inc/libs/twig/Node/Expression/GetAttr.php	(revision 991)
+++ 	(revision )
@@ -1,53 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_GetAttr extends Twig_Node_Expression
-{
-    public function __construct(Twig_Node_Expression $node, Twig_Node_Expression $attribute, Twig_Node_Expression_Array $arguments, $type, $lineno)
-    {
-        parent::__construct(array('node' => $node, 'attribute' => $attribute, 'arguments' => $arguments), array('type' => $type, 'is_defined_test' => false, 'ignore_strict_check' => false, 'disable_c_ext' => false), $lineno);
-    }
-
-    public function compile(Twig_Compiler $compiler)
-    {
-        if (function_exists('twig_template_get_attributes') && !$this->getAttribute('disable_c_ext')) {
-            $compiler->raw('twig_template_get_attributes($this, ');
-        } else {
-            $compiler->raw('$this->getAttribute(');
-        }
-
-        if ($this->getAttribute('ignore_strict_check')) {
-            $this->getNode('node')->setAttribute('ignore_strict_check', true);
-        }
-
-        $compiler->subcompile($this->getNode('node'));
-
-        $compiler->raw(', ')->subcompile($this->getNode('attribute'));
-
-        if (count($this->getNode('arguments')) || Twig_TemplateInterface::ANY_CALL !== $this->getAttribute('type') || $this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) {
-            $compiler->raw(', ')->subcompile($this->getNode('arguments'));
-
-            if (Twig_TemplateInterface::ANY_CALL !== $this->getAttribute('type') || $this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) {
-                $compiler->raw(', ')->repr($this->getAttribute('type'));
-            }
-
-            if ($this->getAttribute('is_defined_test') || $this->getAttribute('ignore_strict_check')) {
-                $compiler->raw(', '.($this->getAttribute('is_defined_test') ? 'true' : 'false'));
-            }
-
-            if ($this->getAttribute('ignore_strict_check')) {
-                $compiler->raw(', '.($this->getAttribute('ignore_strict_check') ? 'true' : 'false'));
-            }
-        }
-
-        $compiler->raw(')');
-    }
-}
Index: nc/libs/twig/Node/Expression/MethodCall.php
===================================================================
--- inc/libs/twig/Node/Expression/MethodCall.php	(revision 991)
+++ 	(revision )
@@ -1,41 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2012 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_MethodCall extends Twig_Node_Expression
-{
-    public function __construct(Twig_Node_Expression $node, $method, Twig_Node_Expression_Array $arguments, $lineno)
-    {
-        parent::__construct(array('node' => $node, 'arguments' => $arguments), array('method' => $method, 'safe' => false), $lineno);
-
-        if ($node instanceof Twig_Node_Expression_Name) {
-            $node->setAttribute('always_defined', true);
-        }
-    }
-
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->subcompile($this->getNode('node'))
-            ->raw('->')
-            ->raw($this->getAttribute('method'))
-            ->raw('(')
-        ;
-        $first = true;
-        foreach ($this->getNode('arguments')->getKeyValuePairs() as $pair) {
-            if (!$first) {
-                $compiler->raw(', ');
-            }
-            $first = false;
-
-            $compiler->subcompile($pair['value']);
-        }
-        $compiler->raw(')');
-    }
-}
Index: nc/libs/twig/Node/Expression/Name.php
===================================================================
--- inc/libs/twig/Node/Expression/Name.php	(revision 991)
+++ 	(revision )
@@ -1,88 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Name extends Twig_Node_Expression
-{
-    protected $specialVars = array(
-        '_self'    => '$this',
-        '_context' => '$context',
-        '_charset' => '$this->env->getCharset()',
-    );
-
-    public function __construct($name, $lineno)
-    {
-        parent::__construct(array(), array('name' => $name, 'is_defined_test' => false, 'ignore_strict_check' => false, 'always_defined' => false), $lineno);
-    }
-
-    public function compile(Twig_Compiler $compiler)
-    {
-        $name = $this->getAttribute('name');
-
-        if ($this->getAttribute('is_defined_test')) {
-            if ($this->isSpecial()) {
-                $compiler->repr(true);
-            } else {
-                $compiler->raw('array_key_exists(')->repr($name)->raw(', $context)');
-            }
-        } elseif ($this->isSpecial()) {
-            $compiler->raw($this->specialVars[$name]);
-        } elseif ($this->getAttribute('always_defined')) {
-            $compiler
-                ->raw('$context[')
-                ->string($name)
-                ->raw(']')
-            ;
-        } else {
-            // remove the non-PHP 5.4 version when PHP 5.3 support is dropped
-            // as the non-optimized version is just a workaround for slow ternary operator
-            // when the context has a lot of variables
-            if (version_compare(phpversion(), '5.4.0RC1', '>=')) {
-                // PHP 5.4 ternary operator performance was optimized
-                $compiler
-                    ->raw('(isset($context[')
-                    ->string($name)
-                    ->raw(']) ? $context[')
-                    ->string($name)
-                    ->raw('] : ')
-                ;
-
-                if ($this->getAttribute('ignore_strict_check') || !$compiler->getEnvironment()->isStrictVariables()) {
-                    $compiler->raw('null)');
-                } else {
-                    $compiler->raw('$this->getContext($context, ')->string($name)->raw('))');
-                }
-            } else {
-                $compiler
-                    ->raw('$this->getContext($context, ')
-                    ->string($name)
-                ;
-
-                if ($this->getAttribute('ignore_strict_check')) {
-                    $compiler->raw(', true');
-                }
-
-                $compiler
-                    ->raw(')')
-                ;
-            }
-        }
-    }
-
-    public function isSpecial()
-    {
-        return isset($this->specialVars[$this->getAttribute('name')]);
-    }
-
-    public function isSimple()
-    {
-        return !$this->isSpecial() && !$this->getAttribute('is_defined_test');
-    }
-}
Index: nc/libs/twig/Node/Expression/Parent.php
===================================================================
--- inc/libs/twig/Node/Expression/Parent.php	(revision 991)
+++ 	(revision )
@@ -1,48 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a parent node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Expression_Parent extends Twig_Node_Expression
-{
-    public function __construct($name, $lineno, $tag = null)
-    {
-        parent::__construct(array(), array('output' => false, 'name' => $name), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        if ($this->getAttribute('output')) {
-            $compiler
-                ->addDebugInfo($this)
-                ->write("\$this->displayParentBlock(")
-                ->string($this->getAttribute('name'))
-                ->raw(", \$context, \$blocks);\n")
-            ;
-        } else {
-            $compiler
-                ->raw("\$this->renderParentBlock(")
-                ->string($this->getAttribute('name'))
-                ->raw(", \$context, \$blocks)")
-            ;
-        }
-    }
-}
Index: nc/libs/twig/Node/Expression/TempName.php
===================================================================
--- inc/libs/twig/Node/Expression/TempName.php	(revision 991)
+++ 	(revision )
@@ -1,26 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_TempName extends Twig_Node_Expression
-{
-    public function __construct($name, $lineno)
-    {
-        parent::__construct(array(), array('name' => $name), $lineno);
-    }
-
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->raw('$_')
-            ->raw($this->getAttribute('name'))
-            ->raw('_')
-        ;
-    }
-}
Index: nc/libs/twig/Node/Expression/Test.php
===================================================================
--- inc/libs/twig/Node/Expression/Test.php	(revision 991)
+++ 	(revision )
@@ -1,54 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Test extends Twig_Node_Expression
-{
-    public function __construct(Twig_NodeInterface $node, $name, Twig_NodeInterface $arguments = null, $lineno)
-    {
-        parent::__construct(array('node' => $node, 'arguments' => $arguments), array('name' => $name), $lineno);
-    }
-
-    public function compile(Twig_Compiler $compiler)
-    {
-        $name = $this->getAttribute('name');
-        $testMap = $compiler->getEnvironment()->getTests();
-        if (!isset($testMap[$name])) {
-            $message = sprintf('The test "%s" does not exist', $name);
-            if ($alternatives = $compiler->getEnvironment()->computeAlternatives($name, array_keys($compiler->getEnvironment()->getTests()))) {
-                $message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives));
-            }
-
-            throw new Twig_Error_Syntax($message, $this->getLine(), $compiler->getFilename());
-        }
-
-        $name = $this->getAttribute('name');
-        $node = $this->getNode('node');
-
-        $compiler
-            ->raw($testMap[$name]->compile().'(')
-            ->subcompile($node)
-        ;
-
-        if (null !== $this->getNode('arguments')) {
-            $compiler->raw(', ');
-
-            $max = count($this->getNode('arguments')) - 1;
-            foreach ($this->getNode('arguments') as $i => $arg) {
-                $compiler->subcompile($arg);
-
-                if ($i != $max) {
-                    $compiler->raw(', ');
-                }
-            }
-        }
-
-        $compiler->raw(')');
-    }
-}
Index: nc/libs/twig/Node/Expression/Test/Constant.php
===================================================================
--- inc/libs/twig/Node/Expression/Test/Constant.php	(revision 991)
+++ 	(revision )
@@ -1,36 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Checks if a variable is the exact same value as a constant.
- *
- * <pre>
- *  {% if post.status is constant('Post::PUBLISHED') %}
- *    the status attribute is exactly the same as Post::PUBLISHED
- *  {% endif %}
- * </pre>
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Expression_Test_Constant extends Twig_Node_Expression_Test
-{
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->raw('(')
-            ->subcompile($this->getNode('node'))
-            ->raw(' === constant(')
-            ->subcompile($this->getNode('arguments')->getNode(0))
-            ->raw('))')
-        ;
-    }
-}
Index: nc/libs/twig/Node/Expression/Test/Defined.php
===================================================================
--- inc/libs/twig/Node/Expression/Test/Defined.php	(revision 991)
+++ 	(revision )
@@ -1,55 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Checks if a variable is defined in the current context.
- *
- * <pre>
- * {# defined works with variable names and variable attributes #}
- * {% if foo is defined %}
- *     {# ... #}
- * {% endif %}
- * </pre>
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Expression_Test_Defined extends Twig_Node_Expression_Test
-{
-    public function __construct(Twig_NodeInterface $node, $name, Twig_NodeInterface $arguments = null, $lineno)
-    {
-        parent::__construct($node, $name, $arguments, $lineno);
-
-        if ($node instanceof Twig_Node_Expression_Name) {
-            $node->setAttribute('is_defined_test', true);
-        } elseif ($node instanceof Twig_Node_Expression_GetAttr) {
-            $node->setAttribute('is_defined_test', true);
-
-            $this->changeIgnoreStrictCheck($node);
-        } else {
-            throw new Twig_Error_Syntax('The "defined" test only works with simple variables', $this->getLine(), $compiler->getFilename());
-        }
-    }
-
-    protected function changeIgnoreStrictCheck(Twig_Node_Expression_GetAttr $node)
-    {
-        $node->setAttribute('ignore_strict_check', true);
-
-        if ($node->getNode('node') instanceof Twig_Node_Expression_GetAttr) {
-            $this->changeIgnoreStrictCheck($node->getNode('node'));
-        }
-    }
-
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler->subcompile($this->getNode('node'));
-    }
-}
Index: nc/libs/twig/Node/Expression/Test/Divisibleby.php
===================================================================
--- inc/libs/twig/Node/Expression/Test/Divisibleby.php	(revision 991)
+++ 	(revision )
@@ -1,34 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Checks if a variable is divisible by a number.
- *
- * <pre>
- *  {% if loop.index is divisibleby(3) %}
- * </pre>
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Expression_Test_Divisibleby extends Twig_Node_Expression_Test
-{
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->raw('(0 == ')
-            ->subcompile($this->getNode('node'))
-            ->raw(' % ')
-            ->subcompile($this->getNode('arguments')->getNode(0))
-            ->raw(')')
-        ;
-    }
-}
Index: nc/libs/twig/Node/Expression/Test/Even.php
===================================================================
--- inc/libs/twig/Node/Expression/Test/Even.php	(revision 991)
+++ 	(revision )
@@ -1,33 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Checks if a number is even.
- *
- * <pre>
- *  {{ var is even }}
- * </pre>
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Expression_Test_Even extends Twig_Node_Expression_Test
-{
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->raw('(')
-            ->subcompile($this->getNode('node'))
-            ->raw(' % 2 == 0')
-            ->raw(')')
-        ;
-    }
-}
Index: nc/libs/twig/Node/Expression/Test/Null.php
===================================================================
--- inc/libs/twig/Node/Expression/Test/Null.php	(revision 991)
+++ 	(revision )
@@ -1,32 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Checks that a variable is null.
- *
- * <pre>
- *  {{ var is none }}
- * </pre>
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Expression_Test_Null extends Twig_Node_Expression_Test
-{
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->raw('(null === ')
-            ->subcompile($this->getNode('node'))
-            ->raw(')')
-        ;
-    }
-}
Index: nc/libs/twig/Node/Expression/Test/Odd.php
===================================================================
--- inc/libs/twig/Node/Expression/Test/Odd.php	(revision 991)
+++ 	(revision )
@@ -1,33 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Checks if a number is odd.
- *
- * <pre>
- *  {{ var is odd }}
- * </pre>
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Expression_Test_Odd extends Twig_Node_Expression_Test
-{
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->raw('(')
-            ->subcompile($this->getNode('node'))
-            ->raw(' % 2 == 1')
-            ->raw(')')
-        ;
-    }
-}
Index: nc/libs/twig/Node/Expression/Test/Sameas.php
===================================================================
--- inc/libs/twig/Node/Expression/Test/Sameas.php	(revision 991)
+++ 	(revision )
@@ -1,30 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Checks if a variable is the same as another one (=== in PHP).
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Expression_Test_Sameas extends Twig_Node_Expression_Test
-{
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->raw('(')
-            ->subcompile($this->getNode('node'))
-            ->raw(' === ')
-            ->subcompile($this->getNode('arguments')->getNode(0))
-            ->raw(')')
-        ;
-    }
-}
Index: nc/libs/twig/Node/Expression/Unary.php
===================================================================
--- inc/libs/twig/Node/Expression/Unary.php	(revision 0)
+++ 	(revision )
@@ -1,30 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-abstract class Twig_Node_Expression_Unary extends Twig_Node_Expression
-{
-    public function __construct(Twig_NodeInterface $node, $lineno)
-    {
-        parent::__construct(array('node' => $node), array(), $lineno);
-    }
-
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler->raw('(');
-        $this->operator($compiler);
-        $compiler
-            ->subcompile($this->getNode('node'))
-            ->raw(')')
-        ;
-    }
-
-    abstract public function operator(Twig_Compiler $compiler);
-}
Index: nc/libs/twig/Node/Expression/Unary/Neg.php
===================================================================
--- inc/libs/twig/Node/Expression/Unary/Neg.php	(revision 0)
+++ 	(revision )
@@ -1,18 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Unary_Neg extends Twig_Node_Expression_Unary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        $compiler->raw('-');
-    }
-}
Index: nc/libs/twig/Node/Expression/Unary/Not.php
===================================================================
--- inc/libs/twig/Node/Expression/Unary/Not.php	(revision 0)
+++ 	(revision )
@@ -1,18 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Unary_Not extends Twig_Node_Expression_Unary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        $compiler->raw('!');
-    }
-}
Index: nc/libs/twig/Node/Expression/Unary/Pos.php
===================================================================
--- inc/libs/twig/Node/Expression/Unary/Pos.php	(revision 0)
+++ 	(revision )
@@ -1,18 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-class Twig_Node_Expression_Unary_Pos extends Twig_Node_Expression_Unary
-{
-    public function operator(Twig_Compiler $compiler)
-    {
-        $compiler->raw('+');
-    }
-}
Index: nc/libs/twig/Node/Flush.php
===================================================================
--- inc/libs/twig/Node/Flush.php	(revision 991)
+++ 	(revision )
@@ -1,37 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a flush node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Flush extends Twig_Node
-{
-    public function __construct($lineno, $tag)
-    {
-        parent::__construct(array(), array(), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->addDebugInfo($this)
-            ->write("flush();\n")
-        ;
-    }
-}
Index: nc/libs/twig/Node/For.php
===================================================================
--- inc/libs/twig/Node/For.php	(revision 991)
+++ 	(revision )
@@ -1,113 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a for node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_For extends Twig_Node
-{
-    protected $loop;
-
-    public function __construct(Twig_Node_Expression_AssignName $keyTarget, Twig_Node_Expression_AssignName $valueTarget, Twig_Node_Expression $seq, Twig_Node_Expression $ifexpr = null, Twig_NodeInterface $body, Twig_NodeInterface $else = null, $lineno, $tag = null)
-    {
-        $body = new Twig_Node(array($body, $this->loop = new Twig_Node_ForLoop($lineno, $tag)));
-
-        if (null !== $ifexpr) {
-            $body = new Twig_Node_If(new Twig_Node(array($ifexpr, $body)), null, $lineno, $tag);
-        }
-
-        parent::__construct(array('key_target' => $keyTarget, 'value_target' => $valueTarget, 'seq' => $seq, 'body' => $body, 'else' => $else), array('with_loop' => true, 'ifexpr' => null !== $ifexpr), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->addDebugInfo($this)
-            // the (array) cast bypasses a PHP 5.2.6 bug
-            ->write("\$context['_parent'] = (array) \$context;\n")
-            ->write("\$context['_seq'] = twig_ensure_traversable(")
-            ->subcompile($this->getNode('seq'))
-            ->raw(");\n")
-        ;
-
-        if (null !== $this->getNode('else')) {
-            $compiler->write("\$context['_iterated'] = false;\n");
-        }
-
-        if ($this->getAttribute('with_loop')) {
-            $compiler
-                ->write("\$context['loop'] = array(\n")
-                ->write("  'parent' => \$context['_parent'],\n")
-                ->write("  'index0' => 0,\n")
-                ->write("  'index'  => 1,\n")
-                ->write("  'first'  => true,\n")
-                ->write(");\n")
-            ;
-
-            if (!$this->getAttribute('ifexpr')) {
-                $compiler
-                    ->write("if (is_array(\$context['_seq']) || (is_object(\$context['_seq']) && \$context['_seq'] instanceof Countable)) {\n")
-                    ->indent()
-                    ->write("\$length = count(\$context['_seq']);\n")
-                    ->write("\$context['loop']['revindex0'] = \$length - 1;\n")
-                    ->write("\$context['loop']['revindex'] = \$length;\n")
-                    ->write("\$context['loop']['length'] = \$length;\n")
-                    ->write("\$context['loop']['last'] = 1 === \$length;\n")
-                    ->outdent()
-                    ->write("}\n")
-                ;
-            }
-        }
-
-        $this->loop->setAttribute('else', null !== $this->getNode('else'));
-        $this->loop->setAttribute('with_loop', $this->getAttribute('with_loop'));
-        $this->loop->setAttribute('ifexpr', $this->getAttribute('ifexpr'));
-
-        $compiler
-            ->write("foreach (\$context['_seq'] as ")
-            ->subcompile($this->getNode('key_target'))
-            ->raw(" => ")
-            ->subcompile($this->getNode('value_target'))
-            ->raw(") {\n")
-            ->indent()
-            ->subcompile($this->getNode('body'))
-            ->outdent()
-            ->write("}\n")
-        ;
-
-        if (null !== $this->getNode('else')) {
-            $compiler
-                ->write("if (!\$context['_iterated']) {\n")
-                ->indent()
-                ->subcompile($this->getNode('else'))
-                ->outdent()
-                ->write("}\n")
-            ;
-        }
-
-        $compiler->write("\$_parent = \$context['_parent'];\n");
-
-        // remove some "private" loop variables (needed for nested loops)
-        $compiler->write('unset($context[\'_seq\'], $context[\'_iterated\'], $context[\''.$this->getNode('key_target')->getAttribute('name').'\'], $context[\''.$this->getNode('value_target')->getAttribute('name').'\'], $context[\'_parent\'], $context[\'loop\']);'."\n");
-
-        // keep the values set in the inner context for variables defined in the outer context
-        $compiler->write("\$context = array_merge(\$_parent, array_intersect_key(\$context, \$_parent));\n");
-    }
-}
Index: nc/libs/twig/Node/ForLoop.php
===================================================================
--- inc/libs/twig/Node/ForLoop.php	(revision 991)
+++ 	(revision )
@@ -1,56 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Internal node used by the for node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_ForLoop extends Twig_Node
-{
-    public function __construct($lineno, $tag = null)
-    {
-        parent::__construct(array(), array('with_loop' => false, 'ifexpr' => false, 'else' => false), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        if ($this->getAttribute('else')) {
-            $compiler->write("\$context['_iterated'] = true;\n");
-        }
-
-        if ($this->getAttribute('with_loop')) {
-            $compiler
-                ->write("++\$context['loop']['index0'];\n")
-                ->write("++\$context['loop']['index'];\n")
-                ->write("\$context['loop']['first'] = false;\n")
-            ;
-
-            if (!$this->getAttribute('ifexpr')) {
-                $compiler
-                    ->write("if (isset(\$context['loop']['length'])) {\n")
-                    ->indent()
-                    ->write("--\$context['loop']['revindex0'];\n")
-                    ->write("--\$context['loop']['revindex'];\n")
-                    ->write("\$context['loop']['last'] = 0 === \$context['loop']['revindex0'];\n")
-                    ->outdent()
-                    ->write("}\n")
-                ;
-            }
-        }
-    }
-}
Index: nc/libs/twig/Node/If.php
===================================================================
--- inc/libs/twig/Node/If.php	(revision 991)
+++ 	(revision )
@@ -1,67 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents an if node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_If extends Twig_Node
-{
-    public function __construct(Twig_NodeInterface $tests, Twig_NodeInterface $else = null, $lineno, $tag = null)
-    {
-        parent::__construct(array('tests' => $tests, 'else' => $else), array(), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler->addDebugInfo($this);
-        for ($i = 0; $i < count($this->getNode('tests')); $i += 2) {
-            if ($i > 0) {
-                $compiler
-                    ->outdent()
-                    ->write("} elseif (")
-                ;
-            } else {
-                $compiler
-                    ->write('if (')
-                ;
-            }
-
-            $compiler
-                ->subcompile($this->getNode('tests')->getNode($i))
-                ->raw(") {\n")
-                ->indent()
-                ->subcompile($this->getNode('tests')->getNode($i + 1))
-            ;
-        }
-
-        if ($this->hasNode('else') && null !== $this->getNode('else')) {
-            $compiler
-                ->outdent()
-                ->write("} else {\n")
-                ->indent()
-                ->subcompile($this->getNode('else'))
-            ;
-        }
-
-        $compiler
-            ->outdent()
-            ->write("}\n");
-    }
-}
Index: nc/libs/twig/Node/Import.php
===================================================================
--- inc/libs/twig/Node/Import.php	(revision 991)
+++ 	(revision )
@@ -1,51 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents an import node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Import extends Twig_Node
-{
-    public function __construct(Twig_Node_Expression $expr, Twig_Node_Expression $var, $lineno, $tag = null)
-    {
-        parent::__construct(array('expr' => $expr, 'var' => $var), array(), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->addDebugInfo($this)
-            ->write('')
-            ->subcompile($this->getNode('var'))
-            ->raw(' = ')
-        ;
-
-        if ($this->getNode('expr') instanceof Twig_Node_Expression_Name && '_self' === $this->getNode('expr')->getAttribute('name')) {
-            $compiler->raw("\$this");
-        } else {
-            $compiler
-                ->raw('$this->env->loadTemplate(')
-                ->subcompile($this->getNode('expr'))
-                ->raw(")")
-            ;
-        }
-
-        $compiler->raw(";\n");
-    }
-}
Index: nc/libs/twig/Node/Include.php
===================================================================
--- inc/libs/twig/Node/Include.php	(revision 991)
+++ 	(revision )
@@ -1,100 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents an include node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Include extends Twig_Node implements Twig_NodeOutputInterface
-{
-    public function __construct(Twig_Node_Expression $expr, Twig_Node_Expression $variables = null, $only = false, $ignoreMissing = false, $lineno, $tag = null)
-    {
-        parent::__construct(array('expr' => $expr, 'variables' => $variables), array('only' => (Boolean) $only, 'ignore_missing' => (Boolean) $ignoreMissing), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler->addDebugInfo($this);
-
-        if ($this->getAttribute('ignore_missing')) {
-            $compiler
-                ->write("try {\n")
-                ->indent()
-            ;
-        }
-
-        $this->addGetTemplate($compiler);
-
-        $compiler->raw('->display(');
-
-        $this->addTemplateArguments($compiler);
-
-        $compiler->raw(");\n");
-
-        if ($this->getAttribute('ignore_missing')) {
-            $compiler
-                ->outdent()
-                ->write("} catch (Twig_Error_Loader \$e) {\n")
-                ->indent()
-                ->write("// ignore missing template\n")
-                ->outdent()
-                ->write("}\n\n")
-            ;
-        }
-    }
-
-    protected function addGetTemplate(Twig_Compiler $compiler)
-    {
-        if ($this->getNode('expr') instanceof Twig_Node_Expression_Constant) {
-            $compiler
-                ->write("\$this->env->loadTemplate(")
-                ->subcompile($this->getNode('expr'))
-                ->raw(")")
-            ;
-        } else {
-            $compiler
-                ->write("\$template = \$this->env->resolveTemplate(")
-                ->subcompile($this->getNode('expr'))
-                ->raw(");\n")
-                ->write('$template')
-            ;
-        }
-    }
-
-    protected function addTemplateArguments(Twig_Compiler $compiler)
-    {
-        if (false === $this->getAttribute('only')) {
-            if (null === $this->getNode('variables')) {
-                $compiler->raw('$context');
-            } else {
-                $compiler
-                    ->raw('array_merge($context, ')
-                    ->subcompile($this->getNode('variables'))
-                    ->raw(')')
-                ;
-            }
-        } else {
-            if (null === $this->getNode('variables')) {
-                $compiler->raw('array()');
-            } else {
-                $compiler->subcompile($this->getNode('variables'));
-            }
-        }
-    }
-}
Index: nc/libs/twig/Node/Macro.php
===================================================================
--- inc/libs/twig/Node/Macro.php	(revision 991)
+++ 	(revision )
@@ -1,84 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a macro node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Macro extends Twig_Node
-{
-    public function __construct($name, Twig_NodeInterface $body, Twig_NodeInterface $arguments, $lineno, $tag = null)
-    {
-        parent::__construct(array('body' => $body, 'arguments' => $arguments), array('name' => $name), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $arguments = array();
-        foreach ($this->getNode('arguments') as $argument) {
-            $arguments[] = '$_'.$argument->getAttribute('name').' = null';
-        }
-
-        $compiler
-            ->addDebugInfo($this)
-            ->write(sprintf("public function get%s(%s)\n", $this->getAttribute('name'), implode(', ', $arguments)), "{\n")
-            ->indent()
-        ;
-
-        if (!count($this->getNode('arguments'))) {
-            $compiler->write("\$context = \$this->env->getGlobals();\n\n");
-        } else {
-            $compiler
-                ->write("\$context = \$this->env->mergeGlobals(array(\n")
-                ->indent()
-            ;
-
-            foreach ($this->getNode('arguments') as $argument) {
-                $compiler
-                    ->write('')
-                    ->string($argument->getAttribute('name'))
-                    ->raw(' => $_'.$argument->getAttribute('name'))
-                    ->raw(",\n")
-                ;
-            }
-
-            $compiler
-                ->outdent()
-                ->write("));\n\n")
-            ;
-        }
-
-        $compiler
-            ->write("\$blocks = array();\n\n")
-            ->write("ob_start();\n")
-            ->write("try {\n")
-            ->indent()
-            ->subcompile($this->getNode('body'))
-            ->outdent()
-            ->write("} catch (Exception \$e) {\n")
-            ->indent()
-            ->write("ob_end_clean();\n\n")
-            ->write("throw \$e;\n")
-            ->outdent()
-            ->write("}\n\n")
-            ->write("return ('' === \$tmp = ob_get_clean()) ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset());\n")
-            ->outdent()
-            ->write("}\n\n")
-        ;
-    }
-}
Index: nc/libs/twig/Node/Module.php
===================================================================
--- inc/libs/twig/Node/Module.php	(revision 991)
+++ 	(revision )
@@ -1,372 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a module node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Module extends Twig_Node
-{
-    public function __construct(Twig_NodeInterface $body, Twig_Node_Expression $parent = null, Twig_NodeInterface $blocks, Twig_NodeInterface $macros, Twig_NodeInterface $traits, $embeddedTemplates, $filename)
-    {
-        // embedded templates are set as attributes so that they are only visited once by the visitors
-        parent::__construct(array('parent' => $parent, 'body' => $body, 'blocks' => $blocks, 'macros' => $macros, 'traits' => $traits), array('filename' => $filename, 'index' => null, 'embedded_templates' => $embeddedTemplates), 1);
-    }
-
-    public function setIndex($index)
-    {
-        $this->setAttribute('index', $index);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $this->compileTemplate($compiler);
-
-        foreach ($this->getAttribute('embedded_templates') as $template) {
-            $compiler->subcompile($template);
-        }
-    }
-
-    protected function compileTemplate(Twig_Compiler $compiler)
-    {
-        if (!$this->getAttribute('index')) {
-            $compiler->write('<?php');
-        }
-
-        $this->compileClassHeader($compiler);
-
-        if (count($this->getNode('blocks')) || count($this->getNode('traits')) || null === $this->getNode('parent') || $this->getNode('parent') instanceof Twig_Node_Expression_Constant) {
-            $this->compileConstructor($compiler);
-        }
-
-        $this->compileGetParent($compiler);
-
-        $this->compileDisplayHeader($compiler);
-
-        $this->compileDisplayBody($compiler);
-
-        $this->compileDisplayFooter($compiler);
-
-        $compiler->subcompile($this->getNode('blocks'));
-
-        $this->compileMacros($compiler);
-
-        $this->compileGetTemplateName($compiler);
-
-        $this->compileIsTraitable($compiler);
-
-        $this->compileDebugInfo($compiler);
-
-        $this->compileClassFooter($compiler);
-    }
-
-    protected function compileGetParent(Twig_Compiler $compiler)
-    {
-        if (null === $this->getNode('parent')) {
-            return;
-        }
-
-        $compiler
-            ->write("protected function doGetParent(array \$context)\n", "{\n")
-            ->indent()
-            ->write("return ")
-        ;
-
-        if ($this->getNode('parent') instanceof Twig_Node_Expression_Constant) {
-            $compiler->subcompile($this->getNode('parent'));
-        } else {
-            $compiler
-                ->raw("\$this->env->resolveTemplate(")
-                ->subcompile($this->getNode('parent'))
-                ->raw(")")
-            ;
-        }
-
-        $compiler
-            ->raw(";\n")
-            ->outdent()
-            ->write("}\n\n")
-        ;
-    }
-
-    protected function compileDisplayBody(Twig_Compiler $compiler)
-    {
-        $compiler->subcompile($this->getNode('body'));
-
-        if (null !== $this->getNode('parent')) {
-            if ($this->getNode('parent') instanceof Twig_Node_Expression_Constant) {
-                $compiler->write("\$this->parent");
-            } else {
-                $compiler->write("\$this->getParent(\$context)");
-            }
-            $compiler->raw("->display(\$context, array_merge(\$this->blocks, \$blocks));\n");
-        }
-    }
-
-    protected function compileClassHeader(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->write("\n\n")
-            // if the filename contains */, add a blank to avoid a PHP parse error
-            ->write("/* ".str_replace('*/', '* /', $this->getAttribute('filename'))." */\n")
-            ->write('class '.$compiler->getEnvironment()->getTemplateClass($this->getAttribute('filename'), $this->getAttribute('index')))
-            ->raw(sprintf(" extends %s\n", $compiler->getEnvironment()->getBaseTemplateClass()))
-            ->write("{\n")
-            ->indent()
-        ;
-    }
-
-    protected function compileConstructor(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->write("public function __construct(Twig_Environment \$env)\n", "{\n")
-            ->indent()
-            ->write("parent::__construct(\$env);\n\n")
-        ;
-
-        // parent
-        if (null === $this->getNode('parent')) {
-            $compiler->write("\$this->parent = false;\n\n");
-        } elseif ($this->getNode('parent') instanceof Twig_Node_Expression_Constant) {
-            $compiler
-                ->write("\$this->parent = \$this->env->loadTemplate(")
-                ->subcompile($this->getNode('parent'))
-                ->raw(");\n\n")
-            ;
-        }
-
-        $countTraits = count($this->getNode('traits'));
-        if ($countTraits) {
-            // traits
-            foreach ($this->getNode('traits') as $i => $trait) {
-                $this->compileLoadTemplate($compiler, $trait->getNode('template'), sprintf('$_trait_%s', $i));
-
-                $compiler
-                    ->addDebugInfo($trait->getNode('template'))
-                    ->write(sprintf("if (!\$_trait_%s->isTraitable()) {\n", $i))
-                    ->indent()
-                    ->write("throw new Twig_Error_Runtime('Template \"'.")
-                    ->subcompile($trait->getNode('template'))
-                    ->raw(".'\" cannot be used as a trait.');\n")
-                    ->outdent()
-                    ->write("}\n")
-                    ->write(sprintf("\$_trait_%s_blocks = \$_trait_%s->getBlocks();\n\n", $i, $i))
-                ;
-
-                foreach ($trait->getNode('targets') as $key => $value) {
-                    $compiler
-                        ->write(sprintf("\$_trait_%s_blocks[", $i))
-                        ->subcompile($value)
-                        ->raw(sprintf("] = \$_trait_%s_blocks[", $i))
-                        ->string($key)
-                        ->raw(sprintf("]; unset(\$_trait_%s_blocks[", $i))
-                        ->string($key)
-                        ->raw("]);\n\n")
-                    ;
-                }
-            }
-
-            if ($countTraits > 1) {
-                $compiler
-                    ->write("\$this->traits = array_merge(\n")
-                    ->indent()
-                ;
-
-                for ($i = 0; $i < $countTraits; $i++) {
-                    $compiler
-                        ->write(sprintf("\$_trait_%s_blocks".($i == $countTraits - 1 ? '' : ',')."\n", $i))
-                    ;
-                }
-
-                $compiler
-                    ->outdent()
-                    ->write(");\n\n")
-                ;
-            } else {
-                $compiler
-                    ->write("\$this->traits = \$_trait_0_blocks;\n\n")
-                ;
-            }
-
-            $compiler
-                ->write("\$this->blocks = array_merge(\n")
-                ->indent()
-                ->write("\$this->traits,\n")
-                ->write("array(\n")
-            ;
-        } else {
-            $compiler
-                ->write("\$this->blocks = array(\n")
-            ;
-        }
-
-        // blocks
-        $compiler
-            ->indent()
-        ;
-
-        foreach ($this->getNode('blocks') as $name => $node) {
-            $compiler
-                ->write(sprintf("'%s' => array(\$this, 'block_%s'),\n", $name, $name))
-            ;
-        }
-
-        if ($countTraits) {
-            $compiler
-                ->outdent()
-                ->write(")\n")
-            ;
-        }
-
-        $compiler
-            ->outdent()
-            ->write(");\n")
-            ->outdent()
-            ->write("}\n\n");
-        ;
-    }
-
-    protected function compileDisplayHeader(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->write("protected function doDisplay(array \$context, array \$blocks = array())\n", "{\n")
-            ->indent()
-        ;
-    }
-
-    protected function compileDisplayFooter(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->outdent()
-            ->write("}\n\n")
-        ;
-    }
-
-    protected function compileClassFooter(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->outdent()
-            ->write("}\n")
-        ;
-    }
-
-    protected function compileMacros(Twig_Compiler $compiler)
-    {
-        $compiler->subcompile($this->getNode('macros'));
-    }
-
-    protected function compileGetTemplateName(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->write("public function getTemplateName()\n", "{\n")
-            ->indent()
-            ->write('return ')
-            ->repr($this->getAttribute('filename'))
-            ->raw(";\n")
-            ->outdent()
-            ->write("}\n\n")
-        ;
-    }
-
-    protected function compileIsTraitable(Twig_Compiler $compiler)
-    {
-        // A template can be used as a trait if:
-        //   * it has no parent
-        //   * it has no macros
-        //   * it has no body
-        //
-        // Put another way, a template can be used as a trait if it
-        // only contains blocks and use statements.
-        $traitable = null === $this->getNode('parent') && 0 === count($this->getNode('macros'));
-        if ($traitable) {
-            if ($this->getNode('body') instanceof Twig_Node_Body) {
-                $nodes = $this->getNode('body')->getNode(0);
-            } else {
-                $nodes = $this->getNode('body');
-            }
-
-            if (!count($nodes)) {
-                $nodes = new Twig_Node(array($nodes));
-            }
-
-            foreach ($nodes as $node) {
-                if (!count($node)) {
-                    continue;
-                }
-
-                if ($node instanceof Twig_Node_Text && ctype_space($node->getAttribute('data'))) {
-                    continue;
-                }
-
-                if ($node instanceof Twig_Node_BlockReference) {
-                    continue;
-                }
-
-                $traitable = false;
-                break;
-            }
-        }
-
-        if ($traitable) {
-            return;
-        }
-
-        $compiler
-            ->write("public function isTraitable()\n", "{\n")
-            ->indent()
-            ->write(sprintf("return %s;\n", $traitable ? 'true' : 'false'))
-            ->outdent()
-            ->write("}\n\n")
-        ;
-    }
-
-    protected function compileDebugInfo(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->write("public function getDebugInfo()\n", "{\n")
-            ->indent()
-            ->write(sprintf("return %s;\n", str_replace("\n", '', var_export(array_reverse($compiler->getDebugInfo(), true), true))))
-            ->outdent()
-            ->write("}\n")
-        ;
-    }
-
-    protected function compileLoadTemplate(Twig_Compiler $compiler, $node, $var)
-    {
-        if ($node instanceof Twig_Node_Expression_Constant) {
-            $compiler
-                ->write(sprintf("%s = \$this->env->loadTemplate(", $var))
-                ->subcompile($node)
-                ->raw(");\n")
-            ;
-        } else {
-            $compiler
-                ->write(sprintf("%s = ", $var))
-                ->subcompile($node)
-                ->raw(";\n")
-                ->write(sprintf("if (!%s", $var))
-                ->raw(" instanceof Twig_Template) {\n")
-                ->indent()
-                ->write(sprintf("%s = \$this->env->loadTemplate(%s);\n", $var, $var))
-                ->outdent()
-                ->write("}\n")
-            ;
-        }
-    }
-}
Index: nc/libs/twig/Node/Print.php
===================================================================
--- inc/libs/twig/Node/Print.php	(revision 991)
+++ 	(revision )
@@ -1,40 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a node that outputs an expression.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Print extends Twig_Node implements Twig_NodeOutputInterface
-{
-    public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null)
-    {
-        parent::__construct(array('expr' => $expr), array(), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->addDebugInfo($this)
-            ->write('echo ')
-            ->subcompile($this->getNode('expr'))
-            ->raw(";\n")
-        ;
-    }
-}
Index: nc/libs/twig/Node/Sandbox.php
===================================================================
--- inc/libs/twig/Node/Sandbox.php	(revision 991)
+++ 	(revision )
@@ -1,48 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a sandbox node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Sandbox extends Twig_Node
-{
-    public function __construct(Twig_NodeInterface $body, $lineno, $tag = null)
-    {
-        parent::__construct(array('body' => $body), array(), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->addDebugInfo($this)
-            ->write("\$sandbox = \$this->env->getExtension('sandbox');\n")
-            ->write("if (!\$alreadySandboxed = \$sandbox->isSandboxed()) {\n")
-            ->indent()
-            ->write("\$sandbox->enableSandbox();\n")
-            ->outdent()
-            ->write("}\n")
-            ->subcompile($this->getNode('body'))
-            ->write("if (!\$alreadySandboxed) {\n")
-            ->indent()
-            ->write("\$sandbox->disableSandbox();\n")
-            ->outdent()
-            ->write("}\n")
-        ;
-    }
-}
Index: nc/libs/twig/Node/SandboxedModule.php
===================================================================
--- inc/libs/twig/Node/SandboxedModule.php	(revision 991)
+++ 	(revision )
@@ -1,61 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a module node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_SandboxedModule extends Twig_Node_Module
-{
-    protected $usedFilters;
-    protected $usedTags;
-    protected $usedFunctions;
-
-    public function __construct(Twig_Node_Module $node, array $usedFilters, array $usedTags, array $usedFunctions)
-    {
-        parent::__construct($node->getNode('body'), $node->getNode('parent'), $node->getNode('blocks'), $node->getNode('macros'), $node->getNode('traits'), $node->getAttribute('embedded_templates'), $node->getAttribute('filename'), $node->getLine(), $node->getNodeTag());
-
-        $this->setAttribute('index', $node->getAttribute('index'));
-
-        $this->usedFilters = $usedFilters;
-        $this->usedTags = $usedTags;
-        $this->usedFunctions = $usedFunctions;
-    }
-
-    protected function compileDisplayBody(Twig_Compiler $compiler)
-    {
-        $compiler->write("\$this->checkSecurity();\n");
-
-        parent::compileDisplayBody($compiler);
-    }
-
-    protected function compileDisplayFooter(Twig_Compiler $compiler)
-    {
-        parent::compileDisplayFooter($compiler);
-
-        $compiler
-            ->write("protected function checkSecurity()\n", "{\n")
-            ->indent()
-            ->write("\$this->env->getExtension('sandbox')->checkSecurity(\n")
-            ->indent()
-            ->write(!$this->usedTags ? "array(),\n" : "array('".implode('\', \'', $this->usedTags)."'),\n")
-            ->write(!$this->usedFilters ? "array(),\n" : "array('".implode('\', \'', $this->usedFilters)."'),\n")
-            ->write(!$this->usedFunctions ? "array()\n" : "array('".implode('\', \'', $this->usedFunctions)."')\n")
-            ->outdent()
-            ->write(");\n")
-            ->outdent()
-            ->write("}\n\n")
-        ;
-    }
-}
Index: nc/libs/twig/Node/SandboxedPrint.php
===================================================================
--- inc/libs/twig/Node/SandboxedPrint.php	(revision 991)
+++ 	(revision )
@@ -1,60 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Twig_Node_SandboxedPrint adds a check for the __toString() method
- * when the variable is an object and the sandbox is activated.
- *
- * When there is a simple Print statement, like {{ article }},
- * and if the sandbox is enabled, we need to check that the __toString()
- * method is allowed if 'article' is an object.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_SandboxedPrint extends Twig_Node_Print
-{
-    public function __construct(Twig_Node_Expression $expr, $lineno, $tag = null)
-    {
-        parent::__construct($expr, $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->addDebugInfo($this)
-            ->write('echo $this->env->getExtension(\'sandbox\')->ensureToStringAllowed(')
-            ->subcompile($this->getNode('expr'))
-            ->raw(");\n")
-        ;
-    }
-
-    /**
-     * Removes node filters.
-     *
-     * This is mostly needed when another visitor adds filters (like the escaper one).
-     *
-     * @param Twig_Node $node A Node
-     */
-    protected function removeNodeFilter($node)
-    {
-        if ($node instanceof Twig_Node_Expression_Filter) {
-            return $this->removeNodeFilter($node->getNode('node'));
-        }
-
-        return $node;
-    }
-}
Index: nc/libs/twig/Node/Set.php
===================================================================
--- inc/libs/twig/Node/Set.php	(revision 991)
+++ 	(revision )
@@ -1,102 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a set node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Set extends Twig_Node
-{
-    public function __construct($capture, Twig_NodeInterface $names, Twig_NodeInterface $values, $lineno, $tag = null)
-    {
-        parent::__construct(array('names' => $names, 'values' => $values), array('capture' => $capture, 'safe' => false), $lineno, $tag);
-
-        /*
-         * Optimizes the node when capture is used for a large block of text.
-         *
-         * {% set foo %}foo{% endset %} is compiled to $context['foo'] = new Twig_Markup("foo");
-         */
-        if ($this->getAttribute('capture')) {
-            $this->setAttribute('safe', true);
-
-            $values = $this->getNode('values');
-            if ($values instanceof Twig_Node_Text) {
-                $this->setNode('values', new Twig_Node_Expression_Constant($values->getAttribute('data'), $values->getLine()));
-                $this->setAttribute('capture', false);
-            }
-        }
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler->addDebugInfo($this);
-
-        if (count($this->getNode('names')) > 1) {
-            $compiler->write('list(');
-            foreach ($this->getNode('names') as $idx => $node) {
-                if ($idx) {
-                    $compiler->raw(', ');
-                }
-
-                $compiler->subcompile($node);
-            }
-            $compiler->raw(')');
-        } else {
-            if ($this->getAttribute('capture')) {
-                $compiler
-                    ->write("ob_start();\n")
-                    ->subcompile($this->getNode('values'))
-                ;
-            }
-
-            $compiler->subcompile($this->getNode('names'), false);
-
-            if ($this->getAttribute('capture')) {
-                $compiler->raw(" = ('' === \$tmp = ob_get_clean()) ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset())");
-            }
-        }
-
-        if (!$this->getAttribute('capture')) {
-            $compiler->raw(' = ');
-
-            if (count($this->getNode('names')) > 1) {
-                $compiler->write('array(');
-                foreach ($this->getNode('values') as $idx => $value) {
-                    if ($idx) {
-                        $compiler->raw(', ');
-                    }
-
-                    $compiler->subcompile($value);
-                }
-                $compiler->raw(')');
-            } else {
-                if ($this->getAttribute('safe')) {
-                    $compiler
-                        ->raw("('' === \$tmp = ")
-                        ->subcompile($this->getNode('values'))
-                        ->raw(") ? '' : new Twig_Markup(\$tmp, \$this->env->getCharset())")
-                    ;
-                } else {
-                    $compiler->subcompile($this->getNode('values'));
-                }
-            }
-        }
-
-        $compiler->raw(";\n");
-    }
-}
Index: nc/libs/twig/Node/SetTemp.php
===================================================================
--- inc/libs/twig/Node/SetTemp.php	(revision 991)
+++ 	(revision )
@@ -1,35 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-class Twig_Node_SetTemp extends Twig_Node
-{
-    public function __construct($name, $lineno)
-    {
-        parent::__construct(array(), array('name' => $name), $lineno);
-    }
-
-    public function compile(Twig_Compiler $compiler)
-    {
-        $name = $this->getAttribute('name');
-        $compiler
-            ->addDebugInfo($this)
-            ->write('if (isset($context[')
-            ->string($name)
-            ->raw('])) { $_')
-            ->raw($name)
-            ->raw('_ = $context[')
-            ->repr($name)
-            ->raw(']; } else { $_')
-            ->raw($name)
-            ->raw("_ = null; }\n")
-        ;
-    }
-}
Index: nc/libs/twig/Node/Spaceless.php
===================================================================
--- inc/libs/twig/Node/Spaceless.php	(revision 991)
+++ 	(revision )
@@ -1,41 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a spaceless node.
- *
- * It removes spaces between HTML tags.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Spaceless extends Twig_Node
-{
-    public function __construct(Twig_NodeInterface $body, $lineno, $tag = 'spaceless')
-    {
-        parent::__construct(array('body' => $body), array(), $lineno, $tag);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->addDebugInfo($this)
-            ->write("ob_start();\n")
-            ->subcompile($this->getNode('body'))
-            ->write("echo trim(preg_replace('/>\s+</', '><', ob_get_clean()));\n")
-        ;
-    }
-}
Index: nc/libs/twig/Node/Text.php
===================================================================
--- inc/libs/twig/Node/Text.php	(revision 991)
+++ 	(revision )
@@ -1,40 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a text node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Node_Text extends Twig_Node implements Twig_NodeOutputInterface
-{
-    public function __construct($data, $lineno)
-    {
-        parent::__construct(array(), array('data' => $data), $lineno);
-    }
-
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler)
-    {
-        $compiler
-            ->addDebugInfo($this)
-            ->write('echo ')
-            ->string($this->getAttribute('data'))
-            ->raw(";\n")
-        ;
-    }
-}
Index: nc/libs/twig/NodeInterface.php
===================================================================
--- inc/libs/twig/NodeInterface.php	(revision 991)
+++ 	(revision )
@@ -1,30 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a node in the AST.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-interface Twig_NodeInterface extends Countable, IteratorAggregate
-{
-    /**
-     * Compiles the node to PHP.
-     *
-     * @param Twig_Compiler A Twig_Compiler instance
-     */
-    public function compile(Twig_Compiler $compiler);
-
-    public function getLine();
-
-    public function getNodeTag();
-}
Index: nc/libs/twig/NodeOutputInterface.php
===================================================================
--- inc/libs/twig/NodeOutputInterface.php	(revision 991)
+++ 	(revision )
@@ -1,20 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a displayable node in the AST.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-interface Twig_NodeOutputInterface
-{
-}
Index: nc/libs/twig/NodeTraverser.php
===================================================================
--- inc/libs/twig/NodeTraverser.php	(revision 991)
+++ 	(revision )
@@ -1,89 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Twig_NodeTraverser is a node traverser.
- *
- * It visits all nodes and their children and call the given visitor for each.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_NodeTraverser
-{
-    protected $env;
-    protected $visitors;
-
-    /**
-     * Constructor.
-     *
-     * @param Twig_Environment $env      A Twig_Environment instance
-     * @param array            $visitors An array of Twig_NodeVisitorInterface instances
-     */
-    public function __construct(Twig_Environment $env, array $visitors = array())
-    {
-        $this->env = $env;
-        $this->visitors = array();
-        foreach ($visitors as $visitor) {
-            $this->addVisitor($visitor);
-        }
-    }
-
-    /**
-     * Adds a visitor.
-     *
-     * @param Twig_NodeVisitorInterface $visitor A Twig_NodeVisitorInterface instance
-     */
-    public function addVisitor(Twig_NodeVisitorInterface $visitor)
-    {
-        if (!isset($this->visitors[$visitor->getPriority()])) {
-            $this->visitors[$visitor->getPriority()] = array();
-        }
-
-        $this->visitors[$visitor->getPriority()][] = $visitor;
-    }
-
-    /**
-     * Traverses a node and calls the registered visitors.
-     *
-     * @param Twig_NodeInterface $node A Twig_NodeInterface instance
-     */
-    public function traverse(Twig_NodeInterface $node)
-    {
-        ksort($this->visitors);
-        foreach ($this->visitors as $visitors) {
-            foreach ($visitors as $visitor) {
-                $node = $this->traverseForVisitor($visitor, $node);
-            }
-        }
-
-        return $node;
-    }
-
-    protected function traverseForVisitor(Twig_NodeVisitorInterface $visitor, Twig_NodeInterface $node = null)
-    {
-        if (null === $node) {
-            return null;
-        }
-
-        $node = $visitor->enterNode($node, $this->env);
-
-        foreach ($node as $k => $n) {
-            if (false !== $n = $this->traverseForVisitor($visitor, $n)) {
-                $node->setNode($k, $n);
-            } else {
-                $node->removeNode($k);
-            }
-        }
-
-        return $visitor->leaveNode($node, $this->env);
-    }
-}
Index: nc/libs/twig/NodeVisitor/Escaper.php
===================================================================
--- inc/libs/twig/NodeVisitor/Escaper.php	(revision 991)
+++ 	(revision )
@@ -1,172 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Twig_NodeVisitor_Escaper implements output escaping.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_NodeVisitor_Escaper implements Twig_NodeVisitorInterface
-{
-    protected $statusStack = array();
-    protected $blocks = array();
-    protected $safeAnalysis;
-    protected $traverser;
-    protected $defaultStrategy = false;
-    protected $safeVars = array();
-
-    public function __construct()
-    {
-        $this->safeAnalysis = new Twig_NodeVisitor_SafeAnalysis();
-    }
-
-    /**
-     * Called before child nodes are visited.
-     *
-     * @param Twig_NodeInterface $node The node to visit
-     * @param Twig_Environment   $env  The Twig environment instance
-     *
-     * @return Twig_NodeInterface The modified node
-     */
-    public function enterNode(Twig_NodeInterface $node, Twig_Environment $env)
-    {
-        if ($node instanceof Twig_Node_Module) {
-            if ($env->hasExtension('escaper') && $defaultStrategy = $env->getExtension('escaper')->getDefaultStrategy($node->getAttribute('filename'))) {
-                $this->defaultStrategy = $defaultStrategy;
-            }
-            $this->safeVars = array();
-        } elseif ($node instanceof Twig_Node_AutoEscape) {
-            $this->statusStack[] = $node->getAttribute('value');
-        } elseif ($node instanceof Twig_Node_Block) {
-            $this->statusStack[] = isset($this->blocks[$node->getAttribute('name')]) ? $this->blocks[$node->getAttribute('name')] : $this->needEscaping($env);
-        } elseif ($node instanceof Twig_Node_Import) {
-            $this->safeVars[] = $node->getNode('var')->getAttribute('name');
-        }
-
-        return $node;
-    }
-
-    /**
-     * Called after child nodes are visited.
-     *
-     * @param Twig_NodeInterface $node The node to visit
-     * @param Twig_Environment   $env  The Twig environment instance
-     *
-     * @return Twig_NodeInterface The modified node
-     */
-    public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env)
-    {
-        if ($node instanceof Twig_Node_Module) {
-            $this->defaultStrategy = false;
-            $this->safeVars = array();
-        } elseif ($node instanceof Twig_Node_Expression_Filter) {
-            return $this->preEscapeFilterNode($node, $env);
-        } elseif ($node instanceof Twig_Node_Print) {
-            return $this->escapePrintNode($node, $env, $this->needEscaping($env));
-        }
-
-        if ($node instanceof Twig_Node_AutoEscape || $node instanceof Twig_Node_Block) {
-            array_pop($this->statusStack);
-        } elseif ($node instanceof Twig_Node_BlockReference) {
-            $this->blocks[$node->getAttribute('name')] = $this->needEscaping($env);
-        }
-
-        return $node;
-    }
-
-    protected function escapePrintNode(Twig_Node_Print $node, Twig_Environment $env, $type)
-    {
-        if (false === $type) {
-            return $node;
-        }
-
-        $expression = $node->getNode('expr');
-
-        if ($this->isSafeFor($type, $expression, $env)) {
-            return $node;
-        }
-
-        $class = get_class($node);
-
-        return new $class(
-            $this->getEscaperFilter($type, $expression),
-            $node->getLine()
-        );
-    }
-
-    protected function preEscapeFilterNode(Twig_Node_Expression_Filter $filter, Twig_Environment $env)
-    {
-        $name = $filter->getNode('filter')->getAttribute('value');
-
-        if (false !== $f = $env->getFilter($name)) {
-            $type = $f->getPreEscape();
-            if (null === $type) {
-                return $filter;
-            }
-
-            $node = $filter->getNode('node');
-            if ($this->isSafeFor($type, $node, $env)) {
-                return $filter;
-            }
-
-            $filter->setNode('node', $this->getEscaperFilter($type, $node));
-
-            return $filter;
-        }
-
-        return $filter;
-    }
-
-    protected function isSafeFor($type, Twig_NodeInterface $expression, $env)
-    {
-        $safe = $this->safeAnalysis->getSafe($expression);
-
-        if (null === $safe) {
-            if (null === $this->traverser) {
-                $this->traverser = new Twig_NodeTraverser($env, array($this->safeAnalysis));
-            }
-
-            $this->safeAnalysis->setSafeVars($this->safeVars);
-
-            $this->traverser->traverse($expression);
-            $safe = $this->safeAnalysis->getSafe($expression);
-        }
-
-        return in_array($type, $safe) || in_array('all', $safe);
-    }
-
-    protected function needEscaping(Twig_Environment $env)
-    {
-        if (count($this->statusStack)) {
-            return $this->statusStack[count($this->statusStack) - 1];
-        }
-
-        return $this->defaultStrategy ? $this->defaultStrategy : false;
-    }
-
-    protected function getEscaperFilter($type, Twig_NodeInterface $node)
-    {
-        $line = $node->getLine();
-        $name = new Twig_Node_Expression_Constant('escape', $line);
-        $args = new Twig_Node(array(new Twig_Node_Expression_Constant((string) $type, $line), new Twig_Node_Expression_Constant(null, $line), new Twig_Node_Expression_Constant(true, $line)));
-
-        return new Twig_Node_Expression_Filter($node, $name, $args, $line);
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPriority()
-    {
-        return 0;
-    }
-}
Index: nc/libs/twig/NodeVisitor/Optimizer.php
===================================================================
--- inc/libs/twig/NodeVisitor/Optimizer.php	(revision 991)
+++ 	(revision )
@@ -1,247 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Twig_NodeVisitor_Optimizer tries to optimizes the AST.
- *
- * This visitor is always the last registered one.
- *
- * You can configure which optimizations you want to activate via the
- * optimizer mode.
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-class Twig_NodeVisitor_Optimizer implements Twig_NodeVisitorInterface
-{
-    const OPTIMIZE_ALL         = -1;
-    const OPTIMIZE_NONE        = 0;
-    const OPTIMIZE_FOR         = 2;
-    const OPTIMIZE_RAW_FILTER  = 4;
-    const OPTIMIZE_VAR_ACCESS  = 8;
-
-    protected $loops = array();
-    protected $optimizers;
-    protected $prependedNodes = array();
-    protected $inABody = false;
-
-    /**
-     * Constructor.
-     *
-     * @param integer $optimizers The optimizer mode
-     */
-    public function __construct($optimizers = -1)
-    {
-        if (!is_int($optimizers) || $optimizers > 2) {
-            throw new InvalidArgumentException(sprintf('Optimizer mode "%s" is not valid.', $optimizers));
-        }
-
-        $this->optimizers = $optimizers;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function enterNode(Twig_NodeInterface $node, Twig_Environment $env)
-    {
-        if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) {
-            $this->enterOptimizeFor($node, $env);
-        }
-
-        if (!version_compare(phpversion(), '5.4.0RC1', '>=') && self::OPTIMIZE_VAR_ACCESS === (self::OPTIMIZE_VAR_ACCESS & $this->optimizers) && !$env->isStrictVariables() && !$env->hasExtension('sandbox')) {
-            if ($this->inABody) {
-                if (!$node instanceof Twig_Node_Expression) {
-                    if (get_class($node) !== 'Twig_Node') {
-                        array_unshift($this->prependedNodes, array());
-                    }
-                } else {
-                    $node = $this->optimizeVariables($node, $env);
-                }
-            } elseif ($node instanceof Twig_Node_Body) {
-                $this->inABody = true;
-            }
-        }
-
-        return $node;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env)
-    {
-        $expression = $node instanceof Twig_Node_Expression;
-
-        if (self::OPTIMIZE_FOR === (self::OPTIMIZE_FOR & $this->optimizers)) {
-            $this->leaveOptimizeFor($node, $env);
-        }
-
-        if (self::OPTIMIZE_RAW_FILTER === (self::OPTIMIZE_RAW_FILTER & $this->optimizers)) {
-            $node = $this->optimizeRawFilter($node, $env);
-        }
-
-        $node = $this->optimizePrintNode($node, $env);
-
-        if (self::OPTIMIZE_VAR_ACCESS === (self::OPTIMIZE_VAR_ACCESS & $this->optimizers) && !$env->isStrictVariables() && !$env->hasExtension('sandbox')) {
-            if ($node instanceof Twig_Node_Body) {
-                $this->inABody = false;
-            } elseif ($this->inABody) {
-                if (!$expression && get_class($node) !== 'Twig_Node' && $prependedNodes = array_shift($this->prependedNodes)) {
-                    $nodes = array();
-                    foreach (array_unique($prependedNodes) as $name) {
-                        $nodes[] = new Twig_Node_SetTemp($name, $node->getLine());
-                    }
-
-                    $nodes[] = $node;
-                    $node = new Twig_Node($nodes);
-                }
-            }
-        }
-
-        return $node;
-    }
-
-    protected function optimizeVariables($node, $env)
-    {
-        if ('Twig_Node_Expression_Name' === get_class($node) && $node->isSimple()) {
-            $this->prependedNodes[0][] = $node->getAttribute('name');
-
-            return new Twig_Node_Expression_TempName($node->getAttribute('name'), $node->getLine());
-        }
-
-        return $node;
-    }
-
-    /**
-     * Optimizes print nodes.
-     *
-     * It replaces:
-     *
-     *   * "echo $this->render(Parent)Block()" with "$this->display(Parent)Block()"
-     *
-     * @param Twig_NodeInterface $node A Node
-     * @param Twig_Environment   $env  The current Twig environment
-     */
-    protected function optimizePrintNode($node, $env)
-    {
-        if (!$node instanceof Twig_Node_Print) {
-            return $node;
-        }
-
-        if (
-            $node->getNode('expr') instanceof Twig_Node_Expression_BlockReference ||
-            $node->getNode('expr') instanceof Twig_Node_Expression_Parent
-        ) {
-            $node->getNode('expr')->setAttribute('output', true);
-
-            return $node->getNode('expr');
-        }
-
-        return $node;
-    }
-
-    /**
-     * Removes "raw" filters.
-     *
-     * @param Twig_NodeInterface $node A Node
-     * @param Twig_Environment   $env  The current Twig environment
-     */
-    protected function optimizeRawFilter($node, $env)
-    {
-        if ($node instanceof Twig_Node_Expression_Filter && 'raw' == $node->getNode('filter')->getAttribute('value')) {
-            return $node->getNode('node');
-        }
-
-        return $node;
-    }
-
-    /**
-     * Optimizes "for" tag by removing the "loop" variable creation whenever possible.
-     *
-     * @param Twig_NodeInterface $node A Node
-     * @param Twig_Environment   $env  The current Twig environment
-     */
-    protected function enterOptimizeFor($node, $env)
-    {
-        if ($node instanceof Twig_Node_For) {
-            // disable the loop variable by default
-            $node->setAttribute('with_loop', false);
-            array_unshift($this->loops, $node);
-        } elseif (!$this->loops) {
-            // we are outside a loop
-            return;
-        }
-
-        // when do we need to add the loop variable back?
-
-        // the loop variable is referenced for the current loop
-        elseif ($node instanceof Twig_Node_Expression_Name && 'loop' === $node->getAttribute('name')) {
-            $this->addLoopToCurrent();
-        }
-
-        // block reference
-        elseif ($node instanceof Twig_Node_BlockReference || $node instanceof Twig_Node_Expression_BlockReference) {
-            $this->addLoopToCurrent();
-        }
-
-        // include without the only attribute
-        elseif ($node instanceof Twig_Node_Include && !$node->getAttribute('only')) {
-            $this->addLoopToAll();
-        }
-
-        // the loop variable is referenced via an attribute
-        elseif ($node instanceof Twig_Node_Expression_GetAttr
-            && (!$node->getNode('attribute') instanceof Twig_Node_Expression_Constant
-                || 'parent' === $node->getNode('attribute')->getAttribute('value')
-               )
-            && (true === $this->loops[0]->getAttribute('with_loop')
-                || ($node->getNode('node') instanceof Twig_Node_Expression_Name
-                    && 'loop' === $node->getNode('node')->getAttribute('name')
-                   )
-               )
-        ) {
-            $this->addLoopToAll();
-        }
-    }
-
-    /**
-     * Optimizes "for" tag by removing the "loop" variable creation whenever possible.
-     *
-     * @param Twig_NodeInterface $node A Node
-     * @param Twig_Environment   $env  The current Twig environment
-     */
-    protected function leaveOptimizeFor($node, $env)
-    {
-        if ($node instanceof Twig_Node_For) {
-            array_shift($this->loops);
-        }
-    }
-
-    protected function addLoopToCurrent()
-    {
-        $this->loops[0]->setAttribute('with_loop', true);
-    }
-
-    protected function addLoopToAll()
-    {
-        foreach ($this->loops as $loop) {
-            $loop->setAttribute('with_loop', true);
-        }
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPriority()
-    {
-        return 255;
-    }
-}
Index: nc/libs/twig/NodeVisitor/SafeAnalysis.php
===================================================================
--- inc/libs/twig/NodeVisitor/SafeAnalysis.php	(revision 991)
+++ 	(revision )
@@ -1,133 +1,0 @@
-<?php
-
-class Twig_NodeVisitor_SafeAnalysis implements Twig_NodeVisitorInterface
-{
-    protected $data = array();
-    protected $safeVars = array();
-
-    public function setSafeVars($safeVars)
-    {
-        $this->safeVars = $safeVars;
-    }
-
-    public function getSafe(Twig_NodeInterface $node)
-    {
-        $hash = spl_object_hash($node);
-        if (isset($this->data[$hash])) {
-            foreach ($this->data[$hash] as $bucket) {
-                if ($bucket['key'] === $node) {
-                    return $bucket['value'];
-                }
-            }
-        }
-
-        return null;
-    }
-
-    protected function setSafe(Twig_NodeInterface $node, array $safe)
-    {
-        $hash = spl_object_hash($node);
-        if (isset($this->data[$hash])) {
-            foreach ($this->data[$hash] as &$bucket) {
-                if ($bucket['key'] === $node) {
-                    $bucket['value'] = $safe;
-
-                    return;
-                }
-            }
-        }
-        $this->data[$hash][] = array(
-            'key' => $node,
-            'value' => $safe,
-        );
-    }
-
-    public function enterNode(Twig_NodeInterface $node, Twig_Environment $env)
-    {
-        return $node;
-    }
-
-    public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env)
-    {
-        if ($node instanceof Twig_Node_Expression_Constant) {
-            // constants are marked safe for all
-            $this->setSafe($node, array('all'));
-        } elseif ($node instanceof Twig_Node_Expression_BlockReference) {
-            // blocks are safe by definition
-            $this->setSafe($node, array('all'));
-        } elseif ($node instanceof Twig_Node_Expression_Parent) {
-            // parent block is safe by definition
-            $this->setSafe($node, array('all'));
-        } elseif ($node instanceof Twig_Node_Expression_Conditional) {
-            // intersect safeness of both operands
-            $safe = $this->intersectSafe($this->getSafe($node->getNode('expr2')), $this->getSafe($node->getNode('expr3')));
-            $this->setSafe($node, $safe);
-        } elseif ($node instanceof Twig_Node_Expression_Filter) {
-            // filter expression is safe when the filter is safe
-            $name = $node->getNode('filter')->getAttribute('value');
-            $args = $node->getNode('arguments');
-            if (false !== $filter = $env->getFilter($name)) {
-                $safe = $filter->getSafe($args);
-                if (null === $safe) {
-                    $safe = $this->intersectSafe($this->getSafe($node->getNode('node')), $filter->getPreservesSafety());
-                }
-                $this->setSafe($node, $safe);
-            } else {
-                $this->setSafe($node, array());
-            }
-        } elseif ($node instanceof Twig_Node_Expression_Function) {
-            // function expression is safe when the function is safe
-            $name = $node->getAttribute('name');
-            $args = $node->getNode('arguments');
-            $function = $env->getFunction($name);
-            if (false !== $function) {
-                $this->setSafe($node, $function->getSafe($args));
-            } else {
-                $this->setSafe($node, array());
-            }
-        } elseif ($node instanceof Twig_Node_Expression_MethodCall) {
-            if ($node->getAttribute('safe')) {
-                $this->setSafe($node, array('all'));
-            } else {
-                $this->setSafe($node, array());
-            }
-        } elseif ($node instanceof Twig_Node_Expression_GetAttr && $node->getNode('node') instanceof Twig_Node_Expression_Name) {
-            $name = $node->getNode('node')->getAttribute('name');
-            // attributes on template instances are safe
-            if ('_self' == $name || in_array($name, $this->safeVars)) {
-                $this->setSafe($node, array('all'));
-            } else {
-                $this->setSafe($node, array());
-            }
-        } else {
-            $this->setSafe($node, array());
-        }
-
-        return $node;
-    }
-
-    protected function intersectSafe(array $a = null, array $b = null)
-    {
-        if (null === $a || null === $b) {
-            return array();
-        }
-
-        if (in_array('all', $a)) {
-            return $b;
-        }
-
-        if (in_array('all', $b)) {
-            return $a;
-        }
-
-        return array_intersect($a, $b);
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPriority()
-    {
-        return 0;
-    }
-}
Index: nc/libs/twig/NodeVisitor/Sandbox.php
===================================================================
--- inc/libs/twig/NodeVisitor/Sandbox.php	(revision 991)
+++ 	(revision )
@@ -1,93 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Twig_NodeVisitor_Sandbox implements sandboxing.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_NodeVisitor_Sandbox implements Twig_NodeVisitorInterface
-{
-    protected $inAModule = false;
-    protected $tags;
-    protected $filters;
-    protected $functions;
-
-    /**
-     * Called before child nodes are visited.
-     *
-     * @param Twig_NodeInterface $node The node to visit
-     * @param Twig_Environment   $env  The Twig environment instance
-     *
-     * @return Twig_NodeInterface The modified node
-     */
-    public function enterNode(Twig_NodeInterface $node, Twig_Environment $env)
-    {
-        if ($node instanceof Twig_Node_Module) {
-            $this->inAModule = true;
-            $this->tags = array();
-            $this->filters = array();
-            $this->functions = array();
-
-            return $node;
-        } elseif ($this->inAModule) {
-            // look for tags
-            if ($node->getNodeTag()) {
-                $this->tags[] = $node->getNodeTag();
-            }
-
-            // look for filters
-            if ($node instanceof Twig_Node_Expression_Filter) {
-                $this->filters[] = $node->getNode('filter')->getAttribute('value');
-            }
-
-            // look for functions
-            if ($node instanceof Twig_Node_Expression_Function) {
-                $this->functions[] = $node->getAttribute('name');
-            }
-
-            // wrap print to check __toString() calls
-            if ($node instanceof Twig_Node_Print) {
-                return new Twig_Node_SandboxedPrint($node->getNode('expr'), $node->getLine(), $node->getNodeTag());
-            }
-        }
-
-        return $node;
-    }
-
-    /**
-     * Called after child nodes are visited.
-     *
-     * @param Twig_NodeInterface $node The node to visit
-     * @param Twig_Environment   $env  The Twig environment instance
-     *
-     * @return Twig_NodeInterface The modified node
-     */
-    public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env)
-    {
-        if ($node instanceof Twig_Node_Module) {
-            $this->inAModule = false;
-
-            return new Twig_Node_SandboxedModule($node, array_unique($this->filters), array_unique($this->tags), array_unique($this->functions));
-        }
-
-        return $node;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getPriority()
-    {
-        return 0;
-    }
-}
Index: nc/libs/twig/NodeVisitorInterface.php
===================================================================
--- inc/libs/twig/NodeVisitorInterface.php	(revision 991)
+++ 	(revision )
@@ -1,48 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Twig_NodeVisitorInterface is the interface the all node visitor classes must implement.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-interface Twig_NodeVisitorInterface
-{
-    /**
-     * Called before child nodes are visited.
-     *
-     * @param Twig_NodeInterface $node The node to visit
-     * @param Twig_Environment   $env  The Twig environment instance
-     *
-     * @return Twig_NodeInterface The modified node
-     */
-    public function enterNode(Twig_NodeInterface $node, Twig_Environment $env);
-
-    /**
-     * Called after child nodes are visited.
-     *
-     * @param Twig_NodeInterface $node The node to visit
-     * @param Twig_Environment   $env  The Twig environment instance
-     *
-     * @return Twig_NodeInterface The modified node
-     */
-    public function leaveNode(Twig_NodeInterface $node, Twig_Environment $env);
-
-    /**
-     * Returns the priority for this visitor.
-     *
-     * Priority should be between -10 and 10 (0 is the default).
-     *
-     * @return integer The priority level
-     */
-    public function getPriority();
-}
Index: nc/libs/twig/Parser.php
===================================================================
--- inc/libs/twig/Parser.php	(revision 991)
+++ 	(revision )
@@ -1,395 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Default parser implementation.
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Parser implements Twig_ParserInterface
-{
-    protected $stack = array();
-    protected $stream;
-    protected $parent;
-    protected $handlers;
-    protected $visitors;
-    protected $expressionParser;
-    protected $blocks;
-    protected $blockStack;
-    protected $macros;
-    protected $env;
-    protected $reservedMacroNames;
-    protected $importedSymbols;
-    protected $traits;
-    protected $embeddedTemplates = array();
-
-    /**
-     * Constructor.
-     *
-     * @param Twig_Environment $env A Twig_Environment instance
-     */
-    public function __construct(Twig_Environment $env)
-    {
-        $this->env = $env;
-    }
-
-    public function getEnvironment()
-    {
-        return $this->env;
-    }
-
-    public function getVarName()
-    {
-        return sprintf('__internal_%s', hash('sha1', uniqid(mt_rand(), true), false));
-    }
-
-    public function getFilename()
-    {
-        return $this->stream->getFilename();
-    }
-
-    /**
-     * Converts a token stream to a node tree.
-     *
-     * @param Twig_TokenStream $stream A token stream instance
-     *
-     * @return Twig_Node_Module A node tree
-     */
-    public function parse(Twig_TokenStream $stream, $test = null, $dropNeedle = false)
-    {
-        // push all variables into the stack to keep the current state of the parser
-        $vars = get_object_vars($this);
-        unset($vars['stack'], $vars['env'], $vars['handlers'], $vars['visitors'], $vars['expressionParser']);
-        $this->stack[] = $vars;
-
-        // tag handlers
-        if (null === $this->handlers) {
-            $this->handlers = $this->env->getTokenParsers();
-            $this->handlers->setParser($this);
-        }
-
-        // node visitors
-        if (null === $this->visitors) {
-            $this->visitors = $this->env->getNodeVisitors();
-        }
-
-        if (null === $this->expressionParser) {
-            $this->expressionParser = new Twig_ExpressionParser($this, $this->env->getUnaryOperators(), $this->env->getBinaryOperators());
-        }
-
-        $this->stream = $stream;
-        $this->parent = null;
-        $this->blocks = array();
-        $this->macros = array();
-        $this->traits = array();
-        $this->blockStack = array();
-        $this->importedSymbols = array(array());
-        $this->embeddedTemplates = array();
-
-        try {
-            $body = $this->subparse($test, $dropNeedle);
-
-            if (null !== $this->parent) {
-                if (null === $body = $this->filterBodyNodes($body)) {
-                    $body = new Twig_Node();
-                }
-            }
-        } catch (Twig_Error_Syntax $e) {
-            if (!$e->getTemplateFile()) {
-                $e->setTemplateFile($this->getFilename());
-            }
-
-            if (!$e->getTemplateLine()) {
-                $e->setTemplateLine($this->stream->getCurrent()->getLine());
-            }
-
-            throw $e;
-        }
-
-        $node = new Twig_Node_Module(new Twig_Node_Body(array($body)), $this->parent, new Twig_Node($this->blocks), new Twig_Node($this->macros), new Twig_Node($this->traits), $this->embeddedTemplates, $this->getFilename());
-
-        $traverser = new Twig_NodeTraverser($this->env, $this->visitors);
-
-        $node = $traverser->traverse($node);
-
-        // restore previous stack so previous parse() call can resume working
-        foreach (array_pop($this->stack) as $key => $val) {
-            $this->$key = $val;
-        }
-
-        return $node;
-    }
-
-    public function subparse($test, $dropNeedle = false)
-    {
-        $lineno = $this->getCurrentToken()->getLine();
-        $rv = array();
-        while (!$this->stream->isEOF()) {
-            switch ($this->getCurrentToken()->getType()) {
-                case Twig_Token::TEXT_TYPE:
-                    $token = $this->stream->next();
-                    $rv[] = new Twig_Node_Text($token->getValue(), $token->getLine());
-                    break;
-
-                case Twig_Token::VAR_START_TYPE:
-                    $token = $this->stream->next();
-                    $expr = $this->expressionParser->parseExpression();
-                    $this->stream->expect(Twig_Token::VAR_END_TYPE);
-                    $rv[] = new Twig_Node_Print($expr, $token->getLine());
-                    break;
-
-                case Twig_Token::BLOCK_START_TYPE:
-                    $this->stream->next();
-                    $token = $this->getCurrentToken();
-
-                    if ($token->getType() !== Twig_Token::NAME_TYPE) {
-                        throw new Twig_Error_Syntax('A block must start with a tag name', $token->getLine(), $this->getFilename());
-                    }
-
-                    if (null !== $test && call_user_func($test, $token)) {
-                        if ($dropNeedle) {
-                            $this->stream->next();
-                        }
-
-                        if (1 === count($rv)) {
-                            return $rv[0];
-                        }
-
-                        return new Twig_Node($rv, array(), $lineno);
-                    }
-
-                    $subparser = $this->handlers->getTokenParser($token->getValue());
-                    if (null === $subparser) {
-                        if (null !== $test) {
-                            $error = sprintf('Unexpected tag name "%s"', $token->getValue());
-                            if (is_array($test) && isset($test[0]) && $test[0] instanceof Twig_TokenParserInterface) {
-                                $error .= sprintf(' (expecting closing tag for the "%s" tag defined near line %s)', $test[0]->getTag(), $lineno);
-                            }
-
-                            throw new Twig_Error_Syntax($error, $token->getLine(), $this->getFilename());
-                        }
-
-                        $message = sprintf('Unknown tag name "%s"', $token->getValue());
-                        if ($alternatives = $this->env->computeAlternatives($token->getValue(), array_keys($this->env->getTags()))) {
-                            $message = sprintf('%s. Did you mean "%s"', $message, implode('", "', $alternatives));
-                        }
-
-                        throw new Twig_Error_Syntax($message, $token->getLine(), $this->getFilename());
-                    }
-
-                    $this->stream->next();
-
-                    $node = $subparser->parse($token);
-                    if (null !== $node) {
-                        $rv[] = $node;
-                    }
-                    break;
-
-                default:
-                    throw new Twig_Error_Syntax('Lexer or parser ended up in unsupported state.', 0, $this->getFilename());
-            }
-        }
-
-        if (1 === count($rv)) {
-            return $rv[0];
-        }
-
-        return new Twig_Node($rv, array(), $lineno);
-    }
-
-    public function addHandler($name, $class)
-    {
-        $this->handlers[$name] = $class;
-    }
-
-    public function addNodeVisitor(Twig_NodeVisitorInterface $visitor)
-    {
-        $this->visitors[] = $visitor;
-    }
-
-    public function getBlockStack()
-    {
-        return $this->blockStack;
-    }
-
-    public function peekBlockStack()
-    {
-        return $this->blockStack[count($this->blockStack) - 1];
-    }
-
-    public function popBlockStack()
-    {
-        array_pop($this->blockStack);
-    }
-
-    public function pushBlockStack($name)
-    {
-        $this->blockStack[] = $name;
-    }
-
-    public function hasBlock($name)
-    {
-        return isset($this->blocks[$name]);
-    }
-
-    public function getBlock($name)
-    {
-        return $this->blocks[$name];
-    }
-
-    public function setBlock($name, $value)
-    {
-        $this->blocks[$name] = new Twig_Node_Body(array($value), array(), $value->getLine());
-    }
-
-    public function hasMacro($name)
-    {
-        return isset($this->macros[$name]);
-    }
-
-    public function setMacro($name, Twig_Node_Macro $node)
-    {
-        if (null === $this->reservedMacroNames) {
-            $this->reservedMacroNames = array();
-            $r = new ReflectionClass($this->env->getBaseTemplateClass());
-            foreach ($r->getMethods() as $method) {
-                $this->reservedMacroNames[] = $method->getName();
-            }
-        }
-
-        if (in_array($name, $this->reservedMacroNames)) {
-            throw new Twig_Error_Syntax(sprintf('"%s" cannot be used as a macro name as it is a reserved keyword', $name), $node->getLine(), $this->getFilename());
-        }
-
-        $this->macros[$name] = $node;
-    }
-
-    public function addTrait($trait)
-    {
-        $this->traits[] = $trait;
-    }
-
-    public function hasTraits()
-    {
-        return count($this->traits) > 0;
-    }
-
-    public function embedTemplate(Twig_Node_Module $template)
-    {
-        $template->setIndex(mt_rand());
-
-        $this->embeddedTemplates[] = $template;
-    }
-
-    public function addImportedSymbol($type, $alias, $name = null, Twig_Node_Expression $node = null)
-    {
-        $this->importedSymbols[0][$type][$alias] = array('name' => $name, 'node' => $node);
-    }
-
-    public function getImportedSymbol($type, $alias)
-    {
-        foreach ($this->importedSymbols as $functions) {
-            if (isset($functions[$type][$alias])) {
-                return $functions[$type][$alias];
-            }
-        }
-    }
-
-    public function isMainScope()
-    {
-        return 1 === count($this->importedSymbols);
-    }
-
-    public function pushLocalScope()
-    {
-        array_unshift($this->importedSymbols, array());
-    }
-
-    public function popLocalScope()
-    {
-        array_shift($this->importedSymbols);
-    }
-
-    /**
-     * Gets the expression parser.
-     *
-     * @return Twig_ExpressionParser The expression parser
-     */
-    public function getExpressionParser()
-    {
-        return $this->expressionParser;
-    }
-
-    public function getParent()
-    {
-        return $this->parent;
-    }
-
-    public function setParent($parent)
-    {
-        $this->parent = $parent;
-    }
-
-    /**
-     * Gets the token stream.
-     *
-     * @return Twig_TokenStream The token stream
-     */
-    public function getStream()
-    {
-        return $this->stream;
-    }
-
-    /**
-     * Gets the current token.
-     *
-     * @return Twig_Token The current token
-     */
-    public function getCurrentToken()
-    {
-        return $this->stream->getCurrent();
-    }
-
-    protected function filterBodyNodes(Twig_NodeInterface $node)
-    {
-        // check that the body does not contain non-empty output nodes
-        if (
-            ($node instanceof Twig_Node_Text && !ctype_space($node->getAttribute('data')))
-            ||
-            (!$node instanceof Twig_Node_Text && !$node instanceof Twig_Node_BlockReference && $node instanceof Twig_NodeOutputInterface)
-        ) {
-            if (false !== strpos((string) $node, chr(0xEF).chr(0xBB).chr(0xBF))) {
-                throw new Twig_Error_Syntax('A template that extends another one cannot have a body but a byte order mark (BOM) has been detected; it must be removed.', $node->getLine(), $this->getFilename());
-            }
-
-            throw new Twig_Error_Syntax('A template that extends another one cannot have a body.', $node->getLine(), $this->getFilename());
-        }
-
-        // bypass "set" nodes as they "capture" the output
-        if ($node instanceof Twig_Node_Set) {
-            return $node;
-        }
-
-        if ($node instanceof Twig_NodeOutputInterface) {
-            return;
-        }
-
-        foreach ($node as $k => $n) {
-            if (null !== $n && null === $n = $this->filterBodyNodes($n)) {
-                $node->removeNode($k);
-            }
-        }
-
-        return $node;
-    }
-}
Index: nc/libs/twig/ParserInterface.php
===================================================================
--- inc/libs/twig/ParserInterface.php	(revision 991)
+++ 	(revision )
@@ -1,28 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Interface implemented by parser classes.
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-interface Twig_ParserInterface
-{
-    /**
-     * Converts a token stream to a node tree.
-     *
-     * @param Twig_TokenStream $stream A token stream instance
-     *
-     * @return Twig_Node_Module A node tree
-     */
-    public function parse(Twig_TokenStream $stream);
-}
Index: nc/libs/twig/Sandbox/SecurityError.php
===================================================================
--- inc/libs/twig/Sandbox/SecurityError.php	(revision 991)
+++ 	(revision )
@@ -1,20 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Exception thrown when a security error occurs at runtime.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Sandbox_SecurityError extends Twig_Error
-{
-}
Index: nc/libs/twig/Sandbox/SecurityPolicy.php
===================================================================
--- inc/libs/twig/Sandbox/SecurityPolicy.php	(revision 991)
+++ 	(revision )
@@ -1,120 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a security policy which need to be enforced when sandbox mode is enabled.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Sandbox_SecurityPolicy implements Twig_Sandbox_SecurityPolicyInterface
-{
-    protected $allowedTags;
-    protected $allowedFilters;
-    protected $allowedMethods;
-    protected $allowedProperties;
-    protected $allowedFunctions;
-
-    public function __construct(array $allowedTags = array(), array $allowedFilters = array(), array $allowedMethods = array(), array $allowedProperties = array(), array $allowedFunctions = array())
-    {
-        $this->allowedTags = $allowedTags;
-        $this->allowedFilters = $allowedFilters;
-        $this->setAllowedMethods($allowedMethods);
-        $this->allowedProperties = $allowedProperties;
-        $this->allowedFunctions = $allowedFunctions;
-    }
-
-    public function setAllowedTags(array $tags)
-    {
-        $this->allowedTags = $tags;
-    }
-
-    public function setAllowedFilters(array $filters)
-    {
-        $this->allowedFilters = $filters;
-    }
-
-    public function setAllowedMethods(array $methods)
-    {
-        $this->allowedMethods = array();
-        foreach ($methods as $class => $m) {
-            $this->allowedMethods[$class] = array_map('strtolower', is_array($m) ? $m : array($m));
-        }
-    }
-
-    public function setAllowedProperties(array $properties)
-    {
-        $this->allowedProperties = $properties;
-    }
-
-    public function setAllowedFunctions(array $functions)
-    {
-        $this->allowedFunctions = $functions;
-    }
-
-    public function checkSecurity($tags, $filters, $functions)
-    {
-        foreach ($tags as $tag) {
-            if (!in_array($tag, $this->allowedTags)) {
-                throw new Twig_Sandbox_SecurityError(sprintf('Tag "%s" is not allowed.', $tag));
-            }
-        }
-
-        foreach ($filters as $filter) {
-            if (!in_array($filter, $this->allowedFilters)) {
-                throw new Twig_Sandbox_SecurityError(sprintf('Filter "%s" is not allowed.', $filter));
-            }
-        }
-
-        foreach ($functions as $function) {
-            if (!in_array($function, $this->allowedFunctions)) {
-                throw new Twig_Sandbox_SecurityError(sprintf('Function "%s" is not allowed.', $function));
-            }
-        }
-    }
-
-    public function checkMethodAllowed($obj, $method)
-    {
-        if ($obj instanceof Twig_TemplateInterface || $obj instanceof Twig_Markup) {
-            return true;
-        }
-
-        $allowed = false;
-        $method = strtolower($method);
-        foreach ($this->allowedMethods as $class => $methods) {
-            if ($obj instanceof $class) {
-                $allowed = in_array($method, $methods);
-
-                break;
-            }
-        }
-
-        if (!$allowed) {
-            throw new Twig_Sandbox_SecurityError(sprintf('Calling "%s" method on a "%s" object is not allowed.', $method, get_class($obj)));
-        }
-    }
-
-    public function checkPropertyAllowed($obj, $property)
-    {
-        $allowed = false;
-        foreach ($this->allowedProperties as $class => $properties) {
-            if ($obj instanceof $class) {
-                $allowed = in_array($property, is_array($properties) ? $properties : array($properties));
-
-                break;
-            }
-        }
-
-        if (!$allowed) {
-            throw new Twig_Sandbox_SecurityError(sprintf('Calling "%s" property on a "%s" object is not allowed.', $property, get_class($obj)));
-        }
-    }
-}
Index: nc/libs/twig/Sandbox/SecurityPolicyInterface.php
===================================================================
--- inc/libs/twig/Sandbox/SecurityPolicyInterface.php	(revision 991)
+++ 	(revision )
@@ -1,25 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Interfaces that all security policy classes must implements.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-interface Twig_Sandbox_SecurityPolicyInterface
-{
-    public function checkSecurity($tags, $filters, $functions);
-
-    public function checkMethodAllowed($obj, $method);
-
-    public function checkPropertyAllowed($obj, $method);
-}
Index: nc/libs/twig/Template.php
===================================================================
--- inc/libs/twig/Template.php	(revision 991)
+++ 	(revision )
@@ -1,454 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Default base class for compiled templates.
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-abstract class Twig_Template implements Twig_TemplateInterface
-{
-    protected static $cache = array();
-
-    protected $parent;
-    protected $parents;
-    protected $env;
-    protected $blocks;
-    protected $traits;
-
-    /**
-     * Constructor.
-     *
-     * @param Twig_Environment $env A Twig_Environment instance
-     */
-    public function __construct(Twig_Environment $env)
-    {
-        $this->env = $env;
-        $this->blocks = array();
-        $this->traits = array();
-    }
-
-    /**
-     * Returns the template name.
-     *
-     * @return string The template name
-     */
-    abstract public function getTemplateName();
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getEnvironment()
-    {
-        return $this->env;
-    }
-
-    /**
-     * Returns the parent template.
-     *
-     * This method is for internal use only and should never be called
-     * directly.
-     *
-     * @return Twig_TemplateInterface|false The parent template or false if there is no parent
-     */
-    public function getParent(array $context)
-    {
-        if (null !== $this->parent) {
-            return $this->parent;
-        }
-
-        $parent = $this->doGetParent($context);
-        if (false === $parent) {
-            return false;
-        } elseif ($parent instanceof Twig_Template) {
-            $name = $parent->getTemplateName();
-            $this->parents[$name] = $parent;
-            $parent = $name;
-        } elseif (!isset($this->parents[$parent])) {
-            $this->parents[$parent] = $this->env->loadTemplate($parent);
-        }
-
-        return $this->parents[$parent];
-    }
-
-    protected function doGetParent(array $context)
-    {
-        return false;
-    }
-
-    public function isTraitable()
-    {
-        return true;
-    }
-
-    /**
-     * Displays a parent block.
-     *
-     * This method is for internal use only and should never be called
-     * directly.
-     *
-     * @param string $name    The block name to display from the parent
-     * @param array  $context The context
-     * @param array  $blocks  The current set of blocks
-     */
-    public function displayParentBlock($name, array $context, array $blocks = array())
-    {
-        $name = (string) $name;
-
-        if (isset($this->traits[$name])) {
-            $this->traits[$name][0]->displayBlock($name, $context, $blocks);
-        } elseif (false !== $parent = $this->getParent($context)) {
-            $parent->displayBlock($name, $context, $blocks);
-        } else {
-            throw new Twig_Error_Runtime(sprintf('The template has no parent and no traits defining the "%s" block', $name), -1, $this->getTemplateName());
-        }
-    }
-
-    /**
-     * Displays a block.
-     *
-     * This method is for internal use only and should never be called
-     * directly.
-     *
-     * @param string $name    The block name to display
-     * @param array  $context The context
-     * @param array  $blocks  The current set of blocks
-     */
-    public function displayBlock($name, array $context, array $blocks = array())
-    {
-        $name = (string) $name;
-
-        if (isset($blocks[$name])) {
-            $b = $blocks;
-            unset($b[$name]);
-            call_user_func($blocks[$name], $context, $b);
-        } elseif (isset($this->blocks[$name])) {
-            call_user_func($this->blocks[$name], $context, $blocks);
-        } elseif (false !== $parent = $this->getParent($context)) {
-            $parent->displayBlock($name, $context, array_merge($this->blocks, $blocks));
-        }
-    }
-
-    /**
-     * Renders a parent block.
-     *
-     * This method is for internal use only and should never be called
-     * directly.
-     *
-     * @param string $name    The block name to render from the parent
-     * @param array  $context The context
-     * @param array  $blocks  The current set of blocks
-     *
-     * @return string The rendered block
-     */
-    public function renderParentBlock($name, array $context, array $blocks = array())
-    {
-        ob_start();
-        $this->displayParentBlock($name, $context, $blocks);
-
-        return ob_get_clean();
-    }
-
-    /**
-     * Renders a block.
-     *
-     * This method is for internal use only and should never be called
-     * directly.
-     *
-     * @param string $name    The block name to render
-     * @param array  $context The context
-     * @param array  $blocks  The current set of blocks
-     *
-     * @return string The rendered block
-     */
-    public function renderBlock($name, array $context, array $blocks = array())
-    {
-        ob_start();
-        $this->displayBlock($name, $context, $blocks);
-
-        return ob_get_clean();
-    }
-
-    /**
-     * Returns whether a block exists or not.
-     *
-     * This method is for internal use only and should never be called
-     * directly.
-     *
-     * This method does only return blocks defined in the current template
-     * or defined in "used" traits.
-     *
-     * It does not return blocks from parent templates as the parent
-     * template name can be dynamic, which is only known based on the
-     * current context.
-     *
-     * @param string $name The block name
-     *
-     * @return Boolean true if the block exists, false otherwise
-     */
-    public function hasBlock($name)
-    {
-        return isset($this->blocks[(string) $name]);
-    }
-
-    /**
-     * Returns all block names.
-     *
-     * This method is for internal use only and should never be called
-     * directly.
-     *
-     * @return array An array of block names
-     *
-     * @see hasBlock
-     */
-    public function getBlockNames()
-    {
-        return array_keys($this->blocks);
-    }
-
-    /**
-     * Returns all blocks.
-     *
-     * This method is for internal use only and should never be called
-     * directly.
-     *
-     * @return array An array of blocks
-     *
-     * @see hasBlock
-     */
-    public function getBlocks()
-    {
-        return $this->blocks;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function display(array $context, array $blocks = array())
-    {
-        $this->displayWithErrorHandling($this->env->mergeGlobals($context), $blocks);
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function render(array $context)
-    {
-        $level = ob_get_level();
-        ob_start();
-        try {
-            $this->display($context);
-        } catch (Exception $e) {
-            while (ob_get_level() > $level) {
-                ob_end_clean();
-            }
-
-            throw $e;
-        }
-
-        return ob_get_clean();
-    }
-
-    protected function displayWithErrorHandling(array $context, array $blocks = array())
-    {
-        try {
-            $this->doDisplay($context, $blocks);
-        } catch (Twig_Error $e) {
-            if (!$e->getTemplateFile()) {
-                $e->setTemplateFile($this->getTemplateName());
-            }
-
-            // this is mostly useful for Twig_Error_Loader exceptions
-            // see Twig_Error_Loader
-            if (false === $e->getTemplateLine()) {
-                $e->setTemplateLine(-1);
-                $e->guess();
-            }
-
-            throw $e;
-        } catch (Exception $e) {
-            throw new Twig_Error_Runtime(sprintf('An exception has been thrown during the rendering of a template ("%s").', $e->getMessage()), -1, null, $e);
-        }
-    }
-
-    /**
-     * Auto-generated method to display the template with the given context.
-     *
-     * @param array $context An array of parameters to pass to the template
-     * @param array $blocks  An array of blocks to pass to the template
-     */
-    abstract protected function doDisplay(array $context, array $blocks = array());
-
-    /**
-     * Returns a variable from the context.
-     *
-     * This method is for internal use only and should never be called
-     * directly.
-     *
-     * This method should not be overridden in a sub-class as this is an
-     * implementation detail that has been introduced to optimize variable
-     * access for versions of PHP before 5.4. This is not a way to override
-     * the way to get a variable value.
-     *
-     * @param array   $context           The context
-     * @param string  $item              The variable to return from the context
-     * @param Boolean $ignoreStrictCheck Whether to ignore the strict variable check or not
-     *
-     * @return The content of the context variable
-     *
-     * @throws Twig_Error_Runtime if the variable does not exist and Twig is running in strict mode
-     */
-    final protected function getContext($context, $item, $ignoreStrictCheck = false)
-    {
-        if (!array_key_exists($item, $context)) {
-            if ($ignoreStrictCheck || !$this->env->isStrictVariables()) {
-                return null;
-            }
-
-            throw new Twig_Error_Runtime(sprintf('Variable "%s" does not exist', $item), -1, $this->getTemplateName());
-        }
-
-        return $context[$item];
-    }
-
-    /**
-     * Returns the attribute value for a given array/object.
-     *
-     * @param mixed   $object            The object or array from where to get the item
-     * @param mixed   $item              The item to get from the array or object
-     * @param array   $arguments         An array of arguments to pass if the item is an object method
-     * @param string  $type              The type of attribute (@see Twig_TemplateInterface)
-     * @param Boolean $isDefinedTest     Whether this is only a defined check
-     * @param Boolean $ignoreStrictCheck Whether to ignore the strict attribute check or not
-     *
-     * @return mixed The attribute value, or a Boolean when $isDefinedTest is true, or null when the attribute is not set and $ignoreStrictCheck is true
-     *
-     * @throws Twig_Error_Runtime if the attribute does not exist and Twig is running in strict mode and $isDefinedTest is false
-     */
-    protected function getAttribute($object, $item, array $arguments = array(), $type = Twig_TemplateInterface::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false)
-    {
-        $item = ctype_digit((string) $item) ? (int) $item : (string) $item;
-
-        // array
-        if (Twig_TemplateInterface::METHOD_CALL !== $type) {
-            if ((is_array($object) && array_key_exists($item, $object))
-                || ($object instanceof ArrayAccess && isset($object[$item]))
-            ) {
-                if ($isDefinedTest) {
-                    return true;
-                }
-
-                return $object[$item];
-            }
-
-            if (Twig_TemplateInterface::ARRAY_CALL === $type) {
-                if ($isDefinedTest) {
-                    return false;
-                }
-
-                if ($ignoreStrictCheck || !$this->env->isStrictVariables()) {
-                    return null;
-                }
-
-                if (is_object($object)) {
-                    throw new Twig_Error_Runtime(sprintf('Key "%s" in object (with ArrayAccess) of type "%s" does not exist', $item, get_class($object)), -1, $this->getTemplateName());
-                } elseif (is_array($object)) {
-                    throw new Twig_Error_Runtime(sprintf('Key "%s" for array with keys "%s" does not exist', $item, implode(', ', array_keys($object))), -1, $this->getTemplateName());
-                } else {
-                    throw new Twig_Error_Runtime(sprintf('Impossible to access a key ("%s") on a "%s" variable', $item, gettype($object)), -1, $this->getTemplateName());
-                }
-            }
-        }
-
-        if (!is_object($object)) {
-            if ($isDefinedTest) {
-                return false;
-            }
-
-            if ($ignoreStrictCheck || !$this->env->isStrictVariables()) {
-                return null;
-            }
-
-            throw new Twig_Error_Runtime(sprintf('Item "%s" for "%s" does not exist', $item, is_array($object) ? 'Array' : $object), -1, $this->getTemplateName());
-        }
-
-        $class = get_class($object);
-
-        // object property
-        if (Twig_TemplateInterface::METHOD_CALL !== $type) {
-            if (isset($object->$item) || array_key_exists($item, $object)) {
-                if ($isDefinedTest) {
-                    return true;
-                }
-
-                if ($this->env->hasExtension('sandbox')) {
-                    $this->env->getExtension('sandbox')->checkPropertyAllowed($object, $item);
-                }
-
-                return $object->$item;
-            }
-        }
-
-        // object method
-        if (!isset(self::$cache[$class]['methods'])) {
-            self::$cache[$class]['methods'] = array_change_key_case(array_flip(get_class_methods($object)));
-        }
-
-        $lcItem = strtolower($item);
-        if (isset(self::$cache[$class]['methods'][$lcItem])) {
-            $method = $item;
-        } elseif (isset(self::$cache[$class]['methods']['get'.$lcItem])) {
-            $method = 'get'.$item;
-        } elseif (isset(self::$cache[$class]['methods']['is'.$lcItem])) {
-            $method = 'is'.$item;
-        } elseif (isset(self::$cache[$class]['methods']['__call'])) {
-            $method = $item;
-        } else {
-            if ($isDefinedTest) {
-                return false;
-            }
-
-            if ($ignoreStrictCheck || !$this->env->isStrictVariables()) {
-                return null;
-            }
-
-            throw new Twig_Error_Runtime(sprintf('Method "%s" for object "%s" does not exist', $item, get_class($object)), -1, $this->getTemplateName());
-        }
-
-        if ($isDefinedTest) {
-            return true;
-        }
-
-        if ($this->env->hasExtension('sandbox')) {
-            $this->env->getExtension('sandbox')->checkMethodAllowed($object, $method);
-        }
-
-        $ret = call_user_func_array(array($object, $method), $arguments);
-
-        // useful when calling a template method from a template
-        // this is not supported but unfortunately heavily used in the Symfony profiler
-        if ($object instanceof Twig_TemplateInterface) {
-            return $ret === '' ? '' : new Twig_Markup($ret, $this->env->getCharset());
-        }
-
-        return $ret;
-    }
-
-    /**
-     * This method is only useful when testing Twig. Do not use it.
-     */
-    public static function clearCache()
-    {
-        self::$cache = array();
-    }
-}
Index: nc/libs/twig/TemplateInterface.php
===================================================================
--- inc/libs/twig/TemplateInterface.php	(revision 991)
+++ 	(revision )
@@ -1,47 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Interface implemented by all compiled templates.
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-interface Twig_TemplateInterface
-{
-    const ANY_CALL    = 'any';
-    const ARRAY_CALL  = 'array';
-    const METHOD_CALL = 'method';
-
-    /**
-     * Renders the template with the given context and returns it as string.
-     *
-     * @param array $context An array of parameters to pass to the template
-     *
-     * @return string The rendered template
-     */
-    public function render(array $context);
-
-    /**
-     * Displays the template with the given context.
-     *
-     * @param array $context An array of parameters to pass to the template
-     * @param array $blocks  An array of blocks to pass to the template
-     */
-    public function display(array $context, array $blocks = array());
-
-    /**
-     * Returns the bound environment for this template.
-     *
-     * @return Twig_Environment The current environment
-     */
-    public function getEnvironment();
-}
Index: nc/libs/twig/Test/Function.php
===================================================================
--- inc/libs/twig/Test/Function.php	(revision 991)
+++ 	(revision )
@@ -1,31 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a function template test.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Test_Function implements Twig_TestInterface
-{
-    protected $function;
-
-    public function __construct($function)
-    {
-        $this->function = $function;
-    }
-
-    public function compile()
-    {
-        return $this->function;
-    }
-}
Index: nc/libs/twig/Test/IntegrationTestCase.php
===================================================================
--- inc/libs/twig/Test/IntegrationTestCase.php	(revision 991)
+++ 	(revision )
@@ -1,155 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Integration test helper
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- * @author  Karma Dordrak <drak@zikula.org>
- */
-abstract class Twig_Test_IntegrationTestCase extends PHPUnit_Framework_TestCase
-{
-    abstract protected function getExtensions();
-    abstract protected function getFixturesDir();
-
-    /**
-     * @dataProvider getTests
-     */
-    public function testIntegration($file, $message, $condition, $templates, $exception, $outputs)
-    {
-        $this->doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs);
-    }
-
-    public function getTests()
-    {
-        $fixturesDir = realpath($this->getFixturesDir());
-        $tests = array();
-
-        foreach (new RecursiveIteratorIterator(new RecursiveDirectoryIterator($fixturesDir), RecursiveIteratorIterator::LEAVES_ONLY) as $file) {
-            if (!preg_match('/\.test$/', $file)) {
-                continue;
-            }
-
-            $test = file_get_contents($file->getRealpath());
-
-            if (preg_match('/
-                    --TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)\s*(?:--DATA--\s*(.*))?\s*--EXCEPTION--\s*(.*)/sx', $test, $match)) {
-                $message = $match[1];
-                $condition = $match[2];
-                $templates = $this->parseTemplates($match[3]);
-                $exception = $match[5];
-                $outputs = array(array(null, $match[4], null, ''));
-            } elseif (preg_match('/--TEST--\s*(.*?)\s*(?:--CONDITION--\s*(.*))?\s*((?:--TEMPLATE(?:\(.*?\))?--(?:.*?))+)--DATA--.*?--EXPECT--.*/s', $test, $match)) {
-                $message = $match[1];
-                $condition = $match[2];
-                $templates = $this->parseTemplates($match[3]);
-                $exception = false;
-                preg_match_all('/--DATA--(.*?)(?:--CONFIG--(.*?))?--EXPECT--(.*?)(?=\-\-DATA\-\-|$)/s', $test, $outputs, PREG_SET_ORDER);
-            } else {
-                throw new InvalidArgumentException(sprintf('Test "%s" is not valid.', str_replace($fixturesDir.'/', '', $file)));
-            }
-
-            $tests[] = array(str_replace($fixturesDir.'/', '', $file), $message, $condition, $templates, $exception, $outputs);
-        }
-
-        return $tests;
-    }
-
-    protected function doIntegrationTest($file, $message, $condition, $templates, $exception, $outputs)
-    {
-        if ($condition) {
-            eval('$ret = '.$condition.';');
-            if (!$ret) {
-                $this->markTestSkipped($condition);
-            }
-        }
-
-        $loader = new Twig_Loader_Array($templates);
-
-        foreach ($outputs as $match) {
-            $config = array_merge(array(
-                'cache' => false,
-                'strict_variables' => true,
-            ), $match[2] ? eval($match[2].';') : array());
-            $twig = new Twig_Environment($loader, $config);
-            $twig->addGlobal('global', 'global');
-            foreach ($this->getExtensions() as $extension) {
-                $twig->addExtension($extension);
-            }
-
-            try {
-                $template = $twig->loadTemplate('index.twig');
-            } catch (Exception $e) {
-                if (false !== $exception) {
-                    $this->assertEquals(trim($exception), trim(sprintf('%s: %s', get_class($e), $e->getMessage())));
-
-                    return;
-                }
-
-                if ($e instanceof Twig_Error_Syntax) {
-                    $e->setTemplateFile($file);
-
-                    throw $e;
-                }
-
-                throw new Twig_Error(sprintf('%s: %s', get_class($e), $e->getMessage()), -1, $file, $e);
-            }
-
-            try {
-                $output = trim($template->render(eval($match[1].';')), "\n ");
-            } catch (Exception $e) {
-                if (false !== $exception) {
-                    $this->assertEquals(trim($exception), trim(sprintf('%s: %s', get_class($e), $e->getMessage())));
-
-                    return;
-                }
-
-                if ($e instanceof Twig_Error_Syntax) {
-                    $e->setTemplateFile($file);
-                } else {
-                    $e = new Twig_Error(sprintf('%s: %s', get_class($e), $e->getMessage()), -1, $file, $e);
-                }
-
-                $output = trim(sprintf('%s: %s', get_class($e), $e->getMessage()));
-            }
-
-            if (false !== $exception) {
-                list($class, ) = explode(':', $exception);
-                $this->assertThat(NULL, new PHPUnit_Framework_Constraint_Exception($class));
-            }
-
-            $expected = trim($match[3], "\n ");
-
-            if ($expected != $output) {
-                echo 'Compiled template that failed:';
-
-                foreach (array_keys($templates) as $name) {
-                    echo "Template: $name\n";
-                    $source = $loader->getSource($name);
-                    echo $twig->compile($twig->parse($twig->tokenize($source, $name)));
-                }
-            }
-            $this->assertEquals($expected, $output, $message.' (in '.$file.')');
-        }
-    }
-
-    protected static function parseTemplates($test)
-    {
-        $templates = array();
-        preg_match_all('/--TEMPLATE(?:\((.*?)\))?--(.*?)(?=\-\-TEMPLATE|$)/s', $test, $matches, PREG_SET_ORDER);
-        foreach ($matches as $match) {
-            $templates[($match[1] ? $match[1] : 'index.twig')] = $match[2];
-        }
-
-        return $templates;
-    }
-}
Index: nc/libs/twig/Test/Method.php
===================================================================
--- inc/libs/twig/Test/Method.php	(revision 991)
+++ 	(revision )
@@ -1,33 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a method template test.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Test_Method implements Twig_TestInterface
-{
-    protected $extension;
-    protected $method;
-
-    public function __construct(Twig_ExtensionInterface $extension, $method)
-    {
-        $this->extension = $extension;
-        $this->method = $method;
-    }
-
-    public function compile()
-    {
-        return sprintf('$this->env->getExtension(\'%s\')->%s', $this->extension->getName(), $this->method);
-    }
-}
Index: nc/libs/twig/Test/Node.php
===================================================================
--- inc/libs/twig/Test/Node.php	(revision 991)
+++ 	(revision )
@@ -1,35 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a template test as a Node.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Test_Node implements Twig_TestInterface
-{
-    protected $class;
-
-    public function __construct($class)
-    {
-        $this->class = $class;
-    }
-
-    public function getClass()
-    {
-        return $this->class;
-    }
-
-    public function compile()
-    {
-    }
-}
Index: nc/libs/twig/Test/NodeTestCase.php
===================================================================
--- inc/libs/twig/Test/NodeTestCase.php	(revision 991)
+++ 	(revision )
@@ -1,58 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-abstract class Twig_Test_NodeTestCase extends PHPUnit_Framework_TestCase
-{
-    abstract public function getTests();
-
-    /**
-     * @dataProvider getTests
-     */
-    public function testCompile($node, $source, $environment = null)
-    {
-        $this->assertNodeCompilation($source, $node, $environment);
-    }
-
-    public function assertNodeCompilation($source, Twig_Node $node, Twig_Environment $environment = null)
-    {
-        $compiler = $this->getCompiler($environment);
-        $compiler->compile($node);
-
-        $this->assertEquals($source, trim($compiler->getSource()));
-    }
-
-    protected function getCompiler(Twig_Environment $environment = null)
-    {
-        return new Twig_Compiler(null === $environment ? $this->getEnvironment() : $environment);
-    }
-
-    protected function getEnvironment()
-    {
-        return new Twig_Environment();
-    }
-
-    protected function getVariableGetter($name)
-    {
-        if (version_compare(phpversion(), '5.4.0RC1', '>=')) {
-            return sprintf('(isset($context["%s"]) ? $context["%s"] : null)', $name, $name);
-        }
-
-        return sprintf('$this->getContext($context, "%s")', $name);
-    }
-
-    protected function getAttributeGetter()
-    {
-        if (function_exists('twig_template_get_attributes')) {
-            return 'twig_template_get_attributes($this, ';
-        }
-
-        return '$this->getAttribute(';
-    }
-}
Index: nc/libs/twig/TestInterface.php
===================================================================
--- inc/libs/twig/TestInterface.php	(revision 991)
+++ 	(revision )
@@ -1,26 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a template test.
- *
- * @package    twig
- * @author     Fabien Potencier <fabien@symfony.com>
- */
-interface Twig_TestInterface
-{
-    /**
-     * Compiles a test.
-     *
-     * @return string The PHP code for the test
-     */
-    public function compile();
-}
Index: nc/libs/twig/Token.php
===================================================================
--- inc/libs/twig/Token.php	(revision 991)
+++ 	(revision )
@@ -1,219 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a Token.
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-class Twig_Token
-{
-    protected $value;
-    protected $type;
-    protected $lineno;
-
-    const EOF_TYPE                  = -1;
-    const TEXT_TYPE                 = 0;
-    const BLOCK_START_TYPE          = 1;
-    const VAR_START_TYPE            = 2;
-    const BLOCK_END_TYPE            = 3;
-    const VAR_END_TYPE              = 4;
-    const NAME_TYPE                 = 5;
-    const NUMBER_TYPE               = 6;
-    const STRING_TYPE               = 7;
-    const OPERATOR_TYPE             = 8;
-    const PUNCTUATION_TYPE          = 9;
-    const INTERPOLATION_START_TYPE  = 10;
-    const INTERPOLATION_END_TYPE    = 11;
-
-    /**
-     * Constructor.
-     *
-     * @param integer $type   The type of the token
-     * @param string  $value  The token value
-     * @param integer $lineno The line position in the source
-     */
-    public function __construct($type, $value, $lineno)
-    {
-        $this->type   = $type;
-        $this->value  = $value;
-        $this->lineno = $lineno;
-    }
-
-    /**
-     * Returns a string representation of the token.
-     *
-     * @return string A string representation of the token
-     */
-    public function __toString()
-    {
-        return sprintf('%s(%s)', self::typeToString($this->type, true, $this->lineno), $this->value);
-    }
-
-    /**
-     * Tests the current token for a type and/or a value.
-     *
-     * Parameters may be:
-     * * just type
-     * * type and value (or array of possible values)
-     * * just value (or array of possible values) (NAME_TYPE is used as type)
-     *
-     * @param array|integer     $type   The type to test
-     * @param array|string|null $values The token value
-     *
-     * @return Boolean
-     */
-    public function test($type, $values = null)
-    {
-        if (null === $values && !is_int($type)) {
-            $values = $type;
-            $type = self::NAME_TYPE;
-        }
-
-        return ($this->type === $type) && (
-            null === $values ||
-            (is_array($values) && in_array($this->value, $values)) ||
-            $this->value == $values
-        );
-    }
-
-    /**
-     * Gets the line.
-     *
-     * @return integer The source line
-     */
-    public function getLine()
-    {
-        return $this->lineno;
-    }
-
-    /**
-     * Gets the token type.
-     *
-     * @return integer The token type
-     */
-    public function getType()
-    {
-        return $this->type;
-    }
-
-    /**
-     * Gets the token value.
-     *
-     * @return string The token value
-     */
-    public function getValue()
-    {
-        return $this->value;
-    }
-
-    /**
-     * Returns the constant representation (internal) of a given type.
-     *
-     * @param integer $type  The type as an integer
-     * @param Boolean $short Whether to return a short representation or not
-     * @param integer $line  The code line
-     *
-     * @return string The string representation
-     */
-    public static function typeToString($type, $short = false, $line = -1)
-    {
-        switch ($type) {
-            case self::EOF_TYPE:
-                $name = 'EOF_TYPE';
-                break;
-            case self::TEXT_TYPE:
-                $name = 'TEXT_TYPE';
-                break;
-            case self::BLOCK_START_TYPE:
-                $name = 'BLOCK_START_TYPE';
-                break;
-            case self::VAR_START_TYPE:
-                $name = 'VAR_START_TYPE';
-                break;
-            case self::BLOCK_END_TYPE:
-                $name = 'BLOCK_END_TYPE';
-                break;
-            case self::VAR_END_TYPE:
-                $name = 'VAR_END_TYPE';
-                break;
-            case self::NAME_TYPE:
-                $name = 'NAME_TYPE';
-                break;
-            case self::NUMBER_TYPE:
-                $name = 'NUMBER_TYPE';
-                break;
-            case self::STRING_TYPE:
-                $name = 'STRING_TYPE';
-                break;
-            case self::OPERATOR_TYPE:
-                $name = 'OPERATOR_TYPE';
-                break;
-            case self::PUNCTUATION_TYPE:
-                $name = 'PUNCTUATION_TYPE';
-                break;
-            case self::INTERPOLATION_START_TYPE:
-                $name = 'INTERPOLATION_START_TYPE';
-                break;
-            case self::INTERPOLATION_END_TYPE:
-                $name = 'INTERPOLATION_END_TYPE';
-                break;
-            default:
-                throw new LogicException(sprintf('Token of type "%s" does not exist.', $type));
-        }
-
-        return $short ? $name : 'Twig_Token::'.$name;
-    }
-
-    /**
-     * Returns the english representation of a given type.
-     *
-     * @param integer $type The type as an integer
-     * @param integer $line The code line
-     *
-     * @return string The string representation
-     */
-    public static function typeToEnglish($type, $line = -1)
-    {
-        switch ($type) {
-            case self::EOF_TYPE:
-                return 'end of template';
-            case self::TEXT_TYPE:
-                return 'text';
-            case self::BLOCK_START_TYPE:
-                return 'begin of statement block';
-            case self::VAR_START_TYPE:
-                return 'begin of print statement';
-            case self::BLOCK_END_TYPE:
-                return 'end of statement block';
-            case self::VAR_END_TYPE:
-                return 'end of print statement';
-            case self::NAME_TYPE:
-                return 'name';
-            case self::NUMBER_TYPE:
-                return 'number';
-            case self::STRING_TYPE:
-                return 'string';
-            case self::OPERATOR_TYPE:
-                return 'operator';
-            case self::PUNCTUATION_TYPE:
-                return 'punctuation';
-            case self::INTERPOLATION_START_TYPE:
-                return 'begin of string interpolation';
-            case self::INTERPOLATION_END_TYPE:
-                return 'end of string interpolation';
-            default:
-                throw new LogicException(sprintf('Token of type "%s" does not exist.', $type));
-        }
-    }
-}
Index: nc/libs/twig/TokenParser.php
===================================================================
--- inc/libs/twig/TokenParser.php	(revision 991)
+++ 	(revision )
@@ -1,34 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Base class for all token parsers.
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-abstract class Twig_TokenParser implements Twig_TokenParserInterface
-{
-    /**
-     * @var Twig_Parser
-     */
-    protected $parser;
-
-    /**
-     * Sets the parser associated with this token parser
-     *
-     * @param $parser A Twig_Parser instance
-     */
-    public function setParser(Twig_Parser $parser)
-    {
-        $this->parser = $parser;
-    }
-}
Index: nc/libs/twig/TokenParser/AutoEscape.php
===================================================================
--- inc/libs/twig/TokenParser/AutoEscape.php	(revision 991)
+++ 	(revision )
@@ -1,89 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Marks a section of a template to be escaped or not.
- *
- * <pre>
- * {% autoescape true %}
- *   Everything will be automatically escaped in this block
- * {% endautoescape %}
- *
- * {% autoescape false %}
- *   Everything will be outputed as is in this block
- * {% endautoescape %}
- *
- * {% autoescape true js %}
- *   Everything will be automatically escaped in this block
- *   using the js escaping strategy
- * {% endautoescape %}
- * </pre>
- */
-class Twig_TokenParser_AutoEscape extends Twig_TokenParser
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        $lineno = $token->getLine();
-        $stream = $this->parser->getStream();
-
-        if ($stream->test(Twig_Token::BLOCK_END_TYPE)) {
-            $value = 'html';
-        } else {
-            $expr = $this->parser->getExpressionParser()->parseExpression();
-            if (!$expr instanceof Twig_Node_Expression_Constant) {
-                throw new Twig_Error_Syntax('An escaping strategy must be a string or a Boolean.', $stream->getCurrent()->getLine(), $stream->getFilename());
-            }
-            $value = $expr->getAttribute('value');
-
-            $compat = true === $value || false === $value;
-
-            if (true === $value) {
-                $value = 'html';
-            }
-
-            if ($compat && $stream->test(Twig_Token::NAME_TYPE)) {
-                if (false === $value) {
-                    throw new Twig_Error_Syntax('Unexpected escaping strategy as you set autoescaping to false.', $stream->getCurrent()->getLine(), $stream->getFilename());
-                }
-
-                $value = $stream->next()->getValue();
-            }
-        }
-
-        $stream->expect(Twig_Token::BLOCK_END_TYPE);
-        $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true);
-        $stream->expect(Twig_Token::BLOCK_END_TYPE);
-
-        return new Twig_Node_AutoEscape($value, $body, $lineno, $this->getTag());
-    }
-
-    public function decideBlockEnd(Twig_Token $token)
-    {
-        return $token->test('endautoescape');
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'autoescape';
-    }
-}
Index: nc/libs/twig/TokenParser/Block.php
===================================================================
--- inc/libs/twig/TokenParser/Block.php	(revision 991)
+++ 	(revision )
@@ -1,83 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Marks a section of a template as being reusable.
- *
- * <pre>
- *  {% block head %}
- *    <link rel="stylesheet" href="style.css" />
- *    <title>{% block title %}{% endblock %} - My Webpage</title>
- *  {% endblock %}
- * </pre>
- */
-class Twig_TokenParser_Block extends Twig_TokenParser
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        $lineno = $token->getLine();
-        $stream = $this->parser->getStream();
-        $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue();
-        if ($this->parser->hasBlock($name)) {
-            throw new Twig_Error_Syntax(sprintf("The block '$name' has already been defined line %d", $this->parser->getBlock($name)->getLine()), $stream->getCurrent()->getLine(), $stream->getFilename());
-        }
-        $this->parser->setBlock($name, $block = new Twig_Node_Block($name, new Twig_Node(array()), $lineno));
-        $this->parser->pushLocalScope();
-        $this->parser->pushBlockStack($name);
-
-        if ($stream->test(Twig_Token::BLOCK_END_TYPE)) {
-            $stream->next();
-
-            $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true);
-            if ($stream->test(Twig_Token::NAME_TYPE)) {
-                $value = $stream->next()->getValue();
-
-                if ($value != $name) {
-                    throw new Twig_Error_Syntax(sprintf("Expected endblock for block '$name' (but %s given)", $value), $stream->getCurrent()->getLine(), $stream->getFilename());
-                }
-            }
-        } else {
-            $body = new Twig_Node(array(
-                new Twig_Node_Print($this->parser->getExpressionParser()->parseExpression(), $lineno),
-            ));
-        }
-        $stream->expect(Twig_Token::BLOCK_END_TYPE);
-
-        $block->setNode('body', $body);
-        $this->parser->popBlockStack();
-        $this->parser->popLocalScope();
-
-        return new Twig_Node_BlockReference($name, $lineno, $this->getTag());
-    }
-
-    public function decideBlockEnd(Twig_Token $token)
-    {
-        return $token->test('endblock');
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'block';
-    }
-}
Index: nc/libs/twig/TokenParser/Do.php
===================================================================
--- inc/libs/twig/TokenParser/Do.php	(revision 991)
+++ 	(revision )
@@ -1,42 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Evaluates an expression, disgarding the returned value.
- */
-class Twig_TokenParser_Do extends Twig_TokenParser
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        $expr = $this->parser->getExpressionParser()->parseExpression();
-
-        $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-
-        return new Twig_Node_Do($expr, $token->getLine(), $this->getTag());
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'do';
-    }
-}
Index: nc/libs/twig/TokenParser/Embed.php
===================================================================
--- inc/libs/twig/TokenParser/Embed.php	(revision 991)
+++ 	(revision )
@@ -1,66 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2012 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Embeds a template.
- */
-class Twig_TokenParser_Embed extends Twig_TokenParser_Include
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        $stream = $this->parser->getStream();
-
-        $parent = $this->parser->getExpressionParser()->parseExpression();
-
-        list($variables, $only, $ignoreMissing) = $this->parseArguments();
-
-        // inject a fake parent to make the parent() function work
-        $stream->injectTokens(array(
-            new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', $token->getLine()),
-            new Twig_Token(Twig_Token::NAME_TYPE, 'extends', $token->getLine()),
-            new Twig_Token(Twig_Token::STRING_TYPE, '__parent__', $token->getLine()),
-            new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', $token->getLine()),
-        ));
-
-        $module = $this->parser->parse($stream, array($this, 'decideBlockEnd'), true);
-
-        // override the parent with the correct one
-        $module->setNode('parent', $parent);
-
-        $this->parser->embedTemplate($module);
-
-        $stream->expect(Twig_Token::BLOCK_END_TYPE);
-
-        return new Twig_Node_Embed($module->getAttribute('filename'), $module->getAttribute('index'), $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag());
-    }
-
-    public function decideBlockEnd(Twig_Token $token)
-    {
-        return $token->test('endembed');
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'embed';
-    }
-}
Index: nc/libs/twig/TokenParser/Extends.php
===================================================================
--- inc/libs/twig/TokenParser/Extends.php	(revision 991)
+++ 	(revision )
@@ -1,54 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Extends a template by another one.
- *
- * <pre>
- *  {% extends "base.html" %}
- * </pre>
- */
-class Twig_TokenParser_Extends extends Twig_TokenParser
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        if (!$this->parser->isMainScope()) {
-            throw new Twig_Error_Syntax('Cannot extend from a block', $token->getLine(), $this->parser->getFilename());
-        }
-
-        if (null !== $this->parser->getParent()) {
-            throw new Twig_Error_Syntax('Multiple extends tags are forbidden', $token->getLine(), $this->parser->getFilename());
-        }
-        $this->parser->setParent($this->parser->getExpressionParser()->parseExpression());
-
-        $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-
-        return null;
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'extends';
-    }
-}
Index: nc/libs/twig/TokenParser/Filter.php
===================================================================
--- inc/libs/twig/TokenParser/Filter.php	(revision 991)
+++ 	(revision )
@@ -1,61 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Filters a section of a template by applying filters.
- *
- * <pre>
- * {% filter upper %}
- *  This text becomes uppercase
- * {% endfilter %}
- * </pre>
- */
-class Twig_TokenParser_Filter extends Twig_TokenParser
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        $name = $this->parser->getVarName();
-        $ref = new Twig_Node_Expression_BlockReference(new Twig_Node_Expression_Constant($name, $token->getLine()), true, $token->getLine(), $this->getTag());
-
-        $filter = $this->parser->getExpressionParser()->parseFilterExpressionRaw($ref, $this->getTag());
-        $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-
-        $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true);
-        $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-
-        $block = new Twig_Node_Block($name, $body, $token->getLine());
-        $this->parser->setBlock($name, $block);
-
-        return new Twig_Node_Print($filter, $token->getLine(), $this->getTag());
-    }
-
-    public function decideBlockEnd(Twig_Token $token)
-    {
-        return $token->test('endfilter');
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'filter';
-    }
-}
Index: nc/libs/twig/TokenParser/Flush.php
===================================================================
--- inc/libs/twig/TokenParser/Flush.php	(revision 991)
+++ 	(revision )
@@ -1,42 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Flushes the output to the client.
- *
- * @see flush()
- */
-class Twig_TokenParser_Flush extends Twig_TokenParser
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-
-        return new Twig_Node_Flush($token->getLine(), $this->getTag());
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'flush';
-    }
-}
Index: nc/libs/twig/TokenParser/For.php
===================================================================
--- inc/libs/twig/TokenParser/For.php	(revision 991)
+++ 	(revision )
@@ -1,89 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Loops over each item of a sequence.
- *
- * <pre>
- * <ul>
- *  {% for user in users %}
- *    <li>{{ user.username|e }}</li>
- *  {% endfor %}
- * </ul>
- * </pre>
- */
-class Twig_TokenParser_For extends Twig_TokenParser
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        $lineno = $token->getLine();
-        $targets = $this->parser->getExpressionParser()->parseAssignmentExpression();
-        $this->parser->getStream()->expect(Twig_Token::OPERATOR_TYPE, 'in');
-        $seq = $this->parser->getExpressionParser()->parseExpression();
-
-        $ifexpr = null;
-        if ($this->parser->getStream()->test(Twig_Token::NAME_TYPE, 'if')) {
-            $this->parser->getStream()->next();
-            $ifexpr = $this->parser->getExpressionParser()->parseExpression();
-        }
-
-        $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-        $body = $this->parser->subparse(array($this, 'decideForFork'));
-        if ($this->parser->getStream()->next()->getValue() == 'else') {
-            $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-            $else = $this->parser->subparse(array($this, 'decideForEnd'), true);
-        } else {
-            $else = null;
-        }
-        $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-
-        if (count($targets) > 1) {
-            $keyTarget = $targets->getNode(0);
-            $keyTarget = new Twig_Node_Expression_AssignName($keyTarget->getAttribute('name'), $keyTarget->getLine());
-            $valueTarget = $targets->getNode(1);
-            $valueTarget = new Twig_Node_Expression_AssignName($valueTarget->getAttribute('name'), $valueTarget->getLine());
-        } else {
-            $keyTarget = new Twig_Node_Expression_AssignName('_key', $lineno);
-            $valueTarget = $targets->getNode(0);
-            $valueTarget = new Twig_Node_Expression_AssignName($valueTarget->getAttribute('name'), $valueTarget->getLine());
-        }
-
-        return new Twig_Node_For($keyTarget, $valueTarget, $seq, $ifexpr, $body, $else, $lineno, $this->getTag());
-    }
-
-    public function decideForFork(Twig_Token $token)
-    {
-        return $token->test(array('else', 'endfor'));
-    }
-
-    public function decideForEnd(Twig_Token $token)
-    {
-        return $token->test('endfor');
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'for';
-    }
-}
Index: nc/libs/twig/TokenParser/From.php
===================================================================
--- inc/libs/twig/TokenParser/From.php	(revision 991)
+++ 	(revision )
@@ -1,74 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Imports macros.
- *
- * <pre>
- *   {% from 'forms.html' import forms %}
- * </pre>
- */
-class Twig_TokenParser_From extends Twig_TokenParser
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        $macro = $this->parser->getExpressionParser()->parseExpression();
-        $stream = $this->parser->getStream();
-        $stream->expect('import');
-
-        $targets = array();
-        do {
-            $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue();
-
-            $alias = $name;
-            if ($stream->test('as')) {
-                $stream->next();
-
-                $alias = $stream->expect(Twig_Token::NAME_TYPE)->getValue();
-            }
-
-            $targets[$name] = $alias;
-
-            if (!$stream->test(Twig_Token::PUNCTUATION_TYPE, ',')) {
-                break;
-            }
-
-            $stream->next();
-        } while (true);
-
-        $stream->expect(Twig_Token::BLOCK_END_TYPE);
-
-        $node = new Twig_Node_Import($macro, new Twig_Node_Expression_AssignName($this->parser->getVarName(), $token->getLine()), $token->getLine(), $this->getTag());
-
-        foreach ($targets as $name => $alias) {
-            $this->parser->addImportedSymbol('function', $alias, 'get'.$name, $node->getNode('var'));
-        }
-
-        return $node;
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'from';
-    }
-}
Index: nc/libs/twig/TokenParser/If.php
===================================================================
--- inc/libs/twig/TokenParser/If.php	(revision 991)
+++ 	(revision )
@@ -1,94 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Tests a condition.
- *
- * <pre>
- * {% if users %}
- *  <ul>
- *    {% for user in users %}
- *      <li>{{ user.username|e }}</li>
- *    {% endfor %}
- *  </ul>
- * {% endif %}
- * </pre>
- */
-class Twig_TokenParser_If extends Twig_TokenParser
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        $lineno = $token->getLine();
-        $expr = $this->parser->getExpressionParser()->parseExpression();
-        $stream = $this->parser->getStream();
-        $stream->expect(Twig_Token::BLOCK_END_TYPE);
-        $body = $this->parser->subparse(array($this, 'decideIfFork'));
-        $tests = array($expr, $body);
-        $else = null;
-
-        $end = false;
-        while (!$end) {
-            switch ($stream->next()->getValue()) {
-                case 'else':
-                    $stream->expect(Twig_Token::BLOCK_END_TYPE);
-                    $else = $this->parser->subparse(array($this, 'decideIfEnd'));
-                    break;
-
-                case 'elseif':
-                    $expr = $this->parser->getExpressionParser()->parseExpression();
-                    $stream->expect(Twig_Token::BLOCK_END_TYPE);
-                    $body = $this->parser->subparse(array($this, 'decideIfFork'));
-                    $tests[] = $expr;
-                    $tests[] = $body;
-                    break;
-
-                case 'endif':
-                    $end = true;
-                    break;
-
-                default:
-                    throw new Twig_Error_Syntax(sprintf('Unexpected end of template. Twig was looking for the following tags "else", "elseif", or "endif" to close the "if" block started at line %d)', $lineno), $stream->getCurrent()->getLine(), $stream->getFilename());
-            }
-        }
-
-        $stream->expect(Twig_Token::BLOCK_END_TYPE);
-
-        return new Twig_Node_If(new Twig_Node($tests), $else, $lineno, $this->getTag());
-    }
-
-    public function decideIfFork(Twig_Token $token)
-    {
-        return $token->test(array('elseif', 'else', 'endif'));
-    }
-
-    public function decideIfEnd(Twig_Token $token)
-    {
-        return $token->test(array('endif'));
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'if';
-    }
-}
Index: nc/libs/twig/TokenParser/Import.php
===================================================================
--- inc/libs/twig/TokenParser/Import.php	(revision 991)
+++ 	(revision )
@@ -1,49 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Imports macros.
- *
- * <pre>
- *   {% import 'forms.html' as forms %}
- * </pre>
- */
-class Twig_TokenParser_Import extends Twig_TokenParser
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        $macro = $this->parser->getExpressionParser()->parseExpression();
-        $this->parser->getStream()->expect('as');
-        $var = new Twig_Node_Expression_AssignName($this->parser->getStream()->expect(Twig_Token::NAME_TYPE)->getValue(), $token->getLine());
-        $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-
-        $this->parser->addImportedSymbol('template', $var->getAttribute('name'));
-
-        return new Twig_Node_Import($macro, $var, $token->getLine(), $this->getTag());
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'import';
-    }
-}
Index: nc/libs/twig/TokenParser/Include.php
===================================================================
--- inc/libs/twig/TokenParser/Include.php	(revision 991)
+++ 	(revision )
@@ -1,80 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Includes a template.
- *
- * <pre>
- *   {% include 'header.html' %}
- *     Body
- *   {% include 'footer.html' %}
- * </pre>
- */
-class Twig_TokenParser_Include extends Twig_TokenParser
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        $expr = $this->parser->getExpressionParser()->parseExpression();
-
-        list($variables, $only, $ignoreMissing) = $this->parseArguments();
-
-        return new Twig_Node_Include($expr, $variables, $only, $ignoreMissing, $token->getLine(), $this->getTag());
-    }
-
-    protected function parseArguments()
-    {
-        $stream = $this->parser->getStream();
-
-        $ignoreMissing = false;
-        if ($stream->test(Twig_Token::NAME_TYPE, 'ignore')) {
-            $stream->next();
-            $stream->expect(Twig_Token::NAME_TYPE, 'missing');
-
-            $ignoreMissing = true;
-        }
-
-        $variables = null;
-        if ($stream->test(Twig_Token::NAME_TYPE, 'with')) {
-            $stream->next();
-
-            $variables = $this->parser->getExpressionParser()->parseExpression();
-        }
-
-        $only = false;
-        if ($stream->test(Twig_Token::NAME_TYPE, 'only')) {
-            $stream->next();
-
-            $only = true;
-        }
-
-        $stream->expect(Twig_Token::BLOCK_END_TYPE);
-
-        return array($variables, $only, $ignoreMissing);
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'include';
-    }
-}
Index: nc/libs/twig/TokenParser/Macro.php
===================================================================
--- inc/libs/twig/TokenParser/Macro.php	(revision 991)
+++ 	(revision )
@@ -1,70 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Defines a macro.
- *
- * <pre>
- * {% macro input(name, value, type, size) %}
- *    <input type="{{ type|default('text') }}" name="{{ name }}" value="{{ value|e }}" size="{{ size|default(20) }}" />
- * {% endmacro %}
- * </pre>
- */
-class Twig_TokenParser_Macro extends Twig_TokenParser
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        $lineno = $token->getLine();
-        $stream = $this->parser->getStream();
-        $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue();
-
-        $arguments = $this->parser->getExpressionParser()->parseArguments();
-
-        $stream->expect(Twig_Token::BLOCK_END_TYPE);
-        $this->parser->pushLocalScope();
-        $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true);
-        if ($stream->test(Twig_Token::NAME_TYPE)) {
-            $value = $stream->next()->getValue();
-
-            if ($value != $name) {
-                throw new Twig_Error_Syntax(sprintf("Expected endmacro for macro '$name' (but %s given)", $value), $stream->getCurrent()->getLine(), $stream->getFilename());
-            }
-        }
-        $this->parser->popLocalScope();
-        $stream->expect(Twig_Token::BLOCK_END_TYPE);
-
-        $this->parser->setMacro($name, new Twig_Node_Macro($name, new Twig_Node_Body(array($body)), $arguments, $lineno, $this->getTag()));
-
-        return null;
-    }
-
-    public function decideBlockEnd(Twig_Token $token)
-    {
-        return $token->test('endmacro');
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'macro';
-    }
-}
Index: nc/libs/twig/TokenParser/Sandbox.php
===================================================================
--- inc/libs/twig/TokenParser/Sandbox.php	(revision 991)
+++ 	(revision )
@@ -1,68 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Marks a section of a template as untrusted code that must be evaluated in the sandbox mode.
- *
- * <pre>
- * {% sandbox %}
- *     {% include 'user.html' %}
- * {% endsandbox %}
- * </pre>
- *
- * @see http://www.twig-project.org/doc/api.html#sandbox-extension for details
- */
-class Twig_TokenParser_Sandbox extends Twig_TokenParser
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-        $body = $this->parser->subparse(array($this, 'decideBlockEnd'), true);
-        $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-
-        // in a sandbox tag, only include tags are allowed
-        if (!$body instanceof Twig_Node_Include) {
-            foreach ($body as $node) {
-                if ($node instanceof Twig_Node_Text && ctype_space($node->getAttribute('data'))) {
-                    continue;
-                }
-
-                if (!$node instanceof Twig_Node_Include) {
-                    throw new Twig_Error_Syntax('Only "include" tags are allowed within a "sandbox" section', $node->getLine(), $this->parser->getFilename());
-                }
-            }
-        }
-
-        return new Twig_Node_Sandbox($body, $token->getLine(), $this->getTag());
-    }
-
-    public function decideBlockEnd(Twig_Token $token)
-    {
-        return $token->test('endsandbox');
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'sandbox';
-    }
-}
Index: nc/libs/twig/TokenParser/Set.php
===================================================================
--- inc/libs/twig/TokenParser/Set.php	(revision 991)
+++ 	(revision )
@@ -1,84 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Defines a variable.
- *
- * <pre>
- *  {% set foo = 'foo' %}
- *
- *  {% set foo = [1, 2] %}
- *
- *  {% set foo = {'foo': 'bar'} %}
- *
- *  {% set foo = 'foo' ~ 'bar' %}
- *
- *  {% set foo, bar = 'foo', 'bar' %}
- *
- *  {% set foo %}Some content{% endset %}
- * </pre>
- */
-class Twig_TokenParser_Set extends Twig_TokenParser
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        $lineno = $token->getLine();
-        $stream = $this->parser->getStream();
-        $names = $this->parser->getExpressionParser()->parseAssignmentExpression();
-
-        $capture = false;
-        if ($stream->test(Twig_Token::OPERATOR_TYPE, '=')) {
-            $stream->next();
-            $values = $this->parser->getExpressionParser()->parseMultitargetExpression();
-
-            $stream->expect(Twig_Token::BLOCK_END_TYPE);
-
-            if (count($names) !== count($values)) {
-                throw new Twig_Error_Syntax("When using set, you must have the same number of variables and assignements.", $stream->getCurrent()->getLine(), $stream->getFilename());
-            }
-        } else {
-            $capture = true;
-
-            if (count($names) > 1) {
-                throw new Twig_Error_Syntax("When using set with a block, you cannot have a multi-target.", $stream->getCurrent()->getLine(), $stream->getFilename());
-            }
-
-            $stream->expect(Twig_Token::BLOCK_END_TYPE);
-
-            $values = $this->parser->subparse(array($this, 'decideBlockEnd'), true);
-            $stream->expect(Twig_Token::BLOCK_END_TYPE);
-        }
-
-        return new Twig_Node_Set($capture, $names, $values, $lineno, $this->getTag());
-    }
-
-    public function decideBlockEnd(Twig_Token $token)
-    {
-        return $token->test('endset');
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'set';
-    }
-}
Index: nc/libs/twig/TokenParser/Spaceless.php
===================================================================
--- inc/libs/twig/TokenParser/Spaceless.php	(revision 991)
+++ 	(revision )
@@ -1,59 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Remove whitespaces between HTML tags.
- *
- * <pre>
- * {% spaceless %}
- *      <div>
- *          <strong>foo</strong>
- *      </div>
- * {% endspaceless %}
- *
- * {# output will be <div><strong>foo</strong></div> #}
- * </pre>
- */
-class Twig_TokenParser_Spaceless extends Twig_TokenParser
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        $lineno = $token->getLine();
-
-        $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-        $body = $this->parser->subparse(array($this, 'decideSpacelessEnd'), true);
-        $this->parser->getStream()->expect(Twig_Token::BLOCK_END_TYPE);
-
-        return new Twig_Node_Spaceless($body, $lineno, $this->getTag());
-    }
-
-    public function decideSpacelessEnd(Twig_Token $token)
-    {
-        return $token->test('endspaceless');
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'spaceless';
-    }
-}
Index: nc/libs/twig/TokenParser/Use.php
===================================================================
--- inc/libs/twig/TokenParser/Use.php	(revision 991)
+++ 	(revision )
@@ -1,84 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2011 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Imports blocks defined in another template into the current template.
- *
- * <pre>
- * {% extends "base.html" %}
- *
- * {% use "blocks.html" %}
- *
- * {% block title %}{% endblock %}
- * {% block content %}{% endblock %}
- * </pre>
- *
- * @see http://www.twig-project.org/doc/templates.html#horizontal-reuse for details.
- */
-class Twig_TokenParser_Use extends Twig_TokenParser
-{
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token)
-    {
-        $template = $this->parser->getExpressionParser()->parseExpression();
-        $stream = $this->parser->getStream();
-
-        if (!$template instanceof Twig_Node_Expression_Constant) {
-            throw new Twig_Error_Syntax('The template references in a "use" statement must be a string.', $stream->getCurrent()->getLine(), $stream->getFilename());
-        }
-
-        $targets = array();
-        if ($stream->test('with')) {
-            $stream->next();
-
-            do {
-                $name = $stream->expect(Twig_Token::NAME_TYPE)->getValue();
-
-                $alias = $name;
-                if ($stream->test('as')) {
-                    $stream->next();
-
-                    $alias = $stream->expect(Twig_Token::NAME_TYPE)->getValue();
-                }
-
-                $targets[$name] = new Twig_Node_Expression_Constant($alias, -1);
-
-                if (!$stream->test(Twig_Token::PUNCTUATION_TYPE, ',')) {
-                    break;
-                }
-
-                $stream->next();
-            } while (true);
-        }
-
-        $stream->expect(Twig_Token::BLOCK_END_TYPE);
-
-        $this->parser->addTrait(new Twig_Node(array('template' => $template, 'targets' => new Twig_Node($targets))));
-
-        return null;
-    }
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag()
-    {
-        return 'use';
-    }
-}
Index: nc/libs/twig/TokenParserBroker.php
===================================================================
--- inc/libs/twig/TokenParserBroker.php	(revision 991)
+++ 	(revision )
@@ -1,113 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- * (c) 2010 Arnaud Le Blanc
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Default implementation of a token parser broker.
- *
- * @package twig
- * @author  Arnaud Le Blanc <arnaud.lb@gmail.com>
- */
-class Twig_TokenParserBroker implements Twig_TokenParserBrokerInterface
-{
-    protected $parser;
-    protected $parsers = array();
-    protected $brokers = array();
-
-    /**
-     * Constructor.
-     *
-     * @param array|Traversable $parsers A Traversable of Twig_TokenParserInterface instances
-     * @param array|Traversable $brokers A Traversable of Twig_TokenParserBrokerInterface instances
-     */
-    public function __construct($parsers = array(), $brokers = array())
-    {
-        foreach ($parsers as $parser) {
-            if (!$parser instanceof Twig_TokenParserInterface) {
-                throw new LogicException('$parsers must a an array of Twig_TokenParserInterface');
-            }
-            $this->parsers[$parser->getTag()] = $parser;
-        }
-        foreach ($brokers as $broker) {
-            if (!$broker instanceof Twig_TokenParserBrokerInterface) {
-                throw new LogicException('$brokers must a an array of Twig_TokenParserBrokerInterface');
-            }
-            $this->brokers[] = $broker;
-        }
-    }
-
-    /**
-     * Adds a TokenParser.
-     *
-     * @param Twig_TokenParserInterface $parser A Twig_TokenParserInterface instance
-     */
-    public function addTokenParser(Twig_TokenParserInterface $parser)
-    {
-        $this->parsers[$parser->getTag()] = $parser;
-    }
-
-    /**
-     * Adds a TokenParserBroker.
-     *
-     * @param Twig_TokenParserBroker $broker A Twig_TokenParserBroker instance
-     */
-    public function addTokenParserBroker(Twig_TokenParserBroker $broker)
-    {
-        $this->brokers[] = $broker;
-    }
-
-    /**
-     * Gets a suitable TokenParser for a tag.
-     *
-     * First looks in parsers, then in brokers.
-     *
-     * @param string $tag A tag name
-     *
-     * @return null|Twig_TokenParserInterface A Twig_TokenParserInterface or null if no suitable TokenParser was found
-     */
-    public function getTokenParser($tag)
-    {
-        if (isset($this->parsers[$tag])) {
-            return $this->parsers[$tag];
-        }
-        $broker = end($this->brokers);
-        while (false !== $broker) {
-            $parser = $broker->getTokenParser($tag);
-            if (null !== $parser) {
-                return $parser;
-            }
-            $broker = prev($this->brokers);
-        }
-
-        return null;
-    }
-
-    public function getParsers()
-    {
-        return $this->parsers;
-    }
-
-    public function getParser()
-    {
-        return $this->parser;
-    }
-
-    public function setParser(Twig_ParserInterface $parser)
-    {
-        $this->parser = $parser;
-        foreach ($this->parsers as $tokenParser) {
-            $tokenParser->setParser($parser);
-        }
-        foreach ($this->brokers as $broker) {
-            $broker->setParser($parser);
-        }
-    }
-}
Index: nc/libs/twig/TokenParserBrokerInterface.php
===================================================================
--- inc/libs/twig/TokenParserBrokerInterface.php	(revision 991)
+++ 	(revision )
@@ -1,45 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- * (c) 2010 Arnaud Le Blanc
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Interface implemented by token parser brokers.
- *
- * Token parser brokers allows to implement custom logic in the process of resolving a token parser for a given tag name.
- *
- * @package twig
- * @author  Arnaud Le Blanc <arnaud.lb@gmail.com>
- */
-interface Twig_TokenParserBrokerInterface
-{
-    /**
-     * Gets a TokenParser suitable for a tag.
-     *
-     * @param string $tag A tag name
-     *
-     * @return null|Twig_TokenParserInterface A Twig_TokenParserInterface or null if no suitable TokenParser was found
-     */
-    public function getTokenParser($tag);
-
-    /**
-     * Calls Twig_TokenParserInterface::setParser on all parsers the implementation knows of.
-     *
-     * @param Twig_ParserInterface $parser A Twig_ParserInterface interface
-     */
-    public function setParser(Twig_ParserInterface $parser);
-
-    /**
-     * Gets the Twig_ParserInterface.
-     *
-     * @return null|Twig_ParserInterface A Twig_ParserInterface instance or null
-     */
-    public function getParser();
-}
Index: nc/libs/twig/TokenParserInterface.php
===================================================================
--- inc/libs/twig/TokenParserInterface.php	(revision 991)
+++ 	(revision )
@@ -1,42 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2010 Fabien Potencier
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Interface implemented by token parsers.
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-interface Twig_TokenParserInterface
-{
-    /**
-     * Sets the parser associated with this token parser
-     *
-     * @param $parser A Twig_Parser instance
-     */
-    public function setParser(Twig_Parser $parser);
-
-    /**
-     * Parses a token and returns a node.
-     *
-     * @param Twig_Token $token A Twig_Token instance
-     *
-     * @return Twig_NodeInterface A Twig_NodeInterface instance
-     */
-    public function parse(Twig_Token $token);
-
-    /**
-     * Gets the tag name associated with this token parser.
-     *
-     * @return string The tag name
-     */
-    public function getTag();
-}
Index: nc/libs/twig/TokenStream.php
===================================================================
--- inc/libs/twig/TokenStream.php	(revision 991)
+++ 	(revision )
@@ -1,145 +1,0 @@
-<?php
-
-/*
- * This file is part of Twig.
- *
- * (c) 2009 Fabien Potencier
- * (c) 2009 Armin Ronacher
- *
- * For the full copyright and license information, please view the LICENSE
- * file that was distributed with this source code.
- */
-
-/**
- * Represents a token stream.
- *
- * @package twig
- * @author  Fabien Potencier <fabien@symfony.com>
- */
-class Twig_TokenStream
-{
-    protected $tokens;
-    protected $current;
-    protected $filename;
-
-    /**
-     * Constructor.
-     *
-     * @param array  $tokens   An array of tokens
-     * @param string $filename The name of the filename which tokens are associated with
-     */
-    public function __construct(array $tokens, $filename = null)
-    {
-        $this->tokens     = $tokens;
-        $this->current    = 0;
-        $this->filename   = $filename;
-    }
-
-    /**
-     * Returns a string representation of the token stream.
-     *
-     * @return string
-     */
-    public function __toString()
-    {
-        return implode("\n", $this->tokens);
-    }
-
-    public function injectTokens(array $tokens)
-    {
-        $this->tokens = array_merge(array_slice($this->tokens, 0, $this->current), $tokens, array_slice($this->tokens, $this->current));
-    }
-
-    /**
-     * Sets the pointer to the next token and returns the old one.
-     *
-     * @return Twig_Token
-     */
-    public function next()
-    {
-        if (!isset($this->tokens[++$this->current])) {
-            throw new Twig_Error_Syntax('Unexpected end of template', $this->token[$this->current - 1]->getLine(), $this->filename);
-        }
-
-        return $this->tokens[$this->current - 1];
-    }
-
-    /**
-     * Tests a token and returns it or throws a syntax error.
-     *
-     * @return Twig_Token
-     */
-    public function expect($type, $value = null, $message = null)
-    {
-        $token = $this->tokens[$this->current];
-        if (!$token->test($type, $value)) {
-            $line = $token->getLine();
-            throw new Twig_Error_Syntax(sprintf('%sUnexpected token "%s" of value "%s" ("%s" expected%s)',
-                $message ? $message.'. ' : '',
-                Twig_Token::typeToEnglish($token->getType(), $line), $token->getValue(),
-                Twig_Token::typeToEnglish($type, $line), $value ? sprintf(' with value "%s"', $value) : ''),
-                $line,
-                $this->filename
-            );
-        }
-        $this->next();
-
-        return $token;
-    }
-
-    /**
-     * Looks at the next token.
-     *
-     * @param integer $number
-     *
-     * @return Twig_Token
-     */
-    public function look($number = 1)
-    {
-        if (!isset($this->tokens[$this->current + $number])) {
-            throw new Twig_Error_Syntax('Unexpected end of template', $this->token[$this->current + $number - 1]->getLine(), $this->filename);
-        }
-
-        return $this->tokens[$this->current + $number];
-    }
-
-    /**
-     * Tests the current token
-     *
-     * @return bool
-     */
-    public function test($primary, $secondary = null)
-    {
-        return $this->tokens[$this->current]->test($primary, $secondary);
-    }
-
-    /**
-     * Checks if end of stream was reached
-     *
-     * @return bool
-     */
-    public function isEOF()
-    {
-        return $this->tokens[$this->current]->getType() === Twig_Token::EOF_TYPE;
-    }
-
-    /**
-     * Gets the current token
-     *
-     * @return Twig_Token
-     */
-    public function getCurrent()
-    {
-        return $this->tokens[$this->current];
-    }
-
-    /**
-     * Gets the filename associated with this stream
-     *
-     * @return string
-     */
-    public function getFilename()
-    {
-        return $this->filename;
-    }
-}
Index: nc/load_theme_file.php
===================================================================
--- inc/load_theme_file.php	(revision 1057)
+++ 	(revision )
@@ -1,116 +1,0 @@
-<?php
-# -- BEGIN LICENSE BLOCK ---------------------------------------
-#
-# This file is part of Dotclear 2.
-#
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
-# Licensed under the GPL version 2.0 license.
-# See LICENSE file or
-# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
-#
-# -- END LICENSE BLOCK -----------------------------------------
-
-// TODO: Fix loose of relative path in CSS
-
-# Check if config file exists
-if (isset($_SERVER['DC_RC_PATH'])) {
-	$zc_conf_file = $_SERVER['DC_RC_PATH'];
-} elseif (isset($_SERVER['REDIRECT_DC_RC_PATH'])) {
-	$zc_conf_file = $_SERVER['REDIRECT_DC_RC_PATH'];
-} else {
-	$zc_conf_file = dirname(__FILE__).'/config.php';
-}
-
-if (!is_file($zc_conf_file)) {
-	trigger_error('Unable to open config file',E_USER_ERROR);
-	exit;
-}
-unset($zc_conf_file);
-
-# Start Dotclear core (required to load template engine and find paths)
-require_once dirname(__FILE__).'/prepend.php';
-
-# No request
-if (empty($_GET['tf'])) {
-	header('Content-Type: text/plain');
-	http::head(404,'Not Found');
-	exit;
-}
-
-# Add default templates path
-if (defined('DC_CONTEXT_ADMIN')) {
-
-	# Set admin context
-	$_ctx = new dcAdminContext($core);
-	$core->tpl->addExtension($_ctx);
-	$core->tpl->getLoader()->addPath(dirname(__FILE__).'/admin/default-templates');
-	
-	// TODO: Find a better way to add plugins templates paths
-	# --BEHAVIOR-- adminPrepend
-	$core->callBehavior('adminPrepend',$core,$_ctx);
-}
-else {
-	// TODO: dcPublicContext ...
-	//$core->tpl->getLoader()->addPath(dirname(__FILE__).'/public/default-templates');
-}
-
-# Clean up requested filename
-$f = path::clean($_GET['tf']);
-
-# Find templates paths then plugins paths
-$paths = $core->tpl->getLoader()->getPaths();
-rsort($paths); // read default-templates last
-/*
-// TODO: Find a better way to add plugins templates paths
-$plugins_paths = array_reverse(explode(PATH_SEPARATOR,DC_PLUGINS_ROOT));
-$paths = array_merge($paths,$plugins_paths);
-//*/
-
-# Check all paths to see if file exists
-foreach ($paths as $path) {
-	$file = path::real($path.'/'.$f);
-	
-	if ($file !== false) {
-		break;
-	}
-}
-unset($paths);
-
-# Can't find requested file
-if ($file === false || !is_file($file) || !is_readable($file)) {
-	header('Content-Type: text/plain');
-	http::head(404,'Not Found');
-	exit;
-}
-
-# Limit type of files to serve
-$allow_types = array('png','jpg','jpeg','gif','css','js','swf');
-
-# File extension is not allowed
-if (!in_array(files::getExtension($file),$allow_types)) {
-	header('Content-Type: text/plain');
-	http::head(404,'Not Found');
-	exit;
-}
-
-# Display file
-http::$cache_max_age = 7200;
-http::cache(array_merge(array($file),get_included_files()));
-header('Content-Type: '.files::getMimeType($file));
-
-# Temporary hack css files to regain relative path
-if (files::getExtension($file) == 'css') {
-	$content = preg_replace(
-		'/url\((\'|)([^:].*?)(\'|)\)/msi',
-		'url($1?tf='.dirname($f).'/$2$3)',
-		file_get_contents($file)
-	);
-	header('Content-Length: '.strlen($content));
-	echo $content;
-}
-else {
-	header('Content-Length: '.filesize($file));
-	readfile($file);
-}
-exit;
-?>
Index: inc/prepend.php
===================================================================
--- inc/prepend.php	(revision 1092)
+++ inc/prepend.php	(revision 1069)
@@ -12,5 +12,5 @@
 
 /* ------------------------------------------------------------------------------------------- */
-#  ClearBricks, Twig, DotClear classes auto-loader
+#  ClearBricks, DotClear classes auto-loader
 if (@is_dir('/usr/lib/clearbricks')) {
 	define('CLEARBRICKS_PATH','/usr/lib/clearbricks');
@@ -46,5 +46,4 @@
 $__autoload['dcWorkspace']			= dirname(__FILE__).'/core/class.dc.workspace.php';
 $__autoload['dcPrefs']				= dirname(__FILE__).'/core/class.dc.prefs.php';
-$__autoload['dcTwigPage']			= dirname(__FILE__).'/core/class.dc.twig.page.php';
 
 $__autoload['rsExtPost']				= dirname(__FILE__).'/core/class.dc.rs.extensions.php';
@@ -53,5 +52,4 @@
 $__autoload['rsExtUser']				= dirname(__FILE__).'/core/class.dc.rs.extensions.php';
 
-$__autoload['dcAdminContext']				= dirname(__FILE__).'/admin/class.dc.admincontext.php';
 $__autoload['dcMenu']				= dirname(__FILE__).'/admin/class.dc.menu.php';
 $__autoload['dcPage']				= dirname(__FILE__).'/admin/lib.dc.page.php';
@@ -65,26 +63,8 @@
 $__autoload['context']				= dirname(__FILE__).'/public/lib.tpl.context.php';
 $__autoload['dcUrlHandlers']			= dirname(__FILE__).'/public/lib.urlhandlers.php';
-$__autoload['dcForm']			= dirname(__FILE__).'/admin/class.dc.form.php';
-$__autoload['dcFormExtension']			= dirname(__FILE__).'/admin/class.dc.form.php';
-$__autoload['dcTabExtension']			= dirname(__FILE__).'/admin/class.dc.tab.php';
 
 # Clearbricks extensions
 html::$absolute_regs[] = '/(<param\s+name="movie"\s+value=")(.*?)(")/msu';
 html::$absolute_regs[] = '/(<param\s+name="FlashVars"\s+value=".*?(?:mp3|flv)=)(.*?)(&|")/msu';
-
-if (@is_dir('/usr/lib/twig')) {
-	define('TWIG_PATH','/usr/lib/twig');
-} elseif (is_dir(dirname(__FILE__).'/libs/twig')) {
-	define('TWIG_PATH',dirname(__FILE__).'/libs/twig');
-} elseif (isset($_SERVER['TWIG_PATH']) && is_dir($_SERVER['TWIG_PATH'])) {
-	define('TWIG_PATH',$_SERVER['TWIG_PATH']);
-}
-
-if (!defined('TWIG_PATH') || !is_dir(TWIG_PATH)) {
-	exit('No Twig path defined');
-}
-require TWIG_PATH.'/Autoloader.php';
-Twig_Autoloader::register();
-
 /* ------------------------------------------------------------------------------------------- */
 
Index: plugins/aboutConfig/_admin.php
===================================================================
--- plugins/aboutConfig/_admin.php	(revision 1070)
+++ plugins/aboutConfig/_admin.php	(revision 270)
@@ -15,5 +15,3 @@
 		preg_match('/plugin.php\?p=aboutConfig(&.*)?$/',$_SERVER['REQUEST_URI']),
 		$core->auth->isSuperAdmin());
-
-$core->tpl->getLoader()->addPath(dirname(__FILE__).'/admtpl/','aboutConfig');
 ?>
Index: lugins/aboutConfig/admtpl/index.html.twig
===================================================================
--- plugins/aboutConfig/admtpl/index.html.twig	(revision 1092)
+++ 	(revision )
@@ -1,80 +1,0 @@
-{% extends "layout.html.twig" %}
-
-{% block header %}
-  {{ parent() }}
-  {{ init_tabs() }}
-  <link rel="stylesheet" href="{{plugin_url}}aboutConfig/style/aboutConfig.css" type="text/css" media="screen" />
-  <script type="text/javascript" src="{{plugin_url}}aboutConfig/js/aboutConfig.js"></script>
-{% endblock %}
-
-{%block content %}
-  {{ parent() }}
-
-  {% tab local('local',__('blog settings')) %}
-    {% if local_settings is not empty %}
-    {% form local_nav_form %}
-	<p class="anchor-nav">{{ form_field('local_nav') }} {{ form_field('local_nav_submit') }}</p>
-    {% endform %}
-    {% endif %}
-
-    {% form local_settings_form %}
-    {% for ns, setting in local_settings %}
-	<table class="settings" id="local_{{ ns }}"><caption>{{ ns }}</caption>
-	<thead>
-	<tr>
-	<th class="nowrap">Setting ID</th>
-	<th>{{__('Value')}}</th>
-	<th>{{__('Type')}}</th>
-	<th class="maximal">{{__('Description')}}</th>
-	</tr>
-	</thead>
-	<tbody>
-    {% for key,value in setting %}
-    {% set fname = 'local_' ~ ns ~ '_' ~ key %}
-	<tr>
-	<td scope="raw"><label for="{{ fname }}">{% if value.global %}<strong>{{ key }}</strong>{% else %}{{ key }}{% endif %}</label></td>
-	<td>{% if value.type == 'boolean' %}{{ form_field(fname) }}{% else %}{{ form_field(fname,{'size':40}) }}{% endif %}</td>
-	<td>{{ value.type }}</td>
-	<td>{{ value.label }}</td>
-	</tr>
-    {% endfor %}
-	</tbody></table>
-    {% endfor %}
-	<p>{{ form_field('local_submit') }}</p>
-    {% endform %}
-  {% endtab %}
-
-  {% tab global('global',__('global settings')) %}
-    {% if global_settings is not empty %}
-    {% form global_nav_form %}
-	<p class="anchor-nav">{{ form_field('global_nav') }} {{ form_field('global_nav_submit') }}</p>
-    {% endform %}
-    {% endif %}
-
-    {% form global_settings_form %}
-    {% for ns, setting in global_settings %}
-	<table class="settings" id="global_{{ ns }}"><caption>{{ ns }}</caption>
-	<thead>
-	<tr>
-	<th class="nowrap">Setting ID</th>
-	<th>{{__('Value')}}</th>
-	<th>{{__('Type')}}</th>
-	<th class="maximal">{{__('Description')}}</th>
-	</tr>
-	</thead><tbody>
-    {% for key,value in setting %}
-    {% set fname = 'global_' ~ ns ~ '_' ~ key %}
-	<tr>
-	<td scope="raw"><label for="{{ fname }}">{{ key }}</label></td>
-	<td>{% if value.type == 'boolean' %}{{ form_field(fname) }}{% else %}{{ form_field(fname,{'size':40}) }}{% endif %}</td>
-	<td>{{ value.type }}</td>
-	<td>{{ value.label }}</td>
-	</tr>
-    {% endfor %}
-	</tbody></table>
-    {% endfor %}
-	<p>{{ form_field('global_submit') }}</p>
-    {% endform %}
-  {% endtab %}
-
-{% endblock %}
Index: plugins/aboutConfig/index.php
===================================================================
--- plugins/aboutConfig/index.php	(revision 1089)
+++ plugins/aboutConfig/index.php	(revision 907)
@@ -12,136 +12,229 @@
 if (!defined('DC_CONTEXT_ADMIN')) { return; }
 
-class adminPageAboutConfig
-{
-	public static $p_url = 'plugin.php?p=aboutConfig';
-	
-	# Update local settings
-	public static function updLocal($form)
-	{
-		self::updSettings($form);
-	}
-	
-	# Update global settings
-	public static function updGlobal($form)
-	{
-		self::updSettings($form,true);
-	}
-	
-	# Update settings
-	protected static function updSettings($form,$global=false)
-	{
-		global $core,$_ctx;
-		
-		$part = $global ? 'global' : 'local';
-		$prefix = $part.'_';
-		
-		try {
-			foreach ($core->blog->settings->dumpNamespaces() as $ns => $namespace) {
-				$core->blog->settings->addNamespace($ns);
-				$ns_settings = $global ? 
-					$namespace->dumpGlobalSettings() : $namespace->dumpSettings();
-				
-				foreach ($ns_settings as $k => $v) {
-					// need to cast type
-					$f = (string) $form->{$prefix.$ns.'_'.$k};
-					settype($f,$v['type']);
-					
-					$core->blog->settings->$ns->put($k,$f,null,null,true,$global);
-					$form->{$prefix.$ns.'_'.$k} = $f;
-				}
+# Local navigation
+if (!empty($_POST['gs_nav'])) {
+	http::redirect($p_url.$_POST['gs_nav']);
+	exit;
+}
+if (!empty($_POST['ls_nav'])) {
+	http::redirect($p_url.$_POST['ls_nav']);
+	exit;
+}
+
+# Local settings update
+if (!empty($_POST['s']) && is_array($_POST['s']))
+{
+	try
+	{
+		foreach ($_POST['s'] as $ns => $s)
+		{
+			$core->blog->settings->addNamespace($ns);
+			
+			foreach ($s as $k => $v) 	{
+				$core->blog->settings->$ns->put($k,$v);
 			}
+			
 			$core->blog->triggerBlog();
-			
-			http::redirect(self::$p_url.'&upd=1&part='.$part);
-		}
-		catch (Exception $e) {
-			$_ctx->addError($e->getMessage());
-		}
-	}
-	
-	# Set nav and settings forms
-	public static function setForms($global=false)
-	{
-		global $core, $_ctx;
-		
-		$prefix = $global ? 'global_' : 'local_';
-		$action = $global ? 'updGlobal' : 'updLocal';
-		
-		if (!empty($_POST[$prefix.'nav'])) {
-			http::redirect(self::$p_url.$_POST[$prefix.'nav']);
-			exit;
 		}
 		
-		$nav_form = new dcForm($core,$prefix.'nav_form','plugin.php');
-		$settings_form = new dcForm($core,$prefix.'settings_form','plugin.php');
-		
-		$settings = $combo = array();
-		foreach ($core->blog->settings->dumpNamespaces() as $ns => $namespace) {
-			$ns_settings = $global ? 
-				$namespace->dumpGlobalSettings() : $namespace->dumpSettings();
-			
-			foreach ($ns_settings as $k => $v) {
-				$settings[$ns][$k] = $v;
+		http::redirect($p_url.'&upd=1');
+	}
+	catch (Exception $e)
+	{
+		$core->error->add($e->getMessage());
+	}
+}
+
+# Global settings update
+if (!empty($_POST['gs']) && is_array($_POST['gs']))
+{
+	try
+	{
+		foreach ($_POST['gs'] as $ns => $s)
+		{
+			$core->blog->settings->addNamespace($ns);
+			
+			foreach ($s as $k => $v) 	{
+				$core->blog->settings->$ns->put($k,$v,null,null,true,true);
 			}
+			
+			$core->blog->triggerBlog();
 		}
 		
-		ksort($settings);
-		foreach ($settings as $ns => $s) {
-			$combo['#'.$prefix.$ns] = $ns;
-			ksort($s);
-			foreach ($s as $k => $v)	{
-				if ($v['type'] == 'boolean') {
-					$settings_form->addField(
-						new dcFieldCombo($prefix.$ns.'_'.$k,
-							'',array(1 => __('yes'),0 => __('no'))));
-				}
-				else {
-					$settings_form->addField(
-						new dcFieldText($prefix.$ns.'_'.$k,''));
-				}
-				$settings_form->{$prefix.$ns.'_'.$k} = $v['value'];
-			}
-		}
-		
-		$nav_form
-			->addField(
-				new dcFieldCombo($prefix.'nav','',$combo,array(
-					"label" => __('Goto:'))))
-			->addField(
-				new dcFieldSubmit($prefix.'nav_submit',__('OK')))
-			->addField(
-				new dcFieldHidden ('p','aboutConfig'))
-			;
-		
-		$settings_form
-			->addField(
-				new dcFieldSubmit($prefix.'submit',__('Save'),array(
-					'action' => array('adminPageAboutConfig',$action))))
-			->addField(
-				new dcFieldHidden ('p','aboutConfig'))
-			;
-		
-		$_ctx->{$prefix.'settings'} = $settings;
-		
-		$nav_form->setup();
-		$settings_form->setup();
-	}
-}
-
-# Local settings forms
-adminPageAboutConfig::setForms();
-
-# Global settings forms
-adminPageAboutConfig::setForms(true);
-
-# Commons
+		http::redirect($p_url.'&upd=1&part=global');
+	}
+	catch (Exception $e)
+	{
+		$core->error->add($e->getMessage());
+	}
+}
+
+$part = !empty($_GET['part']) && $_GET['part'] == 'global' ? 'global' : 'local';
+
+function settingLine($id,$s,$ns,$field_name,$strong_label)
+{
+	if ($s['type'] == 'boolean') {
+		$field = form::combo(array($field_name.'['.$ns.']['.$id.']',$field_name.'_'.$id),
+		array(__('yes') => 1, __('no') => 0),$s['value']);
+	} else {
+		$field = form::field(array($field_name.'['.$ns.']['.$id.']',$field_name.'_'.$id),40,null,
+		html::escapeHTML($s['value']));
+	}
+	
+	$slabel = $strong_label ? '<strong>%s</strong>' : '%s';
+	
+	return
+	'<tr>'.
+	'<td scope="raw"><label for="s_'.$id.'">'.sprintf($slabel,html::escapeHTML($id)).'</label></td>'.
+	'<td>'.$field.'</td>'.
+	'<td>'.$s['type'].'</td>'.
+	'<td>'.html::escapeHTML($s['label']).'</td>'.
+	'</tr>';
+}
+?>
+<html>
+<head>
+  <title>about:config</title>
+  <?php echo dcPage::jsPageTabs($part); ?>
+  <style type="text/css">
+  table.settings { border: 1px solid #999; margin-bottom: 2em; }
+  table.settings th { background: #f5f5f5; color: #444; padding-top: 0.3em; padding-bottom: 0.3em; }
+  p.anchor-nav {float: right; }
+  </style>
+	<script type="text/javascript">
+	//<![CDATA[
+	$(function() {
+		$("#gs_submit").hide();
+		$("#ls_submit").hide();
+		$("#gs_nav").change(function() {
+			window.location = $("#gs_nav option:selected").val();
+		})
+		$("#ls_nav").change(function() {
+			window.location = $("#ls_nav option:selected").val();
+		})
+	});
+	//]]>
+	</script>
+</head>
+
+<body>
+<?php
 if (!empty($_GET['upd'])) {
-	$_ctx->setAlert(__('Configuration successfully updated'));
-}
+	dcPage::message(__('Configuration successfully updated'));
+}
+
 if (!empty($_GET['upda'])) {
-	$_ctx->setAlert(__('Settings definition successfully updated'));
-}
-$_ctx->default_tab = !empty($_GET['part']) && $_GET['part'] == 'global' ? 'global' : 'local';
-$_ctx->fillPageTitle('about:config');
-$core->tpl->display('@aboutConfig/index.html.twig');
-?>
+	dcPage::message(__('Settings definition successfully updated'));
+}
+?>
+<h2><?php echo html::escapeHTML($core->blog->name); ?> &rsaquo; <span class="page-title">about:config</span></h2>
+
+<div id="local" class="multi-part" title="<?php echo __('blog settings'); ?>">
+
+<?php 
+$table_header = '<table class="settings" id="%s"><caption>%s</caption>'.
+'<thead>'.
+'<tr>'."\n".
+'  <th class="nowrap">Setting ID</th>'."\n".
+'  <th>'.__('Value').'</th>'."\n".
+'  <th>'.__('Type').'</th>'."\n".
+'  <th class="maximalx">'.__('Description').'</th>'."\n".
+'</tr>'."\n".
+'</thead>'."\n".
+'<tbody>';
+$table_footer = '</tbody></table>';
+
+$settings = array();
+foreach ($core->blog->settings->dumpNamespaces() as $ns => $namespace) {
+	foreach ($namespace->dumpSettings() as $k => $v) {
+		$settings[$ns][$k] = $v;
+	}
+}
+ksort($settings);
+if (count($settings) > 0) {
+	$ns_combo = array();
+	foreach ($settings as $ns => $s) {
+		$ns_combo[$ns] = '#l_'.$ns;
+	}
+	echo 
+		'<form action="plugin.php" method="post">'.
+		'<p class="anchor-nav">'.
+		'<label for="ls_nav" class="classic">'.__('Goto:').'</label> '.form::combo('ls_nav',$ns_combo).
+		' <input type="submit" value="'.__('Ok').'" id="ls_submit" />'.
+		'<input type="hidden" name="p" value="aboutConfig" />'.
+		$core->formNonce().'</p></form>';
+}
+?>
+
+<form action="plugin.php" method="post">
+
+<?php
+foreach ($settings as $ns => $s)
+{
+	ksort($s);
+	echo sprintf($table_header,'l_'.$ns,$ns);
+	foreach ($s as $k => $v)
+	{
+		echo settingLine($k,$v,$ns,'s',!$v['global']);
+	}
+	echo $table_footer;
+}
+?>
+
+<p><input type="submit" value="<?php echo __('Save'); ?>" />
+<input type="hidden" name="p" value="aboutConfig" />
+<?php echo $core->formNonce(); ?></p>
+</form>
+</div>
+
+<div id="global" class="multi-part" title="<?php echo __('global settings'); ?>">
+
+<?php
+$settings = array();
+
+foreach ($core->blog->settings->dumpNamespaces() as $ns => $namespace) {
+	foreach ($namespace->dumpGlobalSettings() as $k => $v) {
+		$settings[$ns][$k] = $v;
+	}
+}
+
+ksort($settings);
+
+if (count($settings) > 0) {
+	$ns_combo = array();
+	foreach ($settings as $ns => $s) {
+		$ns_combo[$ns] = '#g_'.$ns;
+	}
+	echo 
+		'<form action="plugin.php" method="post">'.
+		'<p class="anchor-nav">'.
+		'<label for="gs_nav" class="classic">'.__('Goto:').'</label> '.form::combo('gs_nav',$ns_combo).
+		' <input type="submit" value="'.__('Ok').'" id="gs_submit" />'.
+		'<input type="hidden" name="p" value="aboutConfig" />'.
+		$core->formNonce().'</p></form>';
+}
+?>
+
+<form action="plugin.php" method="post">
+
+<?php
+foreach ($settings as $ns => $s)
+{
+	ksort($s);
+	echo sprintf($table_header,'g_'.$ns,$ns);
+	foreach ($s as $k => $v)
+	{
+		echo settingLine($k,$v,$ns,'gs',false);
+	}
+	echo $table_footer;
+}
+?>
+
+<p><input type="submit" value="<?php echo __('Save'); ?>" />
+<input type="hidden" name="p" value="aboutConfig" />
+<?php echo $core->formNonce(); ?></p>
+</form>
+</div>
+
+</body>
+</html>
Index: lugins/aboutConfig/js/aboutConfig.js
===================================================================
--- plugins/aboutConfig/js/aboutConfig.js	(revision 1089)
+++ 	(revision )
@@ -1,10 +1,0 @@
-$(function() {
-	$("#global_nav_submit").hide();
-	$("#local_nav_submit").hide();
-	$("#global_nav").change(function() {
-		window.location = $("#global_nav option:selected").val();
-	})
-	$("#local_nav").change(function() {
-		window.location = $("#local_nav option:selected").val();
-	})
-});
Index: lugins/aboutConfig/style/aboutConfig.css
===================================================================
--- plugins/aboutConfig/style/aboutConfig.css	(revision 1070)
+++ 	(revision )
@@ -1,16 +1,0 @@
-table.settings {
-	border: 1px solid #999;
-	margin-bottom: 2em;
-}
-table.settings th {
-	background: #f5f5f5;
-	color: #444;
-	padding-top: 0.3em;
-	padding-bottom: 0.3em;
-}
-p.anchor-nav {
-	float: right;
-}
-p.anchor-nav label {
-	display: inline;
-}
Index: plugins/importExport/inc/flat/class.flat.import.php
===================================================================
--- plugins/importExport/inc/flat/class.flat.import.php	(revision 841)
+++ plugins/importExport/inc/flat/class.flat.import.php	(revision 1093)
@@ -790,6 +790,6 @@
 		$strReq = 'SELECT media_id '.
 				'FROM '.$this->prefix.'media '.
-				"WHERE media_path = '".$this->cur_media->media_path."' ".
-				"AND media_file = '".$this->cur_media->media_file."' ";
+				"WHERE media_path = '".$this->con->escape($this->cur_media->media_path)."' ".
+				"AND media_file = '".$this->con->escape($this->cur_media->media_file)."' ";
 		
 		$rs = $this->con->select($strReq);
Index: themes/ductile/_config.php
===================================================================
--- themes/ductile/_config.php	(revision 1011)
+++ themes/ductile/_config.php	(revision 1081)
@@ -44,6 +44,4 @@
 }
 
-
-
 $contexts = array(
 	'default' => __('Home (first page)'),
@@ -67,4 +65,10 @@
 	__('Impact') => 'Impact',
 	__('Monospace') => 'Monospace'
+);
+
+$webfont_apis = array(
+	__('none') => '',
+	__('javascript (Adobe)') => 'js',
+	__('stylesheet (Google)') => 'css'
 );
 
@@ -227,5 +231,11 @@
 	// CSS
 	'body_font' => null,
+	'body_webfont_family' => null,
+	'body_webfont_url' => null,
+	'body_webfont_api' => null,
 	'alternate_font' => null,
+	'alternate_webfont_family' => null,
+	'alternate_webfont_url' => null,
+	'alternate_webfont_api' => null,
 	'blog_title_w' => null,
 	'blog_title_s' => null,
@@ -368,5 +378,12 @@
 		if ($conf_tab == 'css') {
 			$ductile_user['body_font'] = $_POST['body_font'];
+			$ductile_user['body_webfont_family'] = $_POST['body_webfont_family'];
+			$ductile_user['body_webfont_url'] = $_POST['body_webfont_url'];
+			$ductile_user['body_webfont_api'] = $_POST['body_webfont_api'];
+
 			$ductile_user['alternate_font'] = $_POST['alternate_font'];
+			$ductile_user['alternate_webfont_family'] = $_POST['alternate_webfont_family'];
+			$ductile_user['alternate_webfont_url'] = $_POST['alternate_webfont_url'];
+			$ductile_user['alternate_webfont_api'] = $_POST['alternate_webfont_api'];
 
 			$ductile_user['blog_title_w'] = (integer) !empty($_POST['blog_title_w']);
@@ -507,15 +524,37 @@
 echo '<h3>'.__('General settings').'</h3>';
 
-echo '<fieldset><legend>'.__('Fonts').'</legend>'.
+echo '<fieldset><legend>'.__('Fonts').'</legend>';
+
+echo '<div class="two-cols">';
+echo '<div class="col">';
+echo
 '<p class="field"><label for="body_font">'.__('Main:').' '.
 form::combo('body_font',$fonts,$ductile_user['body_font']).'</label>'.
 (!empty($ductile_user['body_font']) ? ' '.fontDef($ductile_user['body_font']) : '').
 '</p>'.
-
+'<p class="form-note">'.__('Set main font to default to use webfont below.').'</p> '.
+'<p class="field"><label for="body_webfont_family">'.__('Webfont family:').'</label> '.
+form::field('body_webfont_family',25,255,$ductile_user['body_webfont_family']).'</p>'.
+'<p class="field"><label for="body_webfont_url">'.__('Webfont URL:').'</label> '.
+form::field('body_webfont_url',50,255,$ductile_user['body_webfont_url']).'</p>'.
+'<p class="field"><label for="body_webfont_url">'.__('Webfont API:').' '.
+form::combo('body_webfont_api',$webfont_apis,$ductile_user['body_webfont_api']).'</label>'.'</p>';
+echo '</div>';
+echo '<div class="col">';
+echo
 '<p class="field"><label for="alternate_font">'.__('Secondary:').' '.
 form::combo('alternate_font',$fonts,$ductile_user['alternate_font']).'</label>'.
 (!empty($ductile_user['alternate_font']) ? ' '.fontDef($ductile_user['alternate_font']) : '').
 '</p>'.
-'</fieldset>';
+'<p class="form-note">'.__('Set secondary font to default to use webfont below.').'</p> '.
+'<p class="field"><label for="alternate_webfont_family">'.__('Webfont family:').'</label> '.
+form::field('alternate_webfont_family',25,255,$ductile_user['alternate_webfont_family']).'</p>'.
+'<p class="field"><label for="alternate_webfont_url">'.__('Webfont URL:').'</label> '.
+form::field('alternate_webfont_url',50,255,$ductile_user['alternate_webfont_url']).'</p>'.
+'<p class="field"><label for="alternate_webfont_api">'.__('Webfont API:').' '.
+form::combo('alternate_webfont_api',$webfont_apis,$ductile_user['alternate_webfont_api']).'</label>'.'</p>';
+echo '</div>';
+echo '</div>';
+echo '</fieldset>';
 
 echo '<div class="two-cols">';
Index: themes/ductile/_public.php
===================================================================
--- themes/ductile/_public.php	(revision 1045)
+++ themes/ductile/_public.php	(revision 1081)
@@ -250,4 +250,73 @@
 			$core->blog->settings->system->themes_url.'/'.$core->blog->settings->system->theme.
 			'/ductile.js"></script>'."\n";
+
+		echo self::ductileWebfontHelper();
+	}
+
+	public static function ductileWebfontHelper()
+	{
+		$s = $GLOBALS['core']->blog->settings->themes->get($GLOBALS['core']->blog->settings->system->theme.'_style');
+
+		if ($s === null) {
+			return;
+		}
+
+		$s = @unserialize($s);
+		if (!is_array($s)) {
+			return;
+		}
+
+		$ret = '';
+		$css = array();
+		$uri = array();
+		if (!isset($s['body_font']) || ($s['body_font'] == '')) {
+			// See if webfont defined for main font
+			if (isset($s['body_webfont_api']) && isset($s['body_webfont_family']) && isset($s['body_webfont_url'])) {
+				$uri[] = $s['body_webfont_url'];
+				switch ($s['body_webfont_api']) {
+					case 'js':
+						$ret .= sprintf('<script type="text/javascript" src="%s"></script>',$s['body_webfont_url'])."\n";
+						break;
+					case 'css':
+						$ret .= sprintf('<link type="text/css" href="%s" rel="stylesheet" />',$s['body_webfont_url'])."\n";
+						break;
+				}
+				# Main font
+				$selectors = 'body, .supranav li a span, #comments.me, a.comment-number';
+				self::prop($css,$selectors,'font-family',$s['body_webfont_family']);
+			}
+		}
+		if (!isset($s['alternate_font']) || ($s['alternate_font'] == '')) {
+			// See if webfont defined for secondary font
+			if (isset($s['alternate_webfont_api']) && isset($s['alternate_webfont_family']) && isset($s['alternate_webfont_url'])) {
+				if (!in_array($s['alternate_webfont_url'], $uri)) {
+					switch ($s['alternate_webfont_api']) {
+						case 'js':
+							$ret .= sprintf('<script type="text/javascript" src="%s"></script>',$s['alternate_webfont_url'])."\n";
+							break;
+						case 'css':
+							$ret .= sprintf('<link type="text/css" href="%s" rel="stylesheet" />',$s['alternate_webfont_url'])."\n";
+							break;
+					}
+				}
+				# Secondary font
+				$selectors = '#blogdesc, .supranav, #content-info, #subcategories, #comments-feed, #sidebar h2, #sidebar h3, #footer';
+				self::prop($css,$selectors,'font-family',$s['alternate_webfont_family']);
+			}
+		}
+		# Style directives
+		$res = '';
+		foreach ($css as $selector => $values) {
+			$res .= $selector." {\n";
+			foreach ($values as $k => $v) {
+				$res .= $k.':'.$v.";\n";
+			}
+			$res .= "}\n";
+		}
+		if ($res != '') {
+			$ret .= '<style type="text/css">'."\n".$res.'</style>'."\n";
+		}
+
+		return $ret;
 	}
 	
Index: themes/ductile/locales/fr/admin.po
===================================================================
--- themes/ductile/locales/fr/admin.po	(revision 810)
+++ themes/ductile/locales/fr/admin.po	(revision 1081)
@@ -110,4 +110,28 @@
 msgstr "Secondaire :"
 
+msgid "none"
+msgstr "aucune"
+
+msgid "javascript (Adobe)"
+msgstr "javascript (Adobe)"
+
+msgid "stylesheet (Google)"
+msgstr "feuille de style (Google)"
+
+msgid "Set main font to default to use webfont below."
+msgstr "Mettre la police de caractère principale à Défaut pour utiliser la fonte web ci-dessous."
+
+msgid "Set secondary font to default to use webfont below."
+msgstr "Mettre la police de caractère secondaire à Défaut pour utiliser la fonte web ci-dessous."
+
+msgid "Webfont family:"
+msgstr "Famille"
+
+msgid "Webfont URL:"
+msgstr "URL de la fonte web"
+
+msgid "Webfont API:"
+msgstr "Type d'API"
+
 msgid "Ductile primary"
 msgstr "Principale de Ductile"
