Index: admin/auth.php
===================================================================
--- admin/auth.php	(revision 550)
+++ admin/auth.php	(revision 199)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -22,6 +22,5 @@
 # That's a tricky hack but it works ;)
 $dlang = http::getAcceptLanguage();
-$dlang = ($dlang == '' ? 'en' : $dlang);
-if ($dlang != 'en' && preg_match('/^[a-z]{2}(-[a-z]{2})?$/',$dlang))
+if ($dlang != 'en')
 {
 	l10n::set(dirname(__FILE__).'/../locales/'.$dlang.'/main');
@@ -90,5 +89,5 @@
 		$page_url.'?akey='.$recover_key;
 		
-		$headers[] = 'From: '.(defined('DC_ADMIN_MAILFROM') && DC_ADMIN_MAILFROM ? DC_ADMIN_MAILFROM : 'dotclear@local');
+		$headers[] = 'From: dotclear@'.$_SERVER['HTTP_HOST'];
 		$headers[] = 'Content-Type: text/plain; charset=UTF-8;';
 		
@@ -126,21 +125,6 @@
 }
 # 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();
-		}
-		
+elseif ($change_pwd and $data = unserialize(base64_decode($_POST['login_data'])))
+{
 	# Check login informations
 	$check_user = false;
@@ -157,4 +141,6 @@
 	}
 	
+	try
+	{
 		if (!$core->auth->allowPassChange() || !$check_user) {
 			$change_pwd = false;
@@ -179,5 +165,9 @@
 		$_SESSION['sess_browser_uid'] = http::browserUID(DC_MASTER_KEY);
 		
-		if ($data['user_remember'])
+		if (!empty($data['blog_id'])) {
+			$_SESSION['sess_blog_id'] = $data['blog_id'];
+		}
+		
+		if (!empty($data['user_remember']))
 		{
 			setcookie('dc_admin',$data['cookie_admin'],strtotime('+15 days'),'','',DC_ADMIN_SSL);
@@ -202,9 +192,10 @@
 	if ($check_user && $core->auth->mustChangePassword())
 	{
-		$login_data = join('/',array(
-			base64_encode($user_id),
-			$cookie_admin,
-			empty($_POST['user_remember'])?'0':'1'
-		));
+		$login_data = base64_encode(serialize(array(
+			'user_id'=>$user_id,
+			'cookie_admin'=>$cookie_admin,
+			'blog_id'=>(!empty($_POST['blog']) ? $_POST['blog'] : ''),
+			'user_remember'=>!empty($_POST['user_remember'])
+		)));
 		
 		if (!$core->auth->allowPassChange()) {
@@ -257,10 +248,10 @@
 <!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; ?>">
+xml:lang="en" 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="<?php echo $dlang; ?>" />
+  <meta http-equiv="Content-Language" content="en" />
   <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />
   <meta name="GOOGLEBOT" content="NOSNIPPET" />
@@ -272,6 +263,7 @@
 ?>
   
-	<link rel="stylesheet" href="style/default.css" type="text/css" media="screen" />
-	 
+  <style type="text/css">
+  @import url(style/default.css); 
+  </style>
   <?php
   # --BEHAVIOR-- loginPageHTMLHead
@@ -300,8 +292,7 @@
 	 return true;
     };
-    $.cookie('dc_admin_test_cookie',true);
-    if ($.cookie('dc_admin_test_cookie')) {
+    
+    if (navigator.cookieEnabled) {
       $('#cookie_help').hide();
-      $.cookie('dc_admin_test_cookie', '', {'expires': -1});
     } else {
       $('#cookie_help').show();
@@ -334,16 +325,15 @@
 	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').'" />'.
+	'<p><label for="user_id">'.__('Username:').' '.
+	form::field(array('user_id','user_id'),20,32,html::escapeHTML($user_id),'',1).'</label></p>'.
+	
+	'<p><label for="user_email">'.__('Email:').' '.
+	form::field(array('user_email','user_email'),20,255,html::escapeHTML($user_email),'',2).'</label></p>'.
+	
+	'<p><input type="submit" value="'.__('recover').'" tabindex="3" />'.
 	form::hidden(array('recover'),1).'</p>'.
 	'</fieldset>'.
 	
-	'<div id="issue">'.
-	'<p><a href="auth.php">'.__('Back to login screen').'</a></p></div>';
+	'<p><a href="auth.php">'.__('Back to login screen').'</a></p>';
 }
 elseif ($change_pwd)
@@ -351,9 +341,9 @@
 	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>'.
+	'<p><label for="new_pwd">'.__('New password:').' '.
+	form::password(array('new_pwd','new_pwd'),20,255,'','',1).'</label></p>'.
+	
+	'<p><label for="new_pwd_c">'.__('Confirm password:').' '.
+	form::password(array('new_pwd_c','new_pwd_c'),20,255,'','',2).'</label></p>'.
 	'</fielset>'.
 	
@@ -369,6 +359,7 @@
 	else
 	{
+		echo
+		'<fieldset>';
 		if ($safe_mode) {
-			echo '<fieldset>';
 			echo '<legend>'.__('Safe mode login').'</legend>';
 			echo 
@@ -378,21 +369,16 @@
 				'</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">'.
+		'<p><label for="user_id">'.__('Username:').' '.
+		form::field(array('user_id','user_id'),20,32,html::escapeHTML($user_id),'',1).'</label></p>'.
+		
+		'<p><label for="user_pwd">'.__('Password:').' '.
+		form::password(array('user_pwd','user_pwd'),20,255,'','',2).'</label></p>'.
+		
+		'<p><label for="user_remember" class="classic">'.
+		form::checkbox(array('user_remember','user_remember'),1,'','',3).' '.
 		__('Remember my ID on this computer').'</label></p>'.
 		
-		'<p><input type="submit" value="'.__('log in').'" /></p>';
+		'<p><input type="submit" value="'.__('log in').'" tabindex="4" /></p>';
 		
 		if (!empty($_REQUEST['blog'])) {
@@ -400,13 +386,10 @@
 		}
 		if($safe_mode) {
-			echo 
-			form::hidden('safe_mode',1).
-			'</fieldset>';
-		}
-		else {
-			echo '</div>';
-		}
+			echo form::hidden('safe_mode',1);
+		}
+		
 		echo
-		'<p id="cookie_help" class="error">'.__('You must accept cookies in order to use the private area.').'</p>';
+		'</fieldset>'.
+		'<p id="cookie_help">'.__('You must accept cookies in order to use the private area.').'</p>';
 
 		echo '<div id="issue">';
Index: admin/blog.php
===================================================================
--- admin/blog.php	(revision 565)
+++ admin/blog.php	(revision 217)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -70,8 +70,9 @@
 	
 	echo
-	'<h2><a href="blogs.php">'.__('Blogs').'</a> &rsaquo; <span class="page-title">'.__('New blog').'</span></h2>'.
+	'<h2><a href="blogs.php">'.__('Blogs').'</a> &rsaquo; '.__('New blog').'</h2>'.
 	
-	'<form action="blog.php" method="post" id="blog-form" class="fieldset">'.
+	'<form action="blog.php" method="post" id="blog-form">'.
 	
+	'<fieldset><legend>'.__('Blog details').'</legend>'.
 	$core->formNonce().
 	'<p><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog ID:').' '.
@@ -88,6 +89,7 @@
 	'<p class="area"><label for="blog_desc">'.__('Blog description:').'</label> '.
 	form::textarea('blog_desc',60,5,html::escapeHTML($blog_desc)).'</p>'.
+	'</fieldset>'.
 	
-	'<p><input type="submit" accesskey="s" value="'.__('Create').'" /></p>'.
+	'<p><input type="submit" accesskey="s" value="'.__('Save').'" /></p>'.
 	'</form>';
 
Index: admin/blog_del.php
===================================================================
--- admin/blog_del.php	(revision 500)
+++ admin/blog_del.php	(revision 38)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -16,5 +16,4 @@
 
 $blog_id = '';
-$blog_name = '';
 
 if (!empty($_POST['blog_id']))
@@ -30,5 +29,4 @@
 	} else {
 		$blog_id = $rs->blog_id;
-		$blog_name = $rs->blog_name;
 	}
 }
@@ -54,8 +52,8 @@
 {
 	echo
-	'<h2 class="page-title">'.__('Delete a blog').'</h2>'.
+	'<h2>'.__('Delete a blog').'</h2>'.
 	'<p class="message">'.__('Warning').'</p>'.
 	'<p>'.sprintf(__('You are about to delete the blog %s. Every entry, comment and category will be deleted.'),
-	'<strong>'.$blog_id.' ('.$blog_name.')</strong>').'</p>'.
+	'<strong>'.$blog_id.'</strong>').'</p>'.
 	'<p>'.__('Please give your password to confirm the blog deletion.').'</p>';
 	
Index: admin/blog_pref.php
===================================================================
--- admin/blog_pref.php	(revision 557)
+++ admin/blog_pref.php	(revision 217)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -243,6 +243,6 @@
 {
 	echo '<h2>'.(!$standalone ? '<a href="blogs.php">'.__('Blogs').'</a> &rsaquo; ' : '').
-	html::escapeHTML($blog_name).' &rsaquo; <span class="page-title">'.
-	__('Blog settings').'</span></h2>';
+	html::escapeHTML($blog_name).' &rsaquo; '.
+	__('Blog settings').'</h2>';
 	
 	if (!empty($_GET['add'])) {
@@ -528,5 +528,5 @@
 					echo
 					' - <a href="permissions.php?blog_id[]='.$blog_id.'&amp;user_id[]='.$k.'">'
-					.__('Change permissions').'</a>';
+					.__('change permissions').'</a>';
 				}
 				
Index: admin/blog_theme.php
===================================================================
--- admin/blog_theme.php	(revision 557)
+++ admin/blog_theme.php	(revision 217)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -156,9 +156,5 @@
 	
 	$radio_id = 'theme_'.html::escapeHTML($id);
-	if (preg_match('#^http(s)?://#',$core->blog->settings->system->themes_url)) {
-		$theme_url = http::concatURL($core->blog->settings->system->themes_url,'/'.$id);
-	} else {
-		$theme_url = http::concatURL($core->blog->url,$core->blog->settings->system->themes_url.'/'.$id);
-	}
+	$theme_url = http::concatURL($core->blog->url,$core->blog->settings->system->themes_url.'/'.$id);
 	$has_conf = file_exists(path::real($core->blog->themes_path.'/'.$id).'/_config.php');
 	$has_css = file_exists(path::real($core->blog->themes_path.'/'.$id).'/style.css');
@@ -194,5 +190,5 @@
 	'<div class="theme-actions">';
 		if ($current && $has_conf) {
-			$res .= '<p><a href="blog_theme.php?conf=1" class="button">'.__('Configure theme').'</a></p>';
+			$res .= '<p><a href="blog_theme.php?conf=1" class="button">'.__('Theme configuration').'</a></p>';
 		}
 		if ($current) {
@@ -216,5 +212,5 @@
 {
 	echo
-	'<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Blog appearance').'</span></h2>';
+	'<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.__('Blog appearance').'</h2>';
 	
 	if (!empty($_GET['upd'])) {
@@ -269,8 +265,8 @@
 	'<div class="two-cols clear" id="themes-actions">'.
 	$core->formNonce().
-	'<p class="col"><input type="submit" name="select" value="'.__('Use selected theme').'" /></p>';
+	'<p class="col"><input type="submit" name="select" value="'.__('use selected theme').'" /></p>';
 	
 	if ($can_install) {
-		echo '<p class="col right"><input type="submit" class="delete" name="remove" value="'.__('Delete selected theme').'" /></p>';
+		echo '<p class="col right"><input type="submit" class="delete" name="remove" value="'.__('delete selected theme').'" /></p>';
 	}
 	
@@ -333,23 +329,17 @@
 	echo
 	'<h2>'.html::escapeHTML($core->blog->name).
-	' &rsaquo; <a href="blog_theme.php">'.__('Blog appearance').'</a> &rsaquo; <span class="page-title">'.__('Theme configuration').'<span class="page-title"></h2>'.
+	' &rsaquo; <a href="blog_theme.php">'.__('Blog appearance').'</a> &rsaquo; '.__('Theme configuration').'</h2>'.
 	'<p><a class="back" href="blog_theme.php">'.__('back').'</a></p>';
 	
 	try
 	{
-		# Let theme configuration set their own form(s) if required
-		$standalone_config = (boolean) $core->themes->moduleInfo($core->blog->settings->system->theme,'standalone_config');
-
-		if (!$standalone_config)
-			echo '<form id="theme_config" action="blog_theme.php?conf=1" method="post" enctype="multipart/form-data">';
-
+		echo '<form id="theme_config" action="blog_theme.php?conf=1" method="post" enctype="multipart/form-data">';
+		
 		include $theme_conf_file;
-
-		if (!$standalone_config)
-			echo
-			'<p class="clear"><input type="submit" value="'.__('Save').'" />'.
-			$core->formNonce().'</p>'.
-			'</form>';
-
+		
+		echo
+		'<p class="clear"><input type="submit" value="'.__('Save').'" />'.
+		$core->formNonce().'</p>'.
+		'</form>';
 	}
 	catch (Exception $e)
Index: admin/blogs.php
===================================================================
--- admin/blogs.php	(revision 500)
+++ admin/blogs.php	(revision 158)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -79,5 +79,5 @@
 }
 
-echo '<h2 class="page-title">'.__('List of blogs').'</h2>';
+echo '<h2>'.__('List of blogs').'</h2>';
 
 if (!$core->error->flag())
Index: admin/categories.php
===================================================================
--- admin/categories.php	(revision 560)
+++ admin/categories.php	(revision 82)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -68,5 +68,5 @@
 }
 
-echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Categories').'</span></h2>';
+echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.__('Categories').'</h2>';
 
 $rs = $core->blog->getCategories(array('post_type'=>'post'));
@@ -130,11 +130,9 @@
 '<option value="0">'.__('Top level').'</option>';
 while ($rs->fetch()) {
-	echo '<option value="'.$rs->cat_id.'">'.
-		str_repeat('&nbsp;&nbsp;',$rs->level-1).($rs->level-1 == 0 ? '' : '&bull; ').
-		html::escapeHTML($rs->cat_title).'</option>';
+	echo '<option value="'.$rs->cat_id.'">'.str_repeat('&nbsp;&nbsp;',$rs->level).'&bull; '.html::escapeHTML($rs->cat_title).'</option>';
 }
 echo
 '</select></label></p>'.
-'<p><input type="submit" value="'.__('Create').'" /></p>'.
+'<p><input type="submit" value="'.__('Save').'" /></p>'.
 $core->formNonce().
 '</fieldset>'.
@@ -167,5 +165,5 @@
 		'<p><label for="del_cat">'.__('Choose a category to remove:').' '.
 		form::combo('del_cat',$deletable).'</label></p> '.
-		'<p><input type="submit" value="'.__('Delete').'" class="delete" /></p>'.
+		'<p><input type="submit" value="'.__('ok').'" /></p>'.
 		$core->formNonce().
 		'</fieldset>'.
Index: admin/category.php
===================================================================
--- admin/category.php	(revision 500)
+++ admin/category.php	(revision 38)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -58,5 +58,5 @@
 		if (!isset($p[$rs->cat_id])) {
 			$allowed_parents[] = new formSelectOption(
-				str_repeat('&nbsp;&nbsp;',$rs->level-1).($rs->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($rs->cat_title),
+				str_repeat('&nbsp;&nbsp;',$rs->level-1).'&bull; '.html::escapeHTML($rs->cat_title),
 				$rs->cat_id
 			);
@@ -179,5 +179,5 @@
 }
 
-echo '<span class="page-title">'.$title.'</span></h2>';
+echo $title.'</h2>';
 
 echo
@@ -185,5 +185,5 @@
 '<fieldset><legend>'.__('Category information').'</legend>'.
 '<p><label class="required" for="cat_title"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').' '.
-form::field('cat_title',40,255,html::escapeHTML($cat_title)).
+form::field('cat_title',40,255,html::escapeHTML($cat_title),'',2).
 '</label></p>';
 if (!$cat_id)
@@ -192,5 +192,5 @@
 	echo
 	'<p><label for="new_cat_parent">'.__('Parent:').' '.
-	'<select id="new_cat_parent" name="new_cat_parent" >'.
+	'<select id="new_cat_parent" name="new_cat_parent" tabindex="3">'.
 	'<option value="0">'.__('Top level').'</option>';
 	while ($rs->fetch()) {
@@ -204,5 +204,5 @@
 echo
 '<div class="lockable">'.
-'<p><label for="cat_url">'.__('URL:').' '.form::field('cat_url',40,255,html::escapeHTML($cat_url)).
+'<p><label for="cat_url">'.__('URL:').' '.form::field('cat_url',40,255,html::escapeHTML($cat_url),'',4).
 '</label></p>'.
 '<p class="form-note warn" id="note-cat-url">'.
@@ -211,8 +211,8 @@
 
 '<p class="area"><label for="cat_desc">'.__('Description:').'</label> '.
-form::textarea('cat_desc',50,8,html::escapeHTML($cat_desc)).
+form::textarea('cat_desc',50,8,html::escapeHTML($cat_desc),'',5).
 '</p>'.
 
-'<p><input type="submit" accesskey="s" value="'.__('Save').'" />'.
+'<p><input type="submit" accesskey="s" value="'.__('Save').'" tabindex="5" />'.
 ($cat_id ? form::hidden('id',$cat_id) : '').
 $core->formNonce().
@@ -232,5 +232,5 @@
 	'<p><label for="cat_parent" class="classic">'.__('Parent:').' '.
 	form::combo('cat_parent',$allowed_parents,$cat_parent).'</label></p>'.
-	'<p><input type="submit" accesskey="s" value="'.__('Save').'" />'.
+	'<p><input type="submit" accesskey="s" value="'.__('Save').'" tabindex="5" />'.
 	form::hidden(array('id'),$cat_id).$core->formNonce().'</p>'.
 	'</fieldset>'.
@@ -246,5 +246,5 @@
 		form::combo('cat_move',array(__('before')=>'before',__('after')=>'after'),'','','',false,'title="'.__('position: ').'"').' '.
 		form::combo('cat_sibling',$siblings).'</p>'.
-		'<p><input type="submit" accesskey="s" value="'.__('Save').'" />'.
+		'<p><input type="submit" accesskey="s" value="'.__('Save').'" tabindex="5" />'.
 		form::hidden(array('id'),$cat_id).$core->formNonce().'</p>'.
 		'</fieldset>'.
Index: admin/comment.php
===================================================================
--- admin/comment.php	(revision 500)
+++ admin/comment.php	(revision 217)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -184,8 +184,9 @@
 	}
 	
-	echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <a href="'.
-		$core->getPostAdminURL($post_type,$post_id).'&amp;co=1#c'.$comment_id.'"> '.
-		$post_title.'</a> &rsaquo; <span class="page-title">'.__('Edit comment').'</span></h2>';
-		
+	echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.__('Edit comment').'</h2>';
+	
+	echo '<p><a class="back" href="'.$core->getPostAdminURL($post_type,$post_id).'&amp;co=1#c'.$comment_id.'"> '.
+		sprintf(__('Back to "%s"'),$post_title).'</a></p>';
+	
 	echo
 	'<form action="comment.php" method="post" id="comment-form">'.
Index: admin/comments.php
===================================================================
--- admin/comments.php	(revision 500)
+++ admin/comments.php	(revision 178)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -108,5 +108,4 @@
 # Actions combo box
 $combo_action = array();
-$default = '';
 if ($core->auth->check('publish,contentadmin',$core->blog->id))
 {
@@ -119,7 +118,4 @@
 {
 	$combo_action[__('delete')] = 'delete';
-	if ($status == -2) {
-		$default = 'delete';
-	}
 }
 
@@ -148,5 +144,5 @@
 dcPage::open(__('Comments and trackbacks'),$starting_script);
 
-echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Comments and trackbacks').'</span></h2>';
+echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.__('Comments and trackbacks').'</h2>';
 
 if (!$core->error->flag())
@@ -218,5 +214,5 @@
 	
 	'<p class="col right"><label for="action" class="classic">'.__('Selected comments action:').'</label> '.
-	form::combo('action',$combo_action,$default,'','','','title="'.__('action: ').'"').
+	form::combo('action',$combo_action,'','','','','title="'.__('action: ').'"').
 	$core->formNonce().
 	'<input type="submit" value="'.__('ok').'" /></p>'.
Index: admin/comments_actions.php
===================================================================
--- admin/comments_actions.php	(revision 270)
+++ admin/comments_actions.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: admin/dispatcher.php
===================================================================
--- admin/dispatcher.php	(revision 270)
+++ admin/dispatcher.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: admin/index.php
===================================================================
--- admin/index.php	(revision 536)
+++ admin/index.php	(revision 217)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -84,5 +84,5 @@
 			$title = ($fav['name'] == 'posts' ? sprintf($str_entries,$post_count) : 
 				($fav['name'] == 'comments' ? sprintf($str_comments,$comment_count) : $fav['title']));
-			$__dashboard_icons[$fav['name']] = new ArrayObject(array(__($title),$fav['url'],$fav['large-icon']));
+			$__dashboard_icons[$fav['name']] = new ArrayObject(array($title,$fav['url'],$fav['large-icon']));
 
 			# Let plugins set their own title for favorite on dashboard
@@ -99,5 +99,5 @@
 			$title = ($fav['name'] == 'posts' ? sprintf($str_entries,$post_count) : 
 				($fav['name'] == 'comments' ? sprintf($str_comments,$comment_count) : $fav['title']));
-			$__dashboard_icons[$fav['name']] = new ArrayObject(array(__($title),$fav['url'],$fav['large-icon']));
+			$__dashboard_icons[$fav['name']] = new ArrayObject(array($title,$fav['url'],$fav['large-icon']));
 
 			# Let plugins set their own title for favorite on dashboard
@@ -177,9 +177,4 @@
 $core->callBehavior('adminDashboardItems', $core, $__dashboard_items);
 
-# Dashboard content
-$dashboardContents = '';
-$__dashboard_contents = new ArrayObject(array(new ArrayObject,new ArrayObject));
-$core->callBehavior('adminDashboardContents', $core, $__dashboard_contents);
-
 /* DISPLAY
 -------------------------------------------------------- */
@@ -191,10 +186,12 @@
 );
 
-echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Dashboard').'</span></h2>';
+echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.__('Dashboard');
 
 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>';
-}
+	' - <a href="index.php?default_blog=1" class="button">'.__('Make this blog my default blog').'</a>';
+}
+
+echo '</h2>';
 
 if ($core->blog->status == 0) {
@@ -204,15 +201,8 @@
 }
 
-if (!defined('DC_ADMIN_URL') || !DC_ADMIN_URL) {
+if (!DC_ADMIN_URL) {
 	echo
 	'<p class="static-msg">'.
-	'DC_ADMIN_URL '.__('is not defined, you should edit your configuration file.').
-	'</p>';
-}
-
-if (!defined('DC_ADMIN_MAILFROM') || !DC_ADMIN_MAILFROM) {
-	echo
-	'<p class="static-msg">'.
-	'DC_ADMIN_MAILFROM '.__('is not defined, you should edit your configuration file.').
+	__('DC_ADMIN_URL is not defined, you should edit your configuration file.').
 	'</p>';
 }
@@ -289,6 +279,6 @@
 {
 	echo
-	'<p><a href="'.$i[1].'"><img src="'.$i[2].'" alt="" />'.
-	'<br /><span>'.$i[0].'</span></a></p>';
+	'<p><a href="'.$i[1].'"><img src="'.$i[2].'" alt="" /></a>'.
+	'<span><a href="'.$i[1].'">'.$i[0].'</a></span></p>';
 }
 echo '</div>';
@@ -302,6 +292,5 @@
 			while ($categories->fetch()) {
 				$categories_combo[] = new formSelectOption(
-					str_repeat('&nbsp;&nbsp;',$categories->level-1).
-					($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title),
+					str_repeat('&nbsp;&nbsp;',$categories->level-1).'&bull; '.html::escapeHTML($categories->cat_title),
 					$categories->cat_id
 				);
@@ -313,17 +302,17 @@
 		'<h3>'.__('Quick entry').'</h3>'.
 		'<form id="quick-entry" action="post.php" method="post">'.
-		'<fieldset><legend>'.__('New entry').'</legend>'.
+		'<fieldset>'.
 		'<p class="col"><label for="post_title" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').
-		form::field('post_title',20,255,'','maximal').
+		form::field('post_title',20,255,'','maximal',2).
 		'</label></p>'.
 		'<p class="area"><label class="required" '.
 		'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '.
-		form::textarea('post_content',50,7).
+		form::textarea('post_content',50,7,'','',2).
 		'</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" /> '.
+		form::combo('cat_id',$categories_combo,'','',2).'</label></p>'.
+		'<p><input type="submit" value="'.__('Save').'" name="save" tabindex="3" /> '.
 		($core->auth->check('publish',$core->blog->id)
-			? '<input type="hidden" value="'.__('Save and publish').'" name="save-publish" />'
+			? '<input type="hidden" value="'.__('save and publish').'" name="save-publish" />'
 			: '').
 		$core->formNonce().
@@ -340,17 +329,4 @@
 }
 
-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>';
 
Index: admin/install/check.php
===================================================================
--- admin/install/check.php	(revision 270)
+++ admin/install/check.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: admin/install/index.php
===================================================================
--- admin/install/index.php	(revision 557)
+++ admin/install/index.php	(revision 199)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -191,13 +191,5 @@
 		$core->auth->user_prefs->dashboard->put('dcnews',true,'boolean','',null,true);
 		$core->auth->user_prefs->dashboard->put('quickentry',true,'boolean','',null,true);
-
-		# Add accessibility options
-		$core->auth->user_prefs->addWorkspace('accessibility');
-		$core->auth->user_prefs->accessibility->put('nodragdrop',false,'boolean','',null,true);
-
-		# Add user interface options
-		$core->auth->user_prefs->addWorkspace('interface');
-		$core->auth->user_prefs->interface->put('enhanceduploader',false,'boolean','',null,true);
-
+		
 		# Add default favorites
 		$core->auth->user_prefs->addWorkspace('favorites');
@@ -205,27 +197,27 @@
 		$init_fav = array();
 		
-		$init_fav['new_post'] = array('new_post','New entry','post.php',
+		$init_fav['new_post'] = array('new_post',__('New entry'),'post.php',
 			'images/menu/edit.png','images/menu/edit-b.png',
 			'usage,contentadmin',null,'menu-new-post');
-		$init_fav['posts'] = array('posts','Entries','posts.php',
+		$init_fav['posts'] = array('posts',__('Entries'),'posts.php',
 			'images/menu/entries.png','images/menu/entries-b.png',
 			'usage,contentadmin',null,null);
-		$init_fav['comments'] = array('comments','Comments','comments.php',
+		$init_fav['comments'] = array('comments',__('Comments'),'comments.php',
 			'images/menu/comments.png','images/menu/comments-b.png',
 			'usage,contentadmin',null,null);
-		$init_fav['prefs'] = array('prefs','My preferences','preferences.php',
+		$init_fav['prefs'] = array('prefs',__('My preferences'),'preferences.php',
 			'images/menu/user-pref.png','images/menu/user-pref-b.png',
 			'*',null,null);
-		$init_fav['blog_pref'] = array('blog_pref','Blog settings','blog_pref.php',
+		$init_fav['blog_pref'] = array('blog_pref',__('Blog settings'),'blog_pref.php',
 			'images/menu/blog-pref.png','images/menu/blog-pref-b.png',
 			'admin',null,null);
-		$init_fav['blog_theme'] = array('blog_theme','Blog appearance','blog_theme.php',
+		$init_fav['blog_theme'] = array('blog_theme',__('Blog appearance'),'blog_theme.php',
 			'images/menu/themes.png','images/menu/blog-theme-b.png',
 			'admin',null,null);
 
-		$init_fav['pages'] = array('pages','Pages','plugin.php?p=pages',
+		$init_fav['pages'] = array('pages',__('Pages'),'plugin.php?p=pages',
 			'index.php?pf=pages/icon.png','index.php?pf=pages/icon-big.png',
 			'contentadmin,pages',null,null);
-		$init_fav['blogroll'] = array('blogroll','Blogroll','plugin.php?p=blogroll',
+		$init_fav['blogroll'] = array('blogroll',__('Blogroll'),'plugin.php?p=blogroll',
 			'index.php?pf=blogroll/icon-small.png','index.php?pf=blogroll/icon.png',
 			'usage,contentadmin',null,null);
@@ -264,6 +256,7 @@
   <title><?php echo __('Dotclear Install'); ?></title>
   
-	<link rel="stylesheet" href="../style/install.css" type="text/css" media="screen" /> 
-
+  <style type="text/css">
+  @import url(../style/install.css); 
+  </style>
   <script type="text/javascript" src="../js/jquery/jquery.js"></script>
   <script type="text/javascript">
@@ -320,22 +313,22 @@
 	'<form action="index.php" method="post">'.
 	'<fieldset><legend>'.__('User information').'</legend>'.
-	'<p><label for="u_firstname">'.__('First Name:').' '.
+	'<p><label>'.__('First Name:').' '.
 	form::field('u_firstname',30,255,html::escapeHTML($u_firstname)).'</label></p>'.
-	'<p><label for="u_name">'.__('Last Name:').' '.
+	'<p><label>'.__('Last Name:').' '.
 	form::field('u_name',30,255,html::escapeHTML($u_name)).'</label></p>'.
-	'<p><label for="u_email">'.__('Email:').' '.
+	'<p><label>'.__('Email:').' '.
 	form::field('u_email',30,255,html::escapeHTML($u_email)).'</label></p>'.
 	'</fieldset>'.
 	
 	'<fieldset><legend>'.__('Username and password').'</legend>'.
-	'<p><label for="u_login" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Username:').' '.
+	'<p><label class="required" title="'.__('Required field').'">'.__('Username:').' '.
 	form::field('u_login',30,32,html::escapeHTML($u_login)).'</label></p>'.
-	'<p><label for="u_pwd" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Password:').' '.
+	'<p><label class="required" title="'.__('Required field').'">'.__('Password:').' '.
 	form::password('u_pwd',30,255).'</label></p>'.
-	'<p><label for="u_pwd2" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Confirm password:').' '.
+	'<p><label class="required" title="'.__('Required field').'">'.__('Confirm password:').' '.
 	form::password('u_pwd2',30,255).'</label></p>'.
 	'</fieldset>'.
 	
-	'<p><input type="submit" value="'.__('Save').'" /></p>'.
+	'<p><input type="submit" value="'.__('save').'" /></p>'.
 	'</form>';
 }
Index: admin/install/wizard.php
===================================================================
--- admin/install/wizard.php	(revision 557)
+++ admin/install/wizard.php	(revision 217)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -100,5 +100,4 @@
 		$admin_url = preg_replace('%install/wizard.php$%','',$_SERVER['REQUEST_URI']);
 		writeConfigValue('DC_ADMIN_URL',http::getHost().$admin_url,$full_conf);
-		writeConfigValue('DC_ADMIN_MAILFROM','dotclear@'.$_SERVER['HTTP_HOST'],$full_conf);
 		writeConfigValue('DC_MASTER_KEY',md5(uniqid()),$full_conf);
 		
@@ -139,5 +138,8 @@
   <meta name="GOOGLEBOT" content="NOSNIPPET" />
   <title><?php echo __('Dotclear installation wizard'); ?></title>
-	<link rel="stylesheet" href="../style/install.css" type="text/css" media="screen" /> 
+  
+  <style type="text/css">
+  @import url(../style/install.css); 
+  </style>
 </head>
 
@@ -169,18 +171,18 @@
 
 '<form action="wizard.php" method="post">'.
-'<p><label class="required" for="DBDRIVER"><abbr title="'.__('Required field').'">*</abbr> '.__('Database type:').' '.
+'<p><label class="required" title="'.__('Required field').'">'.__('Database type:').' '.
 form::combo('DBDRIVER',array('MySQL'=>'mysql','PostgreSQL'=>'pgsql'),$DBDRIVER).'</label></p>'.
-'<p><label for="DBHOST">'.__('Database Host Name:').' '.
+'<p><label>'.__('Database Host Name:').' '.
 form::field('DBHOST',30,255,html::escapeHTML($DBHOST)).'</label></p>'.
-'<p><label for="DBNAME">'.__('Database Name:').' '.
+'<p><label>'.__('Database Name:').' '.
 form::field('DBNAME',30,255,html::escapeHTML($DBNAME)).'</label></p>'.
-'<p><label for="DBUSER">'.__('Database User Name:').' '.
+'<p><label>'.__('Database User Name:').' '.
 form::field('DBUSER',30,255,html::escapeHTML($DBUSER)).'</label></p>'.
-'<p><label for="DBPASSWORD">'.__('Database Password:').' '.
+'<p><label>'.__('Database Password:').' '.
 form::password('DBPASSWORD',30,255).'</label></p>'.
-'<p><label for="DBPREFIX" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Database Tables Prefix:').' '.
+'<p><label class="required" title="'.__('Required field').'">'.__('Database Tables Prefix:').' '.
 form::field('DBPREFIX',30,255,html::escapeHTML($DBPREFIX)).'</label></p>'.
 
-'<p><input type="submit" value="'.__('Continue').'" /></p>'.
+'<p><input type="submit" value="'.__('Save').'" /></p>'.
 '</form>';
 ?>
Index: admin/js/_index.js
===================================================================
--- admin/js/_index.js	(revision 454)
+++ admin/js/_index.js	(revision 3)
@@ -4,12 +4,12 @@
 		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() + '" />');
+			var btn = $('<input type="submit" value="' + $('input[name=save-publish]',f).val() + '" tabindex="3" />');
 			$('input[name=save-publish]',f).remove();
 			$('input[name=save]',f).after(btn).after(' ');
@@ -19,10 +19,10 @@
 			});
 		}
-
+		
 		function quickPost(f,status) {
 			if (contentTb.getMode() == 'wysiwyg') {
 				contentTb.syncContents('iframe');
 			}
-
+			
 			var params = {
 				f: 'quickPost',
@@ -35,7 +35,7 @@
 				post_lang: $('#post_lang',f).val()
 			}
-
+			
 			$('p.qinfo',f).remove();
-
+			
 			$.post('services.php',params,function(data) {
 				if ($('rsp[status=failed]',data).length > 0) {
@@ -57,13 +57,13 @@
 					}
 				}
-
+				
 				$('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);
+		cookie: 'dcx_quick_entry',
+	});
 });
Index: admin/js/_media.js
===================================================================
--- admin/js/_media.js	(revision 250)
+++ admin/js/_media.js	(revision 224)
@@ -17,5 +17,12 @@
 	
 	if (!$.browser.opera) {
-		if (dotclear.candyUpload_force_init == '1') {
+		var cue = $('<a/>').attr({'id':'candyupload-enable','href':'#'}).append(dotclear.msg.activate_enhanced_uploader)
+		.click(function() {
+			candyUploadInit();
+			return false;
+		});
+		$('#media-upload>fieldset').append($('<div></div>').append(cue));
+		
+		if ($.cookie('dc_candy_upl') == 1) {
 			candyUploadInit();
 		}
@@ -36,6 +43,16 @@
 				createControls: function() {
 					var _this = this;
+					var cud = $('<a/>').attr({'id':'candyupload-disable','href':'#'}).append(dotclear.msg.disable_enhanced_uploader)
+					.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.btn_browse.hide();
 					this.ctrl.msg.html(dotclear.msg.load_enhanced_uploader);
+					this.ctrl.disable = $('<div class="cu-disable"></div>').append(cud).appendTo(this.ctrl.block);
 				},
 				flashReady: function() {
@@ -50,4 +67,5 @@
 						});
 					});
+					this.ctrl.block.append(this.ctrl.disable);
 				},
 				uploadSuccess: function(o,data) {
Index: admin/js/_post.js
===================================================================
--- admin/js/_post.js	(revision 0)
+++ admin/js/_post.js	(revision 326)
@@ -80,15 +80,14 @@
 		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';
+			$('#post_excerpt').dctoolbar('switch',$(this).val());
+			$('#post_content').dctoolbar('switch',$(this).val());
+		});
+		
+		// Init toolbars
+		$('#post_excerpt,#post_content').dctoolbar({formatter: $(formatField).val()});
 	}
 	
 	if (document.getElementById('comment_content')) {
-		var commentTb = new jsToolBar(document.getElementById('comment_content'));
+		//$('#comment_content').dctoolbar({formatter:'xhtml'});
 	}
 	
@@ -97,5 +96,5 @@
 	
 	// Tabs events
-	$('#edit-entry').onetabload(function() {
+	$('#edit-entry').onetabload(function() { 
 		dotclear.hideLockable();
 		
@@ -125,11 +124,9 @@
 		// 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); },
+			fn: function() { $('#post_excerpt').dctoolbar('draw'); },
 			cookie: 'dcx_post_excerpt',
 			hide: $('#post_excerpt').val() == ''
 		});
-		
-		// Load toolbars
-		contentTb.switchMode(formatField.value);
+		$('#post_content').dctoolbar('draw');
 		
 		// Replace attachment remove links by a POST form submit
@@ -227,5 +224,5 @@
 	
 	$('#add-comment').onetabload(function() {
-		commentTb.draw('xhtml');
+		$('#comment_content').dctoolbarmanager('draw');
 	});
 });
Index: admin/js/_users.js
===================================================================
--- admin/js/_users.js	(revision 548)
+++ admin/js/_users.js	(revision 0)
@@ -20,8 +20,6 @@
 			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;
-					}
+					user_ids[i].checked = false;
+					msg_cannot_delete = true;
 				}
 			}
Index: admin/js/color-picker.js
===================================================================
--- admin/js/color-picker.js	(revision 499)
+++ admin/js/color-picker.js	(revision 0)
@@ -36,7 +36,5 @@
 		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('width',($(this).width()+12)+'px');
 		span.css('padding','0 5px 0 0');
 		$(this).wrap(span);
@@ -47,7 +45,5 @@
 			position: 'absolute',
 			top: 3,
-			/* la largeur du span n'étant pas calculée
-			right: 0 crée un affichage pourri. On vire. */
-			//right: 0
+			right: 0
 		});
 		
Index: admin/js/common.js
===================================================================
--- admin/js/common.js	(revision 343)
+++ admin/js/common.js	(revision 163)
@@ -57,5 +57,5 @@
 }
 
-jQuery.fn.toggleWithLegend = function(target,s) {
+jQuery.fn.toggleWithLegend = function(target,s, callback) {
 	var defaults = {
 		img_on_src: dotclear.img_plus_src,
@@ -79,14 +79,14 @@
 	}
 
-	var toggle = function(i,speed) {
+	var toggle = function(i,speed, callback) {
 		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);
+			target.hide(speed, callback);
 		} else {
 			$(i).get(0).src = p.img_off_src;
 			$(i).get(0).alt = p.img_off_alt;
-			target.show(speed, positionFooter);
+			target.show(speed, callback);
 			if (p.fn) {
 				p.fn.apply(target);
@@ -122,5 +122,5 @@
 		$(ctarget).css('cursor','pointer');
 		$(ctarget).click(function() {
-			toggle(i,p.speed, positionFooter);
+			toggle(i,p.speed, callback);
 			return false;
 		});
@@ -316,29 +316,4 @@
 };
 
-/* Sticky footer
--------------------------------------------------------- */
-function positionFooter() {
-	$("#wrapper").css({ overflow: "auto" });
-	var page_height = $("#top").height() + $("#wrapper").height() - $("#footer").height();
-	if( page_height < $(window).height() ){
-		// calcul de la largeur
-		var page_width = $(document).width() - 30;
-		$("#footer").css({
-			position: "absolute",
-			bottom: "10px",
-			width: page_width+"px",
-			padding: ".75em 0",
-			marginbottom: "0"
-		});
-	} else {
-		$("#footer").css({
-			position: "static",
-			padding: ".75em 0",
-			width: "auto"
-		});
-	}
-
-}
-
 /* On document ready
 -------------------------------------------------------- */
@@ -356,14 +331,18 @@
 	}
 	$('#blog-menu h3:first').toggleWithLegend($('#blog-menu ul:first'),
-		$.extend({cookie:'dc_blog_menu'},menu_settings)
+		$.extend({cookie:'dc_blog_menu'},menu_settings),
+		positionFooter
 	);
 	$('#system-menu h3:first').toggleWithLegend($('#system-menu ul:first'),
-		$.extend({cookie:'dc_system_menu'},menu_settings)
+		$.extend({cookie:'dc_system_menu'},menu_settings),
+		positionFooter
 	);
 	$('#plugins-menu h3:first').toggleWithLegend($('#plugins-menu ul:first'),
-		$.extend({cookie:'dc_plugins_menu'},menu_settings)
+		$.extend({cookie:'dc_plugins_menu'},menu_settings),
+		positionFooter
 	);
 	$('#favorites-menu h3:first').toggleWithLegend($('#favorites-menu ul:first'),
-		$.extend({cookie:'dc_favorites_menu',hide:false,reverse_cookie:true},menu_settings)
+		$.extend({cookie:'dc_favorites_menu',hide:false,reverse_cookie:true},menu_settings),
+		positionFooter
 	);
 
@@ -388,5 +367,28 @@
 	// Sticky footer
 	positionFooter();
+	function positionFooter() {
+		$("#wrapper").css({ overflow: "auto" });
+		var page_height = $("#top").height() + $("#wrapper").height() - $("#footer").height();
+		if( page_height < $(window).height() ){
+			// calcul de la largeur
+			var page_width = $(document).width() - 30;
+			$("#footer").css({
+				position: "absolute",
+				bottom: "10px",
+				width: page_width+"px",
+				padding: ".75em 0",
+				marginbottom: "0"
+			});
+		} else {
+			$("#footer").css({
+				position: "static",
+				padding: ".75em 0",
+				width: "auto",
+			});
+		}
+
+	}
 	$(window).resize(positionFooter);
+
 });
 
Index: admin/js/dcToolBar.js
===================================================================
--- admin/js/dcToolBar.js	(revision 430)
+++ admin/js/dcToolBar.js	(revision 430)
@@ -0,0 +1,131 @@
+(function($){
+	var methods = {
+		init: function(options) {
+			var settings = {
+				formatter: ''
+			}
+			$.extend(settings,options);
+			
+			if (dcToolBar.getConfig(settings.formatter) == null) {
+				if (console != 'undefined') {
+					console.log('No toolbar configuration for formatter ['+ settings.formatter +']');
+				}
+			}
+			
+			tinymce.addI18n(dcToolBar.getI18n());
+			
+			return this.each(function(){
+				$.data(this,'toolbar',new tinymce.Editor($(this).attr('id'),dcToolBar.getConfig(settings.formatter)));
+				$(this).data('toolbar').activeFormatter = settings.formatter;
+			});
+		
+		},
+		draw: function() {
+			return this.each(function(){
+				if ($(this).data('toolbar') == null) {
+					throw 'Toolbar should be initialize before render it';
+				}
+				$(this).data('toolbar').render();
+			});
+		},
+		show: function() {
+			return this.each(function(){
+				if ($(this).data('toolbar') == null) {
+					throw 'Toolbar should be initialize before show it';
+				}
+				var t = $(this).data('toolbar');
+
+				tinymce.dom.show(t.getContainer());
+				t.load();
+			});
+		},
+		hide: function() {
+			return this.each(function(){
+				if ($(this).data('toolbar') == null) {
+					throw 'Toolbar should be initialize before hide it';
+				}
+				var t = $(this).data('toolbar');
+
+				tinymce.dom.hide(t.getContainer());
+				t.load();
+			});
+		},
+		toggle: function() {
+			return this.each(function(){
+				if ($(this).data('toolbar') == null) {
+					throw 'Toolbar should be initialize before toogle it';
+				}
+				var t = $(this).data('toolbar');
+				if (t.isHidden()) {
+					t.show();
+					t.load();
+				}
+				else {
+					t.save();
+					$(t.getContainer()).hide();
+				}
+			});
+		},
+		destroy: function() {
+			return this.each(function(){
+				if ($(this).data('toolbar') == null) {
+					return;
+				}
+				$(this).data('toolbar').remove();
+				$.data(this,'toolbar',null);
+			});
+		},
+		switch: function(formatter) {
+			return this.each(function(){
+				if ($(this).data('formatter') != formatter) {
+					var options = {};
+					options.formatter = formatter;
+					methods.destroy.apply($(this));
+					methods.init.apply($(this),[options]);
+					methods.draw.apply($(this));
+				}
+			});
+		}
+	};
+	
+	$.fn.dctoolbar = function(method) {
+		try {
+			if (methods[method]) {
+				return methods[method].apply(this,Array.prototype.slice.call(arguments,1));
+			} else if (typeof method === 'object' || !method) {
+				return methods.init.apply(this,arguments);
+			} else {
+				throw 'Method ' + method + ' does not exist on jQuery.dctoolbar';
+			}
+		} catch (e) {
+			$.error('Error happend on jQuery.dctoolbar: ' + e);
+		}
+	};
+})(jQuery);
+
+function dcToolBar() {
+	this.setConfig = function(formatter,config) {
+		this.configurations[formatter] = config;
+	};
+	
+	this.setI18n = function(i18n) {
+		this.i18n = i18n;
+	};
+	
+	this.getConfig = function(formatter) {
+		if (this.configurations.hasOwnProperty(formatter)) {
+			return this.configurations[formatter];
+		} else {
+			return null;
+		}
+	};
+	
+	this.getI18n = function() {
+		return this.i18n == null ? {} : this.i18n;
+	};
+}
+
+dcToolBar.prototype = {
+	configurations: {},
+	i18n: null
+}
Index: admin/js/filters.js
===================================================================
--- admin/js/filters.js	(revision 226)
+++ admin/js/filters.js	(revision 226)
@@ -0,0 +1,5 @@
+$(function() {
+	$('#toggle-filters').click(function(e) {
+		$('#filters').toggle('slow');
+	});
+});
Index: admin/js/jquery/jquery.candyUpload.js
===================================================================
--- admin/js/jquery/jquery.candyUpload.js	(revision 536)
+++ admin/js/jquery/jquery.candyUpload.js	(revision 3)
@@ -501,5 +501,5 @@
 			
 			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);
+			$('<div class="cu-maxsize">' + this.locales.max_file_size + ' ' + size + '</div>').appendTo(this.ctrl.block);
 		},
 		
@@ -553,5 +553,5 @@
 					'<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-filecancel"><a href="#">cancel</a></span> ' +
 					'<span class="cu-filemsg"></span>' +
 					'</div>');
Index: admin/js/jquery/jquery.js
===================================================================
--- admin/js/jquery/jquery.js	(revision 0)
+++ admin/js/jquery/jquery.js	(revision 398)
@@ -1,7 +1,7 @@
 /*!
- * jQuery JavaScript Library v1.4.2
+ * jQuery JavaScript Library v1.6.1
  * http://jquery.com/
  *
- * Copyright 2010, John Resig
+ * Copyright 2011, John Resig
  * Dual licensed under the MIT or GPL Version 2 licenses.
  * http://jquery.org/license
@@ -9,15 +9,21 @@
  * Includes Sizzle.js
  * http://sizzlejs.com/
- * Copyright 2010, The Dojo Foundation
+ * Copyright 2011, The Dojo Foundation
  * Released under the MIT, BSD, and GPL Licenses.
  *
- * Date: Sat Feb 13 22:33:48 2010 -0500
+ * Date: Thu May 12 15:04:36 2011 -0400
  */
 (function( window, undefined ) {
+
+// Use the correct document accordingly with window argument (sandbox)
+var document = window.document,
+	navigator = window.navigator,
+	location = window.location;
+var jQuery = (function() {
 
 // Define a local copy of jQuery
 var jQuery = function( selector, context ) {
 		// The jQuery object is actually just the init constructor 'enhanced'
-		return new jQuery.fn.init( selector, context );
+		return new jQuery.fn.init( selector, context, rootjQuery );
 	},
 
@@ -28,7 +34,4 @@
 	_$ = window.$,
 
-	// Use the correct document accordingly with window argument (sandbox)
-	document = window.document,
-
 	// A central reference to the root jQuery(document)
 	rootjQuery,
@@ -36,8 +39,5 @@
 	// A simple way to check for HTML strings or ID strings
 	// (both of which we optimize for)
-	quickExpr = /^[^<]*(<[\w\W]+>)[^>]*$|^#([\w-]+)$/,
-
-	// Is it a simple selector
-	isSimple = /^.[^:#\[\.,]*$/,
+	quickExpr = /^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
 
 	// Check if a string has a non-whitespace character in it
@@ -45,9 +45,25 @@
 
 	// Used for trimming whitespace
-	rtrim = /^(\s|\u00A0)+|(\s|\u00A0)+$/g,
+	trimLeft = /^\s+/,
+	trimRight = /\s+$/,
+
+	// Check for digits
+	rdigit = /\d/,
 
 	// Match a standalone tag
 	rsingleTag = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
 
+	// JSON RegExp
+	rvalidchars = /^[\],:{}\s]*$/,
+	rvalidescape = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
+	rvalidtokens = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
+	rvalidbraces = /(?:^|:|,)(?:\s*\[)+/g,
+
+	// Useragent RegExp
+	rwebkit = /(webkit)[ \/]([\w.]+)/,
+	ropera = /(opera)(?:.*version)?[ \/]([\w.]+)/,
+	rmsie = /(msie) ([\w.]+)/,
+	rmozilla = /(mozilla)(?:.*? rv:([\w.]+))?/,
+
 	// Keep a UserAgent string for use with jQuery.browser
 	userAgent = navigator.userAgent,
@@ -55,10 +71,7 @@
 	// For matching the engine and version of the browser
 	browserMatch,
-	
-	// Has the ready events already been bound?
-	readyBound = false,
-	
-	// The functions to execute on DOM ready
-	readyList = [],
+
+	// The deferred used on DOM ready
+	readyList,
 
 	// The ready event handler
@@ -67,11 +80,16 @@
 	// Save a reference to some core methods
 	toString = Object.prototype.toString,
-	hasOwnProperty = Object.prototype.hasOwnProperty,
+	hasOwn = Object.prototype.hasOwnProperty,
 	push = Array.prototype.push,
 	slice = Array.prototype.slice,
-	indexOf = Array.prototype.indexOf;
+	trim = String.prototype.trim,
+	indexOf = Array.prototype.indexOf,
+
+	// [[Class]] -> type pairs
+	class2type = {};
 
 jQuery.fn = jQuery.prototype = {
-	init: function( selector, context ) {
+	constructor: jQuery,
+	init: function( selector, context, rootjQuery ) {
 		var match, elem, ret, doc;
 
@@ -87,10 +105,10 @@
 			return this;
 		}
-		
+
 		// The body element only exists once, optimize finding it
-		if ( selector === "body" && !context ) {
+		if ( selector === "body" && !context && document.body ) {
 			this.context = document;
 			this[0] = document.body;
-			this.selector = "body";
+			this.selector = selector;
 			this.length = 1;
 			return this;
@@ -100,5 +118,11 @@
 		if ( typeof selector === "string" ) {
 			// Are we dealing with HTML string or an ID?
-			match = quickExpr.exec( selector );
+			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 = quickExpr.exec( selector );
+			}
 
 			// Verify a match, and that no context was specified for #id
@@ -107,4 +131,5 @@
 				// HANDLE: $(html) -> $(array)
 				if ( match[1] ) {
+					context = context instanceof jQuery ? context[0] : context;
 					doc = (context ? context.ownerDocument || context : document);
 
@@ -123,15 +148,17 @@
 
 					} else {
-						ret = buildFragment( [ match[1] ], [ doc ] );
-						selector = (ret.cacheable ? ret.fragment.cloneNode(true) : ret.fragment).childNodes;
-					}
-					
+						ret = jQuery.buildFragment( [ match[1] ], [ doc ] );
+						selector = (ret.cacheable ? jQuery.clone(ret.fragment) : ret.fragment).childNodes;
+					}
+
 					return jQuery.merge( this, selector );
-					
+
 				// HANDLE: $("#id")
 				} else {
 					elem = document.getElementById( match[2] );
 
-					if ( elem ) {
+					// 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
@@ -150,11 +177,4 @@
 				}
 
-			// HANDLE: $("TAG")
-			} else if ( !context && /^\w+$/.test( selector ) ) {
-				this.selector = selector;
-				this.context = document;
-				selector = document.getElementsByTagName( selector );
-				return jQuery.merge( this, selector );
-
 			// HANDLE: $(expr, $(...))
 			} else if ( !context || context.jquery ) {
@@ -164,5 +184,5 @@
 			// (which is just equivalent to: $(context).find(expr)
 			} else {
-				return jQuery( context ).find( selector );
+				return this.constructor( context ).find( selector );
 			}
 
@@ -185,5 +205,5 @@
 
 	// The current version of jQuery being used
-	jquery: "1.4.2",
+	jquery: "1.6.1",
 
 	// The default length of a jQuery object is 0
@@ -208,5 +228,5 @@
 
 			// Return just the object
-			( num < 0 ? this.slice(num)[ 0 ] : this[ num ] );
+			( num < 0 ? this[ this.length + num ] : this[ num ] );
 	},
 
@@ -215,9 +235,9 @@
 	pushStack: function( elems, name, selector ) {
 		// Build a new jQuery matched element set
-		var ret = jQuery();
+		var ret = this.constructor();
 
 		if ( jQuery.isArray( elems ) ) {
 			push.apply( ret, elems );
-		
+
 		} else {
 			jQuery.merge( ret, elems );
@@ -245,23 +265,15 @@
 		return jQuery.each( this, callback, args );
 	},
-	
+
 	ready: function( fn ) {
 		// Attach the listeners
 		jQuery.bindReady();
 
-		// If the DOM is already ready
-		if ( jQuery.isReady ) {
-			// Execute the function immediately
-			fn.call( document, jQuery );
-
-		// Otherwise, remember the function for later
-		} else if ( readyList ) {
-			// Add the function to the wait list
-			readyList.push( fn );
-		}
+		// Add the callback
+		readyList.done( fn );
 
 		return this;
 	},
-	
+
 	eq: function( i ) {
 		return i === -1 ?
@@ -288,7 +300,7 @@
 		}));
 	},
-	
+
 	end: function() {
-		return this.prevObject || jQuery(null);
+		return this.prevObject || this.constructor(null);
 	},
 
@@ -304,6 +316,9 @@
 
 jQuery.extend = jQuery.fn.extend = function() {
-	// copy reference to target object
-	var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options, name, src, copy;
+	var options, name, src, copy, copyIsArray, clone,
+		target = arguments[0] || {},
+		i = 1,
+		length = arguments.length,
+		deep = false;
 
 	// Handle a deep copy situation
@@ -339,8 +354,13 @@
 				}
 
-				// Recurse if we're merging object literal values or arrays
-				if ( deep && copy && ( jQuery.isPlainObject(copy) || jQuery.isArray(copy) ) ) {
-					var clone = src && ( jQuery.isPlainObject(src) || jQuery.isArray(src) ) ? src
-						: jQuery.isArray(copy) ? [] : {};
+				// 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
@@ -361,7 +381,9 @@
 jQuery.extend({
 	noConflict: function( deep ) {
-		window.$ = _$;
-
-		if ( deep ) {
+		if ( window.$ === jQuery ) {
+			window.$ = _$;
+		}
+
+		if ( deep && window.jQuery === jQuery ) {
 			window.jQuery = _jQuery;
 		}
@@ -369,15 +391,28 @@
 		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() {
-		// Make sure that the DOM is not already loaded
-		if ( !jQuery.isReady ) {
+	ready: function( wait ) {
+		// Either a released hold or an DOMready/load event and not yet ready
+		if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
 			// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
 			if ( !document.body ) {
-				return setTimeout( jQuery.ready, 13 );
+				return setTimeout( jQuery.ready, 1 );
 			}
 
@@ -385,34 +420,31 @@
 			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
-			if ( readyList ) {
-				// Execute all of them
-				var fn, i = 0;
-				while ( (fn = readyList[ i++ ]) ) {
-					fn.call( document, jQuery );
-				}
-
-				// Reset the list of functions
-				readyList = null;
-			}
+			readyList.resolveWith( document, [ jQuery ] );
 
 			// Trigger any bound ready events
-			if ( jQuery.fn.triggerHandler ) {
-				jQuery( document ).triggerHandler( "ready" );
-			}
-		}
-	},
-	
+			if ( jQuery.fn.trigger ) {
+				jQuery( document ).trigger( "ready" ).unbind( "ready" );
+			}
+		}
+	},
+
 	bindReady: function() {
-		if ( readyBound ) {
+		if ( readyList ) {
 			return;
 		}
 
-		readyBound = true;
+		readyList = jQuery._Deferred();
 
 		// Catch cases where $(document).ready() is called after the
 		// browser event has already occurred.
 		if ( document.readyState === "complete" ) {
-			return jQuery.ready();
+			// Handle it asynchronously to allow scripts the opportunity to delay ready
+			return setTimeout( jQuery.ready, 1 );
 		}
 
@@ -421,5 +453,5 @@
 			// 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 );
@@ -429,6 +461,6 @@
 			// ensure firing before onload,
 			// maybe late but safe also for iframes
-			document.attachEvent("onreadystatechange", DOMContentLoaded);
-			
+			document.attachEvent( "onreadystatechange", DOMContentLoaded );
+
 			// A fallback to window.onload, that will always work
 			window.attachEvent( "onload", jQuery.ready );
@@ -452,9 +484,24 @@
 	// aren't supported. They return false on IE (#2968).
 	isFunction: function( obj ) {
-		return toString.call(obj) === "[object Function]";
-	},
-
-	isArray: function( obj ) {
-		return toString.call(obj) === "[object Array]";
+		return jQuery.type(obj) === "function";
+	},
+
+	isArray: Array.isArray || function( obj ) {
+		return jQuery.type(obj) === "array";
+	},
+
+	// A crude way of determining if an object is a window
+	isWindow: function( obj ) {
+		return obj && typeof obj === "object" && "setInterval" in obj;
+	},
+
+	isNaN: function( obj ) {
+		return obj == null || !rdigit.test( obj ) || isNaN( obj );
+	},
+
+	type: function( obj ) {
+		return obj == null ?
+			String( obj ) :
+			class2type[ toString.call(obj) ] || "object";
 	},
 
@@ -463,22 +510,22 @@
 		// 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 || toString.call(obj) !== "[object Object]" || obj.nodeType || obj.setInterval ) {
+		if ( !obj || jQuery.type(obj) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
 			return false;
 		}
-		
+
 		// Not own constructor property must be Object
-		if ( obj.constructor
-			&& !hasOwnProperty.call(obj, "constructor")
-			&& !hasOwnProperty.call(obj.constructor.prototype, "isPrototypeOf") ) {
+		if ( obj.constructor &&
+			!hasOwn.call(obj, "constructor") &&
+			!hasOwn.call(obj.constructor.prototype, "isPrototypeOf") ) {
 			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 || hasOwnProperty.call( obj, key );
+
+		return key === undefined || hasOwn.call( obj, key );
 	},
 
@@ -489,9 +536,9 @@
 		return true;
 	},
-	
+
 	error: function( msg ) {
 		throw msg;
 	},
-	
+
 	parseJSON: function( data ) {
 		if ( typeof data !== "string" || !data ) {
@@ -501,43 +548,57 @@
 		// 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 ( /^[\],:{}\s]*$/.test(data.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@")
-			.replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]")
-			.replace(/(?:^|:|,)(?:\s*\[)+/g, "")) ) {
-
-			// Try to use the native JSON parser first
-			return window.JSON && window.JSON.parse ?
-				window.JSON.parse( data ) :
-				(new Function("return " + data))();
-
-		} else {
-			jQuery.error( "Invalid JSON: " + data );
-		}
+		if ( rvalidchars.test( data.replace( rvalidescape, "@" )
+			.replace( rvalidtokens, "]" )
+			.replace( rvalidbraces, "")) ) {
+
+			return (new Function( "return " + data ))();
+
+		}
+		jQuery.error( "Invalid JSON: " + data );
+	},
+
+	// Cross-browser xml parsing
+	// (xml & tmp used internally)
+	parseXML: function( data , xml , tmp ) {
+
+		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 );
+		}
+
+		tmp = xml.documentElement;
+
+		if ( ! tmp || ! tmp.nodeName || tmp.nodeName === "parsererror" ) {
+			jQuery.error( "Invalid XML: " + data );
+		}
+
+		return xml;
 	},
 
 	noop: function() {},
 
-	// Evalulates a script in a global context
+	// 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 && rnotwhite.test(data) ) {
-			// Inspired by code by Andrea Giammarchi
-			// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
-			var head = document.getElementsByTagName("head")[0] || document.documentElement,
-				script = document.createElement("script");
-
-			script.type = "text/javascript";
-
-			if ( jQuery.support.scriptEval ) {
-				script.appendChild( document.createTextNode( data ) );
-			} else {
-				script.text = data;
-			}
-
-			// Use insertBefore instead of appendChild to circumvent an IE6 bug.
-			// This arises when a base node is used (#2709).
-			head.insertBefore( script, head.firstChild );
-			head.removeChild( script );
+		if ( data && 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 );
 		}
 	},
@@ -551,5 +612,5 @@
 		var name, i = 0,
 			length = object.length,
-			isObj = length === undefined || jQuery.isFunction(object);
+			isObj = length === undefined || jQuery.isFunction( object );
 
 		if ( args ) {
@@ -577,6 +638,9 @@
 				}
 			} else {
-				for ( var value = object[0];
-					i < length && callback.call( value, i, value ) !== false; value = object[++i] ) {}
+				for ( ; i < length; ) {
+					if ( callback.call( object[ i ], i, object[ i++ ] ) === false ) {
+						break;
+					}
+				}
 			}
 		}
@@ -585,7 +649,18 @@
 	},
 
-	trim: function( text ) {
-		return (text || "").replace( rtrim, "" );
-	},
+	// Use native String.trim function wherever possible
+	trim: trim ?
+		function( text ) {
+			return text == null ?
+				"" :
+				trim.call( text );
+		} :
+
+		// Otherwise use our own trimming functionality
+		function( text ) {
+			return text == null ?
+				"" :
+				text.toString().replace( trimLeft, "" ).replace( trimRight, "" );
+		},
 
 	// results is for internal usage only
@@ -597,5 +672,8 @@
 			// The extra typeof function check is to prevent crashes
 			// in Safari 2 (See: #3039)
-			if ( array.length == null || typeof array === "string" || jQuery.isFunction(array) || (typeof array !== "function" && array.setInterval) ) {
+			// Tweaked logic slightly to handle Blackberry 4.7 RegExp issues #6930
+			var type = jQuery.type( array );
+
+			if ( array.length == null || type === "string" || type === "function" || type === "regexp" || jQuery.isWindow( array ) ) {
 				push.call( ret, array );
 			} else {
@@ -608,6 +686,7 @@
 
 	inArray: function( elem, array ) {
-		if ( array.indexOf ) {
-			return array.indexOf( elem );
+
+		if ( indexOf ) {
+			return indexOf.call( array, elem );
 		}
 
@@ -622,5 +701,6 @@
 
 	merge: function( first, second ) {
-		var i = first.length, j = 0;
+		var i = first.length,
+			j = 0;
 
 		if ( typeof second.length === "number" ) {
@@ -628,5 +708,5 @@
 				first[ i++ ] = second[ j ];
 			}
-		
+
 		} else {
 			while ( second[j] !== undefined ) {
@@ -641,10 +721,12 @@
 
 	grep: function( elems, callback, inv ) {
-		var ret = [];
+		var ret = [], retVal;
+		inv = !!inv;
 
 		// Go through the array, only saving the items
 		// that pass the validator function
 		for ( var i = 0, length = elems.length; i < length; i++ ) {
-			if ( !inv !== !callback( elems[ i ], i ) ) {
+			retVal = !!callback( elems[ i ], i );
+			if ( inv !== retVal ) {
 				ret.push( elems[ i ] );
 			}
@@ -656,16 +738,32 @@
 	// arg is for internal usage only
 	map: function( elems, callback, arg ) {
-		var ret = [], value;
+		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
-		// new value (or values).
-		for ( var i = 0, length = elems.length; i < length; i++ ) {
-			value = callback( elems[ i ], i, arg );
-
-			if ( value != null ) {
-				ret[ ret.length ] = value;
-			}
-		}
-
+		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 );
 	},
@@ -674,30 +772,62 @@
 	guid: 1,
 
-	proxy: function( fn, proxy, thisObject ) {
-		if ( arguments.length === 2 ) {
-			if ( typeof proxy === "string" ) {
-				thisObject = fn;
-				fn = thisObject[ proxy ];
-				proxy = undefined;
-
-			} else if ( proxy && !jQuery.isFunction( proxy ) ) {
-				thisObject = proxy;
-				proxy = undefined;
-			}
-		}
-
-		if ( !proxy && fn ) {
+	// Bind a function to a context, optionally partially applying any
+	// arguments.
+	proxy: function( fn, context ) {
+		if ( typeof context === "string" ) {
+			var 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
+		var args = slice.call( arguments, 2 ),
 			proxy = function() {
-				return fn.apply( thisObject || this, arguments );
+				return fn.apply( context, args.concat( slice.call( arguments ) ) );
 			};
-		}
 
 		// Set the guid of unique handler to the same of original handler, so it can be removed
-		if ( fn ) {
-			proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
-		}
-
-		// So proxy can be declared as an argument
+		proxy.guid = fn.guid = fn.guid || proxy.guid || jQuery.guid++;
+
 		return proxy;
+	},
+
+	// Mutifunctional method to get and set values to a collection
+	// The value/s can be optionally by executed if its a function
+	access: function( elems, key, value, exec, fn, pass ) {
+		var length = elems.length;
+
+		// Setting many attributes
+		if ( typeof key === "object" ) {
+			for ( var k in key ) {
+				jQuery.access( elems, k, key[k], exec, fn, value );
+			}
+			return elems;
+		}
+
+		// Setting one attribute
+		if ( value !== undefined ) {
+			// Optionally, function values get executed if exec is true
+			exec = !pass && exec && jQuery.isFunction(value);
+
+			for ( var i = 0; i < length; i++ ) {
+				fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
+			}
+
+			return elems;
+		}
+
+		// Getting an attribute
+		return length ? fn( elems[0], key ) : undefined;
+	},
+
+	now: function() {
+		return (new Date()).getTime();
 	},
 
@@ -707,14 +837,40 @@
 		ua = ua.toLowerCase();
 
-		var match = /(webkit)[ \/]([\w.]+)/.exec( ua ) ||
-			/(opera)(?:.*version)?[ \/]([\w.]+)/.exec( ua ) ||
-			/(msie) ([\w.]+)/.exec( ua ) ||
-			!/compatible/.test( ua ) && /(mozilla)(?:.*? rv:([\w.]+))?/.exec( ua ) ||
-		  	[];
+		var match = rwebkit.exec( ua ) ||
+			ropera.exec( ua ) ||
+			rmsie.exec( ua ) ||
+			ua.indexOf("compatible") < 0 && rmozilla.exec( ua ) ||
+			[];
 
 		return { browser: match[1] || "", version: match[2] || "0" };
 	},
 
+	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;
+	},
+
 	browser: {}
+});
+
+// Populate the class2type map
+jQuery.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(i, name) {
+	class2type[ "[object " + name + "]" ] = name.toLowerCase();
 });
 
@@ -730,8 +886,8 @@
 }
 
-if ( indexOf ) {
-	jQuery.inArray = function( elem, array ) {
-		return indexOf.call( array, elem );
-	};
+// IE doesn't match non-breaking spaces with \s
+if ( rnotwhite.test( "\xA0" ) ) {
+	trimLeft = /^[\s\xA0]+/;
+	trimRight = /[\s\xA0]+$/;
 }
 
@@ -766,5 +922,5 @@
 		// http://javascript.nwbox.com/IEContentLoaded/
 		document.documentElement.doScroll("left");
-	} catch( error ) {
+	} catch(e) {
 		setTimeout( doScrollCheck, 1 );
 		return;
@@ -775,91 +931,264 @@
 }
 
-function evalScript( i, elem ) {
-	if ( elem.src ) {
-		jQuery.ajax({
-			url: elem.src,
-			async: false,
-			dataType: "script"
+// Expose jQuery to the global object
+return jQuery;
+
+})();
+
+
+var // Promise methods
+	promiseMethods = "done fail isResolved isRejected promise then always pipe".split( " " ),
+	// Static reference to slice
+	sliceDeferred = [].slice;
+
+jQuery.extend({
+	// Create a simple deferred (one callbacks list)
+	_Deferred: function() {
+		var // callbacks list
+			callbacks = [],
+			// stored [ context , args ]
+			fired,
+			// to avoid firing when already doing so
+			firing,
+			// flag to know if the deferred has been cancelled
+			cancelled,
+			// the deferred itself
+			deferred  = {
+
+				// done( f1, f2, ...)
+				done: function() {
+					if ( !cancelled ) {
+						var args = arguments,
+							i,
+							length,
+							elem,
+							type,
+							_fired;
+						if ( fired ) {
+							_fired = fired;
+							fired = 0;
+						}
+						for ( i = 0, length = args.length; i < length; i++ ) {
+							elem = args[ i ];
+							type = jQuery.type( elem );
+							if ( type === "array" ) {
+								deferred.done.apply( deferred, elem );
+							} else if ( type === "function" ) {
+								callbacks.push( elem );
+							}
+						}
+						if ( _fired ) {
+							deferred.resolveWith( _fired[ 0 ], _fired[ 1 ] );
+						}
+					}
+					return this;
+				},
+
+				// resolve with given context and args
+				resolveWith: function( context, args ) {
+					if ( !cancelled && !fired && !firing ) {
+						// make sure args are available (#8421)
+						args = args || [];
+						firing = 1;
+						try {
+							while( callbacks[ 0 ] ) {
+								callbacks.shift().apply( context, args );
+							}
+						}
+						finally {
+							fired = [ context, args ];
+							firing = 0;
+						}
+					}
+					return this;
+				},
+
+				// resolve with this as context and given arguments
+				resolve: function() {
+					deferred.resolveWith( this, arguments );
+					return this;
+				},
+
+				// Has this deferred been resolved?
+				isResolved: function() {
+					return !!( firing || fired );
+				},
+
+				// Cancel
+				cancel: function() {
+					cancelled = 1;
+					callbacks = [];
+					return this;
+				}
+			};
+
+		return deferred;
+	},
+
+	// Full fledged deferred (two callbacks list)
+	Deferred: function( func ) {
+		var deferred = jQuery._Deferred(),
+			failDeferred = jQuery._Deferred(),
+			promise;
+		// Add errorDeferred methods, then and promise
+		jQuery.extend( deferred, {
+			then: function( doneCallbacks, failCallbacks ) {
+				deferred.done( doneCallbacks ).fail( failCallbacks );
+				return this;
+			},
+			always: function() {
+				return deferred.done.apply( deferred, arguments ).fail.apply( this, arguments );
+			},
+			fail: failDeferred.done,
+			rejectWith: failDeferred.resolveWith,
+			reject: failDeferred.resolve,
+			isRejected: failDeferred.isResolved,
+			pipe: function( fnDone, fnFail ) {
+				return jQuery.Deferred(function( newDefer ) {
+					jQuery.each( {
+						done: [ fnDone, "resolve" ],
+						fail: [ fnFail, "reject" ]
+					}, function( handler, data ) {
+						var fn = data[ 0 ],
+							action = data[ 1 ],
+							returned;
+						if ( jQuery.isFunction( fn ) ) {
+							deferred[ handler ](function() {
+								returned = fn.apply( this, arguments );
+								if ( returned && jQuery.isFunction( returned.promise ) ) {
+									returned.promise().then( newDefer.resolve, newDefer.reject );
+								} else {
+									newDefer[ action ]( returned );
+								}
+							});
+						} else {
+							deferred[ handler ]( newDefer[ action ] );
+						}
+					});
+				}).promise();
+			},
+			// Get a promise for this deferred
+			// If obj is provided, the promise aspect is added to the object
+			promise: function( obj ) {
+				if ( obj == null ) {
+					if ( promise ) {
+						return promise;
+					}
+					promise = obj = {};
+				}
+				var i = promiseMethods.length;
+				while( i-- ) {
+					obj[ promiseMethods[i] ] = deferred[ promiseMethods[i] ];
+				}
+				return obj;
+			}
 		});
-	} else {
-		jQuery.globalEval( elem.text || elem.textContent || elem.innerHTML || "" );
-	}
-
-	if ( elem.parentNode ) {
-		elem.parentNode.removeChild( elem );
-	}
-}
-
-// Mutifunctional method to get and set values to a collection
-// The value/s can be optionally by executed if its a function
-function access( elems, key, value, exec, fn, pass ) {
-	var length = elems.length;
-	
-	// Setting many attributes
-	if ( typeof key === "object" ) {
-		for ( var k in key ) {
-			access( elems, k, key[k], exec, fn, value );
-		}
-		return elems;
-	}
-	
-	// Setting one attribute
-	if ( value !== undefined ) {
-		// Optionally, function values get executed if exec is true
-		exec = !pass && exec && jQuery.isFunction(value);
-		
-		for ( var i = 0; i < length; i++ ) {
-			fn( elems[i], key, exec ? value.call( elems[i], i, fn( elems[i], key ) ) : value, pass );
-		}
-		
-		return elems;
-	}
-	
-	// Getting an attribute
-	return length ? fn( elems[0], key ) : undefined;
-}
-
-function now() {
-	return (new Date).getTime();
-}
-(function() {
-
-	jQuery.support = {};
-
-	var root = document.documentElement,
-		script = document.createElement("script"),
-		div = document.createElement("div"),
-		id = "script" + now();
-
-	div.style.display = "none";
-	div.innerHTML = "   <link/><table></table><a href='/a' style='color:red;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
-
-	var all = div.getElementsByTagName("*"),
-		a = div.getElementsByTagName("a")[0];
+		// Make sure only one callback list will be used
+		deferred.done( failDeferred.cancel ).fail( deferred.cancel );
+		// Unexpose cancel
+		delete deferred.cancel;
+		// Call given func if any
+		if ( func ) {
+			func.call( deferred, deferred );
+		}
+		return deferred;
+	},
+
+	// Deferred helper
+	when: function( firstParam ) {
+		var args = arguments,
+			i = 0,
+			length = args.length,
+			count = length,
+			deferred = length <= 1 && firstParam && jQuery.isFunction( firstParam.promise ) ?
+				firstParam :
+				jQuery.Deferred();
+		function resolveFunc( i ) {
+			return function( value ) {
+				args[ i ] = arguments.length > 1 ? sliceDeferred.call( arguments, 0 ) : value;
+				if ( !( --count ) ) {
+					// Strange bug in FF4:
+					// Values changed onto the arguments object sometimes end up as undefined values
+					// outside the $.when method. Cloning the object into a fresh array solves the issue
+					deferred.resolveWith( deferred, sliceDeferred.call( args, 0 ) );
+				}
+			};
+		}
+		if ( length > 1 ) {
+			for( ; i < length; i++ ) {
+				if ( args[ i ] && jQuery.isFunction( args[ i ].promise ) ) {
+					args[ i ].promise().then( resolveFunc(i), deferred.reject );
+				} else {
+					--count;
+				}
+			}
+			if ( !count ) {
+				deferred.resolveWith( deferred, args );
+			}
+		} else if ( deferred !== firstParam ) {
+			deferred.resolveWith( deferred, length ? [ firstParam ] : [] );
+		}
+		return deferred.promise();
+	}
+});
+
+
+
+jQuery.support = (function() {
+
+	var div = document.createElement( "div" ),
+		documentElement = document.documentElement,
+		all,
+		a,
+		select,
+		opt,
+		input,
+		marginDiv,
+		support,
+		fragment,
+		body,
+		bodyStyle,
+		tds,
+		events,
+		eventName,
+		i,
+		isSupported;
+
+	// Preliminary tests
+	div.setAttribute("className", "t");
+	div.innerHTML = "   <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>";
+
+	all = div.getElementsByTagName( "*" );
+	a = div.getElementsByTagName( "a" )[ 0 ];
 
 	// Can't get basic test support
 	if ( !all || !all.length || !a ) {
-		return;
-	}
-
-	jQuery.support = {
+		return {};
+	}
+
+	// First batch of supports tests
+	select = document.createElement( "select" );
+	opt = select.appendChild( document.createElement("option") );
+	input = div.getElementsByTagName( "input" )[ 0 ];
+
+	support = {
 		// IE strips leading whitespace when .innerHTML is used
-		leadingWhitespace: div.firstChild.nodeType === 3,
+		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,
+		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,
+		htmlSerialize: !!div.getElementsByTagName( "link" ).length,
 
 		// Get the style information from getAttribute
-		// (IE uses .cssText insted)
-		style: /red/.test( a.getAttribute("style") ),
+		// (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",
+		hrefNormalized: ( a.getAttribute( "href" ) === "/a" ),
 
 		// Make sure that element opacity exists
@@ -875,119 +1204,191 @@
 		// that it defaults to "on".
 		// (WebKit defaults to "" instead)
-		checkOn: div.getElementsByTagName("input")[0].value === "on",
+		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: document.createElement("select").appendChild( document.createElement("option") ).selected,
-
-		parentNode: div.removeChild( div.appendChild( document.createElement("div") ) ).parentNode === null,
+		optSelected: opt.selected,
+
+		// Test setAttribute on camelCase class. If it works, we need attrFixes when doing get/setAttribute (ie6/7)
+		getSetAttribute: div.className !== "t",
 
 		// Will be defined later
+		submitBubbles: true,
+		changeBubbles: true,
+		focusinBubbles: false,
 		deleteExpando: true,
-		checkClone: false,
-		scriptEval: false,
 		noCloneEvent: true,
-		boxModel: null
+		inlineBlockNeedsLayout: false,
+		shrinkWrapBlocks: false,
+		reliableMarginRight: true
 	};
 
-	script.type = "text/javascript";
-	try {
-		script.appendChild( document.createTextNode( "window." + id + "=1;" ) );
-	} catch(e) {}
-
-	root.insertBefore( script, root.firstChild );
-
-	// Make sure that the execution of code works by injecting a script
-	// tag with appendChild/createTextNode
-	// (IE doesn't support this, fails, and uses .text instead)
-	if ( window[ id ] ) {
-		jQuery.support.scriptEval = true;
-		delete window[ id ];
-	}
+	// 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 script.test;
-	
-	} catch(e) {
-		jQuery.support.deleteExpando = false;
-	}
-
-	root.removeChild( script );
-
-	if ( div.attachEvent && div.fireEvent ) {
-		div.attachEvent("onclick", function click() {
+		delete div.test;
+	} catch( e ) {
+		support.deleteExpando = false;
+	}
+
+	if ( !div.addEventListener && div.attachEvent && div.fireEvent ) {
+		div.attachEvent( "onclick", function click() {
 			// Cloning a node shouldn't copy over any
 			// bound event handlers (IE does this)
-			jQuery.support.noCloneEvent = false;
-			div.detachEvent("onclick", click);
+			support.noCloneEvent = false;
+			div.detachEvent( "onclick", click );
 		});
-		div.cloneNode(true).fireEvent("onclick");
-	}
-
-	div = document.createElement("div");
-	div.innerHTML = "<input type='radio' name='radiotest' checked='checked'/>";
-
-	var fragment = document.createDocumentFragment();
+		div.cloneNode( true ).fireEvent( "onclick" );
+	}
+
+	// Check if a radio maintains it's 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");
+	div.appendChild( input );
+	fragment = document.createDocumentFragment();
 	fragment.appendChild( div.firstChild );
 
 	// WebKit doesn't clone checked state correctly in fragments
-	jQuery.support.checkClone = fragment.cloneNode(true).cloneNode(true).lastChild.checked;
+	support.checkClone = fragment.cloneNode( true ).cloneNode( true ).lastChild.checked;
+
+	div.innerHTML = "";
 
 	// Figure out if the W3C box model works as expected
-	// document.body must exist before we can do this
-	jQuery(function() {
-		var div = document.createElement("div");
-		div.style.width = div.style.paddingLeft = "1px";
-
-		document.body.appendChild( div );
-		jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
-		document.body.removeChild( div ).style.display = 'none';
-
-		div = null;
-	});
+	div.style.width = div.style.paddingLeft = "1px";
+
+	// We use our own, invisible, body
+	body = document.createElement( "body" );
+	bodyStyle = {
+		visibility: "hidden",
+		width: 0,
+		height: 0,
+		border: 0,
+		margin: 0,
+		// Set background to avoid IE crashes when removing (#9028)
+		background: "none"
+	};
+	for ( i in bodyStyle ) {
+		body.style[ i ] = bodyStyle[ i ];
+	}
+	body.appendChild( div );
+	documentElement.insertBefore( body, documentElement.firstChild );
+
+	// Check if a disconnected checkbox will retain its checked
+	// value of true after appended to the DOM (IE6/7)
+	support.appendChecked = input.checked;
+
+	support.boxModel = div.offsetWidth === 2;
+
+	if ( "zoom" in div.style ) {
+		// 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.style.display = "inline";
+		div.style.zoom = 1;
+		support.inlineBlockNeedsLayout = ( div.offsetWidth === 2 );
+
+		// Check if elements with layout shrink-wrap their children
+		// (IE 6 does this)
+		div.style.display = "";
+		div.innerHTML = "<div style='width:4px;'></div>";
+		support.shrinkWrapBlocks = ( div.offsetWidth !== 2 );
+	}
+
+	div.innerHTML = "<table><tr><td style='padding:0;border:0;display:none'></td><td>t</td></tr></table>";
+	tds = div.getElementsByTagName( "td" );
+
+	// 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)
+	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 );
+	div.innerHTML = "";
+
+	// 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
+	if ( document.defaultView && document.defaultView.getComputedStyle ) {
+		marginDiv = document.createElement( "div" );
+		marginDiv.style.width = "0";
+		marginDiv.style.marginRight = "0";
+		div.appendChild( marginDiv );
+		support.reliableMarginRight =
+			( parseInt( ( document.defaultView.getComputedStyle( marginDiv, null ) || { marginRight: 0 } ).marginRight, 10 ) || 0 ) === 0;
+	}
+
+	// Remove the body element we added
+	body.innerHTML = "";
+	documentElement.removeChild( body );
 
 	// Technique from Juriy Zaytsev
 	// http://thinkweb2.com/projects/prototype/detecting-event-support-without-browser-sniffing/
-	var eventSupported = function( eventName ) { 
-		var el = document.createElement("div"); 
-		eventName = "on" + eventName; 
-
-		var isSupported = (eventName in el); 
-		if ( !isSupported ) { 
-			el.setAttribute(eventName, "return;"); 
-			isSupported = typeof el[eventName] === "function"; 
-		} 
-		el = null; 
-
-		return isSupported; 
-	};
-	
-	jQuery.support.submitBubbles = eventSupported("submit");
-	jQuery.support.changeBubbles = eventSupported("change");
-
-	// release memory in IE
-	root = script = div = all = a = null;
+	// 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: 1,
+			change: 1,
+			focusin: 1
+		} ) {
+			eventName = "on" + i;
+			isSupported = ( eventName in div );
+			if ( !isSupported ) {
+				div.setAttribute( eventName, "return;" );
+				isSupported = ( typeof div[ eventName ] === "function" );
+			}
+			support[ i + "Bubbles" ] = isSupported;
+		}
+	}
+
+	return support;
 })();
 
-jQuery.props = {
-	"for": "htmlFor",
-	"class": "className",
-	readonly: "readOnly",
-	maxlength: "maxLength",
-	cellspacing: "cellSpacing",
-	rowspan: "rowSpan",
-	colspan: "colSpan",
-	tabindex: "tabIndex",
-	usemap: "useMap",
-	frameborder: "frameBorder"
-};
-var expando = "jQuery" + now(), uuid = 0, windowData = {};
+// Keep track of boxModel
+jQuery.boxModel = jQuery.support.boxModel;
+
+
+
+
+var rbrace = /^(?:\{.*\}|\[.*\])$/,
+	rmultiDash = /([a-z])([A-Z])/g;
 
 jQuery.extend({
 	cache: {},
-	
-	expando:expando,
+
+	// Please use with caution
+	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
@@ -995,84 +1396,199 @@
 	noData: {
 		"embed": true,
-		"object": true,
+		// Ban all objects except for Flash (which handle expandos)
+		"object": "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
 		"applet": true
 	},
 
-	data: function( elem, name, data ) {
-		if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+	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;
 		}
 
-		elem = elem == window ?
-			windowData :
-			elem;
-
-		var id = elem[ expando ], cache = jQuery.cache, thisCache;
-
-		if ( !id && typeof name === "string" && data === undefined ) {
-			return null;
-		}
-
-		// Compute a unique ID for the element
-		if ( !id ) { 
-			id = ++uuid;
-		}
-
-		// Avoid generating a new cache unless none exists and we
-		// want to manipulate it.
-		if ( typeof name === "object" ) {
-			elem[ expando ] = id;
-			thisCache = cache[ id ] = jQuery.extend(true, {}, name);
-
-		} else if ( !cache[ id ] ) {
-			elem[ expando ] = id;
+		var internalKey = jQuery.expando, getByName = typeof name === "string", thisCache,
+
+			// 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[ jQuery.expando ] : elem[ jQuery.expando ] && jQuery.expando;
+
+		// 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 || (pvt && id && !cache[ id ][ internalKey ])) && 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[ jQuery.expando ] = id = ++jQuery.uuid;
+			} else {
+				id = jQuery.expando;
+			}
+		}
+
+		if ( !cache[ id ] ) {
 			cache[ id ] = {};
+
+			// TODO: This is a hack for 1.5 ONLY. 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 ][ internalKey ] = jQuery.extend(cache[ id ][ internalKey ], name);
+			} else {
+				cache[ id ] = jQuery.extend(cache[ id ], name);
+			}
 		}
 
 		thisCache = cache[ id ];
 
-		// Prevent overriding the named cache with undefined values
+		// Internal jQuery data is stored in a separate object inside the object's data
+		// cache in order to avoid key collisions between internal data and user-defined
+		// data
+		if ( pvt ) {
+			if ( !thisCache[ internalKey ] ) {
+				thisCache[ internalKey ] = {};
+			}
+
+			thisCache = thisCache[ internalKey ];
+		}
+
 		if ( data !== undefined ) {
-			thisCache[ name ] = data;
-		}
-
-		return typeof name === "string" ? thisCache[ name ] : thisCache;
-	},
-
-	removeData: function( elem, name ) {
-		if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+			thisCache[ jQuery.camelCase( name ) ] = data;
+		}
+
+		// TODO: This is a hack for 1.5 ONLY. It will be removed in 1.6. Users should
+		// not attempt to inspect the internal events object using jQuery.data, as this
+		// internal data object is undocumented and subject to change.
+		if ( name === "events" && !thisCache[name] ) {
+			return thisCache[ internalKey ] && thisCache[ internalKey ].events;
+		}
+
+		return getByName ? thisCache[ jQuery.camelCase( name ) ] : thisCache;
+	},
+
+	removeData: function( elem, name, pvt /* Internal Use Only */ ) {
+		if ( !jQuery.acceptData( elem ) ) {
 			return;
 		}
 
-		elem = elem == window ?
-			windowData :
-			elem;
-
-		var id = elem[ expando ], cache = jQuery.cache, thisCache = cache[ id ];
-
-		// If we want to remove a specific section of the element's data
+		var internalKey = jQuery.expando, isNode = elem.nodeType,
+
+			// See jQuery.data for more information
+			cache = isNode ? jQuery.cache : elem,
+
+			// See jQuery.data for more information
+			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 ) {
+			var thisCache = pvt ? cache[ id ][ internalKey ] : cache[ id ];
+
 			if ( thisCache ) {
-				// Remove the section of cache data
 				delete thisCache[ name ];
 
-				// If we've removed all the data, remove the element's cache
-				if ( jQuery.isEmptyObject(thisCache) ) {
-					jQuery.removeData( elem );
-				}
-			}
-
-		// Otherwise, we want to remove all of the element's data
+				// If there is no data left in the cache, we want to continue
+				// and let the cache object itself get destroyed
+				if ( !isEmptyDataObject(thisCache) ) {
+					return;
+				}
+			}
+		}
+
+		// See jQuery.data for more information
+		if ( pvt ) {
+			delete cache[ id ][ internalKey ];
+
+			// Don't destroy the parent cache unless the internal data object
+			// had been the only thing left in it
+			if ( !isEmptyDataObject(cache[ id ]) ) {
+				return;
+			}
+		}
+
+		var internalCache = cache[ id ][ internalKey ];
+
+		// Browsers that fail expando deletion also refuse to delete expandos on
+		// the window, but it will allow it on all other JS objects; other browsers
+		// don't care
+		if ( jQuery.support.deleteExpando || cache != window ) {
+			delete cache[ id ];
 		} else {
+			cache[ id ] = null;
+		}
+
+		// We destroyed the entire user cache at once because it's faster than
+		// iterating through each key, but we need to continue to persist internal
+		// data if it existed
+		if ( internalCache ) {
+			cache[ id ] = {};
+			// TODO: This is a hack for 1.5 ONLY. Avoids exposing jQuery
+			// metadata on plain JS objects when the object is serialized using
+			// JSON.stringify
+			if ( !isNode ) {
+				cache[ id ].toJSON = jQuery.noop;
+			}
+
+			cache[ id ][ internalKey ] = internalCache;
+
+		// Otherwise, we need to eliminate the expando on the node to avoid
+		// false lookups in the cache for entries that no longer exist
+		} else if ( isNode ) {
+			// 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 ( jQuery.support.deleteExpando ) {
 				delete elem[ jQuery.expando ];
-
 			} else if ( elem.removeAttribute ) {
 				elem.removeAttribute( jQuery.expando );
-			}
-
-			// Completely remove the data cache
-			delete cache[ id ];
-		}
+			} else {
+				elem[ jQuery.expando ] = 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 ) {
+		if ( elem.nodeName ) {
+			var match = jQuery.noData[ elem.nodeName.toLowerCase() ];
+
+			if ( match ) {
+				return !(match === true || elem.getAttribute("classid") !== match);
+			}
+		}
+
+		return true;
 	}
 });
@@ -1080,6 +1596,25 @@
 jQuery.fn.extend({
 	data: function( key, value ) {
-		if ( typeof key === "undefined" && this.length ) {
-			return jQuery.data( this[0] );
+		var data = null;
+
+		if ( typeof key === "undefined" ) {
+			if ( this.length ) {
+				data = jQuery.data( this[0] );
+
+				if ( this[0].nodeType === 1 ) {
+			    var attr = this[0].attributes, name;
+					for ( var i = 0, l = attr.length; i < l; i++ ) {
+						name = attr[i].name;
+
+						if ( name.indexOf( "data-" ) === 0 ) {
+							name = jQuery.camelCase( name.substring(5) );
+
+							dataAttr( this[0], name, data[ name ] );
+						}
+					}
+				}
+			}
+
+			return data;
 
 		} else if ( typeof key === "object" ) {
@@ -1093,15 +1628,24 @@
 
 		if ( value === undefined ) {
-			var data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
-
+			data = this.triggerHandler("getData" + parts[1] + "!", [parts[0]]);
+
+			// Try to fetch any internally stored data first
 			if ( data === undefined && this.length ) {
 				data = jQuery.data( this[0], key );
-			}
+				data = dataAttr( this[0], key, data );
+			}
+
 			return data === undefined && parts[1] ?
 				this.data( parts[0] ) :
 				data;
+
 		} else {
-			return this.trigger("setData" + parts[1] + "!", [parts[0], value]).each(function() {
+			return this.each(function() {
+				var $this = jQuery( this ),
+					args = [ parts[0], value ];
+
+				$this.triggerHandler( "setData" + parts[1] + "!", args );
 				jQuery.data( this, key, value );
+				$this.triggerHandler( "changeData" + parts[1] + "!", args );
 			});
 		}
@@ -1114,26 +1658,112 @@
 	}
 });
+
+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-$2" ).toLowerCase();
+
+		data = elem.getAttribute( name );
+
+		if ( typeof data === "string" ) {
+			try {
+				data = data === "true" ? true :
+				data === "false" ? false :
+				data === "null" ? null :
+				!jQuery.isNaN( data ) ? parseFloat( 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;
+}
+
+// TODO: This is a hack for 1.5 ONLY to allow objects with a single toJSON
+// property to be considered empty objects; this property always exists in
+// order to make sure JSON.stringify does not expose internal metadata
+function isEmptyDataObject( obj ) {
+	for ( var name in obj ) {
+		if ( name !== "toJSON" ) {
+			return false;
+		}
+	}
+
+	return true;
+}
+
+
+
+
+function handleQueueMarkDefer( elem, type, src ) {
+	var deferDataKey = type + "defer",
+		queueDataKey = type + "queue",
+		markDataKey = type + "mark",
+		defer = jQuery.data( elem, deferDataKey, undefined, true );
+	if ( defer &&
+		( src === "queue" || !jQuery.data( elem, queueDataKey, undefined, true ) ) &&
+		( src === "mark" || !jQuery.data( elem, markDataKey, undefined, true ) ) ) {
+		// Give room for hard-coded callbacks to fire first
+		// and eventually mark/queue something else on the element
+		setTimeout( function() {
+			if ( !jQuery.data( elem, queueDataKey, undefined, true ) &&
+				!jQuery.data( elem, markDataKey, undefined, true ) ) {
+				jQuery.removeData( elem, deferDataKey, true );
+				defer.resolve();
+			}
+		}, 0 );
+	}
+}
+
 jQuery.extend({
+
+	_mark: function( elem, type ) {
+		if ( elem ) {
+			type = (type || "fx") + "mark";
+			jQuery.data( elem, type, (jQuery.data(elem,type,undefined,true) || 0) + 1, true );
+		}
+	},
+
+	_unmark: function( force, elem, type ) {
+		if ( force !== true ) {
+			type = elem;
+			elem = force;
+			force = false;
+		}
+		if ( elem ) {
+			type = type || "fx";
+			var key = type + "mark",
+				count = force ? 0 : ( (jQuery.data( elem, key, undefined, true) || 1 ) - 1 );
+			if ( count ) {
+				jQuery.data( elem, key, count, true );
+			} else {
+				jQuery.removeData( elem, key, true );
+				handleQueueMarkDefer( elem, type, "mark" );
+			}
+		}
+	},
+
 	queue: function( elem, type, data ) {
-		if ( !elem ) {
-			return;
-		}
-
-		type = (type || "fx") + "queue";
-		var q = jQuery.data( elem, type );
-
-		// Speed up dequeue by getting out quickly if this is just a lookup
-		if ( !data ) {
+		if ( elem ) {
+			type = (type || "fx") + "queue";
+			var q = jQuery.data( elem, type, undefined, true );
+			// Speed up dequeue by getting out quickly if this is just a lookup
+			if ( data ) {
+				if ( !q || jQuery.isArray(data) ) {
+					q = jQuery.data( elem, type, jQuery.makeArray(data), true );
+				} else {
+					q.push( data );
+				}
+			}
 			return q || [];
 		}
-
-		if ( !q || jQuery.isArray(data) ) {
-			q = jQuery.data( elem, type, jQuery.makeArray(data) );
-
-		} else {
-			q.push( data );
-		}
-
-		return q;
 	},
 
@@ -1141,5 +1771,7 @@
 		type = type || "fx";
 
-		var queue = jQuery.queue( elem, type ), fn = queue.shift();
+		var queue = jQuery.queue( elem, type ),
+			fn = queue.shift(),
+			defer;
 
 		// If the fx queue is dequeued, always remove the progress sentinel
@@ -1159,4 +1791,9 @@
 			});
 		}
+
+		if ( !queue.length ) {
+			jQuery.removeData( elem, type + "queue", true );
+			handleQueueMarkDefer( elem, type, "queue" );
+		}
 	}
 });
@@ -1172,5 +1809,5 @@
 			return jQuery.queue( this[0], type );
 		}
-		return this.each(function( i, elem ) {
+		return this.each(function() {
 			var queue = jQuery.queue( this, type, data );
 
@@ -1185,5 +1822,4 @@
 		});
 	},
-
 	// Based off of the plugin by Clint Helfers, with permission.
 	// http://blindsignals.com/index.php/2009/07/jquery-delay/
@@ -1199,37 +1835,86 @@
 		});
 	},
-
 	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, object ) {
+		if ( typeof type !== "string" ) {
+			object = type;
+			type = undefined;
+		}
+		type = type || "fx";
+		var defer = jQuery.Deferred(),
+			elements = this,
+			i = elements.length,
+			count = 1,
+			deferDataKey = type + "defer",
+			queueDataKey = type + "queue",
+			markDataKey = type + "mark",
+			tmp;
+		function resolve() {
+			if ( !( --count ) ) {
+				defer.resolveWith( elements, [ elements ] );
+			}
+		}
+		while( i-- ) {
+			if (( tmp = jQuery.data( elements[ i ], deferDataKey, undefined, true ) ||
+					( jQuery.data( elements[ i ], queueDataKey, undefined, true ) ||
+						jQuery.data( elements[ i ], markDataKey, undefined, true ) ) &&
+					jQuery.data( elements[ i ], deferDataKey, jQuery._Deferred(), true ) )) {
+				count++;
+				tmp.done( resolve );
+			}
+		}
+		resolve();
+		return defer.promise();
 	}
 });
-var rclass = /[\n\t]/g,
+
+
+
+
+var rclass = /[\n\t\r]/g,
 	rspace = /\s+/,
 	rreturn = /\r/g,
-	rspecialurl = /href|src|style/,
-	rtype = /(button|input)/i,
-	rfocusable = /(button|input|object|select|textarea)/i,
-	rclickable = /^(a|area)$/i,
-	rradiocheck = /radio|checkbox/;
+	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,
+	rinvalidChar = /\:/,
+	formHook, boolHook;
 
 jQuery.fn.extend({
 	attr: function( name, value ) {
-		return access( this, name, value, true, jQuery.attr );
-	},
-
-	removeAttr: function( name, fn ) {
-		return this.each(function(){
-			jQuery.attr( this, name, "" );
-			if ( this.nodeType === 1 ) {
-				this.removeAttribute( name );
-			}
+		return jQuery.access( this, name, value, true, jQuery.attr );
+	},
+
+	removeAttr: function( name ) {
+		return this.each(function() {
+			jQuery.removeAttr( this, name );
 		});
 	},
+	
+	prop: function( name, value ) {
+		return jQuery.access( this, name, value, true, jQuery.prop );
+	},
+	
+	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 ) {
-		if ( jQuery.isFunction(value) ) {
+		if ( jQuery.isFunction( value ) ) {
 			return this.each(function(i) {
 				var self = jQuery(this);
-				self.addClass( value.call(this, i, self.attr("class")) );
+				self.addClass( value.call(this, i, self.attr("class") || "") );
 			});
 		}
@@ -1246,5 +1931,7 @@
 
 					} else {
-						var className = " " + elem.className + " ", setClass = elem.className;
+						var className = " " + elem.className + " ",
+							setClass = elem.className;
+
 						for ( var c = 0, cl = classNames.length; c < cl; c++ ) {
 							if ( className.indexOf( " " + classNames[c] + " " ) < 0 ) {
@@ -1270,5 +1957,5 @@
 
 		if ( (value && typeof value === "string") || value === undefined ) {
-			var classNames = (value || "").split(rspace);
+			var classNames = (value || "").split( rspace );
 
 			for ( var i = 0, l = this.length; i < l; i++ ) {
@@ -1294,5 +1981,6 @@
 
 	toggleClass: function( value, stateVal ) {
-		var type = typeof value, isBool = typeof stateVal === "boolean";
+		var type = typeof value,
+			isBool = typeof stateVal === "boolean";
 
 		if ( jQuery.isFunction( value ) ) {
@@ -1306,5 +1994,7 @@
 			if ( type === "string" ) {
 				// toggle individual class names
-				var className, i = 0, self = jQuery(this),
+				var className,
+					i = 0,
+					self = jQuery( this ),
 					state = stateVal,
 					classNames = value.split( rspace );
@@ -1319,9 +2009,9 @@
 				if ( this.className ) {
 					// store className if set
-					jQuery.data( this, "__className__", this.className );
+					jQuery._data( this, "__className__", this.className );
 				}
 
 				// toggle whole className
-				this.className = this.className || value === false ? "" : jQuery.data( this, "__className__" ) || "";
+				this.className = this.className || value === false ? "" : jQuery._data( this, "__className__" ) || "";
 			}
 		});
@@ -1340,54 +2030,16 @@
 
 	val: function( value ) {
-		if ( value === undefined ) {
-			var elem = this[0];
-
+		var hooks, ret,
+			elem = this[0];
+		
+		if ( !arguments.length ) {
 			if ( elem ) {
-				if ( jQuery.nodeName( elem, "option" ) ) {
-					return (elem.attributes.value || {}).specified ? elem.value : elem.text;
-				}
-
-				// We need to handle select boxes special
-				if ( jQuery.nodeName( elem, "select" ) ) {
-					var index = elem.selectedIndex,
-						values = [],
-						options = elem.options,
-						one = elem.type === "select-one";
-
-					// Nothing was selected
-					if ( index < 0 ) {
-						return null;
-					}
-
-					// Loop through all the selected options
-					for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
-						var option = options[ i ];
-
-						if ( option.selected ) {
-							// Get the specifc 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;
-				}
-
-				// Handle the case where in Webkit "" is returned instead of "on" if a value isn't specified
-				if ( rradiocheck.test( elem.type ) && !jQuery.support.checkOn ) {
-					return elem.getAttribute("value") === null ? "on" : elem.value;
-				}
-				
-
-				// Everything else, we just grab the value
+				hooks = jQuery.valHooks[ elem.nodeName.toLowerCase() ] || jQuery.valHooks[ elem.type ];
+
+				if ( hooks && "get" in hooks && (ret = hooks.get( elem, "value" )) !== undefined ) {
+					return ret;
+				}
+
 				return (elem.value || "").replace(rreturn, "");
-
 			}
 
@@ -1395,8 +2047,8 @@
 		}
 
-		var isFunction = jQuery.isFunction(value);
-
-		return this.each(function(i) {
-			var self = jQuery(this), val = value;
+		var isFunction = jQuery.isFunction( value );
+
+		return this.each(function( i ) {
+			var self = jQuery(this), val;
 
 			if ( this.nodeType !== 1 ) {
@@ -1405,35 +2057,97 @@
 
 			if ( isFunction ) {
-				val = value.call(this, i, self.val());
-			}
-
-			// Typecast each time if the value is a Function and the appended
-			// value is therefore different each time.
-			if ( typeof val === "number" ) {
+				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 += "";
-			}
-
-			if ( jQuery.isArray(val) && rradiocheck.test( this.type ) ) {
-				this.checked = jQuery.inArray( self.val(), val ) >= 0;
-
-			} else if ( jQuery.nodeName( this, "select" ) ) {
-				var values = jQuery.makeArray(val);
-
-				jQuery( "option", this ).each(function() {
+			} else if ( jQuery.isArray( val ) ) {
+				val = jQuery.map(val, function ( value ) {
+					return value == null ? "" : value + "";
+				});
+			}
+
+			hooks = jQuery.valHooks[ this.nodeName.toLowerCase() ] || jQuery.valHooks[ this.type ];
+
+			// 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,
+					index = elem.selectedIndex,
+					values = [],
+					options = elem.options,
+					one = elem.type === "select-one";
+
+				// Nothing was selected
+				if ( index < 0 ) {
+					return null;
+				}
+
+				// Loop through all the selected options
+				for ( var i = one ? index : 0, max = one ? index + 1 : options.length; i < max; i++ ) {
+					var option = options[ i ];
+
+					// Don't return options that are disabled or in a disabled optgroup
+					if ( option.selected && (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 );
+					}
+				}
+
+				// Fixes Bug #2551 -- select.val() broken in IE after form.reset()
+				if ( one && !values.length && options.length ) {
+					return jQuery( options[ index ] ).val();
+				}
+
+				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 ) {
-					this.selectedIndex = -1;
-				}
-
-			} else {
-				this.value = val;
-			}
-		});
-	}
-});
-
-jQuery.extend({
+					elem.selectedIndex = -1;
+				}
+				return values;
+			}
+		}
+	},
+
 	attrFn: {
 		val: true,
@@ -1446,104 +2160,346 @@
 		offset: true
 	},
+	
+	attrFix: {
+		// Always normalize to ensure hook usage
+		tabindex: "tabIndex"
+	},
+	
+	attr: function( elem, name, value, pass ) {
+		var nType = elem.nodeType;
 		
-	attr: function( elem, name, value, pass ) {
-		// don't set attributes on text and comment nodes
-		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
+		// don't get/set attributes on text, comment and attribute nodes
+		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
 			return undefined;
 		}
 
 		if ( pass && name in jQuery.attrFn ) {
-			return jQuery(elem)[name](value);
-		}
-
-		var notxml = elem.nodeType !== 1 || !jQuery.isXMLDoc( elem ),
-			// Whether we are setting (or getting)
-			set = value !== undefined;
-
-		// Try to normalize/fix the name
-		name = notxml && jQuery.props[ name ] || name;
-
-		// Only do all the following if this is a node (faster for style)
+			return jQuery( elem )[ name ]( value );
+		}
+
+		// Fallback to prop when attributes are not supported
+		if ( !("getAttribute" in elem) ) {
+			return jQuery.prop( elem, name, value );
+		}
+
+		var ret, hooks,
+			notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+		// Normalize the name if needed
+		name = notxml && jQuery.attrFix[ name ] || name;
+
+		hooks = jQuery.attrHooks[ name ];
+
+		if ( !hooks ) {
+			// Use boolHook for boolean attributes
+			if ( rboolean.test( name ) &&
+				(typeof value === "boolean" || value === undefined || value.toLowerCase() === name.toLowerCase()) ) {
+
+				hooks = boolHook;
+
+			// Use formHook for forms and if the name contains certain characters
+			} else if ( formHook && (jQuery.nodeName( elem, "form" ) || rinvalidChar.test( name )) ) {
+				hooks = formHook;
+			}
+		}
+
+		if ( value !== undefined ) {
+
+			if ( value === null ) {
+				jQuery.removeAttr( elem, name );
+				return undefined;
+
+			} 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 ) {
+			return hooks.get( elem, name );
+
+		} else {
+
+			ret = elem.getAttribute( name );
+
+			// Non-existent attributes return null, we normalize to undefined
+			return ret === null ?
+				undefined :
+				ret;
+		}
+	},
+
+	removeAttr: function( elem, name ) {
+		var propName;
 		if ( elem.nodeType === 1 ) {
-			// These attributes require special treatment
-			var special = rspecialurl.test( name );
-
-			// Safari mis-reports the default selected property of an option
-			// Accessing the parent's selectedIndex property fixes it
-			if ( name === "selected" && !jQuery.support.optSelected ) {
-				var parent = elem.parentNode;
-				if ( parent ) {
-					parent.selectedIndex;
-	
-					// Make sure that it also works with optgroups, see #5701
-					if ( parent.parentNode ) {
-						parent.parentNode.selectedIndex;
-					}
-				}
-			}
-
-			// If applicable, access the attribute via the DOM 0 way
-			if ( name in elem && notxml && !special ) {
-				if ( set ) {
-					// We can't allow the type property to be changed (since it causes problems in IE)
-					if ( name === "type" && rtype.test( elem.nodeName ) && elem.parentNode ) {
-						jQuery.error( "type property can't be changed" );
-					}
-
-					elem[ name ] = value;
-				}
-
-				// browsers index elements by id/name on forms, give priority to attributes.
-				if ( jQuery.nodeName( elem, "form" ) && elem.getAttributeNode(name) ) {
-					return elem.getAttributeNode( name ).nodeValue;
-				}
-
+			name = jQuery.attrFix[ name ] || name;
+		
+			if ( jQuery.support.getSetAttribute ) {
+				// Use removeAttribute in browsers that support it
+				elem.removeAttribute( name );
+			} else {
+				jQuery.attr( elem, name, "" );
+				elem.removeAttributeNode( elem.getAttributeNode( name ) );
+			}
+
+			// Set corresponding property to false for boolean attributes
+			if ( rboolean.test( name ) && (propName = jQuery.propFix[ name ] || name) 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;
+				}
+			}
+		},
+		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/
-				if ( name === "tabIndex" ) {
-					var attributeNode = elem.getAttributeNode( "tabIndex" );
-
-					return attributeNode && attributeNode.specified ?
-						attributeNode.value :
-						rfocusable.test( elem.nodeName ) || rclickable.test( elem.nodeName ) && elem.href ?
-							0 :
-							undefined;
-				}
-
+				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;
+			}
+		}
+	},
+
+	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 nType = elem.nodeType;
+
+		// don't get/set properties on text, comment and attribute nodes
+		if ( !elem || nType === 3 || nType === 8 || nType === 2 ) {
+			return undefined;
+		}
+
+		var ret, hooks,
+			notxml = nType !== 1 || !jQuery.isXMLDoc( elem );
+
+		// Try to normalize/fix the name
+		name = notxml && 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 )) !== undefined ) {
+				return ret;
+
+			} else {
 				return elem[ name ];
 			}
-
-			if ( !jQuery.support.style && notxml && name === "style" ) {
-				if ( set ) {
-					elem.style.cssText = "" + value;
-				}
-
-				return elem.style.cssText;
-			}
-
-			if ( set ) {
-				// convert the value to a string (all browsers do this but IE) see #1070
-				elem.setAttribute( name, "" + value );
-			}
-
-			var attr = !jQuery.support.hrefNormalized && notxml && special ?
-					// Some attributes require a special call on IE
-					elem.getAttribute( name, 2 ) :
-					elem.getAttribute( name );
-
-			// Non-existent attributes return null, we normalize to undefined
-			return attr === null ? undefined : attr;
-		}
-
-		// elem is actually elem.style ... set the style
-		// Using attr for specific style information is now deprecated. Use style instead.
-		return jQuery.style( elem, name, value );
-	}
+		}
+	},
+	
+	propHooks: {}
 });
-var rnamespaces = /\.(.*)$/,
+
+// Hook for boolean attributes
+boolHook = {
+	get: function( elem, name ) {
+		// Align boolean attributes with corresponding properties
+		return elem[ jQuery.propFix[ name ] || name ] ?
+			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 ] = value;
+			}
+
+			elem.setAttribute( name, name.toLowerCase() );
+		}
+		return name;
+	}
+};
+
+// Use the value property for back compat
+// Use the formHook for button elements in IE6/7 (#1954)
+jQuery.attrHooks.value = {
+	get: function( elem, name ) {
+		if ( formHook && jQuery.nodeName( elem, "button" ) ) {
+			return formHook.get( elem, name );
+		}
+		return elem.value;
+	},
+	set: function( elem, value, name ) {
+		if ( formHook && jQuery.nodeName( elem, "button" ) ) {
+			return formHook.set( elem, value, name );
+		}
+		// Does not return so that setAttribute is also used
+		elem.value = value;
+	}
+};
+
+// IE6/7 do not support getting/setting some attributes with get/setAttribute
+if ( !jQuery.support.getSetAttribute ) {
+
+	// propFix is more comprehensive and contains all fixes
+	jQuery.attrFix = jQuery.propFix;
+	
+	// Use this for any attribute on a form in IE6/7
+	formHook = jQuery.attrHooks.name = jQuery.valHooks.button = {
+		get: function( elem, name ) {
+			var ret;
+			ret = elem.getAttributeNode( name );
+			// Return undefined if nodeValue is empty string
+			return ret && ret.nodeValue !== "" ?
+				ret.nodeValue :
+				undefined;
+		},
+		set: function( elem, value, name ) {
+			// Check form objects in IE (multiple bugs related)
+			// Only use nodeValue if the attribute node exists on the form
+			var ret = elem.getAttributeNode( name );
+			if ( ret ) {
+				ret.nodeValue = value;
+				return 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;
+				}
+			}
+		});
+	});
+}
+
+
+// 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;
+				}
+			}
+		}
+	});
+}
+
+// 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 hasOwn = Object.prototype.hasOwnProperty,
+	rnamespaces = /\.(.*)$/,
+	rformElems = /^(?:textarea|input|select)$/i,
+	rperiod = /\./g,
+	rspaces = / /g,
+	rescape = /[^\w\s.|`]/g,
 	fcleanup = function( nm ) {
-		return nm.replace(/[^\w\s\.\|`]/g, function( ch ) {
-			return "\\" + ch;
-		});
+		return nm.replace(rescape, "\\$&");
 	};
 
@@ -1562,8 +2518,9 @@
 		}
 
-		// For whatever reason, IE has trouble passing the window object
-		// around, causing it to be cloned in the process
-		if ( elem.setInterval && ( elem !== window && !elem.frameElement ) ) {
-			elem = window;
+		if ( handler === false ) {
+			handler = returnFalse;
+		} else if ( !handler ) {
+			// Fixes bug #7229. Fix recommended by jdalton
+			return;
 		}
 
@@ -1581,5 +2538,5 @@
 
 		// Init the element's event structure
-		var elemData = jQuery.data( elem );
+		var elemData = jQuery._data( elem );
 
 		// If no elemData is found then we must be trying to bind to one of the
@@ -1589,12 +2546,16 @@
 		}
 
-		var events = elemData.events = elemData.events || {},
-			eventHandle = elemData.handle, eventHandle;
+		var events = elemData.events,
+			eventHandle = elemData.handle;
+
+		if ( !events ) {
+			elemData.events = events = {};
+		}
 
 		if ( !eventHandle ) {
-			elemData.handle = eventHandle = function() {
-				// Handle the second event of a trigger and when
-				// an event is called after a page has unloaded
-				return typeof jQuery !== "undefined" && !jQuery.event.triggered ?
+			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.handle.apply( eventHandle.elem, arguments ) :
 					undefined;
@@ -1629,5 +2590,7 @@
 
 			handleObj.type = type;
-			handleObj.guid = handler.guid;
+			if ( !handleObj.guid ) {
+				handleObj.guid = handler.guid;
+			}
 
 			// Get the current list of functions bound to this event
@@ -1652,7 +2615,7 @@
 				}
 			}
-			
-			if ( special.add ) { 
-				special.add.call( elem, handleObj ); 
+
+			if ( special.add ) {
+				special.add.call( elem, handleObj );
 
 				if ( !handleObj.handler.guid ) {
@@ -1664,5 +2627,5 @@
 			handlers.push( handleObj );
 
-			// Keep track of which events have been used, for global triggering
+			// Keep track of which events have been used, for event optimization
 			jQuery.event.global[ type ] = true;
 		}
@@ -1681,6 +2644,10 @@
 		}
 
-		var ret, type, fn, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
-			elemData = jQuery.data( elem ),
+		if ( handler === false ) {
+			handler = returnFalse;
+		}
+
+		var ret, type, fn, j, i = 0, all, namespaces, namespace, special, eventType, handleObj, origType,
+			elemData = jQuery.hasData( elem ) && jQuery._data( elem ),
 			events = elemData && elemData.events;
 
@@ -1721,6 +2688,6 @@
 				type = namespaces.shift();
 
-				namespace = new RegExp("(^|\\.)" + 
-					jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)")
+				namespace = new RegExp("(^|\\.)" +
+					jQuery.map( namespaces.slice(0).sort(), fcleanup ).join("\\.(?:.*\\.)?") + "(\\.|$)");
 			}
 
@@ -1732,5 +2699,5 @@
 
 			if ( !handler ) {
-				for ( var j = 0; j < eventType.length; j++ ) {
+				for ( j = 0; j < eventType.length; j++ ) {
 					handleObj = eventType[ j ];
 
@@ -1746,5 +2713,5 @@
 			special = jQuery.event.special[ type ] || {};
 
-			for ( var j = pos || 0; j < eventType.length; j++ ) {
+			for ( j = pos || 0; j < eventType.length; j++ ) {
 				handleObj = eventType[ j ];
 
@@ -1770,5 +2737,5 @@
 			if ( eventType.length === 0 || pos != null && eventType.length === 1 ) {
 				if ( !special.teardown || special.teardown.call( elem, namespaces ) === false ) {
-					removeEvent( elem, type, elemData.handle );
+					jQuery.removeEvent( elem, type, elemData.handle );
 				}
 
@@ -1789,173 +2756,194 @@
 
 			if ( jQuery.isEmptyObject( elemData ) ) {
-				jQuery.removeData( elem );
-			}
-		}
-	},
-
-	// bubbling is internal
-	trigger: function( event, data, elem /*, bubbling */ ) {
+				jQuery.removeData( elem, undefined, 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 ) {
 		// Event object or event type
 		var type = event.type || event,
-			bubbling = arguments[3];
-
-		if ( !bubbling ) {
-			event = typeof event === "object" ?
-				// jQuery.Event object
-				event[expando] ? event :
-				// Object literal
-				jQuery.extend( jQuery.Event(type), event ) :
-				// Just the event type (string)
-				jQuery.Event(type);
-
-			if ( type.indexOf("!") >= 0 ) {
-				event.type = type = type.slice(0, -1);
-				event.exclusive = true;
-			}
-
-			// Handle a global trigger
-			if ( !elem ) {
-				// Don't bubble custom events when global (to avoid too much overhead)
-				event.stopPropagation();
-
-				// Only trigger if we've ever bound an event for it
-				if ( jQuery.event.global[ type ] ) {
-					jQuery.each( jQuery.cache, function() {
-						if ( this.events && this.events[type] ) {
-							jQuery.event.trigger( event, data, this.handle.elem );
+			namespaces = [],
+			exclusive;
+
+		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.exclusive = exclusive;
+		event.namespace = namespaces.join(".");
+		event.namespace_re = new RegExp("(^|\\.)" + namespaces.join("\\.(?:.*\\.)?") + "(\\.|$)");
+		
+		// triggerHandler() and global events don't bubble or run the default action
+		if ( onlyHandlers || !elem ) {
+			event.preventDefault();
+			event.stopPropagation();
+		}
+
+		// Handle a global trigger
+		if ( !elem ) {
+			// TODO: Stop taunting the data cache; remove global events and always attach to document
+			jQuery.each( jQuery.cache, function() {
+				// internalKey variable is just used to make it easier to find
+				// and potentially change this stuff later; currently it just
+				// points to jQuery.expando
+				var internalKey = jQuery.expando,
+					internalCache = this[ internalKey ];
+				if ( internalCache && internalCache.events && internalCache.events[ type ] ) {
+					jQuery.event.trigger( event, data, internalCache.handle.elem );
+				}
+			});
+			return;
+		}
+
+		// Don't do events on text and comment nodes
+		if ( elem.nodeType === 3 || elem.nodeType === 8 ) {
+			return;
+		}
+
+		// Clean up the event in case it is being reused
+		event.result = undefined;
+		event.target = elem;
+
+		// Clone any incoming data and prepend the event, creating the handler arg list
+		data = data ? jQuery.makeArray( data ) : [];
+		data.unshift( event );
+
+		var cur = elem,
+			// IE doesn't like method names with a colon (#3533, #8272)
+			ontype = type.indexOf(":") < 0 ? "on" + type : "";
+
+		// Fire event on the current element, then bubble up the DOM tree
+		do {
+			var handle = jQuery._data( cur, "handle" );
+
+			event.currentTarget = cur;
+			if ( handle ) {
+				handle.apply( cur, data );
+			}
+
+			// Trigger an inline bound script
+			if ( ontype && jQuery.acceptData( cur ) && cur[ ontype ] && cur[ ontype ].apply( cur, data ) === false ) {
+				event.result = false;
+				event.preventDefault();
+			}
+
+			// Bubble up to document, then to window
+			cur = cur.parentNode || cur.ownerDocument || cur === event.target.ownerDocument && window;
+		} while ( cur && !event.isPropagationStopped() );
+
+		// If nobody prevented the default action, do it now
+		if ( !event.isDefaultPrevented() ) {
+			var old,
+				special = jQuery.event.special[ type ] || {};
+
+			if ( (!special._default || special._default.call( elem.ownerDocument, event ) === 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.
+				// IE<9 dies on focus to hidden element (#1486), may want to revisit a try/catch.
+				try {
+					if ( ontype && elem[ type ] ) {
+						// Don't re-trigger an onFOO event when we call its FOO() method
+						old = elem[ ontype ];
+
+						if ( old ) {
+							elem[ ontype ] = null;
 						}
-					});
-				}
-			}
-
-			// Handle triggering a single element
-
-			// don't do events on text and comment nodes
-			if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
-				return undefined;
-			}
-
-			// Clean up in case it is reused
-			event.result = undefined;
-			event.target = elem;
-
-			// Clone the incoming data, if any
-			data = jQuery.makeArray( data );
-			data.unshift( event );
-		}
-
-		event.currentTarget = elem;
-
-		// Trigger the event, it is assumed that "handle" is a function
-		var handle = jQuery.data( elem, "handle" );
-		if ( handle ) {
-			handle.apply( elem, data );
-		}
-
-		var parent = elem.parentNode || elem.ownerDocument;
-
-		// Trigger an inline bound script
-		try {
-			if ( !(elem && elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()]) ) {
-				if ( elem[ "on" + type ] && elem[ "on" + type ].apply( elem, data ) === false ) {
-					event.result = false;
-				}
-			}
-
-		// prevent IE from throwing an error for some elements with some event types, see #3533
-		} catch (e) {}
-
-		if ( !event.isPropagationStopped() && parent ) {
-			jQuery.event.trigger( event, data, parent, true );
-
-		} else if ( !event.isDefaultPrevented() ) {
-			var target = event.target, old,
-				isClick = jQuery.nodeName(target, "a") && type === "click",
-				special = jQuery.event.special[ type ] || {};
-
-			if ( (!special._default || special._default.call( elem, event ) === false) && 
-				!isClick && !(target && target.nodeName && jQuery.noData[target.nodeName.toLowerCase()]) ) {
-
-				try {
-					if ( target[ type ] ) {
-						// Make sure that we don't accidentally re-trigger the onFOO events
-						old = target[ "on" + type ];
-
-						if ( old ) {
-							target[ "on" + type ] = null;
-						}
-
-						jQuery.event.triggered = true;
-						target[ type ]();
-					}
-
-				// prevent IE from throwing an error for some elements with some event types, see #3533
-				} catch (e) {}
+
+						jQuery.event.triggered = type;
+						elem[ type ]();
+					}
+				} catch ( ieError ) {}
 
 				if ( old ) {
-					target[ "on" + type ] = old;
-				}
-
-				jQuery.event.triggered = false;
-			}
-		}
+					elem[ ontype ] = old;
+				}
+
+				jQuery.event.triggered = undefined;
+			}
+		}
+		
+		return event.result;
 	},
 
 	handle: function( event ) {
-		var all, handlers, namespaces, namespace, events;
-
-		event = arguments[0] = jQuery.event.fix( event || window.event );
+		event = jQuery.event.fix( event || window.event );
+		// Snapshot the handlers list since a called handler may add/remove events.
+		var handlers = ((jQuery._data( this, "events" ) || {})[ event.type ] || []).slice(0),
+			run_all = !event.exclusive && !event.namespace,
+			args = Array.prototype.slice.call( arguments, 0 );
+
+		// Use the fix-ed Event rather than the (read-only) native event
+		args[0] = event;
 		event.currentTarget = this;
 
-		// Namespaced event handlers
-		all = event.type.indexOf(".") < 0 && !event.exclusive;
-
-		if ( !all ) {
-			namespaces = event.type.split(".");
-			event.type = namespaces.shift();
-			namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
-		}
-
-		var events = jQuery.data(this, "events"), handlers = events[ event.type ];
-
-		if ( events && handlers ) {
-			// Clone the handlers to prevent manipulation
-			handlers = handlers.slice(0);
-
-			for ( var j = 0, l = handlers.length; j < l; j++ ) {
-				var handleObj = handlers[ j ];
-
-				// Filter the functions by class
-				if ( all || namespace.test( handleObj.namespace ) ) {
-					// Pass in a reference to the handler function itself
-					// So that we can later remove it
-					event.handler = handleObj.handler;
-					event.data = handleObj.data;
-					event.handleObj = handleObj;
-	
-					var ret = handleObj.handler.apply( this, arguments );
-
-					if ( ret !== undefined ) {
-						event.result = ret;
-						if ( ret === false ) {
-							event.preventDefault();
-							event.stopPropagation();
-						}
-					}
-
-					if ( event.isImmediatePropagationStopped() ) {
-						break;
-					}
-				}
-			}
-		}
-
+		for ( var j = 0, l = handlers.length; j < l; j++ ) {
+			var handleObj = handlers[ j ];
+
+			// Triggered event must 1) be non-exclusive and have no namespace, or
+			// 2) have namespace(s) a subset or equal to those in the bound event.
+			if ( run_all || event.namespace_re.test( handleObj.namespace ) ) {
+				// Pass in a reference to the handler function itself
+				// So that we can later remove it
+				event.handler = handleObj.handler;
+				event.data = handleObj.data;
+				event.handleObj = handleObj;
+
+				var ret = handleObj.handler.apply( this, args );
+
+				if ( ret !== undefined ) {
+					event.result = ret;
+					if ( ret === false ) {
+						event.preventDefault();
+						event.stopPropagation();
+					}
+				}
+
+				if ( event.isImmediatePropagationStopped() ) {
+					break;
+				}
+			}
+		}
 		return event.result;
 	},
 
-	props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
+	props: "altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode layerX layerY metaKey newValue offsetX offsetY pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),
 
 	fix: function( event ) {
-		if ( event[ expando ] ) {
+		if ( event[ jQuery.expando ] ) {
 			return event;
 		}
@@ -1973,5 +2961,6 @@
 		// Fix target property, if necessary
 		if ( !event.target ) {
-			event.target = event.srcElement || document; // Fixes #1925 where srcElement might not be defined either
+			// Fixes #1925 where srcElement might not be defined either
+			event.target = event.srcElement || document;
 		}
 
@@ -1988,5 +2977,8 @@
 		// Calculate pageX/Y if missing and clientX/Y available
 		if ( event.pageX == null && event.clientX != null ) {
-			var doc = document.documentElement, body = document.body;
+			var eventDocument = event.target.ownerDocument || document,
+				doc = eventDocument.documentElement,
+				body = eventDocument.body;
+
 			event.pageX = event.clientX + (doc && doc.scrollLeft || body && body.scrollLeft || 0) - (doc && doc.clientLeft || body && body.clientLeft || 0);
 			event.pageY = event.clientY + (doc && doc.scrollTop  || body && body.scrollTop  || 0) - (doc && doc.clientTop  || body && body.clientTop  || 0);
@@ -1994,6 +2986,6 @@
 
 		// Add which for key events
-		if ( !event.which && ((event.charCode || event.charCode === 0) ? event.charCode : event.keyCode) ) {
-			event.which = event.charCode || event.keyCode;
+		if ( event.which == null && (event.charCode != null || event.keyCode != null) ) {
+			event.which = event.charCode != null ? event.charCode : event.keyCode;
 		}
 
@@ -2027,23 +3019,12 @@
 		live: {
 			add: function( handleObj ) {
-				jQuery.event.add( this, handleObj.origType, jQuery.extend({}, handleObj, {handler: liveHandler}) ); 
+				jQuery.event.add( this,
+					liveConvert( handleObj.origType, handleObj.selector ),
+					jQuery.extend({}, handleObj, {handler: liveHandler, guid: handleObj.handler.guid}) );
 			},
 
 			remove: function( handleObj ) {
-				var remove = true,
-					type = handleObj.origType.replace(rnamespaces, "");
-				
-				jQuery.each( jQuery.data(this, "events").live || [], function() {
-					if ( type === this.origType.replace(rnamespaces, "") ) {
-						remove = false;
-						return false;
-					}
-				});
-
-				if ( remove ) {
-					jQuery.event.remove( this, handleObj.origType, liveHandler );
-				}
-			}
-
+				jQuery.event.remove( this, liveConvert( handleObj.origType, handleObj.selector ), handleObj );
+			}
 		},
 
@@ -2051,10 +3032,9 @@
 			setup: function( data, namespaces, eventHandle ) {
 				// We only want to do this special case on windows
-				if ( this.setInterval ) {
+				if ( jQuery.isWindow( this ) ) {
 					this.onbeforeunload = eventHandle;
 				}
-
-				return false;
 			},
+
 			teardown: function( namespaces, eventHandle ) {
 				if ( this.onbeforeunload === eventHandle ) {
@@ -2066,16 +3046,20 @@
 };
 
-var removeEvent = document.removeEventListener ?
+jQuery.removeEvent = document.removeEventListener ?
 	function( elem, type, handle ) {
-		elem.removeEventListener( type, handle, false );
-	} : 
+		if ( elem.removeEventListener ) {
+			elem.removeEventListener( type, handle, false );
+		}
+	} :
 	function( elem, type, handle ) {
-		elem.detachEvent( "on" + type, handle );
+		if ( elem.detachEvent ) {
+			elem.detachEvent( "on" + type, handle );
+		}
 	};
 
-jQuery.Event = function( src ) {
+jQuery.Event = function( src, props ) {
 	// Allow instantiation without the 'new' keyword
 	if ( !this.preventDefault ) {
-		return new jQuery.Event( src );
+		return new jQuery.Event( src, props );
 	}
 
@@ -2084,4 +3068,10 @@
 		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 {
@@ -2089,10 +3079,15 @@
 	}
 
+	// Put explicitly provided properties onto the event object
+	if ( props ) {
+		jQuery.extend( this, props );
+	}
+
 	// timeStamp is buggy for some events on Firefox(#3843)
 	// So we won't rely on the native value
-	this.timeStamp = now();
+	this.timeStamp = jQuery.now();
 
 	// Mark it as fixed
-	this[ expando ] = true;
+	this[ jQuery.expando ] = true;
 };
 
@@ -2114,11 +3109,13 @@
 			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)
-		e.returnValue = false;
+		} else {
+			e.returnValue = false;
+		}
 	},
 	stopPropagation: function() {
@@ -2151,7 +3148,17 @@
 	var parent = event.relatedTarget;
 
+	// set the correct event type
+	event.type = event.data;
+
 	// Firefox sometimes assigns relatedTarget a XUL element
 	// which we cannot access the parentNode property of
 	try {
+
+		// Chrome does something similar, the parentNode property
+		// can be accessed but is null.
+		if ( parent && parent !== document && !parent.parentNode ) {
+			return;
+		}
+
 		// Traverse up the tree
 		while ( parent && parent !== this ) {
@@ -2160,7 +3167,4 @@
 
 		if ( parent !== this ) {
-			// set the correct event type
-			event.type = event.data;
-
 			// handle event if we actually just moused on to a non sub-element
 			jQuery.event.handle.apply( this, arguments );
@@ -2198,18 +3202,20 @@
 	jQuery.event.special.submit = {
 		setup: function( data, namespaces ) {
-			if ( this.nodeName.toLowerCase() !== "form" ) {
+			if ( !jQuery.nodeName( this, "form" ) ) {
 				jQuery.event.add(this, "click.specialSubmit", function( e ) {
-					var elem = e.target, type = elem.type;
+					var elem = e.target,
+						type = elem.type;
 
 					if ( (type === "submit" || type === "image") && jQuery( elem ).closest("form").length ) {
-						return trigger( "submit", this, arguments );
+						trigger( "submit", this, arguments );
 					}
 				});
-	 
+
 				jQuery.event.add(this, "keypress.specialSubmit", function( e ) {
-					var elem = e.target, type = elem.type;
+					var elem = e.target,
+						type = elem.type;
 
 					if ( (type === "text" || type === "password") && jQuery( elem ).closest("form").length && e.keyCode === 13 ) {
-						return trigger( "submit", this, arguments );
+						trigger( "submit", this, arguments );
 					}
 				});
@@ -2230,7 +3236,5 @@
 if ( !jQuery.support.changeBubbles ) {
 
-	var formElems = /textarea|input|select/i,
-
-	changeFilters,
+	var changeFilters,
 
 	getVal = function( elem ) {
@@ -2247,5 +3251,5 @@
 				"";
 
-		} else if ( elem.nodeName.toLowerCase() === "select" ) {
+		} else if ( jQuery.nodeName( elem, "select" ) ) {
 			val = elem.selectedIndex;
 		}
@@ -2257,16 +3261,16 @@
 		var elem = e.target, data, val;
 
-		if ( !formElems.test( elem.nodeName ) || elem.readOnly ) {
+		if ( !rformElems.test( elem.nodeName ) || elem.readOnly ) {
 			return;
 		}
 
-		data = jQuery.data( elem, "_change_data" );
+		data = jQuery._data( elem, "_change_data" );
 		val = getVal(elem);
 
 		// the current data will be also retrieved by beforeactivate
 		if ( e.type !== "focusout" || elem.type !== "radio" ) {
-			jQuery.data( elem, "_change_data", val );
-		}
-		
+			jQuery._data( elem, "_change_data", val );
+		}
+
 		if ( data === undefined || val === data ) {
 			return;
@@ -2275,5 +3279,6 @@
 		if ( data != null || val ) {
 			e.type = "change";
-			return jQuery.event.trigger( e, arguments[1], elem );
+			e.liveFired = undefined;
+			jQuery.event.trigger( e, arguments[1], elem );
 		}
 	};
@@ -2281,11 +3286,13 @@
 	jQuery.event.special.change = {
 		filters: {
-			focusout: testChange, 
+			focusout: testChange,
+
+			beforedeactivate: testChange,
 
 			click: function( e ) {
-				var elem = e.target, type = elem.type;
-
-				if ( type === "radio" || type === "checkbox" || elem.nodeName.toLowerCase() === "select" ) {
-					return testChange.call( this, e );
+				var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
+
+				if ( type === "radio" || type === "checkbox" || jQuery.nodeName( elem, "select" ) ) {
+					testChange.call( this, e );
 				}
 			},
@@ -2294,10 +3301,10 @@
 			// Keydown will be called before keypress, which is used in submit-event delegation
 			keydown: function( e ) {
-				var elem = e.target, type = elem.type;
-
-				if ( (e.keyCode === 13 && elem.nodeName.toLowerCase() !== "textarea") ||
+				var elem = e.target, type = jQuery.nodeName( elem, "input" ) ? elem.type : "";
+
+				if ( (e.keyCode === 13 && !jQuery.nodeName( elem, "textarea" ) ) ||
 					(e.keyCode === 32 && (type === "checkbox" || type === "radio")) ||
 					type === "select-multiple" ) {
-					return testChange.call( this, e );
+					testChange.call( this, e );
 				}
 			},
@@ -2305,8 +3312,8 @@
 			// Beforeactivate happens also before the previous element is blurred
 			// with this event you can't trigger a change event, but you can store
-			// information/focus[in] is not needed anymore
+			// information
 			beforeactivate: function( e ) {
 				var elem = e.target;
-				jQuery.data( elem, "_change_data", getVal(elem) );
+				jQuery._data( elem, "_change_data", getVal(elem) );
 			}
 		},
@@ -2321,5 +3328,5 @@
 			}
 
-			return formElems.test( this.nodeName );
+			return rformElems.test( this.nodeName );
 		},
 
@@ -2327,32 +3334,59 @@
 			jQuery.event.remove( this, ".specialChange" );
 
-			return formElems.test( this.nodeName );
+			return rformElems.test( this.nodeName );
 		}
 	};
 
 	changeFilters = jQuery.event.special.change.filters;
+
+	// Handle when the input is .focus()'d
+	changeFilters.focus = changeFilters.beforeactivate;
 }
 
 function trigger( type, elem, args ) {
-	args[0].type = type;
-	return jQuery.event.handle.apply( elem, args );
+	// 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.
+	// Don't pass args or remember liveFired; they apply to the donor event.
+	var event = jQuery.extend( {}, args[ 0 ] );
+	event.type = type;
+	event.originalEvent = {};
+	event.liveFired = undefined;
+	jQuery.event.handle.call( elem, event );
+	if ( event.isDefaultPrevented() ) {
+		args[ 0 ].preventDefault();
+	}
 }
 
 // Create "bubbling" focus and blur events
-if ( document.addEventListener ) {
+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;
+
 		jQuery.event.special[ fix ] = {
 			setup: function() {
-				this.addEventListener( orig, handler, true );
-			}, 
-			teardown: function() { 
-				this.removeEventListener( orig, handler, true );
+				if ( attaches++ === 0 ) {
+					document.addEventListener( orig, handler, true );
+				}
+			},
+			teardown: function() {
+				if ( --attaches === 0 ) {
+					document.removeEventListener( orig, handler, true );
+				}
 			}
 		};
 
-		function handler( e ) { 
-			e = jQuery.event.fix( e );
+		function handler( donor ) {
+			// Donor event is always a native one; fix it and switch its type.
+			// Let focusin/out handler cancel the donor focus/blur event.
+			var e = jQuery.event.fix( donor );
 			e.type = fix;
-			return jQuery.event.handle.call( this, e );
+			e.originalEvent = {};
+			jQuery.event.trigger( e, null, e.target );
+			if ( e.isDefaultPrevented() ) {
+				donor.preventDefault();
+			}
 		}
 	});
@@ -2361,4 +3395,6 @@
 jQuery.each(["bind", "one"], function( i, name ) {
 	jQuery.fn[ name ] = function( type, data, fn ) {
+		var handler;
+
 		// Handle object literals
 		if ( typeof type === "object" ) {
@@ -2368,14 +3404,19 @@
 			return this;
 		}
-		
-		if ( jQuery.isFunction( data ) ) {
+
+		if ( arguments.length === 2 || data === false ) {
 			fn = data;
 			data = undefined;
 		}
 
-		var handler = name === "one" ? jQuery.proxy( fn, function( event ) {
-			jQuery( this ).unbind( event, handler );
-			return fn.apply( this, arguments );
-		}) : fn;
+		if ( name === "one" ) {
+			handler = function( event ) {
+				jQuery( this ).unbind( event, handler );
+				return fn.apply( this, arguments );
+			};
+			handler.guid = fn.guid || jQuery.guid++;
+		} else {
+			handler = fn;
+		}
 
 		if ( type === "unload" && name !== "one" ) {
@@ -2408,18 +3449,18 @@
 		return this;
 	},
-	
+
 	delegate: function( selector, types, data, fn ) {
 		return this.live( types, data, fn, selector );
 	},
-	
+
 	undelegate: function( selector, types, fn ) {
 		if ( arguments.length === 0 ) {
-				return this.unbind( "live" );
-		
+			return this.unbind( "live" );
+
 		} else {
 			return this.die( types, null, fn, selector );
 		}
 	},
-	
+
 	trigger: function( type, data ) {
 		return this.each(function() {
@@ -2430,9 +3471,5 @@
 	triggerHandler: function( type, data ) {
 		if ( this[0] ) {
-			var event = jQuery.Event( type );
-			event.preventDefault();
-			event.stopPropagation();
-			jQuery.event.trigger( event, data, this[0] );
-			return event.result;
+			return jQuery.event.trigger( type, data, this[0], true );
 		}
 	},
@@ -2440,22 +3477,26 @@
 	toggle: function( fn ) {
 		// Save reference to arguments for access in closure
-		var args = arguments, i = 1;
+		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 ) {
-			jQuery.proxy( fn, args[ i++ ] );
-		}
-
-		return this.click( jQuery.proxy( fn, 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;
-		}));
+			args[ i++ ].guid = guid;
+		}
+
+		return this.click( toggler );
 	},
 
@@ -2478,6 +3519,22 @@
 			context = origSelector ? this : jQuery( this.context );
 
-		if ( jQuery.isFunction( data ) ) {
-			fn = data;
+		if ( typeof types === "object" && !types.preventDefault ) {
+			for ( var key in types ) {
+				context[ name ]( key, data, types[key], selector );
+			}
+
+			return this;
+		}
+
+		if ( name === "die" && !types &&
+					origSelector && origSelector.charAt(0) === "." ) {
+
+			context.unbind( origSelector );
+
+			return this;
+		}
+
+		if ( data === false || jQuery.isFunction( data ) ) {
+			fn = data || returnFalse;
 			data = undefined;
 		}
@@ -2501,5 +3558,5 @@
 			preType = type;
 
-			if ( type === "focus" || type === "blur" ) {
+			if ( liveMap[ type ] ) {
 				types.push( liveMap[ type ] + namespaces );
 				type = type + namespaces;
@@ -2511,27 +3568,32 @@
 			if ( name === "live" ) {
 				// bind live handler
-				context.each(function(){
-					jQuery.event.add( this, liveConvert( type, selector ),
+				for ( var j = 0, l = context.length; j < l; j++ ) {
+					jQuery.event.add( context[j], "live." + liveConvert( type, selector ),
 						{ data: data, selector: selector, handler: fn, origType: type, origHandler: fn, preType: preType } );
-				});
+				}
 
 			} else {
 				// unbind live handler
-				context.unbind( liveConvert( type, selector ), fn );
-			}
-		}
-		
+				context.unbind( "live." + liveConvert( type, selector ), fn );
+			}
+		}
+
 		return this;
-	}
+	};
 });
 
 function liveHandler( event ) {
-	var stop, elems = [], selectors = [], args = arguments,
-		related, match, handleObj, elem, j, i, l, data,
-		events = jQuery.data( this, "events" );
-
-	// Make sure we avoid non-left-click bubbling in Firefox (#3861)
-	if ( event.liveFired === this || !events || !events.live || event.button && event.type === "click" ) {
+	var stop, maxLevel, related, match, handleObj, elem, j, i, l, data, close, namespace, ret,
+		elems = [],
+		selectors = [],
+		events = jQuery._data( this, "events" );
+
+	// Make sure we avoid non-left-click bubbling in Firefox (#3861) and disabled elements in IE (#6911)
+	if ( event.liveFired === this || !events || !events.live || event.target.disabled || event.button && event.type === "click" ) {
 		return;
+	}
+
+	if ( event.namespace ) {
+		namespace = new RegExp("(^|\\.)" + event.namespace.split(".").join("\\.(?:.*\\.)?") + "(\\.|$)");
 	}
 
@@ -2554,18 +3616,26 @@
 
 	for ( i = 0, l = match.length; i < l; i++ ) {
+		close = match[i];
+
 		for ( j = 0; j < live.length; j++ ) {
 			handleObj = live[j];
 
-			if ( match[i].selector === handleObj.selector ) {
-				elem = match[i].elem;
+			if ( close.selector === handleObj.selector && (!namespace || namespace.test( handleObj.namespace )) && !close.elem.disabled ) {
+				elem = close.elem;
 				related = null;
 
 				// Those two events require additional checking
 				if ( handleObj.preType === "mouseenter" || handleObj.preType === "mouseleave" ) {
+					event.type = handleObj.preType;
 					related = jQuery( event.relatedTarget ).closest( handleObj.selector )[0];
+
+					// Make sure not to accidentally match a child element with the same selector
+					if ( related && jQuery.contains( elem, related ) ) {
+						related = elem;
+					}
 				}
 
 				if ( !related || related !== elem ) {
-					elems.push({ elem: elem, handleObj: handleObj });
+					elems.push({ elem: elem, handleObj: handleObj, level: close.level });
 				}
 			}
@@ -2575,11 +3645,24 @@
 	for ( i = 0, l = elems.length; i < l; i++ ) {
 		match = elems[i];
+
+		if ( maxLevel && match.level > maxLevel ) {
+			break;
+		}
+
 		event.currentTarget = match.elem;
 		event.data = match.handleObj.data;
 		event.handleObj = match.handleObj;
 
-		if ( match.handleObj.origHandler.apply( match.elem, args ) === false ) {
-			stop = false;
-			break;
+		ret = match.handleObj.origHandler.apply( match.elem, arguments );
+
+		if ( ret === false || event.isPropagationStopped() ) {
+			maxLevel = match.level;
+
+			if ( ret === false ) {
+				stop = false;
+			}
+			if ( event.isImmediatePropagationStopped() ) {
+				break;
+			}
 		}
 	}
@@ -2589,5 +3672,5 @@
 
 function liveConvert( type, selector ) {
-	return "live." + (type && type !== "*" ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&");
+	return (type && type !== "*" ? type + "." : "") + selector.replace(rperiod, "`").replace(rspaces, "&");
 }
 
@@ -2597,6 +3680,13 @@
 
 	// Handle event binding
-	jQuery.fn[ name ] = function( fn ) {
-		return fn ? this.bind( name, fn ) : this.trigger( name );
+	jQuery.fn[ name ] = function( data, fn ) {
+		if ( fn == null ) {
+			fn = data;
+			data = null;
+		}
+
+		return arguments.length > 0 ?
+			this.bind( name, data, fn ) :
+			this.trigger( name );
 	};
 
@@ -2606,23 +3696,9 @@
 });
 
-// Prevent memory leaks in IE
-// Window isn't included so as not to unbind existing unload events
-// More info:
-//  - http://isaacschlueter.com/2006/10/msie-memory-leaks/
-if ( window.attachEvent && !window.addEventListener ) {
-	window.attachEvent("onunload", function() {
-		for ( var id in jQuery.cache ) {
-			if ( jQuery.cache[ id ].handle ) {
-				// Try/Catch is to handle iframes being unloaded, see #4280
-				try {
-					jQuery.event.remove( jQuery.cache[ id ].handle.elem );
-				} catch(e) {}
-			}
-		}
-	});
-}
+
+
 /*!
- * Sizzle CSS Selector Engine - v1.0
- *  Copyright 2009, The Dojo Foundation
+ * Sizzle CSS Selector Engine
+ *  Copyright 2011, The Dojo Foundation
  *  Released under the MIT, BSD, and GPL Licenses.
  *  More information: http://sizzlejs.com/
@@ -2630,9 +3706,11 @@
 (function(){
 
-var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
 	done = 0,
 	toString = Object.prototype.toString,
 	hasDuplicate = false,
-	baseHasDuplicate = true;
+	baseHasDuplicate = true,
+	rBackslash = /\\/g,
+	rNonWord = /\W/;
 
 // Here we check if the JavaScript engine is using some sort of
@@ -2640,12 +3718,14 @@
 // function. If that is the case, discard the hasDuplicate value.
 //   Thus far that includes Google Chrome.
-[0, 0].sort(function(){
+[0, 0].sort(function() {
 	baseHasDuplicate = false;
 	return 0;
 });
 
-var Sizzle = function(selector, context, results, seed) {
+var Sizzle = function( selector, context, results, seed ) {
 	results = results || [];
-	var origContext = context = context || document;
+	context = context || document;
+
+	var origContext = context;
 
 	if ( context.nodeType !== 1 && context.nodeType !== 9 ) {
@@ -2657,22 +3737,32 @@
 	}
 
-	var parts = [], m, set, checkSet, extra, prune = true, contextXML = isXML(context),
+	var m, set, checkSet, extra, ret, cur, pop, i,
+		prune = true,
+		contextXML = Sizzle.isXML( context ),
+		parts = [],
 		soFar = selector;
 	
 	// Reset the position of the chunker regexp (start from head)
-	while ( (chunker.exec(""), m = chunker.exec(soFar)) !== null ) {
-		soFar = m[3];
+	do {
+		chunker.exec( "" );
+		m = chunker.exec( soFar );
+
+		if ( m ) {
+			soFar = m[3];
 		
-		parts.push( m[1] );
+			parts.push( m[1] );
 		
-		if ( m[2] ) {
-			extra = m[3];
-			break;
-		}
-	}
+			if ( m[2] ) {
+				extra = m[3];
+				break;
+			}
+		}
+	} while ( m );
 
 	if ( parts.length > 1 && origPOS.exec( selector ) ) {
+
 		if ( parts.length === 2 && Expr.relative[ parts[0] ] ) {
 			set = posProcess( parts[0] + parts[1], context );
+
 		} else {
 			set = Expr.relative[ parts[0] ] ?
@@ -2690,4 +3780,5 @@
 			}
 		}
+
 	} else {
 		// Take a shortcut and set the context if the root selector is an ID
@@ -2695,16 +3786,23 @@
 		if ( !seed && parts.length > 1 && context.nodeType === 9 && !contextXML &&
 				Expr.match.ID.test(parts[0]) && !Expr.match.ID.test(parts[parts.length - 1]) ) {
-			var ret = Sizzle.find( parts.shift(), context, contextXML );
-			context = ret.expr ? Sizzle.filter( ret.expr, ret.set )[0] : ret.set[0];
+
+			ret = Sizzle.find( parts.shift(), context, contextXML );
+			context = ret.expr ?
+				Sizzle.filter( ret.expr, ret.set )[0] :
+				ret.set[0];
 		}
 
 		if ( context ) {
-			var ret = seed ?
+			ret = seed ?
 				{ expr: parts.pop(), set: makeArray(seed) } :
 				Sizzle.find( parts.pop(), parts.length === 1 && (parts[0] === "~" || parts[0] === "+") && context.parentNode ? context.parentNode : context, contextXML );
-			set = ret.expr ? Sizzle.filter( ret.expr, ret.set ) : ret.set;
+
+			set = ret.expr ?
+				Sizzle.filter( ret.expr, ret.set ) :
+				ret.set;
 
 			if ( parts.length > 0 ) {
-				checkSet = makeArray(set);
+				checkSet = makeArray( set );
+
 			} else {
 				prune = false;
@@ -2712,5 +3810,6 @@
 
 			while ( parts.length ) {
-				var cur = parts.pop(), pop = cur;
+				cur = parts.pop();
+				pop = cur;
 
 				if ( !Expr.relative[ cur ] ) {
@@ -2726,4 +3825,5 @@
 				Expr.relative[ cur ]( checkSet, pop, contextXML );
 			}
+
 		} else {
 			checkSet = parts = [];
@@ -2742,12 +3842,14 @@
 		if ( !prune ) {
 			results.push.apply( results, checkSet );
+
 		} else if ( context && context.nodeType === 1 ) {
-			for ( var i = 0; checkSet[i] != null; i++ ) {
-				if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && contains(context, checkSet[i])) ) {
+			for ( i = 0; checkSet[i] != null; i++ ) {
+				if ( checkSet[i] && (checkSet[i] === true || checkSet[i].nodeType === 1 && Sizzle.contains(context, checkSet[i])) ) {
 					results.push( set[i] );
 				}
 			}
+
 		} else {
-			for ( var i = 0; checkSet[i] != null; i++ ) {
+			for ( i = 0; checkSet[i] != null; i++ ) {
 				if ( checkSet[i] && checkSet[i].nodeType === 1 ) {
 					results.push( set[i] );
@@ -2755,4 +3857,5 @@
 			}
 		}
+
 	} else {
 		makeArray( checkSet, results );
@@ -2767,13 +3870,13 @@
 };
 
-Sizzle.uniqueSort = function(results){
+Sizzle.uniqueSort = function( results ) {
 	if ( sortOrder ) {
 		hasDuplicate = baseHasDuplicate;
-		results.sort(sortOrder);
+		results.sort( sortOrder );
 
 		if ( hasDuplicate ) {
 			for ( var i = 1; i < results.length; i++ ) {
-				if ( results[i] === results[i-1] ) {
-					results.splice(i--, 1);
+				if ( results[i] === results[ i - 1 ] ) {
+					results.splice( i--, 1 );
 				}
 			}
@@ -2784,10 +3887,14 @@
 };
 
-Sizzle.matches = function(expr, set){
-	return Sizzle(expr, null, null, set);
+Sizzle.matches = function( expr, set ) {
+	return Sizzle( expr, null, null, set );
 };
 
-Sizzle.find = function(expr, context, isXML){
-	var set, match;
+Sizzle.matchesSelector = function( node, expr ) {
+	return Sizzle( expr, null, null, [node] ).length > 0;
+};
+
+Sizzle.find = function( expr, context, isXML ) {
+	var set;
 
 	if ( !expr ) {
@@ -2796,13 +3903,15 @@
 
 	for ( var i = 0, l = Expr.order.length; i < l; i++ ) {
-		var type = Expr.order[i], match;
+		var match,
+			type = Expr.order[i];
 		
 		if ( (match = Expr.leftMatch[ type ].exec( expr )) ) {
 			var left = match[1];
-			match.splice(1,1);
+			match.splice( 1, 1 );
 
 			if ( left.substr( left.length - 1 ) !== "\\" ) {
-				match[1] = (match[1] || "").replace(/\\/g, "");
+				match[1] = (match[1] || "").replace( rBackslash, "" );
 				set = Expr.find[ type ]( match, context, isXML );
+
 				if ( set != null ) {
 					expr = expr.replace( Expr.match[ type ], "" );
@@ -2814,18 +3923,26 @@
 
 	if ( !set ) {
-		set = context.getElementsByTagName("*");
-	}
-
-	return {set: set, expr: expr};
+		set = typeof context.getElementsByTagName !== "undefined" ?
+			context.getElementsByTagName( "*" ) :
+			[];
+	}
+
+	return { set: set, expr: expr };
 };
 
-Sizzle.filter = function(expr, set, inplace, not){
-	var old = expr, result = [], curLoop = set, match, anyFound,
-		isXMLFilter = set && set[0] && isXML(set[0]);
+Sizzle.filter = function( expr, set, inplace, not ) {
+	var match, anyFound,
+		old = expr,
+		result = [],
+		curLoop = set,
+		isXMLFilter = set && set[0] && Sizzle.isXML( set[0] );
 
 	while ( expr && set.length ) {
 		for ( var type in Expr.filter ) {
 			if ( (match = Expr.leftMatch[ type ].exec( expr )) != null && match[2] ) {
-				var filter = Expr.filter[ type ], found, item, left = match[1];
+				var found, item,
+					filter = Expr.filter[ type ],
+					left = match[1];
+
 				anyFound = false;
 
@@ -2845,4 +3962,5 @@
 					if ( !match ) {
 						anyFound = found = true;
+
 					} else if ( match === true ) {
 						continue;
@@ -2859,7 +3977,9 @@
 								if ( pass ) {
 									anyFound = true;
+
 								} else {
 									curLoop[i] = false;
 								}
+
 							} else if ( pass ) {
 								result.push( item );
@@ -2890,4 +4010,5 @@
 			if ( anyFound == null ) {
 				Sizzle.error( expr );
+
 			} else {
 				break;
@@ -2907,28 +4028,36 @@
 var Expr = Sizzle.selectors = {
 	order: [ "ID", "NAME", "TAG" ],
+
 	match: {
-		ID: /#((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
-		CLASS: /\.((?:[\w\u00c0-\uFFFF-]|\\.)+)/,
-		NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF-]|\\.)+)['"]*\]/,
-		ATTR: /\[\s*((?:[\w\u00c0-\uFFFF-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,
-		TAG: /^((?:[\w\u00c0-\uFFFF\*-]|\\.)+)/,
-		CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
-		POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
-		PSEUDO: /:((?:[\w\u00c0-\uFFFF-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
-	},
+		ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
+		CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
+		NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
+		ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
+		TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
+		CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
+		POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
+		PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
+	},
+
 	leftMatch: {},
+
 	attrMap: {
 		"class": "className",
 		"for": "htmlFor"
 	},
+
 	attrHandle: {
-		href: function(elem){
-			return elem.getAttribute("href");
-		}
-	},
+		href: function( elem ) {
+			return elem.getAttribute( "href" );
+		},
+		type: function( elem ) {
+			return elem.getAttribute( "type" );
+		}
+	},
+
 	relative: {
 		"+": function(checkSet, part){
 			var isPartStr = typeof part === "string",
-				isTag = isPartStr && !/\W/.test(part),
+				isTag = isPartStr && !rNonWord.test( part ),
 				isPartStrNotTag = isPartStr && !isTag;
 
@@ -2951,12 +4080,17 @@
 			}
 		},
-		">": function(checkSet, part){
-			var isPartStr = typeof part === "string";
-
-			if ( isPartStr && !/\W/.test(part) ) {
+
+		">": function( checkSet, part ) {
+			var elem,
+				isPartStr = typeof part === "string",
+				i = 0,
+				l = checkSet.length;
+
+			if ( isPartStr && !rNonWord.test( part ) ) {
 				part = part.toLowerCase();
 
-				for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-					var elem = checkSet[i];
+				for ( ; i < l; i++ ) {
+					elem = checkSet[i];
+
 					if ( elem ) {
 						var parent = elem.parentNode;
@@ -2964,7 +4098,9 @@
 					}
 				}
+
 			} else {
-				for ( var i = 0, l = checkSet.length; i < l; i++ ) {
-					var elem = checkSet[i];
+				for ( ; i < l; i++ ) {
+					elem = checkSet[i];
+
 					if ( elem ) {
 						checkSet[i] = isPartStr ?
@@ -2979,35 +4115,48 @@
 			}
 		},
+
 		"": function(checkSet, part, isXML){
-			var doneName = done++, checkFn = dirCheck;
-
-			if ( typeof part === "string" && !/\W/.test(part) ) {
-				var nodeCheck = part = part.toLowerCase();
+			var nodeCheck,
+				doneName = done++,
+				checkFn = dirCheck;
+
+			if ( typeof part === "string" && !rNonWord.test( part ) ) {
+				part = part.toLowerCase();
+				nodeCheck = part;
 				checkFn = dirNodeCheck;
 			}
 
-			checkFn("parentNode", part, doneName, checkSet, nodeCheck, isXML);
+			checkFn( "parentNode", part, doneName, checkSet, nodeCheck, isXML );
 		},
-		"~": function(checkSet, part, isXML){
-			var doneName = done++, checkFn = dirCheck;
-
-			if ( typeof part === "string" && !/\W/.test(part) ) {
-				var nodeCheck = part = part.toLowerCase();
+
+		"~": function( checkSet, part, isXML ) {
+			var nodeCheck,
+				doneName = done++,
+				checkFn = dirCheck;
+
+			if ( typeof part === "string" && !rNonWord.test( part ) ) {
+				part = part.toLowerCase();
+				nodeCheck = part;
 				checkFn = dirNodeCheck;
 			}
 
-			checkFn("previousSibling", part, doneName, checkSet, nodeCheck, isXML);
-		}
-	},
+			checkFn( "previousSibling", part, doneName, checkSet, nodeCheck, isXML );
+		}
+	},
+
 	find: {
-		ID: function(match, context, isXML){
+		ID: function( match, context, isXML ) {
 			if ( typeof context.getElementById !== "undefined" && !isXML ) {
 				var m = context.getElementById(match[1]);
-				return m ? [m] : [];
+				// Check parentNode to catch when Blackberry 4.6 returns
+				// nodes that are no longer in the document #6963
+				return m && m.parentNode ? [m] : [];
 			}
 		},
-		NAME: function(match, context){
+
+		NAME: function( match, context ) {
 			if ( typeof context.getElementsByName !== "undefined" ) {
-				var ret = [], results = context.getElementsByName(match[1]);
+				var ret = [],
+					results = context.getElementsByName( match[1] );
 
 				for ( var i = 0, l = results.length; i < l; i++ ) {
@@ -3020,11 +4169,14 @@
 			}
 		},
-		TAG: function(match, context){
-			return context.getElementsByTagName(match[1]);
+
+		TAG: function( match, context ) {
+			if ( typeof context.getElementsByTagName !== "undefined" ) {
+				return context.getElementsByTagName( match[1] );
+			}
 		}
 	},
 	preFilter: {
-		CLASS: function(match, curLoop, inplace, result, not, isXML){
-			match = " " + match[1].replace(/\\/g, "") + " ";
+		CLASS: function( match, curLoop, inplace, result, not, isXML ) {
+			match = " " + match[1].replace( rBackslash, "" ) + " ";
 
 			if ( isXML ) {
@@ -3034,8 +4186,9 @@
 			for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
 				if ( elem ) {
-					if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n]/g, " ").indexOf(match) >= 0) ) {
+					if ( not ^ (elem.className && (" " + elem.className + " ").replace(/[\t\n\r]/g, " ").indexOf(match) >= 0) ) {
 						if ( !inplace ) {
 							result.push( elem );
 						}
+
 					} else if ( inplace ) {
 						curLoop[i] = false;
@@ -3046,14 +4199,23 @@
 			return false;
 		},
-		ID: function(match){
-			return match[1].replace(/\\/g, "");
+
+		ID: function( match ) {
+			return match[1].replace( rBackslash, "" );
 		},
-		TAG: function(match, curLoop){
-			return match[1].toLowerCase();
+
+		TAG: function( match, curLoop ) {
+			return match[1].replace( rBackslash, "" ).toLowerCase();
 		},
-		CHILD: function(match){
+
+		CHILD: function( match ) {
 			if ( match[1] === "nth" ) {
+				if ( !match[2] ) {
+					Sizzle.error( match[0] );
+				}
+
+				match[2] = match[2].replace(/^\+|\s*/g, '');
+
 				// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
-				var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
+				var test = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec(
 					match[2] === "even" && "2n" || match[2] === "odd" && "2n+1" ||
 					!/\D/.test( match[2] ) && "0n+" + match[2] || match[2]);
@@ -3063,4 +4225,7 @@
 				match[3] = test[3] - 0;
 			}
+			else if ( match[2] ) {
+				Sizzle.error( match[0] );
+			}
 
 			// TODO: Move to normal caching system
@@ -3069,6 +4234,7 @@
 			return match;
 		},
-		ATTR: function(match, curLoop, inplace, result, not, isXML){
-			var name = match[1].replace(/\\/g, "");
+
+		ATTR: function( match, curLoop, inplace, result, not, isXML ) {
+			var name = match[1] = match[1].replace( rBackslash, "" );
 			
 			if ( !isXML && Expr.attrMap[name] ) {
@@ -3076,4 +4242,7 @@
 			}
 
+			// Handle if an un-quoted value was used
+			match[4] = ( match[4] || match[5] || "" ).replace( rBackslash, "" );
+
 			if ( match[2] === "~=" ) {
 				match[4] = " " + match[4] + " ";
@@ -3082,16 +4251,21 @@
 			return match;
 		},
-		PSEUDO: function(match, curLoop, inplace, result, not){
+
+		PSEUDO: function( match, curLoop, inplace, result, not ) {
 			if ( match[1] === "not" ) {
 				// If we're dealing with a complex expression, or a simple one
 				if ( ( chunker.exec(match[3]) || "" ).length > 1 || /^\w/.test(match[3]) ) {
 					match[3] = Sizzle(match[3], null, null, curLoop);
+
 				} else {
 					var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+
 					if ( !inplace ) {
 						result.push.apply( result, ret );
 					}
+
 					return false;
 				}
+
 			} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
 				return true;
@@ -3100,107 +4274,150 @@
 			return match;
 		},
-		POS: function(match){
+
+		POS: function( match ) {
 			match.unshift( true );
+
 			return match;
 		}
 	},
+	
 	filters: {
-		enabled: function(elem){
+		enabled: function( elem ) {
 			return elem.disabled === false && elem.type !== "hidden";
 		},
-		disabled: function(elem){
+
+		disabled: function( elem ) {
 			return elem.disabled === true;
 		},
-		checked: function(elem){
+
+		checked: function( elem ) {
 			return elem.checked === true;
 		},
-		selected: function(elem){
+		
+		selected: function( elem ) {
 			// Accessing this property makes selected-by-default
 			// options in Safari work properly
-			elem.parentNode.selectedIndex;
+			if ( elem.parentNode ) {
+				elem.parentNode.selectedIndex;
+			}
+			
 			return elem.selected === true;
 		},
-		parent: function(elem){
+
+		parent: function( elem ) {
 			return !!elem.firstChild;
 		},
-		empty: function(elem){
+
+		empty: function( elem ) {
 			return !elem.firstChild;
 		},
-		has: function(elem, i, match){
+
+		has: function( elem, i, match ) {
 			return !!Sizzle( match[3], elem ).length;
 		},
-		header: function(elem){
-			return /h\d/i.test( elem.nodeName );
+
+		header: function( elem ) {
+			return (/h\d/i).test( elem.nodeName );
 		},
-		text: function(elem){
-			return "text" === elem.type;
+
+		text: function( elem ) {
+			var attr = elem.getAttribute( "type" ), type = elem.type;
+			// 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" && "text" === type && ( attr === type || attr === null );
 		},
-		radio: function(elem){
-			return "radio" === elem.type;
+
+		radio: function( elem ) {
+			return elem.nodeName.toLowerCase() === "input" && "radio" === elem.type;
 		},
-		checkbox: function(elem){
-			return "checkbox" === elem.type;
+
+		checkbox: function( elem ) {
+			return elem.nodeName.toLowerCase() === "input" && "checkbox" === elem.type;
 		},
-		file: function(elem){
-			return "file" === elem.type;
+
+		file: function( elem ) {
+			return elem.nodeName.toLowerCase() === "input" && "file" === elem.type;
 		},
-		password: function(elem){
-			return "password" === elem.type;
+
+		password: function( elem ) {
+			return elem.nodeName.toLowerCase() === "input" && "password" === elem.type;
 		},
-		submit: function(elem){
-			return "submit" === elem.type;
+
+		submit: function( elem ) {
+			var name = elem.nodeName.toLowerCase();
+			return (name === "input" || name === "button") && "submit" === elem.type;
 		},
-		image: function(elem){
-			return "image" === elem.type;
+
+		image: function( elem ) {
+			return elem.nodeName.toLowerCase() === "input" && "image" === elem.type;
 		},
-		reset: function(elem){
-			return "reset" === elem.type;
+
+		reset: function( elem ) {
+			var name = elem.nodeName.toLowerCase();
+			return (name === "input" || name === "button") && "reset" === elem.type;
 		},
-		button: function(elem){
-			return "button" === elem.type || elem.nodeName.toLowerCase() === "button";
+
+		button: function( elem ) {
+			var name = elem.nodeName.toLowerCase();
+			return name === "input" && "button" === elem.type || name === "button";
 		},
-		input: function(elem){
-			return /input|select|textarea|button/i.test(elem.nodeName);
+
+		input: function( elem ) {
+			return (/input|select|textarea|button/i).test( elem.nodeName );
+		},
+
+		focus: function( elem ) {
+			return elem === elem.ownerDocument.activeElement;
 		}
 	},
 	setFilters: {
-		first: function(elem, i){
+		first: function( elem, i ) {
 			return i === 0;
 		},
-		last: function(elem, i, match, array){
+
+		last: function( elem, i, match, array ) {
 			return i === array.length - 1;
 		},
-		even: function(elem, i){
+
+		even: function( elem, i ) {
 			return i % 2 === 0;
 		},
-		odd: function(elem, i){
+
+		odd: function( elem, i ) {
 			return i % 2 === 1;
 		},
-		lt: function(elem, i, match){
+
+		lt: function( elem, i, match ) {
 			return i < match[3] - 0;
 		},
-		gt: function(elem, i, match){
+
+		gt: function( elem, i, match ) {
 			return i > match[3] - 0;
 		},
-		nth: function(elem, i, match){
+
+		nth: function( elem, i, match ) {
 			return match[3] - 0 === i;
 		},
-		eq: function(elem, i, match){
+
+		eq: function( elem, i, match ) {
 			return match[3] - 0 === i;
 		}
 	},
 	filter: {
-		PSEUDO: function(elem, match, i, array){
-			var name = match[1], filter = Expr.filters[ name ];
+		PSEUDO: function( elem, match, i, array ) {
+			var name = match[1],
+				filter = Expr.filters[ name ];
 
 			if ( filter ) {
 				return filter( elem, i, match, array );
+
 			} else if ( name === "contains" ) {
-				return (elem.textContent || elem.innerText || getText([ elem ]) || "").indexOf(match[3]) >= 0;
+				return (elem.textContent || elem.innerText || Sizzle.getText([ elem ]) || "").indexOf(match[3]) >= 0;
+
 			} else if ( name === "not" ) {
 				var not = match[3];
 
-				for ( var i = 0, l = not.length; i < l; i++ ) {
-					if ( not[i] === elem ) {
+				for ( var j = 0, l = not.length; j < l; j++ ) {
+					if ( not[j] === elem ) {
 						return false;
 					}
@@ -3208,13 +4425,17 @@
 
 				return true;
+
 			} else {
-				Sizzle.error( "Syntax error, unrecognized expression: " + name );
+				Sizzle.error( name );
 			}
 		},
-		CHILD: function(elem, match){
-			var type = match[1], node = elem;
-			switch (type) {
-				case 'only':
-				case 'first':
+
+		CHILD: function( elem, match ) {
+			var type = match[1],
+				node = elem;
+
+			switch ( type ) {
+				case "only":
+				case "first":
 					while ( (node = node.previousSibling) )	 {
 						if ( node.nodeType === 1 ) { 
@@ -3222,9 +4443,12 @@
 						}
 					}
+
 					if ( type === "first" ) { 
 						return true; 
 					}
+
 					node = elem;
-				case 'last':
+
+				case "last":
 					while ( (node = node.nextSibling) )	 {
 						if ( node.nodeType === 1 ) { 
@@ -3232,7 +4456,10 @@
 						}
 					}
+
 					return true;
-				case 'nth':
-					var first = match[2], last = match[3];
+
+				case "nth":
+					var first = match[2],
+						last = match[3];
 
 					if ( first === 1 && last === 0 ) {
@@ -3245,4 +4472,5 @@
 					if ( parent && (parent.sizcache !== doneName || !elem.nodeIndex) ) {
 						var count = 0;
+						
 						for ( node = parent.firstChild; node; node = node.nextSibling ) {
 							if ( node.nodeType === 1 ) {
@@ -3250,10 +4478,13 @@
 							}
 						} 
+
 						parent.sizcache = doneName;
 					}
 					
 					var diff = elem.nodeIndex - last;
+
 					if ( first === 0 ) {
 						return diff === 0;
+
 					} else {
 						return ( diff % first === 0 && diff / first >= 0 );
@@ -3261,15 +4492,19 @@
 			}
 		},
-		ID: function(elem, match){
+
+		ID: function( elem, match ) {
 			return elem.nodeType === 1 && elem.getAttribute("id") === match;
 		},
-		TAG: function(elem, match){
+
+		TAG: function( elem, match ) {
 			return (match === "*" && elem.nodeType === 1) || elem.nodeName.toLowerCase() === match;
 		},
-		CLASS: function(elem, match){
+		
+		CLASS: function( elem, match ) {
 			return (" " + (elem.className || elem.getAttribute("class")) + " ")
 				.indexOf( match ) > -1;
 		},
-		ATTR: function(elem, match){
+
+		ATTR: function( elem, match ) {
 			var name = match[1],
 				result = Expr.attrHandle[ name ] ?
@@ -3302,6 +4537,8 @@
 				false;
 		},
-		POS: function(elem, match, i, array){
-			var name = match[2], filter = Expr.setFilters[ name ];
+
+		POS: function( elem, match, i, array ) {
+			var name = match[2],
+				filter = Expr.setFilters[ name ];
 
 			if ( filter ) {
@@ -3312,14 +4549,15 @@
 };
 
-var origPOS = Expr.match.POS;
+var origPOS = Expr.match.POS,
+	fescape = function(all, num){
+		return "\\" + (num - 0 + 1);
+	};
 
 for ( var type in Expr.match ) {
-	Expr.match[ type ] = new RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
-	Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, function(all, num){
-		return "\\" + (num - 0 + 1);
-	}));
+	Expr.match[ type ] = new RegExp( Expr.match[ type ].source + (/(?![^\[]*\])(?![^\(]*\))/.source) );
+	Expr.leftMatch[ type ] = new RegExp( /(^(?:.|\r|\n)*?)/.source + Expr.match[ type ].source.replace(/\\(\d+)/g, fescape) );
 }
 
-var makeArray = function(array, results) {
+var makeArray = function( array, results ) {
 	array = Array.prototype.slice.call( array, 0 );
 
@@ -3340,17 +4578,20 @@
 
 // Provide a fallback method if it does not work
-} catch(e){
-	makeArray = function(array, results) {
-		var ret = results || [];
+} catch( e ) {
+	makeArray = function( array, results ) {
+		var i = 0,
+			ret = results || [];
 
 		if ( toString.call(array) === "[object Array]" ) {
 			Array.prototype.push.apply( ret, array );
+
 		} else {
 			if ( typeof array.length === "number" ) {
-				for ( var i = 0, l = array.length; i < l; i++ ) {
+				for ( var l = array.length; i < l; i++ ) {
 					ret.push( array[i] );
 				}
+
 			} else {
-				for ( var i = 0; array[i]; i++ ) {
+				for ( ; array[i]; i++ ) {
 					ret.push( array[i] );
 				}
@@ -3362,60 +4603,102 @@
 }
 
-var sortOrder;
+var sortOrder, siblingCheck;
 
 if ( document.documentElement.compareDocumentPosition ) {
 	sortOrder = function( a, b ) {
+		if ( a === b ) {
+			hasDuplicate = true;
+			return 0;
+		}
+
 		if ( !a.compareDocumentPosition || !b.compareDocumentPosition ) {
-			if ( a == b ) {
-				hasDuplicate = true;
-			}
 			return a.compareDocumentPosition ? -1 : 1;
 		}
 
-		var ret = a.compareDocumentPosition(b) & 4 ? -1 : a === b ? 0 : 1;
-		if ( ret === 0 ) {
+		return a.compareDocumentPosition(b) & 4 ? -1 : 1;
+	};
+
+} else {
+	sortOrder = function( a, b ) {
+		// The nodes are identical, we can exit early
+		if ( a === b ) {
 			hasDuplicate = true;
-		}
-		return ret;
+			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 );
 	};
-} else if ( "sourceIndex" in document.documentElement ) {
-	sortOrder = function( a, b ) {
-		if ( !a.sourceIndex || !b.sourceIndex ) {
-			if ( a == b ) {
-				hasDuplicate = true;
-			}
-			return a.sourceIndex ? -1 : 1;
-		}
-
-		var ret = a.sourceIndex - b.sourceIndex;
-		if ( ret === 0 ) {
-			hasDuplicate = true;
-		}
-		return ret;
-	};
-} else if ( document.createRange ) {
-	sortOrder = function( a, b ) {
-		if ( !a.ownerDocument || !b.ownerDocument ) {
-			if ( a == b ) {
-				hasDuplicate = true;
-			}
-			return a.ownerDocument ? -1 : 1;
-		}
-
-		var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
-		aRange.setStart(a, 0);
-		aRange.setEnd(a, 0);
-		bRange.setStart(b, 0);
-		bRange.setEnd(b, 0);
-		var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
-		if ( ret === 0 ) {
-			hasDuplicate = true;
-		}
-		return ret;
+
+	siblingCheck = function( a, b, ret ) {
+		if ( a === b ) {
+			return ret;
+		}
+
+		var cur = a.nextSibling;
+
+		while ( cur ) {
+			if ( cur === b ) {
+				return -1;
+			}
+
+			cur = cur.nextSibling;
+		}
+
+		return 1;
 	};
 }
 
 // Utility function for retreiving the text value of an array of DOM nodes
-function getText( elems ) {
+Sizzle.getText = function( elems ) {
 	var ret = "", elem;
 
@@ -3429,10 +4712,10 @@
 		// Traverse everything else, except comment nodes
 		} else if ( elem.nodeType !== 8 ) {
-			ret += getText( elem.childNodes );
+			ret += Sizzle.getText( elem.childNodes );
 		}
 	}
 
 	return ret;
-}
+};
 
 // Check to see if the browser returns elements by name when
@@ -3441,9 +4724,10 @@
 	// We're going to inject a fake input element with a specified name
 	var form = document.createElement("div"),
-		id = "script" + (new Date).getTime();
+		id = "script" + (new Date()).getTime(),
+		root = document.documentElement;
+
 	form.innerHTML = "<a name='" + id + "'/>";
 
 	// Inject it into the root element, check its status, and remove it quickly
-	var root = document.documentElement;
 	root.insertBefore( form, root.firstChild );
 
@@ -3451,13 +4735,19 @@
 	// Which slows things down for other browsers (hence the branching)
 	if ( document.getElementById( id ) ) {
-		Expr.find.ID = function(match, context, isXML){
+		Expr.find.ID = function( match, context, isXML ) {
 			if ( typeof context.getElementById !== "undefined" && !isXML ) {
 				var m = context.getElementById(match[1]);
-				return m ? m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ? [m] : undefined : [];
+
+				return m ?
+					m.id === match[1] || typeof m.getAttributeNode !== "undefined" && m.getAttributeNode("id").nodeValue === match[1] ?
+						[m] :
+						undefined :
+					[];
 			}
 		};
 
-		Expr.filter.ID = function(elem, match){
+		Expr.filter.ID = function( elem, match ) {
 			var node = typeof elem.getAttributeNode !== "undefined" && elem.getAttributeNode("id");
+
 			return elem.nodeType === 1 && node && node.nodeValue === match;
 		};
@@ -3465,5 +4755,7 @@
 
 	root.removeChild( form );
-	root = form = null; // release memory in IE
+
+	// release memory in IE
+	root = form = null;
 })();
 
@@ -3478,6 +4770,6 @@
 	// Make sure no comments are found
 	if ( div.getElementsByTagName("*").length > 0 ) {
-		Expr.find.TAG = function(match, context){
-			var results = context.getElementsByTagName(match[1]);
+		Expr.find.TAG = function( match, context ) {
+			var results = context.getElementsByTagName( match[1] );
 
 			// Filter out possible comments
@@ -3500,17 +4792,23 @@
 	// Check to see if an attribute returns normalized href attributes
 	div.innerHTML = "<a href='#'></a>";
+
 	if ( div.firstChild && typeof div.firstChild.getAttribute !== "undefined" &&
 			div.firstChild.getAttribute("href") !== "#" ) {
-		Expr.attrHandle.href = function(elem){
-			return elem.getAttribute("href", 2);
+
+		Expr.attrHandle.href = function( elem ) {
+			return elem.getAttribute( "href", 2 );
 		};
 	}
 
-	div = null; // release memory in IE
+	// release memory in IE
+	div = null;
 })();
 
 if ( document.querySelectorAll ) {
 	(function(){
-		var oldSizzle = Sizzle, div = document.createElement("div");
+		var oldSizzle = Sizzle,
+			div = document.createElement("div"),
+			id = "__sizzle__";
+
 		div.innerHTML = "<p class='TEST'></p>";
 
@@ -3521,13 +4819,84 @@
 		}
 	
-		Sizzle = function(query, context, extra, seed){
+		Sizzle = function( query, context, extra, seed ) {
 			context = context || document;
 
 			// Only use querySelectorAll on non-XML documents
 			// (ID selectors don't work in non-HTML documents)
-			if ( !seed && context.nodeType === 9 && !isXML(context) ) {
-				try {
-					return makeArray( context.querySelectorAll(query), extra );
-				} catch(e){}
+			if ( !seed && !Sizzle.isXML(context) ) {
+				// See if we find a selector to speed up
+				var match = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec( query );
+				
+				if ( match && (context.nodeType === 1 || context.nodeType === 9) ) {
+					// Speed-up: Sizzle("TAG")
+					if ( match[1] ) {
+						return makeArray( context.getElementsByTagName( query ), extra );
+					
+					// Speed-up: Sizzle(".CLASS")
+					} else if ( match[2] && Expr.find.CLASS && context.getElementsByClassName ) {
+						return makeArray( context.getElementsByClassName( match[2] ), extra );
+					}
+				}
+				
+				if ( context.nodeType === 9 ) {
+					// Speed-up: Sizzle("body")
+					// The body element only exists once, optimize finding it
+					if ( query === "body" && context.body ) {
+						return makeArray( [ context.body ], extra );
+						
+					// Speed-up: Sizzle("#ID")
+					} else if ( match && match[3] ) {
+						var elem = context.getElementById( match[3] );
+
+						// 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[3] ) {
+								return makeArray( [ elem ], extra );
+							}
+							
+						} else {
+							return makeArray( [], extra );
+						}
+					}
+					
+					try {
+						return makeArray( context.querySelectorAll(query), extra );
+					} catch(qsaError) {}
+
+				// 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
+				} else if ( context.nodeType === 1 && context.nodeName.toLowerCase() !== "object" ) {
+					var oldContext = context,
+						old = context.getAttribute( "id" ),
+						nid = old || id,
+						hasParent = context.parentNode,
+						relativeHierarchySelector = /^\s*[+~]/.test( query );
+
+					if ( !old ) {
+						context.setAttribute( "id", nid );
+					} else {
+						nid = nid.replace( /'/g, "\\$&" );
+					}
+					if ( relativeHierarchySelector && hasParent ) {
+						context = context.parentNode;
+					}
+
+					try {
+						if ( !relativeHierarchySelector || hasParent ) {
+							return makeArray( context.querySelectorAll( "[id='" + nid + "'] " + query ), extra );
+						}
+
+					} catch(pseudoError) {
+					} finally {
+						if ( !old ) {
+							oldContext.removeAttribute( "id" );
+						}
+					}
+				}
 			}
 		
@@ -3539,7 +4908,52 @@
 		}
 
-		div = null; // release memory in IE
+		// release memory in IE
+		div = null;
 	})();
 }
+
+(function(){
+	var html = document.documentElement,
+		matches = html.matchesSelector || html.mozMatchesSelector || html.webkitMatchesSelector || html.msMatchesSelector;
+
+	if ( matches ) {
+		// Check to see if it's possible to do matchesSelector
+		// on a disconnected node (IE 9 fails this)
+		var disconnectedMatch = !matches.call( document.createElement( "div" ), "div" ),
+			pseudoWorks = false;
+
+		try {
+			// This should fail with an exception
+			// Gecko does not error, returns false instead
+			matches.call( document.documentElement, "[test!='']:sizzle" );
+	
+		} catch( pseudoError ) {
+			pseudoWorks = true;
+		}
+
+		Sizzle.matchesSelector = function( node, expr ) {
+			// Make sure that attribute selectors are quoted
+			expr = expr.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']");
+
+			if ( !Sizzle.isXML( node ) ) {
+				try { 
+					if ( pseudoWorks || !Expr.match.PSEUDO.test( expr ) && !/!=/.test( expr ) ) {
+						var ret = matches.call( node, 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, so check for that
+								node.document && node.document.nodeType !== 11 ) {
+							return ret;
+						}
+					}
+				} catch(e) {}
+			}
+
+			return Sizzle(expr, null, null, [node]).length > 0;
+		};
+	}
+})();
 
 (function(){
@@ -3562,5 +4976,5 @@
 	
 	Expr.order.splice(1, 0, "CLASS");
-	Expr.find.CLASS = function(match, context, isXML) {
+	Expr.find.CLASS = function( match, context, isXML ) {
 		if ( typeof context.getElementsByClassName !== "undefined" && !isXML ) {
 			return context.getElementsByClassName(match[1]);
@@ -3568,5 +4982,6 @@
 	};
 
-	div = null; // release memory in IE
+	// release memory in IE
+	div = null;
 })();
 
@@ -3574,7 +4989,9 @@
 	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
 		var elem = checkSet[i];
+
 		if ( elem ) {
+			var match = false;
+
 			elem = elem[dir];
-			var match = false;
 
 			while ( elem ) {
@@ -3605,7 +5022,9 @@
 	for ( var i = 0, l = checkSet.length; i < l; i++ ) {
 		var elem = checkSet[i];
+
 		if ( elem ) {
+			var match = false;
+			
 			elem = elem[dir];
-			var match = false;
 
 			while ( elem ) {
@@ -3620,4 +5039,5 @@
 						elem.sizset = i;
 					}
+
 					if ( typeof cur !== "string" ) {
 						if ( elem === cur ) {
@@ -3640,19 +5060,32 @@
 }
 
-var contains = document.compareDocumentPosition ? function(a, b){
-	return !!(a.compareDocumentPosition(b) & 16);
-} : function(a, b){
-	return a !== b && (a.contains ? a.contains(b) : true);
-};
-
-var isXML = function(elem){
+if ( document.documentElement.contains ) {
+	Sizzle.contains = function( a, b ) {
+		return a !== b && (a.contains ? a.contains(b) : true);
+	};
+
+} else if ( document.documentElement.compareDocumentPosition ) {
+	Sizzle.contains = function( a, b ) {
+		return !!(a.compareDocumentPosition(b) & 16);
+	};
+
+} else {
+	Sizzle.contains = function() {
+		return false;
+	};
+}
+
+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 : 0).documentElement;
+
 	return documentElement ? documentElement.nodeName !== "HTML" : false;
 };
 
-var posProcess = function(selector, context){
-	var tmpSet = [], later = "", match,
+var posProcess = function( selector, context ) {
+	var match,
+		tmpSet = [],
+		later = "",
 		root = context.nodeType ? [context] : context;
 
@@ -3678,53 +5111,46 @@
 jQuery.expr[":"] = jQuery.expr.filters;
 jQuery.unique = Sizzle.uniqueSort;
-jQuery.text = getText;
-jQuery.isXMLDoc = isXML;
-jQuery.contains = contains;
-
-return;
-
-window.Sizzle = Sizzle;
+jQuery.text = Sizzle.getText;
+jQuery.isXMLDoc = Sizzle.isXML;
+jQuery.contains = Sizzle.contains;
+
 
 })();
+
+
 var runtil = /Until$/,
 	rparentsprev = /^(?:parents|prevUntil|prevAll)/,
 	// Note: This RegExp should be improved, or likely pulled from Sizzle
 	rmultiselector = /,/,
-	slice = Array.prototype.slice;
-
-// Implement the identical functionality for filter and not
-var winnow = function( elements, qualifier, keep ) {
-	if ( jQuery.isFunction( qualifier ) ) {
-		return jQuery.grep(elements, function( elem, i ) {
-			return !!qualifier.call( elem, i, elem ) === 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;
-	});
-};
+	isSimple = /^.[^:#\[\.,]*$/,
+	slice = Array.prototype.slice,
+	POS = jQuery.expr.match.POS,
+	// 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 ret = this.pushStack( "", "find", selector ), length = 0;
-
-		for ( var i = 0, l = this.length; i < l; i++ ) {
+		var self = this,
+			i, l;
+
+		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;
+					}
+				}
+			});
+		}
+
+		var ret = this.pushStack( "", "find", selector ),
+			length, n, r;
+
+		for ( i = 0, l = this.length; i < l; i++ ) {
 			length = ret.length;
 			jQuery.find( selector, this[i], ret );
@@ -3732,6 +5158,6 @@
 			if ( i > 0 ) {
 				// Make sure that the results are unique
-				for ( var n = length; n < ret.length; n++ ) {
-					for ( var r = 0; r < length; r++ ) {
+				for ( n = length; n < ret.length; n++ ) {
+					for ( r = 0; r < length; r++ ) {
 						if ( ret[r] === ret[n] ) {
 							ret.splice(n--, 1);
@@ -3764,19 +5190,26 @@
 		return this.pushStack( winnow(this, selector, true), "filter", selector );
 	},
-	
+
 	is: function( selector ) {
-		return !!selector && jQuery.filter( selector, this ).length > 0;
+		return !!selector && ( typeof selector === "string" ?
+			jQuery.filter( selector, this ).length > 0 :
+			this.filter( selector ).length > 0 );
 	},
 
 	closest: function( selectors, context ) {
+		var ret = [], i, l, cur = this[0];
+		
+		// Array
 		if ( jQuery.isArray( selectors ) ) {
-			var ret = [], cur = this[0], match, matches = {}, selector;
+			var match, selector,
+				matches = {},
+				level = 1;
 
 			if ( cur && selectors.length ) {
-				for ( var i = 0, l = selectors.length; i < l; i++ ) {
+				for ( i = 0, l = selectors.length; i < l; i++ ) {
 					selector = selectors[i];
 
-					if ( !matches[selector] ) {
-						matches[selector] = jQuery.expr.match.POS.test( selector ) ? 
+					if ( !matches[ selector ] ) {
+						matches[ selector ] = POS.test( selector ) ?
 							jQuery( selector, context || this.context ) :
 							selector;
@@ -3786,12 +5219,13 @@
 				while ( cur && cur.ownerDocument && cur !== context ) {
 					for ( selector in matches ) {
-						match = matches[selector];
-
-						if ( match.jquery ? match.index(cur) > -1 : jQuery(cur).is(match) ) {
-							ret.push({ selector: selector, elem: cur });
-							delete matches[selector];
+						match = matches[ selector ];
+
+						if ( match.jquery ? match.index( cur ) > -1 : jQuery( cur ).is( match ) ) {
+							ret.push({ selector: selector, elem: cur, level: level });
 						}
 					}
+
 					cur = cur.parentNode;
+					level++;
 				}
 			}
@@ -3800,18 +5234,31 @@
 		}
 
-		var pos = jQuery.expr.match.POS.test( selectors ) ? 
-			jQuery( selectors, context || this.context ) : null;
-
-		return this.map(function( i, cur ) {
-			while ( cur && cur.ownerDocument && cur !== context ) {
-				if ( pos ? pos.index(cur) > -1 : jQuery(cur).is(selectors) ) {
-					return cur;
-				}
-				cur = cur.parentNode;
-			}
-			return null;
-		});
-	},
-	
+		// String
+		var pos = POS.test( selectors ) || typeof selectors !== "string" ?
+				jQuery( selectors, context || this.context ) :
+				0;
+
+		for ( i = 0, l = this.length; i < l; i++ ) {
+			cur = this[i];
+
+			while ( cur ) {
+				if ( pos ? pos.index(cur) > -1 : jQuery.find.matchesSelector(cur, selectors) ) {
+					ret.push( cur );
+					break;
+
+				} else {
+					cur = cur.parentNode;
+					if ( !cur || !cur.ownerDocument || cur === context || cur.nodeType === 11 ) {
+						break;
+					}
+				}
+			}
+		}
+
+		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
@@ -3831,6 +5278,6 @@
 	add: function( selector, context ) {
 		var set = typeof selector === "string" ?
-				jQuery( selector, context || this.context ) :
-				jQuery.makeArray( selector ),
+				jQuery( selector, context ) :
+				jQuery.makeArray( selector && selector.nodeType ? [ selector ] : selector ),
 			all = jQuery.merge( this.get(), set );
 
@@ -3893,6 +5340,11 @@
 }, function( name, fn ) {
 	jQuery.fn[ name ] = function( until, selector ) {
-		var ret = jQuery.map( this, fn, until );
-		
+		var ret = jQuery.map( this, fn, until ),
+			// The variable 'args' was introduced in
+			// https://github.com/jquery/jquery/commit/52a0238
+			// to work around a bug in Chrome 10 (Dev) and should be removed when the bug is fixed.
+			// http://code.google.com/p/v8/issues/detail?id=1050
+			args = slice.call(arguments);
+
 		if ( !runtil.test( name ) ) {
 			selector = until;
@@ -3903,5 +5355,5 @@
 		}
 
-		ret = this.length > 1 ? jQuery.unique( ret ) : ret;
+		ret = this.length > 1 && !guaranteedUnique[ name ] ? jQuery.unique( ret ) : ret;
 
 		if ( (this.length > 1 || rmultiselector.test( selector )) && rparentsprev.test( name ) ) {
@@ -3909,5 +5361,5 @@
 		}
 
-		return this.pushStack( ret, name, slice.call(arguments).join(",") );
+		return this.pushStack( ret, name, args.join(",") );
 	};
 });
@@ -3919,9 +5371,13 @@
 		}
 
-		return jQuery.find.matches(expr, elems);
-	},
-	
+		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];
+		var matched = [],
+			cur = elem[ dir ];
+
 		while ( cur && cur.nodeType !== 9 && (until === undefined || cur.nodeType !== 1 || !jQuery( cur ).is( until )) ) {
 			if ( cur.nodeType === 1 ) {
@@ -3958,18 +5414,54 @@
 	}
 });
+
+// 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;
+	});
+}
+
+
+
+
 var rinlinejQuery = / jQuery\d+="(?:\d+|null)"/g,
 	rleadingWhitespace = /^\s+/,
-	rxhtmlTag = /(<([\w:]+)[^>]*?)\/>/g,
-	rselfClosing = /^(?:area|br|col|embed|hr|img|input|link|meta|param)$/i,
+	rxhtmlTag = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
 	rtagName = /<([\w:]+)/,
 	rtbody = /<tbody/i,
 	rhtml = /<|&#?\w+;/,
-	rnocache = /<script|<object|<embed|<option|<style/i,
-	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,  // checked="checked" or checked (html5)
-	fcloseTag = function( all, front, tag ) {
-		return rselfClosing.test( tag ) ?
-			all :
-			front + "></" + tag + ">";
-	},
+	rnocache = /<(?:script|object|embed|option|style)/i,
+	// checked="checked" or checked
+	rchecked = /checked\s*(?:[^=]|=\s*.checked.)/i,
+	rscriptType = /\/(java|ecma)script/i,
+	rcleanScript = /^\s*<!(?:\[CDATA\[|\-\-)/,
 	wrapMap = {
 		option: [ 1, "<select multiple='multiple'>", "</select>" ],
@@ -3996,5 +5488,6 @@
 		if ( jQuery.isFunction(text) ) {
 			return this.each(function(i) {
-				var self = jQuery(this);
+				var self = jQuery( this );
+
 				self.text( text.call(this, i, self.text()) );
 			});
@@ -4031,5 +5524,5 @@
 
 				return elem;
-			}).append(this);
+			}).append( this );
 		}
 
@@ -4045,5 +5538,6 @@
 
 		return this.each(function() {
-			var self = jQuery( this ), contents = self.contents();
+			var self = jQuery( this ),
+				contents = self.contents();
 
 			if ( contents.length ) {
@@ -4109,5 +5603,5 @@
 		}
 	},
-	
+
 	// keepData is for internal use only--do not document
 	remove: function( selector, keepData ) {
@@ -4120,9 +5614,9 @@
 
 				if ( elem.parentNode ) {
-					 elem.parentNode.removeChild( elem );
-				}
-			}
-		}
-		
+					elem.parentNode.removeChild( elem );
+				}
+			}
+		}
+
 		return this;
 	},
@@ -4140,44 +5634,15 @@
 			}
 		}
-		
+
 		return this;
 	},
 
-	clone: function( events ) {
-		// Do the clone
-		var ret = this.map(function() {
-			if ( !jQuery.support.noCloneEvent && !jQuery.isXMLDoc(this) ) {
-				// IE copies events bound via attachEvent when
-				// using cloneNode. Calling detachEvent on the
-				// clone will also remove the events from the orignal
-				// In order to get around this, we use innerHTML.
-				// Unfortunately, this means some modifications to
-				// attributes in IE that are actually only stored
-				// as properties will not be copied (such as the
-				// the name attribute on an input).
-				var html = this.outerHTML, ownerDocument = this.ownerDocument;
-				if ( !html ) {
-					var div = ownerDocument.createElement("div");
-					div.appendChild( this.cloneNode(true) );
-					html = div.innerHTML;
-				}
-
-				return jQuery.clean([html.replace(rinlinejQuery, "")
-					// Handle the case in IE 8 where action=/test/> self-closes a tag
-					.replace(/=([^="'>\s]+\/)>/g, '="$1">')
-					.replace(rleadingWhitespace, "")], ownerDocument)[0];
-			} else {
-				return this.cloneNode(true);
-			}
+	clone: function( dataAndEvents, deepDataAndEvents ) {
+		dataAndEvents = dataAndEvents == null ? false : dataAndEvents;
+		deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents;
+
+		return this.map( function () {
+			return jQuery.clone( this, dataAndEvents, deepDataAndEvents );
 		});
-
-		// Copy the events from the original to the clone
-		if ( events === true ) {
-			cloneCopyEvent( this, ret );
-			cloneCopyEvent( this.find("*"), ret.find("*") );
-		}
-
-		// Return the cloned set
-		return ret;
 	},
 
@@ -4193,5 +5658,5 @@
 			!wrapMap[ (rtagName.exec( value ) || ["", ""])[1].toLowerCase() ] ) {
 
-			value = value.replace(rxhtmlTag, fcloseTag);
+			value = value.replace(rxhtmlTag, "<$1></$2>");
 
 			try {
@@ -4211,8 +5676,7 @@
 		} else if ( jQuery.isFunction( value ) ) {
 			this.each(function(i){
-				var self = jQuery(this), old = self.html();
-				self.empty().append(function(){
-					return value.call( this, i, old );
-				});
+				var self = jQuery( this );
+
+				self.html( value.call(this, i, self.html()) );
 			});
 
@@ -4236,11 +5700,12 @@
 
 			if ( typeof value !== "string" ) {
-				value = jQuery(value).detach();
+				value = jQuery( value ).detach();
 			}
 
 			return this.each(function() {
-				var next = this.nextSibling, parent = this.parentNode;
-
-				jQuery(this).remove();
+				var next = this.nextSibling,
+					parent = this.parentNode;
+
+				jQuery( this ).remove();
 
 				if ( next ) {
@@ -4251,5 +5716,7 @@
 			});
 		} else {
-			return this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value );
+			return this.length ?
+				this.pushStack( jQuery(jQuery.isFunction(value) ? value() : value), "replaceWith", value ) :
+				this;
 		}
 	},
@@ -4260,5 +5727,7 @@
 
 	domManip: function( args, table, callback ) {
-		var results, first, value = args[0], scripts = [], fragment, parent;
+		var results, first, fragment, parent,
+			value = args[0],
+			scripts = [];
 
 		// We can't cloneNode fragments that contain checked, in WebKit
@@ -4285,9 +5754,9 @@
 
 			} else {
-				results = buildFragment( args, this, scripts );
-			}
-			
+				results = jQuery.buildFragment( args, this, scripts );
+			}
+
 			fragment = results.fragment;
-			
+
 			if ( fragment.childNodes.length === 1 ) {
 				first = fragment = fragment.firstChild;
@@ -4299,11 +5768,18 @@
 				table = table && jQuery.nodeName( first, "tr" );
 
-				for ( var i = 0, l = this.length; i < l; i++ ) {
+				for ( var i = 0, l = this.length, lastIndex = l - 1; i < l; i++ ) {
 					callback.call(
 						table ?
 							root(this[i], first) :
 							this[i],
-						i > 0 || results.cacheable || this.length > 1  ?
-							fragment.cloneNode(true) :
+						// Make sure that we do not leak memory by inadvertently discarding
+						// the original fragment (which might have attached data) instead of
+						// using it; in addition, use the original fragment object for the last
+						// item instead of first because it can end up being emptied incorrectly
+						// in certain situations (Bug #8070).
+						// Fragments from the fragment cache must always be cloned and never used
+						// in place.
+						results.cacheable || (l > 1 && i < lastIndex) ?
+							jQuery.clone( fragment, true, true ) :
 							fragment
 					);
@@ -4317,23 +5793,29 @@
 
 		return this;
-
-		function root( elem, cur ) {
-			return jQuery.nodeName(elem, "table") ?
-				(elem.getElementsByTagName("tbody")[0] ||
-				elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
-				elem;
-		}
 	}
 });
 
-function cloneCopyEvent(orig, ret) {
-	var i = 0;
-
-	ret.each(function() {
-		if ( this.nodeName !== (orig[i] && orig[i].nodeName) ) {
-			return;
-		}
-
-		var oldData = jQuery.data( orig[i++] ), curData = jQuery.data( this, oldData ), events = oldData && oldData.events;
+function root( elem, cur ) {
+	return jQuery.nodeName(elem, "table") ?
+		(elem.getElementsByTagName("tbody")[0] ||
+		elem.appendChild(elem.ownerDocument.createElement("tbody"))) :
+		elem;
+}
+
+function cloneCopyEvent( src, dest ) {
+
+	if ( dest.nodeType !== 1 || !jQuery.hasData( src ) ) {
+		return;
+	}
+
+	var internalKey = jQuery.expando,
+		oldData = jQuery.data( src ),
+		curData = jQuery.data( dest, oldData );
+
+	// Switch to use the internal data object, if it exists, for the next
+	// stage of data copying
+	if ( (oldData = oldData[ internalKey ]) ) {
+		var events = oldData.events;
+				curData = curData[ internalKey ] = jQuery.extend({}, oldData);
 
 		if ( events ) {
@@ -4342,29 +5824,86 @@
 
 			for ( var type in events ) {
-				for ( var handler in events[ type ] ) {
-					jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
-				}
-			}
-		}
-	});
+				for ( var i = 0, l = events[ type ].length; i < l; i++ ) {
+					jQuery.event.add( dest, type + ( events[ type ][ i ].namespace ? "." : "" ) + events[ type ][ i ].namespace, events[ type ][ i ], events[ type ][ i ].data );
+				}
+			}
+		}
+	}
 }
 
-function buildFragment( args, nodes, scripts ) {
+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();
+
+	// IE6-8 fail to clone children inside object elements that use
+	// the proprietary classid attribute value (rather than the type
+	// attribute) to identify the type of content to display
+	if ( nodeName === "object" ) {
+		dest.outerHTML = src.outerHTML;
+
+	} else if ( nodeName === "input" && (src.type === "checkbox" || src.type === "radio") ) {
+		// 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
+		if ( src.checked ) {
+			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;
+	}
+
+	// Event data gets referenced instead of copied if the expando
+	// gets copied too
+	dest.removeAttribute( jQuery.expando );
+}
+
+jQuery.buildFragment = function( args, nodes, scripts ) {
 	var fragment, cacheable, cacheresults,
 		doc = (nodes && nodes[0] ? nodes[0].ownerDocument || nodes[0] : document);
 
-	// Only cache "small" (1/2 KB) strings that are associated with the main document
+	// 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
 	if ( args.length === 1 && typeof args[0] === "string" && args[0].length < 512 && doc === document &&
-		!rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
+		args[0].charAt(0) === "<" && !rnocache.test( args[0] ) && (jQuery.support.checkClone || !rchecked.test( args[0] )) ) {
 
 		cacheable = true;
+
 		cacheresults = jQuery.fragments[ args[0] ];
-		if ( cacheresults ) {
-			if ( cacheresults !== 1 ) {
-				fragment = cacheresults;
-			}
+		if ( cacheresults && cacheresults !== 1 ) {
+			fragment = cacheresults;
 		}
 	}
@@ -4380,5 +5919,5 @@
 
 	return { fragment: fragment, cacheable: cacheable };
-}
+};
 
 jQuery.fragments = {};
@@ -4392,18 +5931,19 @@
 }, function( name, original ) {
 	jQuery.fn[ name ] = function( selector ) {
-		var ret = [], insert = jQuery( selector ),
+		var ret = [],
+			insert = jQuery( selector ),
 			parent = this.length === 1 && this[0].parentNode;
-		
+
 		if ( parent && parent.nodeType === 11 && parent.childNodes.length === 1 && insert.length === 1 ) {
 			insert[ original ]( this[0] );
 			return this;
-			
+
 		} else {
 			for ( var i = 0, l = insert.length; i < l; i++ ) {
 				var elems = (i > 0 ? this.clone(true) : this).get();
-				jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
+				jQuery( insert[i] )[ original ]( elems );
 				ret = ret.concat( elems );
 			}
-		
+
 			return this.pushStack( ret, name, insert.selector );
 		}
@@ -4411,6 +5951,82 @@
 });
 
+function getAll( elem ) {
+	if ( "getElementsByTagName" in elem ) {
+		return elem.getElementsByTagName( "*" );
+
+	} else if ( "querySelectorAll" in elem ) {
+		return elem.querySelectorAll( "*" );
+
+	} else {
+		return [];
+	}
+}
+
+// Used in clean, fixes the defaultChecked property
+function fixDefaultChecked( elem ) {
+	if ( elem.type === "checkbox" || elem.type === "radio" ) {
+		elem.defaultChecked = elem.checked;
+	}
+}
+// Finds all inputs and passes them to fixDefaultChecked
+function findInputs( elem ) {
+	if ( jQuery.nodeName( elem, "input" ) ) {
+		fixDefaultChecked( elem );
+	} else if ( elem.getElementsByTagName ) {
+		jQuery.grep( elem.getElementsByTagName("input"), fixDefaultChecked );
+	}
+}
+
 jQuery.extend({
+	clone: function( elem, dataAndEvents, deepDataAndEvents ) {
+		var clone = elem.cloneNode(true),
+				srcElements,
+				destElements,
+				i;
+
+		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 ) {
+				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] );
+				}
+			}
+		}
+
+		// Return the cloned set
+		return clone;
+	},
+
 	clean: function( elems, context, fragment, scripts ) {
+		var checkScriptType;
+
 		context = context || document;
 
@@ -4420,5 +6036,5 @@
 		}
 
-		var ret = [];
+		var ret = [], j;
 
 		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
@@ -4432,52 +6048,65 @@
 
 			// Convert html string into DOM nodes
-			if ( typeof elem === "string" && !rhtml.test( elem ) ) {
-				elem = context.createTextNode( elem );
-
-			} else if ( typeof elem === "string" ) {
-				// Fix "XHTML"-style tags in all browsers
-				elem = elem.replace(rxhtmlTag, fcloseTag);
-
-				// Trim whitespace, otherwise indexOf won't work as expected
-				var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
-					wrap = wrapMap[ tag ] || wrapMap._default,
-					depth = wrap[0],
-					div = context.createElement("div");
-
-				// Go to html and back, then peel off extra wrappers
-				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>
-					var 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 ( var j = tbody.length - 1; j >= 0 ; --j ) {
-						if ( jQuery.nodeName( tbody[ j ], "tbody" ) && !tbody[ j ].childNodes.length ) {
-							tbody[ j ].parentNode.removeChild( tbody[ j ] );
+			if ( typeof elem === "string" ) {
+				if ( !rhtml.test( elem ) ) {
+					elem = context.createTextNode( elem );
+				} else {
+					// Fix "XHTML"-style tags in all browsers
+					elem = elem.replace(rxhtmlTag, "<$1></$2>");
+
+					// Trim whitespace, otherwise indexOf won't work as expected
+					var tag = (rtagName.exec( elem ) || ["", ""])[1].toLowerCase(),
+						wrap = wrapMap[ tag ] || wrapMap._default,
+						depth = wrap[0],
+						div = context.createElement("div");
+
+					// Go to html and back, then peel off extra wrappers
+					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>
+						var 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;
+					// 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;
+				}
+			}
+
+			// Resets defaultChecked for any radios and checkboxes
+			// about to be appended to the DOM in IE 6/7 (#8060)
+			var len;
+			if ( !jQuery.support.appendChecked ) {
+				if ( elem[0] && typeof (len = elem.length) === "number" ) {
+					for ( j = 0; j < len; j++ ) {
+						findInputs( elem[j] );
+					}
+				} else {
+					findInputs( elem );
+				}
 			}
 
@@ -4490,11 +6119,16 @@
 
 		if ( fragment ) {
-			for ( var i = 0; ret[i]; i++ ) {
+			checkScriptType = function( elem ) {
+				return !elem.type || rscriptType.test( elem.type );
+			};
+			for ( i = 0; ret[i]; i++ ) {
 				if ( scripts && jQuery.nodeName( ret[i], "script" ) && (!ret[i].type || ret[i].type.toLowerCase() === "text/javascript") ) {
 					scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
-				
+
 				} else {
 					if ( ret[i].nodeType === 1 ) {
-						ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName("script"))) );
+						var jsTags = jQuery.grep( ret[i].getElementsByTagName( "script" ), checkScriptType );
+
+						ret.splice.apply( ret, [i + 1, 0].concat( jsTags ) );
 					}
 					fragment.appendChild( ret[i] );
@@ -4505,27 +6139,36 @@
 		return ret;
 	},
-	
+
 	cleanData: function( elems ) {
-		var data, id, cache = jQuery.cache,
-			special = jQuery.event.special,
+		var data, id, cache = jQuery.cache, internalKey = jQuery.expando, special = jQuery.event.special,
 			deleteExpando = jQuery.support.deleteExpando;
-		
+
 		for ( var i = 0, elem; (elem = elems[i]) != null; i++ ) {
+			if ( elem.nodeName && jQuery.noData[elem.nodeName.toLowerCase()] ) {
+				continue;
+			}
+
 			id = elem[ jQuery.expando ];
-			
+
 			if ( id ) {
-				data = cache[ id ];
-				
-				if ( data.events ) {
+				data = cache[ id ] && cache[ id ][ internalKey ];
+
+				if ( data && data.events ) {
 					for ( var type in data.events ) {
 						if ( special[ type ] ) {
 							jQuery.event.remove( elem, type );
 
+						// This is a shortcut to avoid jQuery.event.remove's overhead
 						} else {
-							removeEvent( elem, type, data.handle );
+							jQuery.removeEvent( elem, type, data.handle );
 						}
 					}
-				}
-				
+
+					// Null the DOM reference to avoid IE6/7/8 leak (#7054)
+					if ( data.handle ) {
+						data.handle.elem = null;
+					}
+				}
+
 				if ( deleteExpando ) {
 					delete elem[ jQuery.expando ];
@@ -4534,5 +6177,5 @@
 					elem.removeAttribute( jQuery.expando );
 				}
-				
+
 				delete cache[ id ];
 			}
@@ -4540,22 +6183,42 @@
 	}
 });
-// exclude the following css properties to add px
-var rexclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
-	ralpha = /alpha\([^)]*\)/,
+
+function evalScript( i, elem ) {
+	if ( elem.src ) {
+		jQuery.ajax({
+			url: elem.src,
+			async: false,
+			dataType: "script"
+		});
+	} else {
+		jQuery.globalEval( ( elem.text || elem.textContent || elem.innerHTML || "" ).replace( rcleanScript, "/*$0*/" ) );
+	}
+
+	if ( elem.parentNode ) {
+		elem.parentNode.removeChild( elem );
+	}
+}
+
+
+
+
+var ralpha = /alpha\([^)]*\)/i,
 	ropacity = /opacity=([^)]*)/,
-	rfloat = /float/i,
 	rdashAlpha = /-([a-z])/ig,
-	rupper = /([A-Z])/g,
+	// fixed for IE9, see #8346
+	rupper = /([A-Z]|^ms)/g,
 	rnumpx = /^-?\d+(?:px)?$/i,
 	rnum = /^-?\d/,
-
-	cssShow = { position: "absolute", visibility: "hidden", display:"block" },
+	rrelNum = /^[+\-]=/,
+	rrelNumFilter = /[^+\-\.\de]+/g,
+
+	cssShow = { position: "absolute", visibility: "hidden", display: "block" },
 	cssWidth = [ "Left", "Right" ],
 	cssHeight = [ "Top", "Bottom" ],
-
-	// cache check for defaultView.getComputedStyle
-	getComputedStyle = document.defaultView && document.defaultView.getComputedStyle,
-	// normalize float css property
-	styleFloat = jQuery.support.cssFloat ? "cssFloat" : "styleFloat",
+	curCSS,
+
+	getComputedStyle,
+	currentStyle,
+
 	fcamelCase = function( all, letter ) {
 		return letter.toUpperCase();
@@ -4563,173 +6226,125 @@
 
 jQuery.fn.css = function( name, value ) {
-	return access( this, name, value, true, function( elem, name, value ) {
-		if ( value === undefined ) {
-			return jQuery.curCSS( elem, name );
-		}
-		
-		if ( typeof value === "number" && !rexclude.test(name) ) {
-			value += "px";
-		}
-
-		jQuery.style( elem, name, value );
+	// Setting 'undefined' is a no-op
+	if ( arguments.length === 2 && value === undefined ) {
+		return this;
+	}
+
+	return jQuery.access( this, name, value, true, function( elem, name, value ) {
+		return value !== undefined ?
+			jQuery.style( elem, name, value ) :
+			jQuery.css( elem, name );
 	});
 };
 
 jQuery.extend({
-	style: function( elem, name, value ) {
-		// don't set styles on text and comment nodes
-		if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 ) {
-			return undefined;
-		}
-
-		// ignore negative width and height values #1599
-		if ( (name === "width" || name === "height") && parseFloat(value) < 0 ) {
-			value = undefined;
-		}
-
-		var style = elem.style || elem, set = value !== undefined;
-
-		// IE uses filters for opacity
-		if ( !jQuery.support.opacity && name === "opacity" ) {
-			if ( set ) {
-				// IE has trouble with opacity if it does not have layout
-				// Force it by setting the zoom level
-				style.zoom = 1;
-
-				// Set the alpha filter to set the opacity
-				var opacity = parseInt( value, 10 ) + "" === "NaN" ? "" : "alpha(opacity=" + value * 100 + ")";
-				var filter = style.filter || jQuery.curCSS( elem, "filter" ) || "";
-				style.filter = ralpha.test(filter) ? filter.replace(ralpha, opacity) : opacity;
-			}
-
-			return style.filter && style.filter.indexOf("opacity=") >= 0 ?
-				(parseFloat( ropacity.exec(style.filter)[1] ) / 100) + "":
-				"";
-		}
-
-		// Make sure we're using the right name for getting the float value
-		if ( rfloat.test( name ) ) {
-			name = styleFloat;
-		}
-
-		name = name.replace(rdashAlpha, fcamelCase);
-
-		if ( set ) {
-			style[ name ] = value;
-		}
-
-		return style[ name ];
-	},
-
-	css: function( elem, name, force, extra ) {
-		if ( name === "width" || name === "height" ) {
-			var val, props = cssShow, which = name === "width" ? cssWidth : cssHeight;
-
-			function getWH() {
-				val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
-
-				if ( extra === "border" ) {
-					return;
-				}
-
-				jQuery.each( which, function() {
-					if ( !extra ) {
-						val -= parseFloat(jQuery.curCSS( elem, "padding" + this, true)) || 0;
-					}
-
-					if ( extra === "margin" ) {
-						val += parseFloat(jQuery.curCSS( elem, "margin" + this, true)) || 0;
-					} else {
-						val -= parseFloat(jQuery.curCSS( elem, "border" + this + "Width", true)) || 0;
-					}
-				});
-			}
-
-			if ( elem.offsetWidth !== 0 ) {
-				getWH();
-			} else {
-				jQuery.swap( elem, props, getWH );
-			}
-
-			return Math.max(0, Math.round(val));
-		}
-
-		return jQuery.curCSS( elem, name, force );
-	},
-
-	curCSS: function( elem, name, force ) {
-		var ret, style = elem.style, filter;
-
-		// IE uses filters for opacity
-		if ( !jQuery.support.opacity && name === "opacity" && elem.currentStyle ) {
-			ret = ropacity.test(elem.currentStyle.filter || "") ?
-				(parseFloat(RegExp.$1) / 100) + "" :
-				"";
-
-			return ret === "" ?
-				"1" :
-				ret;
-		}
-
-		// Make sure we're using the right name for getting the float value
-		if ( rfloat.test( name ) ) {
-			name = styleFloat;
-		}
-
-		if ( !force && style && style[ name ] ) {
-			ret = style[ name ];
-
-		} else if ( getComputedStyle ) {
-
-			// Only "float" is needed here
-			if ( rfloat.test( name ) ) {
-				name = "float";
-			}
-
-			name = name.replace( rupper, "-$1" ).toLowerCase();
-
-			var defaultView = elem.ownerDocument.defaultView;
-
-			if ( !defaultView ) {
-				return null;
-			}
-
-			var computedStyle = defaultView.getComputedStyle( elem, null );
-
-			if ( computedStyle ) {
-				ret = computedStyle.getPropertyValue( name );
-			}
-
-			// We should always get a number back from opacity
-			if ( name === "opacity" && ret === "" ) {
-				ret = "1";
-			}
-
-		} else if ( elem.currentStyle ) {
-			var camelCase = name.replace(rdashAlpha, fcamelCase);
-
-			ret = elem.currentStyle[ name ] || elem.currentStyle[ camelCase ];
-
-			// 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
-			if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
-				// Remember the original values
-				var left = style.left, rsLeft = elem.runtimeStyle.left;
-
-				// Put in the new values to get a computed value out
-				elem.runtimeStyle.left = elem.currentStyle.left;
-				style.left = camelCase === "fontSize" ? "1em" : (ret || 0);
-				ret = style.pixelLeft + "px";
-
-				// Revert the changed values
-				style.left = left;
-				elem.runtimeStyle.left = rsLeft;
-			}
-		}
-
-		return ret;
+	// 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", "opacity" );
+					return ret === "" ? "1" : ret;
+
+				} else {
+					return elem.style.opacity;
+				}
+			}
+		}
+	},
+
+	// Exclude the following css properties to add px
+	cssNumber: {
+		"zIndex": true,
+		"fontWeight": true,
+		"opacity": true,
+		"zoom": true,
+		"lineHeight": true,
+		"widows": true,
+		"orphans": 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, origName = jQuery.camelCase( name ),
+			style = elem.style, hooks = jQuery.cssHooks[ origName ];
+
+		name = jQuery.cssProps[ origName ] || origName;
+
+		// Check if we're setting a value
+		if ( value !== undefined ) {
+			type = typeof value;
+
+			// Make sure that NaN and null values aren't set. See: #7116
+			if ( type === "number" && isNaN( value ) || value == null ) {
+				return;
+			}
+
+			// convert relative number strings (+= or -=) to relative numbers. #7345
+			if ( type === "string" && rrelNum.test( value ) ) {
+				value = +value.replace( rrelNumFilter, "" ) + parseFloat( jQuery.css( elem, name ) );
+			}
+
+			// 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 )) !== 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, extra ) {
+		var ret, hooks;
+
+		// Make sure that we're working with the right name
+		name = jQuery.camelCase( name );
+		hooks = jQuery.cssHooks[ name ];
+		name = jQuery.cssProps[ name ] || name;
+
+		// cssFloat needs a special treatment
+		if ( name === "cssFloat" ) {
+			name = "float";
+		}
+
+		// If a hook was provided get the computed value from there
+		if ( hooks && "get" in hooks && (ret = hooks.get( elem, true, extra )) !== undefined ) {
+			return ret;
+
+		// Otherwise, if a way to get the computed value exists, use that
+		} else if ( curCSS ) {
+			return curCSS( elem, name );
+		}
 	},
 
@@ -4747,20 +6362,213 @@
 
 		// Revert the old values
-		for ( var name in options ) {
+		for ( name in options ) {
 			elem.style[ name ] = old[ name ];
 		}
+	},
+
+	camelCase: function( string ) {
+		return string.replace( rdashAlpha, fcamelCase );
 	}
 });
+
+// DEPRECATED, Use jQuery.css() instead
+jQuery.curCSS = jQuery.css;
+
+jQuery.each(["height", "width"], function( i, name ) {
+	jQuery.cssHooks[ name ] = {
+		get: function( elem, computed, extra ) {
+			var val;
+
+			if ( computed ) {
+				if ( elem.offsetWidth !== 0 ) {
+					val = getWH( elem, name, extra );
+
+				} else {
+					jQuery.swap( elem, cssShow, function() {
+						val = getWH( elem, name, extra );
+					});
+				}
+
+				if ( val <= 0 ) {
+					val = curCSS( elem, name, name );
+
+					if ( val === "0px" && currentStyle ) {
+						val = currentStyle( elem, name, name );
+					}
+
+					if ( val != null ) {
+						// Should return "auto" instead of 0, use 0 for
+						// temporary backwards-compat
+						return val === "" || val === "auto" ? "0px" : val;
+					}
+				}
+
+				if ( val < 0 || val == null ) {
+					val = elem.style[ name ];
+
+					// Should return "auto" instead of 0, use 0 for
+					// temporary backwards-compat
+					return val === "" || val === "auto" ? "0px" : val;
+				}
+
+				return typeof val === "string" ? val : val + "px";
+			}
+		},
+
+		set: function( elem, value ) {
+			if ( rnumpx.test( value ) ) {
+				// ignore negative width and height values #1599
+				value = parseFloat(value);
+
+				if ( value >= 0 ) {
+					return value + "px";
+				}
+
+			} else {
+				return value;
+			}
+		}
+	};
+});
+
+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) || "" ) ?
+				( parseFloat( RegExp.$1 ) / 100 ) + "" :
+				computed ? "1" : "";
+		},
+
+		set: function( elem, value ) {
+			var style = elem.style,
+				currentStyle = elem.currentStyle;
+
+			// IE has trouble with opacity if it does not have layout
+			// Force it by setting the zoom level
+			style.zoom = 1;
+
+			// Set the alpha filter to set the opacity
+			var opacity = jQuery.isNaN( value ) ?
+				"" :
+				"alpha(opacity=" + value * 100 + ")",
+				filter = currentStyle && currentStyle.filter || style.filter || "";
+
+			style.filter = ralpha.test( filter ) ?
+				filter.replace( ralpha, opacity ) :
+				filter + " " + opacity;
+		}
+	};
+}
+
+jQuery(function() {
+	// This hook cannot be added until DOM ready because the support test
+	// for it is not run until after DOM ready
+	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
+				var ret;
+				jQuery.swap( elem, { "display": "inline-block" }, function() {
+					if ( computed ) {
+						ret = curCSS( elem, "margin-right", "marginRight" );
+					} else {
+						ret = elem.style.marginRight;
+					}
+				});
+				return ret;
+			}
+		};
+	}
+});
+
+if ( document.defaultView && document.defaultView.getComputedStyle ) {
+	getComputedStyle = function( elem, name ) {
+		var ret, defaultView, computedStyle;
+
+		name = name.replace( rupper, "-$1" ).toLowerCase();
+
+		if ( !(defaultView = elem.ownerDocument.defaultView) ) {
+			return undefined;
+		}
+
+		if ( (computedStyle = defaultView.getComputedStyle( elem, null )) ) {
+			ret = computedStyle.getPropertyValue( name );
+			if ( ret === "" && !jQuery.contains( elem.ownerDocument.documentElement, elem ) ) {
+				ret = jQuery.style( elem, name );
+			}
+		}
+
+		return ret;
+	};
+}
+
+if ( document.documentElement.currentStyle ) {
+	currentStyle = function( elem, name ) {
+		var left,
+			ret = elem.currentStyle && elem.currentStyle[ name ],
+			rsLeft = elem.runtimeStyle && elem.runtimeStyle[ name ],
+			style = elem.style;
+
+		// 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
+		if ( !rnumpx.test( ret ) && rnum.test( ret ) ) {
+			// Remember the original values
+			left = style.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 || 0);
+			ret = style.pixelLeft + "px";
+
+			// Revert the changed values
+			style.left = left;
+			if ( rsLeft ) {
+				elem.runtimeStyle.left = rsLeft;
+			}
+		}
+
+		return ret === "" ? "auto" : ret;
+	};
+}
+
+curCSS = getComputedStyle || currentStyle;
+
+function getWH( elem, name, extra ) {
+	var which = name === "width" ? cssWidth : cssHeight,
+		val = name === "width" ? elem.offsetWidth : elem.offsetHeight;
+
+	if ( extra === "border" ) {
+		return val;
+	}
+
+	jQuery.each( which, function() {
+		if ( !extra ) {
+			val -= parseFloat(jQuery.css( elem, "padding" + this )) || 0;
+		}
+
+		if ( extra === "margin" ) {
+			val += parseFloat(jQuery.css( elem, "margin" + this )) || 0;
+
+		} else {
+			val -= parseFloat(jQuery.css( elem, "border" + this + "Width" )) || 0;
+		}
+	});
+
+	return val;
+}
 
 if ( jQuery.expr && jQuery.expr.filters ) {
 	jQuery.expr.filters.hidden = function( elem ) {
-		var width = elem.offsetWidth, height = elem.offsetHeight,
-			skip = elem.nodeName.toLowerCase() === "tr";
-
-		return width === 0 && height === 0 && !skip ?
-			true :
-			width > 0 && height > 0 && !skip ?
-				false :
-				jQuery.curCSS(elem, "display") === "none";
+		var width = elem.offsetWidth,
+			height = elem.offsetHeight;
+
+		return (width === 0 && height === 0) || (!jQuery.support.reliableHiddenOffsets && (elem.style.display || jQuery.css( elem, "display" )) === "none");
 	};
 
@@ -4769,21 +6577,147 @@
 	};
 }
-var jsc = now(),
-	rscript = /<script(.|\s)*?\/script>/gi,
-	rselectTextarea = /select|textarea/i,
-	rinput = /color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week/i,
-	jsre = /=\?(&|$)/,
+
+
+
+
+var r20 = /%20/g,
+	rbracket = /\[\]$/,
+	rCRLF = /\r?\n/g,
+	rhash = /#.*$/,
+	rheaders = /^(.*?):[ \t]*([^\r\n]*)\r?$/mg, // IE leaves an \r character at EOL
+	rinput = /^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
+	// #7653, #8125, #8152: local protocol detection
+	rlocalProtocol = /^(?:about|app|app\-storage|.+\-extension|file|widget):$/,
+	rnoContent = /^(?:GET|HEAD)$/,
+	rprotocol = /^\/\//,
 	rquery = /\?/,
-	rts = /(\?|&)_=.*?(&|$)/,
-	rurl = /^(\w+:)?\/\/([^\/?#]+)/,
-	r20 = /%20/g,
+	rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
+	rselectTextarea = /^(?:select|textarea)/i,
+	rspacesAjax = /\s+/,
+	rts = /([?&])_=[^&]*/,
+	rurl = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
 
 	// Keep a copy of the old load method
-	_load = jQuery.fn.load;
+	_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 = {},
+
+	// Document location
+	ajaxLocation,
+
+	// Document location segments
+	ajaxLocParts;
+
+// #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 = "*";
+		}
+
+		if ( jQuery.isFunction( func ) ) {
+			var dataTypes = dataTypeExpression.toLowerCase().split( rspacesAjax ),
+				i = 0,
+				length = dataTypes.length,
+				dataType,
+				list,
+				placeBefore;
+
+			// 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 list = structure[ dataType ],
+		i = 0,
+		length = list ? list.length : 0,
+		executeOnly = ( structure === prefilters ),
+		selection;
+
+	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;
+}
 
 jQuery.fn.extend({
 	load: function( url, params, callback ) {
-		if ( typeof url !== "string" ) {
-			return _load.call( this, url );
+		if ( typeof url !== "string" && _load ) {
+			return _load.apply( this, arguments );
 
 		// Don't do a request if no elements are being requested
@@ -4792,8 +6726,8 @@
 		}
 
-		var off = url.indexOf(" ");
+		var off = url.indexOf( " " );
 		if ( off >= 0 ) {
-			var selector = url.slice(off, url.length);
-			url = url.slice(0, off);
+			var selector = url.slice( off, url.length );
+			url = url.slice( 0, off );
 		}
 
@@ -4807,5 +6741,5 @@
 				// We assume that it's the callback
 				callback = params;
-				params = null;
+				params = undefined;
 
 			// Otherwise, build a param string
@@ -4824,14 +6758,22 @@
 			dataType: "html",
 			data: params,
-			complete: function( res, status ) {
+			// Complete callback (responseText is used internally)
+			complete: function( jqXHR, status, responseText ) {
+				// Store the response as specified by the jqXHR object
+				responseText = jqXHR.responseText;
 				// If successful, inject the HTML into all the matched elements
-				if ( status === "success" || status === "notmodified" ) {
+				if ( jqXHR.isResolved() ) {
+					// #4825: Get the actual response in case
+					// a dataFilter is present in ajaxSettings
+					jqXHR.done(function( r ) {
+						responseText = r;
+					});
 					// See if a selector was specified
 					self.html( selector ?
 						// Create a dummy div to hold the results
-						jQuery("<div />")
+						jQuery("<div>")
 							// inject the contents of the document in, removing the scripts
 							// to avoid any 'Permission Denied' errors in IE
-							.append(res.responseText.replace(rscript, ""))
+							.append(responseText.replace(rscript, ""))
 
 							// Locate the specified elements
@@ -4839,9 +6781,9 @@
 
 						// If not, just inject the full result
-						res.responseText );
+						responseText );
 				}
 
 				if ( callback ) {
-					self.each( callback, [res.responseText, status, res] );
+					self.each( callback, [ responseText, status, jqXHR ] );
 				}
 			}
@@ -4852,25 +6794,26 @@
 
 	serialize: function() {
-		return jQuery.param(this.serializeArray());
-	},
+		return jQuery.param( this.serializeArray() );
+	},
+
 	serializeArray: function() {
-		return this.map(function() {
-			return this.elements ? jQuery.makeArray(this.elements) : this;
+		return this.map(function(){
+			return this.elements ? jQuery.makeArray( this.elements ) : this;
 		})
-		.filter(function() {
+		.filter(function(){
 			return this.name && !this.disabled &&
-				(this.checked || rselectTextarea.test(this.nodeName) ||
-					rinput.test(this.type));
+				( this.checked || rselectTextarea.test( this.nodeName ) ||
+					rinput.test( this.type ) );
 		})
-		.map(function( i, elem ) {
-			var val = jQuery(this).val();
+		.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 };
+				jQuery.isArray( val ) ?
+					jQuery.map( val, function( val, i ){
+						return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
 					}) :
-					{ name: elem.name, value: val };
+					{ name: elem.name, value: val.replace( rCRLF, "\r\n" ) };
 		}).get();
 	}
@@ -4878,22 +6821,21 @@
 
 // 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.bind(o, f);
+jQuery.each( "ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split( " " ), function( i, o ){
+	jQuery.fn[ o ] = function( f ){
+		return this.bind( o, f );
 	};
 });
 
-jQuery.extend({
-
-	get: function( url, data, callback, type ) {
-		// shift arguments if data argument was omited
+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 = null;
+			data = undefined;
 		}
 
 		return jQuery.ajax({
-			type: "GET",
+			type: method,
 			url: url,
 			data: data,
@@ -4901,37 +6843,43 @@
 			dataType: type
 		});
-	},
+	};
+});
+
+jQuery.extend({
 
 	getScript: function( url, callback ) {
-		return jQuery.get(url, null, callback, "script");
+		return jQuery.get( url, undefined, callback, "script" );
 	},
 
 	getJSON: function( url, data, callback ) {
-		return jQuery.get(url, data, callback, "json");
-	},
-
-	post: function( url, data, callback, type ) {
-		// shift arguments if data argument was omited
-		if ( jQuery.isFunction( data ) ) {
-			type = type || callback;
-			callback = data;
-			data = {};
-		}
-
-		return jQuery.ajax({
-			type: "POST",
-			url: url,
-			data: data,
-			success: callback,
-			dataType: type
-		});
-	},
-
-	ajaxSetup: function( settings ) {
-		jQuery.extend( jQuery.ajaxSettings, settings );
+		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 ) {
+			// Only one parameter, we extend ajaxSettings
+			settings = target;
+			target = jQuery.extend( true, jQuery.ajaxSettings, settings );
+		} else {
+			// target was provided, we extend into it
+			jQuery.extend( true, target, jQuery.ajaxSettings, settings );
+		}
+		// Flatten fields we don't want deep extended
+		for( var field in { context: 1, url: 1 } ) {
+			if ( field in settings ) {
+				target[ field ] = settings[ field ];
+			} else if( field in jQuery.ajaxSettings ) {
+				target[ field ] = jQuery.ajaxSettings[ field ];
+			}
+		}
+		return target;
 	},
 
 	ajaxSettings: {
-		url: location.href,
+		url: ajaxLocation,
+		isLocal: rlocalProtocol.test( ajaxLocParts[ 1 ] ),
 		global: true,
 		type: "GET",
@@ -4942,434 +6890,432 @@
 		timeout: 0,
 		data: null,
+		dataType: null,
 		username: null,
 		password: null,
+		cache: null,
 		traditional: false,
+		headers: {},
 		*/
-		// Create the request object; Microsoft failed to properly
-		// implement the XMLHttpRequest in IE7 (can't request local files),
-		// so we use the ActiveXObject when it is available
-		// This function can be overriden by calling jQuery.ajaxSetup
-		xhr: window.XMLHttpRequest && (window.location.protocol !== "file:" || !window.ActiveXObject) ?
-			function() {
-				return new window.XMLHttpRequest();
-			} :
-			function() {
-				try {
-					return new window.ActiveXObject("Microsoft.XMLHTTP");
-				} catch(e) {}
-			},
+
 		accepts: {
 			xml: "application/xml, text/xml",
 			html: "text/html",
-			script: "text/javascript, application/javascript",
+			text: "text/plain",
 			json: "application/json, text/javascript",
-			text: "text/plain",
-			_default: "*/*"
-		}
-	},
-
-	// Last-Modified header cache for next request
-	lastModified: {},
-	etag: {},
-
-	ajax: function( origSettings ) {
-		var s = jQuery.extend(true, {}, jQuery.ajaxSettings, origSettings);
-		
-		var jsonp, status, data,
-			callbackContext = origSettings && origSettings.context || s,
-			type = s.type.toUpperCase();
-
-		// convert data if not already a string
+			"*": "*/*"
+		},
+
+		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
+		}
+	},
+
+	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 // 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._Deferred(),
+			// Status-dependent callbacks
+			statusCode = s.statusCode || {},
+			// ifModified key
+			ifModifiedKey,
+			// Headers (they are sent all at once)
+			requestHeaders = {},
+			requestHeadersNames = {},
+			// Response headers
+			responseHeadersString,
+			responseHeaders,
+			// transport
+			transport,
+			// timeout handle
+			timeoutTimer,
+			// Cross-domain detection vars
+			parts,
+			// The jqXHR state
+			state = 0,
+			// To know if global events are to be dispatched
+			fireGlobals,
+			// Loop variable
+			i,
+			// 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 || "abort";
+					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, statusText, responses, headers ) {
+
+			// 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 ? 4 : 0;
+
+			var isSuccess,
+				success,
+				error,
+				response = responses ? ajaxHandleResponses( s, jqXHR, responses ) : undefined,
+				lastModified,
+				etag;
+
+			// 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 ) {
+
+					if ( ( lastModified = jqXHR.getResponseHeader( "Last-Modified" ) ) ) {
+						jQuery.lastModified[ ifModifiedKey ] = lastModified;
+					}
+					if ( ( etag = jqXHR.getResponseHeader( "Etag" ) ) ) {
+						jQuery.etag[ ifModifiedKey ] = etag;
+					}
+				}
+
+				// If not modified
+				if ( status === 304 ) {
+
+					statusText = "notmodified";
+					isSuccess = true;
+
+				// If we have data
+				} else {
+
+					try {
+						success = ajaxConvert( s, response );
+						statusText = "success";
+						isSuccess = true;
+					} catch(e) {
+						// We have a parsererror
+						statusText = "parsererror";
+						error = e;
+					}
+				}
+			} 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 = 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.resolveWith( 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.done;
+
+		// 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.then( tmp, 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( rspacesAjax );
+
+		// Determine if a cross-domain request is in order
+		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 );
 		}
 
-		// Handle JSONP Parameter Callbacks
-		if ( s.dataType === "jsonp" ) {
-			if ( type === "GET" ) {
-				if ( !jsre.test( s.url ) ) {
-					s.url += (rquery.test( s.url ) ? "&" : "?") + (s.jsonp || "callback") + "=?";
-				}
-			} else if ( !s.data || !jsre.test(s.data) ) {
-				s.data = (s.data ? s.data + "&" : "") + (s.jsonp || "callback") + "=?";
-			}
-			s.dataType = "json";
-		}
-
-		// Build temporary JSONP function
-		if ( s.dataType === "json" && (s.data && jsre.test(s.data) || jsre.test(s.url)) ) {
-			jsonp = s.jsonpCallback || ("jsonp" + jsc++);
-
-			// Replace the =? sequence both in the query string and the data
+		// Apply prefilters
+		inspectPrefiltersOrTransports( prefilters, s, options, jqXHR );
+
+		// If request was aborted inside a prefiler, stop there
+		if ( state === 2 ) {
+			return false;
+		}
+
+		// 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.data = (s.data + "").replace(jsre, "=" + jsonp + "$1");
-			}
-
-			s.url = s.url.replace(jsre, "=" + jsonp + "$1");
-
-			// We need to make sure
-			// that a JSONP style response is executed properly
-			s.dataType = "script";
-
-			// Handle JSONP-style loading
-			window[ jsonp ] = window[ jsonp ] || function( tmp ) {
-				data = tmp;
-				success();
-				complete();
-				// Garbage collect
-				window[ jsonp ] = undefined;
-
-				try {
-					delete window[ jsonp ];
-				} catch(e) {}
-
-				if ( head ) {
-					head.removeChild( script );
-				}
-			};
-		}
-
-		if ( s.dataType === "script" && s.cache === null ) {
-			s.cache = false;
-		}
-
-		if ( s.cache === false && type === "GET" ) {
-			var ts = now();
-
-			// try replacing _= if it is there
-			var ret = s.url.replace(rts, "$1_=" + ts + "$2");
-
-			// if nothing was replaced, add timestamp to the end
-			s.url = ret + ((ret === s.url) ? (rquery.test(s.url) ? "&" : "?") + "_=" + ts : "");
-		}
-
-		// If data is available, append data to url for get requests
-		if ( s.data && type === "GET" ) {
-			s.url += (rquery.test(s.url) ? "&" : "?") + s.data;
-		}
-
-		// Watch for a new set of requests
-		if ( s.global && ! jQuery.active++ ) {
-			jQuery.event.trigger( "ajaxStart" );
-		}
-
-		// Matches an absolute URL, and saves the domain
-		var parts = rurl.exec( s.url ),
-			remote = parts && (parts[1] && parts[1] !== location.protocol || parts[2] !== location.host);
-
-		// If we're requesting a remote document
-		// and trying to load JSON or Script with a GET
-		if ( s.dataType === "script" && type === "GET" && remote ) {
-			var head = document.getElementsByTagName("head")[0] || document.documentElement;
-			var script = document.createElement("script");
-			script.src = s.url;
-			if ( s.scriptCharset ) {
-				script.charset = s.scriptCharset;
-			}
-
-			// Handle Script loading
-			if ( !jsonp ) {
-				var done = false;
-
-				// Attach handlers for all browsers
-				script.onload = script.onreadystatechange = function() {
-					if ( !done && (!this.readyState ||
-							this.readyState === "loaded" || this.readyState === "complete") ) {
-						done = true;
-						success();
-						complete();
-
-						// Handle memory leak in IE
-						script.onload = script.onreadystatechange = null;
-						if ( head && script.parentNode ) {
-							head.removeChild( script );
-						}
-					}
-				};
-			}
-
-			// 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 );
-
-			// We handle everything using the script element injection
-			return undefined;
-		}
-
-		var requestDone = false;
-
-		// Create the request object
-		var xhr = s.xhr();
-
-		if ( !xhr ) {
-			return;
-		}
-
-		// Open the socket
-		// Passing null username, generates a login popup on Opera (#2865)
-		if ( s.username ) {
-			xhr.open(type, s.url, s.async, s.username, s.password);
+				s.url += ( rquery.test( s.url ) ? "&" : "?" ) + 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 ] !== "*" ? ", */*; 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
+				jqXHR.abort();
+				return false;
+
+		}
+
+		// 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 {
-			xhr.open(type, s.url, s.async);
-		}
-
-		// Need an extra try/catch for cross domain requests in Firefox 3
-		try {
-			// Set the correct header, if data is being sent
-			if ( s.data || origSettings && origSettings.contentType ) {
-				xhr.setRequestHeader("Content-Type", s.contentType);
-			}
-
-			// Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode.
-			if ( s.ifModified ) {
-				if ( jQuery.lastModified[s.url] ) {
-					xhr.setRequestHeader("If-Modified-Since", jQuery.lastModified[s.url]);
-				}
-
-				if ( jQuery.etag[s.url] ) {
-					xhr.setRequestHeader("If-None-Match", jQuery.etag[s.url]);
-				}
-			}
-
-			// Set header so the called script knows that it's an XMLHttpRequest
-			// Only send the header if it's not a remote XHR
-			if ( !remote ) {
-				xhr.setRequestHeader("X-Requested-With", "XMLHttpRequest");
-			}
-
-			// Set the Accepts header for the server, depending on the dataType
-			xhr.setRequestHeader("Accept", s.dataType && s.accepts[ s.dataType ] ?
-				s.accepts[ s.dataType ] + ", */*" :
-				s.accepts._default );
-		} catch(e) {}
-
-		// Allow custom headers/mimetypes and early abort
-		if ( s.beforeSend && s.beforeSend.call(callbackContext, xhr, s) === false ) {
-			// Handle the global AJAX counter
-			if ( s.global && ! --jQuery.active ) {
-				jQuery.event.trigger( "ajaxStop" );
-			}
-
-			// close opended socket
-			xhr.abort();
-			return false;
-		}
-
-		if ( s.global ) {
-			trigger("ajaxSend", [xhr, s]);
-		}
-
-		// Wait for a response to come back
-		var onreadystatechange = xhr.onreadystatechange = function( isTimeout ) {
-			// The request was aborted
-			if ( !xhr || xhr.readyState === 0 || isTimeout === "abort" ) {
-				// Opera doesn't call onreadystatechange before this point
-				// so we simulate the call
-				if ( !requestDone ) {
-					complete();
-				}
-
-				requestDone = true;
-				if ( xhr ) {
-					xhr.onreadystatechange = jQuery.noop;
-				}
-
-			// The transfer is complete and the data is available, or the request timed out
-			} else if ( !requestDone && xhr && (xhr.readyState === 4 || isTimeout === "timeout") ) {
-				requestDone = true;
-				xhr.onreadystatechange = jQuery.noop;
-
-				status = isTimeout === "timeout" ?
-					"timeout" :
-					!jQuery.httpSuccess( xhr ) ?
-						"error" :
-						s.ifModified && jQuery.httpNotModified( xhr, s.url ) ?
-							"notmodified" :
-							"success";
-
-				var errMsg;
-
-				if ( status === "success" ) {
-					// Watch for, and catch, XML document parse errors
-					try {
-						// process the data (runs the xml through httpData regardless of callback)
-						data = jQuery.httpData( xhr, s.dataType, s );
-					} catch(err) {
-						status = "parsererror";
-						errMsg = err;
-					}
-				}
-
-				// Make sure that the request was successful or notmodified
-				if ( status === "success" || status === "notmodified" ) {
-					// JSONP handles its own success callback
-					if ( !jsonp ) {
-						success();
-					}
+			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 ( status < 2 ) {
+					done( -1, e );
+				// Simply rethrow otherwise
 				} else {
-					jQuery.handleError(s, xhr, status, errMsg);
-				}
-
-				// Fire the complete handlers
-				complete();
-
-				if ( isTimeout === "timeout" ) {
-					xhr.abort();
-				}
-
-				// Stop memory leaks
-				if ( s.async ) {
-					xhr = null;
-				}
-			}
-		};
-
-		// Override the abort handler, if we can (IE doesn't allow it, but that's OK)
-		// Opera doesn't fire onreadystatechange at all on abort
-		try {
-			var oldAbort = xhr.abort;
-			xhr.abort = function() {
-				if ( xhr ) {
-					oldAbort.call( xhr );
-				}
-
-				onreadystatechange( "abort" );
-			};
-		} catch(e) { }
-
-		// Timeout checker
-		if ( s.async && s.timeout > 0 ) {
-			setTimeout(function() {
-				// Check to see if the request is still happening
-				if ( xhr && !requestDone ) {
-					onreadystatechange( "timeout" );
-				}
-			}, s.timeout);
-		}
-
-		// Send the data
-		try {
-			xhr.send( type === "POST" || type === "PUT" || type === "DELETE" ? s.data : null );
-		} catch(e) {
-			jQuery.handleError(s, xhr, null, e);
-			// Fire the complete handlers
-			complete();
-		}
-
-		// firefox 1.5 doesn't fire statechange for sync requests
-		if ( !s.async ) {
-			onreadystatechange();
-		}
-
-		function success() {
-			// If a local callback was specified, fire it and pass it the data
-			if ( s.success ) {
-				s.success.call( callbackContext, data, status, xhr );
-			}
-
-			// Fire the global callback
-			if ( s.global ) {
-				trigger( "ajaxSuccess", [xhr, s] );
-			}
-		}
-
-		function complete() {
-			// Process result
-			if ( s.complete ) {
-				s.complete.call( callbackContext, xhr, status);
-			}
-
-			// The request was completed
-			if ( s.global ) {
-				trigger( "ajaxComplete", [xhr, s] );
-			}
-
-			// Handle the global AJAX counter
-			if ( s.global && ! --jQuery.active ) {
-				jQuery.event.trigger( "ajaxStop" );
-			}
-		}
-		
-		function trigger(type, args) {
-			(s.context ? jQuery(s.context) : jQuery.event).trigger(type, args);
-		}
-
-		// return XMLHttpRequest to allow aborting the request etc.
-		return xhr;
-	},
-
-	handleError: function( s, xhr, status, e ) {
-		// If a local callback was specified, fire it
-		if ( s.error ) {
-			s.error.call( s.context || s, xhr, status, e );
-		}
-
-		// Fire the global callback
-		if ( s.global ) {
-			(s.context ? jQuery(s.context) : jQuery.event).trigger( "ajaxError", [xhr, s, e] );
-		}
-	},
-
-	// Counter for holding the number of active queries
-	active: 0,
-
-	// Determines if an XMLHttpRequest was successful or not
-	httpSuccess: function( xhr ) {
-		try {
-			// IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
-			return !xhr.status && location.protocol === "file:" ||
-				// Opera returns 0 when status is 304
-				( xhr.status >= 200 && xhr.status < 300 ) ||
-				xhr.status === 304 || xhr.status === 1223 || xhr.status === 0;
-		} catch(e) {}
-
-		return false;
-	},
-
-	// Determines if an XMLHttpRequest returns NotModified
-	httpNotModified: function( xhr, url ) {
-		var lastModified = xhr.getResponseHeader("Last-Modified"),
-			etag = xhr.getResponseHeader("Etag");
-
-		if ( lastModified ) {
-			jQuery.lastModified[url] = lastModified;
-		}
-
-		if ( etag ) {
-			jQuery.etag[url] = etag;
-		}
-
-		// Opera returns 0 when status is 304
-		return xhr.status === 304 || xhr.status === 0;
-	},
-
-	httpData: function( xhr, type, s ) {
-		var ct = xhr.getResponseHeader("content-type") || "",
-			xml = type === "xml" || !type && ct.indexOf("xml") >= 0,
-			data = xml ? xhr.responseXML : xhr.responseText;
-
-		if ( xml && data.documentElement.nodeName === "parsererror" ) {
-			jQuery.error( "parsererror" );
-		}
-
-		// Allow a pre-filtering function to sanitize the response
-		// s is checked to keep backwards compatibility
-		if ( s && s.dataFilter ) {
-			data = s.dataFilter( data, type );
-		}
-
-		// The filter can actually parse the response
-		if ( typeof data === "string" ) {
-			// Get the JavaScript object, if JSON is used.
-			if ( type === "json" || !type && ct.indexOf("json") >= 0 ) {
-				data = jQuery.parseJSON( data );
-
-			// If the type is "script", eval it in global context
-			} else if ( type === "script" || !type && ct.indexOf("javascript") >= 0 ) {
-				jQuery.globalEval( data );
-			}
-		}
-
-		return data;
+					jQuery.error( e );
+				}
+			}
+		}
+
+		return jqXHR;
 	},
 
@@ -5377,70 +7323,628 @@
 	// key/values into a query string
 	param: function( a, traditional ) {
-		var s = [];
-		
+		var s = [],
+			add = function( key, value ) {
+				// If value is a function, invoke it and return its value
+				value = jQuery.isFunction( value ) ? value() : value;
+				s[ s.length ] = encodeURIComponent( key ) + "=" + encodeURIComponent( value );
+			};
+
 		// Set traditional to true for jQuery <= 1.3.2 behavior.
 		if ( traditional === undefined ) {
 			traditional = jQuery.ajaxSettings.traditional;
 		}
-		
+
 		// If an array was passed in, assume that it is an array of form elements.
-		if ( jQuery.isArray(a) || a.jquery ) {
+		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 ( var prefix in a ) {
-				buildParams( prefix, a[prefix] );
+				buildParams( prefix, a[ prefix ], traditional, add );
 			}
 		}
 
 		// Return the resulting serialization
-		return s.join("&").replace(r20, "+");
-
-		function buildParams( prefix, obj ) {
-			if ( jQuery.isArray(obj) ) {
-				// Serialize array item.
-				jQuery.each( obj, function( i, v ) {
-					if ( traditional || /\[\]$/.test( prefix ) ) {
-						// Treat each array item as a scalar.
-						add( prefix, v );
+		return s.join( "&" ).replace( r20, "+" );
+	}
+});
+
+function buildParams( prefix, obj, traditional, add ) {
+	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" || jQuery.isArray(v) ? i : "" ) + "]", v, traditional, add );
+			}
+		});
+
+	} else if ( !traditional && obj != null && typeof obj === "object" ) {
+		// Serialize object item.
+		for ( var name in obj ) {
+			buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add );
+		}
+
+	} else {
+		// Serialize scalar item.
+		add( prefix, obj );
+	}
+}
+
+// This is still on the jQuery object... for now
+// Want to move this to jQuery.ajax some day
+jQuery.extend({
+
+	// 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 contents = s.contents,
+		dataTypes = s.dataTypes,
+		responseFields = s.responseFields,
+		ct,
+		type,
+		finalDataType,
+		firstDataType;
+
+	// 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 ) {
+
+	// Apply the dataFilter if provided
+	if ( s.dataFilter ) {
+		response = s.dataFilter( response, s.dataType );
+	}
+
+	var dataTypes = s.dataTypes,
+		converters = {},
+		i,
+		key,
+		length = dataTypes.length,
+		tmp,
+		// Current and previous dataTypes
+		current = dataTypes[ 0 ],
+		prev,
+		// Conversion expression
+		conversion,
+		// Conversion function
+		conv,
+		// Conversion functions (transitive conversion)
+		conv1,
+		conv2;
+
+	// For each dataType in the chain
+	for( i = 1; i < length; i++ ) {
+
+		// Create converters map
+		// with lowercased keys
+		if ( i === 1 ) {
+			for( key in s.converters ) {
+				if( typeof key === "string" ) {
+					converters[ key.toLowerCase() ] = s.converters[ key ];
+				}
+			}
+		}
+
+		// Get the dataTypes
+		prev = current;
+		current = dataTypes[ i ];
+
+		// If current is auto dataType, update it to prev
+		if( current === "*" ) {
+			current = prev;
+		// If no auto and dataTypes are actually different
+		} else if ( prev !== "*" && prev !== current ) {
+
+			// Get the converter
+			conversion = prev + " " + current;
+			conv = converters[ conversion ] || converters[ "* " + current ];
+
+			// If there is no direct converter, search transitively
+			if ( !conv ) {
+				conv2 = undefined;
+				for( conv1 in converters ) {
+					tmp = conv1.split( " " );
+					if ( tmp[ 0 ] === prev || tmp[ 0 ] === "*" ) {
+						conv2 = converters[ tmp[1] + " " + current ];
+						if ( conv2 ) {
+							conv1 = converters[ conv1 ];
+							if ( conv1 === true ) {
+								conv = conv2;
+							} else if ( conv2 === true ) {
+								conv = conv1;
+							}
+							break;
+						}
+					}
+				}
+			}
+			// If we found no converter, dispatch an error
+			if ( !( conv || conv2 ) ) {
+				jQuery.error( "No conversion from " + conversion.replace(" "," to ") );
+			}
+			// If found converter is not an equivalence
+			if ( conv !== true ) {
+				// Convert with 1 or 2 converters accordingly
+				response = conv ? conv( response ) : conv2( conv1(response) );
+			}
+		}
+	}
+	return response;
+}
+
+
+
+
+var jsc = jQuery.now(),
+	jsre = /(\=)\?(&|$)|\?\?/i;
+
+// Default jsonp settings
+jQuery.ajaxSetup({
+	jsonp: "callback",
+	jsonpCallback: function() {
+		return jQuery.expando + "_" + ( jsc++ );
+	}
+});
+
+// Detect, normalize options and install callbacks for jsonp requests
+jQuery.ajaxPrefilter( "json jsonp", function( s, originalSettings, jqXHR ) {
+
+	var inspectData = s.contentType === "application/x-www-form-urlencoded" &&
+		( typeof s.data === "string" );
+
+	if ( s.dataTypes[ 0 ] === "jsonp" ||
+		s.jsonp !== false && ( jsre.test( s.url ) ||
+				inspectData && jsre.test( s.data ) ) ) {
+
+		var responseContainer,
+			jsonpCallback = s.jsonpCallback =
+				jQuery.isFunction( s.jsonpCallback ) ? s.jsonpCallback() : s.jsonpCallback,
+			previous = window[ jsonpCallback ],
+			url = s.url,
+			data = s.data,
+			replace = "$1" + jsonpCallback + "$2";
+
+		if ( s.jsonp !== false ) {
+			url = url.replace( jsre, replace );
+			if ( s.url === url ) {
+				if ( inspectData ) {
+					data = data.replace( jsre, replace );
+				}
+				if ( s.data === data ) {
+					// Add callback manually
+					url += (/\?/.test( url ) ? "&" : "?") + s.jsonp + "=" + jsonpCallback;
+				}
+			}
+		}
+
+		s.url = url;
+		s.data = data;
+
+		// Install callback
+		window[ jsonpCallback ] = function( response ) {
+			responseContainer = [ response ];
+		};
+
+		// Clean-up function
+		jqXHR.always(function() {
+			// Set callback back to previous value
+			window[ jsonpCallback ] = previous;
+			// Call if it was a function and we have a response
+			if ( responseContainer && jQuery.isFunction( previous ) ) {
+				window[ jsonpCallback ]( responseContainer[ 0 ] );
+			}
+		});
+
+		// Use data converter to retrieve json after script execution
+		s.converters["script json"] = function() {
+			if ( !responseContainer ) {
+				jQuery.error( jsonpCallback + " was not called" );
+			}
+			return responseContainer[ 0 ];
+		};
+
+		// force json dataType
+		s.dataTypes[ 0 ] = "json";
+
+		// 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 // #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,
+	xhrCallbacks;
+
+// 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 xhr = s.xhr(),
+						handle,
+						i;
+
+					// 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 {
-						// 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" || jQuery.isArray(v) ? i : "" ) + "]", v );
-					}
-				});
-					
-			} else if ( !traditional && obj != null && typeof obj === "object" ) {
-				// Serialize object item.
-				jQuery.each( obj, function( k, v ) {
-					buildParams( prefix + "[" + k + "]", v );
-				});
-					
-			} else {
-				// Serialize scalar item.
-				add( prefix, obj );
-			}
-		}
-
-		function add( key, value ) {
-			// If value is a function, invoke it and return its value
-			value = jQuery.isFunction(value) ? value() : value;
-			s[ s.length ] = encodeURIComponent(key) + "=" + encodeURIComponent(value);
-		}
-	}
-});
+						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 occured
+						// 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;
+									}
+									responses.text = xhr.responseText;
+
+									// 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 we're in sync mode or it's in cache
+					// and has been retrieved directly (IE6 & IE7)
+					// we need to manually fire the callback
+					if ( !s.async || xhr.readyState === 4 ) {
+						callback();
+					} 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 elemdisplay = {},
-	rfxtypes = /toggle|show|hide/,
-	rfxnum = /^([+-]=)?([\d+-.]+)(.*)$/,
+	iframe, iframeDoc,
+	rfxtypes = /^(?:toggle|show|hide)$/,
+	rfxnum = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
 	timerId,
 	fxAttrs = [
@@ -5451,38 +7955,69 @@
 		// opacity animations
 		[ "opacity" ]
-	];
+	],
+	fxNow,
+	requestAnimationFrame = window.webkitRequestAnimationFrame ||
+	    window.mozRequestAnimationFrame ||
+	    window.oRequestAnimationFrame;
 
 jQuery.fn.extend({
-	show: function( speed, callback ) {
-		if ( speed || speed === 0) {
-			return this.animate( genFx("show", 3), speed, callback);
+	show: function( speed, easing, callback ) {
+		var elem, display;
+
+		if ( speed || speed === 0 ) {
+			return this.animate( genFx("show", 3), speed, easing, callback);
 
 		} else {
-			for ( var i = 0, l = this.length; i < l; i++ ) {
-				var old = jQuery.data(this[i], "olddisplay");
-
-				this[i].style.display = old || "";
-
-				if ( jQuery.css(this[i], "display") === "none" ) {
-					var nodeName = this[i].nodeName, display;
-
-					if ( elemdisplay[ nodeName ] ) {
-						display = elemdisplay[ nodeName ];
-
-					} else {
-						var elem = jQuery("<" + nodeName + " />").appendTo("body");
-
-						display = elem.css("display");
-
-						if ( display === "none" ) {
-							display = "block";
-						}
-
-						elem.remove();
-
-						elemdisplay[ nodeName ] = display;
-					}
-
-					jQuery.data(this[i], "olddisplay", display);
+			for ( var i = 0, j = this.length; i < j; i++ ) {
+				elem = this[i];
+
+				if ( elem.style ) {
+					display = elem.style.display;
+
+					// Reset the inline display of this element to learn if it is
+					// being hidden by cascaded rules or not
+					if ( !jQuery._data(elem, "olddisplay") && display === "none" ) {
+						display = 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 ( display === "" && jQuery.css( elem, "display" ) === "none" ) {
+						jQuery._data(elem, "olddisplay", defaultDisplay(elem.nodeName));
+					}
+				}
+			}
+
+			// Set the display of most of the elements in a second loop
+			// to avoid the constant reflow
+			for ( i = 0; i < j; i++ ) {
+				elem = this[i];
+
+				if ( elem.style ) {
+					display = elem.style.display;
+
+					if ( display === "" || display === "none" ) {
+						elem.style.display = jQuery._data(elem, "olddisplay") || "";
+					}
+				}
+			}
+
+			return this;
+		}
+	},
+
+	hide: function( speed, easing, callback ) {
+		if ( speed || speed === 0 ) {
+			return this.animate( genFx("hide", 3), speed, easing, callback);
+
+		} else {
+			for ( var i = 0, j = this.length; i < j; i++ ) {
+				if ( this[i].style ) {
+					var display = jQuery.css( this[i], "display" );
+
+					if ( display !== "none" && !jQuery._data( this[i], "olddisplay" ) ) {
+						jQuery._data( this[i], "olddisplay", display );
+					}
 				}
 			}
@@ -5490,28 +8025,8 @@
 			// Set the display of the elements in a second loop
 			// to avoid the constant reflow
-			for ( var j = 0, k = this.length; j < k; j++ ) {
-				this[j].style.display = jQuery.data(this[j], "olddisplay") || "";
-			}
-
-			return this;
-		}
-	},
-
-	hide: function( speed, callback ) {
-		if ( speed || speed === 0 ) {
-			return this.animate( genFx("hide", 3), speed, callback);
-
-		} else {
-			for ( var i = 0, l = this.length; i < l; i++ ) {
-				var old = jQuery.data(this[i], "olddisplay");
-				if ( !old && old !== "none" ) {
-					jQuery.data(this[i], "olddisplay", jQuery.css(this[i], "display"));
-				}
-			}
-
-			// Set the display of the elements in a second loop
-			// to avoid the constant reflow
-			for ( var j = 0, k = this.length; j < k; j++ ) {
-				this[j].style.display = "none";
+			for ( i = 0; i < j; i++ ) {
+				if ( this[i].style ) {
+					this[i].style.display = "none";
+				}
 			}
 
@@ -5523,5 +8038,5 @@
 	_toggle: jQuery.fn.toggle,
 
-	toggle: function( fn, fn2 ) {
+	toggle: function( fn, fn2, callback ) {
 		var bool = typeof fn === "boolean";
 
@@ -5536,5 +8051,5 @@
 
 		} else {
-			this.animate(genFx("toggle", 3), fn, fn2);
+			this.animate(genFx("toggle", 3), fn, fn2, callback);
 		}
 
@@ -5542,7 +8057,7 @@
 	},
 
-	fadeTo: function( speed, to, callback ) {
+	fadeTo: function( speed, to, easing, callback ) {
 		return this.filter(":hidden").css("opacity", 0).show().end()
-					.animate({opacity: to}, speed, callback);
+					.animate({opacity: to}, speed, easing, callback);
 	},
 
@@ -5551,37 +8066,80 @@
 
 		if ( jQuery.isEmptyObject( prop ) ) {
-			return this.each( optall.complete );
-		}
+			return this.each( optall.complete, [ false ] );
+		}
+
+		// Do not change referenced properties as per-property easing will be lost
+		prop = jQuery.extend( {}, prop );
 
 		return this[ optall.queue === false ? "each" : "queue" ](function() {
-			var opt = jQuery.extend({}, optall), p,
-				hidden = this.nodeType === 1 && jQuery(this).is(":hidden"),
-				self = this;
+			// XXX 'this' does not always have a nodeName when running the
+			// test suite
+
+			if ( optall.queue === false ) {
+				jQuery._mark( this );
+			}
+
+			var opt = jQuery.extend( {}, optall ),
+				isElement = this.nodeType === 1,
+				hidden = isElement && jQuery(this).is(":hidden"),
+				name, val, p,
+				display, e,
+				parts, start, end, unit;
+
+			// will store per property easing and be used to determine when an animation is complete
+			opt.animatedProperties = {};
 
 			for ( p in prop ) {
-				var name = p.replace(rdashAlpha, fcamelCase);
-
+
+				// property name normalization
+				name = jQuery.camelCase( p );
 				if ( p !== name ) {
 					prop[ name ] = prop[ p ];
 					delete prop[ p ];
-					p = name;
-				}
-
-				if ( prop[p] === "hide" && hidden || prop[p] === "show" && !hidden ) {
-					return opt.complete.call(this);
-				}
-
-				if ( ( p === "height" || p === "width" ) && this.style ) {
-					// Store display property
-					opt.display = jQuery.css(this, "display");
-
+				}
+
+				val = prop[ name ];
+
+				// easing resolution: per property > opt.specialEasing > opt.easing > 'swing' (default)
+				if ( jQuery.isArray( val ) ) {
+					opt.animatedProperties[ name ] = val[ 1 ];
+					val = prop[ name ] = val[ 0 ];
+				} else {
+					opt.animatedProperties[ name ] = opt.specialEasing && opt.specialEasing[ name ] || opt.easing || 'swing';
+				}
+
+				if ( val === "hide" && hidden || val === "show" && !hidden ) {
+					return opt.complete.call( this );
+				}
+
+				if ( isElement && ( name === "height" || name === "width" ) ) {
 					// Make sure that nothing sneaks out
-					opt.overflow = this.style.overflow;
-				}
-
-				if ( jQuery.isArray( prop[p] ) ) {
-					// Create (if needed) and add to specialEasing
-					(opt.specialEasing = opt.specialEasing || {})[p] = prop[p][1];
-					prop[p] = prop[p][0];
+					// Record all 3 overflow attributes because IE does not
+					// change the overflow attribute when overflowX and
+					// overflowY are set to the same value
+					opt.overflow = [ this.style.overflow, this.style.overflowX, this.style.overflowY ];
+
+					// Set display property to inline-block for height/width
+					// animations on inline elements that are having width/height
+					// animated
+					if ( jQuery.css( this, "display" ) === "inline" &&
+							jQuery.css( this, "float" ) === "none" ) {
+						if ( !jQuery.support.inlineBlockNeedsLayout ) {
+							this.style.display = "inline-block";
+
+						} else {
+							display = defaultDisplay( this.nodeName );
+
+							// inline-level elements accept inline-block;
+							// block-level elements need to be inline with layout
+							if ( display === "inline" ) {
+								this.style.display = "inline-block";
+
+							} else {
+								this.style.display = "inline";
+								this.style.zoom = 1;
+							}
+						}
+					}
 				}
 			}
@@ -5591,30 +8149,29 @@
 			}
 
-			opt.curAnim = jQuery.extend({}, prop);
-
-			jQuery.each( prop, function( name, val ) {
-				var e = new jQuery.fx( self, opt, name );
+			for ( p in prop ) {
+				e = new jQuery.fx( this, opt, p );
+				val = prop[ p ];
 
 				if ( rfxtypes.test(val) ) {
-					e[ val === "toggle" ? hidden ? "show" : "hide" : val ]( prop );
+					e[ val === "toggle" ? hidden ? "show" : "hide" : val ]();
 
 				} else {
-					var parts = rfxnum.exec(val),
-						start = e.cur(true) || 0;
+					parts = rfxnum.exec( val );
+					start = e.cur();
 
 					if ( parts ) {
-						var end = parseFloat( parts[2] ),
-							unit = parts[3] || "px";
+						end = parseFloat( parts[2] );
+						unit = parts[3] || ( jQuery.cssNumber[ p ] ? "" : "px" );
 
 						// We need to compute starting value
 						if ( unit !== "px" ) {
-							self.style[ name ] = (end || 1) + unit;
-							start = ((end || 1) / e.cur(true)) * start;
-							self.style[ name ] = start + unit;
+							jQuery.style( this, p, (end || 1) + unit);
+							start = ((end || 1) / e.cur()) * start;
+							jQuery.style( this, p, start + unit);
 						}
 
 						// If a +=/-= token was provided, we're doing a relative animation
 						if ( parts[1] ) {
-							end = ((parts[1] === "-=" ? -1 : 1) * end) + start;
+							end = ( (parts[ 1 ] === "-=" ? -1 : 1) * end ) + start;
 						}
 
@@ -5625,5 +8182,5 @@
 					}
 				}
-			});
+			}
 
 			// For JS strict compliance
@@ -5633,6 +8190,4 @@
 
 	stop: function( clearQueue, gotoEnd ) {
-		var timers = jQuery.timers;
-
 		if ( clearQueue ) {
 			this.queue([]);
@@ -5640,6 +8195,11 @@
 
 		this.each(function() {
-			// go in reverse order so anything added to the queue during the loop is ignored
-			for ( var i = timers.length - 1; i >= 0; i-- ) {
+			var timers = jQuery.timers,
+				i = timers.length;
+			// clear marker counters if we know they won't be
+			if ( !gotoEnd ) {
+				jQuery._unmark( true, this );
+			}
+			while ( i-- ) {
 				if ( timers[i].elem === this ) {
 					if (gotoEnd) {
@@ -5662,4 +8222,25 @@
 
 });
+
+// Animations created synchronously will run synchronously
+function createFxNow() {
+	setTimeout( clearFxNow, 0 );
+	return ( fxNow = jQuery.now() );
+}
+
+function clearFxNow() {
+	fxNow = undefined;
+}
+
+// Generate parameters to create a standard animation
+function genFx( type, num ) {
+	var obj = {};
+
+	jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
+		obj[ this ] = type;
+	});
+
+	return obj;
+}
 
 // Generate shortcuts for custom animations
@@ -5669,8 +8250,9 @@
 	slideToggle: genFx("toggle", 1),
 	fadeIn: { opacity: "show" },
-	fadeOut: { opacity: "hide" }
+	fadeOut: { opacity: "hide" },
+	fadeToggle: { opacity: "toggle" }
 }, function( name, props ) {
-	jQuery.fn[ name ] = function( speed, callback ) {
-		return this.animate( props, speed, callback );
+	jQuery.fn[ name ] = function( speed, easing, callback ) {
+		return this.animate( props, speed, easing, callback );
 	};
 });
@@ -5678,5 +8260,5 @@
 jQuery.extend({
 	speed: function( speed, easing, fn ) {
-		var opt = speed && typeof speed === "object" ? speed : {
+		var opt = speed && typeof speed === "object" ? jQuery.extend({}, speed) : {
 			complete: fn || !fn && easing ||
 				jQuery.isFunction( speed ) && speed,
@@ -5686,12 +8268,15 @@
 
 		opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === "number" ? opt.duration :
-			jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
+			opt.duration in jQuery.fx.speeds ? jQuery.fx.speeds[opt.duration] : jQuery.fx.speeds._default;
 
 		// Queueing
 		opt.old = opt.complete;
-		opt.complete = function() {
+		opt.complete = function( noUnmark ) {
 			if ( opt.queue !== false ) {
-				jQuery(this).dequeue();
-			}
+				jQuery.dequeue( this );
+			} else if ( noUnmark !== false ) {
+				jQuery._unmark( this );
+			}
+
 			if ( jQuery.isFunction( opt.old ) ) {
 				opt.old.call( this );
@@ -5718,7 +8303,5 @@
 		this.prop = prop;
 
-		if ( !options.orig ) {
-			options.orig = {};
-		}
+		options.orig = options.orig || {};
 	}
 
@@ -5733,31 +8316,33 @@
 
 		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
-
-		// Set display property to block for height/width animations
-		if ( ( this.prop === "height" || this.prop === "width" ) && this.elem.style ) {
-			this.elem.style.display = "block";
-		}
 	},
 
 	// Get the current size
-	cur: function( force ) {
+	cur: function() {
 		if ( this.elem[this.prop] != null && (!this.elem.style || this.elem.style[this.prop] == null) ) {
 			return this.elem[ this.prop ];
 		}
 
-		var r = parseFloat(jQuery.css(this.elem, this.prop, force));
-		return r && r > -10000 ? r : parseFloat(jQuery.curCSS(this.elem, this.prop)) || 0;
+		var parsed,
+			r = jQuery.css( this.elem, this.prop );
+		// Empty strings, null, undefined and "auto" are converted to 0,
+		// complex values such as "rotate(1rad)" are returned as is,
+		// simple values such as "10px" are parsed to Float.
+		return isNaN( parsed = parseFloat( r ) ) ? !r || r === "auto" ? 0 : r : parsed;
 	},
 
 	// Start an animation from one number to another
 	custom: function( from, to, unit ) {
-		this.startTime = now();
+		var self = this,
+			fx = jQuery.fx,
+			raf;
+
+		this.startTime = fxNow || createFxNow();
 		this.start = from;
 		this.end = to;
-		this.unit = unit || this.unit || "px";
+		this.unit = unit || this.unit || ( jQuery.cssNumber[ this.prop ] ? "" : "px" );
 		this.now = this.start;
 		this.pos = this.state = 0;
 
-		var self = this;
 		function t( gotoEnd ) {
 			return self.step(gotoEnd);
@@ -5767,5 +8352,18 @@
 
 		if ( t() && jQuery.timers.push(t) && !timerId ) {
-			timerId = setInterval(jQuery.fx.tick, 13);
+			// Use requestAnimationFrame instead of setInterval if available
+			if ( requestAnimationFrame ) {
+				timerId = 1;
+				raf = function() {
+					// When timerId gets set to null at any point, this stops
+					if ( timerId ) {
+						requestAnimationFrame( raf );
+						fx.tick();
+					}
+				};
+				requestAnimationFrame( raf );
+			} else {
+				timerId = setInterval( fx.tick, fx.interval );
+			}
 		}
 	},
@@ -5798,15 +8396,19 @@
 	// Each step of an animation
 	step: function( gotoEnd ) {
-		var t = now(), done = true;
-
-		if ( gotoEnd || t >= this.options.duration + this.startTime ) {
+		var t = fxNow || createFxNow(),
+			done = true,
+			elem = this.elem,
+			options = this.options,
+			i, n;
+
+		if ( gotoEnd || t >= options.duration + this.startTime ) {
 			this.now = this.end;
 			this.pos = this.state = 1;
 			this.update();
 
-			this.options.curAnim[ this.prop ] = true;
-
-			for ( var i in this.options.curAnim ) {
-				if ( this.options.curAnim[i] !== true ) {
+			options.animatedProperties[ this.prop ] = true;
+
+			for ( i in options.animatedProperties ) {
+				if ( options.animatedProperties[i] !== true ) {
 					done = false;
 				}
@@ -5814,31 +8416,26 @@
 
 			if ( done ) {
-				if ( this.options.display != null ) {
-					// Reset the overflow
-					this.elem.style.overflow = this.options.overflow;
-
-					// Reset the display
-					var old = jQuery.data(this.elem, "olddisplay");
-					this.elem.style.display = old ? old : this.options.display;
-
-					if ( jQuery.css(this.elem, "display") === "none" ) {
-						this.elem.style.display = "block";
-					}
+				// Reset the overflow
+				if ( options.overflow != null && !jQuery.support.shrinkWrapBlocks ) {
+
+					jQuery.each( [ "", "X", "Y" ], function (index, value) {
+						elem.style[ "overflow" + value ] = options.overflow[index];
+					});
 				}
 
 				// Hide the element if the "hide" operation was done
-				if ( this.options.hide ) {
-					jQuery(this.elem).hide();
+				if ( options.hide ) {
+					jQuery(elem).hide();
 				}
 
 				// Reset the properties, if the item has been hidden or shown
-				if ( this.options.hide || this.options.show ) {
-					for ( var p in this.options.curAnim ) {
-						jQuery.style(this.elem, p, this.options.orig[p]);
+				if ( options.hide || options.show ) {
+					for ( var p in options.animatedProperties ) {
+						jQuery.style( elem, p, options.orig[p] );
 					}
 				}
 
 				// Execute the complete function
-				this.options.complete.call( this.elem );
+				options.complete.call( elem );
 			}
 
@@ -5846,13 +8443,15 @@
 
 		} else {
-			var n = t - this.startTime;
-			this.state = n / this.options.duration;
-
-			// Perform the easing function, defaults to swing
-			var specialEasing = this.options.specialEasing && this.options.specialEasing[this.prop];
-			var defaultEasing = this.options.easing || (jQuery.easing.swing ? "swing" : "linear");
-			this.pos = jQuery.easing[specialEasing || defaultEasing](this.state, n, 0, 1, this.options.duration);
-			this.now = this.start + ((this.end - this.start) * this.pos);
-
+			// classical easing cannot be used with an Infinity duration
+			if ( options.duration == Infinity ) {
+				this.now = t;
+			} else {
+				n = t - this.startTime;
+				this.state = n / options.duration;
+
+				// Perform the easing function, defaults to swing
+				this.pos = jQuery.easing[ options.animatedProperties[ this.prop ] ]( this.state, n, 0, 1, options.duration );
+				this.now = this.start + ((this.end - this.start) * this.pos);
+			}
 			// Perform the next step of the animation
 			this.update();
@@ -5865,7 +8464,5 @@
 jQuery.extend( jQuery.fx, {
 	tick: function() {
-		var timers = jQuery.timers;
-
-		for ( var i = 0; i < timers.length; i++ ) {
+		for ( var timers = jQuery.timers, i = 0 ; i < timers.length ; ++i ) {
 			if ( !timers[i]() ) {
 				timers.splice(i--, 1);
@@ -5877,20 +8474,22 @@
 		}
 	},
-		
+
+	interval: 13,
+
 	stop: function() {
 		clearInterval( timerId );
 		timerId = null;
 	},
-	
+
 	speeds: {
 		slow: 600,
- 		fast: 200,
- 		// Default speed
- 		_default: 400
+		fast: 200,
+		// Default speed
+		_default: 400
 	},
 
 	step: {
 		opacity: function( fx ) {
-			jQuery.style(fx.elem, "opacity", fx.now);
+			jQuery.style( fx.elem, "opacity", fx.now );
 		},
 
@@ -5913,18 +8512,60 @@
 }
 
-function genFx( type, num ) {
-	var obj = {};
-
-	jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function() {
-		obj[ this ] = type;
-	});
-
-	return obj;
+// Try to restore the default display value of an element
+function defaultDisplay( nodeName ) {
+
+	if ( !elemdisplay[ nodeName ] ) {
+
+		var elem = jQuery( "<" + nodeName + ">" ).appendTo( "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 === "" ) {
+			// No iframe to use yet, so create it
+			if ( !iframe ) {
+				iframe = document.createElement( "iframe" );
+				iframe.frameBorder = iframe.width = iframe.height = 0;
+			}
+
+			document.body.appendChild( iframe );
+
+			// 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><body></body></html>" );
+			}
+
+			elem = iframeDoc.createElement( nodeName );
+
+			iframeDoc.body.appendChild( elem );
+
+			display = jQuery.css( elem, "display" );
+
+			document.body.removeChild( iframe );
+		}
+
+		// Store the correct default display
+		elemdisplay[ nodeName ] = display;
+	}
+
+	return elemdisplay[ nodeName ];
 }
+
+
+
+
+var rtable = /^t(?:able|d|h)$/i,
+	rroot = /^(?:body|html)$/i;
+
 if ( "getBoundingClientRect" in document.documentElement ) {
 	jQuery.fn.offset = function( options ) {
-		var elem = this[0];
-
-		if ( options ) { 
+		var elem = this[0], box;
+
+		if ( options ) {
 			return this.each(function( i ) {
 				jQuery.offset.setOffset( this, options, i );
@@ -5940,8 +8581,24 @@
 		}
 
-		var box = elem.getBoundingClientRect(), doc = elem.ownerDocument, body = doc.body, docElem = doc.documentElement,
-			clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
-			top  = box.top  + (self.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop ) - clientTop,
-			left = box.left + (self.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft) - clientLeft;
+		try {
+			box = elem.getBoundingClientRect();
+		} catch(e) {}
+
+		var doc = elem.ownerDocument,
+			docElem = doc.documentElement;
+
+		// Make sure we're not dealing with a disconnected DOM node
+		if ( !box || !jQuery.contains( docElem, elem ) ) {
+			return box ? { top: box.top, left: box.left } : { top: 0, left: 0 };
+		}
+
+		var body = doc.body,
+			win = getWindow(doc),
+			clientTop  = docElem.clientTop  || body.clientTop  || 0,
+			clientLeft = docElem.clientLeft || body.clientLeft || 0,
+			scrollTop  = win.pageYOffset || jQuery.support.boxModel && docElem.scrollTop  || body.scrollTop,
+			scrollLeft = win.pageXOffset || jQuery.support.boxModel && docElem.scrollLeft || body.scrollLeft,
+			top  = box.top  + scrollTop  - clientTop,
+			left = box.left + scrollLeft - clientLeft;
 
 		return { top: top, left: left };
@@ -5952,5 +8609,5 @@
 		var elem = this[0];
 
-		if ( options ) { 
+		if ( options ) {
 			return this.each(function( i ) {
 				jQuery.offset.setOffset( this, options, i );
@@ -5968,9 +8625,14 @@
 		jQuery.offset.initialize();
 
-		var offsetParent = elem.offsetParent, prevOffsetParent = elem,
-			doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
-			body = doc.body, defaultView = doc.defaultView,
+		var computedStyle,
+			offsetParent = elem.offsetParent,
+			prevOffsetParent = elem,
+			doc = elem.ownerDocument,
+			docElem = doc.documentElement,
+			body = doc.body,
+			defaultView = doc.defaultView,
 			prevComputedStyle = defaultView ? defaultView.getComputedStyle( elem, null ) : elem.currentStyle,
-			top = elem.offsetTop, left = elem.offsetLeft;
+			top = elem.offsetTop,
+			left = elem.offsetLeft;
 
 		while ( (elem = elem.parentNode) && elem !== body && elem !== docElem ) {
@@ -5987,10 +8649,11 @@
 				left += elem.offsetLeft;
 
-				if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && /^t(able|d|h)$/i.test(elem.nodeName)) ) {
+				if ( jQuery.offset.doesNotAddBorder && !(jQuery.offset.doesAddBorderForTableAndCells && rtable.test(elem.nodeName)) ) {
 					top  += parseFloat( computedStyle.borderTopWidth  ) || 0;
 					left += parseFloat( computedStyle.borderLeftWidth ) || 0;
 				}
 
-				prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
+				prevOffsetParent = offsetParent;
+				offsetParent = elem.offsetParent;
 			}
 
@@ -6019,5 +8682,5 @@
 jQuery.offset = {
 	initialize: function() {
-		var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.curCSS(body, "marginTop", true) ) || 0,
+		var body = document.body, container = document.createElement("div"), innerDiv, checkDiv, table, td, bodyMarginTop = parseFloat( jQuery.css(body, "marginTop") ) || 0,
 			html = "<div style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;'><div></div></div><table style='position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;' cellpadding='0' cellspacing='0'><tr><td></td></tr></table>";
 
@@ -6033,10 +8696,14 @@
 		this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
 
-		checkDiv.style.position = "fixed", checkDiv.style.top = "20px";
+		checkDiv.style.position = "fixed";
+		checkDiv.style.top = "20px";
+
 		// safari subtracts parent border width here which is 5px
 		this.supportsFixedPosition = (checkDiv.offsetTop === 20 || checkDiv.offsetTop === 15);
 		checkDiv.style.position = checkDiv.style.top = "";
 
-		innerDiv.style.overflow = "hidden", innerDiv.style.position = "relative";
+		innerDiv.style.overflow = "hidden";
+		innerDiv.style.position = "relative";
+
 		this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
 
@@ -6044,30 +8711,45 @@
 
 		body.removeChild( container );
-		body = container = innerDiv = checkDiv = table = td = null;
 		jQuery.offset.initialize = jQuery.noop;
 	},
 
 	bodyOffset: function( body ) {
-		var top = body.offsetTop, left = body.offsetLeft;
+		var top = body.offsetTop,
+			left = body.offsetLeft;
 
 		jQuery.offset.initialize();
 
 		if ( jQuery.offset.doesNotIncludeMarginInBodyOffset ) {
-			top  += parseFloat( jQuery.curCSS(body, "marginTop",  true) ) || 0;
-			left += parseFloat( jQuery.curCSS(body, "marginLeft", true) ) || 0;
+			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 ( /static/.test( jQuery.curCSS( elem, "position" ) ) ) {
+		if ( position === "static" ) {
 			elem.style.position = "relative";
 		}
-		var curElem   = jQuery( elem ),
+
+		var curElem = jQuery( elem ),
 			curOffset = curElem.offset(),
-			curTop    = parseInt( jQuery.curCSS( elem, "top",  true ), 10 ) || 0,
-			curLeft   = parseInt( jQuery.curCSS( elem, "left", true ), 10 ) || 0;
+			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 ) ) {
@@ -6075,9 +8757,11 @@
 		}
 
-		var props = {
-			top:  (options.top  - curOffset.top)  + curTop,
-			left: (options.left - curOffset.left) + curLeft
-		};
-		
+		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 );
@@ -6102,15 +8786,15 @@
 		// Get correct offsets
 		offset       = this.offset(),
-		parentOffset = /^body|html$/i.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.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.curCSS(elem, "marginTop",  true) ) || 0;
-		offset.left -= parseFloat( jQuery.curCSS(elem, "marginLeft", true) ) || 0;
+		offset.top  -= parseFloat( jQuery.css(elem, "marginTop") ) || 0;
+		offset.left -= parseFloat( jQuery.css(elem, "marginLeft") ) || 0;
 
 		// Add offsetParent borders
-		parentOffset.top  += parseFloat( jQuery.curCSS(offsetParent[0], "borderTopWidth",  true) ) || 0;
-		parentOffset.left += parseFloat( jQuery.curCSS(offsetParent[0], "borderLeftWidth", true) ) || 0;
+		parentOffset.top  += parseFloat( jQuery.css(offsetParent[0], "borderTopWidth") ) || 0;
+		parentOffset.left += parseFloat( jQuery.css(offsetParent[0], "borderLeftWidth") ) || 0;
 
 		// Subtract the two offsets
@@ -6124,5 +8808,5 @@
 		return this.map(function() {
 			var offsetParent = this.offsetParent || document.body;
-			while ( offsetParent && (!/^body|html$/i.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
+			while ( offsetParent && (!rroot.test(offsetParent.nodeName) && jQuery.css(offsetParent, "position") === "static") ) {
 				offsetParent = offsetParent.offsetParent;
 			}
@@ -6137,27 +8821,14 @@
 	var method = "scroll" + name;
 
-	jQuery.fn[ method ] = function(val) {
-		var elem = this[0], win;
-		
-		if ( !elem ) {
-			return null;
-		}
-
-		if ( val !== undefined ) {
-			// Set the scroll offset
-			return this.each(function() {
-				win = getWindow( this );
-
-				if ( win ) {
-					win.scrollTo(
-						!i ? val : jQuery(win).scrollLeft(),
-						 i ? val : jQuery(win).scrollTop()
-					);
-
-				} else {
-					this[ method ] = val;
-				}
-			});
-		} else {
+	jQuery.fn[ method ] = function( val ) {
+		var elem, win;
+
+		if ( val === undefined ) {
+			elem = this[ 0 ];
+
+			if ( !elem ) {
+				return null;
+			}
+
 			win = getWindow( elem );
 
@@ -6168,9 +8839,24 @@
 				elem[ method ];
 		}
+
+		// Set the scroll offset
+		return this.each(function() {
+			win = getWindow( this );
+
+			if ( win ) {
+				win.scrollTo(
+					!i ? val : jQuery( win ).scrollLeft(),
+					 i ? val : jQuery( win ).scrollTop()
+				);
+
+			} else {
+				this[ method ] = val;
+			}
+		});
 	};
 });
 
 function getWindow( elem ) {
-	return ("scrollTo" in elem && elem.document) ?
+	return jQuery.isWindow( elem ) ?
 		elem :
 		elem.nodeType === 9 ?
@@ -6178,4 +8864,8 @@
 			false;
 }
+
+
+
+
 // Create innerHeight, innerWidth, outerHeight and outerWidth methods
 jQuery.each([ "Height", "Width" ], function( i, name ) {
@@ -6186,5 +8876,5 @@
 	jQuery.fn["inner" + name] = function() {
 		return this[0] ?
-			jQuery.css( this[0], type, false, "padding" ) :
+			parseFloat( jQuery.css( this[0], type, "padding" ) ) :
 			null;
 	};
@@ -6193,5 +8883,5 @@
 	jQuery.fn["outer" + name] = function( margin ) {
 		return this[0] ?
-			jQuery.css( this[0], type, false, margin ? "margin" : "border" ) :
+			parseFloat( jQuery.css( this[0], type, margin ? "margin" : "border" ) ) :
 			null;
 	};
@@ -6203,5 +8893,5 @@
 			return size == null ? null : this;
 		}
-		
+
 		if ( jQuery.isFunction( size ) ) {
 			return this.each(function( i ) {
@@ -6211,30 +8901,36 @@
 		}
 
-		return ("scrollTo" in elem && elem.document) ? // does it walk and quack like a window?
+		if ( jQuery.isWindow( elem ) ) {
 			// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
-			elem.document.compatMode === "CSS1Compat" && elem.document.documentElement[ "client" + name ] ||
-			elem.document.body[ "client" + name ] :
-
-			// Get document width or height
-			(elem.nodeType === 9) ? // is it a document
-				// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
-				Math.max(
-					elem.documentElement["client" + name],
-					elem.body["scroll" + name], elem.documentElement["scroll" + name],
-					elem.body["offset" + name], elem.documentElement["offset" + name]
-				) :
-
-				// Get or set width or height on the element
-				size === undefined ?
-					// Get width or height on the element
-					jQuery.css( elem, type ) :
-
-					// Set the width or height on the element (default to pixels if value is unitless)
-					this.css( type, typeof size === "string" ? size : size + "px" );
+			// 3rd condition allows Nokia support, as it supports the docElem prop but not CSS1Compat
+			var docElemProp = elem.document.documentElement[ "client" + name ];
+			return elem.document.compatMode === "CSS1Compat" && docElemProp ||
+				elem.document.body[ "client" + name ] || docElemProp;
+
+		// Get document width or height
+		} else if ( elem.nodeType === 9 ) {
+			// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+			return Math.max(
+				elem.documentElement["client" + name],
+				elem.body["scroll" + name], elem.documentElement["scroll" + name],
+				elem.body["offset" + name], elem.documentElement["offset" + name]
+			);
+
+		// Get or set width or height on the element
+		} else if ( size === undefined ) {
+			var orig = jQuery.css( elem, type ),
+				ret = parseFloat( orig );
+
+			return jQuery.isNaN( ret ) ? orig : ret;
+
+		// Set the width or height on the element (default to pixels if value is unitless)
+		} else {
+			return this.css( type, typeof size === "string" ? size : size + "px" );
+		}
 	};
 
 });
-// Expose jQuery to the global object
+
+
 window.jQuery = window.$ = jQuery;
-
 })(window);
Index: admin/js/jquery/jquery.oembed.js
===================================================================
--- admin/js/jquery/jquery.oembed.js	(revision 412)
+++ admin/js/jquery/jquery.oembed.js	(revision 412)
@@ -0,0 +1,413 @@
+(function() {
+	var settings = {
+		maxWidth: null,
+		maxHeight: null,
+		embedMethod: 'auto',			// auto|append|replace
+		defaultOEmbedProvider: 'embed.ly',	// oohembed|embed.ly|none
+		allowedProviders: null,
+		disallowedProviders: null,
+		customProviders: null,			// [ new $.oembed('OEmbedProvider','customprovider', null, ['customprovider\\.com/watch.+v=[\\w-]+&?']) ]
+		greedy: false,
+		onProviderNotFound: function() {},
+		beforeEmbed: function() {},
+		afterEmbed: function() {},
+		onEmbed: function() {},
+		onError: function() {},
+		ajaxOptions: {}
+	};
+	
+	var publicMethods = {
+		init: function(url,options) {
+			$.extend(settings,options);
+			
+			internalMethods._init();
+			
+			return this.each(function(){
+				var container = $(this);
+				var resourceURL = (url != null) ? url : container.attr('href');
+				var provider = null;
+				
+				if (!options.onEmbed) {
+					settings.onEmbed = function (data) {
+						internalMethods._insertCode(this,settings.embedMethod,data);
+					};
+				}
+				
+				if (resourceURL != null) {
+					provider = publicMethods.getOEmbedProvider(resourceURL);
+					
+					if (provider != null) {
+						provider.params = internalMethods._getNormalizedParams(settings[provider.name]) || {};
+						provider.maxWidth = settings.maxWidth;
+						provider.maxHeight = settings.maxHeight;
+						internalMethods._doRequest(container,resourceURL,provider);
+					} else {
+						settings.onProviderNotFound.call(container, resourceURL);
+					}
+				}
+				
+				return container;
+			});
+		},
+		
+		OEmbedProvider: function(name,type,urlschemes,apiendpoint,callbackparameter) {
+			this.name = name;
+			this.type = type; // 'photo', 'video', 'link', 'rich', null
+			this.urlschemes = getUrlSchemes(urlschemes);
+			this.apiendpoint = apiendpoint;
+			this.callbackparameter = callbackparameter;
+			this.maxWidth = 500;
+			this.maxHeight = 400;
+			this.enable = true;
+			var i, property, regExp;
+			
+			this.matches = function (externalUrl) {
+				for (i = 0; i < this.urlschemes.length; i++) {
+					regExp = new RegExp(this.urlschemes[i], 'i');
+					if (externalUrl.match(regExp) != null) {
+						return true;
+					}
+				}
+				return false;
+			};
+			
+			this.fromJSON = function (json) {
+				for (property in json) {
+					if (property != 'urlschemes') {
+						this[property] = json[property];
+					} else {
+						this[property] = getUrlSchemes(json[property]);
+					}
+				}
+				return true;
+			};
+			
+			function getUrlSchemes(urls) {
+				if (internalMethods._isNullOrEmpty(urls)) {
+					return ['.'];
+				}
+				if ($.isArray(urls)) {
+					return urls;
+				}
+				return urls.split(';');
+			}
+		},
+		
+		getOEmbedProvider: function(url) {
+			for (var i = 0; i < providers.length; i++) {
+				if (providers[i].matches(url)) {
+					return providers[i];
+				}
+			}
+			return null;
+		}
+	};
+	
+	var internalMethods = {
+		_doRequest: function(container,url,embedProvider) {
+			$.ajax($.extend({
+				url: internalMethods._getRequestUrl(embedProvider,url),
+				type: 'get',
+				dataType: 'json',
+				cache: false,
+				timeout: 10000,
+				success:  function (data) {
+					var data = $.extend({
+						type: null,
+						version: null,
+						title: null,
+						author_name: null,
+						author_url: null,
+						provider_name: null,
+						provider_url: null,
+						cache_age: null,
+						thumbnail_url: null,
+						thumbnail_width: null,
+						thumbnail_height: null,
+						url: null,
+						width: null,
+						height: null,
+						html: null,
+						code: null
+					}, data);
+					switch (data.type) {
+						case 'photo':
+							data.code = internalMethods._getPhotoCode(data);
+							break;
+						case 'video':
+							data.code = internalMethods._getVideoCode(data);
+							break;
+						case 'rich':
+							data.code = internalMethods._getRichCode(data);
+							break;
+						case 'link':
+							data.code = internalMethods._getLinkCode(data);
+							break;
+						case 'error':
+							settings.onError.call(null,data.error_code,data.error_message);
+							break;
+					}
+					settings.beforeEmbed.call(container,data);
+					settings.onEmbed.call(container,data);
+					settings.afterEmbed.call(container,data);
+				},
+				error: settings.onError
+			},settings.ajaxOptions || {}));
+		},
+		
+		_insertCode: function(container,method,data) {
+			if (data.type == null && data.code == null) {
+				return;
+			}
+			
+			switch (method) {
+				case 'auto':
+					if (container.attr('href') == null) {
+						internalMethods._insertCode(container,'append',data);
+					}
+					else {
+						internalMethods._insertCode(container,'replace',data);
+					};
+					break;
+				case 'replace':
+					container.replaceWith(data.code);
+					break;
+				case 'append':
+					container.html(data.code);
+					break;
+			}
+		},
+		
+		_getPhotoCode: function(data) {
+			var href = null;
+			var title = null;
+			var alt = new Array();
+			
+			href = data.thumbnail_url ? data.thumbnail_url : data.url;
+			title = data.title ? data.title : '';
+			
+			if (data.provider_name) alt.push(data.provider_name);
+			if (data.author_name) alt.push(data.author_name);
+			if (data.title) alt.push(data.title);
+			
+			return $('<div>').append($('<a>').attr({
+				'href': data.url,
+				'title': title
+			}).append($('<img>').attr({
+				'src': href,
+				'title': title,
+				'alt': alt.join(' - ')
+			}))).html();
+		},
+		
+		_getVideoCode: function(data) {
+			return internalMethods._getValidHXHTMLCode(data.html,data);
+		},
+		
+		_getRichCode: function(data) {
+			return internalMethods._getValidHXHTMLCode(data.html,data);
+		},
+		
+		_getLinkCode: function(data) {
+			var title = null;
+			var alt = new Array();
+			
+			title = data.title ? data.title : '';
+			
+			if (data.provider_name) alt.push(data.provider_name);
+			if (data.author_name) alt.push(data.author_name);
+			if (data.title) alt.push(data.title);
+			
+			return $('<div>').append($('<a>').attr({
+				'href': data.url,
+				'title': title
+			}).append(title)).html();
+		},
+		
+		_getValidHXHTMLCode: function(html,data) {
+			var xhtml = '';
+			var alt = new Array();
+			if (data.provider_name) alt.push(data.provider_name);
+			if (data.author_name) alt.push(data.author_name);
+			if (data.title) alt.push(data.title);
+			
+			$(html).each(function() {
+				if (this.tagName == 'IFRAME') {
+					var attr = {
+						'src': 'data',
+						'width': 'width',
+						'height': 'height'
+					};
+					var attributes = this.attributes;
+					object = $('<object>');
+					object.attr('type','text/html');
+					for (i in attributes) {
+						if (attr.hasOwnProperty(attributes[i].name)) {
+							object.attr(attr[attributes[i].name],attributes[i].value);
+						}
+					}
+					xhtml += $('<div>').append(object.html(alt.join(' - '))).html();
+				} 
+				else if (this.tagName == 'OBJECT') {
+					if ($(this).find('embed').size() > 0) {
+						var embed = $(this).find('embed').get(0);
+						if ($.inArray('src',embed.attributes)) {
+							$(this).attr('data',embed.attributes.src.nodeValue);
+						}
+						if ($.inArray('type',embed.attributes)) {
+							$(this).attr('type',embed.attributes.type.nodeValue);
+						}
+						$(this).find('embed').remove();
+					}
+					xhtml += $('<div>').append($(this).html(alt.join(' - '))).html();
+				} else {
+					xhtml += internalMethods._getValidHXHTMLCode($('<div>').append($(html).find('iframe,object')).html(),data);
+				}
+			});
+			
+			return xhtml;
+		},
+		
+		_init: function() {
+			var provider;
+			var i;
+			
+			// If there are allowed providers, jQuery oembed can not be greedy
+			if (!internalMethods._isNullOrEmpty(settings.allowedProviders)) {
+				settings.greedy = false;
+			}
+			
+			// If there are allowed providers, jQuery oembed can not be greedy
+			// Disabled also providers
+			if (!internalMethods._isNullOrEmpty(settings.disallowedProviders)) {
+				for (i = 0; i < providers.length; i++) {
+					if ($.inArray(providers[i].name,settings.disallowedProviders)) {
+						provider.enable = false;
+					}
+				}
+				settings.greedy = false;
+			}
+			
+			if (!internalMethods._isNullOrEmpty(settings.customProviders)) {
+				$.each(settings.customProviders, function(n,customProvider) {
+					if (customProvider instanceof publicMethods.OEmbedProvider) {
+						providers.push(provider);
+					} else {
+						provider = new publicMethods.OEmbedProvider();
+						if (provider.fromJSON(customProvider)) {
+							providers.push(provider);
+						}
+					}
+				});
+			}
+			
+			// If in greedy mode, we add the default provider
+			defaultProvider = internalMethods._getDefaultOEmbedProvider(settings.defaultOEmbedProvider);
+			if (settings.greedy) {
+				providers.push(defaultProvider);
+			}
+			
+			// If any provider has no apiendpoint, we use the default provider endpoint
+			for (i = 0; i < providers.length; i++) {
+				if (providers[i].enable && providers[i].apiendpoint == null) {
+					providers[i].apiendpoint = defaultProvider.apiendpoint;
+				}
+			}
+		},
+		
+		_getDefaultOEmbedProvider: function(defaultOEmbedProvider) {
+			var url = 'http://oohembed.com/oohembed/';
+			if (defaultOEmbedProvider == 'embed.ly') {
+				url = 'http://api.embed.ly/v1/api/oembed?';
+			}
+			return new publicMethods.OEmbedProvider(defaultOEmbedProvider,null,null,url,'callback');
+		},
+		
+		_getRequestUrl: function(provider,externalUrl) {
+			var url = provider.apiendpoint, qs = "", callbackparameter = provider.callbackparameter || 'callback', i;
+			
+			if (url.indexOf('?') <= 0) {
+				url = url + '?';
+			} else {
+				url = url + '&';
+			}
+			
+			if (provider.maxWidth != null && provider.params['maxwidth'] == null) {
+				provider.params['maxwidth'] = provider.maxWidth;
+			}
+			
+			if (provider.maxHeight != null && provider.params['maxheight'] == null) {
+				provider.params['maxheight'] = provider.maxHeight;
+			}
+			
+			for (i in provider.params) {
+				// We don't want them to jack everything up by changing the callback parameter
+				if (i == provider.callbackparameter) {
+					continue;
+				}
+				
+				// allows the options to be set to null, don't send null values to the server as parameters
+				if (provider.params[i] != null) {
+					qs += '&' + escape(i) + '=' + provider.params[i];
+				}
+			}
+			
+			url += 'format=json&url=' + escape(externalUrl) +
+			qs +
+			'&' + callbackparameter + '=?';
+			
+			return url;
+		},
+		
+		_getNormalizedParams: function(params) {
+			if (params == null) {
+				return null;
+			}
+			
+			var key;
+			var normalizedParams = {};
+			
+			for (key in params) {
+				if (key != null) {
+					normalizedParams[key.toLowerCase()] = params[key];
+				}
+			}
+			return normalizedParams;
+		},
+		
+		_isNullOrEmpty: function(object) {
+			if (typeof object == 'undefined') {
+				return true;
+			} else if (object == null) {
+				return true;
+			} else if ($.isArray(object) && object.length == 0) {
+				return true;
+			} else {
+				return false;
+			}
+		}
+	};
+	
+	var providers = [
+		new publicMethods.OEmbedProvider('youtube', 'video', ['youtube\\.com/watch.+v=[\\w-]+&?', 'youtu\\.be/.*']), // 'http://www.youtube.com/oembed'	(no jsonp)
+		new publicMethods.OEmbedProvider('flickr', 'photo', ['flickr\\.com/photos/[-.\\w@]+/\\d+/?'], 'http://flickr.com/services/oembed', 'jsoncallback'),
+		new publicMethods.OEmbedProvider('viddler', 'video', ['viddler\.com']), // 'http://lab.viddler.com/services/oembed/' (no jsonp)
+		new publicMethods.OEmbedProvider('blip', 'video', ['blip\\.tv/.+'], 'http://blip.tv/oembed/'),
+		new publicMethods.OEmbedProvider('hulu', 'video', ['hulu\\.com/watch/.*'], 'http://www.hulu.com/api/oembed.json'),
+		new publicMethods.OEmbedProvider('vimeo', 'video', ['http:\/\/www\.vimeo\.com\/groups\/.*\/videos\/.*', 'http:\/\/www\.vimeo\.com\/.*', 'http:\/\/vimeo\.com\/groups\/.*\/videos\/.*', 'http:\/\/vimeo\.com\/.*'], 'http://vimeo.com/api/oembed.json'),
+		new publicMethods.OEmbedProvider('dailymotion', 'video', ['dailymotion\\.com/.+']), // 'http://www.dailymotion.com/api/oembed/' (callback parameter does not return jsonp)
+		new publicMethods.OEmbedProvider('scribd', 'rich', ['scribd\\.com/.+']), // ', 'http://www.scribd.com/services/oembed'' (no jsonp)		
+		new publicMethods.OEmbedProvider('slideshare', 'rich', ['slideshare\.net'], 'http://www.slideshare.net/api/oembed/1'),
+		new publicMethods.OEmbedProvider('photobucket', 'photo', ['photobucket\\.com/(albums|groups)/.*'], 'http://photobucket.com/oembed/')
+	];
+	
+	$.fn.oembed = function(method) {
+		if (publicMethods[method]) {
+			return publicMethods[method].apply(this,Array.prototype.slice.call(arguments,1));
+		} else if (typeof method === 'string' || !method) {
+			return publicMethods.init.apply(this,arguments);
+		} else {
+			$.error('Method ' + method + ' does not exist on jQuery.oembed');
+		}
+	};
+})(jQuery)
Index: admin/js/jquery/jquery.pageTabs.js
===================================================================
--- admin/js/jquery/jquery.pageTabs.js	(revision 297)
+++ admin/js/jquery/jquery.pageTabs.js	(revision 0)
@@ -9,7 +9,7 @@
 		breakerClassName: 'clear'
 	};
-
+	
 	var index = start_tab ? start_tab : 0;
-
+	
 	this.params = jQuery.extend(defaults,settings);
 	this.divs = jQuery('div.'+this.params.className);
@@ -20,10 +20,10 @@
 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;
@@ -32,5 +32,5 @@
 		this.block.appendChild(this.list);
 		var li, a;
-
+		
 		var This = this;
 		var i=0;
@@ -57,30 +57,30 @@
 			}
 		});
-
+		
 		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);
+				jQuery(this).show();
 				This.items[i].className = This.params.listClassName+'-active';
 				to_trigger = i;
 			} else {
-				jQuery(this).hide(0, positionFooter);
+				jQuery(this).hide();
 				This.items[i].className = '';
 			}
-
+			
 			i++;
 		});
-
+		
 		if (to_trigger != null) {
 			jQuery(this.divs[to_trigger]).onetabload();
Index: admin/js/jsToolBar/jsToolBar.js
===================================================================
--- admin/js/jsToolBar/jsToolBar.js	(revision 530)
+++ admin/js/jsToolBar/jsToolBar.js	(revision 307)
@@ -44,15 +44,18 @@
 	
 	// Dragable resizing (only for gecko)
-	if (navigator.appName == 'Microsoft Internet Explorer')
+	if (this.editor.addEventListener)
 	{
-		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.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);
+		// fix memory leak in Firefox (bug #241518)
+		window.addEventListener('unload',function() {
+				var del = This.handle.parentNode.removeChild(This.handle);
+				delete(This.handle);
+		},false);
+		
+		this.editor.parentNode.insertBefore(this.handle,this.editor.nextSibling);
 	}
 	
@@ -154,4 +157,16 @@
 		mode = mode || 'xhtml';
 		this.draw(mode);
+	},
+	
+	remove: function() {
+		// Empty toolbar
+		while (this.toolbar.hasChildNodes()) {
+			this.toolbar.removeChild(this.toolbar.firstChild)
+		}
+		this.toolbar.parentNode.appendChild(this.textarea);
+		this.toolbar.parentNode.removeChild(this.handle);
+		this.toolbar.parentNode.removeChild(this.editor);
+		this.toolbar.parentNode.removeChild(this.toolbar);
+		this.toolNodes = {}; // vide les raccourcis DOM/**/
 	},
 	
Index: admin/js/prelude.js
===================================================================
--- admin/js/prelude.js	(revision 447)
+++ 	(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: admin/js/tiny_mce/langs/en.js
===================================================================
--- admin/js/tiny_mce/langs/en.js	(revision 307)
+++ admin/js/tiny_mce/langs/en.js	(revision 307)
@@ -0,0 +1,223 @@
+tinyMCE.addI18n({en:{
+common:{
+edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?",
+apply:"Apply",
+insert:"Insert",
+update:"Update",
+cancel:"Cancel",
+close:"Close",
+browse:"Browse",
+class_name:"Class",
+not_set:"-- Not set --",
+clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",
+clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",
+popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",
+invalid_data:"{#field} is invalid",
+invalid_data_number:"{#field} must be a number",
+invalid_data_min:"{#field} must be a number greater than {#min}",
+invalid_data_size:"{#field} must be a number or percentage",
+more_colors:"More colors"
+},
+colors:{
+'000000':'Black',
+'993300':'Burnt orange',
+'333300':'Dark olive',
+'003300':'Dark green',
+'003366':'Dark azure',
+'000080':'Navy Blue',
+'333399':'Indigo',
+'333333':'Very dark gray',
+'800000':'Maroon',
+'FF6600':'Orange',
+'808000':'Olive',
+'008000':'Green',
+'008080':'Teal',
+'0000FF':'Blue',
+'666699':'Grayish blue',
+'808080':'Gray',
+'FF0000':'Red',
+'FF9900':'Amber',
+'99CC00':'Yellow green',
+'339966':'Sea green',
+'33CCCC':'Turquoise',
+'3366FF':'Royal blue',
+'800080':'Purple',
+'999999':'Medium gray',
+'FF00FF':'Magenta',
+'FFCC00':'Gold',
+'FFFF00':'Yellow',
+'00FF00':'Lime',
+'00FFFF':'Aqua',
+'00CCFF':'Sky blue',
+'993366':'Brown',
+'C0C0C0':'Silver',
+'FF99CC':'Pink',
+'FFCC99':'Peach',
+'FFFF99':'Light yellow',
+'CCFFCC':'Pale green',
+'CCFFFF':'Pale cyan',
+'99CCFF':'Light sky blue',
+'CC99FF':'Plum',
+'FFFFFF':'White'
+},
+contextmenu:{
+align:"Alignment",
+left:"Left",
+center:"Center",
+right:"Right",
+full:"Full"
+},
+insertdatetime:{
+date_fmt:"%Y-%m-%d",
+time_fmt:"%H:%M:%S",
+insertdate_desc:"Insert date",
+inserttime_desc:"Insert time",
+months_long:"January,February,March,April,May,June,July,August,September,October,November,December",
+months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
+day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
+day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"
+},
+print:{
+print_desc:"Print"
+},
+preview:{
+preview_desc:"Preview"
+},
+directionality:{
+ltr_desc:"Direction left to right",
+rtl_desc:"Direction right to left"
+},
+layer:{
+insertlayer_desc:"Insert new layer",
+forward_desc:"Move forward",
+backward_desc:"Move backward",
+absolute_desc:"Toggle absolute positioning",
+content:"New layer..."
+},
+save:{
+save_desc:"Save",
+cancel_desc:"Cancel all changes"
+},
+nonbreaking:{
+nonbreaking_desc:"Insert non-breaking space character"
+},
+iespell:{
+iespell_desc:"Run spell checking",
+download:"ieSpell not detected. Do you want to install it now?"
+},
+advhr:{
+advhr_desc:"Horizontal rule"
+},
+emotions:{
+emotions_desc:"Emotions"
+},
+searchreplace:{
+search_desc:"Find",
+replace_desc:"Find/Replace"
+},
+advimage:{
+image_desc:"Insert/edit image"
+},
+advlink:{
+link_desc:"Insert/edit link"
+},
+xhtmlxtras:{
+cite_desc:"Citation",
+abbr_desc:"Abbreviation",
+acronym_desc:"Acronym",
+del_desc:"Deletion",
+ins_desc:"Insertion",
+attribs_desc:"Insert/Edit Attributes"
+},
+style:{
+desc:"Edit CSS Style"
+},
+paste:{
+paste_text_desc:"Paste as Plain Text",
+paste_word_desc:"Paste from Word",
+selectall_desc:"Select All",
+plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.",
+plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode."
+},
+paste_dlg:{
+text_title:"Use CTRL+V on your keyboard to paste the text into the window.",
+text_linebreaks:"Keep linebreaks",
+word_title:"Use CTRL+V on your keyboard to paste the text into the window."
+},
+table:{
+desc:"Inserts a new table",
+row_before_desc:"Insert row before",
+row_after_desc:"Insert row after",
+delete_row_desc:"Delete row",
+col_before_desc:"Insert column before",
+col_after_desc:"Insert column after",
+delete_col_desc:"Remove column",
+split_cells_desc:"Split merged table cells",
+merge_cells_desc:"Merge table cells",
+row_desc:"Table row properties",
+cell_desc:"Table cell properties",
+props_desc:"Table properties",
+paste_row_before_desc:"Paste table row before",
+paste_row_after_desc:"Paste table row after",
+cut_row_desc:"Cut table row",
+copy_row_desc:"Copy table row",
+del:"Delete table",
+row:"Row",
+col:"Column",
+cell:"Cell"
+},
+autosave:{
+unload_msg:"The changes you made will be lost if you navigate away from this page.",
+restore_content:"Restore auto-saved content.",
+warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?."
+},
+fullscreen:{
+desc:"Toggle fullscreen mode"
+},
+media:{
+desc:"Insert / edit embedded media",
+edit:"Edit embedded media"
+},
+fullpage:{
+desc:"Document properties"
+},
+template:{
+desc:"Insert predefined template content"
+},
+visualchars:{
+desc:"Visual control characters on/off."
+},
+spellchecker:{
+desc:"Toggle spellchecker",
+menu:"Spellchecker settings",
+ignore_word:"Ignore word",
+ignore_words:"Ignore all",
+langs:"Languages",
+wait:"Please wait...",
+sug:"Suggestions",
+no_sug:"No suggestions",
+no_mpell:"No misspellings found.",
+learn_word:"Learn word" 
+},
+pagebreak:{
+desc:"Insert page break."
+},
+advlist:{
+types:"Types",
+def:"Default",
+lower_alpha:"Lower alpha",
+lower_greek:"Lower greek",
+lower_roman:"Lower roman",
+upper_alpha:"Upper alpha",
+upper_roman:"Upper roman",
+circle:"Circle",
+disc:"Disc",
+square:"Square"
+},
+aria:{
+rich_text_area:"Rich Text Area"
+},
+wordcount:{
+words: 'Words: '
+}
+}});
Index: admin/js/tiny_mce/license.txt
===================================================================
--- admin/js/tiny_mce/license.txt	(revision 307)
+++ admin/js/tiny_mce/license.txt	(revision 307)
@@ -0,0 +1,504 @@
+		  GNU LESSER GENERAL PUBLIC LICENSE
+		       Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+		  GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library 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
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
Index: admin/js/tiny_mce/plugins/dcControls/editor_plugin.js
===================================================================
--- admin/js/tiny_mce/plugins/dcControls/editor_plugin.js	(revision 445)
+++ admin/js/tiny_mce/plugins/dcControls/editor_plugin.js	(revision 445)
@@ -0,0 +1,144 @@
+(function() {
+	tinymce.create('tinymce.plugins.dcControls',{
+		// Init.
+		init: function(ed, url) {
+			var t = this;
+			var popup_link_url = 'popup_link.php';
+			var popup_media_url = 'media.php?popup=1';
+			var popup_web_media_url = 'popup_web_media.php';
+			
+			t.editor = ed;
+			
+			// Register commands
+			ed.addCommand('dcCode', function() {
+				ed.formatter.toggle('inlinecode');
+			});
+			ed.addCommand('dcQuote', function() {
+				ed.formatter.toggle('quote');
+			});
+			ed.addCommand('dcLink', function() {
+				var se = ed.selection;
+				
+				// No selection and not in link
+				if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))
+					return;
+				
+				var url = popup_link_url;
+				var node = ed.dom.getParent(se.getNode(), 'A');
+				
+				if (node == null) {
+					node = se.getNode();
+				}
+				
+				if (node.nodeName == 'A') {
+					var href= node.href || '';
+					var title = node.title || '';
+					var hreflang = node.hreflang || '';
+					url += '?href='+href+'&hreflang='+hreflang+'&title='+title;
+				}
+				ed.windowManager.open({
+					file: url,
+					width: 760,
+					height: 500,
+					inline: 1,
+					dc_popup: '',
+					alwaysRaised: 'yes',
+					dependent: 'yes',
+					toolbar: 'yes',
+					menubar: 'no',
+					resizable: 'yes',
+					scrollbars: 'yes',
+					status: 'no'
+				}, {
+					plugin_url : url
+				});
+			});
+			ed.addCommand('dcMedia', function() {
+				ed.windowManager.open({
+					file: popup_media_url,
+					width: 760,
+					height: 500,
+					inline: 1,
+					dc_popup: '',
+					alwaysRaised: 'yes',
+					dependent: 'yes',
+					toolbar: 'yes',
+					menubar: 'no',
+					resizable: 'yes',
+					scrollbars: 'yes',
+					status: 'no'
+				}, {
+					plugin_url : url
+				});
+			});
+			ed.addCommand('dcWebMedia', function() {
+				ed.windowManager.open({
+					file: popup_web_media_url,
+					width: 800,
+					height: 650,
+					inline: 1,
+					dc_popup: '',
+					alwaysRaised: 'yes',
+					dependent: 'yes',
+					toolbar: 'yes',
+					menubar: 'no',
+					resizable: 'yes',
+					scrollbars: 'yes',
+					status: 'no'
+				}, {
+					plugin_url : url
+				});
+			});
+			
+			// Register buttons
+			ed.addButton('inlinecode', {
+				title: 'dcControls.inlinecode_desc',
+				cmd: 'dcCode'
+			});
+			ed.addButton('quote', {
+				title: 'dcControls.quote_desc',
+				cmd: 'dcQuote'
+			});
+			ed.addButton('link', {
+				title: 'advanced.link_desc',
+				cmd: 'dcLink'
+			});
+			ed.addButton('media', {
+				title: 'dcControls.media_desc',
+				cmd: 'dcMedia'
+			});
+			ed.addButton('webmedia', {
+				title: 'dcControls.webmedia_desc',
+				cmd: 'dcWebMedia'
+			});
+			
+			// Init shortcuts
+			for (var s in ed.shortcuts) {
+				delete ed.shortcuts[s];
+			}
+			// Register shortcuts
+			ed.addShortcut('ctrl+alt+l', 'dcControls.link_desc', 'dcLink');
+			ed.addShortcut('ctrl+alt+m', 'dcControls.media_desc', 'dcMedia');
+			ed.addShortcut('ctrl+alt+w', 'dcControls.media_desc', 'dcWebMedia');
+			
+			// Register changes management
+			ed.onNodeChange.add(function(ed, cm, n, co) {
+				cm.setActive('inlinecode', n.nodeName == 'CODE' || ed.dom.getParent(n,'CODE'));
+				cm.setActive('quote', n.nodeName == 'Q' || ed.dom.getParent(n,'Q'));
+			});
+		},
+		
+		getInfo: function() {
+			return {
+				longname: 'Dotclear custom controls',
+				author: 'Tomtom for dotclear',
+				authorurl: 'http://dotclear.org',
+				infourl: '',
+				version: tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
+	
+	// Register plugin
+	tinymce.PluginManager.add('dcControls',tinymce.plugins.dcControls);
+})();
Index: admin/js/tiny_mce/plugins/dcControls/js/popup_link.js
===================================================================
--- admin/js/tiny_mce/plugins/dcControls/js/popup_link.js	(revision 329)
+++ admin/js/tiny_mce/plugins/dcControls/js/popup_link.js	(revision 329)
@@ -0,0 +1,72 @@
+tinyMCEPopup.requireLangPack();
+
+var popup_link = {
+	init: function() {
+		$('#div-entries h4').toggleWithLegend($('#div-entries').children().not('h4'),{
+			cookie: 'dcx_div_entries'
+		});
+		
+		$('#form-entries tr>td.maximal>a').click(function() {
+			$('#href').val($(this).attr('title'));
+			$('#title').val($(this).html());
+			return false;
+		});
+		
+		$('#link-insert-ok').click(function(){
+			var ed = tinyMCEPopup.editor;
+			var formatter = ed.getParam('formatter');
+			var node = ed.selection.getNode();
+			var href = $('#href').val();
+			var title = $('#title').val();
+			var hreflang = $('#hreflang').val();
+			
+			// href attribue is mandatory
+			if (href == '') {
+				$('#href').focus();
+				$('#href').backgroundFade({sColor:'#ffffff',eColor:'#ff9999',steps:50},function() {
+					$(this).backgroundFade({sColor:'#ff9999',eColor:'#ffffff'});
+				});
+				return false;
+			}
+			
+			node = ed.dom.getParent(node, 'A');
+			
+			// Insert link
+			if (node == null) {
+				ed.getDoc().execCommand('unlink', false, null);
+				tinyMCEPopup.execCommand('mceInsertLink', false, '#mce_temp_url#', {skip_undo : 1});
+		
+				elementArray = tinymce.grep(ed.dom.select("a"),function(n) {return ed.dom.getAttrib(n,'href') == '#mce_temp_url#';});
+				for (i=0; i<elementArray.length; i++) {
+					node = elementArray[i];
+					ed.dom.setAttrib(node,'href',href);
+					ed.dom.setAttrib(node,'title',title);
+					ed.dom.setAttrib(node,'hreflang',hreflang);
+				}
+			}
+			// Update link
+			else {
+				ed.dom.setAttrib(node,'href',href);
+				ed.dom.setAttrib(node,'title',title);
+				ed.dom.setAttrib(node,'hreflang',hreflang);
+			}
+			
+			// Don't move caret if selection was image
+			if (node.childNodes.length != 1 || node.firstChild.nodeName != 'IMG') {
+				ed.focus();
+				ed.selection.select(node);
+				ed.selection.collapse(0);
+				tinyMCEPopup.storeSelection();
+			}
+		
+			tinyMCEPopup.execCommand('mceEndUndoLevel');
+			tinyMCEPopup.close();
+		});
+		
+		$('#link-insert-cancel').click(function(){
+			tinyMCEPopup.close();
+		});
+	}
+};
+
+tinyMCEPopup.onInit.add(popup_link.init, popup_link);
Index: admin/js/tiny_mce/plugins/dcControls/js/popup_media.js
===================================================================
--- admin/js/tiny_mce/plugins/dcControls/js/popup_media.js	(revision 410)
+++ admin/js/tiny_mce/plugins/dcControls/js/popup_media.js	(revision 410)
@@ -0,0 +1,120 @@
+tinyMCEPopup.requireLangPack();
+
+var popup_media = {
+	init: function() {
+		$('#media-insert-ok').click(function() {
+			// Internal vars
+			var ed = tinyMCEPopup.editor;
+			var formatter = ed.getParam('formatter');
+			var node = ed.selection.getNode();
+			var media_align_grid = {
+				left: 'float: left; margin: 0 1em 1em 0;',
+				right: 'float: right; margin: 0 0 1em 1em;',
+				center: 'text-align: center;'
+			};
+			// Form vars
+			var url = $('input[name="url"]').val();
+			var src = $('input[name="src"]:checked').val();
+			var type = $('input[name="type"]').val();
+			var title = $('input[name="title"]').val();
+			var description = $('input[name="description"]').val();
+			var alignment = $('input[name="alignment"]:checked').val();
+			var insertion = $('input[name="insertion"]:checked').val();
+			var player = $('#public_player').val();
+			var width = $('#video_w').val();
+			var height = $('#video_h').val();
+			
+			if (type == 'image') {
+				var opts_img = {
+					src: src,
+					alt: (description || title),
+					title: title
+				};
+				var opts_a = {
+					href: url,
+					title: opts_img.alt
+				};
+				
+				if (alignment != 'none') {
+					opts_img.style = media_align_grid[alignment];
+				}
+				
+				var res = null;
+				var img = ed.dom.create('img',opts_img);
+				 
+				if (insertion == 'link') {
+					res = ed.dom.createHTML('a',opts_a,ed.dom.getOuterHTML(img));
+				}
+				else {
+					res = ed.dom.getOuterHTML(img);
+				}
+				ed.execCommand('mceInsertContent',false,res,{skip_undo : 1});
+			}
+			else if (type == 'mp3') {
+				var res = null;
+				var opts_div = {
+					class: 'media media-audio'
+				};
+				
+				if (alignment != 'none') {
+					opts_div.style = media_align_grid[alignment];
+				}
+				
+				res = ed.dom.createHTML('div',opts_div,player);
+				
+				ed.execCommand('mceInsertContent',false,res,{skip_undo : 1});
+			}
+			else if (type == 'flv') {
+				var res = null;
+				var opt_div = {
+					class: 'media media-video'
+				};
+				var oplayer = $(player);
+				var flashvars = $('[name="FlashVars"]',player).val();
+				
+				if (title) {
+					flashvars = 'title='+title+'&amp;'+flashvars;
+				}
+				flashvars = flashvars.replace(/(width=\d*)/,'width='+width);
+				flashvars = flashvars.replace(/(height=\d*)/,'height='+height);
+				$('[name="FlashVars"]',oplayer).val(flashvars);
+				
+				oplayer.attr('width',width);
+				oplayer.attr('height',height);
+				
+				if (alignment != 'none') {
+					opt_div.style = media_align_grid[alignment];
+				}
+				
+				res = ed.dom.createHTML('div',opt_div,ed.dom.getOuterHTML(oplayer.get(0)));
+				
+				ed.execCommand('mceInsertContent',false,res,{skip_undo : 1});
+			}
+			else {
+				var res = null;
+				var opts_a = {
+					href: url,
+					title: title
+				};
+				
+				if (alignment != 'none') {
+					opts_a.style = media_align_grid[alignment];
+				}
+				
+				res = ed.dom.createHTML('a',opts_a,(description || title));
+				
+				ed.execCommand('mceInsertContent',false,res,{skip_undo : 1});
+			}
+			
+			ed.execCommand('mceEndUndoLevel');
+			ed.execCommand('mceRepaint');
+			tinyMCEPopup.close();
+		});
+		
+		$('#media-insert-cancel').click(function() {
+			tinyMCEPopup.close();
+		});
+	}
+};
+
+tinyMCEPopup.onInit.add(popup_media.init, popup_media);
Index: admin/js/tiny_mce/plugins/dcControls/js/popup_web_media.js
===================================================================
--- admin/js/tiny_mce/plugins/dcControls/js/popup_web_media.js	(revision 427)
+++ admin/js/tiny_mce/plugins/dcControls/js/popup_web_media.js	(revision 427)
@@ -0,0 +1,168 @@
+tinyMCEPopup.requireLangPack();
+
+var popup_web_media = {
+	oembed_opts: {
+		maxWidth: 450,
+		maxHeight: 400,
+		onProviderNotFound: function(url) {
+			$('#src').removeClass().addClass('error');
+			alert(tinyMCEPopup.editor.getLang('dcControls_dlg.provider_not_supported'));
+		},
+		beforeEmbed: function(data) {
+			if (data.type == 'error') {
+				$('#src').removeClass().addClass('error');
+				$('a.insert').hide();
+			} else {
+				$('#src').removeClass().addClass('success');
+				$('a.insert').show();
+			}
+		},
+		afterEmbed: function(data) {
+			if (data.type != 'error') {
+				var attr = new Array();
+				if (data.provider_name) attr.push(data.provider_name);
+				if (data.author_name) attr.push(data.author_name);
+				if (data.title) attr.push(data.title);
+				
+				$('#alt').val(attr.join(' - '));
+				$('#title').val(data.title);
+				
+				if (data.width) $('#width').val(data.width);
+				if (data.height) $('#height').val(data.height);
+				
+				if (data.type == 'photo') {
+					$('#width').attr('disabled',true);
+					$('#height').attr('disabled',true);
+				} else {
+					$('#width').attr('disabled',false);
+					$('#height').attr('disabled',false);
+				}
+				
+				if (!data.thumbnail_url) {
+					$('input[value="thumbnail"]').attr('disabled',true);
+				} else {
+					$('input[value="thumbnail"]').attr('disabled',false);
+				}
+				
+				$(this).data('data',data);
+				
+				$('div.two-cols').slideDown();
+			}
+		},
+		onError: function(xhr,status,error) {
+			$('#src').removeClass().addClass('error');
+			alert(tinyMCEPopup.editor.getLang('dcControl_dlg.webmedia_no_information'));
+		}
+	},
+	
+	init: function() {
+		$('a.insert').hide();
+		
+		$('#src').focusin(function(e) {
+			$(this).removeClass();
+		}).keypress(function(e) {
+			if (e.keyCode == 13) {
+				$(this).focusout();
+				$('#webmedia-insert-search').click();
+			}
+		});
+		
+		$('#webmedia-insert-search').click(function() {
+			if ($('#src').val() == '') {
+				return;
+			}
+			
+			$('a.insert').hide();
+			
+			$('div.two-cols').slideUp();
+			
+			$('#src').removeClass().addClass('loading');
+			
+			$('#alt,#title,#width,#height').val('');
+			
+			$('div.preview').data('data',null);
+			$('div.preview').oembed($('#src').val(),popup_web_media.oembed_opts);
+		});
+		
+		$('#webmedia-insert-ok').click(function(){
+			var ed = tinyMCEPopup.editor;
+			var media_align_grid = {
+				left: 'float: left; margin: 0 1em 1em 0;',
+				right: 'float: right; margin: 0 0 1em 1em;',
+				center: 'text-align: center;'
+			};
+			var data = $('div.preview').data('data');
+			var alignment = $('input[name=alignment]:checked').val();
+			var insertion = $('input[name="insertion"]:checked').val();
+			var src = $('input[name="src"]').val();
+			var title = $('input[name="title"]').val();
+			var alt = $('input[name="alt"]').val();
+			var width = $('input[name="width"]').val();
+			var height = $('input[name="height"]').val();
+			
+			if (data != null) {
+				var res = null;
+				var opts_div = {
+					class: 'media media-' + data.type
+				};
+				var opts_img = {
+					src: data.thumbnail_url,
+					alt: alt,
+					title: title
+				};
+				var opts_a = {
+					href: src,
+					title: title
+				};
+				
+				switch($('input[name="insertion"]:checked').val()) {
+					case 'media':
+						code = $(data.code).attr({
+							'width': width,
+							'height': height
+						});
+						res = ed.dom.create('div',opts_div,ed.dom.getOuterHTML(code.get(0)))
+						break;
+					case 'thumbnail':
+						var img = ed.dom.create('img',opts_img);
+						res = ed.dom.create('a',opts_a,ed.dom.getOuterHTML(img));
+						break;
+					case 'link':
+						res = ed.dom.create('a',opts_a,alt);
+						break;
+				}
+				
+				if (alignment != 'none') {
+					ed.dom.setAttribs(res,{style: media_align_grid[alignment]});
+				}
+				
+				ed.execCommand('mceInsertContent',false,ed.dom.getOuterHTML(res) + ed.dom.createHTML('p'));
+				ed.execCommand('mceRepaint');
+				tinyMCEPopup.close();
+			} else {
+				alert(tinyMCEPopup.editor.getLang('dcControls_dlg.no_media_loaded'));
+			}
+		});
+		
+		$('#webmedia-insert-cancel').click(function(){
+			tinyMCEPopup.close();
+		});
+	},
+	
+	getOEmbedListInfo: function(data,attr) {
+		var info = $('<ul>');
+		for (i in data) {
+			if (attr.hasOwnProperty(i)) {
+				info.append($('<li>').append(attr[i] + ': ' + data[i]));
+			}
+			
+		}
+		return info;
+	}
+};
+
+function plop(data) {
+	alert(data.type);
+}
+
+tinyMCEPopup.onInit.add(popup_web_media.init, popup_web_media);
Index: admin/js/tiny_mce/plugins/dcwiki/editor_plugin.js
===================================================================
--- admin/js/tiny_mce/plugins/dcwiki/editor_plugin.js	(revision 593)
+++ admin/js/tiny_mce/plugins/dcwiki/editor_plugin.js	(revision 593)
@@ -0,0 +1,120 @@
+(function() {
+	tinymce.create('tinymce.plugins.dcwiki',{
+		// Init.
+		init: function(ed, url) {
+			var t = this;
+			
+			t.editor = ed;
+			
+			ed.onBeforeSetContent.add(function(ed,o) {
+				o.content = t._wiki2html(o.content);
+			});
+			ed.onPostProcess.add(function(ed, o) {
+				if (o.set)
+					o.content = t._wiki2html(o.content);
+				if (o.get)
+					o.content = t._html2wiki(o.content);
+			});
+			
+			// Register commands
+			ed.addCommand('Bold', function() {
+				var s = ed.selection.getContent();
+				var res = '__' + s + '__';
+				
+				ed.execCommand('mceInsertContent',false,res);
+			});
+			ed.addCommand('Italic', function() {
+				var s = ed.selection.getContent();
+				var res = "''" + s + "''";
+				
+				ed.execCommand('mceInsertContent',false,res);
+			});
+			ed.addCommand('Underline', function() {
+				var s = ed.selection.getContent();
+				var res = '++' + s + '++';
+				
+				ed.execCommand('mceInsertContent',false,res);
+			});
+			ed.addCommand('Strikethrough', function() {
+				var s = ed.selection.getContent();
+				var res = '--' + s + '--';
+				
+				ed.execCommand('mceInsertContent',false,res);
+			});
+			ed.addCommand('mceBlockQuote', function() {
+				var s = ed.selection.getContent();
+				var res = '<br />> ' + s;
+				
+				ed.execCommand('mceInsertContent',false,res);
+			});
+			ed.addCommand('InsertUnorderedList', function() {
+				var s = ed.selection.getContent();
+				var res = '*' + s;
+				
+				ed.execCommand('mceInsertContent',false,res);
+			});
+			ed.addCommand('InsertOrderedList', function() {
+				var s = ed.selection.getContent();
+				var res = '#' + s;
+				
+				ed.execCommand('mceInsertContent',false,res);
+			});
+			
+			ed.addCommand('dcCode', function() {
+				var s = ed.selection.getContent();
+				var res = '@@' + s + '@@';
+				
+				ed.execCommand('mceInsertContent',false,res);
+			});
+			ed.addCommand('dcQuote', function() {
+				var s = ed.selection.getContent();
+				var res = '{{' + s + '}}';
+				
+				ed.execCommand('mceInsertContent',false,res);
+			});
+		},
+		
+		getInfo: function() {
+			return {
+				longname: 'Dotclear wiki controls',
+				author: 'Tomtom for dotclear',
+				authorurl: 'http://dotclear.org',
+				infourl: '',
+				version: tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		},
+		
+		// HTML -> Dotclear wiki
+		_html2wiki : function(s) {
+			s = tinymce.trim(s);
+			
+			function rep(re, str) {
+				s = s.replace(re, str);
+			};
+			
+			rep(/<br(\s*\/)?>/gi,"\n");
+			rep(/&lt;/gi,'<');
+			rep(/&gt;/gi,'>');
+			
+			return s;
+		},
+		
+		// Dotclear wiki -> HTML
+		_wiki2html : function(s) {
+			s = tinymce.trim(s);
+			
+			function rep(re, str) {
+				s = s.replace(re, str);
+			};
+			
+			rep(/</gi,'&lt;');
+			rep(/>/gi,'&gt;');
+			rep(/\n/g,'<br />');
+			
+			return s;
+		}
+	});
+	
+	// Register plugin
+	tinymce.PluginManager.add('dcwiki',tinymce.plugins.dcwiki);
+})();
Index: admin/js/tiny_mce/plugins/fullscreen/editor_plugin.js
===================================================================
--- admin/js/tiny_mce/plugins/fullscreen/editor_plugin.js	(revision 307)
+++ admin/js/tiny_mce/plugins/fullscreen/editor_plugin.js	(revision 307)
@@ -0,0 +1,1 @@
+(function(){var a=tinymce.DOM;tinymce.create("tinymce.plugins.FullScreenPlugin",{init:function(d,e){var f=this,g={},c,b;f.editor=d;d.addCommand("mceFullScreen",function(){var i,j=a.doc.documentElement;if(d.getParam("fullscreen_is_enabled")){if(d.getParam("fullscreen_new_window")){closeFullscreen()}else{a.win.setTimeout(function(){tinymce.dom.Event.remove(a.win,"resize",f.resizeFunc);tinyMCE.get(d.getParam("fullscreen_editor_id")).setContent(d.getContent({format:"raw"}),{format:"raw"});tinyMCE.remove(d);a.remove("mce_fullscreen_container");j.style.overflow=d.getParam("fullscreen_html_overflow");a.setStyle(a.doc.body,"overflow",d.getParam("fullscreen_overflow"));a.win.scrollTo(d.getParam("fullscreen_scrollx"),d.getParam("fullscreen_scrolly"));tinyMCE.settings=tinyMCE.oldSettings},10)}return}if(d.getParam("fullscreen_new_window")){i=a.win.open(e+"/fullscreen.htm","mceFullScreenPopup","fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width="+screen.availWidth+",height="+screen.availHeight);try{i.resizeTo(screen.availWidth,screen.availHeight)}catch(h){}}else{tinyMCE.oldSettings=tinyMCE.settings;g.fullscreen_overflow=a.getStyle(a.doc.body,"overflow",1)||"auto";g.fullscreen_html_overflow=a.getStyle(j,"overflow",1);c=a.getViewPort();g.fullscreen_scrollx=c.x;g.fullscreen_scrolly=c.y;if(tinymce.isOpera&&g.fullscreen_overflow=="visible"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&g.fullscreen_overflow=="scroll"){g.fullscreen_overflow="auto"}if(tinymce.isIE&&(g.fullscreen_html_overflow=="visible"||g.fullscreen_html_overflow=="scroll")){g.fullscreen_html_overflow="auto"}if(g.fullscreen_overflow=="0px"){g.fullscreen_overflow=""}a.setStyle(a.doc.body,"overflow","hidden");j.style.overflow="hidden";c=a.getViewPort();a.win.scrollTo(0,0);if(tinymce.isIE){c.h-=1}if(tinymce.isIE6){b="absolute;top:"+c.y}else{b="fixed;top:0"}n=a.add(a.doc.body,"div",{id:"mce_fullscreen_container",style:"position:"+b+";left:0;width:"+c.w+"px;height:"+c.h+"px;z-index:200000;"});a.add(n,"div",{id:"mce_fullscreen"});tinymce.each(d.settings,function(k,l){g[l]=k});g.id="mce_fullscreen";g.width=n.clientWidth;g.height=n.clientHeight-15;g.fullscreen_is_enabled=true;g.fullscreen_editor_id=d.id;g.theme_advanced_resizing=false;g.save_onsavecallback=function(){d.setContent(tinyMCE.get(g.id).getContent({format:"raw"}),{format:"raw"});d.execCommand("mceSave")};tinymce.each(d.getParam("fullscreen_settings"),function(m,l){g[l]=m});if(g.theme_advanced_toolbar_location==="external"){g.theme_advanced_toolbar_location="top"}f.fullscreenEditor=new tinymce.Editor("mce_fullscreen",g);f.fullscreenEditor.onInit.add(function(){f.fullscreenEditor.setContent(d.getContent());f.fullscreenEditor.focus()});f.fullscreenEditor.render();f.fullscreenElement=new tinymce.dom.Element("mce_fullscreen_container");f.fullscreenElement.update();f.resizeFunc=tinymce.dom.Event.add(a.win,"resize",function(){var o=tinymce.DOM.getViewPort(),l=f.fullscreenEditor,k,m;k=l.dom.getSize(l.getContainer().firstChild);m=l.dom.getSize(l.getContainer().getElementsByTagName("iframe")[0]);l.theme.resizeTo(o.w-k.w+m.w,o.h-k.h+m.h)})}});d.addButton("fullscreen",{title:"fullscreen.desc",cmd:"mceFullScreen"});d.onNodeChange.add(function(i,h){h.setActive("fullscreen",i.getParam("fullscreen_is_enabled"))})},getInfo:function(){return{longname:"Fullscreen",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("fullscreen",tinymce.plugins.FullScreenPlugin)})();
Index: admin/js/tiny_mce/plugins/fullscreen/editor_plugin_src.js
===================================================================
--- admin/js/tiny_mce/plugins/fullscreen/editor_plugin_src.js	(revision 307)
+++ admin/js/tiny_mce/plugins/fullscreen/editor_plugin_src.js	(revision 307)
@@ -0,0 +1,159 @@
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(function() {
+	var DOM = tinymce.DOM;
+
+	tinymce.create('tinymce.plugins.FullScreenPlugin', {
+		init : function(ed, url) {
+			var t = this, s = {}, vp, posCss;
+
+			t.editor = ed;
+
+			// Register commands
+			ed.addCommand('mceFullScreen', function() {
+				var win, de = DOM.doc.documentElement;
+
+				if (ed.getParam('fullscreen_is_enabled')) {
+					if (ed.getParam('fullscreen_new_window'))
+						closeFullscreen(); // Call to close in new window
+					else {
+						DOM.win.setTimeout(function() {
+							tinymce.dom.Event.remove(DOM.win, 'resize', t.resizeFunc);
+							tinyMCE.get(ed.getParam('fullscreen_editor_id')).setContent(ed.getContent({format : 'raw'}), {format : 'raw'});
+							tinyMCE.remove(ed);
+							DOM.remove('mce_fullscreen_container');
+							de.style.overflow = ed.getParam('fullscreen_html_overflow');
+							DOM.setStyle(DOM.doc.body, 'overflow', ed.getParam('fullscreen_overflow'));
+							DOM.win.scrollTo(ed.getParam('fullscreen_scrollx'), ed.getParam('fullscreen_scrolly'));
+							tinyMCE.settings = tinyMCE.oldSettings; // Restore old settings
+						}, 10);
+					}
+
+					return;
+				}
+
+				if (ed.getParam('fullscreen_new_window')) {
+					win = DOM.win.open(url + "/fullscreen.htm", "mceFullScreenPopup", "fullscreen=yes,menubar=no,toolbar=no,scrollbars=no,resizable=yes,left=0,top=0,width=" + screen.availWidth + ",height=" + screen.availHeight);
+					try {
+						win.resizeTo(screen.availWidth, screen.availHeight);
+					} catch (e) {
+						// Ignore
+					}
+				} else {
+					tinyMCE.oldSettings = tinyMCE.settings; // Store old settings
+					s.fullscreen_overflow = DOM.getStyle(DOM.doc.body, 'overflow', 1) || 'auto';
+					s.fullscreen_html_overflow = DOM.getStyle(de, 'overflow', 1);
+					vp = DOM.getViewPort();
+					s.fullscreen_scrollx = vp.x;
+					s.fullscreen_scrolly = vp.y;
+
+					// Fixes an Opera bug where the scrollbars doesn't reappear
+					if (tinymce.isOpera && s.fullscreen_overflow == 'visible')
+						s.fullscreen_overflow = 'auto';
+
+					// Fixes an IE bug where horizontal scrollbars would appear
+					if (tinymce.isIE && s.fullscreen_overflow == 'scroll')
+						s.fullscreen_overflow = 'auto';
+
+					// Fixes an IE bug where the scrollbars doesn't reappear
+					if (tinymce.isIE && (s.fullscreen_html_overflow == 'visible' || s.fullscreen_html_overflow == 'scroll'))
+						s.fullscreen_html_overflow = 'auto'; 
+
+					if (s.fullscreen_overflow == '0px')
+						s.fullscreen_overflow = '';
+
+					DOM.setStyle(DOM.doc.body, 'overflow', 'hidden');
+					de.style.overflow = 'hidden'; //Fix for IE6/7
+					vp = DOM.getViewPort();
+					DOM.win.scrollTo(0, 0);
+
+					if (tinymce.isIE)
+						vp.h -= 1;
+
+					// Use fixed position if it exists
+					if (tinymce.isIE6)
+						posCss = 'absolute;top:' + vp.y;
+					else
+						posCss = 'fixed;top:0';
+
+					n = DOM.add(DOM.doc.body, 'div', {
+						id : 'mce_fullscreen_container', 
+						style : 'position:' + posCss + ';left:0;width:' + vp.w + 'px;height:' + vp.h + 'px;z-index:200000;'});
+					DOM.add(n, 'div', {id : 'mce_fullscreen'});
+
+					tinymce.each(ed.settings, function(v, n) {
+						s[n] = v;
+					});
+
+					s.id = 'mce_fullscreen';
+					s.width = n.clientWidth;
+					s.height = n.clientHeight - 15;
+					s.fullscreen_is_enabled = true;
+					s.fullscreen_editor_id = ed.id;
+					s.theme_advanced_resizing = false;
+					s.save_onsavecallback = function() {
+						ed.setContent(tinyMCE.get(s.id).getContent({format : 'raw'}), {format : 'raw'});
+						ed.execCommand('mceSave');
+					};
+
+					tinymce.each(ed.getParam('fullscreen_settings'), function(v, k) {
+						s[k] = v;
+					});
+
+					if (s.theme_advanced_toolbar_location === 'external')
+						s.theme_advanced_toolbar_location = 'top';
+
+					t.fullscreenEditor = new tinymce.Editor('mce_fullscreen', s);
+					t.fullscreenEditor.onInit.add(function() {
+						t.fullscreenEditor.setContent(ed.getContent());
+						t.fullscreenEditor.focus();
+					});
+
+					t.fullscreenEditor.render();
+
+					t.fullscreenElement = new tinymce.dom.Element('mce_fullscreen_container');
+					t.fullscreenElement.update();
+					//document.body.overflow = 'hidden';
+
+					t.resizeFunc = tinymce.dom.Event.add(DOM.win, 'resize', function() {
+						var vp = tinymce.DOM.getViewPort(), fed = t.fullscreenEditor, outerSize, innerSize;
+
+						// Get outer/inner size to get a delta size that can be used to calc the new iframe size
+						outerSize = fed.dom.getSize(fed.getContainer().firstChild);
+						innerSize = fed.dom.getSize(fed.getContainer().getElementsByTagName('iframe')[0]);
+
+						fed.theme.resizeTo(vp.w - outerSize.w + innerSize.w, vp.h - outerSize.h + innerSize.h);
+					});
+				}
+			});
+
+			// Register buttons
+			ed.addButton('fullscreen', {title : 'fullscreen.desc', cmd : 'mceFullScreen'});
+
+			ed.onNodeChange.add(function(ed, cm) {
+				cm.setActive('fullscreen', ed.getParam('fullscreen_is_enabled'));
+			});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Fullscreen',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullscreen',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('fullscreen', tinymce.plugins.FullScreenPlugin);
+})();
Index: admin/js/tiny_mce/plugins/fullscreen/fullscreen.htm
===================================================================
--- admin/js/tiny_mce/plugins/fullscreen/fullscreen.htm	(revision 307)
+++ admin/js/tiny_mce/plugins/fullscreen/fullscreen.htm	(revision 307)
@@ -0,0 +1,109 @@
+<!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">
+<head>
+	<title></title>
+	<script type="text/javascript" src="../../tiny_mce.js"></script>
+	<script type="text/javascript">
+		function patchCallback(settings, key) {
+			if (settings[key])
+				settings[key] = "window.opener." + settings[key];
+		}
+
+		var settings = {}, paSe = window.opener.tinyMCE.activeEditor.settings, oeID = window.opener.tinyMCE.activeEditor.id;
+
+		// Clone array
+		for (var n in paSe)
+			settings[n] = paSe[n];
+
+		// Override options for fullscreen
+		for (var n in paSe.fullscreen_settings)
+			settings[n] = paSe.fullscreen_settings[n];
+
+		// Patch callbacks, make them point to window.opener
+		patchCallback(settings, 'urlconverter_callback');
+		patchCallback(settings, 'insertlink_callback');
+		patchCallback(settings, 'insertimage_callback');
+		patchCallback(settings, 'setupcontent_callback');
+		patchCallback(settings, 'save_callback');
+		patchCallback(settings, 'onchange_callback');
+		patchCallback(settings, 'init_instance_callback');
+		patchCallback(settings, 'file_browser_callback');
+		patchCallback(settings, 'cleanup_callback');
+		patchCallback(settings, 'execcommand_callback');
+		patchCallback(settings, 'oninit');
+
+		// Set options
+		delete settings.id;
+		settings['mode'] = 'exact';
+		settings['elements'] = 'fullscreenarea';
+		settings['add_unload_trigger'] = false;
+		settings['ask'] = false;
+		settings['document_base_url'] = window.opener.tinyMCE.activeEditor.documentBaseURI.getURI();
+		settings['fullscreen_is_enabled'] = true;
+		settings['fullscreen_editor_id'] = oeID;
+		settings['theme_advanced_resizing'] = false;
+		settings['strict_loading_mode'] = true;
+
+		settings.save_onsavecallback = function() {
+			window.opener.tinyMCE.get(oeID).setContent(tinyMCE.get('fullscreenarea').getContent({format : 'raw'}), {format : 'raw'});
+			window.opener.tinyMCE.get(oeID).execCommand('mceSave');
+			window.close();
+		};
+
+		function unloadHandler(e) {
+			moveContent();
+		}
+
+		function moveContent() {
+			window.opener.tinyMCE.get(oeID).setContent(tinyMCE.activeEditor.getContent());
+		}
+
+		function closeFullscreen() {
+			moveContent();
+			window.close();
+		}
+
+		function doParentSubmit() {
+			moveContent();
+
+			if (window.opener.tinyMCE.selectedInstance.formElement.form)
+				window.opener.tinyMCE.selectedInstance.formElement.form.submit();
+
+			window.close();
+
+			return false;
+		}
+
+		function render() {
+			var e = document.getElementById('fullscreenarea'), vp, ed, ow, oh, dom = tinymce.DOM;
+
+			e.value = window.opener.tinyMCE.get(oeID).getContent();
+
+			vp = dom.getViewPort();
+			settings.width = vp.w;
+			settings.height = vp.h - 15;
+
+			tinymce.dom.Event.add(window, 'resize', function() {
+				var vp = dom.getViewPort();
+
+				tinyMCE.activeEditor.theme.resizeTo(vp.w, vp.h);
+			});
+
+			tinyMCE.init(settings);
+		}
+
+		// Add onunload
+		tinymce.dom.Event.add(window, "beforeunload", unloadHandler);
+	</script>
+</head>
+<body style="margin:0;overflow:hidden;width:100%;height:100%" scrolling="no" scroll="no">
+<form onsubmit="doParentSubmit();">
+<textarea id="fullscreenarea" style="width:100%; height:100%"></textarea>
+</form>
+
+<script type="text/javascript">
+	render();
+</script>
+
+</body>
+</html>
Index: admin/js/tiny_mce/plugins/inlinepopups/editor_plugin.js
===================================================================
--- admin/js/tiny_mce/plugins/inlinepopups/editor_plugin.js	(revision 428)
+++ admin/js/tiny_mce/plugins/inlinepopups/editor_plugin.js	(revision 428)
@@ -0,0 +1,1 @@
+(function(){var d=tinymce.DOM,b=tinymce.dom.Element,a=tinymce.dom.Event,e=tinymce.each,c=tinymce.is;tinymce.create("tinymce.plugins.InlinePopups",{init:function(f,g){f.onBeforeRenderUI.add(function(){f.windowManager=new tinymce.InlineWindowManager(f);d.loadCSS(g+"/skins/"+(f.settings.inlinepopups_skin||"clearlooks2")+"/window.css")})},getInfo:function(){return{longname:"InlinePopups",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.create("tinymce.InlineWindowManager:tinymce.WindowManager",{InlineWindowManager:function(f){var g=this;g.parent(f);g.zIndex=300000;g.count=0;g.windows={}},open:function(s,j){var z=this,i,k="",r=z.editor,g=0,v=0,h,m,o,q,l,x,y,n;s=s||{};j=j||{};if(!s.inline){return z.parent(s,j)}n=z._frontWindow();if(n&&d.get(n.id+"_ifr")){n.focussedElement=d.get(n.id+"_ifr").contentWindow.document.activeElement}if(!s.type){z.bookmark=r.selection.getBookmark(1)}i=d.uniqueId();h=d.getViewPort();s.width=parseInt(s.width||320);s.height=parseInt(s.height||240)+(tinymce.isIE?8:0);s.min_width=parseInt(s.min_width||150);s.min_height=parseInt(s.min_height||100);s.max_width=parseInt(s.max_width||2000);s.max_height=parseInt(s.max_height||2000);s.left=s.left||Math.round(Math.max(h.x,h.x+(h.w/2)-(s.width/2)));s.top=s.top||Math.round(Math.max(h.y,h.y+(h.h/2)-(s.height/2)));s.movable=s.resizable=true;j.mce_width=s.width;j.mce_height=s.height;j.mce_inline=true;j.mce_window_id=i;j.mce_auto_focus=s.auto_focus;z.features=s;z.params=j;z.onOpen.dispatch(z,s,j);if(s.type){k+=" mceModal";if(s.type){k+=" mce"+s.type.substring(0,1).toUpperCase()+s.type.substring(1)}s.resizable=false}if(s.statusbar){k+=" mceStatusbar"}if(s.resizable){k+=" mceResizable"}if(s.minimizable){k+=" mceMinimizable"}if(s.maximizable){k+=" mceMaximizable"}if(s.movable){k+=" mceMovable"}z._addAll(d.doc.body,["div",{id:i,role:"dialog","aria-labelledby":s.type?i+"_content":i+"_title","class":(r.settings.inlinepopups_skin||"clearlooks2")+(tinymce.isIE&&window.getSelection?" ie9":""),style:"width:100px;height:100px"},["div",{id:i+"_wrapper","class":"mceWrapper"+k},["div",{id:i+"_top","class":"mceTop"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_title"},s.title||""]],["div",{id:i+"_middle","class":"mceMiddle"},["div",{id:i+"_left","class":"mceLeft",tabindex:"0"}],["span",{id:i+"_content"}],["div",{id:i+"_right","class":"mceRight",tabindex:"0"}]],["div",{id:i+"_bottom","class":"mceBottom"},["div",{"class":"mceLeft"}],["div",{"class":"mceCenter"}],["div",{"class":"mceRight"}],["span",{id:i+"_status"},"Content"]],["a",{"class":"mceMove",tabindex:"-1",href:"javascript:;"}],["a",{"class":"mceMin",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMax",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceMed",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{"class":"mceClose",tabindex:"-1",href:"javascript:;",onmousedown:"return false;"}],["a",{id:i+"_resize_n","class":"mceResize mceResizeN",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_s","class":"mceResize mceResizeS",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_w","class":"mceResize mceResizeW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_e","class":"mceResize mceResizeE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_nw","class":"mceResize mceResizeNW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_ne","class":"mceResize mceResizeNE",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_sw","class":"mceResize mceResizeSW",tabindex:"-1",href:"javascript:;"}],["a",{id:i+"_resize_se","class":"mceResize mceResizeSE",tabindex:"-1",href:"javascript:;"}]]]);d.setStyles(i,{top:-10000,left:-10000});if(tinymce.isGecko){d.setStyle(i,"overflow","auto")}if(!s.type){g+=d.get(i+"_left").clientWidth;g+=d.get(i+"_right").clientWidth;v+=d.get(i+"_top").clientHeight;v+=d.get(i+"_bottom").clientHeight}d.setStyles(i,{top:s.top,left:s.left,width:s.width+g,height:s.height+v});y=s.url||s.file;if(y){if(tinymce.relaxedDomain){y+=(y.indexOf("?")==-1?"?":"&")+"mce_rdomain="+tinymce.relaxedDomain}y=tinymce._addVer(y)}if(!s.type){d.add(i+"_content","iframe",{id:i+"_ifr",src:'javascript:""',frameBorder:0,style:"border:0;width:10px;height:10px"});d.setStyles(i+"_ifr",{width:s.width,height:s.height});d.setAttrib(i+"_ifr","src",y)}else{d.add(i+"_wrapper","a",{id:i+"_ok","class":"mceButton mceOk",href:"javascript:;",onmousedown:"return false;"},"Ok");if(s.type=="confirm"){d.add(i+"_wrapper","a",{"class":"mceButton mceCancel",href:"javascript:;",onmousedown:"return false;"},"Cancel")}d.add(i+"_middle","div",{"class":"mceIcon"});d.setHTML(i+"_content",s.content.replace("\n","<br />"));a.add(i,"keyup",function(f){var p=27;if(f.keyCode===p){s.button_func(false);return a.cancel(f)}});a.add(i,"keydown",function(f){var t,p=9;if(f.keyCode===p){t=d.select("a.mceCancel",i+"_wrapper")[0];if(t&&t!==f.target){t.focus()}else{d.get(i+"_ok").focus()}return a.cancel(f)}})}o=a.add(i,"mousedown",function(t){var u=t.target,f,p;f=z.windows[i];z.focus(i);if(u.nodeName=="A"||u.nodeName=="a"){if(u.className=="mceMax"){f.oldPos=f.element.getXY();f.oldSize=f.element.getSize();p=d.getViewPort();p.w-=2;p.h-=2;f.element.moveTo(p.x,p.y);f.element.resizeTo(p.w,p.h);d.setStyles(i+"_ifr",{width:p.w-f.deltaWidth,height:p.h-f.deltaHeight});d.addClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMed"){f.element.moveTo(f.oldPos.x,f.oldPos.y);f.element.resizeTo(f.oldSize.w,f.oldSize.h);f.iframeElement.resizeTo(f.oldSize.w-f.deltaWidth,f.oldSize.h-f.deltaHeight);d.removeClass(i+"_wrapper","mceMaximized")}else{if(u.className=="mceMove"){return z._startDrag(i,t,u.className)}else{if(d.hasClass(u,"mceResize")){return z._startDrag(i,t,u.className.substring(13))}}}}}});q=a.add(i,"click",function(f){var p=f.target;z.focus(i);if(p.nodeName=="A"||p.nodeName=="a"){switch(p.className){case"mceClose":z.close(null,i);return a.cancel(f);case"mceButton mceOk":case"mceButton mceCancel":s.button_func(p.className=="mceButton mceOk");return a.cancel(f)}}});a.add([i+"_left",i+"_right"],"focus",function(p){var t=d.get(i+"_ifr");if(t){var f=t.contentWindow.document.body;var u=d.select(":input:enabled,*[tabindex=0]",f);if(p.target.id===(i+"_left")){u[u.length-1].focus()}else{u[0].focus()}}else{d.get(i+"_ok").focus()}});x=z.windows[i]={id:i,mousedown_func:o,click_func:q,element:new b(i,{blocker:1,container:r.getContainer()}),iframeElement:new b(i+"_ifr"),features:s,deltaWidth:g,deltaHeight:v};x.iframeElement.on("focus",function(){z.focus(i)});if(z.count==0&&z.editor.getParam("dialog_type","modal")=="modal"){d.add(d.doc.body,"div",{id:"mceModalBlocker","class":(z.editor.settings.inlinepopups_skin||"clearlooks2")+"_modalBlocker",style:{zIndex:z.zIndex-1}});d.show("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","true")}else{d.setStyle("mceModalBlocker","z-index",z.zIndex-1)}if(tinymce.isIE6||/Firefox\/2\./.test(navigator.userAgent)||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceModalBlocker",{position:"absolute",left:h.x,top:h.y,width:h.w-2,height:h.h-2})}d.setAttrib(i,"aria-hidden","false");z.focus(i);z._fixIELayout(i,1);if(d.get(i+"_ok")){d.get(i+"_ok").focus()}z.count++;return x},focus:function(h){var g=this,f;if(f=g.windows[h]){f.zIndex=this.zIndex++;f.element.setStyle("zIndex",f.zIndex);f.element.update();h=h+"_wrapper";d.removeClass(g.lastId,"mceFocus");d.addClass(h,"mceFocus");g.lastId=h;if(f.focussedElement){f.focussedElement.focus()}else{if(d.get(h+"_ok")){d.get(f.id+"_ok").focus()}else{if(d.get(f.id+"_ifr")){d.get(f.id+"_ifr").focus()}}}}},_addAll:function(k,h){var g,l,f=this,j=tinymce.DOM;if(c(h,"string")){k.appendChild(j.doc.createTextNode(h))}else{if(h.length){k=k.appendChild(j.create(h[0],h[1]));for(g=2;g<h.length;g++){f._addAll(k,h[g])}}}},_startDrag:function(v,G,E){var o=this,u,z,C=d.doc,f,l=o.windows[v],h=l.element,y=h.getXY(),x,q,F,g,A,s,r,j,i,m,k,n,B;g={x:0,y:0};A=d.getViewPort();A.w-=2;A.h-=2;j=G.screenX;i=G.screenY;m=k=n=B=0;u=a.add(C,"mouseup",function(p){a.remove(C,"mouseup",u);a.remove(C,"mousemove",z);if(f){f.remove()}h.moveBy(m,k);h.resizeBy(n,B);q=h.getSize();d.setStyles(v+"_ifr",{width:q.w-l.deltaWidth,height:q.h-l.deltaHeight});o._fixIELayout(v,1);return a.cancel(p)});if(E!="Move"){D()}function D(){if(f){return}o._fixIELayout(v,0);d.add(C.body,"div",{id:"mceEventBlocker","class":"mceEventBlocker "+(o.editor.settings.inlinepopups_skin||"clearlooks2"),style:{zIndex:o.zIndex+1}});if(tinymce.isIE6||(tinymce.isIE&&!d.boxModel)){d.setStyles("mceEventBlocker",{position:"absolute",left:A.x,top:A.y,width:A.w-2,height:A.h-2})}f=new b("mceEventBlocker");f.update();x=h.getXY();q=h.getSize();s=g.x+x.x-A.x;r=g.y+x.y-A.y;d.add(f.get(),"div",{id:"mcePlaceHolder","class":"mcePlaceHolder",style:{left:s,top:r,width:q.w,height:q.h}});F=new b("mcePlaceHolder")}z=a.add(C,"mousemove",function(w){var p,H,t;D();p=w.screenX-j;H=w.screenY-i;switch(E){case"ResizeW":m=p;n=0-p;break;case"ResizeE":n=p;break;case"ResizeN":case"ResizeNW":case"ResizeNE":if(E=="ResizeNW"){m=p;n=0-p}else{if(E=="ResizeNE"){n=p}}k=H;B=0-H;break;case"ResizeS":case"ResizeSW":case"ResizeSE":if(E=="ResizeSW"){m=p;n=0-p}else{if(E=="ResizeSE"){n=p}}B=H;break;case"mceMove":m=p;k=H;break}if(n<(t=l.features.min_width-q.w)){if(m!==0){m+=n-t}n=t}if(B<(t=l.features.min_height-q.h)){if(k!==0){k+=B-t}B=t}n=Math.min(n,l.features.max_width-q.w);B=Math.min(B,l.features.max_height-q.h);m=Math.max(m,A.x-(s+A.x));k=Math.max(k,A.y-(r+A.y));m=Math.min(m,(A.w+A.x)-(s+q.w+A.x));k=Math.min(k,(A.h+A.y)-(r+q.h+A.y));if(m+k!==0){if(s+m<0){m=0}if(r+k<0){k=0}F.moveTo(s+m,r+k)}if(n+B!==0){F.resizeTo(q.w+n,q.h+B)}return a.cancel(w)});return a.cancel(G)},resizeBy:function(g,h,i){var f=this.windows[i];if(f){f.element.resizeBy(g,h);f.iframeElement.resizeBy(g,h)}},close:function(i,k){var g=this,f,j=d.doc,h,k;k=g._findId(k||i);if(!g.windows[k]){g.parent(i);return}g.count--;if(g.count==0){d.remove("mceModalBlocker");d.setAttrib(d.doc.body,"aria-hidden","false");g.editor.focus()}if(f=g.windows[k]){g.onClose.dispatch(g);a.remove(j,"mousedown",f.mousedownFunc);a.remove(j,"click",f.clickFunc);a.clear(k);a.clear(k+"_ifr");d.setAttrib(k+"_ifr","src",'javascript:""');f.element.remove();delete g.windows[k];h=g._frontWindow();if(h){g.focus(h.id)}}},_frontWindow:function(){var g,f=0;e(this.windows,function(h){if(h.zIndex>f){g=h;f=h.zIndex}});return g},setTitle:function(f,g){var h;f=this._findId(f);if(h=d.get(f+"_title")){h.innerHTML=d.encode(g)}},alert:function(g,f,j){var i=this,h;h=i.open({title:i,type:"alert",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},confirm:function(g,f,j){var i=this,h;h=i.open({title:i,type:"confirm",button_func:function(k){if(f){f.call(k||i,k)}i.close(null,h.id)},content:d.encode(i.editor.getLang(g,g)),inline:1,width:400,height:130})},_findId:function(f){var g=this;if(typeof(f)=="string"){return f}e(g.windows,function(h){var i=d.get(h.id+"_ifr");if(i&&f==i.contentWindow){f=h.id;return false}});return f},_fixIELayout:function(i,h){var f,g;if(!tinymce.isIE6){return}e(["n","s","w","e","nw","ne","sw","se"],function(j){var k=d.get(i+"_resize_"+j);d.setStyles(k,{width:h?k.clientWidth:"",height:h?k.clientHeight:"",cursor:d.getStyle(k,"cursor",1)});d.setStyle(i+"_bottom","bottom","-1px");k=0});if(f=this.windows[i]){f.element.hide();f.element.show();e(d.select("div,a",i),function(k,j){if(k.currentStyle.backgroundImage!="none"){g=new Image();g.src=k.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/,"$1")}});d.get(i).style.filter=""}}});tinymce.PluginManager.add("inlinepopups",tinymce.plugins.InlinePopups)})();
Index: admin/js/tiny_mce/plugins/inlinepopups/editor_plugin_src.js
===================================================================
--- admin/js/tiny_mce/plugins/inlinepopups/editor_plugin_src.js	(revision 428)
+++ admin/js/tiny_mce/plugins/inlinepopups/editor_plugin_src.js	(revision 428)
@@ -0,0 +1,696 @@
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(function() {
+	var DOM = tinymce.DOM, Element = tinymce.dom.Element, Event = tinymce.dom.Event, each = tinymce.each, is = tinymce.is;
+
+	tinymce.create('tinymce.plugins.InlinePopups', {
+		init : function(ed, url) {
+			// Replace window manager
+			ed.onBeforeRenderUI.add(function() {
+				ed.windowManager = new tinymce.InlineWindowManager(ed);
+				DOM.loadCSS(url + '/skins/' + (ed.settings.inlinepopups_skin || 'clearlooks2') + "/window.css");
+			});
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'InlinePopups',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/inlinepopups',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
+
+	tinymce.create('tinymce.InlineWindowManager:tinymce.WindowManager', {
+		InlineWindowManager : function(ed) {
+			var t = this;
+
+			t.parent(ed);
+			t.zIndex = 300000;
+			t.count = 0;
+			t.windows = {};
+		},
+
+		open : function(f, p) {
+			var t = this, id, opt = '', ed = t.editor, dw = 0, dh = 0, vp, po, mdf, clf, we, w, u, parentWindow;
+
+			f = f || {};
+			p = p || {};
+
+			// Run native windows
+			if (!f.inline)
+				return t.parent(f, p);
+
+			parentWindow = t._frontWindow();
+			if (parentWindow && DOM.get(parentWindow.id + '_ifr')) {
+				parentWindow.focussedElement = DOM.get(parentWindow.id + '_ifr').contentWindow.document.activeElement;
+			}
+			
+			// Only store selection if the type is a normal window
+			if (!f.type)
+				t.bookmark = ed.selection.getBookmark(1);
+
+			id = DOM.uniqueId();
+			vp = DOM.getViewPort();
+			f.width = parseInt(f.width || 320);
+			f.height = parseInt(f.height || 240) + (tinymce.isIE ? 8 : 0);
+			f.min_width = parseInt(f.min_width || 150);
+			f.min_height = parseInt(f.min_height || 100);
+			f.max_width = parseInt(f.max_width || 2000);
+			f.max_height = parseInt(f.max_height || 2000);
+			f.left = f.left || Math.round(Math.max(vp.x, vp.x + (vp.w / 2.0) - (f.width / 2.0)));
+			f.top = f.top || Math.round(Math.max(vp.y, vp.y + (vp.h / 2.0) - (f.height / 2.0)));
+			f.movable = f.resizable = true;
+			p.mce_width = f.width;
+			p.mce_height = f.height;
+			p.mce_inline = true;
+			p.mce_window_id = id;
+			p.mce_auto_focus = f.auto_focus;
+
+			// Transpose
+//			po = DOM.getPos(ed.getContainer());
+//			f.left -= po.x;
+//			f.top -= po.y;
+
+			t.features = f;
+			t.params = p;
+			t.onOpen.dispatch(t, f, p);
+
+			if (f.type) {
+				opt += ' mceModal';
+
+				if (f.type)
+					opt += ' mce' + f.type.substring(0, 1).toUpperCase() + f.type.substring(1);
+
+				f.resizable = false;
+			}
+
+			if (f.statusbar)
+				opt += ' mceStatusbar';
+
+			if (f.resizable)
+				opt += ' mceResizable';
+
+			if (f.minimizable)
+				opt += ' mceMinimizable';
+
+			if (f.maximizable)
+				opt += ' mceMaximizable';
+
+			if (f.movable)
+				opt += ' mceMovable';
+
+			// Create DOM objects
+			t._addAll(DOM.doc.body, 
+				['div', {id : id, role : 'dialog', 'aria-labelledby': f.type ? id + '_content' : id + '_title', 'class' : (ed.settings.inlinepopups_skin || 'clearlooks2') + (tinymce.isIE && window.getSelection ? ' ie9' : ''), style : 'width:100px;height:100px'}, 
+					['div', {id : id + '_wrapper', 'class' : 'mceWrapper' + opt},
+						['div', {id : id + '_top', 'class' : 'mceTop'}, 
+							['div', {'class' : 'mceLeft'}],
+							['div', {'class' : 'mceCenter'}],
+							['div', {'class' : 'mceRight'}],
+							['span', {id : id + '_title'}, f.title || '']
+						],
+
+						['div', {id : id + '_middle', 'class' : 'mceMiddle'}, 
+							['div', {id : id + '_left', 'class' : 'mceLeft', tabindex : '0'}],
+							['span', {id : id + '_content'}],
+							['div', {id : id + '_right', 'class' : 'mceRight', tabindex : '0'}]
+						],
+
+						['div', {id : id + '_bottom', 'class' : 'mceBottom'},
+							['div', {'class' : 'mceLeft'}],
+							['div', {'class' : 'mceCenter'}],
+							['div', {'class' : 'mceRight'}],
+							['span', {id : id + '_status'}, 'Content']
+						],
+
+						['a', {'class' : 'mceMove', tabindex : '-1', href : 'javascript:;'}],
+						['a', {'class' : 'mceMin', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
+						['a', {'class' : 'mceMax', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
+						['a', {'class' : 'mceMed', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
+						['a', {'class' : 'mceClose', tabindex : '-1', href : 'javascript:;', onmousedown : 'return false;'}],
+						['a', {id : id + '_resize_n', 'class' : 'mceResize mceResizeN', tabindex : '-1', href : 'javascript:;'}],
+						['a', {id : id + '_resize_s', 'class' : 'mceResize mceResizeS', tabindex : '-1', href : 'javascript:;'}],
+						['a', {id : id + '_resize_w', 'class' : 'mceResize mceResizeW', tabindex : '-1', href : 'javascript:;'}],
+						['a', {id : id + '_resize_e', 'class' : 'mceResize mceResizeE', tabindex : '-1', href : 'javascript:;'}],
+						['a', {id : id + '_resize_nw', 'class' : 'mceResize mceResizeNW', tabindex : '-1', href : 'javascript:;'}],
+						['a', {id : id + '_resize_ne', 'class' : 'mceResize mceResizeNE', tabindex : '-1', href : 'javascript:;'}],
+						['a', {id : id + '_resize_sw', 'class' : 'mceResize mceResizeSW', tabindex : '-1', href : 'javascript:;'}],
+						['a', {id : id + '_resize_se', 'class' : 'mceResize mceResizeSE', tabindex : '-1', href : 'javascript:;'}]
+					]
+				]
+			);
+
+			DOM.setStyles(id, {top : -10000, left : -10000});
+
+			// Fix gecko rendering bug, where the editors iframe messed with window contents
+			if (tinymce.isGecko)
+				DOM.setStyle(id, 'overflow', 'auto');
+
+			// Measure borders
+			if (!f.type) {
+				dw += DOM.get(id + '_left').clientWidth;
+				dw += DOM.get(id + '_right').clientWidth;
+				dh += DOM.get(id + '_top').clientHeight;
+				dh += DOM.get(id + '_bottom').clientHeight;
+			}
+
+			// Resize window
+			DOM.setStyles(id, {top : f.top, left : f.left, width : f.width + dw, height : f.height + dh});
+
+			u = f.url || f.file;
+			if (u) {
+				if (tinymce.relaxedDomain)
+					u += (u.indexOf('?') == -1 ? '?' : '&') + 'mce_rdomain=' + tinymce.relaxedDomain;
+
+				u = tinymce._addVer(u);
+			}
+
+			if (!f.type) {
+				DOM.add(id + '_content', 'iframe', {id : id + '_ifr', src : 'javascript:""', frameBorder : 0, style : 'border:0;width:10px;height:10px'});
+				DOM.setStyles(id + '_ifr', {width : f.width, height : f.height});
+				DOM.setAttrib(id + '_ifr', 'src', u);
+			} else {
+				DOM.add(id + '_wrapper', 'a', {id : id + '_ok', 'class' : 'mceButton mceOk', href : 'javascript:;', onmousedown : 'return false;'}, 'Ok');
+
+				if (f.type == 'confirm')
+					DOM.add(id + '_wrapper', 'a', {'class' : 'mceButton mceCancel', href : 'javascript:;', onmousedown : 'return false;'}, 'Cancel');
+
+				DOM.add(id + '_middle', 'div', {'class' : 'mceIcon'});
+				DOM.setHTML(id + '_content', f.content.replace('\n', '<br />'));
+				
+				Event.add(id, 'keyup', function(evt) {
+					var VK_ESCAPE = 27;
+					if (evt.keyCode === VK_ESCAPE) {
+						f.button_func(false);
+						return Event.cancel(evt);
+					}
+				});
+
+				Event.add(id, 'keydown', function(evt) {
+					var cancelButton, VK_TAB = 9;
+					if (evt.keyCode === VK_TAB) {
+						cancelButton = DOM.select('a.mceCancel', id + '_wrapper')[0];
+						if (cancelButton && cancelButton !== evt.target) {
+							cancelButton.focus();
+						} else {
+							DOM.get(id + '_ok').focus();
+						}
+						return Event.cancel(evt);
+					}
+				});
+			}
+
+			// Register events
+			mdf = Event.add(id, 'mousedown', function(e) {
+				var n = e.target, w, vp;
+
+				w = t.windows[id];
+				t.focus(id);
+
+				if (n.nodeName == 'A' || n.nodeName == 'a') {
+					if (n.className == 'mceMax') {
+						w.oldPos = w.element.getXY();
+						w.oldSize = w.element.getSize();
+
+						vp = DOM.getViewPort();
+
+						// Reduce viewport size to avoid scrollbars
+						vp.w -= 2;
+						vp.h -= 2;
+
+						w.element.moveTo(vp.x, vp.y);
+						w.element.resizeTo(vp.w, vp.h);
+						DOM.setStyles(id + '_ifr', {width : vp.w - w.deltaWidth, height : vp.h - w.deltaHeight});
+						DOM.addClass(id + '_wrapper', 'mceMaximized');
+					} else if (n.className == 'mceMed') {
+						// Reset to old size
+						w.element.moveTo(w.oldPos.x, w.oldPos.y);
+						w.element.resizeTo(w.oldSize.w, w.oldSize.h);
+						w.iframeElement.resizeTo(w.oldSize.w - w.deltaWidth, w.oldSize.h - w.deltaHeight);
+
+						DOM.removeClass(id + '_wrapper', 'mceMaximized');
+					} else if (n.className == 'mceMove')
+						return t._startDrag(id, e, n.className);
+					else if (DOM.hasClass(n, 'mceResize'))
+						return t._startDrag(id, e, n.className.substring(13));
+				}
+			});
+
+			clf = Event.add(id, 'click', function(e) {
+				var n = e.target;
+
+				t.focus(id);
+
+				if (n.nodeName == 'A' || n.nodeName == 'a') {
+					switch (n.className) {
+						case 'mceClose':
+							t.close(null, id);
+							return Event.cancel(e);
+
+						case 'mceButton mceOk':
+						case 'mceButton mceCancel':
+							f.button_func(n.className == 'mceButton mceOk');
+							return Event.cancel(e);
+					}
+				}
+			});
+			
+			// Make sure the tab order loops within the dialog.
+			Event.add([id + '_left', id + '_right'], 'focus', function(evt) {
+				var iframe = DOM.get(id + '_ifr');
+				if (iframe) {
+					var body = iframe.contentWindow.document.body;
+					var focusable = DOM.select(':input:enabled,*[tabindex=0]', body);
+					if (evt.target.id === (id + '_left')) {
+						focusable[focusable.length - 1].focus();
+					} else {
+						focusable[0].focus();
+					}
+				} else {
+					DOM.get(id + '_ok').focus();
+				}
+			});
+			
+			// Add window
+			w = t.windows[id] = {
+				id : id,
+				mousedown_func : mdf,
+				click_func : clf,
+				element : new Element(id, {blocker : 1, container : ed.getContainer()}),
+				iframeElement : new Element(id + '_ifr'),
+				features : f,
+				deltaWidth : dw,
+				deltaHeight : dh
+			};
+
+			w.iframeElement.on('focus', function() {
+				t.focus(id);
+			});
+
+			// Setup blocker
+			if (t.count == 0 && t.editor.getParam('dialog_type', 'modal') == 'modal') {
+				DOM.add(DOM.doc.body, 'div', {
+					id : 'mceModalBlocker',
+					'class' : (t.editor.settings.inlinepopups_skin || 'clearlooks2') + '_modalBlocker',
+					style : {zIndex : t.zIndex - 1}
+				});
+
+				DOM.show('mceModalBlocker'); // Reduces flicker in IE
+				DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'true');
+			} else
+				DOM.setStyle('mceModalBlocker', 'z-index', t.zIndex - 1);
+
+			if (tinymce.isIE6 || /Firefox\/2\./.test(navigator.userAgent) || (tinymce.isIE && !DOM.boxModel))
+				DOM.setStyles('mceModalBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});
+
+			DOM.setAttrib(id, 'aria-hidden', 'false');
+			t.focus(id);
+			t._fixIELayout(id, 1);
+
+			// Focus ok button
+			if (DOM.get(id + '_ok'))
+				DOM.get(id + '_ok').focus();
+			t.count++;
+
+			return w;
+		},
+
+		focus : function(id) {
+			var t = this, w;
+
+			if (w = t.windows[id]) {
+				w.zIndex = this.zIndex++;
+				w.element.setStyle('zIndex', w.zIndex);
+				w.element.update();
+
+				id = id + '_wrapper';
+				DOM.removeClass(t.lastId, 'mceFocus');
+				DOM.addClass(id, 'mceFocus');
+				t.lastId = id;
+				
+				if (w.focussedElement) {
+					w.focussedElement.focus();
+				} else if (DOM.get(id + '_ok')) {
+					DOM.get(w.id + '_ok').focus();
+				} else if (DOM.get(w.id + '_ifr')) {
+					DOM.get(w.id + '_ifr').focus();
+				}
+			}
+		},
+
+		_addAll : function(te, ne) {
+			var i, n, t = this, dom = tinymce.DOM;
+
+			if (is(ne, 'string'))
+				te.appendChild(dom.doc.createTextNode(ne));
+			else if (ne.length) {
+				te = te.appendChild(dom.create(ne[0], ne[1]));
+
+				for (i=2; i<ne.length; i++)
+					t._addAll(te, ne[i]);
+			}
+		},
+
+		_startDrag : function(id, se, ac) {
+			var t = this, mu, mm, d = DOM.doc, eb, w = t.windows[id], we = w.element, sp = we.getXY(), p, sz, ph, cp, vp, sx, sy, sex, sey, dx, dy, dw, dh;
+
+			// Get positons and sizes
+//			cp = DOM.getPos(t.editor.getContainer());
+			cp = {x : 0, y : 0};
+			vp = DOM.getViewPort();
+
+			// Reduce viewport size to avoid scrollbars while dragging
+			vp.w -= 2;
+			vp.h -= 2;
+
+			sex = se.screenX;
+			sey = se.screenY;
+			dx = dy = dw = dh = 0;
+
+			// Handle mouse up
+			mu = Event.add(d, 'mouseup', function(e) {
+				Event.remove(d, 'mouseup', mu);
+				Event.remove(d, 'mousemove', mm);
+
+				if (eb)
+					eb.remove();
+
+				we.moveBy(dx, dy);
+				we.resizeBy(dw, dh);
+				sz = we.getSize();
+				DOM.setStyles(id + '_ifr', {width : sz.w - w.deltaWidth, height : sz.h - w.deltaHeight});
+				t._fixIELayout(id, 1);
+
+				return Event.cancel(e);
+			});
+
+			if (ac != 'Move')
+				startMove();
+
+			function startMove() {
+				if (eb)
+					return;
+
+				t._fixIELayout(id, 0);
+
+				// Setup event blocker
+				DOM.add(d.body, 'div', {
+					id : 'mceEventBlocker',
+					'class' : 'mceEventBlocker ' + (t.editor.settings.inlinepopups_skin || 'clearlooks2'),
+					style : {zIndex : t.zIndex + 1}
+				});
+
+				if (tinymce.isIE6 || (tinymce.isIE && !DOM.boxModel))
+					DOM.setStyles('mceEventBlocker', {position : 'absolute', left : vp.x, top : vp.y, width : vp.w - 2, height : vp.h - 2});
+
+				eb = new Element('mceEventBlocker');
+				eb.update();
+
+				// Setup placeholder
+				p = we.getXY();
+				sz = we.getSize();
+				sx = cp.x + p.x - vp.x;
+				sy = cp.y + p.y - vp.y;
+				DOM.add(eb.get(), 'div', {id : 'mcePlaceHolder', 'class' : 'mcePlaceHolder', style : {left : sx, top : sy, width : sz.w, height : sz.h}});
+				ph = new Element('mcePlaceHolder');
+			};
+
+			// Handle mouse move/drag
+			mm = Event.add(d, 'mousemove', function(e) {
+				var x, y, v;
+
+				startMove();
+
+				x = e.screenX - sex;
+				y = e.screenY - sey;
+
+				switch (ac) {
+					case 'ResizeW':
+						dx = x;
+						dw = 0 - x;
+						break;
+
+					case 'ResizeE':
+						dw = x;
+						break;
+
+					case 'ResizeN':
+					case 'ResizeNW':
+					case 'ResizeNE':
+						if (ac == "ResizeNW") {
+							dx = x;
+							dw = 0 - x;
+						} else if (ac == "ResizeNE")
+							dw = x;
+
+						dy = y;
+						dh = 0 - y;
+						break;
+
+					case 'ResizeS':
+					case 'ResizeSW':
+					case 'ResizeSE':
+						if (ac == "ResizeSW") {
+							dx = x;
+							dw = 0 - x;
+						} else if (ac == "ResizeSE")
+							dw = x;
+
+						dh = y;
+						break;
+
+					case 'mceMove':
+						dx = x;
+						dy = y;
+						break;
+				}
+
+				// Boundary check
+				if (dw < (v = w.features.min_width - sz.w)) {
+					if (dx !== 0)
+						dx += dw - v;
+
+					dw = v;
+				}
+	
+				if (dh < (v = w.features.min_height - sz.h)) {
+					if (dy !== 0)
+						dy += dh - v;
+
+					dh = v;
+				}
+
+				dw = Math.min(dw, w.features.max_width - sz.w);
+				dh = Math.min(dh, w.features.max_height - sz.h);
+				dx = Math.max(dx, vp.x - (sx + vp.x));
+				dy = Math.max(dy, vp.y - (sy + vp.y));
+				dx = Math.min(dx, (vp.w + vp.x) - (sx + sz.w + vp.x));
+				dy = Math.min(dy, (vp.h + vp.y) - (sy + sz.h + vp.y));
+
+				// Move if needed
+				if (dx + dy !== 0) {
+					if (sx + dx < 0)
+						dx = 0;
+	
+					if (sy + dy < 0)
+						dy = 0;
+
+					ph.moveTo(sx + dx, sy + dy);
+				}
+
+				// Resize if needed
+				if (dw + dh !== 0)
+					ph.resizeTo(sz.w + dw, sz.h + dh);
+
+				return Event.cancel(e);
+			});
+
+			return Event.cancel(se);
+		},
+
+		resizeBy : function(dw, dh, id) {
+			var w = this.windows[id];
+
+			if (w) {
+				w.element.resizeBy(dw, dh);
+				w.iframeElement.resizeBy(dw, dh);
+			}
+		},
+
+		close : function(win, id) {
+			var t = this, w, d = DOM.doc, fw, id;
+
+			id = t._findId(id || win);
+
+			// Probably not inline
+			if (!t.windows[id]) {
+				t.parent(win);
+				return;
+			}
+
+			t.count--;
+
+			if (t.count == 0) {
+				DOM.remove('mceModalBlocker');
+				DOM.setAttrib(DOM.doc.body, 'aria-hidden', 'false');
+				t.editor.focus();
+			}
+
+			if (w = t.windows[id]) {
+				t.onClose.dispatch(t);
+				Event.remove(d, 'mousedown', w.mousedownFunc);
+				Event.remove(d, 'click', w.clickFunc);
+				Event.clear(id);
+				Event.clear(id + '_ifr');
+
+				DOM.setAttrib(id + '_ifr', 'src', 'javascript:""'); // Prevent leak
+				w.element.remove();
+				delete t.windows[id];
+
+				fw = t._frontWindow();
+
+				if (fw)
+					t.focus(fw.id);
+			}
+		},
+		
+		// Find front most window
+		_frontWindow : function() {
+			var fw, ix = 0;
+			// Find front most window and focus that
+			each (this.windows, function(w) {
+				if (w.zIndex > ix) {
+					fw = w;
+					ix = w.zIndex;
+				}
+			});
+			return fw;
+		},
+
+		setTitle : function(w, ti) {
+			var e;
+
+			w = this._findId(w);
+
+			if (e = DOM.get(w + '_title'))
+				e.innerHTML = DOM.encode(ti);
+		},
+
+		alert : function(txt, cb, s) {
+			var t = this, w;
+
+			w = t.open({
+				title : t,
+				type : 'alert',
+				button_func : function(s) {
+					if (cb)
+						cb.call(s || t, s);
+
+					t.close(null, w.id);
+				},
+				content : DOM.encode(t.editor.getLang(txt, txt)),
+				inline : 1,
+				width : 400,
+				height : 130
+			});
+		},
+
+		confirm : function(txt, cb, s) {
+			var t = this, w;
+
+			w = t.open({
+				title : t,
+				type : 'confirm',
+				button_func : function(s) {
+					if (cb)
+						cb.call(s || t, s);
+
+					t.close(null, w.id);
+				},
+				content : DOM.encode(t.editor.getLang(txt, txt)),
+				inline : 1,
+				width : 400,
+				height : 130
+			});
+		},
+
+		// Internal functions
+
+		_findId : function(w) {
+			var t = this;
+
+			if (typeof(w) == 'string')
+				return w;
+
+			each(t.windows, function(wo) {
+				var ifr = DOM.get(wo.id + '_ifr');
+
+				if (ifr && w == ifr.contentWindow) {
+					w = wo.id;
+					return false;
+				}
+			});
+
+			return w;
+		},
+
+		_fixIELayout : function(id, s) {
+			var w, img;
+
+			if (!tinymce.isIE6)
+				return;
+
+			// Fixes the bug where hover flickers and does odd things in IE6
+			each(['n','s','w','e','nw','ne','sw','se'], function(v) {
+				var e = DOM.get(id + '_resize_' + v);
+
+				DOM.setStyles(e, {
+					width : s ? e.clientWidth : '',
+					height : s ? e.clientHeight : '',
+					cursor : DOM.getStyle(e, 'cursor', 1)
+				});
+
+				DOM.setStyle(id + "_bottom", 'bottom', '-1px');
+
+				e = 0;
+			});
+
+			// Fixes graphics glitch
+			if (w = this.windows[id]) {
+				// Fixes rendering bug after resize
+				w.element.hide();
+				w.element.show();
+
+				// Forced a repaint of the window
+				//DOM.get(id).style.filter = '';
+
+				// IE has a bug where images used in CSS won't get loaded
+				// sometimes when the cache in the browser is disabled
+				// This fix tries to solve it by loading the images using the image object
+				each(DOM.select('div,a', id), function(e, i) {
+					if (e.currentStyle.backgroundImage != 'none') {
+						img = new Image();
+						img.src = e.currentStyle.backgroundImage.replace(/url\(\"(.+)\"\)/, '$1');
+					}
+				});
+
+				DOM.get(id).style.filter = '';
+			}
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('inlinepopups', tinymce.plugins.InlinePopups);
+})();
+
Index: admin/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css
===================================================================
--- admin/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css	(revision 428)
+++ admin/js/tiny_mce/plugins/inlinepopups/skins/clearlooks2/window.css	(revision 428)
@@ -0,0 +1,90 @@
+/* Clearlooks 2 */
+
+/* Reset */
+.clearlooks2, .clearlooks2 div, .clearlooks2 span, .clearlooks2 a {vertical-align:baseline; text-align:left; position:absolute; border:0; padding:0; margin:0; background:transparent; font-family:Arial,Verdana; font-size:11px; color:#000; text-decoration:none; font-weight:normal; width:auto; height:auto; overflow:hidden; display:block}
+
+/* General */
+.clearlooks2 {position:absolute; direction:ltr}
+.clearlooks2 .mceWrapper {position:static}
+.mceEventBlocker {position:fixed; left:0; top:0; background:url(img/horizontal.gif) no-repeat 0 -75px; width:100%; height:100%}
+.clearlooks2 .mcePlaceHolder {border:1px solid #000; background:#888; top:0; left:0; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50)}
+.clearlooks2_modalBlocker {position:fixed; left:0; top:0; width:100%; height:100%; background:#FFF; opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60); display:none}
+
+/* Top */
+.clearlooks2 .mceTop, .clearlooks2 .mceTop div {top:0; width:100%; height:23px}
+.clearlooks2 .mceTop .mceLeft {width:6px; background:url(img/corners.gif)}
+.clearlooks2 .mceTop .mceCenter {right:6px; width:100%; height:23px; background:url(img/horizontal.gif) 12px 0; clip:rect(auto auto auto 12px)}
+.clearlooks2 .mceTop .mceRight {right:0; width:6px; height:23px; background:url(img/corners.gif) -12px 0}
+.clearlooks2 .mceTop span {width:100%; text-align:center; vertical-align:middle; line-height:23px; font-weight:bold}
+.clearlooks2 .mceFocus .mceTop .mceLeft {background:url(img/corners.gif) -6px 0}
+.clearlooks2 .mceFocus .mceTop .mceCenter {background:url(img/horizontal.gif) 0 -23px}
+.clearlooks2 .mceFocus .mceTop .mceRight {background:url(img/corners.gif) -18px 0}
+.clearlooks2 .mceFocus .mceTop span {color:#FFF}
+
+/* Middle */
+.clearlooks2 .mceMiddle, .clearlooks2 .mceMiddle div {top:0}
+.clearlooks2 .mceMiddle {width:100%; height:100%; clip:rect(23px auto auto auto)}
+.clearlooks2 .mceMiddle .mceLeft {left:0; width:5px; height:100%; background:url(img/vertical.gif) -5px 0}
+.clearlooks2 .mceMiddle span {top:23px; left:5px; width:100%; height:100%; background:#FFF}
+.clearlooks2 .mceMiddle .mceRight {right:0; width:5px; height:100%; background:url(img/vertical.gif)}
+
+/* Bottom */
+.clearlooks2 .mceBottom, .clearlooks2 .mceBottom div {height:6px}
+.clearlooks2 .mceBottom {left:0; bottom:0; width:100%}
+.clearlooks2 .mceBottom div {top:0}
+.clearlooks2 .mceBottom .mceLeft {left:0; width:5px; background:url(img/corners.gif) -34px -6px}
+.clearlooks2 .mceBottom .mceCenter {left:5px; width:100%; background:url(img/horizontal.gif) 0 -46px}
+.clearlooks2 .mceBottom .mceRight {right:0; width:5px; background: url(img/corners.gif) -34px 0}
+.clearlooks2 .mceBottom span {display:none}
+.clearlooks2 .mceStatusbar .mceBottom, .clearlooks2 .mceStatusbar .mceBottom div {height:23px}
+.clearlooks2 .mceStatusbar .mceBottom .mceLeft {background:url(img/corners.gif) -29px 0}
+.clearlooks2 .mceStatusbar .mceBottom .mceCenter {background:url(img/horizontal.gif) 0 -52px}
+.clearlooks2 .mceStatusbar .mceBottom .mceRight {background:url(img/corners.gif) -24px 0}
+.clearlooks2 .mceStatusbar .mceBottom span {display:block; left:7px; font-family:Arial, Verdana; font-size:11px; line-height:23px}
+
+/* Actions */
+.clearlooks2 a {width:29px; height:16px; top:3px;}
+.clearlooks2 .mceClose {right:6px; background:url(img/buttons.gif) -87px 0}
+.clearlooks2 .mceMin {display:none; right:68px; background:url(img/buttons.gif) 0 0}
+.clearlooks2 .mceMed {display:none; right:37px; background:url(img/buttons.gif) -29px 0}
+.clearlooks2 .mceMax {display:none; right:37px; background:url(img/buttons.gif) -58px 0}
+.clearlooks2 .mceMove {display:none;width:100%;cursor:move;background:url(img/corners.gif) no-repeat -100px -100px}
+.clearlooks2 .mceMovable .mceMove {display:block}
+.clearlooks2 .mceFocus .mceClose {right:6px; background:url(img/buttons.gif) -87px -16px}
+.clearlooks2 .mceFocus .mceMin {right:68px; background:url(img/buttons.gif) 0 -16px}
+.clearlooks2 .mceFocus .mceMed {right:37px; background:url(img/buttons.gif) -29px -16px}
+.clearlooks2 .mceFocus .mceMax {right:37px; background:url(img/buttons.gif) -58px -16px}
+.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
+.clearlooks2 .mceFocus .mceClose:hover {right:6px; background:url(img/buttons.gif) -87px -32px}
+.clearlooks2 .mceFocus .mceMin:hover {right:68px; background:url(img/buttons.gif) 0 -32px}
+.clearlooks2 .mceFocus .mceMed:hover {right:37px; background:url(img/buttons.gif) -29px -32px}
+.clearlooks2 .mceFocus .mceMax:hover {right:37px; background:url(img/buttons.gif) -58px -32px}
+
+/* Resize */
+.clearlooks2 .mceResize {top:auto; left:auto; display:none; width:5px; height:5px; background:url(img/horizontal.gif) no-repeat 0 -75px}
+.clearlooks2 .mceResizable .mceResize {display:block}
+.clearlooks2 .mceResizable .mceMin, .clearlooks2 .mceMax {display:none}
+.clearlooks2 .mceMinimizable .mceMin {display:block}
+.clearlooks2 .mceMaximizable .mceMax {display:block}
+.clearlooks2 .mceMaximized .mceMed {display:block}
+.clearlooks2 .mceMaximized .mceMax {display:none}
+.clearlooks2 a.mceResizeN {top:0; left:0; width:100%; cursor:n-resize}
+.clearlooks2 a.mceResizeNW {top:0; left:0; cursor:nw-resize}
+.clearlooks2 a.mceResizeNE {top:0; right:0; cursor:ne-resize}
+.clearlooks2 a.mceResizeW {top:0; left:0; height:100%; cursor:w-resize;}
+.clearlooks2 a.mceResizeE {top:0; right:0; height:100%; cursor:e-resize}
+.clearlooks2 a.mceResizeS {bottom:0; left:0; width:100%; cursor:s-resize}
+.clearlooks2 a.mceResizeSW {bottom:0; left:0; cursor:sw-resize}
+.clearlooks2 a.mceResizeSE {bottom:0; right:0; cursor:se-resize}
+
+/* Alert/Confirm */
+.clearlooks2 .mceButton {font-weight:bold; bottom:10px; width:80px; height:30px; background:url(img/button.gif); line-height:30px; vertical-align:middle; text-align:center; outline:0}
+.clearlooks2 .mceMiddle .mceIcon {left:15px; top:35px; width:32px; height:32px}
+.clearlooks2 .mceAlert .mceMiddle span, .clearlooks2 .mceConfirm .mceMiddle span {background:transparent;left:60px; top:35px; width:320px; height:50px; font-weight:bold; overflow:auto; white-space:normal}
+.clearlooks2 a:hover {font-weight:bold;}
+.clearlooks2 .mceAlert .mceMiddle, .clearlooks2 .mceConfirm .mceMiddle {background:#D6D7D5}
+.clearlooks2 .mceAlert .mceOk {left:50%; top:auto; margin-left: -40px}
+.clearlooks2 .mceAlert .mceIcon {background:url(img/alert.gif)}
+.clearlooks2 .mceConfirm .mceOk {left:50%; top:auto; margin-left: -90px}
+.clearlooks2 .mceConfirm .mceCancel {left:50%; top:auto}
+.clearlooks2 .mceConfirm .mceIcon {background:url(img/confirm.gif)}
Index: admin/js/tiny_mce/plugins/inlinepopups/template.htm
===================================================================
--- admin/js/tiny_mce/plugins/inlinepopups/template.htm	(revision 428)
+++ admin/js/tiny_mce/plugins/inlinepopups/template.htm	(revision 428)
@@ -0,0 +1,387 @@
+<!-- <!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">
+<head>
+<title>Template for dialogs</title>
+<link rel="stylesheet" type="text/css" href="skins/clearlooks2/window.css" />
+</head>
+<body>
+
+<div class="mceEditor">
+	<div class="clearlooks2" style="width:400px; height:100px; left:10px;">
+		<div class="mceWrapper">
+			<div class="mceTop">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Blured</span>
+			</div>
+
+			<div class="mceMiddle">
+				<div class="mceLeft"></div>
+				<span>Content</span>
+				<div class="mceRight"></div>
+			</div>
+
+			<div class="mceBottom">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Statusbar text.</span>
+			</div>
+
+			<a class="mceMove" href="#"></a>
+			<a class="mceMin" href="#"></a>
+			<a class="mceMax" href="#"></a>
+			<a class="mceMed" href="#"></a>
+			<a class="mceClose" href="#"></a>
+			<a class="mceResize mceResizeN" href="#"></a>
+			<a class="mceResize mceResizeS" href="#"></a>
+			<a class="mceResize mceResizeW" href="#"></a>
+			<a class="mceResize mceResizeE" href="#"></a>
+			<a class="mceResize mceResizeNW" href="#"></a>
+			<a class="mceResize mceResizeNE" href="#"></a>
+			<a class="mceResize mceResizeSW" href="#"></a>
+			<a class="mceResize mceResizeSE" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:100px; left:420px;">
+		<div class="mceWrapper mceMovable mceFocus">
+			<div class="mceTop">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Focused</span>
+			</div>
+
+			<div class="mceMiddle">
+				<div class="mceLeft"></div>
+				<span>Content</span>
+				<div class="mceRight"></div>
+			</div>
+
+			<div class="mceBottom">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Statusbar text.</span>
+			</div>
+
+			<a class="mceMove" href="#"></a>
+			<a class="mceMin" href="#"></a>
+			<a class="mceMax" href="#"></a>
+			<a class="mceMed" href="#"></a>
+			<a class="mceClose" href="#"></a>
+			<a class="mceResize mceResizeN" href="#"></a>
+			<a class="mceResize mceResizeS" href="#"></a>
+			<a class="mceResize mceResizeW" href="#"></a>
+			<a class="mceResize mceResizeE" href="#"></a>
+			<a class="mceResize mceResizeNW" href="#"></a>
+			<a class="mceResize mceResizeNE" href="#"></a>
+			<a class="mceResize mceResizeSW" href="#"></a>
+			<a class="mceResize mceResizeSE" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:100px; left:10px; top:120px;">
+		<div class="mceWrapper mceMovable mceFocus mceStatusbar">
+			<div class="mceTop">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Statusbar</span>
+			</div>
+
+			<div class="mceMiddle">
+				<div class="mceLeft"></div>
+				<span>Content</span>
+				<div class="mceRight"></div>
+			</div>
+
+			<div class="mceBottom">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Statusbar text.</span>
+			</div>
+
+			<a class="mceMove" href="#"></a>
+			<a class="mceMin" href="#"></a>
+			<a class="mceMax" href="#"></a>
+			<a class="mceMed" href="#"></a>
+			<a class="mceClose" href="#"></a>
+			<a class="mceResize mceResizeN" href="#"></a>
+			<a class="mceResize mceResizeS" href="#"></a>
+			<a class="mceResize mceResizeW" href="#"></a>
+			<a class="mceResize mceResizeE" href="#"></a>
+			<a class="mceResize mceResizeNW" href="#"></a>
+			<a class="mceResize mceResizeNE" href="#"></a>
+			<a class="mceResize mceResizeSW" href="#"></a>
+			<a class="mceResize mceResizeSE" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:100px; left:420px; top:120px;">
+		<div class="mceWrapper mceMovable mceFocus mceStatusbar mceResizable">
+			<div class="mceTop">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Statusbar, Resizable</span>
+			</div>
+
+			<div class="mceMiddle">
+				<div class="mceLeft"></div>
+				<span>Content</span>
+				<div class="mceRight"></div>
+			</div>
+
+			<div class="mceBottom">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Statusbar text.</span>
+			</div>
+
+			<a class="mceMove" href="#"></a>
+			<a class="mceMin" href="#"></a>
+			<a class="mceMax" href="#"></a>
+			<a class="mceMed" href="#"></a>
+			<a class="mceClose" href="#"></a>
+			<a class="mceResize mceResizeN" href="#"></a>
+			<a class="mceResize mceResizeS" href="#"></a>
+			<a class="mceResize mceResizeW" href="#"></a>
+			<a class="mceResize mceResizeE" href="#"></a>
+			<a class="mceResize mceResizeNW" href="#"></a>
+			<a class="mceResize mceResizeNE" href="#"></a>
+			<a class="mceResize mceResizeSW" href="#"></a>
+			<a class="mceResize mceResizeSE" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:100px; left:10px; top:230px;">
+		<div class="mceWrapper mceMovable mceFocus mceResizable mceMaximizable">
+			<div class="mceTop">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Resizable, Maximizable</span>
+			</div>
+
+			<div class="mceMiddle">
+				<div class="mceLeft"></div>
+				<span>Content</span>
+				<div class="mceRight"></div>
+			</div>
+
+			<div class="mceBottom">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Statusbar text.</span>
+			</div>
+
+			<a class="mceMove" href="#"></a>
+			<a class="mceMin" href="#"></a>
+			<a class="mceMax" href="#"></a>
+			<a class="mceMed" href="#"></a>
+			<a class="mceClose" href="#"></a>
+			<a class="mceResize mceResizeN" href="#"></a>
+			<a class="mceResize mceResizeS" href="#"></a>
+			<a class="mceResize mceResizeW" href="#"></a>
+			<a class="mceResize mceResizeE" href="#"></a>
+			<a class="mceResize mceResizeNW" href="#"></a>
+			<a class="mceResize mceResizeNE" href="#"></a>
+			<a class="mceResize mceResizeSW" href="#"></a>
+			<a class="mceResize mceResizeSE" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:100px; left:420px; top:230px;">
+		<div class="mceWrapper mceMovable mceStatusbar mceResizable mceMaximizable">
+			<div class="mceTop">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Blurred, Maximizable, Statusbar, Resizable</span>
+			</div>
+
+			<div class="mceMiddle">
+				<div class="mceLeft"></div>
+				<span>Content</span>
+				<div class="mceRight"></div>
+			</div>
+
+			<div class="mceBottom">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Statusbar text.</span>
+			</div>
+
+			<a class="mceMove" href="#"></a>
+			<a class="mceMin" href="#"></a>
+			<a class="mceMax" href="#"></a>
+			<a class="mceMed" href="#"></a>
+			<a class="mceClose" href="#"></a>
+			<a class="mceResize mceResizeN" href="#"></a>
+			<a class="mceResize mceResizeS" href="#"></a>
+			<a class="mceResize mceResizeW" href="#"></a>
+			<a class="mceResize mceResizeE" href="#"></a>
+			<a class="mceResize mceResizeNW" href="#"></a>
+			<a class="mceResize mceResizeNE" href="#"></a>
+			<a class="mceResize mceResizeSW" href="#"></a>
+			<a class="mceResize mceResizeSE" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:100px; left:10px; top:340px;">
+		<div class="mceWrapper mceMovable mceFocus mceResizable mceMaximized mceMinimizable mceMaximizable">
+			<div class="mceTop">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Maximized, Maximizable, Minimizable</span>
+			</div>
+
+			<div class="mceMiddle">
+				<div class="mceLeft"></div>
+				<span>Content</span>
+				<div class="mceRight"></div>
+			</div>
+
+			<div class="mceBottom">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Statusbar text.</span>
+			</div>
+
+			<a class="mceMove" href="#"></a>
+			<a class="mceMin" href="#"></a>
+			<a class="mceMax" href="#"></a>
+			<a class="mceMed" href="#"></a>
+			<a class="mceClose" href="#"></a>
+			<a class="mceResize mceResizeN" href="#"></a>
+			<a class="mceResize mceResizeS" href="#"></a>
+			<a class="mceResize mceResizeW" href="#"></a>
+			<a class="mceResize mceResizeE" href="#"></a>
+			<a class="mceResize mceResizeNW" href="#"></a>
+			<a class="mceResize mceResizeNE" href="#"></a>
+			<a class="mceResize mceResizeSW" href="#"></a>
+			<a class="mceResize mceResizeSE" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:100px; left:420px; top:340px;">
+		<div class="mceWrapper mceMovable mceStatusbar mceResizable mceMaximized mceMinimizable mceMaximizable">
+			<div class="mceTop">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Blured</span>
+			</div>
+
+			<div class="mceMiddle">
+				<div class="mceLeft"></div>
+				<span>Content</span>
+				<div class="mceRight"></div>
+			</div>
+
+			<div class="mceBottom">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Statusbar text.</span>
+			</div>
+
+			<a class="mceMove" href="#"></a>
+			<a class="mceMin" href="#"></a>
+			<a class="mceMax" href="#"></a>
+			<a class="mceMed" href="#"></a>
+			<a class="mceClose" href="#"></a>
+			<a class="mceResize mceResizeN" href="#"></a>
+			<a class="mceResize mceResizeS" href="#"></a>
+			<a class="mceResize mceResizeW" href="#"></a>
+			<a class="mceResize mceResizeE" href="#"></a>
+			<a class="mceResize mceResizeNW" href="#"></a>
+			<a class="mceResize mceResizeNE" href="#"></a>
+			<a class="mceResize mceResizeSW" href="#"></a>
+			<a class="mceResize mceResizeSE" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:130px; left:10px; top:450px;">
+		<div class="mceWrapper mceMovable mceFocus mceModal mceAlert">
+			<div class="mceTop">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Alert</span>
+			</div>
+
+			<div class="mceMiddle">
+				<div class="mceLeft"></div>
+				<span>
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+				</span>
+				<div class="mceRight"></div>
+				<div class="mceIcon"></div>
+			</div>
+
+			<div class="mceBottom">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+			</div>
+
+			<a class="mceMove" href="#"></a>
+			<a class="mceButton mceOk" href="#">Ok</a>
+			<a class="mceClose" href="#"></a>
+		</div>
+	</div>
+
+	<div class="clearlooks2" style="width:400px; height:130px; left:420px; top:450px;">
+		<div class="mceWrapper mceMovable mceFocus mceModal mceConfirm">
+			<div class="mceTop">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+				<span>Confirm</span>
+			</div>
+
+			<div class="mceMiddle">
+				<div class="mceLeft"></div>
+				<span>
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					This is a very long error message. This is a very long error message.
+					</span>
+				<div class="mceRight"></div>
+				<div class="mceIcon"></div>
+			</div>
+
+			<div class="mceBottom">
+				<div class="mceLeft"></div>
+				<div class="mceCenter"></div>
+				<div class="mceRight"></div>
+			</div>
+
+			<a class="mceMove" href="#"></a>
+			<a class="mceButton mceOk" href="#">Ok</a>
+			<a class="mceButton mceCancel" href="#">Cancel</a>
+			<a class="mceClose" href="#"></a>
+		</div>
+	</div>
+</div>
+
+</body>
+</html>
Index: admin/js/tiny_mce/plugins/paste/editor_plugin.js
===================================================================
--- admin/js/tiny_mce/plugins/paste/editor_plugin.js	(revision 307)
+++ admin/js/tiny_mce/plugins/paste/editor_plugin.js	(revision 307)
@@ -0,0 +1,1 @@
+(function(){var c=tinymce.each,a={paste_auto_cleanup_on_paste:true,paste_enable_default_filters:true,paste_block_drop:false,paste_retain_style_properties:"none",paste_strip_class_attributes:"mso",paste_remove_spans:false,paste_remove_styles:false,paste_remove_styles_if_webkit:true,paste_convert_middot_lists:true,paste_convert_headers_to_strong:false,paste_dialog_width:"450",paste_dialog_height:"400",paste_text_use_dialog:false,paste_text_sticky:false,paste_text_sticky_default:false,paste_text_notifyalways:false,paste_text_linebreaktype:"p",paste_text_replacements:[[/\u2026/g,"..."],[/[\x93\x94\u201c\u201d]/g,'"'],[/[\x60\x91\x92\u2018\u2019]/g,"'"]]};function b(d,e){return d.getParam(e,a[e])}tinymce.create("tinymce.plugins.PastePlugin",{init:function(d,e){var f=this;f.editor=d;f.url=e;f.onPreProcess=new tinymce.util.Dispatcher(f);f.onPostProcess=new tinymce.util.Dispatcher(f);f.onPreProcess.add(f._preProcess);f.onPostProcess.add(f._postProcess);f.onPreProcess.add(function(i,j){d.execCallback("paste_preprocess",i,j)});f.onPostProcess.add(function(i,j){d.execCallback("paste_postprocess",i,j)});d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){return false}});d.pasteAsPlainText=b(d,"paste_text_sticky_default");function h(m,k){var l=d.dom,i,j;f.onPreProcess.dispatch(f,m);m.node=l.create("div",0,m.content);if(tinymce.isGecko){i=d.selection.getRng(true);if(i.startContainer==i.endContainer&&i.startContainer.nodeType==3){j=l.select("p,h1,h2,h3,h4,h5,h6,pre",m.node);if(j.length==1&&m.content.indexOf("__MCE_ITEM__")===-1){l.remove(j.reverse(),true)}}}f.onPostProcess.dispatch(f,m);m.content=d.serializer.serialize(m.node,{getInner:1});if((!k)&&(d.pasteAsPlainText)){f._insertPlainText(d,l,m.content);if(!b(d,"paste_text_sticky")){d.pasteAsPlainText=false;d.controlManager.setActive("pastetext",false)}}else{f._insert(m.content)}}d.addCommand("mceInsertClipboardContent",function(i,j){h(j,true)});if(!b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(j,i){var k=tinymce.util.Cookie;d.pasteAsPlainText=!d.pasteAsPlainText;d.controlManager.setActive("pastetext",d.pasteAsPlainText);if((d.pasteAsPlainText)&&(!k.get("tinymcePasteText"))){if(b(d,"paste_text_sticky")){d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}else{d.windowManager.alert(d.translate("paste.plaintext_mode_sticky"))}if(!b(d,"paste_text_notifyalways")){k.set("tinymcePasteText","1",new Date(new Date().getFullYear()+1,12,31))}}})}d.addButton("pastetext",{title:"paste.paste_text_desc",cmd:"mcePasteText"});d.addButton("selectall",{title:"paste.selectall_desc",cmd:"selectall"});function g(s){var l,p,j,t,k=d.selection,o=d.dom,q=d.getBody(),i,r;if(s.clipboardData||o.doc.dataTransfer){r=(s.clipboardData||o.doc.dataTransfer).getData("Text");if(d.pasteAsPlainText){s.preventDefault();h({content:r.replace(/\r?\n/g,"<br />")});return}}if(o.get("_mcePaste")){return}l=o.add(q,"div",{id:"_mcePaste","class":"mcePaste","data-mce-bogus":"1"},"\uFEFF\uFEFF");if(q!=d.getDoc().body){i=o.getPos(d.selection.getStart(),q).y}else{i=q.scrollTop+o.getViewPort().y}o.setStyles(l,{position:"absolute",left:-10000,top:i,width:1,height:1,overflow:"hidden"});if(tinymce.isIE){t=k.getRng();j=o.doc.body.createTextRange();j.moveToElementText(l);j.execCommand("Paste");o.remove(l);if(l.innerHTML==="\uFEFF\uFEFF"){d.execCommand("mcePasteWord");s.preventDefault();return}k.setRng(t);k.setContent("");setTimeout(function(){h({content:l.innerHTML})},0);return tinymce.dom.Event.cancel(s)}else{function m(n){n.preventDefault()}o.bind(d.getDoc(),"mousedown",m);o.bind(d.getDoc(),"keydown",m);p=d.selection.getRng();l=l.firstChild;j=d.getDoc().createRange();j.setStart(l,0);j.setEnd(l,2);k.setRng(j);window.setTimeout(function(){var u="",n;if(!o.select("div.mcePaste > div.mcePaste").length){n=o.select("div.mcePaste");c(n,function(w){var v=w.firstChild;if(v&&v.nodeName=="DIV"&&v.style.marginTop&&v.style.backgroundColor){o.remove(v,1)}c(o.select("span.Apple-style-span",w),function(x){o.remove(x,1)});c(o.select("br[data-mce-bogus]",w),function(x){o.remove(x)});if(w.parentNode.className!="mcePaste"){u+=w.innerHTML}})}else{u="<pre>"+o.encode(r).replace(/\r?\n/g,"<br />")+"</pre>"}c(o.select("div.mcePaste"),function(v){o.remove(v)});if(p){k.setRng(p)}h({content:u});o.unbind(d.getDoc(),"mousedown",m);o.unbind(d.getDoc(),"keydown",m)},0)}}if(b(d,"paste_auto_cleanup_on_paste")){if(tinymce.isOpera||/Firefox\/2/.test(navigator.userAgent)){d.onKeyDown.addToTop(function(i,j){if(((tinymce.isMac?j.metaKey:j.ctrlKey)&&j.keyCode==86)||(j.shiftKey&&j.keyCode==45)){g(j)}})}else{d.onPaste.addToTop(function(i,j){return g(j)})}}d.onInit.add(function(){d.controlManager.setActive("pastetext",d.pasteAsPlainText);if(b(d,"paste_block_drop")){d.dom.bind(d.getBody(),["dragend","dragover","draggesture","dragdrop","drop","drag"],function(i){i.preventDefault();i.stopPropagation();return false})}});f._legacySupport()},getInfo:function(){return{longname:"Paste text/word",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_preProcess:function(g,e){var k=this.editor,j=e.content,p=tinymce.grep,n=tinymce.explode,f=tinymce.trim,l,i;function d(h){c(h,function(o){if(o.constructor==RegExp){j=j.replace(o,"")}else{j=j.replace(o[0],o[1])}})}if(k.settings.paste_enable_default_filters==false){return}if(tinymce.isIE&&document.documentMode>=9){d([[/(?:<br>&nbsp;[\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br>&nbsp;[\s\r\n]+|<br>)*/g,"$1"]])}if(/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(j)||e.wordContent){e.wordContent=true;d([/^\s*(&nbsp;)+/gi,/(&nbsp;|<br[^>]*>)+\s*$/gi]);if(b(k,"paste_convert_headers_to_strong")){j=j.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi,"<p><strong>$1</strong></p>")}if(b(k,"paste_convert_middot_lists")){d([[/<!--\[if !supportLists\]-->/gi,"$&__MCE_ITEM__"],[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi,"$1__MCE_ITEM__"],[/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi,"$1__MCE_ITEM__"]])}d([/<!--[\s\S]+?-->/gi,/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,[/<(\/?)s>/gi,"<$1strike>"],[/&nbsp;/gi,"\u00a0"]]);do{l=j.length;j=j.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi,"$1")}while(l!=j.length);if(b(k,"paste_retain_style_properties").replace(/^none$/i,"").length==0){j=j.replace(/<\/?span[^>]*>/gi,"")}else{d([[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,function(o,h){return(h.length>0)?h.replace(/./," ").slice(Math.floor(h.length/2)).split("").join("\u00a0"):""}],[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,function(t,h,r){var u=[],o=0,q=n(f(r).replace(/&quot;/gi,"'"),";");c(q,function(s){var w,y,z=n(s,":");function x(A){return A+((A!=="0")&&(/\d$/.test(A)))?"px":""}if(z.length==2){w=z[0].toLowerCase();y=z[1].toLowerCase();switch(w){case"mso-padding-alt":case"mso-padding-top-alt":case"mso-padding-right-alt":case"mso-padding-bottom-alt":case"mso-padding-left-alt":case"mso-margin-alt":case"mso-margin-top-alt":case"mso-margin-right-alt":case"mso-margin-bottom-alt":case"mso-margin-left-alt":case"mso-table-layout-alt":case"mso-height":case"mso-width":case"mso-vertical-align-alt":u[o++]=w.replace(/^mso-|-alt$/g,"")+":"+x(y);return;case"horiz-align":u[o++]="text-align:"+y;return;case"vert-align":u[o++]="vertical-align:"+y;return;case"font-color":case"mso-foreground":u[o++]="color:"+y;return;case"mso-background":case"mso-highlight":u[o++]="background:"+y;return;case"mso-default-height":u[o++]="min-height:"+x(y);return;case"mso-default-width":u[o++]="min-width:"+x(y);return;case"mso-padding-between-alt":u[o++]="border-collapse:separate;border-spacing:"+x(y);return;case"text-line-through":if((y=="single")||(y=="double")){u[o++]="text-decoration:line-through"}return;case"mso-zero-height":if(y=="yes"){u[o++]="display:none"}return}if(/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(w)){return}u[o++]=w+":"+z[1]}});if(o>0){return h+' style="'+u.join(";")+'"'}else{return h}}]])}}if(b(k,"paste_convert_headers_to_strong")){d([[/<h[1-6][^>]*>/gi,"<p><strong>"],[/<\/h[1-6][^>]*>/gi,"</strong></p>"]])}d([[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi,""]]);i=b(k,"paste_strip_class_attributes");if(i!=="none"){function m(q,o){if(i==="all"){return""}var h=p(n(o.replace(/^(["'])(.*)\1$/,"$2")," "),function(r){return(/^(?!mso)/i.test(r))});return h.length?' class="'+h.join(" ")+'"':""}j=j.replace(/ class="([^"]+)"/gi,m);j=j.replace(/ class=([\-\w]+)/gi,m)}if(b(k,"paste_remove_spans")){j=j.replace(/<\/?span[^>]*>/gi,"")}e.content=j},_postProcess:function(g,i){var f=this,e=f.editor,h=e.dom,d;if(e.settings.paste_enable_default_filters==false){return}if(i.wordContent){c(h.select("a",i.node),function(j){if(!j.href||j.href.indexOf("#_Toc")!=-1){h.remove(j,1)}});if(b(e,"paste_convert_middot_lists")){f._convertLists(g,i)}d=b(e,"paste_retain_style_properties");if((tinymce.is(d,"string"))&&(d!=="all")&&(d!=="*")){d=tinymce.explode(d.replace(/^none$/i,""));c(h.select("*",i.node),function(m){var n={},k=0,l,o,j;if(d){for(l=0;l<d.length;l++){o=d[l];j=h.getStyle(m,o);if(j){n[o]=j;k++}}}h.setAttrib(m,"style","");if(d&&k>0){h.setStyles(m,n)}else{if(m.nodeName=="SPAN"&&!m.className){h.remove(m,true)}}})}}if(b(e,"paste_remove_styles")||(b(e,"paste_remove_styles_if_webkit")&&tinymce.isWebKit)){c(h.select("*[style]",i.node),function(j){j.removeAttribute("style");j.removeAttribute("data-mce-style")})}else{if(tinymce.isWebKit){c(h.select("*",i.node),function(j){j.removeAttribute("data-mce-style")})}}},_convertLists:function(g,e){var i=g.editor.dom,h,l,d=-1,f,m=[],k,j;c(i.select("p",e.node),function(t){var q,u="",s,r,n,o;for(q=t.firstChild;q&&q.nodeType==3;q=q.nextSibling){u+=q.nodeValue}u=t.innerHTML.replace(/<\/?\w+[^>]*>/gi,"").replace(/&nbsp;/g,"\u00a0");if(/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(u)){s="ul"}if(/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(u)){s="ol"}if(s){f=parseFloat(t.style.marginLeft||0);if(f>d){m.push(f)}if(!h||s!=k){h=i.create(s);i.insertAfter(h,t)}else{if(f>d){h=l.appendChild(i.create(s))}else{if(f<d){n=tinymce.inArray(m,f);o=i.getParents(h.parentNode,s);h=o[o.length-1-n]||h}}}c(i.select("span",t),function(v){var p=v.innerHTML.replace(/<\/?\w+[^>]*>/gi,"");if(s=="ul"&&/^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(p)){i.remove(v)}else{if(/^__MCE_ITEM__[\s\S]*\w+\.(&nbsp;|\u00a0)*\s*/.test(p)){i.remove(v)}}});r=t.innerHTML;if(s=="ul"){r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*(&nbsp;|\u00a0)+\s*/,"")}else{r=t.innerHTML.replace(/__MCE_ITEM__/g,"").replace(/^\s*\w+\.(&nbsp;|\u00a0)+\s*/,"")}l=h.appendChild(i.create("li",0,r));i.remove(t);d=f;k=s}else{h=d=0}});j=e.node.innerHTML;if(j.indexOf("__MCE_ITEM__")!=-1){e.node.innerHTML=j.replace(/__MCE_ITEM__/g,"")}},_insert:function(f,d){var e=this.editor,g=e.selection.getRng();if(!e.selection.isCollapsed()&&g.startContainer!=g.endContainer){e.getDoc().execCommand("Delete",false,null)}e.execCommand("mceInsertContent",false,f,{skip_undo:d})},_insertPlainText:function(j,x,v){var t,u,l,k,r,e,p,f,n=j.getWin(),z=j.getDoc(),s=j.selection,m=tinymce.is,y=tinymce.inArray,g=b(j,"paste_text_linebreaktype"),o=b(j,"paste_text_replacements");function q(d){c(d,function(h){if(h.constructor==RegExp){v=v.replace(h,"")}else{v=v.replace(h[0],h[1])}})}if((typeof(v)==="string")&&(v.length>0)){if(/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(v)){q([/[\n\r]+/g])}else{q([/\r+/g])}q([[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi,"\n\n"],[/<br[^>]*>|<\/tr>/gi,"\n"],[/<\/t[dh]>\s*<t[dh][^>]*>/gi,"\t"],/<[a-z!\/?][^>]*>/gi,[/&nbsp;/gi," "],[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi,"$1"],[/\n{3,}/g,"\n\n"],/^\s+|\s+$/g]);v=x.decode(tinymce.html.Entities.encodeRaw(v));if(!s.isCollapsed()){z.execCommand("Delete",false,null)}if(m(o,"array")||(m(o,"array"))){q(o)}else{if(m(o,"string")){q(new RegExp(o,"gi"))}}if(g=="none"){q([[/\n+/g," "]])}else{if(g=="br"){q([[/\n/g,"<br />"]])}else{q([/^\s+|\s+$/g,[/\n\n/g,"</p><p>"],[/\n/g,"<br />"]])}}if((l=v.indexOf("</p><p>"))!=-1){k=v.lastIndexOf("</p><p>");r=s.getNode();e=[];do{if(r.nodeType==1){if(r.nodeName=="TD"||r.nodeName=="BODY"){break}e[e.length]=r}}while(r=r.parentNode);if(e.length>0){p=v.substring(0,l);f="";for(t=0,u=e.length;t<u;t++){p+="</"+e[t].nodeName.toLowerCase()+">";f+="<"+e[e.length-t-1].nodeName.toLowerCase()+">"}if(l==k){v=p+f+v.substring(l+7)}else{v=p+v.substring(l+4,k+4)+f+v.substring(k+7)}}}j.execCommand("mceInsertRawHTML",false,v+'<span id="_plain_text_marker">&nbsp;</span>');window.setTimeout(function(){var d=x.get("_plain_text_marker"),A,h,w,i;s.select(d,false);z.execCommand("Delete",false,null);d=null;A=s.getStart();h=x.getViewPort(n);w=x.getPos(A).y;i=A.clientHeight;if((w<h.y)||(w+i>h.y+h.h)){z.body.scrollTop=w<h.y?w:w-h.h+25}},0)}},_legacySupport:function(){var e=this,d=e.editor;d.addCommand("mcePasteWord",function(){d.windowManager.open({file:e.url+"/pasteword.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})});if(b(d,"paste_text_use_dialog")){d.addCommand("mcePasteText",function(){d.windowManager.open({file:e.url+"/pastetext.htm",width:parseInt(b(d,"paste_dialog_width")),height:parseInt(b(d,"paste_dialog_height")),inline:1})})}d.addButton("pasteword",{title:"paste.paste_word_desc",cmd:"mcePasteWord"})}});tinymce.PluginManager.add("paste",tinymce.plugins.PastePlugin)})();
Index: admin/js/tiny_mce/plugins/paste/editor_plugin_src.js
===================================================================
--- admin/js/tiny_mce/plugins/paste/editor_plugin_src.js	(revision 307)
+++ admin/js/tiny_mce/plugins/paste/editor_plugin_src.js	(revision 307)
@@ -0,0 +1,933 @@
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(function() {
+	var each = tinymce.each,
+		defs = {
+			paste_auto_cleanup_on_paste : true,
+			paste_enable_default_filters : true,
+			paste_block_drop : false,
+			paste_retain_style_properties : "none",
+			paste_strip_class_attributes : "mso",
+			paste_remove_spans : false,
+			paste_remove_styles : false,
+			paste_remove_styles_if_webkit : true,
+			paste_convert_middot_lists : true,
+			paste_convert_headers_to_strong : false,
+			paste_dialog_width : "450",
+			paste_dialog_height : "400",
+			paste_text_use_dialog : false,
+			paste_text_sticky : false,
+			paste_text_sticky_default : false,
+			paste_text_notifyalways : false,
+			paste_text_linebreaktype : "p",
+			paste_text_replacements : [
+				[/\u2026/g, "..."],
+				[/[\x93\x94\u201c\u201d]/g, '"'],
+				[/[\x60\x91\x92\u2018\u2019]/g, "'"]
+			]
+		};
+
+	function getParam(ed, name) {
+		return ed.getParam(name, defs[name]);
+	}
+
+	tinymce.create('tinymce.plugins.PastePlugin', {
+		init : function(ed, url) {
+			var t = this;
+
+			t.editor = ed;
+			t.url = url;
+
+			// Setup plugin events
+			t.onPreProcess = new tinymce.util.Dispatcher(t);
+			t.onPostProcess = new tinymce.util.Dispatcher(t);
+
+			// Register default handlers
+			t.onPreProcess.add(t._preProcess);
+			t.onPostProcess.add(t._postProcess);
+
+			// Register optional preprocess handler
+			t.onPreProcess.add(function(pl, o) {
+				ed.execCallback('paste_preprocess', pl, o);
+			});
+
+			// Register optional postprocess
+			t.onPostProcess.add(function(pl, o) {
+				ed.execCallback('paste_postprocess', pl, o);
+			});
+
+			ed.onKeyDown.addToTop(function(ed, e) {
+				// Block ctrl+v from adding an undo level since the default logic in tinymce.Editor will add that
+				if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
+					return false; // Stop other listeners
+			});
+
+			// Initialize plain text flag
+			ed.pasteAsPlainText = getParam(ed, 'paste_text_sticky_default');
+
+			// This function executes the process handlers and inserts the contents
+			// force_rich overrides plain text mode set by user, important for pasting with execCommand
+			function process(o, force_rich) {
+				var dom = ed.dom, rng, nodes;
+
+				// Execute pre process handlers
+				t.onPreProcess.dispatch(t, o);
+
+				// Create DOM structure
+				o.node = dom.create('div', 0, o.content);
+
+				// If pasting inside the same element and the contents is only one block
+				// remove the block and keep the text since Firefox will copy parts of pre and h1-h6 as a pre element
+				if (tinymce.isGecko) {
+					rng = ed.selection.getRng(true);
+					if (rng.startContainer == rng.endContainer && rng.startContainer.nodeType == 3) {
+						nodes = dom.select('p,h1,h2,h3,h4,h5,h6,pre', o.node);
+
+						// Is only one block node and it doesn't contain word stuff
+						if (nodes.length == 1 && o.content.indexOf('__MCE_ITEM__') === -1)
+							dom.remove(nodes.reverse(), true);
+					}
+				}
+
+				// Execute post process handlers
+				t.onPostProcess.dispatch(t, o);
+
+				// Serialize content
+				o.content = ed.serializer.serialize(o.node, {getInner : 1});
+
+				// Plain text option active?
+				if ((!force_rich) && (ed.pasteAsPlainText)) {
+					t._insertPlainText(ed, dom, o.content);
+
+					if (!getParam(ed, "paste_text_sticky")) {
+						ed.pasteAsPlainText = false;
+						ed.controlManager.setActive("pastetext", false);
+					}
+				} else {
+					t._insert(o.content);
+				}
+			}
+
+			// Add command for external usage
+			ed.addCommand('mceInsertClipboardContent', function(u, o) {
+				process(o, true);
+			});
+
+			if (!getParam(ed, "paste_text_use_dialog")) {
+				ed.addCommand('mcePasteText', function(u, v) {
+					var cookie = tinymce.util.Cookie;
+
+					ed.pasteAsPlainText = !ed.pasteAsPlainText;
+					ed.controlManager.setActive('pastetext', ed.pasteAsPlainText);
+
+					if ((ed.pasteAsPlainText) && (!cookie.get("tinymcePasteText"))) {
+						if (getParam(ed, "paste_text_sticky")) {
+							ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky'));
+						} else {
+							ed.windowManager.alert(ed.translate('paste.plaintext_mode_sticky'));
+						}
+
+						if (!getParam(ed, "paste_text_notifyalways")) {
+							cookie.set("tinymcePasteText", "1", new Date(new Date().getFullYear() + 1, 12, 31))
+						}
+					}
+				});
+			}
+
+			ed.addButton('pastetext', {title: 'paste.paste_text_desc', cmd: 'mcePasteText'});
+			ed.addButton('selectall', {title: 'paste.selectall_desc', cmd: 'selectall'});
+
+			// This function grabs the contents from the clipboard by adding a
+			// hidden div and placing the caret inside it and after the browser paste
+			// is done it grabs that contents and processes that
+			function grabContent(e) {
+				var n, or, rng, oldRng, sel = ed.selection, dom = ed.dom, body = ed.getBody(), posY, textContent;
+
+				// Check if browser supports direct plaintext access
+				if (e.clipboardData || dom.doc.dataTransfer) {
+					textContent = (e.clipboardData || dom.doc.dataTransfer).getData('Text');
+
+					if (ed.pasteAsPlainText) {
+						e.preventDefault();
+						process({content : textContent.replace(/\r?\n/g, '<br />')});
+						return;
+					}
+				}
+
+				if (dom.get('_mcePaste'))
+					return;
+
+				// Create container to paste into
+				n = dom.add(body, 'div', {id : '_mcePaste', 'class' : 'mcePaste', 'data-mce-bogus' : '1'}, '\uFEFF\uFEFF');
+
+				// If contentEditable mode we need to find out the position of the closest element
+				if (body != ed.getDoc().body)
+					posY = dom.getPos(ed.selection.getStart(), body).y;
+				else
+					posY = body.scrollTop + dom.getViewPort().y;
+
+				// Styles needs to be applied after the element is added to the document since WebKit will otherwise remove all styles
+				dom.setStyles(n, {
+					position : 'absolute',
+					left : -10000,
+					top : posY,
+					width : 1,
+					height : 1,
+					overflow : 'hidden'
+				});
+
+				if (tinymce.isIE) {
+					// Store away the old range
+					oldRng = sel.getRng();
+
+					// Select the container
+					rng = dom.doc.body.createTextRange();
+					rng.moveToElementText(n);
+					rng.execCommand('Paste');
+
+					// Remove container
+					dom.remove(n);
+
+					// Check if the contents was changed, if it wasn't then clipboard extraction failed probably due
+					// to IE security settings so we pass the junk though better than nothing right
+					if (n.innerHTML === '\uFEFF\uFEFF') {
+						ed.execCommand('mcePasteWord');
+						e.preventDefault();
+						return;
+					}
+
+					// Restore the old range and clear the contents before pasting
+					sel.setRng(oldRng);
+					sel.setContent('');
+
+					// For some odd reason we need to detach the the mceInsertContent call from the paste event
+					// It's like IE has a reference to the parent element that you paste in and the selection gets messed up
+					// when it tries to restore the selection
+					setTimeout(function() {
+						// Process contents
+						process({content : n.innerHTML});
+					}, 0);
+
+					// Block the real paste event
+					return tinymce.dom.Event.cancel(e);
+				} else {
+					function block(e) {
+						e.preventDefault();
+					};
+
+					// Block mousedown and click to prevent selection change
+					dom.bind(ed.getDoc(), 'mousedown', block);
+					dom.bind(ed.getDoc(), 'keydown', block);
+
+					or = ed.selection.getRng();
+
+					// Move select contents inside DIV
+					n = n.firstChild;
+					rng = ed.getDoc().createRange();
+					rng.setStart(n, 0);
+					rng.setEnd(n, 2);
+					sel.setRng(rng);
+
+					// Wait a while and grab the pasted contents
+					window.setTimeout(function() {
+						var h = '', nl;
+
+						// Paste divs duplicated in paste divs seems to happen when you paste plain text so lets first look for that broken behavior in WebKit
+						if (!dom.select('div.mcePaste > div.mcePaste').length) {
+							nl = dom.select('div.mcePaste');
+
+							// WebKit will split the div into multiple ones so this will loop through then all and join them to get the whole HTML string
+							each(nl, function(n) {
+								var child = n.firstChild;
+
+								// WebKit inserts a DIV container with lots of odd styles
+								if (child && child.nodeName == 'DIV' && child.style.marginTop && child.style.backgroundColor) {
+									dom.remove(child, 1);
+								}
+
+								// Remove apply style spans
+								each(dom.select('span.Apple-style-span', n), function(n) {
+									dom.remove(n, 1);
+								});
+
+								// Remove bogus br elements
+								each(dom.select('br[data-mce-bogus]', n), function(n) {
+									dom.remove(n);
+								});
+
+								// WebKit will make a copy of the DIV for each line of plain text pasted and insert them into the DIV
+								if (n.parentNode.className != 'mcePaste')
+									h += n.innerHTML;
+							});
+						} else {
+							// Found WebKit weirdness so force the content into plain text mode
+							h = '<pre>' + dom.encode(textContent).replace(/\r?\n/g, '<br />') + '</pre>';
+						}
+
+						// Remove the nodes
+						each(dom.select('div.mcePaste'), function(n) {
+							dom.remove(n);
+						});
+
+						// Restore the old selection
+						if (or)
+							sel.setRng(or);
+
+						process({content : h});
+
+						// Unblock events ones we got the contents
+						dom.unbind(ed.getDoc(), 'mousedown', block);
+						dom.unbind(ed.getDoc(), 'keydown', block);
+					}, 0);
+				}
+			}
+
+			// Check if we should use the new auto process method			
+			if (getParam(ed, "paste_auto_cleanup_on_paste")) {
+				// Is it's Opera or older FF use key handler
+				if (tinymce.isOpera || /Firefox\/2/.test(navigator.userAgent)) {
+					ed.onKeyDown.addToTop(function(ed, e) {
+						if (((tinymce.isMac ? e.metaKey : e.ctrlKey) && e.keyCode == 86) || (e.shiftKey && e.keyCode == 45))
+							grabContent(e);
+					});
+				} else {
+					// Grab contents on paste event on Gecko and WebKit
+					ed.onPaste.addToTop(function(ed, e) {
+						return grabContent(e);
+					});
+				}
+			}
+
+			ed.onInit.add(function() {
+				ed.controlManager.setActive("pastetext", ed.pasteAsPlainText);
+
+				// Block all drag/drop events
+				if (getParam(ed, "paste_block_drop")) {
+					ed.dom.bind(ed.getBody(), ['dragend', 'dragover', 'draggesture', 'dragdrop', 'drop', 'drag'], function(e) {
+						e.preventDefault();
+						e.stopPropagation();
+
+						return false;
+					});
+				}
+			});
+
+			// Add legacy support
+			t._legacySupport();
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Paste text/word',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/paste',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		},
+
+		_preProcess : function(pl, o) {
+			var ed = this.editor,
+				h = o.content,
+				grep = tinymce.grep,
+				explode = tinymce.explode,
+				trim = tinymce.trim,
+				len, stripClass;
+
+			//console.log('Before preprocess:' + o.content);
+
+			function process(items) {
+				each(items, function(v) {
+					// Remove or replace
+					if (v.constructor == RegExp)
+						h = h.replace(v, '');
+					else
+						h = h.replace(v[0], v[1]);
+				});
+			}
+			
+			if (ed.settings.paste_enable_default_filters == false) {
+				return;
+			}
+
+			// IE9 adds BRs before/after block elements when contents is pasted from word or for example another browser
+			if (tinymce.isIE && document.documentMode >= 9)
+				process([[/(?:<br>&nbsp;[\s\r\n]+|<br>)*(<\/?(h[1-6r]|p|div|address|pre|form|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|blockquote|center|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br>&nbsp;[\s\r\n]+|<br>)*/g, '$1']]);
+
+			// Detect Word content and process it more aggressive
+			if (/class="?Mso|style="[^"]*\bmso-|w:WordDocument/i.test(h) || o.wordContent) {
+				o.wordContent = true;			// Mark the pasted contents as word specific content
+				//console.log('Word contents detected.');
+
+				// Process away some basic content
+				process([
+					/^\s*(&nbsp;)+/gi,				// &nbsp; entities at the start of contents
+					/(&nbsp;|<br[^>]*>)+\s*$/gi		// &nbsp; entities at the end of contents
+				]);
+
+				if (getParam(ed, "paste_convert_headers_to_strong")) {
+					h = h.replace(/<p [^>]*class="?MsoHeading"?[^>]*>(.*?)<\/p>/gi, "<p><strong>$1</strong></p>");
+				}
+
+				if (getParam(ed, "paste_convert_middot_lists")) {
+					process([
+						[/<!--\[if !supportLists\]-->/gi, '$&__MCE_ITEM__'],					// Convert supportLists to a list item marker
+						[/(<span[^>]+(?:mso-list:|:\s*symbol)[^>]+>)/gi, '$1__MCE_ITEM__'],		// Convert mso-list and symbol spans to item markers
+						[/(<p[^>]+(?:MsoListParagraph)[^>]+>)/gi, '$1__MCE_ITEM__']				// Convert mso-list and symbol paragraphs to item markers (FF)
+					]);
+				}
+
+				process([
+					// Word comments like conditional comments etc
+					/<!--[\s\S]+?-->/gi,
+
+					// Remove comments, scripts (e.g., msoShowComment), XML tag, VML content, MS Office namespaced tags, and a few other tags
+					/<(!|script[^>]*>.*?<\/script(?=[>\s])|\/?(\?xml(:\w+)?|img|meta|link|style|\w:\w+)(?=[\s\/>]))[^>]*>/gi,
+
+					// Convert <s> into <strike> for line-though
+					[/<(\/?)s>/gi, "<$1strike>"],
+
+					// Replace nsbp entites to char since it's easier to handle
+					[/&nbsp;/gi, "\u00a0"]
+				]);
+
+				// Remove bad attributes, with or without quotes, ensuring that attribute text is really inside a tag.
+				// If JavaScript had a RegExp look-behind, we could have integrated this with the last process() array and got rid of the loop. But alas, it does not, so we cannot.
+				do {
+					len = h.length;
+					h = h.replace(/(<[a-z][^>]*\s)(?:id|name|language|type|on\w+|\w+:\w+)=(?:"[^"]*"|\w+)\s?/gi, "$1");
+				} while (len != h.length);
+
+				// Remove all spans if no styles is to be retained
+				if (getParam(ed, "paste_retain_style_properties").replace(/^none$/i, "").length == 0) {
+					h = h.replace(/<\/?span[^>]*>/gi, "");
+				} else {
+					// We're keeping styles, so at least clean them up.
+					// CSS Reference: http://msdn.microsoft.com/en-us/library/aa155477.aspx
+
+					process([
+						// Convert <span style="mso-spacerun:yes">___</span> to string of alternating breaking/non-breaking spaces of same length
+						[/<span\s+style\s*=\s*"\s*mso-spacerun\s*:\s*yes\s*;?\s*"\s*>([\s\u00a0]*)<\/span>/gi,
+							function(str, spaces) {
+								return (spaces.length > 0)? spaces.replace(/./, " ").slice(Math.floor(spaces.length/2)).split("").join("\u00a0") : "";
+							}
+						],
+
+						// Examine all styles: delete junk, transform some, and keep the rest
+						[/(<[a-z][^>]*)\sstyle="([^"]*)"/gi,
+							function(str, tag, style) {
+								var n = [],
+									i = 0,
+									s = explode(trim(style).replace(/&quot;/gi, "'"), ";");
+
+								// Examine each style definition within the tag's style attribute
+								each(s, function(v) {
+									var name, value,
+										parts = explode(v, ":");
+
+									function ensureUnits(v) {
+										return v + ((v !== "0") && (/\d$/.test(v)))? "px" : "";
+									}
+
+									if (parts.length == 2) {
+										name = parts[0].toLowerCase();
+										value = parts[1].toLowerCase();
+
+										// Translate certain MS Office styles into their CSS equivalents
+										switch (name) {
+											case "mso-padding-alt":
+											case "mso-padding-top-alt":
+											case "mso-padding-right-alt":
+											case "mso-padding-bottom-alt":
+											case "mso-padding-left-alt":
+											case "mso-margin-alt":
+											case "mso-margin-top-alt":
+											case "mso-margin-right-alt":
+											case "mso-margin-bottom-alt":
+											case "mso-margin-left-alt":
+											case "mso-table-layout-alt":
+											case "mso-height":
+											case "mso-width":
+											case "mso-vertical-align-alt":
+												n[i++] = name.replace(/^mso-|-alt$/g, "") + ":" + ensureUnits(value);
+												return;
+
+											case "horiz-align":
+												n[i++] = "text-align:" + value;
+												return;
+
+											case "vert-align":
+												n[i++] = "vertical-align:" + value;
+												return;
+
+											case "font-color":
+											case "mso-foreground":
+												n[i++] = "color:" + value;
+												return;
+
+											case "mso-background":
+											case "mso-highlight":
+												n[i++] = "background:" + value;
+												return;
+
+											case "mso-default-height":
+												n[i++] = "min-height:" + ensureUnits(value);
+												return;
+
+											case "mso-default-width":
+												n[i++] = "min-width:" + ensureUnits(value);
+												return;
+
+											case "mso-padding-between-alt":
+												n[i++] = "border-collapse:separate;border-spacing:" + ensureUnits(value);
+												return;
+
+											case "text-line-through":
+												if ((value == "single") || (value == "double")) {
+													n[i++] = "text-decoration:line-through";
+												}
+												return;
+
+											case "mso-zero-height":
+												if (value == "yes") {
+													n[i++] = "display:none";
+												}
+												return;
+										}
+
+										// Eliminate all MS Office style definitions that have no CSS equivalent by examining the first characters in the name
+										if (/^(mso|column|font-emph|lang|layout|line-break|list-image|nav|panose|punct|row|ruby|sep|size|src|tab-|table-border|text-(?!align|decor|indent|trans)|top-bar|version|vnd|word-break)/.test(name)) {
+											return;
+										}
+
+										// If it reached this point, it must be a valid CSS style
+										n[i++] = name + ":" + parts[1];		// Lower-case name, but keep value case
+									}
+								});
+
+								// If style attribute contained any valid styles the re-write it; otherwise delete style attribute.
+								if (i > 0) {
+									return tag + ' style="' + n.join(';') + '"';
+								} else {
+									return tag;
+								}
+							}
+						]
+					]);
+				}
+			}
+
+			// Replace headers with <strong>
+			if (getParam(ed, "paste_convert_headers_to_strong")) {
+				process([
+					[/<h[1-6][^>]*>/gi, "<p><strong>"],
+					[/<\/h[1-6][^>]*>/gi, "</strong></p>"]
+				]);
+			}
+
+			process([
+				// Copy paste from Java like Open Office will produce this junk on FF
+				[/Version:[\d.]+\nStartHTML:\d+\nEndHTML:\d+\nStartFragment:\d+\nEndFragment:\d+/gi, '']
+			]);
+
+			// Class attribute options are: leave all as-is ("none"), remove all ("all"), or remove only those starting with mso ("mso").
+			// Note:-  paste_strip_class_attributes: "none", verify_css_classes: true is also a good variation.
+			stripClass = getParam(ed, "paste_strip_class_attributes");
+
+			if (stripClass !== "none") {
+				function removeClasses(match, g1) {
+						if (stripClass === "all")
+							return '';
+
+						var cls = grep(explode(g1.replace(/^(["'])(.*)\1$/, "$2"), " "),
+							function(v) {
+								return (/^(?!mso)/i.test(v));
+							}
+						);
+
+						return cls.length ? ' class="' + cls.join(" ") + '"' : '';
+				};
+
+				h = h.replace(/ class="([^"]+)"/gi, removeClasses);
+				h = h.replace(/ class=([\-\w]+)/gi, removeClasses);
+			}
+
+			// Remove spans option
+			if (getParam(ed, "paste_remove_spans")) {
+				h = h.replace(/<\/?span[^>]*>/gi, "");
+			}
+
+			//console.log('After preprocess:' + h);
+
+			o.content = h;
+		},
+
+		/**
+		 * Various post process items.
+		 */
+		_postProcess : function(pl, o) {
+			var t = this, ed = t.editor, dom = ed.dom, styleProps;
+
+			if (ed.settings.paste_enable_default_filters == false) {
+				return;
+			}
+			
+			if (o.wordContent) {
+				// Remove named anchors or TOC links
+				each(dom.select('a', o.node), function(a) {
+					if (!a.href || a.href.indexOf('#_Toc') != -1)
+						dom.remove(a, 1);
+				});
+
+				if (getParam(ed, "paste_convert_middot_lists")) {
+					t._convertLists(pl, o);
+				}
+
+				// Process styles
+				styleProps = getParam(ed, "paste_retain_style_properties"); // retained properties
+
+				// Process only if a string was specified and not equal to "all" or "*"
+				if ((tinymce.is(styleProps, "string")) && (styleProps !== "all") && (styleProps !== "*")) {
+					styleProps = tinymce.explode(styleProps.replace(/^none$/i, ""));
+
+					// Retains some style properties
+					each(dom.select('*', o.node), function(el) {
+						var newStyle = {}, npc = 0, i, sp, sv;
+
+						// Store a subset of the existing styles
+						if (styleProps) {
+							for (i = 0; i < styleProps.length; i++) {
+								sp = styleProps[i];
+								sv = dom.getStyle(el, sp);
+
+								if (sv) {
+									newStyle[sp] = sv;
+									npc++;
+								}
+							}
+						}
+
+						// Remove all of the existing styles
+						dom.setAttrib(el, 'style', '');
+
+						if (styleProps && npc > 0)
+							dom.setStyles(el, newStyle); // Add back the stored subset of styles
+						else // Remove empty span tags that do not have class attributes
+							if (el.nodeName == 'SPAN' && !el.className)
+								dom.remove(el, true);
+					});
+				}
+			}
+
+			// Remove all style information or only specifically on WebKit to avoid the style bug on that browser
+			if (getParam(ed, "paste_remove_styles") || (getParam(ed, "paste_remove_styles_if_webkit") && tinymce.isWebKit)) {
+				each(dom.select('*[style]', o.node), function(el) {
+					el.removeAttribute('style');
+					el.removeAttribute('data-mce-style');
+				});
+			} else {
+				if (tinymce.isWebKit) {
+					// We need to compress the styles on WebKit since if you paste <img border="0" /> it will become <img border="0" style="... lots of junk ..." />
+					// Removing the mce_style that contains the real value will force the Serializer engine to compress the styles
+					each(dom.select('*', o.node), function(el) {
+						el.removeAttribute('data-mce-style');
+					});
+				}
+			}
+		},
+
+		/**
+		 * Converts the most common bullet and number formats in Office into a real semantic UL/LI list.
+		 */
+		_convertLists : function(pl, o) {
+			var dom = pl.editor.dom, listElm, li, lastMargin = -1, margin, levels = [], lastType, html;
+
+			// Convert middot lists into real semantic lists
+			each(dom.select('p', o.node), function(p) {
+				var sib, val = '', type, html, idx, parents;
+
+				// Get text node value at beginning of paragraph
+				for (sib = p.firstChild; sib && sib.nodeType == 3; sib = sib.nextSibling)
+					val += sib.nodeValue;
+
+				val = p.innerHTML.replace(/<\/?\w+[^>]*>/gi, '').replace(/&nbsp;/g, '\u00a0');
+
+				// Detect unordered lists look for bullets
+				if (/^(__MCE_ITEM__)+[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*\u00a0*/.test(val))
+					type = 'ul';
+
+				// Detect ordered lists 1., a. or ixv.
+				if (/^__MCE_ITEM__\s*\w+\.\s*\u00a0+/.test(val))
+					type = 'ol';
+
+				// Check if node value matches the list pattern: o&nbsp;&nbsp;
+				if (type) {
+					margin = parseFloat(p.style.marginLeft || 0);
+
+					if (margin > lastMargin)
+						levels.push(margin);
+
+					if (!listElm || type != lastType) {
+						listElm = dom.create(type);
+						dom.insertAfter(listElm, p);
+					} else {
+						// Nested list element
+						if (margin > lastMargin) {
+							listElm = li.appendChild(dom.create(type));
+						} else if (margin < lastMargin) {
+							// Find parent level based on margin value
+							idx = tinymce.inArray(levels, margin);
+							parents = dom.getParents(listElm.parentNode, type);
+							listElm = parents[parents.length - 1 - idx] || listElm;
+						}
+					}
+
+					// Remove middot or number spans if they exists
+					each(dom.select('span', p), function(span) {
+						var html = span.innerHTML.replace(/<\/?\w+[^>]*>/gi, '');
+
+						// Remove span with the middot or the number
+						if (type == 'ul' && /^__MCE_ITEM__[\u2022\u00b7\u00a7\u00d8o\u25CF]/.test(html))
+							dom.remove(span);
+						else if (/^__MCE_ITEM__[\s\S]*\w+\.(&nbsp;|\u00a0)*\s*/.test(html))
+							dom.remove(span);
+					});
+
+					html = p.innerHTML;
+
+					// Remove middot/list items
+					if (type == 'ul')
+						html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^[\u2022\u00b7\u00a7\u00d8o\u25CF]\s*(&nbsp;|\u00a0)+\s*/, '');
+					else
+						html = p.innerHTML.replace(/__MCE_ITEM__/g, '').replace(/^\s*\w+\.(&nbsp;|\u00a0)+\s*/, '');
+
+					// Create li and add paragraph data into the new li
+					li = listElm.appendChild(dom.create('li', 0, html));
+					dom.remove(p);
+
+					lastMargin = margin;
+					lastType = type;
+				} else
+					listElm = lastMargin = 0; // End list element
+			});
+
+			// Remove any left over makers
+			html = o.node.innerHTML;
+			if (html.indexOf('__MCE_ITEM__') != -1)
+				o.node.innerHTML = html.replace(/__MCE_ITEM__/g, '');
+		},
+
+		/**
+		 * Inserts the specified contents at the caret position.
+		 */
+		_insert : function(h, skip_undo) {
+			var ed = this.editor, r = ed.selection.getRng();
+
+			// First delete the contents seems to work better on WebKit when the selection spans multiple list items or multiple table cells.
+			if (!ed.selection.isCollapsed() && r.startContainer != r.endContainer)
+				ed.getDoc().execCommand('Delete', false, null);
+
+			ed.execCommand('mceInsertContent', false, h, {skip_undo : skip_undo});
+		},
+
+		/**
+		 * Instead of the old plain text method which tried to re-create a paste operation, the
+		 * new approach adds a plain text mode toggle switch that changes the behavior of paste.
+		 * This function is passed the same input that the regular paste plugin produces.
+		 * It performs additional scrubbing and produces (and inserts) the plain text.
+		 * This approach leverages all of the great existing functionality in the paste
+		 * plugin, and requires minimal changes to add the new functionality.
+		 * Speednet - June 2009
+		 */
+		_insertPlainText : function(ed, dom, h) {
+			var i, len, pos, rpos, node, breakElms, before, after,
+				w = ed.getWin(),
+				d = ed.getDoc(),
+				sel = ed.selection,
+				is = tinymce.is,
+				inArray = tinymce.inArray,
+				linebr = getParam(ed, "paste_text_linebreaktype"),
+				rl = getParam(ed, "paste_text_replacements");
+
+			function process(items) {
+				each(items, function(v) {
+					if (v.constructor == RegExp)
+						h = h.replace(v, "");
+					else
+						h = h.replace(v[0], v[1]);
+				});
+			};
+
+			if ((typeof(h) === "string") && (h.length > 0)) {
+				// If HTML content with line-breaking tags, then remove all cr/lf chars because only tags will break a line
+				if (/<(?:p|br|h[1-6]|ul|ol|dl|table|t[rdh]|div|blockquote|fieldset|pre|address|center)[^>]*>/i.test(h)) {
+					process([
+						/[\n\r]+/g
+					]);
+				} else {
+					// Otherwise just get rid of carriage returns (only need linefeeds)
+					process([
+						/\r+/g
+					]);
+				}
+
+				process([
+					[/<\/(?:p|h[1-6]|ul|ol|dl|table|div|blockquote|fieldset|pre|address|center)>/gi, "\n\n"],		// Block tags get a blank line after them
+					[/<br[^>]*>|<\/tr>/gi, "\n"],				// Single linebreak for <br /> tags and table rows
+					[/<\/t[dh]>\s*<t[dh][^>]*>/gi, "\t"],		// Table cells get tabs betweem them
+					/<[a-z!\/?][^>]*>/gi,						// Delete all remaining tags
+					[/&nbsp;/gi, " "],							// Convert non-break spaces to regular spaces (remember, *plain text*)
+					[/(?:(?!\n)\s)*(\n+)(?:(?!\n)\s)*/gi, "$1"],	// Cool little RegExp deletes whitespace around linebreak chars.
+					[/\n{3,}/g, "\n\n"],							// Max. 2 consecutive linebreaks
+					/^\s+|\s+$/g									// Trim the front & back
+				]);
+
+				h = dom.decode(tinymce.html.Entities.encodeRaw(h));
+
+				// Delete any highlighted text before pasting
+				if (!sel.isCollapsed()) {
+					d.execCommand("Delete", false, null);
+				}
+
+				// Perform default or custom replacements
+				if (is(rl, "array") || (is(rl, "array"))) {
+					process(rl);
+				}
+				else if (is(rl, "string")) {
+					process(new RegExp(rl, "gi"));
+				}
+
+				// Treat paragraphs as specified in the config
+				if (linebr == "none") {
+					process([
+						[/\n+/g, " "]
+					]);
+				}
+				else if (linebr == "br") {
+					process([
+						[/\n/g, "<br />"]
+					]);
+				}
+				else {
+					process([
+						/^\s+|\s+$/g,
+						[/\n\n/g, "</p><p>"],
+						[/\n/g, "<br />"]
+					]);
+				}
+
+				// This next piece of code handles the situation where we're pasting more than one paragraph of plain
+				// text, and we are pasting the content into the middle of a block node in the editor.  The block
+				// node gets split at the selection point into "Para A" and "Para B" (for the purposes of explaining).
+				// The first paragraph of the pasted text is appended to "Para A", and the last paragraph of the
+				// pasted text is prepended to "Para B".  Any other paragraphs of pasted text are placed between
+				// "Para A" and "Para B".  This code solves a host of problems with the original plain text plugin and
+				// now handles styles correctly.  (Pasting plain text into a styled paragraph is supposed to make the
+				// plain text take the same style as the existing paragraph.)
+				if ((pos = h.indexOf("</p><p>")) != -1) {
+					rpos = h.lastIndexOf("</p><p>");
+					node = sel.getNode(); 
+					breakElms = [];		// Get list of elements to break 
+
+					do {
+						if (node.nodeType == 1) {
+							// Don't break tables and break at body
+							if (node.nodeName == "TD" || node.nodeName == "BODY") {
+								break;
+							}
+
+							breakElms[breakElms.length] = node;
+						}
+					} while (node = node.parentNode);
+
+					// Are we in the middle of a block node?
+					if (breakElms.length > 0) {
+						before = h.substring(0, pos);
+						after = "";
+
+						for (i=0, len=breakElms.length; i<len; i++) {
+							before += "</" + breakElms[i].nodeName.toLowerCase() + ">";
+							after += "<" + breakElms[breakElms.length-i-1].nodeName.toLowerCase() + ">";
+						}
+
+						if (pos == rpos) {
+							h = before + after + h.substring(pos+7);
+						}
+						else {
+							h = before + h.substring(pos+4, rpos+4) + after + h.substring(rpos+7);
+						}
+					}
+				}
+
+				// Insert content at the caret, plus add a marker for repositioning the caret
+				ed.execCommand("mceInsertRawHTML", false, h + '<span id="_plain_text_marker">&nbsp;</span>');
+
+				// Reposition the caret to the marker, which was placed immediately after the inserted content.
+				// Needs to be done asynchronously (in window.setTimeout) or else it doesn't work in all browsers.
+				// The second part of the code scrolls the content up if the caret is positioned off-screen.
+				// This is only necessary for WebKit browsers, but it doesn't hurt to use for all.
+				window.setTimeout(function() {
+					var marker = dom.get('_plain_text_marker'),
+						elm, vp, y, elmHeight;
+
+					sel.select(marker, false);
+					d.execCommand("Delete", false, null);
+					marker = null;
+
+					// Get element, position and height
+					elm = sel.getStart();
+					vp = dom.getViewPort(w);
+					y = dom.getPos(elm).y;
+					elmHeight = elm.clientHeight;
+
+					// Is element within viewport if not then scroll it into view
+					if ((y < vp.y) || (y + elmHeight > vp.y + vp.h)) {
+						d.body.scrollTop = y < vp.y ? y : y - vp.h + 25;
+					}
+				}, 0);
+			}
+		},
+
+		/**
+		 * This method will open the old style paste dialogs. Some users might want the old behavior but still use the new cleanup engine.
+		 */
+		_legacySupport : function() {
+			var t = this, ed = t.editor;
+
+			// Register command(s) for backwards compatibility
+			ed.addCommand("mcePasteWord", function() {
+				ed.windowManager.open({
+					file: t.url + "/pasteword.htm",
+					width: parseInt(getParam(ed, "paste_dialog_width")),
+					height: parseInt(getParam(ed, "paste_dialog_height")),
+					inline: 1
+				});
+			});
+
+			if (getParam(ed, "paste_text_use_dialog")) {
+				ed.addCommand("mcePasteText", function() {
+					ed.windowManager.open({
+						file : t.url + "/pastetext.htm",
+						width: parseInt(getParam(ed, "paste_dialog_width")),
+						height: parseInt(getParam(ed, "paste_dialog_height")),
+						inline : 1
+					});
+				});
+			}
+
+			// Register button for backwards compatibility
+			ed.addButton("pasteword", {title : "paste.paste_word_desc", cmd : "mcePasteWord"});
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add("paste", tinymce.plugins.PastePlugin);
+})();
Index: admin/js/tiny_mce/plugins/paste/js/pastetext.js
===================================================================
--- admin/js/tiny_mce/plugins/paste/js/pastetext.js	(revision 307)
+++ admin/js/tiny_mce/plugins/paste/js/pastetext.js	(revision 307)
@@ -0,0 +1,36 @@
+tinyMCEPopup.requireLangPack();
+
+var PasteTextDialog = {
+	init : function() {
+		this.resize();
+	},
+
+	insert : function() {
+		var h = tinyMCEPopup.dom.encode(document.getElementById('content').value), lines;
+
+		// Convert linebreaks into paragraphs
+		if (document.getElementById('linebreaks').checked) {
+			lines = h.split(/\r?\n/);
+			if (lines.length > 1) {
+				h = '';
+				tinymce.each(lines, function(row) {
+					h += '<p>' + row + '</p>';
+				});
+			}
+		}
+
+		tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h});
+		tinyMCEPopup.close();
+	},
+
+	resize : function() {
+		var vp = tinyMCEPopup.dom.getViewPort(window), el;
+
+		el = document.getElementById('content');
+
+		el.style.width  = (vp.w - 20) + 'px';
+		el.style.height = (vp.h - 90) + 'px';
+	}
+};
+
+tinyMCEPopup.onInit.add(PasteTextDialog.init, PasteTextDialog);
Index: admin/js/tiny_mce/plugins/paste/js/pasteword.js
===================================================================
--- admin/js/tiny_mce/plugins/paste/js/pasteword.js	(revision 307)
+++ admin/js/tiny_mce/plugins/paste/js/pasteword.js	(revision 307)
@@ -0,0 +1,51 @@
+tinyMCEPopup.requireLangPack();
+
+var PasteWordDialog = {
+	init : function() {
+		var ed = tinyMCEPopup.editor, el = document.getElementById('iframecontainer'), ifr, doc, css, cssHTML = '';
+
+		// Create iframe
+		el.innerHTML = '<iframe id="iframe" src="javascript:\'\';" frameBorder="0" style="border: 1px solid gray"></iframe>';
+		ifr = document.getElementById('iframe');
+		doc = ifr.contentWindow.document;
+
+		// Force absolute CSS urls
+		css = [ed.baseURI.toAbsolute("themes/" + ed.settings.theme + "/skins/" + ed.settings.skin + "/content.css")];
+		css = css.concat(tinymce.explode(ed.settings.content_css) || []);
+		tinymce.each(css, function(u) {
+			cssHTML += '<link href="' + ed.documentBaseURI.toAbsolute('' + u) + '" rel="stylesheet" type="text/css" />';
+		});
+
+		// Write content into iframe
+		doc.open();
+		doc.write('<html><head>' + cssHTML + '</head><body class="mceContentBody" spellcheck="false"></body></html>');
+		doc.close();
+
+		doc.designMode = 'on';
+		this.resize();
+
+		window.setTimeout(function() {
+			ifr.contentWindow.focus();
+		}, 10);
+	},
+
+	insert : function() {
+		var h = document.getElementById('iframe').contentWindow.document.body.innerHTML;
+
+		tinyMCEPopup.editor.execCommand('mceInsertClipboardContent', false, {content : h, wordContent : true});
+		tinyMCEPopup.close();
+	},
+
+	resize : function() {
+		var vp = tinyMCEPopup.dom.getViewPort(window), el;
+
+		el = document.getElementById('iframe');
+
+		if (el) {
+			el.style.width  = (vp.w - 20) + 'px';
+			el.style.height = (vp.h - 90) + 'px';
+		}
+	}
+};
+
+tinyMCEPopup.onInit.add(PasteWordDialog.init, PasteWordDialog);
Index: admin/js/tiny_mce/plugins/paste/langs/en_dlg.js
===================================================================
--- admin/js/tiny_mce/plugins/paste/langs/en_dlg.js	(revision 307)
+++ admin/js/tiny_mce/plugins/paste/langs/en_dlg.js	(revision 307)
@@ -0,0 +1,5 @@
+tinyMCE.addI18n('en.paste_dlg',{
+text_title:"Use CTRL+V on your keyboard to paste the text into the window.",
+text_linebreaks:"Keep linebreaks",
+word_title:"Use CTRL+V on your keyboard to paste the text into the window."
+});
Index: admin/js/tiny_mce/plugins/paste/pastetext.htm
===================================================================
--- admin/js/tiny_mce/plugins/paste/pastetext.htm	(revision 307)
+++ admin/js/tiny_mce/plugins/paste/pastetext.htm	(revision 307)
@@ -0,0 +1,27 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#paste.paste_text_desc}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="js/pastetext.js"></script>
+</head>
+<body onresize="PasteTextDialog.resize();" style="display:none; overflow:hidden;">
+	<form name="source" onsubmit="return PasteTextDialog.insert();" action="#">
+		<div style="float: left" class="title">{#paste.paste_text_desc}</div>
+
+		<div style="float: right">
+			<input type="checkbox" name="linebreaks" id="linebreaks" class="wordWrapCode" checked="checked" /><label for="linebreaks">{#paste_dlg.text_linebreaks}</label>
+		</div>
+
+		<br style="clear: both" />
+
+		<div>{#paste_dlg.text_title}</div>
+
+		<textarea id="content" name="content" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,mono; font-size: 12px;" dir="ltr" wrap="soft" class="mceFocus"></textarea>
+
+		<div class="mceActionPanel">
+			<input type="submit" name="insert" value="{#insert}" id="insert" />
+			<input type="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
+		</div>
+	</form>
+</body> 
+</html>
Index: admin/js/tiny_mce/plugins/paste/pasteword.htm
===================================================================
--- admin/js/tiny_mce/plugins/paste/pasteword.htm	(revision 307)
+++ admin/js/tiny_mce/plugins/paste/pasteword.htm	(revision 307)
@@ -0,0 +1,21 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#paste.paste_word_desc}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="js/pasteword.js"></script>
+</head>
+<body onresize="PasteWordDialog.resize();" style="display:none; overflow:hidden;">
+	<form name="source" onsubmit="return PasteWordDialog.insert();" action="#">
+		<div class="title">{#paste.paste_word_desc}</div>
+
+		<div>{#paste_dlg.word_title}</div>
+
+		<div id="iframecontainer"></div>
+
+		<div class="mceActionPanel">
+			<input type="submit" id="insert" name="insert" value="{#insert}" />
+			<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+		</div>
+	</form>
+</body>
+</html>
Index: admin/js/tiny_mce/plugins/searchreplace/css/searchreplace.css
===================================================================
--- admin/js/tiny_mce/plugins/searchreplace/css/searchreplace.css	(revision 307)
+++ admin/js/tiny_mce/plugins/searchreplace/css/searchreplace.css	(revision 307)
@@ -0,0 +1,6 @@
+.panel_wrapper {height:85px;}
+.panel_wrapper div.current {height:85px;}
+
+/* IE */
+* html .panel_wrapper {height:100px;}
+* html .panel_wrapper div.current {height:100px;}
Index: admin/js/tiny_mce/plugins/searchreplace/editor_plugin.js
===================================================================
--- admin/js/tiny_mce/plugins/searchreplace/editor_plugin.js	(revision 307)
+++ admin/js/tiny_mce/plugins/searchreplace/editor_plugin.js	(revision 307)
@@ -0,0 +1,1 @@
+(function(){tinymce.create("tinymce.plugins.SearchReplacePlugin",{init:function(a,c){function b(d){window.focus();a.windowManager.open({file:c+"/searchreplace.htm",width:420+parseInt(a.getLang("searchreplace.delta_width",0)),height:170+parseInt(a.getLang("searchreplace.delta_height",0)),inline:1,auto_focus:0},{mode:d,search_string:a.selection.getContent({format:"text"}),plugin_url:c})}a.addCommand("mceSearch",function(){b("search")});a.addCommand("mceReplace",function(){b("replace")});a.addButton("search",{title:"searchreplace.search_desc",cmd:"mceSearch"});a.addButton("replace",{title:"searchreplace.replace_desc",cmd:"mceReplace"});a.addShortcut("ctrl+f","searchreplace.search_desc","mceSearch")},getInfo:function(){return{longname:"Search/Replace",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("searchreplace",tinymce.plugins.SearchReplacePlugin)})();
Index: admin/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js
===================================================================
--- admin/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js	(revision 307)
+++ admin/js/tiny_mce/plugins/searchreplace/editor_plugin_src.js	(revision 307)
@@ -0,0 +1,61 @@
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(function() {
+	tinymce.create('tinymce.plugins.SearchReplacePlugin', {
+		init : function(ed, url) {
+			function open(m) {
+				// Keep IE from writing out the f/r character to the editor
+				// instance while initializing a new dialog. See: #3131190
+				window.focus();
+
+				ed.windowManager.open({
+					file : url + '/searchreplace.htm',
+					width : 420 + parseInt(ed.getLang('searchreplace.delta_width', 0)),
+					height : 170 + parseInt(ed.getLang('searchreplace.delta_height', 0)),
+					inline : 1,
+					auto_focus : 0
+				}, {
+					mode : m,
+					search_string : ed.selection.getContent({format : 'text'}),
+					plugin_url : url
+				});
+			};
+
+			// Register commands
+			ed.addCommand('mceSearch', function() {
+				open('search');
+			});
+
+			ed.addCommand('mceReplace', function() {
+				open('replace');
+			});
+
+			// Register buttons
+			ed.addButton('search', {title : 'searchreplace.search_desc', cmd : 'mceSearch'});
+			ed.addButton('replace', {title : 'searchreplace.replace_desc', cmd : 'mceReplace'});
+
+			ed.addShortcut('ctrl+f', 'searchreplace.search_desc', 'mceSearch');
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Search/Replace',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/searchreplace',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			};
+		}
+	});
+
+	// Register plugin
+	tinymce.PluginManager.add('searchreplace', tinymce.plugins.SearchReplacePlugin);
+})();
Index: admin/js/tiny_mce/plugins/searchreplace/js/searchreplace.js
===================================================================
--- admin/js/tiny_mce/plugins/searchreplace/js/searchreplace.js	(revision 307)
+++ admin/js/tiny_mce/plugins/searchreplace/js/searchreplace.js	(revision 307)
@@ -0,0 +1,142 @@
+tinyMCEPopup.requireLangPack();
+
+var SearchReplaceDialog = {
+	init : function(ed) {
+		var t = this, f = document.forms[0], m = tinyMCEPopup.getWindowArg("mode");
+
+		t.switchMode(m);
+
+		f[m + '_panel_searchstring'].value = tinyMCEPopup.getWindowArg("search_string");
+
+		// Focus input field
+		f[m + '_panel_searchstring'].focus();
+		
+		mcTabs.onChange.add(function(tab_id, panel_id) {
+			t.switchMode(tab_id.substring(0, tab_id.indexOf('_')));
+		});
+	},
+
+	switchMode : function(m) {
+		var f, lm = this.lastMode;
+
+		if (lm != m) {
+			f = document.forms[0];
+
+			if (lm) {
+				f[m + '_panel_searchstring'].value = f[lm + '_panel_searchstring'].value;
+				f[m + '_panel_backwardsu'].checked = f[lm + '_panel_backwardsu'].checked;
+				f[m + '_panel_backwardsd'].checked = f[lm + '_panel_backwardsd'].checked;
+				f[m + '_panel_casesensitivebox'].checked = f[lm + '_panel_casesensitivebox'].checked;
+			}
+
+			mcTabs.displayTab(m + '_tab',  m + '_panel');
+			document.getElementById("replaceBtn").style.display = (m == "replace") ? "inline" : "none";
+			document.getElementById("replaceAllBtn").style.display = (m == "replace") ? "inline" : "none";
+			this.lastMode = m;
+		}
+	},
+
+	searchNext : function(a) {
+		var ed = tinyMCEPopup.editor, se = ed.selection, r = se.getRng(), f, m = this.lastMode, s, b, fl = 0, w = ed.getWin(), wm = ed.windowManager, fo = 0;
+
+		// Get input
+		f = document.forms[0];
+		s = f[m + '_panel_searchstring'].value;
+		b = f[m + '_panel_backwardsu'].checked;
+		ca = f[m + '_panel_casesensitivebox'].checked;
+		rs = f['replace_panel_replacestring'].value;
+
+		if (tinymce.isIE) {
+			r = ed.getDoc().selection.createRange();
+		}
+
+		if (s == '')
+			return;
+
+		function fix() {
+			// Correct Firefox graphics glitches
+			// TODO: Verify if this is actually needed any more, maybe it was for very old FF versions? 
+			r = se.getRng().cloneRange();
+			ed.getDoc().execCommand('SelectAll', false, null);
+			se.setRng(r);
+		};
+
+		function replace() {
+			ed.selection.setContent(rs); // Needs to be duplicated due to selection bug in IE
+		};
+
+		// IE flags
+		if (ca)
+			fl = fl | 4;
+
+		switch (a) {
+			case 'all':
+				// Move caret to beginning of text
+				ed.execCommand('SelectAll');
+				ed.selection.collapse(true);
+
+				if (tinymce.isIE) {
+					ed.focus();
+					r = ed.getDoc().selection.createRange();
+
+					while (r.findText(s, b ? -1 : 1, fl)) {
+						r.scrollIntoView();
+						r.select();
+						replace();
+						fo = 1;
+
+						if (b) {
+							r.moveEnd("character", -(rs.length)); // Otherwise will loop forever
+						}
+					}
+
+					tinyMCEPopup.storeSelection();
+				} else {
+					while (w.find(s, ca, b, false, false, false, false)) {
+						replace();
+						fo = 1;
+					}
+				}
+
+				if (fo)
+					tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.allreplaced'));
+				else
+					tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
+
+				return;
+
+			case 'current':
+				if (!ed.selection.isCollapsed())
+					replace();
+
+				break;
+		}
+
+		se.collapse(b);
+		r = se.getRng();
+
+		// Whats the point
+		if (!s)
+			return;
+
+		if (tinymce.isIE) {
+			ed.focus();
+			r = ed.getDoc().selection.createRange();
+
+			if (r.findText(s, b ? -1 : 1, fl)) {
+				r.scrollIntoView();
+				r.select();
+			} else
+				tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
+
+			tinyMCEPopup.storeSelection();
+		} else {
+			if (!w.find(s, ca, b, false, false, false, false))
+				tinyMCEPopup.alert(ed.getLang('searchreplace_dlg.notfound'));
+			else
+				fix();
+		}
+	}
+};
+
+tinyMCEPopup.onInit.add(SearchReplaceDialog.init, SearchReplaceDialog);
Index: admin/js/tiny_mce/plugins/searchreplace/langs/en_dlg.js
===================================================================
--- admin/js/tiny_mce/plugins/searchreplace/langs/en_dlg.js	(revision 307)
+++ admin/js/tiny_mce/plugins/searchreplace/langs/en_dlg.js	(revision 307)
@@ -0,0 +1,16 @@
+tinyMCE.addI18n('en.searchreplace_dlg',{
+searchnext_desc:"Find again",
+notfound:"The search has been completed. The search string could not be found.",
+search_title:"Find",
+replace_title:"Find/Replace",
+allreplaced:"All occurrences of the search string were replaced.",
+findwhat:"Find what",
+replacewith:"Replace with",
+direction:"Direction",
+up:"Up",
+down:"Down",
+mcase:"Match case",
+findnext:"Find next",
+replace:"Replace",
+replaceall:"Replace all"
+});
Index: admin/js/tiny_mce/plugins/searchreplace/searchreplace.htm
===================================================================
--- admin/js/tiny_mce/plugins/searchreplace/searchreplace.htm	(revision 307)
+++ admin/js/tiny_mce/plugins/searchreplace/searchreplace.htm	(revision 307)
@@ -0,0 +1,100 @@
+<!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">
+<head>
+	<title>{#searchreplace_dlg.replace_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="js/searchreplace.js"></script>
+	<link rel="stylesheet" type="text/css" href="css/searchreplace.css" />
+</head>
+<body style="display:none;" role="application" aria-labelledby="app_title">
+<span id="app_title" style="display:none">{#searchreplace_dlg.replace_title}</span>
+<form onsubmit="SearchReplaceDialog.searchNext('none');return false;" action="#">
+	<div class="tabs">
+		<ul>
+			<li id="search_tab" aria-controls="search_panel"><span><a href="javascript:SearchReplaceDialog.switchMode('search');" onmousedown="return false;">{#searchreplace.search_desc}</a></span></li>
+			<li id="replace_tab" aria-controls="replace_panel"><span><a href="javascript:SearchReplaceDialog.switchMode('replace');" onmousedown="return false;">{#searchreplace_dlg.replace}</a></span></li>
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="search_panel" class="panel">
+			<table role="presentation" border="0" cellspacing="0" cellpadding="2">
+				<tr>
+					<td><label for="search_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
+					<td><input type="text" id="search_panel_searchstring" name="search_panel_searchstring" style="width: 200px" aria-required="true" /></td>
+				</tr>
+				<tr>
+					<td colspan="2">
+						<table role="presentation" border="0" cellspacing="0" cellpadding="0" class="direction">
+							<tr role="group" aria-labelledby="search_panel_backwards_label">
+								<td><label id="search_panel_backwards_label">{#searchreplace_dlg.direction}</label></td>
+								<td><input id="search_panel_backwardsu" name="search_panel_backwards" class="radio" type="radio" /></td>
+								<td><label for="search_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
+								<td><input id="search_panel_backwardsd" name="search_panel_backwards" class="radio" type="radio" checked="checked" /></td>
+								<td><label for="search_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
+							</tr>
+						</table>
+					</td>
+				</tr>
+				<tr>
+					<td colspan="2">
+						<table role="presentation" border="0" cellspacing="0" cellpadding="0">
+							<tr>
+								<td><input id="search_panel_casesensitivebox" name="search_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
+								<td><label for="search_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
+							</tr>
+						</table>
+					</td>
+				</tr>
+			</table>
+		</div>
+
+		<div id="replace_panel" class="panel">
+			<table role="presentation" border="0" cellspacing="0" cellpadding="2">
+				<tr>
+					<td><label for="replace_panel_searchstring">{#searchreplace_dlg.findwhat}</label></td>
+					<td><input type="text" id="replace_panel_searchstring" name="replace_panel_searchstring" style="width: 200px" aria-required="true" /></td>
+				</tr>
+				<tr>
+					<td><label for="replace_panel_replacestring">{#searchreplace_dlg.replacewith}</label></td>
+					<td><input type="text" id="replace_panel_replacestring" name="replace_panel_replacestring" style="width: 200px" aria-required="true" /></td>
+				</tr>
+				<tr>
+					<td colspan="2">
+						<table role="presentation" border="0" cellspacing="0" cellpadding="0" class="direction">
+							<tr role="group" aria-labelledby="replace_panel_dir_label">
+								<td><label id="replace_panel_dir_label">{#searchreplace_dlg.direction}</label></td>
+								<td><input id="replace_panel_backwardsu" name="replace_panel_backwards" class="radio" type="radio" /></td>
+								<td><label for="replace_panel_backwardsu">{#searchreplace_dlg.up}</label></td>
+								<td><input id="replace_panel_backwardsd" name="replace_panel_backwards" class="radio" type="radio" checked="checked" /></td>
+								<td><label for="replace_panel_backwardsd">{#searchreplace_dlg.down}</label></td>
+							</tr>
+						</table>
+					</td>
+				</tr>
+				<tr>
+					<td colspan="2">
+						<table role="presentation" border="0" cellspacing="0" cellpadding="0">
+							<tr>
+								<td><input id="replace_panel_casesensitivebox" name="replace_panel_casesensitivebox" class="checkbox" type="checkbox" /></td>
+								<td><label for="replace_panel_casesensitivebox">{#searchreplace_dlg.mcase}</label></td>
+							</tr>
+						</table>
+					</td>
+				</tr>
+			</table>
+		</div>
+
+	</div>
+
+	<div class="mceActionPanel">
+		<input type="submit" id="insert" name="insert" value="{#searchreplace_dlg.findnext}" />
+		<input type="button" class="button" id="replaceBtn" name="replaceBtn" value="{#searchreplace_dlg.replace}" onclick="SearchReplaceDialog.searchNext('current');" />
+		<input type="button" class="button" id="replaceAllBtn" name="replaceAllBtn" value="{#searchreplace_dlg.replaceall}" onclick="SearchReplaceDialog.searchNext('all');" />
+		<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+	</div>
+</form>
+</body>
+</html>
Index: admin/js/tiny_mce/themes/advanced/about.htm
===================================================================
--- admin/js/tiny_mce/themes/advanced/about.htm	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/about.htm	(revision 307)
@@ -0,0 +1,52 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#advanced_dlg.about_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="js/about.js"></script>
+</head>
+<body id="about" style="display: none">
+		<div class="tabs">
+			<ul>
+				<li id="general_tab" class="current" aria-controls="general_panel"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.about_general}</a></span></li>
+				<li id="help_tab" style="display:none" aria-hidden="true" aria-controls="help_panel"><span><a href="javascript:mcTabs.displayTab('help_tab','help_panel');" onmousedown="return false;">{#advanced_dlg.about_help}</a></span></li>
+				<li id="plugins_tab" aria-controls="plugins_panel"><span><a href="javascript:mcTabs.displayTab('plugins_tab','plugins_panel');" onmousedown="return false;">{#advanced_dlg.about_plugins}</a></span></li>
+			</ul>
+		</div>
+
+		<div class="panel_wrapper">
+			<div id="general_panel" class="panel current">
+				<h3>{#advanced_dlg.about_title}</h3>
+				<p>Version: <span id="version"></span> (<span id="date"></span>)</p>
+				<p>TinyMCE is a platform independent web based Javascript HTML WYSIWYG editor control released as Open Source under <a href="../../license.txt" target="_blank">LGPL</a>
+				by Moxiecode Systems AB. It has the ability to convert HTML TEXTAREA fields or other HTML elements to editor instances.</p>
+				<p>Copyright &copy; 2003-2008, <a href="http://www.moxiecode.com" target="_blank">Moxiecode Systems AB</a>, All rights reserved.</p>
+				<p>For more information about this software visit the <a href="http://tinymce.moxiecode.com" target="_blank">TinyMCE website</a>.</p>
+
+				<div id="buttoncontainer">
+					<a href="http://www.moxiecode.com" target="_blank"><img src="http://tinymce.moxiecode.com/images/gotmoxie.png" alt="Got Moxie?" border="0" /></a>
+				</div>
+			</div>
+
+			<div id="plugins_panel" class="panel">
+				<div id="pluginscontainer">
+					<h3>{#advanced_dlg.about_loaded}</h3>
+
+					<div id="plugintablecontainer">
+					</div>
+
+					<p>&nbsp;</p>
+				</div>
+			</div>
+
+			<div id="help_panel" class="panel noscroll" style="overflow: visible;">
+				<div id="iframecontainer"></div>
+			</div>
+		</div>
+
+		<div class="mceActionPanel">
+			<input type="button" id="cancel" name="cancel" value="{#close}" onclick="tinyMCEPopup.close();" />
+		</div>
+</body>
+</html>
Index: admin/js/tiny_mce/themes/advanced/anchor.htm
===================================================================
--- admin/js/tiny_mce/themes/advanced/anchor.htm	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/anchor.htm	(revision 307)
@@ -0,0 +1,26 @@
+<!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">
+<head>
+	<title>{#advanced_dlg.anchor_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="js/anchor.js"></script>
+</head>
+<body style="display: none" role="application" aria-labelledby="app_title">
+<form onsubmit="AnchorDialog.update();return false;" action="#">
+	<table border="0" cellpadding="4" cellspacing="0" role="presentation">
+		<tr>
+			<td colspan="2" class="title" id="app_title">{#advanced_dlg.anchor_title}</td>
+		</tr>
+		<tr>
+			<td class="nowrap"><label for="anchorName">{#advanced_dlg.anchor_name}:</label></td>
+			<td><input name="anchorName" type="text" class="mceFocus" id="anchorName" value="" style="width: 200px" aria-required="true" /></td>
+		</tr>
+	</table>
+
+	<div class="mceActionPanel">
+		<input type="submit" id="insert" name="insert" value="{#update}" />
+		<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+	</div>
+</form>
+</body>
+</html>
Index: admin/js/tiny_mce/themes/advanced/charmap.htm
===================================================================
--- admin/js/tiny_mce/themes/advanced/charmap.htm	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/charmap.htm	(revision 307)
@@ -0,0 +1,51 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#advanced_dlg.charmap_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="js/charmap.js"></script>
+</head>
+<body id="charmap" style="display:none">
+<table align="center" border="0" cellspacing="0" cellpadding="2" role="presentation">
+	<tr>
+		<td colspan="2" class="title" ><label for="charmapView" id="charmap_label">{#advanced_dlg.charmap_title}</label></td>
+	</tr>
+	<tr>
+		<td id="charmapView" rowspan="2" align="left" valign="top">
+			<!-- Chars will be rendered here -->
+		</td>
+		<td width="100" align="center" valign="top">
+			<table border="0" cellpadding="0" cellspacing="0" width="100" style="height:100px" role="presentation">
+				<tr>
+					<td id="codeV">&nbsp;</td>
+				</tr>
+				<tr>
+					<td id="codeN">&nbsp;</td>
+				</tr>
+			</table>
+		</td>
+	</tr>
+	<tr>
+		<td valign="bottom" style="padding-bottom: 3px;">
+			<table width="100" align="center" border="0" cellpadding="2" cellspacing="0" role="presentation">
+				<tr>
+					<td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;"><label for="codeA">HTML-Code</label></td>
+				</tr>
+				<tr>
+					<td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeA" align="center">&nbsp;</td>
+				</tr>
+				<tr>
+					<td style="font-size: 1px;">&nbsp;</td>
+				</tr>
+				<tr>
+					<td align="center" style="border-left: 1px solid #666699; border-top: 1px solid #666699; border-right: 1px solid #666699;"><label for="codeB">NUM-Code</label></td>
+				</tr>
+				<tr>
+					<td style="font-size: 16px; font-weight: bold; border-left: 1px solid #666699; border-bottom: 1px solid #666699; border-right: 1px solid #666699;" id="codeB" align="center">&nbsp;</td>
+				</tr>
+			</table>
+		</td>
+	</tr>
+</table>
+</body>
+</html>
Index: admin/js/tiny_mce/themes/advanced/color_picker.htm
===================================================================
--- admin/js/tiny_mce/themes/advanced/color_picker.htm	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/color_picker.htm	(revision 307)
@@ -0,0 +1,74 @@
+<!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">
+<head>
+	<title>{#advanced_dlg.colorpicker_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="js/color_picker.js"></script>
+</head>
+<body id="colorpicker" style="display: none" role="application" aria-labelledby="app_label">
+	<span class="mceVoiceLabel" id="app_label" style="display:none;">{#advanced_dlg.colorpicker_title}</span>
+<form onsubmit="insertAction();return false" action="#">
+	<div class="tabs">
+		<ul>
+			<li id="picker_tab" aria-controls="picker_panel" class="current"><span><a href="javascript:mcTabs.displayTab('picker_tab','picker_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_picker_tab}</a></span></li>
+			<li id="rgb_tab" aria-controls="rgb_panel"><span><a href="javascript:;" onclick="mcTabs.displayTab('rgb_tab','rgb_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_palette_tab}</a></span></li>
+			<li id="named_tab" aria-controls="named_panel"><span><a  href="javascript:;" onclick="javascript:mcTabs.displayTab('named_tab','named_panel');" onmousedown="return false;">{#advanced_dlg.colorpicker_named_tab}</a></span></li>
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="picker_panel" class="panel current">
+			<fieldset>
+				<legend>{#advanced_dlg.colorpicker_picker_title}</legend>
+				<div id="picker">
+					<img id="colors" src="img/colorpicker.jpg" onclick="computeColor(event)" onmousedown="isMouseDown = true;return false;" onmouseup="isMouseDown = false;" onmousemove="if (isMouseDown && isMouseOver) computeColor(event); return false;" onmouseover="isMouseOver=true;" onmouseout="isMouseOver=false;" alt="" />
+
+					<div id="light">
+						<!-- Will be filled with divs -->
+					</div>
+
+					<br style="clear: both" />
+				</div>
+			</fieldset>
+		</div>
+
+		<div id="rgb_panel" class="panel">
+			<fieldset>
+				<legend id="webcolors_title">{#advanced_dlg.colorpicker_palette_title}</legend>
+				<div id="webcolors">
+					<!-- Gets filled with web safe colors-->
+				</div>
+
+				<br style="clear: both" />
+			</fieldset>
+		</div>
+
+		<div id="named_panel" class="panel">
+			<fieldset id="named_picker_label">
+				<legend id="named_title">{#advanced_dlg.colorpicker_named_title}</legend>
+				<div id="namedcolors" role="listbox" tabindex="0" aria-labelledby="named_picker_label">
+					<!-- Gets filled with named colors-->
+				</div>
+
+				<br style="clear: both" />
+
+				<div id="colornamecontainer">
+					{#advanced_dlg.colorpicker_name} <span id="colorname"></span>
+				</div>
+			</fieldset>
+		</div>
+	</div>
+
+	<div class="mceActionPanel">
+		<input type="submit" id="insert" name="insert" value="{#apply}" />
+
+		<div id="preview"></div>
+
+		<div id="previewblock">
+			<label for="color">{#advanced_dlg.colorpicker_color}</label> <input id="color" type="text" size="8" class="text mceFocus" aria-required="true" />
+		</div>
+	</div>
+</form>
+</body>
+</html>
Index: admin/js/tiny_mce/themes/advanced/editor_template.js
===================================================================
--- admin/js/tiny_mce/themes/advanced/editor_template.js	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/editor_template.js	(revision 307)
@@ -0,0 +1,1 @@
+(function(e){var d=e.DOM,b=e.dom.Event,h=e.extend,f=e.each,a=e.util.Cookie,g,c=e.explode;e.ThemeManager.requireLangPack("advanced");e.create("tinymce.themes.AdvancedTheme",{sizes:[8,10,12,14,18,24,36],controls:{bold:["bold_desc","Bold"],italic:["italic_desc","Italic"],underline:["underline_desc","Underline"],strikethrough:["striketrough_desc","Strikethrough"],justifyleft:["justifyleft_desc","JustifyLeft"],justifycenter:["justifycenter_desc","JustifyCenter"],justifyright:["justifyright_desc","JustifyRight"],justifyfull:["justifyfull_desc","JustifyFull"],bullist:["bullist_desc","InsertUnorderedList"],numlist:["numlist_desc","InsertOrderedList"],outdent:["outdent_desc","Outdent"],indent:["indent_desc","Indent"],cut:["cut_desc","Cut"],copy:["copy_desc","Copy"],paste:["paste_desc","Paste"],undo:["undo_desc","Undo"],redo:["redo_desc","Redo"],link:["link_desc","mceLink"],unlink:["unlink_desc","unlink"],image:["image_desc","mceImage"],cleanup:["cleanup_desc","mceCleanup"],help:["help_desc","mceHelp"],code:["code_desc","mceCodeEditor"],hr:["hr_desc","InsertHorizontalRule"],removeformat:["removeformat_desc","RemoveFormat"],sub:["sub_desc","subscript"],sup:["sup_desc","superscript"],forecolor:["forecolor_desc","ForeColor"],forecolorpicker:["forecolor_desc","mceForeColor"],backcolor:["backcolor_desc","HiliteColor"],backcolorpicker:["backcolor_desc","mceBackColor"],charmap:["charmap_desc","mceCharMap"],visualaid:["visualaid_desc","mceToggleVisualAid"],anchor:["anchor_desc","mceInsertAnchor"],newdocument:["newdocument_desc","mceNewDocument"],blockquote:["blockquote_desc","mceBlockQuote"]},stateControls:["bold","italic","underline","strikethrough","bullist","numlist","justifyleft","justifycenter","justifyright","justifyfull","sub","sup","blockquote"],init:function(j,k){var l=this,m,i,n;l.editor=j;l.url=k;l.onResolveName=new e.util.Dispatcher(this);j.forcedHighContrastMode=j.settings.detect_highcontrast&&l._isHighContrast();j.settings.skin=j.forcedHighContrastMode?"highcontrast":j.settings.skin;l.settings=m=h({theme_advanced_path:true,theme_advanced_toolbar_location:"bottom",theme_advanced_buttons1:"bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",theme_advanced_buttons2:"bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",theme_advanced_buttons3:"hr,removeformat,visualaid,|,sub,sup,|,charmap",theme_advanced_blockformats:"p,address,pre,h1,h2,h3,h4,h5,h6",theme_advanced_toolbar_align:"center",theme_advanced_fonts:"Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",theme_advanced_more_colors:1,theme_advanced_row_height:23,theme_advanced_resize_horizontal:1,theme_advanced_resizing_use_cookie:1,theme_advanced_font_sizes:"1,2,3,4,5,6,7",theme_advanced_font_selector:"span",theme_advanced_show_current_color:0,readonly:j.settings.readonly},j.settings);if(!m.font_size_style_values){m.font_size_style_values="8pt,10pt,12pt,14pt,18pt,24pt,36pt"}if(e.is(m.theme_advanced_font_sizes,"string")){m.font_size_style_values=e.explode(m.font_size_style_values);m.font_size_classes=e.explode(m.font_size_classes||"");n={};j.settings.theme_advanced_font_sizes=m.theme_advanced_font_sizes;f(j.getParam("theme_advanced_font_sizes","","hash"),function(q,p){var o;if(p==q&&q>=1&&q<=7){p=q+" ("+l.sizes[q-1]+"pt)";o=m.font_size_classes[q-1];q=m.font_size_style_values[q-1]||(l.sizes[q-1]+"pt")}if(/^\s*\./.test(q)){o=q.replace(/\./g,"")}n[p]=o?{"class":o}:{fontSize:q}});m.theme_advanced_font_sizes=n}if((i=m.theme_advanced_path_location)&&i!="none"){m.theme_advanced_statusbar_location=m.theme_advanced_path_location}if(m.theme_advanced_statusbar_location=="none"){m.theme_advanced_statusbar_location=0}if(j.settings.content_css!==false){j.contentCSS.push(j.baseURI.toAbsolute(k+"/skins/"+j.settings.skin+"/content.css"))}j.onInit.add(function(){if(!j.settings.readonly){j.onNodeChange.add(l._nodeChanged,l);j.onKeyUp.add(l._updateUndoStatus,l);j.onMouseUp.add(l._updateUndoStatus,l);j.dom.bind(j.dom.getRoot(),"dragend",function(){l._updateUndoStatus(j)})}});j.onSetProgressState.add(function(q,o,r){var s,t=q.id,p;if(o){l.progressTimer=setTimeout(function(){s=q.getContainer();s=s.insertBefore(d.create("DIV",{style:"position:relative"}),s.firstChild);p=d.get(q.id+"_tbl");d.add(s,"div",{id:t+"_blocker","class":"mceBlocker",style:{width:p.clientWidth+2,height:p.clientHeight+2}});d.add(s,"div",{id:t+"_progress","class":"mceProgress",style:{left:p.clientWidth/2,top:p.clientHeight/2}})},r||0)}else{d.remove(t+"_blocker");d.remove(t+"_progress");clearTimeout(l.progressTimer)}});d.loadCSS(m.editor_css?j.documentBaseURI.toAbsolute(m.editor_css):k+"/skins/"+j.settings.skin+"/ui.css");if(m.skin_variant){d.loadCSS(k+"/skins/"+j.settings.skin+"/ui_"+m.skin_variant+".css")}},_isHighContrast:function(){var i,j=d.add(d.getRoot(),"div",{style:"background-color: rgb(171,239,86);"});i=(d.getStyle(j,"background-color",true)+"").toLowerCase().replace(/ /g,"");d.remove(j);return i!="rgb(171,239,86)"&&i!="#abef56"},createControl:function(l,i){var j,k;if(k=i.createControl(l)){return k}switch(l){case"styleselect":return this._createStyleSelect();case"formatselect":return this._createBlockFormats();case"fontselect":return this._createFontSelect();case"fontsizeselect":return this._createFontSizeSelect();case"forecolor":return this._createForeColorMenu();case"backcolor":return this._createBackColorMenu()}if((j=this.controls[l])){return i.createButton(l,{title:"advanced."+j[0],cmd:j[1],ui:j[2],value:j[3]})}},execCommand:function(k,j,l){var i=this["_"+k];if(i){i.call(this,j,l);return true}return false},_importClasses:function(k){var i=this.editor,j=i.controlManager.get("styleselect");if(j.getLength()==0){f(i.dom.getClasses(),function(n,l){var m="style_"+l;i.formatter.register(m,{inline:"span",attributes:{"class":n["class"]},selector:"*"});j.add(n["class"],m)})}},_createStyleSelect:function(m){var k=this,i=k.editor,j=i.controlManager,l;l=j.createListBox("styleselect",{title:"advanced.style_select",onselect:function(o){var p,n=[];f(l.items,function(q){n.push(q.value)});i.focus();i.undoManager.add();p=i.formatter.matchAll(n);if(!o||p[0]==o){if(p[0]){i.formatter.remove(p[0])}}else{i.formatter.apply(o)}i.undoManager.add();i.nodeChanged();return false}});i.onInit.add(function(){var o=0,n=i.getParam("style_formats");if(n){f(n,function(p){var q,r=0;f(p,function(){r++});if(r>1){q=p.name=p.name||"style_"+(o++);i.formatter.register(q,p);l.add(p.title,q)}else{l.add(p.title)}})}else{f(i.getParam("theme_advanced_styles","","hash"),function(r,q){var p;if(r){p="style_"+(o++);i.formatter.register(p,{inline:"span",classes:r,selector:"*"});l.add(k.editor.translate(q),p)}})}});if(l.getLength()==0){l.onPostRender.add(function(o,p){if(!l.NativeListBox){b.add(p.id+"_text","focus",k._importClasses,k);b.add(p.id+"_text","mousedown",k._importClasses,k);b.add(p.id+"_open","focus",k._importClasses,k);b.add(p.id+"_open","mousedown",k._importClasses,k)}else{b.add(p.id,"focus",k._importClasses,k)}})}return l},_createFontSelect:function(){var k,j=this,i=j.editor;k=i.controlManager.createListBox("fontselect",{title:"advanced.fontdefault",onselect:function(l){var m=k.items[k.selectedIndex];if(!l&&m){i.execCommand("FontName",false,m.value);return}i.execCommand("FontName",false,l);k.select(function(n){return l==n});if(m&&m.value==l){k.select(null)}return false}});if(k){f(i.getParam("theme_advanced_fonts",j.settings.theme_advanced_fonts,"hash"),function(m,l){k.add(i.translate(l),m,{style:m.indexOf("dings")==-1?"font-family:"+m:""})})}return k},_createFontSizeSelect:function(){var m=this,k=m.editor,n,l=0,j=[];n=k.controlManager.createListBox("fontsizeselect",{title:"advanced.font_size",onselect:function(i){var o=n.items[n.selectedIndex];if(!i&&o){o=o.value;if(o["class"]){k.formatter.toggle("fontsize_class",{value:o["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,o.fontSize)}return}if(i["class"]){k.focus();k.undoManager.add();k.formatter.toggle("fontsize_class",{value:i["class"]});k.undoManager.add();k.nodeChanged()}else{k.execCommand("FontSize",false,i.fontSize)}n.select(function(p){return i==p});if(o&&(o.value.fontSize==i.fontSize||o.value["class"]==i["class"])){n.select(null)}return false}});if(n){f(m.settings.theme_advanced_font_sizes,function(o,i){var p=o.fontSize;if(p>=1&&p<=7){p=m.sizes[parseInt(p)-1]+"pt"}n.add(i,o,{style:"font-size:"+p,"class":"mceFontSize"+(l++)+(" "+(o["class"]||""))})})}return n},_createBlockFormats:function(){var k,i={p:"advanced.paragraph",address:"advanced.address",pre:"advanced.pre",h1:"advanced.h1",h2:"advanced.h2",h3:"advanced.h3",h4:"advanced.h4",h5:"advanced.h5",h6:"advanced.h6",div:"advanced.div",blockquote:"advanced.blockquote",code:"advanced.code",dt:"advanced.dt",dd:"advanced.dd",samp:"advanced.samp"},j=this;k=j.editor.controlManager.createListBox("formatselect",{title:"advanced.block",onselect:function(l){j.editor.execCommand("FormatBlock",false,l);return false}});if(k){f(j.editor.getParam("theme_advanced_blockformats",j.settings.theme_advanced_blockformats,"hash"),function(m,l){k.add(j.editor.translate(l!=m?l:i[m]),m,{"class":"mce_formatPreview mce_"+m})})}return k},_createForeColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_text_colors){l.colors=i}if(k.theme_advanced_default_foreground_color){l.default_color=k.theme_advanced_default_foreground_color}l.title="advanced.forecolor_desc";l.cmd="ForeColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("forecolor",l);return m},_createBackColorMenu:function(){var m,j=this,k=j.settings,l={},i;if(k.theme_advanced_more_colors){l.more_colors_func=function(){j._mceColorPicker(0,{color:m.value,func:function(n){m.setColor(n)}})}}if(i=k.theme_advanced_background_colors){l.colors=i}if(k.theme_advanced_default_background_color){l.default_color=k.theme_advanced_default_background_color}l.title="advanced.backcolor_desc";l.cmd="HiliteColor";l.scope=this;m=j.editor.controlManager.createColorSplitButton("backcolor",l);return m},renderUI:function(k){var m,l,q,v=this,r=v.editor,w=v.settings,u,j,i;if(r.settings){r.settings.aria_label=w.aria_label+r.getLang("advanced.help_shortcut")}m=j=d.create("span",{role:"application","aria-labelledby":r.id+"_voice",id:r.id+"_parent","class":"mceEditor "+r.settings.skin+"Skin"+(w.skin_variant?" "+r.settings.skin+"Skin"+v._ufirst(w.skin_variant):"")});d.add(m,"span",{"class":"mceVoiceLabel",style:"display:none;",id:r.id+"_voice"},w.aria_label);if(!d.boxModel){m=d.add(m,"div",{"class":"mceOldBoxModel"})}m=u=d.add(m,"table",{role:"presentation",id:r.id+"_tbl","class":"mceLayout",cellSpacing:0,cellPadding:0});m=q=d.add(m,"tbody");switch((w.theme_advanced_layout_manager||"").toLowerCase()){case"rowlayout":l=v._rowLayout(w,q,k);break;case"customlayout":l=r.execCallback("theme_advanced_custom_layout",w,q,k,j);break;default:l=v._simpleLayout(w,q,k,j)}m=k.targetNode;i=u.rows;d.addClass(i[0],"mceFirst");d.addClass(i[i.length-1],"mceLast");f(d.select("tr",q),function(o){d.addClass(o.firstChild,"mceFirst");d.addClass(o.childNodes[o.childNodes.length-1],"mceLast")});if(d.get(w.theme_advanced_toolbar_container)){d.get(w.theme_advanced_toolbar_container).appendChild(j)}else{d.insertAfter(j,m)}b.add(r.id+"_path_row","click",function(n){n=n.target;if(n.nodeName=="A"){v._sel(n.className.replace(/^.*mcePath_([0-9]+).*$/,"$1"));return b.cancel(n)}});if(!r.getParam("accessibility_focus")){b.add(d.add(j,"a",{href:"#"},"<!-- IE -->"),"focus",function(){tinyMCE.get(r.id).focus()})}if(w.theme_advanced_toolbar_location=="external"){k.deltaHeight=0}v.deltaHeight=k.deltaHeight;k.targetNode=null;r.onKeyDown.add(function(p,n){var s=121,o=122;if(n.altKey){if(n.keyCode===s){v.toolbarGroup.focus();return b.cancel(n)}else{if(n.keyCode===o){d.get(p.id+"_path_row").focus();return b.cancel(n)}}}});r.addShortcut("alt+0","","mceShortcuts",v);return{iframeContainer:l,editorContainer:r.id+"_parent",sizeContainer:u,deltaHeight:k.deltaHeight}},getInfo:function(){return{longname:"Advanced theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:e.majorVersion+"."+e.minorVersion}},resizeBy:function(i,j){var k=d.get(this.editor.id+"_ifr");this.resizeTo(k.clientWidth+i,k.clientHeight+j)},resizeTo:function(i,m,k){var j=this.editor,l=this.settings,n=d.get(j.id+"_tbl"),o=d.get(j.id+"_ifr");i=Math.max(l.theme_advanced_resizing_min_width||100,i);m=Math.max(l.theme_advanced_resizing_min_height||100,m);i=Math.min(l.theme_advanced_resizing_max_width||65535,i);m=Math.min(l.theme_advanced_resizing_max_height||65535,m);d.setStyle(n,"height","");d.setStyle(o,"height",m);if(l.theme_advanced_resize_horizontal){d.setStyle(n,"width","");d.setStyle(o,"width",i);if(i<n.clientWidth){i=n.clientWidth;d.setStyle(o,"width",n.clientWidth)}}if(k&&l.theme_advanced_resizing_use_cookie){a.setHash("TinyMCE_"+j.id+"_size",{cw:i,ch:m})}},destroy:function(){var i=this.editor.id;b.clear(i+"_resize");b.clear(i+"_path_row");b.clear(i+"_external_close")},_simpleLayout:function(y,r,k,i){var x=this,u=x.editor,v=y.theme_advanced_toolbar_location,m=y.theme_advanced_statusbar_location,l,j,q,w;if(y.readonly){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});return j}if(v=="top"){x._addToolbars(r,k)}if(v=="external"){l=w=d.create("div",{style:"position:relative"});l=d.add(l,"div",{id:u.id+"_external","class":"mceExternalToolbar"});d.add(l,"a",{id:u.id+"_external_close",href:"javascript:;","class":"mceExternalClose"});l=d.add(l,"table",{id:u.id+"_tblext",cellSpacing:0,cellPadding:0});q=d.add(l,"tbody");if(i.firstChild.className=="mceOldBoxModel"){i.firstChild.appendChild(w)}else{i.insertBefore(w,i.firstChild)}x._addToolbars(q,k);u.onMouseUp.add(function(){var o=d.get(u.id+"_external");d.show(o);d.hide(g);var n=b.add(u.id+"_external_close","click",function(){d.hide(u.id+"_external");b.remove(u.id+"_external_close","click",n)});d.show(o);d.setStyle(o,"top",0-d.getRect(u.id+"_tblext").h-1);d.hide(o);d.show(o);o.style.filter="";g=u.id+"_external";o=null})}if(m=="top"){x._addStatusBar(r,k)}if(!y.theme_advanced_toolbar_container){l=d.add(r,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"})}if(v=="bottom"){x._addToolbars(r,k)}if(m=="bottom"){x._addStatusBar(r,k)}return j},_rowLayout:function(w,m,k){var v=this,p=v.editor,u,x,i=p.controlManager,l,j,r,q;u=w.theme_advanced_containers_default_class||"";x=w.theme_advanced_containers_default_align||"center";f(c(w.theme_advanced_containers||""),function(s,o){var n=w["theme_advanced_container_"+s]||"";switch(s.toLowerCase()){case"mceeditor":l=d.add(m,"tr");l=j=d.add(l,"td",{"class":"mceIframeContainer"});break;case"mceelementpath":v._addStatusBar(m,k);break;default:q=(w["theme_advanced_container_"+s+"_align"]||x).toLowerCase();q="mce"+v._ufirst(q);l=d.add(d.add(m,"tr"),"td",{"class":"mceToolbar "+(w["theme_advanced_container_"+s+"_class"]||u)+" "+q||x});r=i.createToolbar("toolbar"+o);v._addControls(n,r);d.setHTML(l,r.renderHTML());k.deltaHeight-=w.theme_advanced_row_height}});return j},_addControls:function(j,i){var k=this,l=k.settings,m,n=k.editor.controlManager;if(l.theme_advanced_disable&&!k._disabled){m={};f(c(l.theme_advanced_disable),function(o){m[o]=1});k._disabled=m}else{m=k._disabled}f(c(j),function(p){var o;if(m&&m[p]){return}if(p=="tablecontrols"){f(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"],function(q){q=k.createControl(q,n);if(q){i.add(q)}});return}o=k.createControl(p,n);if(o){i.add(o)}})},_addToolbars:function(x,k){var A=this,p,m,r=A.editor,B=A.settings,z,j=r.controlManager,u,l,q=[],y,w;w=j.createToolbarGroup("toolbargroup",{name:r.getLang("advanced.toolbar"),tab_focus_toolbar:r.getParam("theme_advanced_tab_focus_toolbar")});A.toolbarGroup=w;y=B.theme_advanced_toolbar_align.toLowerCase();y="mce"+A._ufirst(y);l=d.add(d.add(x,"tr",{role:"presentation"}),"td",{"class":"mceToolbar "+y,role:"presentation"});for(p=1;(z=B["theme_advanced_buttons"+p]);p++){m=j.createToolbar("toolbar"+p,{"class":"mceToolbarRow"+p});if(B["theme_advanced_buttons"+p+"_add"]){z+=","+B["theme_advanced_buttons"+p+"_add"]}if(B["theme_advanced_buttons"+p+"_add_before"]){z=B["theme_advanced_buttons"+p+"_add_before"]+","+z}A._addControls(z,m);w.add(m);k.deltaHeight-=B.theme_advanced_row_height}q.push(w.renderHTML());q.push(d.createHTML("a",{href:"#",accesskey:"z",title:r.getLang("advanced.toolbar_focus"),onfocus:"tinyMCE.getInstanceById('"+r.id+"').focus();"},"<!-- IE -->"));d.setHTML(l,q.join(""))},_addStatusBar:function(m,j){var k,v=this,p=v.editor,w=v.settings,i,q,u,l;k=d.add(m,"tr");k=l=d.add(k,"td",{"class":"mceStatusbar"});k=d.add(k,"div",{id:p.id+"_path_row",role:"group","aria-labelledby":p.id+"_path_voice"});if(w.theme_advanced_path){d.add(k,"span",{id:p.id+"_path_voice"},p.translate("advanced.path"));d.add(k,"span",{},": ")}else{d.add(k,"span",{},"&#160;")}if(w.theme_advanced_resizing){d.add(l,"a",{id:p.id+"_resize",href:"javascript:;",onclick:"return false;","class":"mceResize"});if(w.theme_advanced_resizing_use_cookie){p.onPostRender.add(function(){var n=a.getHash("TinyMCE_"+p.id+"_size"),r=d.get(p.id+"_tbl");if(!n){return}v.resizeTo(n.cw,n.ch)})}p.onPostRender.add(function(){b.add(p.id+"_resize","click",function(n){n.preventDefault()});b.add(p.id+"_resize","mousedown",function(D){var t,r,s,o,C,z,A,F,n,E,x;function y(G){G.preventDefault();n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E)}function B(G){b.remove(d.doc,"mousemove",t);b.remove(p.getDoc(),"mousemove",r);b.remove(d.doc,"mouseup",s);b.remove(p.getDoc(),"mouseup",o);n=A+(G.screenX-C);E=F+(G.screenY-z);v.resizeTo(n,E,true)}D.preventDefault();C=D.screenX;z=D.screenY;x=d.get(v.editor.id+"_ifr");A=n=x.clientWidth;F=E=x.clientHeight;t=b.add(d.doc,"mousemove",y);r=b.add(p.getDoc(),"mousemove",y);s=b.add(d.doc,"mouseup",B);o=b.add(p.getDoc(),"mouseup",B)})})}j.deltaHeight-=21;k=m=null},_updateUndoStatus:function(j){var i=j.controlManager;i.setDisabled("undo",!j.undoManager.hasUndo()&&!j.typing);i.setDisabled("redo",!j.undoManager.hasRedo())},_nodeChanged:function(m,r,D,q,E){var y=this,C,F=0,x,G,z=y.settings,w,k,u,B,l,j,i;e.each(y.stateControls,function(n){r.setActive(n,m.queryCommandState(y.controls[n][1]))});function o(p){var s,n=E.parents,t=p;if(typeof(p)=="string"){t=function(v){return v.nodeName==p}}for(s=0;s<n.length;s++){if(t(n[s])){return n[s]}}}r.setActive("visualaid",m.hasVisual);y._updateUndoStatus(m);r.setDisabled("outdent",!m.queryCommandState("Outdent"));C=o("A");if(G=r.get("link")){if(!C||!C.name){G.setDisabled(!C&&q);G.setActive(!!C)}}if(G=r.get("unlink")){G.setDisabled(!C&&q);G.setActive(!!C&&!C.name)}if(G=r.get("anchor")){G.setActive(!q&&!!C&&C.name)}C=o("IMG");if(G=r.get("image")){G.setActive(!q&&!!C&&D.className.indexOf("mceItem")==-1)}if(G=r.get("styleselect")){y._importClasses();j=[];f(G.items,function(n){j.push(n.value)});i=m.formatter.matchAll(j);G.select(i[0])}if(G=r.get("formatselect")){C=o(d.isBlock);if(C){G.select(C.nodeName.toLowerCase())}}o(function(p){if(p.nodeName==="SPAN"){if(!w&&p.className){w=p.className}}if(m.dom.is(p,z.theme_advanced_font_selector)){if(!k&&p.style.fontSize){k=p.style.fontSize}if(!u&&p.style.fontFamily){u=p.style.fontFamily.replace(/[\"\']+/g,"").replace(/^([^,]+).*/,"$1").toLowerCase()}if(!B&&p.style.color){B=p.style.color}if(!l&&p.style.backgroundColor){l=p.style.backgroundColor}}return false});if(G=r.get("fontselect")){G.select(function(n){return n.replace(/^([^,]+).*/,"$1").toLowerCase()==u})}if(G=r.get("fontsizeselect")){if(z.theme_advanced_runtime_fontsize&&!k&&!w){k=m.dom.getStyle(D,"fontSize",true)}G.select(function(n){if(n.fontSize&&n.fontSize===k){return true}if(n["class"]&&n["class"]===w){return true}})}if(z.theme_advanced_show_current_color){function A(p,n){if(G=r.get(p)){if(!n){n=G.settings.default_color}if(n!==G.value){G.displayColor(n)}}}A("forecolor",B);A("backcolor",l)}if(z.theme_advanced_show_current_color){function A(p,n){if(G=r.get(p)){if(!n){n=G.settings.default_color}if(n!==G.value){G.displayColor(n)}}}A("forecolor",B);A("backcolor",l)}if(z.theme_advanced_path&&z.theme_advanced_statusbar_location){C=d.get(m.id+"_path")||d.add(m.id+"_path_row","span",{id:m.id+"_path"});if(y.statusKeyboardNavigation){y.statusKeyboardNavigation.destroy();y.statusKeyboardNavigation=null}d.setHTML(C,"");o(function(H){var p=H.nodeName.toLowerCase(),s,v,t="";if(H.getAttribute("data-mce-bogus")){return}if(H.nodeType!=1||H.nodeName==="BR"||(d.hasClass(H,"mceItemHidden")||d.hasClass(H,"mceItemRemoved"))){return}if(e.isIE&&H.scopeName!=="HTML"){p=H.scopeName+":"+p}p=p.replace(/mce\:/g,"");switch(p){case"b":p="strong";break;case"i":p="em";break;case"img":if(x=d.getAttrib(H,"src")){t+="src: "+x+" "}break;case"a":if(x=d.getAttrib(H,"name")){t+="name: "+x+" ";p+="#"+x}if(x=d.getAttrib(H,"href")){t+="href: "+x+" "}break;case"font":if(x=d.getAttrib(H,"face")){t+="font: "+x+" "}if(x=d.getAttrib(H,"size")){t+="size: "+x+" "}if(x=d.getAttrib(H,"color")){t+="color: "+x+" "}break;case"span":if(x=d.getAttrib(H,"style")){t+="style: "+x+" "}break}if(x=d.getAttrib(H,"id")){t+="id: "+x+" "}if(x=H.className){x=x.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g,"");if(x){t+="class: "+x+" ";if(d.isBlock(H)||p=="img"||p=="span"){p+="."+x}}}p=p.replace(/(html:)/g,"");p={name:p,node:H,title:t};y.onResolveName.dispatch(y,p);t=p.title;p=p.name;v=d.create("a",{href:"javascript:;",role:"button",onmousedown:"return false;",title:t,"class":"mcePath_"+(F++)},p);if(C.hasChildNodes()){C.insertBefore(d.create("span",{"aria-hidden":"true"},"\u00a0\u00bb "),C.firstChild);C.insertBefore(v,C.firstChild)}else{C.appendChild(v)}},m.getBody());if(d.select("a",C).length>0){y.statusKeyboardNavigation=new e.ui.KeyboardNavigation({root:m.id+"_path_row",items:d.select("a",C),excludeFromTabOrder:true,onCancel:function(){m.focus()}},d)}}},_sel:function(i){this.editor.execCommand("mceSelectNodeDepth",false,i)},_mceInsertAnchor:function(k,j){var i=this.editor;i.windowManager.open({url:this.url+"/anchor.htm",width:320+parseInt(i.getLang("advanced.anchor_delta_width",0)),height:90+parseInt(i.getLang("advanced.anchor_delta_height",0)),inline:true},{theme_url:this.url})},_mceCharMap:function(){var i=this.editor;i.windowManager.open({url:this.url+"/charmap.htm",width:550+parseInt(i.getLang("advanced.charmap_delta_width",0)),height:250+parseInt(i.getLang("advanced.charmap_delta_height",0)),inline:true},{theme_url:this.url})},_mceHelp:function(){var i=this.editor;i.windowManager.open({url:this.url+"/about.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceShortcuts:function(){var i=this.editor;i.windowManager.open({url:this.url+"/shortcuts.htm",width:480,height:380,inline:true},{theme_url:this.url})},_mceColorPicker:function(k,j){var i=this.editor;j=j||{};i.windowManager.open({url:this.url+"/color_picker.htm",width:375+parseInt(i.getLang("advanced.colorpicker_delta_width",0)),height:250+parseInt(i.getLang("advanced.colorpicker_delta_height",0)),close_previous:false,inline:true},{input_color:j.color,func:j.func,theme_url:this.url})},_mceCodeEditor:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/source_editor.htm",width:parseInt(i.getParam("theme_advanced_source_editor_width",720)),height:parseInt(i.getParam("theme_advanced_source_editor_height",580)),inline:true,resizable:true,maximizable:true},{theme_url:this.url})},_mceImage:function(j,k){var i=this.editor;if(i.dom.getAttrib(i.selection.getNode(),"class").indexOf("mceItem")!=-1){return}i.windowManager.open({url:this.url+"/image.htm",width:355+parseInt(i.getLang("advanced.image_delta_width",0)),height:275+parseInt(i.getLang("advanced.image_delta_height",0)),inline:true},{theme_url:this.url})},_mceLink:function(j,k){var i=this.editor;i.windowManager.open({url:this.url+"/link.htm",width:310+parseInt(i.getLang("advanced.link_delta_width",0)),height:200+parseInt(i.getLang("advanced.link_delta_height",0)),inline:true},{theme_url:this.url})},_mceNewDocument:function(){var i=this.editor;i.windowManager.confirm("advanced.newdocument",function(j){if(j){i.execCommand("mceSetContent",false,"")}})},_mceForeColor:function(){var i=this;this._mceColorPicker(0,{color:i.fgColor,func:function(j){i.fgColor=j;i.editor.execCommand("ForeColor",false,j)}})},_mceBackColor:function(){var i=this;this._mceColorPicker(0,{color:i.bgColor,func:function(j){i.bgColor=j;i.editor.execCommand("HiliteColor",false,j)}})},_ufirst:function(i){return i.substring(0,1).toUpperCase()+i.substring(1)}});e.ThemeManager.add("advanced",e.themes.AdvancedTheme)}(tinymce));
Index: admin/js/tiny_mce/themes/advanced/editor_template_src.js
===================================================================
--- admin/js/tiny_mce/themes/advanced/editor_template_src.js	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/editor_template_src.js	(revision 307)
@@ -0,0 +1,1360 @@
+/**
+ * editor_template_src.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(function(tinymce) {
+	var DOM = tinymce.DOM, Event = tinymce.dom.Event, extend = tinymce.extend, each = tinymce.each, Cookie = tinymce.util.Cookie, lastExtID, explode = tinymce.explode;
+
+	// Tell it to load theme specific language pack(s)
+	tinymce.ThemeManager.requireLangPack('advanced');
+
+	tinymce.create('tinymce.themes.AdvancedTheme', {
+		sizes : [8, 10, 12, 14, 18, 24, 36],
+
+		// Control name lookup, format: title, command
+		controls : {
+			bold : ['bold_desc', 'Bold'],
+			italic : ['italic_desc', 'Italic'],
+			underline : ['underline_desc', 'Underline'],
+			strikethrough : ['striketrough_desc', 'Strikethrough'],
+			justifyleft : ['justifyleft_desc', 'JustifyLeft'],
+			justifycenter : ['justifycenter_desc', 'JustifyCenter'],
+			justifyright : ['justifyright_desc', 'JustifyRight'],
+			justifyfull : ['justifyfull_desc', 'JustifyFull'],
+			bullist : ['bullist_desc', 'InsertUnorderedList'],
+			numlist : ['numlist_desc', 'InsertOrderedList'],
+			outdent : ['outdent_desc', 'Outdent'],
+			indent : ['indent_desc', 'Indent'],
+			cut : ['cut_desc', 'Cut'],
+			copy : ['copy_desc', 'Copy'],
+			paste : ['paste_desc', 'Paste'],
+			undo : ['undo_desc', 'Undo'],
+			redo : ['redo_desc', 'Redo'],
+			link : ['link_desc', 'mceLink'],
+			unlink : ['unlink_desc', 'unlink'],
+			image : ['image_desc', 'mceImage'],
+			cleanup : ['cleanup_desc', 'mceCleanup'],
+			help : ['help_desc', 'mceHelp'],
+			code : ['code_desc', 'mceCodeEditor'],
+			hr : ['hr_desc', 'InsertHorizontalRule'],
+			removeformat : ['removeformat_desc', 'RemoveFormat'],
+			sub : ['sub_desc', 'subscript'],
+			sup : ['sup_desc', 'superscript'],
+			forecolor : ['forecolor_desc', 'ForeColor'],
+			forecolorpicker : ['forecolor_desc', 'mceForeColor'],
+			backcolor : ['backcolor_desc', 'HiliteColor'],
+			backcolorpicker : ['backcolor_desc', 'mceBackColor'],
+			charmap : ['charmap_desc', 'mceCharMap'],
+			visualaid : ['visualaid_desc', 'mceToggleVisualAid'],
+			anchor : ['anchor_desc', 'mceInsertAnchor'],
+			newdocument : ['newdocument_desc', 'mceNewDocument'],
+			blockquote : ['blockquote_desc', 'mceBlockQuote']
+		},
+
+		stateControls : ['bold', 'italic', 'underline', 'strikethrough', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'justifyfull', 'sub', 'sup', 'blockquote'],
+
+		init : function(ed, url) {
+			var t = this, s, v, o;
+	
+			t.editor = ed;
+			t.url = url;
+			t.onResolveName = new tinymce.util.Dispatcher(this);
+
+			ed.forcedHighContrastMode = ed.settings.detect_highcontrast && t._isHighContrast();
+			ed.settings.skin = ed.forcedHighContrastMode ? 'highcontrast' : ed.settings.skin;
+
+			// Default settings
+			t.settings = s = extend({
+				theme_advanced_path : true,
+				theme_advanced_toolbar_location : 'bottom',
+				theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect",
+				theme_advanced_buttons2 : "bullist,numlist,|,outdent,indent,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code",
+				theme_advanced_buttons3 : "hr,removeformat,visualaid,|,sub,sup,|,charmap",
+				theme_advanced_blockformats : "p,address,pre,h1,h2,h3,h4,h5,h6",
+				theme_advanced_toolbar_align : "center",
+				theme_advanced_fonts : "Andale Mono=andale mono,times;Arial=arial,helvetica,sans-serif;Arial Black=arial black,avant garde;Book Antiqua=book antiqua,palatino;Comic Sans MS=comic sans ms,sans-serif;Courier New=courier new,courier;Georgia=georgia,palatino;Helvetica=helvetica;Impact=impact,chicago;Symbol=symbol;Tahoma=tahoma,arial,helvetica,sans-serif;Terminal=terminal,monaco;Times New Roman=times new roman,times;Trebuchet MS=trebuchet ms,geneva;Verdana=verdana,geneva;Webdings=webdings;Wingdings=wingdings,zapf dingbats",
+				theme_advanced_more_colors : 1,
+				theme_advanced_row_height : 23,
+				theme_advanced_resize_horizontal : 1,
+				theme_advanced_resizing_use_cookie : 1,
+				theme_advanced_font_sizes : "1,2,3,4,5,6,7",
+				theme_advanced_font_selector : "span",
+				theme_advanced_show_current_color: 0,
+				readonly : ed.settings.readonly
+			}, ed.settings);
+
+			// Setup default font_size_style_values
+			if (!s.font_size_style_values)
+				s.font_size_style_values = "8pt,10pt,12pt,14pt,18pt,24pt,36pt";
+
+			if (tinymce.is(s.theme_advanced_font_sizes, 'string')) {
+				s.font_size_style_values = tinymce.explode(s.font_size_style_values);
+				s.font_size_classes = tinymce.explode(s.font_size_classes || '');
+
+				// Parse string value
+				o = {};
+				ed.settings.theme_advanced_font_sizes = s.theme_advanced_font_sizes;
+				each(ed.getParam('theme_advanced_font_sizes', '', 'hash'), function(v, k) {
+					var cl;
+
+					if (k == v && v >= 1 && v <= 7) {
+						k = v + ' (' + t.sizes[v - 1] + 'pt)';
+						cl = s.font_size_classes[v - 1];
+						v = s.font_size_style_values[v - 1] || (t.sizes[v - 1] + 'pt');
+					}
+
+					if (/^\s*\./.test(v))
+						cl = v.replace(/\./g, '');
+
+					o[k] = cl ? {'class' : cl} : {fontSize : v};
+				});
+
+				s.theme_advanced_font_sizes = o;
+			}
+
+			if ((v = s.theme_advanced_path_location) && v != 'none')
+				s.theme_advanced_statusbar_location = s.theme_advanced_path_location;
+
+			if (s.theme_advanced_statusbar_location == 'none')
+				s.theme_advanced_statusbar_location = 0;
+
+			if (ed.settings.content_css !== false)
+				ed.contentCSS.push(ed.baseURI.toAbsolute(url + "/skins/" + ed.settings.skin + "/content.css"));
+
+			// Init editor
+			ed.onInit.add(function() {
+				if (!ed.settings.readonly) {
+					ed.onNodeChange.add(t._nodeChanged, t);
+					ed.onKeyUp.add(t._updateUndoStatus, t);
+					ed.onMouseUp.add(t._updateUndoStatus, t);
+					ed.dom.bind(ed.dom.getRoot(), 'dragend', function() {
+						t._updateUndoStatus(ed);
+					});
+				}
+			});
+
+			ed.onSetProgressState.add(function(ed, b, ti) {
+				var co, id = ed.id, tb;
+
+				if (b) {
+					t.progressTimer = setTimeout(function() {
+						co = ed.getContainer();
+						co = co.insertBefore(DOM.create('DIV', {style : 'position:relative'}), co.firstChild);
+						tb = DOM.get(ed.id + '_tbl');
+
+						DOM.add(co, 'div', {id : id + '_blocker', 'class' : 'mceBlocker', style : {width : tb.clientWidth + 2, height : tb.clientHeight + 2}});
+						DOM.add(co, 'div', {id : id + '_progress', 'class' : 'mceProgress', style : {left : tb.clientWidth / 2, top : tb.clientHeight / 2}});
+					}, ti || 0);
+				} else {
+					DOM.remove(id + '_blocker');
+					DOM.remove(id + '_progress');
+					clearTimeout(t.progressTimer);
+				}
+			});
+
+			DOM.loadCSS(s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : url + "/skins/" + ed.settings.skin + "/ui.css");
+
+			if (s.skin_variant)
+				DOM.loadCSS(url + "/skins/" + ed.settings.skin + "/ui_" + s.skin_variant + ".css");
+		},
+
+		_isHighContrast : function() {
+			var actualColor, div = DOM.add(DOM.getRoot(), 'div', {'style': 'background-color: rgb(171,239,86);'});
+
+			actualColor = (DOM.getStyle(div, 'background-color', true) + '').toLowerCase().replace(/ /g, '');
+			DOM.remove(div);
+
+			return actualColor != 'rgb(171,239,86)' && actualColor != '#abef56';
+		},
+
+		createControl : function(n, cf) {
+			var cd, c;
+
+			if (c = cf.createControl(n))
+				return c;
+
+			switch (n) {
+				case "styleselect":
+					return this._createStyleSelect();
+
+				case "formatselect":
+					return this._createBlockFormats();
+
+				case "fontselect":
+					return this._createFontSelect();
+
+				case "fontsizeselect":
+					return this._createFontSizeSelect();
+
+				case "forecolor":
+					return this._createForeColorMenu();
+
+				case "backcolor":
+					return this._createBackColorMenu();
+			}
+
+			if ((cd = this.controls[n]))
+				return cf.createButton(n, {title : "advanced." + cd[0], cmd : cd[1], ui : cd[2], value : cd[3]});
+		},
+
+		execCommand : function(cmd, ui, val) {
+			var f = this['_' + cmd];
+
+			if (f) {
+				f.call(this, ui, val);
+				return true;
+			}
+
+			return false;
+		},
+
+		_importClasses : function(e) {
+			var ed = this.editor, ctrl = ed.controlManager.get('styleselect');
+
+			if (ctrl.getLength() == 0) {
+				each(ed.dom.getClasses(), function(o, idx) {
+					var name = 'style_' + idx;
+
+					ed.formatter.register(name, {
+						inline : 'span',
+						attributes : {'class' : o['class']},
+						selector : '*'
+					});
+
+					ctrl.add(o['class'], name);
+				});
+			}
+		},
+
+		_createStyleSelect : function(n) {
+			var t = this, ed = t.editor, ctrlMan = ed.controlManager, ctrl;
+
+			// Setup style select box
+			ctrl = ctrlMan.createListBox('styleselect', {
+				title : 'advanced.style_select',
+				onselect : function(name) {
+					var matches, formatNames = [];
+
+					each(ctrl.items, function(item) {
+						formatNames.push(item.value);
+					});
+
+					ed.focus();
+					ed.undoManager.add();
+
+					// Toggle off the current format
+					matches = ed.formatter.matchAll(formatNames);
+					if (!name || matches[0] == name) {
+						if (matches[0]) 
+							ed.formatter.remove(matches[0]);
+					} else
+						ed.formatter.apply(name);
+
+					ed.undoManager.add();
+					ed.nodeChanged();
+
+					return false; // No auto select
+				}
+			});
+
+			// Handle specified format
+			ed.onInit.add(function() {
+				var counter = 0, formats = ed.getParam('style_formats');
+
+				if (formats) {
+					each(formats, function(fmt) {
+						var name, keys = 0;
+
+						each(fmt, function() {keys++;});
+
+						if (keys > 1) {
+							name = fmt.name = fmt.name || 'style_' + (counter++);
+							ed.formatter.register(name, fmt);
+							ctrl.add(fmt.title, name);
+						} else
+							ctrl.add(fmt.title);
+					});
+				} else {
+					each(ed.getParam('theme_advanced_styles', '', 'hash'), function(val, key) {
+						var name;
+
+						if (val) {
+							name = 'style_' + (counter++);
+
+							ed.formatter.register(name, {
+								inline : 'span',
+								classes : val,
+								selector : '*'
+							});
+
+							ctrl.add(t.editor.translate(key), name);
+						}
+					});
+				}
+			});
+
+			// Auto import classes if the ctrl box is empty
+			if (ctrl.getLength() == 0) {
+				ctrl.onPostRender.add(function(ed, n) {
+					if (!ctrl.NativeListBox) {
+						Event.add(n.id + '_text', 'focus', t._importClasses, t);
+						Event.add(n.id + '_text', 'mousedown', t._importClasses, t);
+						Event.add(n.id + '_open', 'focus', t._importClasses, t);
+						Event.add(n.id + '_open', 'mousedown', t._importClasses, t);
+					} else
+						Event.add(n.id, 'focus', t._importClasses, t);
+				});
+			}
+
+			return ctrl;
+		},
+
+		_createFontSelect : function() {
+			var c, t = this, ed = t.editor;
+
+			c = ed.controlManager.createListBox('fontselect', {
+				title : 'advanced.fontdefault',
+				onselect : function(v) {
+					var cur = c.items[c.selectedIndex];
+
+					if (!v && cur) {
+						ed.execCommand('FontName', false, cur.value);
+						return;
+					}
+
+					ed.execCommand('FontName', false, v);
+
+					// Fake selection, execCommand will fire a nodeChange and update the selection
+					c.select(function(sv) {
+						return v == sv;
+					});
+
+					if (cur && cur.value == v) {
+						c.select(null);
+					}
+
+					return false; // No auto select
+				}
+			});
+
+			if (c) {
+				each(ed.getParam('theme_advanced_fonts', t.settings.theme_advanced_fonts, 'hash'), function(v, k) {
+					c.add(ed.translate(k), v, {style : v.indexOf('dings') == -1 ? 'font-family:' + v : ''});
+				});
+			}
+
+			return c;
+		},
+
+		_createFontSizeSelect : function() {
+			var t = this, ed = t.editor, c, i = 0, cl = [];
+
+			c = ed.controlManager.createListBox('fontsizeselect', {title : 'advanced.font_size', onselect : function(v) {
+				var cur = c.items[c.selectedIndex];
+
+				if (!v && cur) {
+					cur = cur.value;
+
+					if (cur['class']) {
+						ed.formatter.toggle('fontsize_class', {value : cur['class']});
+						ed.undoManager.add();
+						ed.nodeChanged();
+					} else {
+						ed.execCommand('FontSize', false, cur.fontSize);
+					}
+
+					return;
+				}
+
+				if (v['class']) {
+					ed.focus();
+					ed.undoManager.add();
+					ed.formatter.toggle('fontsize_class', {value : v['class']});
+					ed.undoManager.add();
+					ed.nodeChanged();
+				} else
+					ed.execCommand('FontSize', false, v.fontSize);
+
+				// Fake selection, execCommand will fire a nodeChange and update the selection
+				c.select(function(sv) {
+					return v == sv;
+				});
+
+				if (cur && (cur.value.fontSize == v.fontSize || cur.value['class'] == v['class'])) {
+					c.select(null);
+				}
+
+				return false; // No auto select
+			}});
+
+			if (c) {
+				each(t.settings.theme_advanced_font_sizes, function(v, k) {
+					var fz = v.fontSize;
+
+					if (fz >= 1 && fz <= 7)
+						fz = t.sizes[parseInt(fz) - 1] + 'pt';
+
+					c.add(k, v, {'style' : 'font-size:' + fz, 'class' : 'mceFontSize' + (i++) + (' ' + (v['class'] || ''))});
+				});
+			}
+
+			return c;
+		},
+
+		_createBlockFormats : function() {
+			var c, fmts = {
+				p : 'advanced.paragraph',
+				address : 'advanced.address',
+				pre : 'advanced.pre',
+				h1 : 'advanced.h1',
+				h2 : 'advanced.h2',
+				h3 : 'advanced.h3',
+				h4 : 'advanced.h4',
+				h5 : 'advanced.h5',
+				h6 : 'advanced.h6',
+				div : 'advanced.div',
+				blockquote : 'advanced.blockquote',
+				code : 'advanced.code',
+				dt : 'advanced.dt',
+				dd : 'advanced.dd',
+				samp : 'advanced.samp'
+			}, t = this;
+
+			c = t.editor.controlManager.createListBox('formatselect', {title : 'advanced.block', onselect : function(v) {
+				t.editor.execCommand('FormatBlock', false, v);
+				return false;
+			}});
+
+			if (c) {
+				each(t.editor.getParam('theme_advanced_blockformats', t.settings.theme_advanced_blockformats, 'hash'), function(v, k) {
+					c.add(t.editor.translate(k != v ? k : fmts[v]), v, {'class' : 'mce_formatPreview mce_' + v});
+				});
+			}
+
+			return c;
+		},
+
+		_createForeColorMenu : function() {
+			var c, t = this, s = t.settings, o = {}, v;
+
+			if (s.theme_advanced_more_colors) {
+				o.more_colors_func = function() {
+					t._mceColorPicker(0, {
+						color : c.value,
+						func : function(co) {
+							c.setColor(co);
+						}
+					});
+				};
+			}
+
+			if (v = s.theme_advanced_text_colors)
+				o.colors = v;
+
+			if (s.theme_advanced_default_foreground_color)
+				o.default_color = s.theme_advanced_default_foreground_color;
+
+			o.title = 'advanced.forecolor_desc';
+			o.cmd = 'ForeColor';
+			o.scope = this;
+
+			c = t.editor.controlManager.createColorSplitButton('forecolor', o);
+
+			return c;
+		},
+
+		_createBackColorMenu : function() {
+			var c, t = this, s = t.settings, o = {}, v;
+
+			if (s.theme_advanced_more_colors) {
+				o.more_colors_func = function() {
+					t._mceColorPicker(0, {
+						color : c.value,
+						func : function(co) {
+							c.setColor(co);
+						}
+					});
+				};
+			}
+
+			if (v = s.theme_advanced_background_colors)
+				o.colors = v;
+
+			if (s.theme_advanced_default_background_color)
+				o.default_color = s.theme_advanced_default_background_color;
+
+			o.title = 'advanced.backcolor_desc';
+			o.cmd = 'HiliteColor';
+			o.scope = this;
+
+			c = t.editor.controlManager.createColorSplitButton('backcolor', o);
+
+			return c;
+		},
+
+		renderUI : function(o) {
+			var n, ic, tb, t = this, ed = t.editor, s = t.settings, sc, p, nl;
+
+			if (ed.settings) {
+				ed.settings.aria_label = s.aria_label + ed.getLang('advanced.help_shortcut');
+			}
+
+			// TODO: ACC Should have an aria-describedby attribute which is user-configurable to describe what this field is actually for.
+			// Maybe actually inherit it from the original textara?
+			n = p = DOM.create('span', {role : 'application', 'aria-labelledby' : ed.id + '_voice', id : ed.id + '_parent', 'class' : 'mceEditor ' + ed.settings.skin + 'Skin' + (s.skin_variant ? ' ' + ed.settings.skin + 'Skin' + t._ufirst(s.skin_variant) : '')});
+			DOM.add(n, 'span', {'class': 'mceVoiceLabel', 'style': 'display:none;', id: ed.id + '_voice'}, s.aria_label);
+
+			if (!DOM.boxModel)
+				n = DOM.add(n, 'div', {'class' : 'mceOldBoxModel'});
+
+			n = sc = DOM.add(n, 'table', {role : "presentation", id : ed.id + '_tbl', 'class' : 'mceLayout', cellSpacing : 0, cellPadding : 0});
+			n = tb = DOM.add(n, 'tbody');
+
+			switch ((s.theme_advanced_layout_manager || '').toLowerCase()) {
+				case "rowlayout":
+					ic = t._rowLayout(s, tb, o);
+					break;
+
+				case "customlayout":
+					ic = ed.execCallback("theme_advanced_custom_layout", s, tb, o, p);
+					break;
+
+				default:
+					ic = t._simpleLayout(s, tb, o, p);
+			}
+
+			n = o.targetNode;
+
+			// Add classes to first and last TRs
+			nl = sc.rows;
+			DOM.addClass(nl[0], 'mceFirst');
+			DOM.addClass(nl[nl.length - 1], 'mceLast');
+
+			// Add classes to first and last TDs
+			each(DOM.select('tr', tb), function(n) {
+				DOM.addClass(n.firstChild, 'mceFirst');
+				DOM.addClass(n.childNodes[n.childNodes.length - 1], 'mceLast');
+			});
+
+			if (DOM.get(s.theme_advanced_toolbar_container))
+				DOM.get(s.theme_advanced_toolbar_container).appendChild(p);
+			else
+				DOM.insertAfter(p, n);
+
+			Event.add(ed.id + '_path_row', 'click', function(e) {
+				e = e.target;
+
+				if (e.nodeName == 'A') {
+					t._sel(e.className.replace(/^.*mcePath_([0-9]+).*$/, '$1'));
+
+					return Event.cancel(e);
+				}
+			});
+/*
+			if (DOM.get(ed.id + '_path_row')) {
+				Event.add(ed.id + '_tbl', 'mouseover', function(e) {
+					var re;
+	
+					e = e.target;
+
+					if (e.nodeName == 'SPAN' && DOM.hasClass(e.parentNode, 'mceButton')) {
+						re = DOM.get(ed.id + '_path_row');
+						t.lastPath = re.innerHTML;
+						DOM.setHTML(re, e.parentNode.title);
+					}
+				});
+
+				Event.add(ed.id + '_tbl', 'mouseout', function(e) {
+					if (t.lastPath) {
+						DOM.setHTML(ed.id + '_path_row', t.lastPath);
+						t.lastPath = 0;
+					}
+				});
+			}
+*/
+
+			if (!ed.getParam('accessibility_focus'))
+				Event.add(DOM.add(p, 'a', {href : '#'}, '<!-- IE -->'), 'focus', function() {tinyMCE.get(ed.id).focus();});
+
+			if (s.theme_advanced_toolbar_location == 'external')
+				o.deltaHeight = 0;
+
+			t.deltaHeight = o.deltaHeight;
+			o.targetNode = null;
+
+			ed.onKeyDown.add(function(ed, evt) {
+				var DOM_VK_F10 = 121, DOM_VK_F11 = 122;
+
+				if (evt.altKey) {
+		 			if (evt.keyCode === DOM_VK_F10) {
+						t.toolbarGroup.focus();
+						return Event.cancel(evt);
+					} else if (evt.keyCode === DOM_VK_F11) {
+						DOM.get(ed.id + '_path_row').focus();
+						return Event.cancel(evt);
+					}
+				}
+			});
+
+			// alt+0 is the UK recommended shortcut for accessing the list of access controls.
+			ed.addShortcut('alt+0', '', 'mceShortcuts', t);
+
+			return {
+				iframeContainer : ic,
+				editorContainer : ed.id + '_parent',
+				sizeContainer : sc,
+				deltaHeight : o.deltaHeight
+			};
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Advanced theme',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			}
+		},
+
+		resizeBy : function(dw, dh) {
+			var e = DOM.get(this.editor.id + '_ifr');
+
+			this.resizeTo(e.clientWidth + dw, e.clientHeight + dh);
+		},
+
+		resizeTo : function(w, h, store) {
+			var ed = this.editor, s = this.settings, e = DOM.get(ed.id + '_tbl'), ifr = DOM.get(ed.id + '_ifr');
+
+			// Boundery fix box
+			w = Math.max(s.theme_advanced_resizing_min_width || 100, w);
+			h = Math.max(s.theme_advanced_resizing_min_height || 100, h);
+			w = Math.min(s.theme_advanced_resizing_max_width || 0xFFFF, w);
+			h = Math.min(s.theme_advanced_resizing_max_height || 0xFFFF, h);
+
+			// Resize iframe and container
+			DOM.setStyle(e, 'height', '');
+			DOM.setStyle(ifr, 'height', h);
+
+			if (s.theme_advanced_resize_horizontal) {
+				DOM.setStyle(e, 'width', '');
+				DOM.setStyle(ifr, 'width', w);
+
+				// Make sure that the size is never smaller than the over all ui
+				if (w < e.clientWidth) {
+					w = e.clientWidth;
+					DOM.setStyle(ifr, 'width', e.clientWidth);
+				}
+			}
+
+			// Store away the size
+			if (store && s.theme_advanced_resizing_use_cookie) {
+				Cookie.setHash("TinyMCE_" + ed.id + "_size", {
+					cw : w,
+					ch : h
+				});
+			}
+		},
+
+		destroy : function() {
+			var id = this.editor.id;
+
+			Event.clear(id + '_resize');
+			Event.clear(id + '_path_row');
+			Event.clear(id + '_external_close');
+		},
+
+		// Internal functions
+
+		_simpleLayout : function(s, tb, o, p) {
+			var t = this, ed = t.editor, lo = s.theme_advanced_toolbar_location, sl = s.theme_advanced_statusbar_location, n, ic, etb, c;
+
+			if (s.readonly) {
+				n = DOM.add(tb, 'tr');
+				n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
+				return ic;
+			}
+
+			// Create toolbar container at top
+			if (lo == 'top')
+				t._addToolbars(tb, o);
+
+			// Create external toolbar
+			if (lo == 'external') {
+				n = c = DOM.create('div', {style : 'position:relative'});
+				n = DOM.add(n, 'div', {id : ed.id + '_external', 'class' : 'mceExternalToolbar'});
+				DOM.add(n, 'a', {id : ed.id + '_external_close', href : 'javascript:;', 'class' : 'mceExternalClose'});
+				n = DOM.add(n, 'table', {id : ed.id + '_tblext', cellSpacing : 0, cellPadding : 0});
+				etb = DOM.add(n, 'tbody');
+
+				if (p.firstChild.className == 'mceOldBoxModel')
+					p.firstChild.appendChild(c);
+				else
+					p.insertBefore(c, p.firstChild);
+
+				t._addToolbars(etb, o);
+
+				ed.onMouseUp.add(function() {
+					var e = DOM.get(ed.id + '_external');
+					DOM.show(e);
+
+					DOM.hide(lastExtID);
+
+					var f = Event.add(ed.id + '_external_close', 'click', function() {
+						DOM.hide(ed.id + '_external');
+						Event.remove(ed.id + '_external_close', 'click', f);
+					});
+
+					DOM.show(e);
+					DOM.setStyle(e, 'top', 0 - DOM.getRect(ed.id + '_tblext').h - 1);
+
+					// Fixes IE rendering bug
+					DOM.hide(e);
+					DOM.show(e);
+					e.style.filter = '';
+
+					lastExtID = ed.id + '_external';
+
+					e = null;
+				});
+			}
+
+			if (sl == 'top')
+				t._addStatusBar(tb, o);
+
+			// Create iframe container
+			if (!s.theme_advanced_toolbar_container) {
+				n = DOM.add(tb, 'tr');
+				n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
+			}
+
+			// Create toolbar container at bottom
+			if (lo == 'bottom')
+				t._addToolbars(tb, o);
+
+			if (sl == 'bottom')
+				t._addStatusBar(tb, o);
+
+			return ic;
+		},
+
+		_rowLayout : function(s, tb, o) {
+			var t = this, ed = t.editor, dc, da, cf = ed.controlManager, n, ic, to, a;
+
+			dc = s.theme_advanced_containers_default_class || '';
+			da = s.theme_advanced_containers_default_align || 'center';
+
+			each(explode(s.theme_advanced_containers || ''), function(c, i) {
+				var v = s['theme_advanced_container_' + c] || '';
+
+				switch (c.toLowerCase()) {
+					case 'mceeditor':
+						n = DOM.add(tb, 'tr');
+						n = ic = DOM.add(n, 'td', {'class' : 'mceIframeContainer'});
+						break;
+
+					case 'mceelementpath':
+						t._addStatusBar(tb, o);
+						break;
+
+					default:
+						a = (s['theme_advanced_container_' + c + '_align'] || da).toLowerCase();
+						a = 'mce' + t._ufirst(a);
+
+						n = DOM.add(DOM.add(tb, 'tr'), 'td', {
+							'class' : 'mceToolbar ' + (s['theme_advanced_container_' + c + '_class'] || dc) + ' ' + a || da
+						});
+
+						to = cf.createToolbar("toolbar" + i);
+						t._addControls(v, to);
+						DOM.setHTML(n, to.renderHTML());
+						o.deltaHeight -= s.theme_advanced_row_height;
+				}
+			});
+
+			return ic;
+		},
+
+		_addControls : function(v, tb) {
+			var t = this, s = t.settings, di, cf = t.editor.controlManager;
+
+			if (s.theme_advanced_disable && !t._disabled) {
+				di = {};
+
+				each(explode(s.theme_advanced_disable), function(v) {
+					di[v] = 1;
+				});
+
+				t._disabled = di;
+			} else
+				di = t._disabled;
+
+			each(explode(v), function(n) {
+				var c;
+
+				if (di && di[n])
+					return;
+
+				// Compatiblity with 2.x
+				if (n == 'tablecontrols') {
+					each(["table","|","row_props","cell_props","|","row_before","row_after","delete_row","|","col_before","col_after","delete_col","|","split_cells","merge_cells"], function(n) {
+						n = t.createControl(n, cf);
+
+						if (n)
+							tb.add(n);
+					});
+
+					return;
+				}
+
+				c = t.createControl(n, cf);
+
+				if (c)
+					tb.add(c);
+			});
+		},
+
+		_addToolbars : function(c, o) {
+			var t = this, i, tb, ed = t.editor, s = t.settings, v, cf = ed.controlManager, di, n, h = [], a, toolbarGroup;
+
+			toolbarGroup = cf.createToolbarGroup('toolbargroup', {
+				'name': ed.getLang('advanced.toolbar'),
+				'tab_focus_toolbar':ed.getParam('theme_advanced_tab_focus_toolbar')
+			});
+
+			t.toolbarGroup = toolbarGroup;
+
+			a = s.theme_advanced_toolbar_align.toLowerCase();
+			a = 'mce' + t._ufirst(a);
+
+			n = DOM.add(DOM.add(c, 'tr', {role: 'presentation'}), 'td', {'class' : 'mceToolbar ' + a, "role":"presentation"});
+
+			// Create toolbar and add the controls
+			for (i=1; (v = s['theme_advanced_buttons' + i]); i++) {
+				tb = cf.createToolbar("toolbar" + i, {'class' : 'mceToolbarRow' + i});
+
+				if (s['theme_advanced_buttons' + i + '_add'])
+					v += ',' + s['theme_advanced_buttons' + i + '_add'];
+
+				if (s['theme_advanced_buttons' + i + '_add_before'])
+					v = s['theme_advanced_buttons' + i + '_add_before'] + ',' + v;
+
+				t._addControls(v, tb);
+				toolbarGroup.add(tb);
+
+				o.deltaHeight -= s.theme_advanced_row_height;
+			}
+			h.push(toolbarGroup.renderHTML());
+			h.push(DOM.createHTML('a', {href : '#', accesskey : 'z', title : ed.getLang("advanced.toolbar_focus"), onfocus : 'tinyMCE.getInstanceById(\'' + ed.id + '\').focus();'}, '<!-- IE -->'));
+			DOM.setHTML(n, h.join(''));
+		},
+
+		_addStatusBar : function(tb, o) {
+			var n, t = this, ed = t.editor, s = t.settings, r, mf, me, td;
+
+			n = DOM.add(tb, 'tr');
+			n = td = DOM.add(n, 'td', {'class' : 'mceStatusbar'}); 
+			n = DOM.add(n, 'div', {id : ed.id + '_path_row', 'role': 'group', 'aria-labelledby': ed.id + '_path_voice'});
+			if (s.theme_advanced_path) {
+				DOM.add(n, 'span', {id: ed.id + '_path_voice'}, ed.translate('advanced.path'));
+				DOM.add(n, 'span', {}, ': ');
+			} else {
+				DOM.add(n, 'span', {}, '&#160;');
+			}
+			
+
+			if (s.theme_advanced_resizing) {
+				DOM.add(td, 'a', {id : ed.id + '_resize', href : 'javascript:;', onclick : "return false;", 'class' : 'mceResize'});
+
+				if (s.theme_advanced_resizing_use_cookie) {
+					ed.onPostRender.add(function() {
+						var o = Cookie.getHash("TinyMCE_" + ed.id + "_size"), c = DOM.get(ed.id + '_tbl');
+
+						if (!o)
+							return;
+
+						t.resizeTo(o.cw, o.ch);
+					});
+				}
+
+				ed.onPostRender.add(function() {
+					Event.add(ed.id + '_resize', 'click', function(e) {
+						e.preventDefault();
+					});
+
+					Event.add(ed.id + '_resize', 'mousedown', function(e) {
+						var mouseMoveHandler1, mouseMoveHandler2,
+							mouseUpHandler1, mouseUpHandler2,
+							startX, startY, startWidth, startHeight, width, height, ifrElm;
+
+						function resizeOnMove(e) {
+							e.preventDefault();
+
+							width = startWidth + (e.screenX - startX);
+							height = startHeight + (e.screenY - startY);
+
+							t.resizeTo(width, height);
+						};
+
+						function endResize(e) {
+							// Stop listening
+							Event.remove(DOM.doc, 'mousemove', mouseMoveHandler1);
+							Event.remove(ed.getDoc(), 'mousemove', mouseMoveHandler2);
+							Event.remove(DOM.doc, 'mouseup', mouseUpHandler1);
+							Event.remove(ed.getDoc(), 'mouseup', mouseUpHandler2);
+
+							width = startWidth + (e.screenX - startX);
+							height = startHeight + (e.screenY - startY);
+							t.resizeTo(width, height, true);
+						};
+
+						e.preventDefault();
+
+						// Get the current rect size
+						startX = e.screenX;
+						startY = e.screenY;
+						ifrElm = DOM.get(t.editor.id + '_ifr');
+						startWidth = width = ifrElm.clientWidth;
+						startHeight = height = ifrElm.clientHeight;
+
+						// Register envent handlers
+						mouseMoveHandler1 = Event.add(DOM.doc, 'mousemove', resizeOnMove);
+						mouseMoveHandler2 = Event.add(ed.getDoc(), 'mousemove', resizeOnMove);
+						mouseUpHandler1 = Event.add(DOM.doc, 'mouseup', endResize);
+						mouseUpHandler2 = Event.add(ed.getDoc(), 'mouseup', endResize);
+					});
+				});
+			}
+
+			o.deltaHeight -= 21;
+			n = tb = null;
+		},
+
+		_updateUndoStatus : function(ed) {
+			var cm = ed.controlManager;
+
+			cm.setDisabled('undo', !ed.undoManager.hasUndo() && !ed.typing);
+			cm.setDisabled('redo', !ed.undoManager.hasRedo());
+		},
+
+		_nodeChanged : function(ed, cm, n, co, ob) {
+			var t = this, p, de = 0, v, c, s = t.settings, cl, fz, fn, fc, bc, formatNames, matches;
+
+			tinymce.each(t.stateControls, function(c) {
+				cm.setActive(c, ed.queryCommandState(t.controls[c][1]));
+			});
+
+			function getParent(name) {
+				var i, parents = ob.parents, func = name;
+
+				if (typeof(name) == 'string') {
+					func = function(node) {
+						return node.nodeName == name;
+					};
+				}
+
+				for (i = 0; i < parents.length; i++) {
+					if (func(parents[i]))
+						return parents[i];
+				}
+			};
+
+			cm.setActive('visualaid', ed.hasVisual);
+			t._updateUndoStatus(ed);
+			cm.setDisabled('outdent', !ed.queryCommandState('Outdent'));
+
+			p = getParent('A');
+			if (c = cm.get('link')) {
+				if (!p || !p.name) {
+					c.setDisabled(!p && co);
+					c.setActive(!!p);
+				}
+			}
+
+			if (c = cm.get('unlink')) {
+				c.setDisabled(!p && co);
+				c.setActive(!!p && !p.name);
+			}
+
+			if (c = cm.get('anchor')) {
+				c.setActive(!co && !!p && p.name);
+			}
+
+			p = getParent('IMG');
+			if (c = cm.get('image'))
+				c.setActive(!co && !!p && n.className.indexOf('mceItem') == -1);
+
+			if (c = cm.get('styleselect')) {
+				t._importClasses();
+
+				formatNames = [];
+				each(c.items, function(item) {
+					formatNames.push(item.value);
+				});
+
+				matches = ed.formatter.matchAll(formatNames);
+				c.select(matches[0]);
+			}
+
+			if (c = cm.get('formatselect')) {
+				p = getParent(DOM.isBlock);
+
+				if (p)
+					c.select(p.nodeName.toLowerCase());
+			}
+
+			// Find out current fontSize, fontFamily and fontClass
+			getParent(function(n) {
+				if (n.nodeName === 'SPAN') {
+					if (!cl && n.className)
+						cl = n.className;
+				}
+
+				if (ed.dom.is(n, s.theme_advanced_font_selector)) {
+					if (!fz && n.style.fontSize)
+						fz = n.style.fontSize;
+
+					if (!fn && n.style.fontFamily)
+						fn = n.style.fontFamily.replace(/[\"\']+/g, '').replace(/^([^,]+).*/, '$1').toLowerCase();
+					
+					if (!fc && n.style.color)
+						fc = n.style.color;
+
+					if (!bc && n.style.backgroundColor)
+						bc = n.style.backgroundColor;
+				}
+
+				return false;
+			});
+
+			if (c = cm.get('fontselect')) {
+				c.select(function(v) {
+					return v.replace(/^([^,]+).*/, '$1').toLowerCase() == fn;
+				});
+			}
+
+			// Select font size
+			if (c = cm.get('fontsizeselect')) {
+				// Use computed style
+				if (s.theme_advanced_runtime_fontsize && !fz && !cl)
+					fz = ed.dom.getStyle(n, 'fontSize', true);
+
+				c.select(function(v) {
+					if (v.fontSize && v.fontSize === fz)
+						return true;
+
+					if (v['class'] && v['class'] === cl)
+						return true;
+				});
+			}
+			
+			if (s.theme_advanced_show_current_color) {
+				function updateColor(controlId, color) {
+					if (c = cm.get(controlId)) {
+						if (!color)
+							color = c.settings.default_color;
+						if (color !== c.value) {
+							c.displayColor(color);
+						}
+					}
+				}
+				updateColor('forecolor', fc);
+				updateColor('backcolor', bc);
+			}
+
+			if (s.theme_advanced_show_current_color) {
+				function updateColor(controlId, color) {
+					if (c = cm.get(controlId)) {
+						if (!color)
+							color = c.settings.default_color;
+						if (color !== c.value) {
+							c.displayColor(color);
+						}
+					}
+				};
+
+				updateColor('forecolor', fc);
+				updateColor('backcolor', bc);
+			}
+
+			if (s.theme_advanced_path && s.theme_advanced_statusbar_location) {
+				p = DOM.get(ed.id + '_path') || DOM.add(ed.id + '_path_row', 'span', {id : ed.id + '_path'});
+
+				if (t.statusKeyboardNavigation) {
+					t.statusKeyboardNavigation.destroy();
+					t.statusKeyboardNavigation = null;
+				}
+
+				DOM.setHTML(p, '');
+
+				getParent(function(n) {
+					var na = n.nodeName.toLowerCase(), u, pi, ti = '';
+
+					if (n.getAttribute('data-mce-bogus'))
+						return;
+
+					// Ignore non element and hidden elements
+					if (n.nodeType != 1 || n.nodeName === 'BR' || (DOM.hasClass(n, 'mceItemHidden') || DOM.hasClass(n, 'mceItemRemoved')))
+						return;
+
+					// Handle prefix
+					if (tinymce.isIE && n.scopeName !== 'HTML')
+						na = n.scopeName + ':' + na;
+
+					// Remove internal prefix
+					na = na.replace(/mce\:/g, '');
+
+					// Handle node name
+					switch (na) {
+						case 'b':
+							na = 'strong';
+							break;
+
+						case 'i':
+							na = 'em';
+							break;
+
+						case 'img':
+							if (v = DOM.getAttrib(n, 'src'))
+								ti += 'src: ' + v + ' ';
+
+							break;
+
+						case 'a':
+							if (v = DOM.getAttrib(n, 'name')) {
+								ti += 'name: ' + v + ' ';
+								na += '#' + v;
+							}
+
+							if (v = DOM.getAttrib(n, 'href'))
+								ti += 'href: ' + v + ' ';
+
+							break;
+
+						case 'font':
+							if (v = DOM.getAttrib(n, 'face'))
+								ti += 'font: ' + v + ' ';
+
+							if (v = DOM.getAttrib(n, 'size'))
+								ti += 'size: ' + v + ' ';
+
+							if (v = DOM.getAttrib(n, 'color'))
+								ti += 'color: ' + v + ' ';
+
+							break;
+
+						case 'span':
+							if (v = DOM.getAttrib(n, 'style'))
+								ti += 'style: ' + v + ' ';
+
+							break;
+					}
+
+					if (v = DOM.getAttrib(n, 'id'))
+						ti += 'id: ' + v + ' ';
+
+					if (v = n.className) {
+						v = v.replace(/\b\s*(webkit|mce|Apple-)\w+\s*\b/g, '')
+
+						if (v) {
+							ti += 'class: ' + v + ' ';
+
+							if (DOM.isBlock(n) || na == 'img' || na == 'span')
+								na += '.' + v;
+						}
+					}
+
+					na = na.replace(/(html:)/g, '');
+					na = {name : na, node : n, title : ti};
+					t.onResolveName.dispatch(t, na);
+					ti = na.title;
+					na = na.name;
+
+					//u = "javascript:tinymce.EditorManager.get('" + ed.id + "').theme._sel('" + (de++) + "');";
+					pi = DOM.create('a', {'href' : "javascript:;", role: 'button', onmousedown : "return false;", title : ti, 'class' : 'mcePath_' + (de++)}, na);
+
+					if (p.hasChildNodes()) {
+						p.insertBefore(DOM.create('span', {'aria-hidden': 'true'}, '\u00a0\u00bb '), p.firstChild);
+						p.insertBefore(pi, p.firstChild);
+					} else
+						p.appendChild(pi);
+				}, ed.getBody());
+
+				if (DOM.select('a', p).length > 0) {
+					t.statusKeyboardNavigation = new tinymce.ui.KeyboardNavigation({
+						root: ed.id + "_path_row",
+						items: DOM.select('a', p),
+						excludeFromTabOrder: true,
+						onCancel: function() {
+							ed.focus();
+						}
+					}, DOM);
+				}
+			}
+		},
+
+		// Commands gets called by execCommand
+
+		_sel : function(v) {
+			this.editor.execCommand('mceSelectNodeDepth', false, v);
+		},
+
+		_mceInsertAnchor : function(ui, v) {
+			var ed = this.editor;
+
+			ed.windowManager.open({
+				url : this.url + '/anchor.htm',
+				width : 320 + parseInt(ed.getLang('advanced.anchor_delta_width', 0)),
+				height : 90 + parseInt(ed.getLang('advanced.anchor_delta_height', 0)),
+				inline : true
+			}, {
+				theme_url : this.url
+			});
+		},
+
+		_mceCharMap : function() {
+			var ed = this.editor;
+
+			ed.windowManager.open({
+				url : this.url + '/charmap.htm',
+				width : 550 + parseInt(ed.getLang('advanced.charmap_delta_width', 0)),
+				height : 250 + parseInt(ed.getLang('advanced.charmap_delta_height', 0)),
+				inline : true
+			}, {
+				theme_url : this.url
+			});
+		},
+
+		_mceHelp : function() {
+			var ed = this.editor;
+
+			ed.windowManager.open({
+				url : this.url + '/about.htm',
+				width : 480,
+				height : 380,
+				inline : true
+			}, {
+				theme_url : this.url
+			});
+		},
+
+		_mceShortcuts : function() {
+			var ed = this.editor;
+			ed.windowManager.open({
+				url: this.url + '/shortcuts.htm',
+				width: 480,
+				height: 380,
+				inline: true
+			}, {
+				theme_url: this.url
+			});
+		},
+
+		_mceColorPicker : function(u, v) {
+			var ed = this.editor;
+
+			v = v || {};
+
+			ed.windowManager.open({
+				url : this.url + '/color_picker.htm',
+				width : 375 + parseInt(ed.getLang('advanced.colorpicker_delta_width', 0)),
+				height : 250 + parseInt(ed.getLang('advanced.colorpicker_delta_height', 0)),
+				close_previous : false,
+				inline : true
+			}, {
+				input_color : v.color,
+				func : v.func,
+				theme_url : this.url
+			});
+		},
+
+		_mceCodeEditor : function(ui, val) {
+			var ed = this.editor;
+
+			ed.windowManager.open({
+				url : this.url + '/source_editor.htm',
+				width : parseInt(ed.getParam("theme_advanced_source_editor_width", 720)),
+				height : parseInt(ed.getParam("theme_advanced_source_editor_height", 580)),
+				inline : true,
+				resizable : true,
+				maximizable : true
+			}, {
+				theme_url : this.url
+			});
+		},
+
+		_mceImage : function(ui, val) {
+			var ed = this.editor;
+
+			// Internal image object like a flash placeholder
+			if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)
+				return;
+
+			ed.windowManager.open({
+				url : this.url + '/image.htm',
+				width : 355 + parseInt(ed.getLang('advanced.image_delta_width', 0)),
+				height : 275 + parseInt(ed.getLang('advanced.image_delta_height', 0)),
+				inline : true
+			}, {
+				theme_url : this.url
+			});
+		},
+
+		_mceLink : function(ui, val) {
+			var ed = this.editor;
+
+			ed.windowManager.open({
+				url : this.url + '/link.htm',
+				width : 310 + parseInt(ed.getLang('advanced.link_delta_width', 0)),
+				height : 200 + parseInt(ed.getLang('advanced.link_delta_height', 0)),
+				inline : true
+			}, {
+				theme_url : this.url
+			});
+		},
+
+		_mceNewDocument : function() {
+			var ed = this.editor;
+
+			ed.windowManager.confirm('advanced.newdocument', function(s) {
+				if (s)
+					ed.execCommand('mceSetContent', false, '');
+			});
+		},
+
+		_mceForeColor : function() {
+			var t = this;
+
+			this._mceColorPicker(0, {
+				color: t.fgColor,
+				func : function(co) {
+					t.fgColor = co;
+					t.editor.execCommand('ForeColor', false, co);
+				}
+			});
+		},
+
+		_mceBackColor : function() {
+			var t = this;
+
+			this._mceColorPicker(0, {
+				color: t.bgColor,
+				func : function(co) {
+					t.bgColor = co;
+					t.editor.execCommand('HiliteColor', false, co);
+				}
+			});
+		},
+
+		_ufirst : function(s) {
+			return s.substring(0, 1).toUpperCase() + s.substring(1);
+		}
+	});
+
+	tinymce.ThemeManager.add('advanced', tinymce.themes.AdvancedTheme);
+}(tinymce));
Index: admin/js/tiny_mce/themes/advanced/image.htm
===================================================================
--- admin/js/tiny_mce/themes/advanced/image.htm	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/image.htm	(revision 307)
@@ -0,0 +1,80 @@
+<!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">
+<head>
+	<title>{#advanced_dlg.image_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="js/image.js"></script>
+</head>
+<body id="image" style="display: none">
+<form onsubmit="ImageDialog.update();return false;" action="#">
+	<div class="tabs">
+		<ul>
+			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.image_title}</a></span></li>
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="general_panel" class="panel current">
+			<table border="0" cellpadding="4" cellspacing="0">
+				<tr>
+					<td class="nowrap"><label for="src">{#advanced_dlg.image_src}</label></td>
+					<td><table border="0" cellspacing="0" cellpadding="0">
+						<tr>
+							<td><input id="src" name="src" type="text" class="mceFocus" value="" style="width: 200px" onchange="ImageDialog.getImageData();" /></td>
+							<td id="srcbrowsercontainer">&nbsp;</td>
+						</tr>
+					</table></td>
+				</tr>
+				<tr>
+					<td><label for="image_list">{#advanced_dlg.image_list}</label></td>
+					<td><select id="image_list" name="image_list" onchange="document.getElementById('src').value=this.options[this.selectedIndex].value;document.getElementById('alt').value=this.options[this.selectedIndex].text;"></select></td>
+				</tr>
+				<tr>
+					<td class="nowrap"><label for="alt">{#advanced_dlg.image_alt}</label></td>
+					<td><input id="alt" name="alt" type="text" value="" style="width: 200px" /></td>
+				</tr>
+				<tr>
+					<td class="nowrap"><label for="align">{#advanced_dlg.image_align}</label></td>
+					<td><select id="align" name="align" onchange="ImageDialog.updateStyle();">
+						<option value="">{#not_set}</option>
+						<option value="baseline">{#advanced_dlg.image_align_baseline}</option>
+						<option value="top">{#advanced_dlg.image_align_top}</option>
+						<option value="middle">{#advanced_dlg.image_align_middle}</option>
+						<option value="bottom">{#advanced_dlg.image_align_bottom}</option>
+						<option value="text-top">{#advanced_dlg.image_align_texttop}</option>
+						<option value="text-bottom">{#advanced_dlg.image_align_textbottom}</option>
+						<option value="left">{#advanced_dlg.image_align_left}</option>
+						<option value="right">{#advanced_dlg.image_align_right}</option>
+					</select></td>
+				</tr>
+				<tr>
+					<td class="nowrap"><label for="width">{#advanced_dlg.image_dimensions}</label></td>
+					<td><input id="width" name="width" type="text" value="" size="3" maxlength="5" />
+					 x 
+					<input id="height" name="height" type="text" value="" size="3" maxlength="5" /></td>
+				</tr>
+				<tr>
+				<td class="nowrap"><label for="border">{#advanced_dlg.image_border}</label></td>
+				<td><input id="border" name="border" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
+				</tr>
+				<tr>
+					<td class="nowrap"><label for="vspace">{#advanced_dlg.image_vspace}</label></td>
+					<td><input id="vspace" name="vspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
+				</tr>
+				<tr>
+					<td class="nowrap"><label for="hspace">{#advanced_dlg.image_hspace}</label></td>
+					<td><input id="hspace" name="hspace" type="text" value="" size="3" maxlength="3" onchange="ImageDialog.updateStyle();" /></td>
+				</tr>
+			</table>
+		</div>
+	</div>
+
+	<div class="mceActionPanel">
+		<input type="submit" id="insert" name="insert" value="{#insert}" />
+		<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+	</div>
+</form>
+</body>
+</html>
Index: admin/js/tiny_mce/themes/advanced/js/about.js
===================================================================
--- admin/js/tiny_mce/themes/advanced/js/about.js	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/js/about.js	(revision 307)
@@ -0,0 +1,73 @@
+tinyMCEPopup.requireLangPack();
+
+function init() {
+	var ed, tcont;
+
+	tinyMCEPopup.resizeToInnerSize();
+	ed = tinyMCEPopup.editor;
+
+	// Give FF some time
+	window.setTimeout(insertHelpIFrame, 10);
+
+	tcont = document.getElementById('plugintablecontainer');
+	document.getElementById('plugins_tab').style.display = 'none';
+
+	var html = "";
+	html += '<table id="plugintable">';
+	html += '<thead>';
+	html += '<tr>';
+	html += '<td>' + ed.getLang('advanced_dlg.about_plugin') + '</td>';
+	html += '<td>' + ed.getLang('advanced_dlg.about_author') + '</td>';
+	html += '<td>' + ed.getLang('advanced_dlg.about_version') + '</td>';
+	html += '</tr>';
+	html += '</thead>';
+	html += '<tbody>';
+
+	tinymce.each(ed.plugins, function(p, n) {
+		var info;
+
+		if (!p.getInfo)
+			return;
+
+		html += '<tr>';
+
+		info = p.getInfo();
+
+		if (info.infourl != null && info.infourl != '')
+			html += '<td width="50%" title="' + n + '"><a href="' + info.infourl + '" target="_blank">' + info.longname + '</a></td>';
+		else
+			html += '<td width="50%" title="' + n + '">' + info.longname + '</td>';
+
+		if (info.authorurl != null && info.authorurl != '')
+			html += '<td width="35%"><a href="' + info.authorurl + '" target="_blank">' + info.author + '</a></td>';
+		else
+			html += '<td width="35%">' + info.author + '</td>';
+
+		html += '<td width="15%">' + info.version + '</td>';
+		html += '</tr>';
+
+		document.getElementById('plugins_tab').style.display = '';
+
+	});
+
+	html += '</tbody>';
+	html += '</table>';
+
+	tcont.innerHTML = html;
+
+	tinyMCEPopup.dom.get('version').innerHTML = tinymce.majorVersion + "." + tinymce.minorVersion;
+	tinyMCEPopup.dom.get('date').innerHTML = tinymce.releaseDate;
+}
+
+function insertHelpIFrame() {
+	var html;
+
+	if (tinyMCEPopup.getParam('docs_url')) {
+		html = '<iframe width="100%" height="300" src="' + tinyMCEPopup.editor.baseURI.toAbsolute(tinyMCEPopup.getParam('docs_url')) + '"></iframe>';
+		document.getElementById('iframecontainer').innerHTML = html;
+		document.getElementById('help_tab').style.display = 'block';
+		document.getElementById('help_tab').setAttribute("aria-hidden", "false");
+	}
+}
+
+tinyMCEPopup.onInit.add(init);
Index: admin/js/tiny_mce/themes/advanced/js/anchor.js
===================================================================
--- admin/js/tiny_mce/themes/advanced/js/anchor.js	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/js/anchor.js	(revision 307)
@@ -0,0 +1,42 @@
+tinyMCEPopup.requireLangPack();
+
+var AnchorDialog = {
+	init : function(ed) {
+		var action, elm, f = document.forms[0];
+
+		this.editor = ed;
+		elm = ed.dom.getParent(ed.selection.getNode(), 'A');
+		v = ed.dom.getAttrib(elm, 'name');
+
+		if (v) {
+			this.action = 'update';
+			f.anchorName.value = v;
+		}
+
+		f.insert.value = ed.getLang(elm ? 'update' : 'insert');
+	},
+
+	update : function() {
+		var ed = this.editor, elm, name = document.forms[0].anchorName.value;
+
+		if (!name || !/^[a-z][a-z0-9\-\_:\.]*$/i.test(name)) {
+			tinyMCEPopup.alert('advanced_dlg.anchor_invalid');
+			return;
+		}
+
+		tinyMCEPopup.restoreSelection();
+
+		if (this.action != 'update')
+			ed.selection.collapse(1);
+
+		elm = ed.dom.getParent(ed.selection.getNode(), 'A');
+		if (elm)
+			elm.name = name;
+		else
+			ed.execCommand('mceInsertContent', 0, ed.dom.createHTML('a', {name : name, 'class' : 'mceItemAnchor'}, ''));
+
+		tinyMCEPopup.close();
+	}
+};
+
+tinyMCEPopup.onInit.add(AnchorDialog.init, AnchorDialog);
Index: admin/js/tiny_mce/themes/advanced/js/charmap.js
===================================================================
--- admin/js/tiny_mce/themes/advanced/js/charmap.js	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/js/charmap.js	(revision 307)
@@ -0,0 +1,355 @@
+/**
+ * charmap.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+tinyMCEPopup.requireLangPack();
+
+var charmap = [
+	['&nbsp;',    '&#160;',  true, 'no-break space'],
+	['&amp;',     '&#38;',   true, 'ampersand'],
+	['&quot;',    '&#34;',   true, 'quotation mark'],
+// finance
+	['&cent;',    '&#162;',  true, 'cent sign'],
+	['&euro;',    '&#8364;', true, 'euro sign'],
+	['&pound;',   '&#163;',  true, 'pound sign'],
+	['&yen;',     '&#165;',  true, 'yen sign'],
+// signs
+	['&copy;',    '&#169;',  true, 'copyright sign'],
+	['&reg;',     '&#174;',  true, 'registered sign'],
+	['&trade;',   '&#8482;', true, 'trade mark sign'],
+	['&permil;',  '&#8240;', true, 'per mille sign'],
+	['&micro;',   '&#181;',  true, 'micro sign'],
+	['&middot;',  '&#183;',  true, 'middle dot'],
+	['&bull;',    '&#8226;', true, 'bullet'],
+	['&hellip;',  '&#8230;', true, 'three dot leader'],
+	['&prime;',   '&#8242;', true, 'minutes / feet'],
+	['&Prime;',   '&#8243;', true, 'seconds / inches'],
+	['&sect;',    '&#167;',  true, 'section sign'],
+	['&para;',    '&#182;',  true, 'paragraph sign'],
+	['&szlig;',   '&#223;',  true, 'sharp s / ess-zed'],
+// quotations
+	['&lsaquo;',  '&#8249;', true, 'single left-pointing angle quotation mark'],
+	['&rsaquo;',  '&#8250;', true, 'single right-pointing angle quotation mark'],
+	['&laquo;',   '&#171;',  true, 'left pointing guillemet'],
+	['&raquo;',   '&#187;',  true, 'right pointing guillemet'],
+	['&lsquo;',   '&#8216;', true, 'left single quotation mark'],
+	['&rsquo;',   '&#8217;', true, 'right single quotation mark'],
+	['&ldquo;',   '&#8220;', true, 'left double quotation mark'],
+	['&rdquo;',   '&#8221;', true, 'right double quotation mark'],
+	['&sbquo;',   '&#8218;', true, 'single low-9 quotation mark'],
+	['&bdquo;',   '&#8222;', true, 'double low-9 quotation mark'],
+	['&lt;',      '&#60;',   true, 'less-than sign'],
+	['&gt;',      '&#62;',   true, 'greater-than sign'],
+	['&le;',      '&#8804;', true, 'less-than or equal to'],
+	['&ge;',      '&#8805;', true, 'greater-than or equal to'],
+	['&ndash;',   '&#8211;', true, 'en dash'],
+	['&mdash;',   '&#8212;', true, 'em dash'],
+	['&macr;',    '&#175;',  true, 'macron'],
+	['&oline;',   '&#8254;', true, 'overline'],
+	['&curren;',  '&#164;',  true, 'currency sign'],
+	['&brvbar;',  '&#166;',  true, 'broken bar'],
+	['&uml;',     '&#168;',  true, 'diaeresis'],
+	['&iexcl;',   '&#161;',  true, 'inverted exclamation mark'],
+	['&iquest;',  '&#191;',  true, 'turned question mark'],
+	['&circ;',    '&#710;',  true, 'circumflex accent'],
+	['&tilde;',   '&#732;',  true, 'small tilde'],
+	['&deg;',     '&#176;',  true, 'degree sign'],
+	['&minus;',   '&#8722;', true, 'minus sign'],
+	['&plusmn;',  '&#177;',  true, 'plus-minus sign'],
+	['&divide;',  '&#247;',  true, 'division sign'],
+	['&frasl;',   '&#8260;', true, 'fraction slash'],
+	['&times;',   '&#215;',  true, 'multiplication sign'],
+	['&sup1;',    '&#185;',  true, 'superscript one'],
+	['&sup2;',    '&#178;',  true, 'superscript two'],
+	['&sup3;',    '&#179;',  true, 'superscript three'],
+	['&frac14;',  '&#188;',  true, 'fraction one quarter'],
+	['&frac12;',  '&#189;',  true, 'fraction one half'],
+	['&frac34;',  '&#190;',  true, 'fraction three quarters'],
+// math / logical
+	['&fnof;',    '&#402;',  true, 'function / florin'],
+	['&int;',     '&#8747;', true, 'integral'],
+	['&sum;',     '&#8721;', true, 'n-ary sumation'],
+	['&infin;',   '&#8734;', true, 'infinity'],
+	['&radic;',   '&#8730;', true, 'square root'],
+	['&sim;',     '&#8764;', false,'similar to'],
+	['&cong;',    '&#8773;', false,'approximately equal to'],
+	['&asymp;',   '&#8776;', true, 'almost equal to'],
+	['&ne;',      '&#8800;', true, 'not equal to'],
+	['&equiv;',   '&#8801;', true, 'identical to'],
+	['&isin;',    '&#8712;', false,'element of'],
+	['&notin;',   '&#8713;', false,'not an element of'],
+	['&ni;',      '&#8715;', false,'contains as member'],
+	['&prod;',    '&#8719;', true, 'n-ary product'],
+	['&and;',     '&#8743;', false,'logical and'],
+	['&or;',      '&#8744;', false,'logical or'],
+	['&not;',     '&#172;',  true, 'not sign'],
+	['&cap;',     '&#8745;', true, 'intersection'],
+	['&cup;',     '&#8746;', false,'union'],
+	['&part;',    '&#8706;', true, 'partial differential'],
+	['&forall;',  '&#8704;', false,'for all'],
+	['&exist;',   '&#8707;', false,'there exists'],
+	['&empty;',   '&#8709;', false,'diameter'],
+	['&nabla;',   '&#8711;', false,'backward difference'],
+	['&lowast;',  '&#8727;', false,'asterisk operator'],
+	['&prop;',    '&#8733;', false,'proportional to'],
+	['&ang;',     '&#8736;', false,'angle'],
+// undefined
+	['&acute;',   '&#180;',  true, 'acute accent'],
+	['&cedil;',   '&#184;',  true, 'cedilla'],
+	['&ordf;',    '&#170;',  true, 'feminine ordinal indicator'],
+	['&ordm;',    '&#186;',  true, 'masculine ordinal indicator'],
+	['&dagger;',  '&#8224;', true, 'dagger'],
+	['&Dagger;',  '&#8225;', true, 'double dagger'],
+// alphabetical special chars
+	['&Agrave;',  '&#192;',  true, 'A - grave'],
+	['&Aacute;',  '&#193;',  true, 'A - acute'],
+	['&Acirc;',   '&#194;',  true, 'A - circumflex'],
+	['&Atilde;',  '&#195;',  true, 'A - tilde'],
+	['&Auml;',    '&#196;',  true, 'A - diaeresis'],
+	['&Aring;',   '&#197;',  true, 'A - ring above'],
+	['&AElig;',   '&#198;',  true, 'ligature AE'],
+	['&Ccedil;',  '&#199;',  true, 'C - cedilla'],
+	['&Egrave;',  '&#200;',  true, 'E - grave'],
+	['&Eacute;',  '&#201;',  true, 'E - acute'],
+	['&Ecirc;',   '&#202;',  true, 'E - circumflex'],
+	['&Euml;',    '&#203;',  true, 'E - diaeresis'],
+	['&Igrave;',  '&#204;',  true, 'I - grave'],
+	['&Iacute;',  '&#205;',  true, 'I - acute'],
+	['&Icirc;',   '&#206;',  true, 'I - circumflex'],
+	['&Iuml;',    '&#207;',  true, 'I - diaeresis'],
+	['&ETH;',     '&#208;',  true, 'ETH'],
+	['&Ntilde;',  '&#209;',  true, 'N - tilde'],
+	['&Ograve;',  '&#210;',  true, 'O - grave'],
+	['&Oacute;',  '&#211;',  true, 'O - acute'],
+	['&Ocirc;',   '&#212;',  true, 'O - circumflex'],
+	['&Otilde;',  '&#213;',  true, 'O - tilde'],
+	['&Ouml;',    '&#214;',  true, 'O - diaeresis'],
+	['&Oslash;',  '&#216;',  true, 'O - slash'],
+	['&OElig;',   '&#338;',  true, 'ligature OE'],
+	['&Scaron;',  '&#352;',  true, 'S - caron'],
+	['&Ugrave;',  '&#217;',  true, 'U - grave'],
+	['&Uacute;',  '&#218;',  true, 'U - acute'],
+	['&Ucirc;',   '&#219;',  true, 'U - circumflex'],
+	['&Uuml;',    '&#220;',  true, 'U - diaeresis'],
+	['&Yacute;',  '&#221;',  true, 'Y - acute'],
+	['&Yuml;',    '&#376;',  true, 'Y - diaeresis'],
+	['&THORN;',   '&#222;',  true, 'THORN'],
+	['&agrave;',  '&#224;',  true, 'a - grave'],
+	['&aacute;',  '&#225;',  true, 'a - acute'],
+	['&acirc;',   '&#226;',  true, 'a - circumflex'],
+	['&atilde;',  '&#227;',  true, 'a - tilde'],
+	['&auml;',    '&#228;',  true, 'a - diaeresis'],
+	['&aring;',   '&#229;',  true, 'a - ring above'],
+	['&aelig;',   '&#230;',  true, 'ligature ae'],
+	['&ccedil;',  '&#231;',  true, 'c - cedilla'],
+	['&egrave;',  '&#232;',  true, 'e - grave'],
+	['&eacute;',  '&#233;',  true, 'e - acute'],
+	['&ecirc;',   '&#234;',  true, 'e - circumflex'],
+	['&euml;',    '&#235;',  true, 'e - diaeresis'],
+	['&igrave;',  '&#236;',  true, 'i - grave'],
+	['&iacute;',  '&#237;',  true, 'i - acute'],
+	['&icirc;',   '&#238;',  true, 'i - circumflex'],
+	['&iuml;',    '&#239;',  true, 'i - diaeresis'],
+	['&eth;',     '&#240;',  true, 'eth'],
+	['&ntilde;',  '&#241;',  true, 'n - tilde'],
+	['&ograve;',  '&#242;',  true, 'o - grave'],
+	['&oacute;',  '&#243;',  true, 'o - acute'],
+	['&ocirc;',   '&#244;',  true, 'o - circumflex'],
+	['&otilde;',  '&#245;',  true, 'o - tilde'],
+	['&ouml;',    '&#246;',  true, 'o - diaeresis'],
+	['&oslash;',  '&#248;',  true, 'o slash'],
+	['&oelig;',   '&#339;',  true, 'ligature oe'],
+	['&scaron;',  '&#353;',  true, 's - caron'],
+	['&ugrave;',  '&#249;',  true, 'u - grave'],
+	['&uacute;',  '&#250;',  true, 'u - acute'],
+	['&ucirc;',   '&#251;',  true, 'u - circumflex'],
+	['&uuml;',    '&#252;',  true, 'u - diaeresis'],
+	['&yacute;',  '&#253;',  true, 'y - acute'],
+	['&thorn;',   '&#254;',  true, 'thorn'],
+	['&yuml;',    '&#255;',  true, 'y - diaeresis'],
+	['&Alpha;',   '&#913;',  true, 'Alpha'],
+	['&Beta;',    '&#914;',  true, 'Beta'],
+	['&Gamma;',   '&#915;',  true, 'Gamma'],
+	['&Delta;',   '&#916;',  true, 'Delta'],
+	['&Epsilon;', '&#917;',  true, 'Epsilon'],
+	['&Zeta;',    '&#918;',  true, 'Zeta'],
+	['&Eta;',     '&#919;',  true, 'Eta'],
+	['&Theta;',   '&#920;',  true, 'Theta'],
+	['&Iota;',    '&#921;',  true, 'Iota'],
+	['&Kappa;',   '&#922;',  true, 'Kappa'],
+	['&Lambda;',  '&#923;',  true, 'Lambda'],
+	['&Mu;',      '&#924;',  true, 'Mu'],
+	['&Nu;',      '&#925;',  true, 'Nu'],
+	['&Xi;',      '&#926;',  true, 'Xi'],
+	['&Omicron;', '&#927;',  true, 'Omicron'],
+	['&Pi;',      '&#928;',  true, 'Pi'],
+	['&Rho;',     '&#929;',  true, 'Rho'],
+	['&Sigma;',   '&#931;',  true, 'Sigma'],
+	['&Tau;',     '&#932;',  true, 'Tau'],
+	['&Upsilon;', '&#933;',  true, 'Upsilon'],
+	['&Phi;',     '&#934;',  true, 'Phi'],
+	['&Chi;',     '&#935;',  true, 'Chi'],
+	['&Psi;',     '&#936;',  true, 'Psi'],
+	['&Omega;',   '&#937;',  true, 'Omega'],
+	['&alpha;',   '&#945;',  true, 'alpha'],
+	['&beta;',    '&#946;',  true, 'beta'],
+	['&gamma;',   '&#947;',  true, 'gamma'],
+	['&delta;',   '&#948;',  true, 'delta'],
+	['&epsilon;', '&#949;',  true, 'epsilon'],
+	['&zeta;',    '&#950;',  true, 'zeta'],
+	['&eta;',     '&#951;',  true, 'eta'],
+	['&theta;',   '&#952;',  true, 'theta'],
+	['&iota;',    '&#953;',  true, 'iota'],
+	['&kappa;',   '&#954;',  true, 'kappa'],
+	['&lambda;',  '&#955;',  true, 'lambda'],
+	['&mu;',      '&#956;',  true, 'mu'],
+	['&nu;',      '&#957;',  true, 'nu'],
+	['&xi;',      '&#958;',  true, 'xi'],
+	['&omicron;', '&#959;',  true, 'omicron'],
+	['&pi;',      '&#960;',  true, 'pi'],
+	['&rho;',     '&#961;',  true, 'rho'],
+	['&sigmaf;',  '&#962;',  true, 'final sigma'],
+	['&sigma;',   '&#963;',  true, 'sigma'],
+	['&tau;',     '&#964;',  true, 'tau'],
+	['&upsilon;', '&#965;',  true, 'upsilon'],
+	['&phi;',     '&#966;',  true, 'phi'],
+	['&chi;',     '&#967;',  true, 'chi'],
+	['&psi;',     '&#968;',  true, 'psi'],
+	['&omega;',   '&#969;',  true, 'omega'],
+// symbols
+	['&alefsym;', '&#8501;', false,'alef symbol'],
+	['&piv;',     '&#982;',  false,'pi symbol'],
+	['&real;',    '&#8476;', false,'real part symbol'],
+	['&thetasym;','&#977;',  false,'theta symbol'],
+	['&upsih;',   '&#978;',  false,'upsilon - hook symbol'],
+	['&weierp;',  '&#8472;', false,'Weierstrass p'],
+	['&image;',   '&#8465;', false,'imaginary part'],
+// arrows
+	['&larr;',    '&#8592;', true, 'leftwards arrow'],
+	['&uarr;',    '&#8593;', true, 'upwards arrow'],
+	['&rarr;',    '&#8594;', true, 'rightwards arrow'],
+	['&darr;',    '&#8595;', true, 'downwards arrow'],
+	['&harr;',    '&#8596;', true, 'left right arrow'],
+	['&crarr;',   '&#8629;', false,'carriage return'],
+	['&lArr;',    '&#8656;', false,'leftwards double arrow'],
+	['&uArr;',    '&#8657;', false,'upwards double arrow'],
+	['&rArr;',    '&#8658;', false,'rightwards double arrow'],
+	['&dArr;',    '&#8659;', false,'downwards double arrow'],
+	['&hArr;',    '&#8660;', false,'left right double arrow'],
+	['&there4;',  '&#8756;', false,'therefore'],
+	['&sub;',     '&#8834;', false,'subset of'],
+	['&sup;',     '&#8835;', false,'superset of'],
+	['&nsub;',    '&#8836;', false,'not a subset of'],
+	['&sube;',    '&#8838;', false,'subset of or equal to'],
+	['&supe;',    '&#8839;', false,'superset of or equal to'],
+	['&oplus;',   '&#8853;', false,'circled plus'],
+	['&otimes;',  '&#8855;', false,'circled times'],
+	['&perp;',    '&#8869;', false,'perpendicular'],
+	['&sdot;',    '&#8901;', false,'dot operator'],
+	['&lceil;',   '&#8968;', false,'left ceiling'],
+	['&rceil;',   '&#8969;', false,'right ceiling'],
+	['&lfloor;',  '&#8970;', false,'left floor'],
+	['&rfloor;',  '&#8971;', false,'right floor'],
+	['&lang;',    '&#9001;', false,'left-pointing angle bracket'],
+	['&rang;',    '&#9002;', false,'right-pointing angle bracket'],
+	['&loz;',     '&#9674;', true, 'lozenge'],
+	['&spades;',  '&#9824;', true, 'black spade suit'],
+	['&clubs;',   '&#9827;', true, 'black club suit'],
+	['&hearts;',  '&#9829;', true, 'black heart suit'],
+	['&diams;',   '&#9830;', true, 'black diamond suit'],
+	['&ensp;',    '&#8194;', false,'en space'],
+	['&emsp;',    '&#8195;', false,'em space'],
+	['&thinsp;',  '&#8201;', false,'thin space'],
+	['&zwnj;',    '&#8204;', false,'zero width non-joiner'],
+	['&zwj;',     '&#8205;', false,'zero width joiner'],
+	['&lrm;',     '&#8206;', false,'left-to-right mark'],
+	['&rlm;',     '&#8207;', false,'right-to-left mark'],
+	['&shy;',     '&#173;',  false,'soft hyphen']
+];
+
+tinyMCEPopup.onInit.add(function() {
+	tinyMCEPopup.dom.setHTML('charmapView', renderCharMapHTML());
+	addKeyboardNavigation();
+});
+
+function addKeyboardNavigation(){
+	var tableElm, cells, settings;
+
+	cells = tinyMCEPopup.dom.select(".charmaplink", "charmapgroup");
+
+	settings ={
+		root: "charmapgroup",
+		items: cells
+	};
+
+	tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', settings, tinyMCEPopup.dom);
+}
+
+function renderCharMapHTML() {
+	var charsPerRow = 20, tdWidth=20, tdHeight=20, i;
+	var html = '<div id="charmapgroup" aria-labelledby="charmap_label" tabindex="0" role="listbox">'+
+	'<table role="presentation" border="0" cellspacing="1" cellpadding="0" width="' + (tdWidth*charsPerRow) + 
+	'"><tr height="' + tdHeight + '">';
+	var cols=-1;
+
+	for (i=0; i<charmap.length; i++) {
+		var previewCharFn;
+
+		if (charmap[i][2]==true) {
+			cols++;
+			previewCharFn = 'previewChar(\'' + charmap[i][1].substring(1,charmap[i][1].length) + '\',\'' + charmap[i][0].substring(1,charmap[i][0].length) + '\',\'' + charmap[i][3] + '\');';
+			html += ''
+				+ '<td class="charmap">'
+				+ '<a class="charmaplink" role="button" onmouseover="'+previewCharFn+'" onfocus="'+previewCharFn+'" href="javascript:void(0)" onclick="insertChar(\'' + charmap[i][1].substring(2,charmap[i][1].length-1) + '\');" onclick="return false;" onmousedown="return false;" title="' + charmap[i][3] + '">'
+				+ charmap[i][1]
+				+ '</a></td>';
+			if ((cols+1) % charsPerRow == 0)
+				html += '</tr><tr height="' + tdHeight + '">';
+		}
+	 }
+
+	if (cols % charsPerRow > 0) {
+		var padd = charsPerRow - (cols % charsPerRow);
+		for (var i=0; i<padd-1; i++)
+			html += '<td width="' + tdWidth + '" height="' + tdHeight + '" class="charmap">&nbsp;</td>';
+	}
+
+	html += '</tr></table></div>';
+	html = html.replace(/<tr height="20"><\/tr>/g, '');
+
+	return html;
+}
+
+function insertChar(chr) {
+	tinyMCEPopup.execCommand('mceInsertContent', false, '&#' + chr + ';');
+
+	// Refocus in window
+	if (tinyMCEPopup.isWindow)
+		window.focus();
+
+	tinyMCEPopup.editor.focus();
+	tinyMCEPopup.close();
+}
+
+function previewChar(codeA, codeB, codeN) {
+	var elmA = document.getElementById('codeA');
+	var elmB = document.getElementById('codeB');
+	var elmV = document.getElementById('codeV');
+	var elmN = document.getElementById('codeN');
+
+	if (codeA=='#160;') {
+		elmV.innerHTML = '__';
+	} else {
+		elmV.innerHTML = '&' + codeA;
+	}
+
+	elmB.innerHTML = '&amp;' + codeA;
+	elmA.innerHTML = '&amp;' + codeB;
+	elmN.innerHTML = codeN;
+}
Index: admin/js/tiny_mce/themes/advanced/js/color_picker.js
===================================================================
--- admin/js/tiny_mce/themes/advanced/js/color_picker.js	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/js/color_picker.js	(revision 307)
@@ -0,0 +1,329 @@
+tinyMCEPopup.requireLangPack();
+
+var detail = 50, strhex = "0123456789ABCDEF", i, isMouseDown = false, isMouseOver = false;
+
+var colors = [
+	"#000000","#000033","#000066","#000099","#0000cc","#0000ff","#330000","#330033",
+	"#330066","#330099","#3300cc","#3300ff","#660000","#660033","#660066","#660099",
+	"#6600cc","#6600ff","#990000","#990033","#990066","#990099","#9900cc","#9900ff",
+	"#cc0000","#cc0033","#cc0066","#cc0099","#cc00cc","#cc00ff","#ff0000","#ff0033",
+	"#ff0066","#ff0099","#ff00cc","#ff00ff","#003300","#003333","#003366","#003399",
+	"#0033cc","#0033ff","#333300","#333333","#333366","#333399","#3333cc","#3333ff",
+	"#663300","#663333","#663366","#663399","#6633cc","#6633ff","#993300","#993333",
+	"#993366","#993399","#9933cc","#9933ff","#cc3300","#cc3333","#cc3366","#cc3399",
+	"#cc33cc","#cc33ff","#ff3300","#ff3333","#ff3366","#ff3399","#ff33cc","#ff33ff",
+	"#006600","#006633","#006666","#006699","#0066cc","#0066ff","#336600","#336633",
+	"#336666","#336699","#3366cc","#3366ff","#666600","#666633","#666666","#666699",
+	"#6666cc","#6666ff","#996600","#996633","#996666","#996699","#9966cc","#9966ff",
+	"#cc6600","#cc6633","#cc6666","#cc6699","#cc66cc","#cc66ff","#ff6600","#ff6633",
+	"#ff6666","#ff6699","#ff66cc","#ff66ff","#009900","#009933","#009966","#009999",
+	"#0099cc","#0099ff","#339900","#339933","#339966","#339999","#3399cc","#3399ff",
+	"#669900","#669933","#669966","#669999","#6699cc","#6699ff","#999900","#999933",
+	"#999966","#999999","#9999cc","#9999ff","#cc9900","#cc9933","#cc9966","#cc9999",
+	"#cc99cc","#cc99ff","#ff9900","#ff9933","#ff9966","#ff9999","#ff99cc","#ff99ff",
+	"#00cc00","#00cc33","#00cc66","#00cc99","#00cccc","#00ccff","#33cc00","#33cc33",
+	"#33cc66","#33cc99","#33cccc","#33ccff","#66cc00","#66cc33","#66cc66","#66cc99",
+	"#66cccc","#66ccff","#99cc00","#99cc33","#99cc66","#99cc99","#99cccc","#99ccff",
+	"#cccc00","#cccc33","#cccc66","#cccc99","#cccccc","#ccccff","#ffcc00","#ffcc33",
+	"#ffcc66","#ffcc99","#ffcccc","#ffccff","#00ff00","#00ff33","#00ff66","#00ff99",
+	"#00ffcc","#00ffff","#33ff00","#33ff33","#33ff66","#33ff99","#33ffcc","#33ffff",
+	"#66ff00","#66ff33","#66ff66","#66ff99","#66ffcc","#66ffff","#99ff00","#99ff33",
+	"#99ff66","#99ff99","#99ffcc","#99ffff","#ccff00","#ccff33","#ccff66","#ccff99",
+	"#ccffcc","#ccffff","#ffff00","#ffff33","#ffff66","#ffff99","#ffffcc","#ffffff"
+];
+
+var named = {
+	'#F0F8FF':'Alice Blue','#FAEBD7':'Antique White','#00FFFF':'Aqua','#7FFFD4':'Aquamarine','#F0FFFF':'Azure','#F5F5DC':'Beige',
+	'#FFE4C4':'Bisque','#000000':'Black','#FFEBCD':'Blanched Almond','#0000FF':'Blue','#8A2BE2':'Blue Violet','#A52A2A':'Brown',
+	'#DEB887':'Burly Wood','#5F9EA0':'Cadet Blue','#7FFF00':'Chartreuse','#D2691E':'Chocolate','#FF7F50':'Coral','#6495ED':'Cornflower Blue',
+	'#FFF8DC':'Cornsilk','#DC143C':'Crimson','#00FFFF':'Cyan','#00008B':'Dark Blue','#008B8B':'Dark Cyan','#B8860B':'Dark Golden Rod',
+	'#A9A9A9':'Dark Gray','#A9A9A9':'Dark Grey','#006400':'Dark Green','#BDB76B':'Dark Khaki','#8B008B':'Dark Magenta','#556B2F':'Dark Olive Green',
+	'#FF8C00':'Darkorange','#9932CC':'Dark Orchid','#8B0000':'Dark Red','#E9967A':'Dark Salmon','#8FBC8F':'Dark Sea Green','#483D8B':'Dark Slate Blue',
+	'#2F4F4F':'Dark Slate Gray','#2F4F4F':'Dark Slate Grey','#00CED1':'Dark Turquoise','#9400D3':'Dark Violet','#FF1493':'Deep Pink','#00BFFF':'Deep Sky Blue',
+	'#696969':'Dim Gray','#696969':'Dim Grey','#1E90FF':'Dodger Blue','#B22222':'Fire Brick','#FFFAF0':'Floral White','#228B22':'Forest Green',
+	'#FF00FF':'Fuchsia','#DCDCDC':'Gainsboro','#F8F8FF':'Ghost White','#FFD700':'Gold','#DAA520':'Golden Rod','#808080':'Gray','#808080':'Grey',
+	'#008000':'Green','#ADFF2F':'Green Yellow','#F0FFF0':'Honey Dew','#FF69B4':'Hot Pink','#CD5C5C':'Indian Red','#4B0082':'Indigo','#FFFFF0':'Ivory',
+	'#F0E68C':'Khaki','#E6E6FA':'Lavender','#FFF0F5':'Lavender Blush','#7CFC00':'Lawn Green','#FFFACD':'Lemon Chiffon','#ADD8E6':'Light Blue',
+	'#F08080':'Light Coral','#E0FFFF':'Light Cyan','#FAFAD2':'Light Golden Rod Yellow','#D3D3D3':'Light Gray','#D3D3D3':'Light Grey','#90EE90':'Light Green',
+	'#FFB6C1':'Light Pink','#FFA07A':'Light Salmon','#20B2AA':'Light Sea Green','#87CEFA':'Light Sky Blue','#778899':'Light Slate Gray','#778899':'Light Slate Grey',
+	'#B0C4DE':'Light Steel Blue','#FFFFE0':'Light Yellow','#00FF00':'Lime','#32CD32':'Lime Green','#FAF0E6':'Linen','#FF00FF':'Magenta','#800000':'Maroon',
+	'#66CDAA':'Medium Aqua Marine','#0000CD':'Medium Blue','#BA55D3':'Medium Orchid','#9370D8':'Medium Purple','#3CB371':'Medium Sea Green','#7B68EE':'Medium Slate Blue',
+	'#00FA9A':'Medium Spring Green','#48D1CC':'Medium Turquoise','#C71585':'Medium Violet Red','#191970':'Midnight Blue','#F5FFFA':'Mint Cream','#FFE4E1':'Misty Rose','#FFE4B5':'Moccasin',
+	'#FFDEAD':'Navajo White','#000080':'Navy','#FDF5E6':'Old Lace','#808000':'Olive','#6B8E23':'Olive Drab','#FFA500':'Orange','#FF4500':'Orange Red','#DA70D6':'Orchid',
+	'#EEE8AA':'Pale Golden Rod','#98FB98':'Pale Green','#AFEEEE':'Pale Turquoise','#D87093':'Pale Violet Red','#FFEFD5':'Papaya Whip','#FFDAB9':'Peach Puff',
+	'#CD853F':'Peru','#FFC0CB':'Pink','#DDA0DD':'Plum','#B0E0E6':'Powder Blue','#800080':'Purple','#FF0000':'Red','#BC8F8F':'Rosy Brown','#4169E1':'Royal Blue',
+	'#8B4513':'Saddle Brown','#FA8072':'Salmon','#F4A460':'Sandy Brown','#2E8B57':'Sea Green','#FFF5EE':'Sea Shell','#A0522D':'Sienna','#C0C0C0':'Silver',
+	'#87CEEB':'Sky Blue','#6A5ACD':'Slate Blue','#708090':'Slate Gray','#708090':'Slate Grey','#FFFAFA':'Snow','#00FF7F':'Spring Green',
+	'#4682B4':'Steel Blue','#D2B48C':'Tan','#008080':'Teal','#D8BFD8':'Thistle','#FF6347':'Tomato','#40E0D0':'Turquoise','#EE82EE':'Violet',
+	'#F5DEB3':'Wheat','#FFFFFF':'White','#F5F5F5':'White Smoke','#FFFF00':'Yellow','#9ACD32':'Yellow Green'
+};
+
+var namedLookup = {};
+
+function init() {
+	var inputColor = convertRGBToHex(tinyMCEPopup.getWindowArg('input_color')), key, value;
+
+	tinyMCEPopup.resizeToInnerSize();
+
+	generatePicker();
+	generateWebColors();
+	generateNamedColors();
+
+	if (inputColor) {
+		changeFinalColor(inputColor);
+
+		col = convertHexToRGB(inputColor);
+
+		if (col)
+			updateLight(col.r, col.g, col.b);
+	}
+	
+	for (key in named) {
+		value = named[key];
+		namedLookup[value.replace(/\s+/, '').toLowerCase()] = key.replace(/#/, '').toLowerCase();
+	}
+}
+
+function toHexColor(color) {
+	var matches, red, green, blue, toInt = parseInt;
+
+	function hex(value) {
+		value = parseInt(value).toString(16);
+
+		return value.length > 1 ? value : '0' + value; // Padd with leading zero
+	};
+
+	color = color.replace(/[\s#]+/g, '').toLowerCase();
+	color = namedLookup[color] || color;
+	matches = /^rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})|([a-f0-9])([a-f0-9])([a-f0-9])$/.exec(color);
+
+	if (matches) {
+		if (matches[1]) {
+			red = toInt(matches[1]);
+			green = toInt(matches[2]);
+			blue = toInt(matches[3]);
+		} else if (matches[4]) {
+			red = toInt(matches[4], 16);
+			green = toInt(matches[5], 16);
+			blue = toInt(matches[6], 16);
+		} else if (matches[7]) {
+			red = toInt(matches[7] + matches[7], 16);
+			green = toInt(matches[8] + matches[8], 16);
+			blue = toInt(matches[9] + matches[9], 16);
+		}
+
+		return '#' + hex(red) + hex(green) + hex(blue);
+	}
+
+	return '';
+}
+
+function insertAction() {
+	var color = document.getElementById("color").value, f = tinyMCEPopup.getWindowArg('func');
+
+	tinyMCEPopup.restoreSelection();
+
+	if (f)
+		f(toHexColor(color));
+
+	tinyMCEPopup.close();
+}
+
+function showColor(color, name) {
+	if (name)
+		document.getElementById("colorname").innerHTML = name;
+
+	document.getElementById("preview").style.backgroundColor = color;
+	document.getElementById("color").value = color.toUpperCase();
+}
+
+function convertRGBToHex(col) {
+	var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
+
+	if (!col)
+		return col;
+
+	var rgb = col.replace(re, "$1,$2,$3").split(',');
+	if (rgb.length == 3) {
+		r = parseInt(rgb[0]).toString(16);
+		g = parseInt(rgb[1]).toString(16);
+		b = parseInt(rgb[2]).toString(16);
+
+		r = r.length == 1 ? '0' + r : r;
+		g = g.length == 1 ? '0' + g : g;
+		b = b.length == 1 ? '0' + b : b;
+
+		return "#" + r + g + b;
+	}
+
+	return col;
+}
+
+function convertHexToRGB(col) {
+	if (col.indexOf('#') != -1) {
+		col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
+
+		r = parseInt(col.substring(0, 2), 16);
+		g = parseInt(col.substring(2, 4), 16);
+		b = parseInt(col.substring(4, 6), 16);
+
+		return {r : r, g : g, b : b};
+	}
+
+	return null;
+}
+
+function generatePicker() {
+	var el = document.getElementById('light'), h = '', i;
+
+	for (i = 0; i < detail; i++){
+		h += '<div id="gs'+i+'" style="background-color:#000000; width:15px; height:3px; border-style:none; border-width:0px;"'
+		+ ' onclick="changeFinalColor(this.style.backgroundColor)"'
+		+ ' onmousedown="isMouseDown = true; return false;"'
+		+ ' onmouseup="isMouseDown = false;"'
+		+ ' onmousemove="if (isMouseDown && isMouseOver) changeFinalColor(this.style.backgroundColor); return false;"'
+		+ ' onmouseover="isMouseOver = true;"'
+		+ ' onmouseout="isMouseOver = false;"'
+		+ '></div>';
+	}
+
+	el.innerHTML = h;
+}
+
+function generateWebColors() {
+	var el = document.getElementById('webcolors'), h = '', i;
+
+	if (el.className == 'generated')
+		return;
+
+	// TODO: VoiceOver doesn't seem to support legend as a label referenced by labelledby.
+	h += '<div role="listbox" aria-labelledby="webcolors_title" tabindex="0"><table role="presentation" border="0" cellspacing="1" cellpadding="0">'
+		+ '<tr>';
+
+	for (i=0; i<colors.length; i++) {
+		h += '<td bgcolor="' + colors[i] + '" width="10" height="10">'
+			+ '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="web_colors_' + i + '" onfocus="showColor(\'' + colors[i] + '\');" onmouseover="showColor(\'' + colors[i] + '\');" style="display:block;width:10px;height:10px;overflow:hidden;">';
+		if (tinyMCEPopup.editor.forcedHighContrastMode) {
+			h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
+		}
+		h += '<span class="mceVoiceLabel" style="display:none;" id="web_colors_' + i + '">' + colors[i].toUpperCase() + '</span>';
+		h += '</a></td>';
+		if ((i+1) % 18 == 0)
+			h += '</tr><tr>';
+	}
+
+	h += '</table></div>';
+
+	el.innerHTML = h;
+	el.className = 'generated';
+
+	paintCanvas(el);
+	enableKeyboardNavigation(el.firstChild);
+}
+
+function paintCanvas(el) {
+	tinyMCEPopup.getWin().tinymce.each(tinyMCEPopup.dom.select('canvas.mceColorSwatch', el), function(canvas) {
+		var context;
+		if (canvas.getContext && (context = canvas.getContext("2d"))) {
+			context.fillStyle = canvas.getAttribute('data-color');
+			context.fillRect(0, 0, 10, 10);
+		}
+	});
+}
+function generateNamedColors() {
+	var el = document.getElementById('namedcolors'), h = '', n, v, i = 0;
+
+	if (el.className == 'generated')
+		return;
+
+	for (n in named) {
+		v = named[n];
+		h += '<a href="javascript:insertAction();" role="option" tabindex="-1" aria-labelledby="named_colors_' + i + '" onfocus="showColor(\'' + n + '\',\'' + v + '\');" onmouseover="showColor(\'' + n + '\',\'' + v + '\');" style="background-color: ' + n + '">';
+		if (tinyMCEPopup.editor.forcedHighContrastMode) {
+			h += '<canvas class="mceColorSwatch" height="10" width="10" data-color="' + colors[i] + '"></canvas>';
+		}
+		h += '<span class="mceVoiceLabel" style="display:none;" id="named_colors_' + i + '">' + v + '</span>';
+		h += '</a>';
+		i++;
+	}
+
+	el.innerHTML = h;
+	el.className = 'generated';
+
+	paintCanvas(el);
+	enableKeyboardNavigation(el);
+}
+
+function enableKeyboardNavigation(el) {
+	tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
+		root: el,
+		items: tinyMCEPopup.dom.select('a', el)
+	}, tinyMCEPopup.dom);
+}
+
+function dechex(n) {
+	return strhex.charAt(Math.floor(n / 16)) + strhex.charAt(n % 16);
+}
+
+function computeColor(e) {
+	var x, y, partWidth, partDetail, imHeight, r, g, b, coef, i, finalCoef, finalR, finalG, finalB;
+
+	x = e.offsetX ? e.offsetX : (e.target ? e.clientX - e.target.x : 0);
+	y = e.offsetY ? e.offsetY : (e.target ? e.clientY - e.target.y : 0);
+
+	partWidth = document.getElementById('colors').width / 6;
+	partDetail = detail / 2;
+	imHeight = document.getElementById('colors').height;
+
+	r = (x >= 0)*(x < partWidth)*255 + (x >= partWidth)*(x < 2*partWidth)*(2*255 - x * 255 / partWidth) + (x >= 4*partWidth)*(x < 5*partWidth)*(-4*255 + x * 255 / partWidth) + (x >= 5*partWidth)*(x < 6*partWidth)*255;
+	g = (x >= 0)*(x < partWidth)*(x * 255 / partWidth) + (x >= partWidth)*(x < 3*partWidth)*255	+ (x >= 3*partWidth)*(x < 4*partWidth)*(4*255 - x * 255 / partWidth);
+	b = (x >= 2*partWidth)*(x < 3*partWidth)*(-2*255 + x * 255 / partWidth) + (x >= 3*partWidth)*(x < 5*partWidth)*255 + (x >= 5*partWidth)*(x < 6*partWidth)*(6*255 - x * 255 / partWidth);
+
+	coef = (imHeight - y) / imHeight;
+	r = 128 + (r - 128) * coef;
+	g = 128 + (g - 128) * coef;
+	b = 128 + (b - 128) * coef;
+
+	changeFinalColor('#' + dechex(r) + dechex(g) + dechex(b));
+	updateLight(r, g, b);
+}
+
+function updateLight(r, g, b) {
+	var i, partDetail = detail / 2, finalCoef, finalR, finalG, finalB, color;
+
+	for (i=0; i<detail; i++) {
+		if ((i>=0) && (i<partDetail)) {
+			finalCoef = i / partDetail;
+			finalR = dechex(255 - (255 - r) * finalCoef);
+			finalG = dechex(255 - (255 - g) * finalCoef);
+			finalB = dechex(255 - (255 - b) * finalCoef);
+		} else {
+			finalCoef = 2 - i / partDetail;
+			finalR = dechex(r * finalCoef);
+			finalG = dechex(g * finalCoef);
+			finalB = dechex(b * finalCoef);
+		}
+
+		color = finalR + finalG + finalB;
+
+		setCol('gs' + i, '#'+color);
+	}
+}
+
+function changeFinalColor(color) {
+	if (color.indexOf('#') == -1)
+		color = convertRGBToHex(color);
+
+	setCol('preview', color);
+	document.getElementById('color').value = color;
+}
+
+function setCol(e, c) {
+	try {
+		document.getElementById(e).style.backgroundColor = c;
+	} catch (ex) {
+		// Ignore IE warning
+	}
+}
+
+tinyMCEPopup.onInit.add(init);
Index: admin/js/tiny_mce/themes/advanced/js/image.js
===================================================================
--- admin/js/tiny_mce/themes/advanced/js/image.js	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/js/image.js	(revision 307)
@@ -0,0 +1,247 @@
+var ImageDialog = {
+	preInit : function() {
+		var url;
+
+		tinyMCEPopup.requireLangPack();
+
+		if (url = tinyMCEPopup.getParam("external_image_list_url"))
+			document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
+	},
+
+	init : function() {
+		var f = document.forms[0], ed = tinyMCEPopup.editor;
+
+		// Setup browse button
+		document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
+		if (isVisible('srcbrowser'))
+			document.getElementById('src').style.width = '180px';
+
+		e = ed.selection.getNode();
+
+		this.fillFileList('image_list', 'tinyMCEImageList');
+
+		if (e.nodeName == 'IMG') {
+			f.src.value = ed.dom.getAttrib(e, 'src');
+			f.alt.value = ed.dom.getAttrib(e, 'alt');
+			f.border.value = this.getAttrib(e, 'border');
+			f.vspace.value = this.getAttrib(e, 'vspace');
+			f.hspace.value = this.getAttrib(e, 'hspace');
+			f.width.value = ed.dom.getAttrib(e, 'width');
+			f.height.value = ed.dom.getAttrib(e, 'height');
+			f.insert.value = ed.getLang('update');
+			this.styleVal = ed.dom.getAttrib(e, 'style');
+			selectByValue(f, 'image_list', f.src.value);
+			selectByValue(f, 'align', this.getAttrib(e, 'align'));
+			this.updateStyle();
+		}
+	},
+
+	fillFileList : function(id, l) {
+		var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
+
+		l = window[l];
+
+		if (l && l.length > 0) {
+			lst.options[lst.options.length] = new Option('', '');
+
+			tinymce.each(l, function(o) {
+				lst.options[lst.options.length] = new Option(o[0], o[1]);
+			});
+		} else
+			dom.remove(dom.getParent(id, 'tr'));
+	},
+
+	update : function() {
+		var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, args = {}, el;
+
+		tinyMCEPopup.restoreSelection();
+
+		if (f.src.value === '') {
+			if (ed.selection.getNode().nodeName == 'IMG') {
+				ed.dom.remove(ed.selection.getNode());
+				ed.execCommand('mceRepaint');
+			}
+
+			tinyMCEPopup.close();
+			return;
+		}
+
+		if (!ed.settings.inline_styles) {
+			args = tinymce.extend(args, {
+				vspace : nl.vspace.value,
+				hspace : nl.hspace.value,
+				border : nl.border.value,
+				align : getSelectValue(f, 'align')
+			});
+		} else
+			args.style = this.styleVal;
+
+		tinymce.extend(args, {
+			src : f.src.value.replace(/ /g, '%20'),
+			alt : f.alt.value,
+			width : f.width.value,
+			height : f.height.value
+		});
+
+		el = ed.selection.getNode();
+
+		if (el && el.nodeName == 'IMG') {
+			ed.dom.setAttribs(el, args);
+			tinyMCEPopup.editor.execCommand('mceRepaint');
+			tinyMCEPopup.editor.focus();
+		} else {
+			ed.execCommand('mceInsertContent', false, '<img id="__mce_tmp" />', {skip_undo : 1});
+			ed.dom.setAttribs('__mce_tmp', args);
+			ed.dom.setAttrib('__mce_tmp', 'id', '');
+			ed.undoManager.add();
+		}
+
+		tinyMCEPopup.close();
+	},
+
+	updateStyle : function() {
+		var dom = tinyMCEPopup.dom, st, v, f = document.forms[0];
+
+		if (tinyMCEPopup.editor.settings.inline_styles) {
+			st = tinyMCEPopup.dom.parseStyle(this.styleVal);
+
+			// Handle align
+			v = getSelectValue(f, 'align');
+			if (v) {
+				if (v == 'left' || v == 'right') {
+					st['float'] = v;
+					delete st['vertical-align'];
+				} else {
+					st['vertical-align'] = v;
+					delete st['float'];
+				}
+			} else {
+				delete st['float'];
+				delete st['vertical-align'];
+			}
+
+			// Handle border
+			v = f.border.value;
+			if (v || v == '0') {
+				if (v == '0')
+					st['border'] = '0';
+				else
+					st['border'] = v + 'px solid black';
+			} else
+				delete st['border'];
+
+			// Handle hspace
+			v = f.hspace.value;
+			if (v) {
+				delete st['margin'];
+				st['margin-left'] = v + 'px';
+				st['margin-right'] = v + 'px';
+			} else {
+				delete st['margin-left'];
+				delete st['margin-right'];
+			}
+
+			// Handle vspace
+			v = f.vspace.value;
+			if (v) {
+				delete st['margin'];
+				st['margin-top'] = v + 'px';
+				st['margin-bottom'] = v + 'px';
+			} else {
+				delete st['margin-top'];
+				delete st['margin-bottom'];
+			}
+
+			// Merge
+			st = tinyMCEPopup.dom.parseStyle(dom.serializeStyle(st), 'img');
+			this.styleVal = dom.serializeStyle(st, 'img');
+		}
+	},
+
+	getAttrib : function(e, at) {
+		var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
+
+		if (ed.settings.inline_styles) {
+			switch (at) {
+				case 'align':
+					if (v = dom.getStyle(e, 'float'))
+						return v;
+
+					if (v = dom.getStyle(e, 'vertical-align'))
+						return v;
+
+					break;
+
+				case 'hspace':
+					v = dom.getStyle(e, 'margin-left')
+					v2 = dom.getStyle(e, 'margin-right');
+					if (v && v == v2)
+						return parseInt(v.replace(/[^0-9]/g, ''));
+
+					break;
+
+				case 'vspace':
+					v = dom.getStyle(e, 'margin-top')
+					v2 = dom.getStyle(e, 'margin-bottom');
+					if (v && v == v2)
+						return parseInt(v.replace(/[^0-9]/g, ''));
+
+					break;
+
+				case 'border':
+					v = 0;
+
+					tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {
+						sv = dom.getStyle(e, 'border-' + sv + '-width');
+
+						// False or not the same as prev
+						if (!sv || (sv != v && v !== 0)) {
+							v = 0;
+							return false;
+						}
+
+						if (sv)
+							v = sv;
+					});
+
+					if (v)
+						return parseInt(v.replace(/[^0-9]/g, ''));
+
+					break;
+			}
+		}
+
+		if (v = dom.getAttrib(e, at))
+			return v;
+
+		return '';
+	},
+
+	resetImageData : function() {
+		var f = document.forms[0];
+
+		f.width.value = f.height.value = "";	
+	},
+
+	updateImageData : function() {
+		var f = document.forms[0], t = ImageDialog;
+
+		if (f.width.value == "")
+			f.width.value = t.preloadImg.width;
+
+		if (f.height.value == "")
+			f.height.value = t.preloadImg.height;
+	},
+
+	getImageData : function() {
+		var f = document.forms[0];
+
+		this.preloadImg = new Image();
+		this.preloadImg.onload = this.updateImageData;
+		this.preloadImg.onerror = this.resetImageData;
+		this.preloadImg.src = tinyMCEPopup.editor.documentBaseURI.toAbsolute(f.src.value);
+	}
+};
+
+ImageDialog.preInit();
+tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
Index: admin/js/tiny_mce/themes/advanced/js/link.js
===================================================================
--- admin/js/tiny_mce/themes/advanced/js/link.js	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/js/link.js	(revision 307)
@@ -0,0 +1,153 @@
+tinyMCEPopup.requireLangPack();
+
+var LinkDialog = {
+	preInit : function() {
+		var url;
+
+		if (url = tinyMCEPopup.getParam("external_link_list_url"))
+			document.write('<script language="javascript" type="text/javascript" src="' + tinyMCEPopup.editor.documentBaseURI.toAbsolute(url) + '"></script>');
+	},
+
+	init : function() {
+		var f = document.forms[0], ed = tinyMCEPopup.editor;
+
+		// Setup browse button
+		document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser', 'href', 'file', 'theme_advanced_link');
+		if (isVisible('hrefbrowser'))
+			document.getElementById('href').style.width = '180px';
+
+		this.fillClassList('class_list');
+		this.fillFileList('link_list', 'tinyMCELinkList');
+		this.fillTargetList('target_list');
+
+		if (e = ed.dom.getParent(ed.selection.getNode(), 'A')) {
+			f.href.value = ed.dom.getAttrib(e, 'href');
+			f.linktitle.value = ed.dom.getAttrib(e, 'title');
+			f.insert.value = ed.getLang('update');
+			selectByValue(f, 'link_list', f.href.value);
+			selectByValue(f, 'target_list', ed.dom.getAttrib(e, 'target'));
+			selectByValue(f, 'class_list', ed.dom.getAttrib(e, 'class'));
+		}
+	},
+
+	update : function() {
+		var f = document.forms[0], ed = tinyMCEPopup.editor, e, b, href = f.href.value.replace(/ /g, '%20');
+
+		tinyMCEPopup.restoreSelection();
+		e = ed.dom.getParent(ed.selection.getNode(), 'A');
+
+		// Remove element if there is no href
+		if (!f.href.value) {
+			if (e) {
+				b = ed.selection.getBookmark();
+				ed.dom.remove(e, 1);
+				ed.selection.moveToBookmark(b);
+				tinyMCEPopup.execCommand("mceEndUndoLevel");
+				tinyMCEPopup.close();
+				return;
+			}
+		}
+
+		// Create new anchor elements
+		if (e == null) {
+			ed.getDoc().execCommand("unlink", false, null);
+			tinyMCEPopup.execCommand("mceInsertLink", false, "#mce_temp_url#", {skip_undo : 1});
+
+			tinymce.each(ed.dom.select("a"), function(n) {
+				if (ed.dom.getAttrib(n, 'href') == '#mce_temp_url#') {
+					e = n;
+
+					ed.dom.setAttribs(e, {
+						href : href,
+						title : f.linktitle.value,
+						target : f.target_list ? getSelectValue(f, "target_list") : null,
+						'class' : f.class_list ? getSelectValue(f, "class_list") : null
+					});
+				}
+			});
+		} else {
+			ed.dom.setAttribs(e, {
+				href : href,
+				title : f.linktitle.value,
+				target : f.target_list ? getSelectValue(f, "target_list") : null,
+				'class' : f.class_list ? getSelectValue(f, "class_list") : null
+			});
+		}
+
+		// Don't move caret if selection was image
+		if (e.childNodes.length != 1 || e.firstChild.nodeName != 'IMG') {
+			ed.focus();
+			ed.selection.select(e);
+			ed.selection.collapse(0);
+			tinyMCEPopup.storeSelection();
+		}
+
+		tinyMCEPopup.execCommand("mceEndUndoLevel");
+		tinyMCEPopup.close();
+	},
+
+	checkPrefix : function(n) {
+		if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_email')))
+			n.value = 'mailto:' + n.value;
+
+		if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advanced_dlg.link_is_external')))
+			n.value = 'http://' + n.value;
+	},
+
+	fillFileList : function(id, l) {
+		var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
+
+		l = window[l];
+
+		if (l && l.length > 0) {
+			lst.options[lst.options.length] = new Option('', '');
+
+			tinymce.each(l, function(o) {
+				lst.options[lst.options.length] = new Option(o[0], o[1]);
+			});
+		} else
+			dom.remove(dom.getParent(id, 'tr'));
+	},
+
+	fillClassList : function(id) {
+		var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
+
+		if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {
+			cl = [];
+
+			tinymce.each(v.split(';'), function(v) {
+				var p = v.split('=');
+
+				cl.push({'title' : p[0], 'class' : p[1]});
+			});
+		} else
+			cl = tinyMCEPopup.editor.dom.getClasses();
+
+		if (cl.length > 0) {
+			lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
+
+			tinymce.each(cl, function(o) {
+				lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);
+			});
+		} else
+			dom.remove(dom.getParent(id, 'tr'));
+	},
+
+	fillTargetList : function(id) {
+		var dom = tinyMCEPopup.dom, lst = dom.get(id), v;
+
+		lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
+		lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_same'), '_self');
+		lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('advanced_dlg.link_target_blank'), '_blank');
+
+		if (v = tinyMCEPopup.getParam('theme_advanced_link_targets')) {
+			tinymce.each(v.split(','), function(v) {
+				v = v.split('=');
+				lst.options[lst.options.length] = new Option(v[0], v[1]);
+			});
+		}
+	}
+};
+
+LinkDialog.preInit();
+tinyMCEPopup.onInit.add(LinkDialog.init, LinkDialog);
Index: admin/js/tiny_mce/themes/advanced/js/source_editor.js
===================================================================
--- admin/js/tiny_mce/themes/advanced/js/source_editor.js	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/js/source_editor.js	(revision 307)
@@ -0,0 +1,56 @@
+tinyMCEPopup.requireLangPack();
+tinyMCEPopup.onInit.add(onLoadInit);
+
+function saveContent() {
+	tinyMCEPopup.editor.setContent(document.getElementById('htmlSource').value, {source_view : true});
+	tinyMCEPopup.close();
+}
+
+function onLoadInit() {
+	tinyMCEPopup.resizeToInnerSize();
+
+	// Remove Gecko spellchecking
+	if (tinymce.isGecko)
+		document.body.spellcheck = tinyMCEPopup.editor.getParam("gecko_spellcheck");
+
+	document.getElementById('htmlSource').value = tinyMCEPopup.editor.getContent({source_view : true});
+
+	if (tinyMCEPopup.editor.getParam("theme_advanced_source_editor_wrap", true)) {
+		setWrap('soft');
+		document.getElementById('wraped').checked = true;
+	}
+
+	resizeInputs();
+}
+
+function setWrap(val) {
+	var v, n, s = document.getElementById('htmlSource');
+
+	s.wrap = val;
+
+	if (!tinymce.isIE) {
+		v = s.value;
+		n = s.cloneNode(false);
+		n.setAttribute("wrap", val);
+		s.parentNode.replaceChild(n, s);
+		n.value = v;
+	}
+}
+
+function toggleWordWrap(elm) {
+	if (elm.checked)
+		setWrap('soft');
+	else
+		setWrap('off');
+}
+
+function resizeInputs() {
+	var vp = tinyMCEPopup.dom.getViewPort(window), el;
+
+	el = document.getElementById('htmlSource');
+
+	if (el) {
+		el.style.width = (vp.w - 20) + 'px';
+		el.style.height = (vp.h - 65) + 'px';
+	}
+}
Index: admin/js/tiny_mce/themes/advanced/langs/en.js
===================================================================
--- admin/js/tiny_mce/themes/advanced/langs/en.js	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/langs/en.js	(revision 307)
@@ -0,0 +1,68 @@
+tinyMCE.addI18n('en.advanced',{
+style_select:"Styles",
+font_size:"Font size",
+fontdefault:"Font family",
+block:"Format",
+paragraph:"Paragraph",
+div:"Div",
+address:"Address",
+pre:"Preformatted",
+h1:"Heading 1",
+h2:"Heading 2",
+h3:"Heading 3",
+h4:"Heading 4",
+h5:"Heading 5",
+h6:"Heading 6",
+blockquote:"Blockquote",
+code:"Code",
+samp:"Code sample",
+dt:"Definition term ",
+dd:"Definition description",
+bold_desc:"Bold (Ctrl+B)",
+italic_desc:"Italic (Ctrl+I)",
+underline_desc:"Underline (Ctrl+U)",
+striketrough_desc:"Strikethrough",
+justifyleft_desc:"Align left",
+justifycenter_desc:"Align center",
+justifyright_desc:"Align right",
+justifyfull_desc:"Align full",
+bullist_desc:"Unordered list",
+numlist_desc:"Ordered list",
+outdent_desc:"Outdent",
+indent_desc:"Indent",
+undo_desc:"Undo (Ctrl+Z)",
+redo_desc:"Redo (Ctrl+Y)",
+link_desc:"Insert/edit link",
+unlink_desc:"Unlink",
+image_desc:"Insert/edit image",
+cleanup_desc:"Cleanup messy code",
+code_desc:"Edit HTML Source",
+sub_desc:"Subscript",
+sup_desc:"Superscript",
+hr_desc:"Insert horizontal ruler",
+removeformat_desc:"Remove formatting",
+custom1_desc:"Your custom description here",
+forecolor_desc:"Select text color",
+backcolor_desc:"Select background color",
+charmap_desc:"Insert custom character",
+visualaid_desc:"Toggle guidelines/invisible elements",
+anchor_desc:"Insert/edit anchor",
+cut_desc:"Cut",
+copy_desc:"Copy",
+paste_desc:"Paste",
+image_props_desc:"Image properties",
+newdocument_desc:"New document",
+help_desc:"Help",
+blockquote_desc:"Blockquote",
+clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\r\nDo you want more information about this issue?",
+path:"Path",
+newdocument:"Are you sure you want clear all contents?",
+toolbar_focus:"Jump to tool buttons - Alt+Q, Jump to editor - Alt-Z, Jump to element path - Alt-X",
+more_colors:"More colors",
+
+// Accessibility Strings
+shortcuts_desc:'Accessibility Help',
+help_shortcut:'. Press ALT F10 for toolbar. Press ALT 0 for help.',
+rich_text_area:"Rich Text Area",
+toolbar:"Toolbar"
+});
Index: admin/js/tiny_mce/themes/advanced/langs/en_dlg.js
===================================================================
--- admin/js/tiny_mce/themes/advanced/langs/en_dlg.js	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/langs/en_dlg.js	(revision 307)
@@ -0,0 +1,54 @@
+tinyMCE.addI18n('en.advanced_dlg',{
+about_title:"About TinyMCE",
+about_general:"About",
+about_help:"Help",
+about_license:"License",
+about_plugins:"Plugins",
+about_plugin:"Plugin",
+about_author:"Author",
+about_version:"Version",
+about_loaded:"Loaded plugins",
+anchor_title:"Insert/edit anchor",
+anchor_name:"Anchor name",
+anchor_invalid:"Please specify a valid anchor name.",
+code_title:"HTML Source Editor",
+code_wordwrap:"Word wrap",
+colorpicker_title:"Select a color",
+colorpicker_picker_tab:"Picker",
+colorpicker_picker_title:"Color picker",
+colorpicker_palette_tab:"Palette",
+colorpicker_palette_title:"Palette colors",
+colorpicker_named_tab:"Named",
+colorpicker_named_title:"Named colors",
+colorpicker_color:"Color:",
+colorpicker_name:"Name:",
+charmap_title:"Select custom character",
+image_title:"Insert/edit image",
+image_src:"Image URL",
+image_alt:"Image description",
+image_list:"Image list",
+image_border:"Border",
+image_dimensions:"Dimensions",
+image_vspace:"Vertical space",
+image_hspace:"Horizontal space",
+image_align:"Alignment",
+image_align_baseline:"Baseline",
+image_align_top:"Top",
+image_align_middle:"Middle",
+image_align_bottom:"Bottom",
+image_align_texttop:"Text top",
+image_align_textbottom:"Text bottom",
+image_align_left:"Left",
+image_align_right:"Right",
+link_title:"Insert/edit link",
+link_url:"Link URL",
+link_target:"Target",
+link_target_same:"Open link in the same window",
+link_target_blank:"Open link in a new window",
+link_titlefield:"Title",
+link_is_email:"The URL you entered seems to be an email address. Do you want to add the required mailto: prefix?",
+link_is_external:"The URL you entered seems to be an external link. Do you want to add the required http:// prefix?",
+link_list:"Link list",
+accessibility_help:"Accessibility Help",
+accessibility_usage_title:"General Usage"
+});
Index: admin/js/tiny_mce/themes/advanced/link.htm
===================================================================
--- admin/js/tiny_mce/themes/advanced/link.htm	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/link.htm	(revision 307)
@@ -0,0 +1,57 @@
+<!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">
+<head>
+	<title>{#advanced_dlg.link_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="../../utils/mctabs.js"></script>
+	<script type="text/javascript" src="../../utils/form_utils.js"></script>
+	<script type="text/javascript" src="../../utils/validate.js"></script>
+	<script type="text/javascript" src="js/link.js"></script>
+</head>
+<body id="link" style="display: none">
+<form onsubmit="LinkDialog.update();return false;" action="#">
+	<div class="tabs">
+		<ul>
+			<li id="general_tab" class="current"><span><a href="javascript:mcTabs.displayTab('general_tab','general_panel');" onmousedown="return false;">{#advanced_dlg.link_title}</a></span></li>
+		</ul>
+	</div>
+
+	<div class="panel_wrapper">
+		<div id="general_panel" class="panel current">
+			<table border="0" cellpadding="4" cellspacing="0">
+				<tr>
+					<td class="nowrap"><label for="href">{#advanced_dlg.link_url}</label></td>
+					<td><table border="0" cellspacing="0" cellpadding="0"> 
+						<tr> 
+							<td><input id="href" name="href" type="text" class="mceFocus" value="" style="width: 200px" onchange="LinkDialog.checkPrefix(this);" /></td> 
+							<td id="hrefbrowsercontainer">&nbsp;</td>
+						</tr> 
+					</table></td>
+				</tr>
+				<tr>
+					<td><label for="link_list">{#advanced_dlg.link_list}</label></td>
+					<td><select id="link_list" name="link_list" onchange="document.getElementById('href').value=this.options[this.selectedIndex].value;"></select></td>
+				</tr>
+				<tr>
+					<td><label id="targetlistlabel" for="targetlist">{#advanced_dlg.link_target}</label></td>
+					<td><select id="target_list" name="target_list"></select></td>
+				</tr>
+				<tr>
+					<td class="nowrap"><label for="linktitle">{#advanced_dlg.link_titlefield}</label></td>
+					<td><input id="linktitle" name="linktitle" type="text" value="" style="width: 200px" /></td>
+				</tr>
+				<tr>
+					<td><label for="class_list">{#class_name}</label></td>
+					<td><select id="class_list" name="class_list"></select></td>
+				</tr>
+			</table>
+		</div>
+	</div>
+
+	<div class="mceActionPanel">
+		<input type="submit" id="insert" name="insert" value="{#insert}" />
+		<input type="button" id="cancel" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" />
+	</div>
+</form>
+</body>
+</html>
Index: admin/js/tiny_mce/themes/advanced/shortcuts.htm
===================================================================
--- admin/js/tiny_mce/themes/advanced/shortcuts.htm	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/shortcuts.htm	(revision 307)
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+	<head>
+		<title>{#advanced_dlg.accessibility_help}</title>
+		<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+		<script type="text/javascript">tinyMCEPopup.requireLangPack();</script>
+	</head>
+	<body id="content">
+		<h1>{#advanced_dlg.accessibility_usage_title}</h1>
+		<h2>Toolbars</h2>
+		<p>Press ALT-F10 to move focus to the toolbars. Navigate through the buttons using the arrow keys.
+		Press enter to activate a button and return focus to the editor.
+		Press escape to return focus to the editor without performing any actions.</p>
+		
+		<h2>Status Bar</h2>
+		<p>To access the editor status bar, press ALT-F11. Use the left and right arrow keys to navigate between elements in the path.
+		Press enter or space to select an element. Press escape to return focus to the editor without changing the selection.</p>
+		
+		<h2>Context Menu</h2>
+		<p>Press shift-F10 to activate the context menu. Use the up and down arrow keys to move between menu items. To open sub-menus press the right arrow key.
+		To close submenus press the left arrow key.  Press escape to close the context menu.</p>
+		
+		<h1>Keyboard Shortcuts</h1>
+		<table>
+			<thead>
+				<tr>
+					<th>Keystroke</th>
+					<th>Function</th>
+				</tr>
+			</thead>
+			<tbody>
+				<tr>
+					<td>Control-B</td><td>Bold</td>
+				</tr>
+				<tr>
+					<td>Control-I</td><td>Italic</td>
+				</tr>
+				<tr>
+					<td>Control-Z</td><td>Undo</td>
+				</tr>
+				<tr>
+					<td>Control-Y</td><td>Redo</td>
+				</tr>
+			</tbody>
+		</table>
+	</body>
+</html>
Index: admin/js/tiny_mce/themes/advanced/skins/default/content.css
===================================================================
--- admin/js/tiny_mce/themes/advanced/skins/default/content.css	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/skins/default/content.css	(revision 307)
@@ -0,0 +1,47 @@
+body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
+body {background:#FFF;}
+body.mceForceColors {background:#FFF; color:#000;}
+body.mceBrowserDefaults {background:transparent; color:inherit; font-size:inherit; font-family:inherit;}
+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: .75em}
+.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
+a.mceItemAnchor {display:inline-block; width:11px !important; height:11px  !important; background:url(img/items.gif) no-repeat 0 0;}
+span.mceItemNbsp {background: #DDD}
+td.mceSelected, th.mceSelected {background-color:#3399ff !important}
+img {border:0;}
+table {cursor:default}
+table td, table th {cursor:text}
+ins {border-bottom:1px solid green; text-decoration: none; color:green}
+del {color:red; text-decoration:line-through}
+cite {border-bottom:1px dashed blue}
+acronym {border-bottom:1px dotted #CCC; cursor:help}
+abbr {border-bottom:1px dashed #CCC; cursor:help}
+
+/* IE */
+* html body {
+scrollbar-3dlight-color:#F0F0EE;
+scrollbar-arrow-color:#676662;
+scrollbar-base-color:#F0F0EE;
+scrollbar-darkshadow-color:#DDD;
+scrollbar-face-color:#E0E0DD;
+scrollbar-highlight-color:#F0F0EE;
+scrollbar-shadow-color:#F0F0EE;
+scrollbar-track-color:#F5F5F5;
+}
+
+img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
+font[face=mceinline] {font-family:inherit !important}
+
+.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc}
+.mceItemShockWave {background-image:url(../../img/shockwave.gif)}
+.mceItemFlash {background-image:url(../../img/flash.gif)}
+.mceItemQuickTime {background-image:url(../../img/quicktime.gif)}
+.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)}
+.mceItemRealMedia {background-image:url(../../img/realmedia.gif)}
+.mceItemVideo {background-image:url(../../img/video.gif)}
+.mceItemIframe {background-image:url(../../img/iframe.gif)}
+.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}
Index: admin/js/tiny_mce/themes/advanced/skins/default/dialog.css
===================================================================
--- admin/js/tiny_mce/themes/advanced/skins/default/dialog.css	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/skins/default/dialog.css	(revision 307)
@@ -0,0 +1,117 @@
+/* Generic */
+body {
+font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
+scrollbar-3dlight-color:#F0F0EE;
+scrollbar-arrow-color:#676662;
+scrollbar-base-color:#F0F0EE;
+scrollbar-darkshadow-color:#DDDDDD;
+scrollbar-face-color:#E0E0DD;
+scrollbar-highlight-color:#F0F0EE;
+scrollbar-shadow-color:#F0F0EE;
+scrollbar-track-color:#F5F5F5;
+background:#F0F0EE;
+padding:0;
+margin:8px 8px 0 8px;
+}
+
+html {background:#F0F0EE;}
+td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+textarea {resize:none;outline:none;}
+a:link, a:visited {color:black;}
+a:hover {color:#2B6FB6;}
+.nowrap {white-space: nowrap}
+
+/* Forms */
+fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
+legend {color:#2B6FB6; font-weight:bold;}
+label.msg {display:none;}
+label.invalid {color:#EE0000; display:inline;}
+input.invalid {border:1px solid #EE0000;}
+input {background:#FFF; border:1px solid #CCC;}
+input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+input, select, textarea {border:1px solid #808080;}
+input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
+input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
+.input_noborder {border:0;}
+
+/* Buttons */
+#insert, #cancel, input.button, .updateButton {
+border:0; margin:0; padding:0;
+font-weight:bold;
+width:94px; height:26px;
+background:url(img/buttons.png) 0 -26px;
+cursor:pointer;
+padding-bottom:2px;
+float:left;
+}
+
+#insert {background:url(img/buttons.png) 0 -52px}
+#cancel {background:url(img/buttons.png) 0 0; float:right}
+
+/* Browse */
+a.pickcolor, a.browse {text-decoration:none}
+a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}
+.mceOldBoxModel a.browse span {width:22px; height:20px;}
+a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
+a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
+a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
+a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}
+.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
+a.pickcolor:hover span {background-color:#B2BBD0;}
+a.pickcolor:hover span.disabled {}
+
+/* Charmap */
+table.charmap {border:1px solid #AAA; text-align:center}
+td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
+#charmap a {display:block; color:#000; text-decoration:none; border:0}
+#charmap a:hover {background:#CCC;color:#2B6FB6}
+#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
+#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
+
+/* Source */
+.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
+.mceActionPanel {margin-top:5px;}
+
+/* Tabs classes */
+.tabs {width:100%; height:18px; line-height:normal; background:url(img/tabs.gif) repeat-x 0 -72px;}
+.tabs ul {margin:0; padding:0; list-style:none;}
+.tabs li {float:left; background:url(img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}
+.tabs li.current {background:url(img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}
+.tabs span {float:left; display:block; background:url(img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}
+.tabs .current span {background:url(img/tabs.gif) no-repeat right -54px;}
+.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
+.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
+
+/* Panels */
+.panel_wrapper div.panel {display:none;}
+.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
+.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
+
+/* Columns */
+.column {float:left;}
+.properties {width:100%;}
+.properties .column1 {}
+.properties .column2 {text-align:left;}
+
+/* Titles */
+h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
+h3 {font-size:14px;}
+.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
+
+/* Dialog specific */
+#link .panel_wrapper, #link div.current {height:125px;}
+#image .panel_wrapper, #image div.current {height:200px;}
+#plugintable thead {font-weight:bold; background:#DDD;}
+#plugintable, #about #plugintable td {border:1px solid #919B9C;}
+#plugintable {width:96%; margin-top:10px;}
+#pluginscontainer {height:290px; overflow:auto;}
+#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
+#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
+#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
+#colorpicker #light div {overflow:hidden;}
+#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
+#colorpicker .panel_wrapper div.current {height:175px;}
+#colorpicker #namedcolors {width:150px;}
+#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
+#colorpicker #colornamecontainer {margin-top:5px;}
+#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
Index: admin/js/tiny_mce/themes/advanced/skins/default/ui.css
===================================================================
--- admin/js/tiny_mce/themes/advanced/skins/default/ui.css	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/skins/default/ui.css	(revision 307)
@@ -0,0 +1,213 @@
+/* Reset */
+.defaultSkin table, .defaultSkin tbody, .defaultSkin a, .defaultSkin img, .defaultSkin tr, .defaultSkin div, .defaultSkin td, .defaultSkin iframe, .defaultSkin span, .defaultSkin *, .defaultSkin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left}
+.defaultSkin a:hover, .defaultSkin a:link, .defaultSkin a:visited, .defaultSkin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}
+.defaultSkin table td {vertical-align:middle}
+
+/* Containers */
+.defaultSkin table {direction:ltr;background:transparent}
+.defaultSkin iframe {display:block;}
+.defaultSkin .mceToolbar {height:26px}
+.defaultSkin .mceLeft {text-align:left}
+.defaultSkin .mceRight {text-align:right}
+
+/* External */
+.defaultSkin .mceExternalToolbar {position:absolute; border:1px solid #CCC; border-bottom:0; display:none;}
+.defaultSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;}
+.defaultSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}
+
+/* Layout */
+.defaultSkin table.mceLayout {border:0; border-left:1px solid #CCC; border-right:1px solid #CCC}
+.defaultSkin table.mceLayout tr.mceFirst td {border-top:1px solid #CCC}
+.defaultSkin table.mceLayout tr.mceLast td {border-bottom:1px solid #CCC}
+.defaultSkin table.mceToolbar, .defaultSkin tr.mceFirst .mceToolbar tr td, .defaultSkin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0;}
+.defaultSkin td.mceToolbar {background:#F0F0EE; padding-top:1px; vertical-align:top}
+.defaultSkin .mceIframeContainer {border-top:1px solid #CCC; border-bottom:1px solid #CCC}
+.defaultSkin .mceStatusbar {background:#F0F0EE; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; display:block; height:20px}
+.defaultSkin .mceStatusbar div {float:left; margin:2px}
+.defaultSkin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}
+.defaultSkin .mceStatusbar a:hover {text-decoration:underline}
+.defaultSkin table.mceToolbar {margin-left:3px}
+.defaultSkin span.mceIcon, .defaultSkin img.mceIcon {display:block; width:20px; height:20px}
+.defaultSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}
+.defaultSkin td.mceCenter {text-align:center;}
+.defaultSkin td.mceCenter table {margin:0 auto; text-align:left;}
+.defaultSkin td.mceRight table {margin:0 0 0 auto;}
+
+/* Button */
+.defaultSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px; margin-right:1px}
+.defaultSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}
+.defaultSkin a.mceButtonActive, .defaultSkin a.mceButtonSelected {border:1px solid #0A246A; background-color:#C2CBE0}
+.defaultSkin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
+.defaultSkin .mceButtonLabeled {width:auto}
+.defaultSkin .mceButtonLabeled span.mceIcon {float:left}
+.defaultSkin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica}
+.defaultSkin .mceButtonDisabled .mceButtonLabel {color:#888}
+
+/* Separator */
+.defaultSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:2px 2px 0 4px}
+
+/* ListBox */
+.defaultSkin .mceListBox, .defaultSkin .mceListBox a {display:block}
+.defaultSkin .mceListBox .mceText {padding-left:4px; width:70px; text-align:left; border:1px solid #CCC; border-right:0; background:#FFF; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
+.defaultSkin .mceListBox .mceOpen {width:9px; height:20px; background:url(../../img/icons.gif) -741px 0; margin-right:2px; border:1px solid #CCC;}
+.defaultSkin table.mceListBoxEnabled:hover .mceText, .defaultSkin .mceListBoxHover .mceText, .defaultSkin .mceListBoxSelected .mceText {border:1px solid #A2ABC0; border-right:0; background:#FFF}
+.defaultSkin table.mceListBoxEnabled:hover .mceOpen, .defaultSkin .mceListBoxHover .mceOpen, .defaultSkin .mceListBoxSelected .mceOpen {background-color:#FFF; border:1px solid #A2ABC0}
+.defaultSkin .mceListBoxDisabled a.mceText {color:gray; background-color:transparent;}
+.defaultSkin .mceListBoxMenu {overflow:auto; overflow-x:hidden}
+.defaultSkin .mceOldBoxModel .mceListBox .mceText {height:22px}
+.defaultSkin .mceOldBoxModel .mceListBox .mceOpen {width:11px; height:22px;}
+.defaultSkin select.mceNativeListBox {font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:7pt; background:#F0F0EE; border:1px solid gray; margin-right:2px;}
+
+/* SplitButton */
+.defaultSkin .mceSplitButton {width:32px; height:20px; direction:ltr}
+.defaultSkin .mceSplitButton a, .defaultSkin .mceSplitButton span {height:20px; display:block}
+.defaultSkin .mceSplitButton a.mceAction {width:20px; border:1px solid #F0F0EE; border-right:0;}
+.defaultSkin .mceSplitButton span.mceAction {width:20px; background-image:url(../../img/icons.gif);}
+.defaultSkin .mceSplitButton a.mceOpen {width:9px; background:url(../../img/icons.gif) -741px 0; border:1px solid #F0F0EE;}
+.defaultSkin .mceSplitButton span.mceOpen {display:none}
+.defaultSkin table.mceSplitButtonEnabled:hover a.mceAction, .defaultSkin .mceSplitButtonHover a.mceAction, .defaultSkin .mceSplitButtonSelected a.mceAction {border:1px solid #0A246A; border-right:0; background-color:#B2BBD0}
+.defaultSkin table.mceSplitButtonEnabled:hover a.mceOpen, .defaultSkin .mceSplitButtonHover a.mceOpen, .defaultSkin .mceSplitButtonSelected a.mceOpen {background-color:#B2BBD0; border:1px solid #0A246A;}
+.defaultSkin .mceSplitButtonDisabled .mceAction, .defaultSkin .mceSplitButtonDisabled a.mceOpen {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
+.defaultSkin .mceSplitButtonActive a.mceAction {border:1px solid #0A246A; background-color:#C2CBE0}
+.defaultSkin .mceSplitButtonActive a.mceOpen {border-left:0;}
+
+/* ColorSplitButton */
+.defaultSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}
+.defaultSkin .mceColorSplitMenu td {padding:2px}
+.defaultSkin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}
+.defaultSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}
+.defaultSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}
+.defaultSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}
+.defaultSkin a.mceMoreColors:hover {border:1px solid #0A246A}
+.defaultSkin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a}
+.defaultSkin .mce_forecolor span.mceAction, .defaultSkin .mce_backcolor span.mceAction {overflow:hidden; height:16px}
+
+/* Menu */
+.defaultSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #D4D0C8}
+.defaultSkin .mceNoIcons span.mceIcon {width:0;}
+.defaultSkin .mceNoIcons a .mceText {padding-left:10px}
+.defaultSkin .mceMenu table {background:#FFF}
+.defaultSkin .mceMenu a, .defaultSkin .mceMenu span, .defaultSkin .mceMenu {display:block}
+.defaultSkin .mceMenu td {height:20px}
+.defaultSkin .mceMenu a {position:relative;padding:3px 0 4px 0}
+.defaultSkin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block}
+.defaultSkin .mceMenu span.mceText, .defaultSkin .mceMenu .mcePreview {font-size:11px}
+.defaultSkin .mceMenu pre.mceText {font-family:Monospace}
+.defaultSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;}
+.defaultSkin .mceMenu .mceMenuItemEnabled a:hover, .defaultSkin .mceMenu .mceMenuItemActive {background-color:#dbecf3}
+.defaultSkin td.mceMenuItemSeparator {background:#DDD; height:1px}
+.defaultSkin .mceMenuItemTitle a {border:0; background:#EEE; border-bottom:1px solid #DDD}
+.defaultSkin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px}
+.defaultSkin .mceMenuItemDisabled .mceText {color:#888}
+.defaultSkin .mceMenuItemSelected .mceIcon {background:url(img/menu_check.gif)}
+.defaultSkin .mceNoIcons .mceMenuItemSelected a {background:url(img/menu_arrow.gif) no-repeat -6px center}
+.defaultSkin .mceMenu span.mceMenuLine {display:none}
+.defaultSkin .mceMenuItemSub a {background:url(img/menu_arrow.gif) no-repeat top right;}
+
+/* Progress,Resize */
+.defaultSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=50)'; filter:alpha(opacity=50); background:#FFF}
+.defaultSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
+
+/* Formats */
+.defaultSkin .mce_formatPreview a {font-size:10px}
+.defaultSkin .mce_p span.mceText {}
+.defaultSkin .mce_address span.mceText {font-style:italic}
+.defaultSkin .mce_pre span.mceText {font-family:monospace}
+.defaultSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}
+.defaultSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}
+.defaultSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}
+.defaultSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}
+.defaultSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}
+.defaultSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}
+
+/* Theme */
+.defaultSkin span.mce_bold {background-position:0 0}
+.defaultSkin span.mce_italic {background-position:-60px 0}
+.defaultSkin span.mce_underline {background-position:-140px 0}
+.defaultSkin span.mce_strikethrough {background-position:-120px 0}
+.defaultSkin span.mce_undo {background-position:-160px 0}
+.defaultSkin span.mce_redo {background-position:-100px 0}
+.defaultSkin span.mce_cleanup {background-position:-40px 0}
+.defaultSkin span.mce_bullist {background-position:-20px 0}
+.defaultSkin span.mce_numlist {background-position:-80px 0}
+.defaultSkin span.mce_justifyleft {background-position:-460px 0}
+.defaultSkin span.mce_justifyright {background-position:-480px 0}
+.defaultSkin span.mce_justifycenter {background-position:-420px 0}
+.defaultSkin span.mce_justifyfull {background-position:-440px 0}
+.defaultSkin span.mce_anchor {background-position:-200px 0}
+.defaultSkin span.mce_indent {background-position:-400px 0}
+.defaultSkin span.mce_outdent {background-position:-540px 0}
+.defaultSkin span.mce_link {background-position:-500px 0}
+.defaultSkin span.mce_unlink {background-position:-640px 0}
+.defaultSkin span.mce_sub {background-position:-600px 0}
+.defaultSkin span.mce_sup {background-position:-620px 0}
+.defaultSkin span.mce_removeformat {background-position:-580px 0}
+.defaultSkin span.mce_newdocument {background-position:-520px 0}
+.defaultSkin span.mce_image {background-position:-380px 0}
+.defaultSkin span.mce_help {background-position:-340px 0}
+.defaultSkin span.mce_code {background-position:-260px 0}
+.defaultSkin span.mce_hr {background-position:-360px 0}
+.defaultSkin span.mce_visualaid {background-position:-660px 0}
+.defaultSkin span.mce_charmap {background-position:-240px 0}
+.defaultSkin span.mce_paste {background-position:-560px 0}
+.defaultSkin span.mce_copy {background-position:-700px 0}
+.defaultSkin span.mce_cut {background-position:-680px 0}
+.defaultSkin span.mce_blockquote {background-position:-220px 0}
+.defaultSkin .mce_forecolor span.mceAction {background-position:-720px 0}
+.defaultSkin .mce_backcolor span.mceAction {background-position:-760px 0}
+.defaultSkin span.mce_forecolorpicker {background-position:-720px 0}
+.defaultSkin span.mce_backcolorpicker {background-position:-760px 0}
+
+/* Plugins */
+.defaultSkin span.mce_advhr {background-position:-0px -20px}
+.defaultSkin span.mce_ltr {background-position:-20px -20px}
+.defaultSkin span.mce_rtl {background-position:-40px -20px}
+.defaultSkin span.mce_emotions {background-position:-60px -20px}
+.defaultSkin span.mce_fullpage {background-position:-80px -20px}
+.defaultSkin span.mce_fullscreen {background-position:-100px -20px}
+.defaultSkin span.mce_iespell {background-position:-120px -20px}
+.defaultSkin span.mce_insertdate {background-position:-140px -20px}
+.defaultSkin span.mce_inserttime {background-position:-160px -20px}
+.defaultSkin span.mce_absolute {background-position:-180px -20px}
+.defaultSkin span.mce_backward {background-position:-200px -20px}
+.defaultSkin span.mce_forward {background-position:-220px -20px}
+.defaultSkin span.mce_insert_layer {background-position:-240px -20px}
+.defaultSkin span.mce_insertlayer {background-position:-260px -20px}
+.defaultSkin span.mce_movebackward {background-position:-280px -20px}
+.defaultSkin span.mce_moveforward {background-position:-300px -20px}
+.defaultSkin span.mce_media {background-position:-320px -20px}
+.defaultSkin span.mce_nonbreaking {background-position:-340px -20px}
+.defaultSkin span.mce_pastetext {background-position:-360px -20px}
+.defaultSkin span.mce_pasteword {background-position:-380px -20px}
+.defaultSkin span.mce_selectall {background-position:-400px -20px}
+.defaultSkin span.mce_preview {background-position:-420px -20px}
+.defaultSkin span.mce_print {background-position:-440px -20px}
+.defaultSkin span.mce_cancel {background-position:-460px -20px}
+.defaultSkin span.mce_save {background-position:-480px -20px}
+.defaultSkin span.mce_replace {background-position:-500px -20px}
+.defaultSkin span.mce_search {background-position:-520px -20px}
+.defaultSkin span.mce_styleprops {background-position:-560px -20px}
+.defaultSkin span.mce_table {background-position:-580px -20px}
+.defaultSkin span.mce_cell_props {background-position:-600px -20px}
+.defaultSkin span.mce_delete_table {background-position:-620px -20px}
+.defaultSkin span.mce_delete_col {background-position:-640px -20px}
+.defaultSkin span.mce_delete_row {background-position:-660px -20px}
+.defaultSkin span.mce_col_after {background-position:-680px -20px}
+.defaultSkin span.mce_col_before {background-position:-700px -20px}
+.defaultSkin span.mce_row_after {background-position:-720px -20px}
+.defaultSkin span.mce_row_before {background-position:-740px -20px}
+.defaultSkin span.mce_merge_cells {background-position:-760px -20px}
+.defaultSkin span.mce_table_props {background-position:-980px -20px}
+.defaultSkin span.mce_row_props {background-position:-780px -20px}
+.defaultSkin span.mce_split_cells {background-position:-800px -20px}
+.defaultSkin span.mce_template {background-position:-820px -20px}
+.defaultSkin span.mce_visualchars {background-position:-840px -20px}
+.defaultSkin span.mce_abbr {background-position:-860px -20px}
+.defaultSkin span.mce_acronym {background-position:-880px -20px}
+.defaultSkin span.mce_attribs {background-position:-900px -20px}
+.defaultSkin span.mce_cite {background-position:-920px -20px}
+.defaultSkin span.mce_del {background-position:-940px -20px}
+.defaultSkin span.mce_ins {background-position:-960px -20px}
+.defaultSkin span.mce_pagebreak {background-position:0 -40px}
+.defaultSkin span.mce_restoredraft {background-position:-20px -40px}
+.defaultSkin span.mce_spellchecker {background-position:-540px -20px}
Index: admin/js/tiny_mce/themes/advanced/skins/dotclear/content.css
===================================================================
--- admin/js/tiny_mce/themes/advanced/skins/dotclear/content.css	(revision 409)
+++ admin/js/tiny_mce/themes/advanced/skins/dotclear/content.css	(revision 409)
@@ -0,0 +1,117 @@
+/* Default */
+html,body {
+	padding: 10px !important;
+	margin: 0 !important;
+	background: #fff !important;
+}
+body {
+	height: 94% !important;
+	padding: 0 !important;
+}
+body, td, pre {
+	color: #000;
+	font: 76%/1.5em Helvetica,Arial,sans-serif;
+	margin: 8px;
+}
+body.mceForceColors {
+	background: #fff;
+	color: #000;
+}
+* html body {
+	scrollbar-3dlight-color:#F0F0EE;
+	scrollbar-arrow-color:#676662;
+	scrollbar-base-color:#F0F0EE;
+	scrollbar-darkshadow-color:#DDD;
+	scrollbar-face-color:#E0E0DD;
+	scrollbar-highlight-color:#F0F0EE;
+	scrollbar-shadow-color:#F0F0EE;
+	scrollbar-track-color:#F5F5F5;
+}
+
+/* Elements */
+h1 { font-size: 3.5em; }
+h2 { font-size: 3em; }
+h3 { font-size: 2.5em; }
+h4 { font-size: 2em; }
+h5 { font-size: 1.5em; }
+h6 { font-size: 1.17em; }
+img { border: 0; }
+cite, { border-bottom: 1px dashed #bbb; }
+q:before, q:after { font-size: 1.2em; }
+q:before {
+	content: '\201C';
+	margin-right: 1px;
+}
+q:after {
+	content: '\201D';
+	margin-left: 3px;
+}
+a {
+	color: #2373A8;
+	border-bottom: 1px dotted #F90;
+	text-decoration: none;
+}
+a[hreflang]:before {
+	content: attr(hreflang);
+	background-color: whiteSmoke;
+	border: 1px solid #bbb;
+	margin-right: 0.3em;
+	padding: 0 3px 0 3px;
+	-moz-border-radius: 5px;
+	-webkit-border-radius: 5px;
+	-khtml-border-radius: 5px;
+	border-radius: 5px;
+}
+acronym {
+	border-bottom: 1px dotted #bbb;
+	cursor: help;
+}
+abbr {
+	border-bottom: 1px dashed #bbb;
+	cursor:help;
+}
+.mceItemAnchor:before {
+	content: attr(name);
+	background: whiteSmoke url(img/anchor.png) no-repeat 0 3px;
+	font-style: italic;
+	border: 1px solid #ccc;
+	-moz-border-radius: 5px;
+	-webkit-border-radius: 5px;
+	-khtml-border-radius: 5px;
+	border-radius: 5px;
+	margin: 0 3px 0 3px;
+	padding: 0 2px 0 12px;
+}
+span.mceItemNbsp {
+	background: whiteSmoke;
+	border-bottom: 1px dashed #ccc;
+}
+td.mceSelected, th.mceSelected { background-color: #3399ff !important; }
+
+/* Table */
+.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid { border: 1px dashed #ccc; }
+table { cursor: default; }
+table td, table th { cursor: text; }
+
+/* Media */
+div.media object, div.media iframe { display: block; }
+div.media {
+	display: block;
+}
+div.media object, div.media iframe {
+	border: 1px dotted #ccc;
+	background-color: whiteSmoke;
+	background-position: center;
+	background-repeat: no-repeat;
+}
+div.media-audio object, div.media-audio iframe { background-image: url(img/audio.png); }
+div.media-video object, div.media-video iframe { background-image: url(img/video.png); }
+div.media-rich object, div.media-rich iframe { background-image: url(img/rich.png); }
+
+/* Other */
+img:-moz-broken {
+	-moz-force-broken-image-icon: 1;
+	width: 24px;
+	height: 24px;
+}
+font[face=mceinline] { font-family: inherit !important; }
Index: admin/js/tiny_mce/themes/advanced/skins/dotclear/dialog.css
===================================================================
--- admin/js/tiny_mce/themes/advanced/skins/dotclear/dialog.css	(revision 423)
+++ admin/js/tiny_mce/themes/advanced/skins/dotclear/dialog.css	(revision 423)
@@ -0,0 +1,234 @@
+/* Commons */
+body[class=forceColors] {
+	padding: 1.5em;
+	margin: 0;
+	font: 76%/1.5em Helvetica,Arial,sans-serif;
+	background-color: #F5F5F5;
+	color: #333333;
+	border-top: 1.5em solid #555555;
+}
+
+/* Buttons */
+a.button { margin-right: 5px; }
+a.insert { font-weight: bold; }
+
+/* Tabs */
+.tabs ul {
+	overflow: visible;
+	list-style: none;
+	padding: 0;
+	margin: 0;
+}
+.tabs li {
+	position: relative;
+	top: 1px;
+	display: block;
+	float: left;
+	padding: 0.5em 1em 0.5em 1em;
+	margin-right: 0.5em;
+	border: 1px solid #bbb;
+	border-bottom: none;
+	-moz-border-radius-topleft: 5px;
+	-webkit-border-top-left-radius: 5px;
+	-khtml-border-top-left-radius: 5px;
+	border-top-left-radius: 5px;
+	-moz-border-radius-topright: 5px;
+	-webkit-border-top-right-radius: 5px;
+	-khtml-border-top-right-radius: 5px;
+	border-top-right-radius: 5px;
+}
+.tabs li.current {
+	background: #fff;
+	border-bottom: 1px solid #fff;
+}
+.tabs .current span { border-bottom: none; }
+.tabs a { text-decoration: none; }
+.tabs a:link, .tabs a:visited, .tabs a:hover { color:#333; }
+
+/* Panels */
+.panel_wrapper div.panel { display: none; }
+.panel_wrapper div.current {
+	display: block;
+	width: 100%;
+	height: 300px;
+	overflow: visible;
+}
+.panel_wrapper {
+	border: 1px solid #bbb;
+	padding: 10px;
+	padding-top: 5px;
+	clear: both;
+	background: #fff;
+}
+
+/* Columns */
+.column { float: left; }
+.properties { width: 100%; }
+.properties .column1 {}
+.properties .column2 { text-align: left; }
+
+/* Titles */
+.title {
+	font-size: 1.4em;
+	font-weight: bold;
+	color: #666;
+	padding: 4px 0 4px 0;
+}
+
+/* Charmap popup */
+#charmap table.charmap {
+	border: 1px solid #bbb;
+	text-align: center;
+}
+#charmap td.charmap, #charmap a {
+	width: 18px;
+	height: 18px;
+	color: #000;
+	border: 1px solid #bbb;
+	text-align: center;
+	vertical-align: middle;
+	font-size: 1em;
+	line-height: 18px;
+}
+#charmap a {
+	display: block;
+	color: #000;
+	text-decoration: none;
+	border: none;
+}
+#charmap a:hover {
+	background:#ccc;
+	color: #2b6fb6;
+}
+#charmap #codeN {
+	font-size: 0.8em;
+	text-align: center;
+}
+#charmap #codeV {
+	font-size: 4em;
+	height: 80px;
+	border: 1px solid #bbb;
+	text-align: center;
+}
+
+/* Source popup */
+.wordWrapCode {
+	vertical-align: middle;
+	border: 1px none #000000;
+	background: transparent;
+}
+#htmlSource {
+	width: 680px !important;
+	height: 430px !important;
+}
+.mceActionPanel { margin-top: 5px; }
+
+/* Web media popup */
+.two-cols .col:first-child { width: 250px; }
+div.col { width: 100%; }
+#src {
+	padding-left: 25px;
+	background: transparent url(img/search.png) no-repeat 5px center;
+}
+#src.loading { background: #ccc url(img/loader.gif) no-repeat 5px center; }
+#src.error { background: #ff9999 url(img/cross.png) no-repeat 7px center; }
+#src.success { background: #99ff99 url(img/tick.png) no-repeat 7px center; }
+
+/* Dialog specific */
+#link .panel_wrapper, #link div.current { height: 125px; }
+#image .panel_wrapper, #image div.current { height: 200px; }
+#plugintable thead {
+	font-weight:bold;
+	background: #DDD;
+}
+#plugintable, #about #plugintable td { border: 1px solid #919B9C; }
+#plugintable {
+	width: 96%;
+	margin-top: 10px;
+}
+#pluginscontainer {
+	height: 290px;
+	overflow: auto;
+}
+#colorpicker #preview {
+	float: right;
+	width: 50px;
+	height: 14px;
+	line-height: 1px;
+	border: 1px solid black;
+	margin-left: 5px;
+}
+#colorpicker #colors {
+	float: left;
+	border: 1px solid gray;
+	cursor: crosshair;
+}
+#colorpicker #light {
+	border: 1px solid gray;
+	margin-left: 5px;
+	float: left;
+	width: 15px;
+	height: 150px;
+	cursor: crosshair;
+}
+#colorpicker #light div { overflow: hidden; }
+#colorpicker #previewblock {
+	float: right;
+	padding-left: 10px;
+	height: 20px;
+}
+#colorpicker .panel_wrapper div.current { height: 175px; }
+#colorpicker #namedcolors { width: 150px; }
+#colorpicker #namedcolors a {
+	display: block;
+	float: left;
+	width: 10px;
+	height: 10px;
+	margin: 1px 1px 0 0;
+	overflow: hidden;
+}
+#colorpicker #colornamecontainer { margin-top: 5px; }
+#colorpicker #picker_panel fieldset {
+	margin: auto;
+	width: 325px;
+}
+
+/* Browse */
+a.browse span {
+	display: block;
+	width: 20px;
+	height: 18px; background:url(../../img/icons.gif) -860px 0;
+	border: 1px solid #FFF;
+	margin-left: 1px;
+}
+.mceOldBoxModel a.browse span {
+	width: 22px;
+	height: 20px;
+}
+a.browse:hover span {
+	border: 1px solid #0A246A;
+	background-color: #B2BBD0;
+}
+a.browse span.disabled {
+	border: 1px solid white;
+	-moz-opacity: 0.3;
+	opacity: 0.3;
+	filter:progid:DXImageTransform.Microsoft.Alpha(opacity=30);
+}
+a.browse:hover span.disabled {
+	border: 1px solid white;
+	background-color: transparent;
+}
+a.pickcolor span {
+	display: block;
+	width: 20px;
+	height: 16px;
+	background: url(../../img/icons.gif) -840px 0;
+	margin-left: 2px;
+}
+.mceOldBoxModel a.pickcolor span {
+	width: 21px;
+	height: 17px;
+}
+a.pickcolor:hover span { background-color: #B2BBD0; }
+a.pickcolor, a.browse { text-decoration: none; }
Index: admin/js/tiny_mce/themes/advanced/skins/dotclear/ui.css
===================================================================
--- admin/js/tiny_mce/themes/advanced/skins/dotclear/ui.css	(revision 403)
+++ admin/js/tiny_mce/themes/advanced/skins/dotclear/ui.css	(revision 403)
@@ -0,0 +1,542 @@
+/* -----------------------------------*/
+/* Reset */
+.dotclearSkin * {
+	border: 0;
+	margin: 0;
+	padding: 0;
+	background: transparent;
+	white-space: nowrap;
+	text-decoration: none;
+	font-weight: normal;
+	cursor: default;
+	color: #000;
+	vertical-align: baseline;
+	width: auto;
+	border-collapse: separate;
+	text-align: left;
+}
+.dotclearSkin a:hover, .dotclearSkin a:link, .dotclearSkin a:visited, .dotclearSkin a:active {
+	text-decoration: none;
+	font-weight: normal;
+	cursor: default;
+	color: #000;
+}
+.dotclearSkin table td { vertical-align: middle; }
+
+/* -----------------------------------*/
+/* Containers */
+.dotclearSkin table {
+	direction: ltr;
+	background: transparent;
+}
+.dotclearSkin iframe { display: block; }
+.dotclearSkin .mceLeft { text-align: left; }
+.dotclearSkin .mceRight { text-align: right; }
+
+/* -----------------------------------*/
+/* External */
+.dotclearSkin .mceExternalToolbar {
+	position: absolute;
+	border: 1px solid #ccc;
+	border-bottom: none;
+	display: none;
+}
+.dotclearSkin .mceExternalToolbar td.mceToolbar { padding-right: 13px; }
+.dotclearSkin .mceExternalClose {
+	position: absolute;
+	top: 3px;
+	right: 3px;
+	width: 9px;
+	height: 9px;
+	background: url(img/cross.png) no-repeat top left;
+}
+
+/* -----------------------------------*/
+/* Layout */
+.dotclearSkin table.mceLayout {
+	border-left: 1px solid #ccc;
+	border-right: 1px solid #ccc;
+}
+.dotclearSkin table.mceLayout tr.mceFirst td { border-top: 1px solid #ccc; }
+.dotclearSkin table.mceLayout tr.mceLast td { border-bottom: 1px solid #ccc; }
+.dotclearSkin table.mceToolbar, .dotclearSkin tr.mceFirst .mceToolbar tr td, .dotclearSkin tr.mceLast .mceToolbar tr td {
+	border: 0;
+	margin: 0;
+	padding: 0;
+}
+.dotclearSkin td.mceToolbar {
+	background: whiteSmoke;
+	padding: 3px 0 5px 0;
+}
+.dotclearSkin table.mceToolbar { padding: 3px; }
+.dotclearSkin .mceIframeContainer {
+	border-top: 1px solid #ccc;
+	border-bottom: 1px solid #ccc;
+}
+.dotclearSkin .mceStatusbar {
+	background: whiteSmoke;
+	font-family: 'MS Sans Serif',sans-serif,Verdana,Arial;
+	font-size: 9pt;
+	line-height: 16px;
+	overflow: visible;
+	display: block;
+	height: 20px;
+	padding: 3px;
+}
+.dotclearSkin .mceStatusbar div {
+	float: left;
+	padding: 2px;
+}
+.dotclearSkin .mceStatusbar div a,.dotclearSkin .mceStatusbar div a:link, .dotclearSkin .mceStatusbar div a:visited {
+	color: #2373A8;
+	text-decoration: none;
+	border-bottom: 1px dotted #F90;
+}
+.dotclearSkin .mceStatusbar div a:hover { text-decoration: underline; }
+.dotclearSkin .mceStatusbar a.mceResize {
+	border: none;
+	text-decoration: none;
+	display: block;
+	float: right;
+	background: url(img/resizer.png) no-repeat top left;
+	width: 20px;
+	height: 20px;
+	cursor: se-resize;
+	outline: 0;
+}
+.dotclearSkin span.mceIcon, .dotclearSkin img.mceIcon {
+	display: block;
+	width: 20px;
+	height: 20px;
+}
+.dotclearSkin .mceIcon { background: url(img/icons.png) no-repeat 20px 20px; }
+.dotclearSkin td.mceCenter { text-align: center; }
+.dotclearSkin td.mceCenter table {
+	margin: 0 auto;
+	text-align: left;
+}
+.dotclearSkin td.mceRight table { margin: 0 0 0 auto; }
+
+/* -----------------------------------*/
+/* Button */
+.dotclearSkin .mceButton {
+	display: block;
+	border: 1px solid #ccc;
+	background-color: #fff;
+	width: 20px;
+	height: 20px;
+	margin-right: 3px;
+	padding: 2px;
+	-moz-border-radius: 5px;
+	-webkit-border-radius: 5px;
+	-khtml-border-radius: 5px;
+	border-radius: 5px;
+}
+.dotclearSkin a.mceButtonEnabled:hover {
+	border: 1px solid #a2abc0;
+	background-color: #ddd;
+}
+.dotclearSkin a.mceButtonActive, .dotclearSkin a.mceButtonSelected {
+	border: 1px solid #a2abc0;
+	background-color: #99ccff;
+}
+.dotclearSkin .mceButtonDisabled .mceIcon {
+	opacity: 0.3;
+	-ms-filter:'alpha(opacity=30)';
+	filter: alpha(opacity=30);
+}
+.dotclearSkin .mceButtonLabeled { width: auto; }
+.dotclearSkin .mceButtonLabeled span.mceIcon { float: left; }
+.dotclearSkin span.mceButtonLabel {
+	display: block;
+	font-size: 10px; 
+	padding: 4px 6px 0 22px;
+	font-family: Tahoma,Verdana,Arial,Helvetica;
+}
+.dotclearSkin .mceButtonDisabled .mceButtonLabel { color:#888; }
+
+/* -----------------------------------*/
+/* Separator */
+.dotclearSkin .mceSeparator {
+	display: block;
+	width: 10px;
+	height: 20px;
+}
+
+/* -----------------------------------*/
+/* ListBox */
+.dotclearSkin .mceListBox, .dotclearSkin .mceListBox a { display: block; }
+.dotclearSkin .mceListBox .mceText {
+	padding-left: 5px;
+	width: 100px;
+	text-align: left;
+	border: 1px solid #ccc;
+	border-right: none;
+	background: #fff;
+	font-family: Tahoma,Verdana,Arial,Helvetica;
+	font-size: 11px;
+	height: 24px;
+	line-height: 25px;
+	overflow: hidden;
+	-moz-border-radius-bottomleft: 5px;
+	-webkit-border-bottom-left-radius: 5px;
+	-khtml-border-bottom-left-radius: 5px;
+	border-bottom-left-radius: 5px;
+	-moz-border-radius-topleft: 5px;
+	-webkit-border-top-left-radius: 5px;
+	-khtml-border-top-left-radius: 5px;
+	border-top-left-radius: 5px;
+}
+.dotclearSkin .mceListBox .mceOpen {
+	width: 12px;
+	height: 24px;
+	background: #fff url(img/open.png) no-repeat 1px center;
+	border: 1px solid #ccc;
+	margin-right: 3px;
+	-moz-border-radius-bottomright: 5px;
+	-webkit-border-bottom-right-radius: 5px;
+	-khtml-border-bottom-right-radius: 5px;
+	border-bottom-right-radius: 5px;
+	-moz-border-radius-topright: 5px;
+	-webkit-border-top-right-radius: 5px;
+	-khtml-border-top-right-radius: 5px;
+	border-top-right-radius: 5px;
+}
+.dotclearSkin table.mceListBoxEnabled:hover .mceText, .dotcleaSkin .mceListBoxHover .mceText, .dotclearSkin .mceListBoxSelected .mceText {
+	border: 1px solid #a2abc0;
+	border-right: none;
+}
+.dotclearSkin table.mceListBoxEnabled:hover .mceOpen, .dotclearSkin .mceListBoxHover .mceOpen, .dotclearSkin .mceListBoxSelected .mceOpen {
+	background-color: #ccc;
+	border: 1px solid #a2abc0;
+}
+.dotclearSkin .mceListBoxDisabled a.mceText {
+	color: gray;
+	background-color: transparent;
+}
+.dotclearSkin .mceListBoxMenu {
+	overflow: auto;
+	overflow-x: hidden;
+}
+.dotclearSkin .mceOldBoxModel .mceListBox .mceText {
+	height: 22px;
+	padding: 3px;
+}
+.dotclearSkin .mceOldBoxModel .mceListBox .mceOpen {
+	width: 11px;
+	height: 22px;
+}
+.dotclearSkin select.mceNativeListBox {
+	font-family: 'MS Sans Serif',sans-serif,Verdana,Arial;
+	font-size: 7pt;
+	background: #F0F0EE;
+	border: 1px solid gray;
+	margin-right: 2px;
+}
+
+/* -----------------------------------*/
+/* SplitButton */
+.dotclearSkin .mceSplitButton {
+	width: 32px;
+	height: 25px;
+	direction: ltr;
+}
+.dotclearSkin .mceSplitButton a, .dotclearSkin .mceSplitButton span {
+	height: 20px;
+	display: block;
+}
+.dotclearSkin .mceSplitButton a.mceAction {
+	width: 20px;
+	border: 1px solid #ccc;
+	border-right: none;
+	height: 24px;
+	background-color: #fff;
+	-moz-border-radius-bottomleft: 5px;
+	-webkit-border-bottom-left-radius: 5px;
+	-khtml-border-bottom-left-radius: 5px;
+	border-bottom-left-radius: 5px;
+	-moz-border-radius-topleft: 5px;
+	-webkit-border-top-left-radius: 5px;
+	-khtml-border-top-left-radius: 5px;
+	border-top-left-radius: 5px;
+}
+.dotclearSkin .mceSplitButton span.mceAction {
+	width: 20px;
+	background-image: url(img/icons.png);
+}
+.dotclearSkin .mceSplitButton a.mceOpen {
+	width: 12px;
+	height: 24px;
+	background: #fff url(img/open.png) no-repeat 1px center;
+	border: 1px solid #ccc;
+	margin-right: 3px;
+	-moz-border-radius-bottomleft: 5px;
+	-webkit-border-bottom-right-radius: 5px;
+	-khtml-border-bottom-right-radius: 5px;
+	border-bottom-right-radius: 5px;
+	-moz-border-radius-topright: 5px;
+	-webkit-border-top-right-radius: 5px;
+	-khtml-border-top-right-radius: 5px;
+	border-top-right-radius: 5px;
+}
+.dotclearSkin .mceSplitButton span.mceOpen { display:none; }
+.dotclearSkin table.mceSplitButtonEnabled:hover a.mceAction, .dotclearSkin .mceSplitButtonHover a.mceAction, .dotclearSkin .mceSplitButtonSelected a.mceAction {
+	border: 1px solid #a2abc0;
+	border-right: none;
+}
+.dotclearSkin table.mceSplitButtonEnabled:hover a.mceOpen, .dotclearSkin .mceSplitButtonHover a.mceOpen, .dotclearSkin .mceSplitButtonSelected a.mceOpen {
+	background-color: #ccc;
+	border: 1px solid #a2abc0;
+}
+.dotclearSkin .mceSplitButtonDisabled .mceAction, .dotclearSkin .mceSplitButtonDisabled a.mceOpen {
+	opacity: 0.3;
+	-ms-filter: 'alpha(opacity=30)';
+	filter: alpha(opacity=30);
+}
+.dotclearSkin .mceSplitButtonActive a.mceAction {
+	border: 1px solid #a2abc0;
+	background-color: #99ccff;
+}
+.dotclearSkin .mceSplitButtonActive a.mceOpen { border-left: 0; }
+
+/* -----------------------------------*/
+/* ColorSplitButton */
+.dotclearSkin div.mceColorSplitMenu table {
+	background: #FFF;
+	border: 1px solid #a2abc0;
+}
+.dotclearSkin .mceColorSplitMenu td { padding: 2px; }
+.dotclearSkin .mceColorSplitMenu a {
+	display: block;
+	width: 9px;
+	height: 9px;
+	overflow: hidden;
+	border: 1px solid #808080;
+}
+.dotclearSkin .mceColorSplitMenu td.mceMoreColors { padding: 1px 3px 1px 1px; }
+.dotclearSkin .mceColorSplitMenu a.mceMoreColors {
+	width: 100%;
+	height: auto;
+	text-align: center;
+	font-family: Tahoma,Verdana,Arial,Helvetica;
+	font-size: 11px;
+	line-height: 20px;
+	border: 1px solid #FFF;
+}
+.dotclearSkin .mceColorSplitMenu a.mceMoreColors:hover {
+	background-color: #ccc;
+	border: 1px solid #a2abc0;
+}
+.dotclearSkin a.mceMoreColors:hover { border: 1px solid #a2abc0; }
+.dotclearSkin .mceColorPreview {
+	margin-left: 2px;
+	width: 16px;
+	height: 4px;
+	overflow: hidden;
+	background: #9a9b9a;
+}
+.dotclearSkin .mce_forecolor span.mceAction, .dotclearSkin .mce_backcolor span.mceAction {
+	overflow: hidden;
+	height: 16px;
+}
+
+/* -----------------------------------*/
+/* Menu */
+.dotclearSkin .mceMenu {
+	position: absolute;
+	left: 0;
+	top: 0;
+	z-index: 1000;
+	border: 1px solid #D4D0C8;
+}
+.dotclearSkin .mceNoIcons span.mceIcon { width: 0; }
+.dotclearSkin .mceNoIcons a .mceText { padding-left: 10px; }
+.dotclearSkin .mceMenu table { background: #FFF; }
+.dotclearSkin .mceMenu a, .dotclearSkin .mceMenu span, .dotclearSkin .mceMenu { display: block; }
+.dotclearSkin .mceMenu td { height: 20px;}
+.dotclearSkin .mceMenu a {
+	position: relative;
+	padding: 3px 0 4px 0;
+}
+.dotclearSkin .mceMenu .mceText {
+	position: relative;
+	display: block;
+	font-family: Tahoma,Verdana,Arial,Helvetica;
+	color: #000;
+	cursor: default;
+	margin: 0;
+	padding: 0 25px 0 25px;
+	display: block;
+}
+.dotclearSkin .mceMenu span.mceText, .dotclearSkin .mceMenu .mcePreview { font-size: 11px; }
+.dotclearSkin .mceMenu pre.mceText { font-family: Monospace; }
+.dotclearSkin .mceMenu .mceIcon {
+	position: absolute;
+	top: 0;
+	left: 0;
+	width: 22px;
+}
+.dotclearSkin .mceMenu .mceMenuItemEnabled a:hover, .dotclearSkin .mceMenu .mceMenuItemActive { background-color: #dbecf3; }
+.dotclearSkin td.mceMenuItemSeparator {
+	background: #DDD;
+	height:1px;
+}
+.dotclearSkin .mceMenuItemTitle a {
+	border: none;
+	background: #EEE;
+	border-bottom: 1px solid #DDD;
+}
+.dotclearSkin .mceMenuItemTitle span.mceText {
+	color: #000;
+	font-weight: bold;
+	padding-left: 4px;
+}
+.dotclearSkin .mceMenuItemDisabled .mceText { color: #888; }
+.dotclearSkin .mceMenuItemSelected .mceIcon { background: url(img/menu_check.gif); }
+.dotclearSkin .mceNoIcons .mceMenuItemSelected a { background: url(img/menu_arrow.gif) no-repeat -6px center; }
+.dotclearSkin .mceMenu span.mceMenuLine { display: none; }
+.dotclearSkin .mceMenuItemSub a { background: url(img/menu_arrow.gif) no-repeat top right; }
+
+/* -----------------------------------*/
+/* Progress,Resize */
+.dotclearSkin .mceBlocker {
+	position: absolute;
+	left: 0;
+	top: 0;
+	z-index: 1000;
+	opacity: 0.5;
+	-ms-filter: 'alpha(opacity=50)';
+	filter: alpha(opacity=50);
+	background: #FFF;
+}
+.dotclearSkin .mceProgress {
+	position: absolute;
+	left: 0;
+	top: 0;
+	z-index: 1001;
+	background: url(img/progress.gif) no-repeat;
+	width: 32px;
+	height: 32px;
+	margin: -16px 0 0 -16px;
+}
+
+/* -----------------------------------*/
+/* Formats */
+.dotclearSkin .mce_formatPreview a { font-size: 10px; }
+.dotclearSkin .mce_p span.mceText {}
+.dotclearSkin .mce_address span.mceText { font-style: italic; }
+.dotclearSkin .mce_pre span.mceText { font-family: monospace;}
+.dotclearSkin .mce_h1 span.mceText {
+	font-weight: bold;
+	font-size: 2em;
+}
+.dotclearSkin .mce_h2 span.mceText {
+	font-weight: bold;
+	font-size: 1.5em;
+}
+.dotclearSkin .mce_h3 span.mceText {
+	font-weight: bold;
+	font-size: 1.17em;
+}
+.dotclearSkin .mce_h4 span.mceText {
+	font-weight: bold;
+	font-size: 1em;
+}
+.dotclearSkin .mce_h5 span.mceText {
+	font-weight: bold;
+	font-size: .83em;
+}
+.dotclearSkin .mce_h6 span.mceText {
+	font-weight: bold;
+	font-size: .75em;
+}
+
+/* -----------------------------------*/
+/* Theme & plugins */
+.dotclearSkin .mce_abbr{ background-position: 0 0; }
+.dotclearSkin .mce_absolute{ background-position: -20px 0; }
+.dotclearSkin .mce_acronym{ background-position: -40px 0; }
+.dotclearSkin .mce_advhr{ background-position: -60px 0; }
+.dotclearSkin .mce_anchor{ background-position: -80px 0; }
+.dotclearSkin .mce_attribs{ background-position: -100px 0; }
+.dotclearSkin .mce_backcolor, .dotclearSkin .mce_backcolorpicker{ background-position: -120px 0; }
+.dotclearSkin .mce_backward, .dotclearSkin .mce_movebackward{ background-position: -140px 0; }
+.dotclearSkin .mce_blockquote{ background-position: -160px 0; }
+.dotclearSkin .mce_bold{ background-position: -180px 0; }
+.dotclearSkin .mce_bullist{ background-position: -200px 0; }
+.dotclearSkin .mce_cancel{ background-position: -220px 0; }
+.dotclearSkin .mce_cell_props{ background-position: -240px 0; }
+.dotclearSkin .mce_charmap{ background-position: -260px 0; }
+.dotclearSkin .mce_cite, .dotclearSkin .mce_quote{ background-position: -280px 0; }
+.dotclearSkin .mce_cleanup{ background-position: -300px 0; }
+.dotclearSkin .mce_code{ background-position: -320px 0; }
+.dotclearSkin .mce_col_after{ background-position: -340px 0; }
+.dotclearSkin .mce_col_before{ background-position: -360px 0; }
+.dotclearSkin .mce_copy{ background-position: -380px 0; }
+.dotclearSkin .mce_cut{ background-position: -400px 0; }
+.dotclearSkin .mce_del, .dotclearSkin .mce_strikethrough{ background-position: -420px 0; }
+.dotclearSkin .mce_delete_col{ background-position: -440px 0; }
+.dotclearSkin .mce_delete_row{ background-position: -460px 0; }
+.dotclearSkin .mce_delete_table{ background-position: -480px 0; }
+.dotclearSkin .mce_edit-size{ background-position: -500px 0; }
+.dotclearSkin .mce_emotions{ background-position: -520px 0; }
+.dotclearSkin .mce_film{ background-position: -540px 0; }
+.dotclearSkin .mce_forecolor, .dotclearSkin .mce_forecolorpicker{ background-position: -560px 0; }
+.dotclearSkin .mce_forward, .dotclearSkin .mce_moveforward{ background-position: -580px 0; }
+.dotclearSkin .mce_fullscreen{ background-position: -600px 0; }
+.dotclearSkin .mce_help{ background-position: -620px 0; }
+.dotclearSkin .mce_hr{ background-position: -640px 0; }
+.dotclearSkin .mce_iespell, .dotclearSkin .mce_spellchecker{ background-position: -660px 0; }
+.dotclearSkin .mce_image{ background-position: -680px 0; }
+.dotclearSkin .mce_indent{ background-position: -700px 0; }
+.dotclearSkin .mce_inlinecode{ background-position: -720px 0; }
+.dotclearSkin .mce_ins, .dotclearSkin .mce_underline{ background-position: -740px 0; }
+.dotclearSkin .mce_insert_layer, .dotclearSkin .mce_insertlayer{ background-position: -760px 0; }
+.dotclearSkin .mce_insertdate{ background-position: -780px 0; }
+.dotclearSkin .mce_insertfile{ background-position: -800px 0; }
+.dotclearSkin .mce_insertimage{ background-position: -820px 0; }
+.dotclearSkin .mce_inserttime{ background-position: -840px 0; }
+.dotclearSkin .mce_italic{ background-position: -860px 0; }
+.dotclearSkin .mce_justifycenter{ background-position: -880px 0; }
+.dotclearSkin .mce_justifyfull{ background-position: -900px 0; }
+.dotclearSkin .mce_justifyleft{ background-position: -920px 0; }
+.dotclearSkin .mce_justifyright{ background-position: -940px 0; }
+.dotclearSkin .mce_link{ background-position: -960px 0; }
+.dotclearSkin .mce_ltr{ background-position: -980px 0; }
+.dotclearSkin .mce_media{ background-position: -1000px 0; }
+.dotclearSkin .mce_merge_cells{ background-position: -1020px 0; }
+.dotclearSkin .mce_newdocument{ background-position: -1040px 0; }
+.dotclearSkin .mce_nonbreaking{ background-position: -1060px 0; }
+.dotclearSkin .mce_numlist{ background-position: -1080px 0; }
+.dotclearSkin .mce_outdent{ background-position: -1100px 0; }
+.dotclearSkin .mce_pagebreak{ background-position: -1120px 0; }
+.dotclearSkin .mce_paste{ background-position: -1140px 0; }
+.dotclearSkin .mce_pastetext{ background-position: -1160px 0; }
+.dotclearSkin .mce_pasteword{ background-position: -1180px 0; }
+.dotclearSkin .mce_preview{ background-position: -1200px 0; }
+.dotclearSkin .mce_print{ background-position: -1220px 0; }
+.dotclearSkin .mce_redo{ background-position: -1240px 0; }
+.dotclearSkin .mce_removeformat{ background-position: -1260px 0; }
+.dotclearSkin .mce_replace{ background-position: -1280px 0; }
+.dotclearSkin .mce_restoredraft{ background-position: -1300px 0; }
+.dotclearSkin .mce_row_after{ background-position: -1320px 0; }
+.dotclearSkin .mce_row_before{ background-position: -1340px 0; }
+.dotclearSkin .mce_row_props{ background-position: -1360px 0; }
+.dotclearSkin .mce_rtl{ background-position: -1380px 0; }
+.dotclearSkin .mce_save{ background-position: -1400px 0; }
+.dotclearSkin .mce_search{ background-position: -1420px 0; }
+.dotclearSkin .mce_selectall{ background-position: -1440px 0; }
+.dotclearSkin .mce_split_cells{ background-position: -1460px 0; }
+.dotclearSkin .mce_styleprops{ background-position: -1480px 0; }
+.dotclearSkin .mce_sub{ background-position: -1500px 0; }
+.dotclearSkin .mce_sup{ background-position: -1520px 0; }
+.dotclearSkin .mce_table{ background-position: -1540px 0; }
+.dotclearSkin .mce_table_props{ background-position: -1560px 0; }
+.dotclearSkin .mce_tablecontrols{ background-position: -1580px 0; }
+.dotclearSkin .mce_tag{ background-position: -1600px 0; }
+.dotclearSkin .mce_template{ background-position: -1620px 0; }
+.dotclearSkin .mce_undo{ background-position: -1640px 0; }
+.dotclearSkin .mce_unlink{ background-position: -1660px 0; }
+.dotclearSkin .mce_visualaid{ background-position: -1680px 0; }
+.dotclearSkin .mce_visualchars{ background-position: -1700px 0; }
+.dotclearSkin .mce_webmedia{ background-position: -1720px 0; }
Index: admin/js/tiny_mce/themes/advanced/skins/highcontrast/content.css
===================================================================
--- admin/js/tiny_mce/themes/advanced/skins/highcontrast/content.css	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/skins/highcontrast/content.css	(revision 307)
@@ -0,0 +1,23 @@
+body, td, pre { margin:8px;}
+body.mceForceColors {background:#FFF; color:#000;}
+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: .75em}
+.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
+a.mceItemAnchor {display:inline-block; width:11px !important; height:11px  !important; background:url(../default/img/items.gif) no-repeat 0 0;}
+span.mceItemNbsp {background: #DDD}
+td.mceSelected, th.mceSelected {background-color:#3399ff !important}
+img {border:0;}
+table {cursor:default}
+table td, table th {cursor:text}
+ins {border-bottom:1px solid green; text-decoration: none; color:green}
+del {color:red; text-decoration:line-through}
+cite {border-bottom:1px dashed blue}
+acronym {border-bottom:1px dotted #CCC; cursor:help}
+abbr {border-bottom:1px dashed #CCC; cursor:help}
+
+img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
+font[face=mceinline] {font-family:inherit !important}
Index: admin/js/tiny_mce/themes/advanced/skins/highcontrast/dialog.css
===================================================================
--- admin/js/tiny_mce/themes/advanced/skins/highcontrast/dialog.css	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/skins/highcontrast/dialog.css	(revision 307)
@@ -0,0 +1,105 @@
+/* Generic */
+body {
+font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
+background:#F0F0EE;
+color: black;
+padding:0;
+margin:8px 8px 0 8px;
+}
+
+html {background:#F0F0EE; color:#000;}
+td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+textarea {resize:none;outline:none;}
+a:link, a:visited {color:black;background-color:transparent;}
+a:hover {color:#2B6FB6;background-color:transparent;}
+.nowrap {white-space: nowrap}
+
+/* Forms */
+fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
+legend {color:#2B6FB6; font-weight:bold;}
+label.msg {display:none;}
+label.invalid {color:#EE0000; display:inline;background-color:transparent;}
+input.invalid {border:1px solid #EE0000;background-color:transparent;}
+input {background:#FFF; border:1px solid #CCC;color:black;}
+input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+input, select, textarea {border:1px solid #808080;}
+input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
+input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
+.input_noborder {border:0;}
+
+/* Buttons */
+#insert, #cancel, input.button, .updateButton {
+font-weight:bold;
+width:94px; height:23px;
+cursor:pointer;
+padding-bottom:2px;
+float:left;
+}
+
+#cancel {float:right}
+
+/* Browse */
+a.pickcolor, a.browse {text-decoration:none}
+a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}
+.mceOldBoxModel a.browse span {width:22px; height:20px;}
+a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
+a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
+a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
+a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}
+.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
+a.pickcolor:hover span {background-color:#B2BBD0;}
+a.pickcolor:hover span.disabled {}
+
+/* Charmap */
+table.charmap {border:1px solid #AAA; text-align:center}
+td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
+#charmap a {display:block; color:#000; text-decoration:none; border:0}
+#charmap a:hover {background:#CCC;color:#2B6FB6}
+#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
+#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
+
+/* Source */
+.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
+.mceActionPanel {margin-top:5px;}
+
+/* Tabs classes */
+.tabs {width:100%; height:18px; line-height:normal;}
+.tabs ul {margin:0; padding:0; list-style:none;}
+.tabs li {float:left; border: 1px solid black; border-bottom:0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block; cursor:pointer;}
+.tabs li.current {font-weight: bold; margin-right:2px;}
+.tabs span {float:left; display:block; padding:0px 10px 0 0;}
+.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
+.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
+
+/* Panels */
+.panel_wrapper div.panel {display:none;}
+.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
+.panel_wrapper {border:1px solid #919B9C; padding:10px; padding-top:5px; clear:both; background:white;}
+
+/* Columns */
+.column {float:left;}
+.properties {width:100%;}
+.properties .column1 {}
+.properties .column2 {text-align:left;}
+
+/* Titles */
+h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
+h3 {font-size:14px;}
+.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
+
+/* Dialog specific */
+#link .panel_wrapper, #link div.current {height:125px;}
+#image .panel_wrapper, #image div.current {height:200px;}
+#plugintable thead {font-weight:bold; background:#DDD;}
+#plugintable, #about #plugintable td {border:1px solid #919B9C;}
+#plugintable {width:96%; margin-top:10px;}
+#pluginscontainer {height:290px; overflow:auto;}
+#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
+#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
+#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
+#colorpicker #light div {overflow:hidden;}
+#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
+#colorpicker .panel_wrapper div.current {height:175px;}
+#colorpicker #namedcolors {width:150px;}
+#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
+#colorpicker #colornamecontainer {margin-top:5px;}
Index: admin/js/tiny_mce/themes/advanced/skins/highcontrast/ui.css
===================================================================
--- admin/js/tiny_mce/themes/advanced/skins/highcontrast/ui.css	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/skins/highcontrast/ui.css	(revision 307)
@@ -0,0 +1,101 @@
+/* Reset */
+.highcontrastSkin table, .highcontrastSkin tbody, .highcontrastSkin a, .highcontrastSkin img, .highcontrastSkin tr, .highcontrastSkin div, .highcontrastSkin td, .highcontrastSkin iframe, .highcontrastSkin span, .highcontrastSkin *, .highcontrastSkin .mceText {border:0; margin:0; padding:0; vertical-align:baseline; border-collapse:separate;}
+.highcontrastSkin a:hover, .highcontrastSkin a:link, .highcontrastSkin a:visited, .highcontrastSkin a:active {text-decoration:none; font-weight:normal; cursor:default;}
+.highcontrastSkin table td {vertical-align:middle}
+
+.highcontrastSkin .mceIconOnly {display: block !important;}
+
+/* External */
+.highcontrastSkin .mceExternalToolbar {position:absolute; border:1px solid; border-bottom:0; display:none; background-color: white;}
+.highcontrastSkin .mceExternalToolbar td.mceToolbar {padding-right:13px;}
+.highcontrastSkin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px;}
+
+/* Layout */
+.highcontrastSkin table.mceLayout {border: 1px solid;}
+.highcontrastSkin .mceIframeContainer {border-top:1px solid; border-bottom:1px solid}
+.highcontrastSkin .mceStatusbar a:hover {text-decoration:underline}
+.highcontrastSkin .mceStatusbar {display:block; line-height:1.5em; overflow:visible;}
+.highcontrastSkin .mceStatusbar div {float:left}
+.highcontrastSkin .mceStatusbar a.mceResize {display:block; float:right; width:20px; height:20px; cursor:se-resize; outline:0}
+
+.highcontrastSkin .mceToolbar td { display: inline-block; float: left;}
+.highcontrastSkin .mceToolbar tr { display: block;}
+.highcontrastSkin .mceToolbar table { display: block; }
+
+/* Button */
+
+.highcontrastSkin .mceButton { display:block; margin: 2px; padding: 5px 10px;border: 1px solid; border-radius: 3px; -moz-border-radius: 3px; -webkit-border-radius: 3px; -ms-border-radius: 3px; height: 2em;}
+.highcontrastSkin .mceButton .mceVoiceLabel { height: 100%; vertical-align: center; line-height: 2em}
+.highcontrastSkin .mceButtonDisabled .mceVoiceLabel { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);}
+.highcontrastSkin .mceButtonActive, .highcontrastSkin .mceButton:focus, .highcontrastSkin .mceButton:active { border: 5px solid; padding: 1px 6px;-webkit-focus-ring-color:none;outline:none;}
+
+/* Separator */
+.highcontrastSkin .mceSeparator {display:block; width:16px; height:26px;}
+
+/* ListBox */
+.highcontrastSkin .mceListBox { display: block; margin:2px;-webkit-focus-ring-color:none;outline:none;}
+.highcontrastSkin .mceListBox .mceText {padding: 5px 6px;  line-height: 2em; width: 15ex; overflow: hidden;}
+.highcontrastSkin .mceListBoxDisabled .mceText { opacity:0.6; -ms-filter:'alpha(opacity=60)'; filter:alpha(opacity=60);}
+.highcontrastSkin .mceListBox a.mceText { padding: 5px 10px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;}
+.highcontrastSkin .mceListBox a.mceOpen { padding: 5px 4px; display: block; height: 2em; line-height: 2em; border: 1px solid; border-left: 0; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;}
+.highcontrastSkin .mceListBox:focus a.mceText, .highcontrastSkin .mceListBox:active a.mceText { border-width: 5px; padding: 1px 10px 1px 6px;}
+.highcontrastSkin .mceListBox:focus a.mceOpen, .highcontrastSkin .mceListBox:active a.mceOpen { border-width: 5px; padding: 1px 0px 1px 4px;}
+
+.highcontrastSkin .mceListBoxMenu {overflow-y:auto}
+
+/* SplitButton */
+.highcontrastSkin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
+
+.highcontrastSkin .mceSplitButton { border-collapse: collapse; margin: 2px; height: 2em; line-height: 2em;-webkit-focus-ring-color:none;outline:none;}
+.highcontrastSkin .mceSplitButton td { display: table-cell; float: none; margin: 0; padding: 0; height: 2em;}
+.highcontrastSkin .mceSplitButton tr { display: table-row; }
+.highcontrastSkin table.mceSplitButton  { display: table; }
+.highcontrastSkin .mceSplitButton a.mceAction { padding: 5px 10px; display: block; height: 2em; line-height: 2em; overflow: hidden; border: 1px solid; border-right: 0; border-radius: 3px 0px 0px 3px; -moz-border-radius: 3px 0px 0px 3px; -webkit-border-radius: 3px 0px 0px 3px; -ms-border-radius: 3px 0px 0px 3px;}
+.highcontrastSkin .mceSplitButton a.mceOpen { padding: 5px 4px;  display: block; height: 2em; line-height: 2em; border: 1px solid; border-radius: 0px 3px 3px 0px; -moz-border-radius: 0px 3px 3px 0px; -webkit-border-radius: 0px 3px 3px 0px; -ms-border-radius: 0px 3px 3px 0px;}
+.highcontrastSkin .mceSplitButton .mceVoiceLabel { height: 2em; vertical-align: center; line-height: 2em; } 
+.highcontrastSkin .mceSplitButton:focus a.mceAction, .highcontrastSkin .mceSplitButton:active a.mceAction { border-width: 5px; border-right-width: 1px; padding: 1px 10px 1px 6px;-webkit-focus-ring-color:none;outline:none;}
+.highcontrastSkin .mceSplitButton:focus a.mceOpen, .highcontrastSkin .mceSplitButton:active a.mceOpen { border-width: 5px; border-left-width: 1px; padding: 1px 0px 1px 4px;-webkit-focus-ring-color:none;outline:none;}
+
+/* Menu */
+.highcontrastSkin .mceNoIcons span.mceIcon {width:0;}
+.highcontrastSkin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid; }
+.highcontrastSkin .mceMenu table {background:white; color: black}
+.highcontrastSkin .mceNoIcons a .mceText {padding-left:10px}
+.highcontrastSkin .mceMenu a, .highcontrastSkin .mceMenu span, .highcontrastSkin .mceMenu {display:block;background:white; color: black}
+.highcontrastSkin .mceMenu td {height:2em}
+.highcontrastSkin .mceMenu a {position:relative;padding:3px 0 4px 0; display: block;}
+.highcontrastSkin .mceMenu .mceText {position:relative; display:block; cursor:default; margin:0; padding:0 25px 0 25px;}
+.highcontrastSkin .mceMenu pre.mceText {font-family:Monospace}
+.highcontrastSkin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:26px;}
+.highcontrastSkin td.mceMenuItemSeparator {border-top:1px solid; height:1px}
+.highcontrastSkin .mceMenuItemTitle a {border:0; border-bottom:1px solid}
+.highcontrastSkin .mceMenuItemTitle span.mceText {font-weight:bold; padding-left:4px}
+.highcontrastSkin .mceNoIcons .mceMenuItemSelected span.mceText:before {content: "\2713\A0";}
+.highcontrastSkin .mceMenu span.mceMenuLine {display:none}
+.highcontrastSkin .mceMenuItemSub a .mceText:after {content: "\A0\25B8"}
+
+/* ColorSplitButton */
+.highcontrastSkin div.mceColorSplitMenu table {background:#FFF; border:1px solid; color: #000}
+.highcontrastSkin .mceColorSplitMenu td {padding:2px}
+.highcontrastSkin .mceColorSplitMenu a {display:block; width:16px; height:16px; overflow:hidden; color:#000; margin: 0; padding: 0;}
+.highcontrastSkin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}
+.highcontrastSkin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}
+.highcontrastSkin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid; background-color:#B6BDD2}
+.highcontrastSkin a.mceMoreColors:hover {border:1px solid #0A246A; color: #000;}
+.highcontrastSkin .mceColorPreview {display:none;}
+.highcontrastSkin .mce_forecolor span.mceAction, .highcontrastSkin .mce_backcolor span.mceAction {height:17px;overflow:hidden}
+
+/* Progress,Resize */
+.highcontrastSkin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF}
+.highcontrastSkin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
+
+/* Formats */
+.highcontrastSkin .mce_p span.mceText {}
+.highcontrastSkin .mce_address span.mceText {font-style:italic}
+.highcontrastSkin .mce_pre span.mceText {font-family:monospace}
+.highcontrastSkin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}
+.highcontrastSkin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}
+.highcontrastSkin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}
+.highcontrastSkin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}
+.highcontrastSkin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}
+.highcontrastSkin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}
Index: admin/js/tiny_mce/themes/advanced/skins/o2k7/content.css
===================================================================
--- admin/js/tiny_mce/themes/advanced/skins/o2k7/content.css	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/skins/o2k7/content.css	(revision 307)
@@ -0,0 +1,46 @@
+body, td, pre {color:#000; font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px; margin:8px;}
+body {background:#FFF;}
+body.mceForceColors {background:#FFF; color:#000;}
+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: .75em}
+.mceItemTable, .mceItemTable td, .mceItemTable th, .mceItemTable caption, .mceItemVisualAid {border: 1px dashed #BBB;}
+a.mceItemAnchor {display:inline-block; width:11px !important; height:11px  !important; background:url(../default/img/items.gif) no-repeat 0 0;}
+span.mceItemNbsp {background: #DDD}
+td.mceSelected, th.mceSelected {background-color:#3399ff !important}
+img {border:0;}
+table {cursor:default}
+table td, table th {cursor:text}
+ins {border-bottom:1px solid green; text-decoration: none; color:green}
+del {color:red; text-decoration:line-through}
+cite {border-bottom:1px dashed blue}
+acronym {border-bottom:1px dotted #CCC; cursor:help}
+abbr {border-bottom:1px dashed #CCC; cursor:help}
+
+/* IE */
+* html body {
+scrollbar-3dlight-color:#F0F0EE;
+scrollbar-arrow-color:#676662;
+scrollbar-base-color:#F0F0EE;
+scrollbar-darkshadow-color:#DDD;
+scrollbar-face-color:#E0E0DD;
+scrollbar-highlight-color:#F0F0EE;
+scrollbar-shadow-color:#F0F0EE;
+scrollbar-track-color:#F5F5F5;
+}
+
+img:-moz-broken {-moz-force-broken-image-icon:1; width:24px; height:24px}
+font[face=mceinline] {font-family:inherit !important}
+
+.mceItemMedia {border:1px dotted #cc0000; background-position:center; background-repeat:no-repeat; background-color:#ffffcc}
+.mceItemShockWave {background-image:url(../../img/shockwave.gif)}
+.mceItemFlash {background-image:url(../../img/flash.gif)}
+.mceItemQuickTime {background-image:url(../../img/quicktime.gif)}
+.mceItemWindowsMedia {background-image:url(../../img/windowsmedia.gif)}
+.mceItemRealMedia {background-image:url(../../img/realmedia.gif)}
+.mceItemVideo {background-image:url(../../img/video.gif)}
+.mceItemIframe {background-image:url(../../img/iframe.gif)}
+.mcePageBreak {display:block;border:0;width:100%;height:12px;border-top:1px dotted #ccc;margin-top:15px;background:#fff url(../../img/pagebreak.gif) no-repeat center top;}
Index: admin/js/tiny_mce/themes/advanced/skins/o2k7/dialog.css
===================================================================
--- admin/js/tiny_mce/themes/advanced/skins/o2k7/dialog.css	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/skins/o2k7/dialog.css	(revision 307)
@@ -0,0 +1,117 @@
+/* Generic */
+body {
+font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px;
+scrollbar-3dlight-color:#F0F0EE;
+scrollbar-arrow-color:#676662;
+scrollbar-base-color:#F0F0EE;
+scrollbar-darkshadow-color:#DDDDDD;
+scrollbar-face-color:#E0E0DD;
+scrollbar-highlight-color:#F0F0EE;
+scrollbar-shadow-color:#F0F0EE;
+scrollbar-track-color:#F5F5F5;
+background:#F0F0EE;
+padding:0;
+margin:8px 8px 0 8px;
+}
+
+html {background:#F0F0EE;}
+td {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+textarea {resize:none;outline:none;}
+a:link, a:visited {color:black;}
+a:hover {color:#2B6FB6;}
+.nowrap {white-space: nowrap}
+
+/* Forms */
+fieldset {margin:0; padding:4px; border:1px solid #919B9C; font-family:Verdana, Arial; font-size:10px;}
+legend {color:#2B6FB6; font-weight:bold;}
+label.msg {display:none;}
+label.invalid {color:#EE0000; display:inline;}
+input.invalid {border:1px solid #EE0000;}
+input {background:#FFF; border:1px solid #CCC;}
+input, select, textarea {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+input, select, textarea {border:1px solid #808080;}
+input.radio {border:1px none #000000; background:transparent; vertical-align:middle;}
+input.checkbox {border:1px none #000000; background:transparent; vertical-align:middle;}
+.input_noborder {border:0;}
+
+/* Buttons */
+#insert, #cancel, input.button, .updateButton {
+border:0; margin:0; padding:0;
+font-weight:bold;
+width:94px; height:26px;
+background:url(../default/img/buttons.png) 0 -26px;
+cursor:pointer;
+padding-bottom:2px;
+float:left;
+}
+
+#insert {background:url(../default/img/buttons.png) 0 -52px}
+#cancel {background:url(../default/img/buttons.png) 0 0; float:right}
+
+/* Browse */
+a.pickcolor, a.browse {text-decoration:none}
+a.browse span {display:block; width:20px; height:18px; background:url(../../img/icons.gif) -860px 0; border:1px solid #FFF; margin-left:1px;}
+.mceOldBoxModel a.browse span {width:22px; height:20px;}
+a.browse:hover span {border:1px solid #0A246A; background-color:#B2BBD0;}
+a.browse span.disabled {border:1px solid white; opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
+a.browse:hover span.disabled {border:1px solid white; background-color:transparent;}
+a.pickcolor span {display:block; width:20px; height:16px; background:url(../../img/icons.gif) -840px 0; margin-left:2px;}
+.mceOldBoxModel a.pickcolor span {width:21px; height:17px;}
+a.pickcolor:hover span {background-color:#B2BBD0;}
+a.pickcolor:hover span.disabled {}
+
+/* Charmap */
+table.charmap {border:1px solid #AAA; text-align:center}
+td.charmap, #charmap a {width:18px; height:18px; color:#000; border:1px solid #AAA; text-align:center; font-size:12px; vertical-align:middle; line-height: 18px;}
+#charmap a {display:block; color:#000; text-decoration:none; border:0}
+#charmap a:hover {background:#CCC;color:#2B6FB6}
+#charmap #codeN {font-size:10px; font-family:Arial,Helvetica,sans-serif; text-align:center}
+#charmap #codeV {font-size:40px; height:80px; border:1px solid #AAA; text-align:center}
+
+/* Source */
+.wordWrapCode {vertical-align:middle; border:1px none #000000; background:transparent;}
+.mceActionPanel {margin-top:5px;}
+
+/* Tabs classes */
+.tabs {width:100%; height:18px; line-height:normal; background:url(../default/img/tabs.gif) repeat-x 0 -72px;}
+.tabs ul {margin:0; padding:0; list-style:none;}
+.tabs li {float:left; background:url(../default/img/tabs.gif) no-repeat 0 0; margin:0 2px 0 0; padding:0 0 0 10px; line-height:17px; height:18px; display:block;}
+.tabs li.current {background:url(../default/img/tabs.gif) no-repeat 0 -18px; margin-right:2px;}
+.tabs span {float:left; display:block; background:url(../default/img/tabs.gif) no-repeat right -36px; padding:0px 10px 0 0;}
+.tabs .current span {background:url(../default/img/tabs.gif) no-repeat right -54px;}
+.tabs a {text-decoration:none; font-family:Verdana, Arial; font-size:10px;}
+.tabs a:link, .tabs a:visited, .tabs a:hover {color:black;}
+
+/* Panels */
+.panel_wrapper div.panel {display:none;}
+.panel_wrapper div.current {display:block; width:100%; height:300px; overflow:visible;}
+.panel_wrapper {border:1px solid #919B9C; border-top:0px; padding:10px; padding-top:5px; clear:both; background:white;}
+
+/* Columns */
+.column {float:left;}
+.properties {width:100%;}
+.properties .column1 {}
+.properties .column2 {text-align:left;}
+
+/* Titles */
+h1, h2, h3, h4 {color:#2B6FB6; margin:0; padding:0; padding-top:5px;}
+h3 {font-size:14px;}
+.title {font-size:12px; font-weight:bold; color:#2B6FB6;}
+
+/* Dialog specific */
+#link .panel_wrapper, #link div.current {height:125px;}
+#image .panel_wrapper, #image div.current {height:200px;}
+#plugintable thead {font-weight:bold; background:#DDD;}
+#plugintable, #about #plugintable td {border:1px solid #919B9C;}
+#plugintable {width:96%; margin-top:10px;}
+#pluginscontainer {height:290px; overflow:auto;}
+#colorpicker #preview {float:right; width:50px; height:14px;line-height:1px; border:1px solid black; margin-left:5px;}
+#colorpicker #colors {float:left; border:1px solid gray; cursor:crosshair;}
+#colorpicker #light {border:1px solid gray; margin-left:5px; float:left;width:15px; height:150px; cursor:crosshair;}
+#colorpicker #light div {overflow:hidden;}
+#colorpicker #previewblock {float:right; padding-left:10px; height:20px;}
+#colorpicker .panel_wrapper div.current {height:175px;}
+#colorpicker #namedcolors {width:150px;}
+#colorpicker #namedcolors a {display:block; float:left; width:10px; height:10px; margin:1px 1px 0 0; overflow:hidden;}
+#colorpicker #colornamecontainer {margin-top:5px;}
+#colorpicker #picker_panel fieldset {margin:auto;width:325px;}
Index: admin/js/tiny_mce/themes/advanced/skins/o2k7/ui.css
===================================================================
--- admin/js/tiny_mce/themes/advanced/skins/o2k7/ui.css	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/skins/o2k7/ui.css	(revision 307)
@@ -0,0 +1,216 @@
+/* Reset */
+.o2k7Skin table, .o2k7Skin tbody, .o2k7Skin a, .o2k7Skin img, .o2k7Skin tr, .o2k7Skin div, .o2k7Skin td, .o2k7Skin iframe, .o2k7Skin span, .o2k7Skin *, .o2k7Skin .mceText {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000; vertical-align:baseline; width:auto; border-collapse:separate; text-align:left}
+.o2k7Skin a:hover, .o2k7Skin a:link, .o2k7Skin a:visited, .o2k7Skin a:active {text-decoration:none; font-weight:normal; cursor:default; color:#000}
+.o2k7Skin table td {vertical-align:middle}
+
+/* Containers */
+.o2k7Skin table {background:transparent}
+.o2k7Skin iframe {display:block;}
+.o2k7Skin .mceToolbar {height:26px}
+
+/* External */
+.o2k7Skin .mceExternalToolbar {position:absolute; border:1px solid #ABC6DD; border-bottom:0; display:none}
+.o2k7Skin .mceExternalToolbar td.mceToolbar {padding-right:13px;}
+.o2k7Skin .mceExternalClose {position:absolute; top:3px; right:3px; width:7px; height:7px; background:url(../../img/icons.gif) -820px 0}
+
+/* Layout */
+.o2k7Skin table.mceLayout {border:0; border-left:1px solid #ABC6DD; border-right:1px solid #ABC6DD}
+.o2k7Skin table.mceLayout tr.mceFirst td {border-top:1px solid #ABC6DD}
+.o2k7Skin table.mceLayout tr.mceLast td {border-bottom:1px solid #ABC6DD}
+.o2k7Skin table.mceToolbar, .o2k7Skin tr.mceFirst .mceToolbar tr td, .o2k7Skin tr.mceLast .mceToolbar tr td {border:0; margin:0; padding:0}
+.o2k7Skin .mceIframeContainer {border-top:1px solid #ABC6DD; border-bottom:1px solid #ABC6DD}
+.o2k7Skin td.mceToolbar{background:#E5EFFD}
+.o2k7Skin .mceStatusbar {background:#E5EFFD; display:block; font-family:'MS Sans Serif',sans-serif,Verdana,Arial; font-size:9pt; line-height:16px; overflow:visible; color:#000; height:20px}
+.o2k7Skin .mceStatusbar div {float:left; padding:2px}
+.o2k7Skin .mceStatusbar a.mceResize {display:block; float:right; background:url(../../img/icons.gif) -800px 0; width:20px; height:20px; cursor:se-resize; outline:0}
+.o2k7Skin .mceStatusbar a:hover {text-decoration:underline}
+.o2k7Skin table.mceToolbar {margin-left:3px}
+.o2k7Skin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; margin-left:3px;}
+.o2k7Skin .mceToolbar td.mceFirst span {margin:0}
+.o2k7Skin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px}
+.o2k7Skin .mceToolbar .mceToolbarEndListBox span, .o2k7Skin .mceToolbar .mceToolbarStartListBox span {display:none}
+.o2k7Skin span.mceIcon, .o2k7Skin img.mceIcon {display:block; width:20px; height:20px}
+.o2k7Skin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}
+.o2k7Skin td.mceCenter {text-align:center;}
+.o2k7Skin td.mceCenter table {margin:0 auto; text-align:left;}
+.o2k7Skin td.mceRight table {margin:0 0 0 auto;}
+
+/* Button */
+.o2k7Skin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px}
+.o2k7Skin a.mceButton span, .o2k7Skin a.mceButton img {margin-left:1px}
+.o2k7Skin .mceOldBoxModel a.mceButton span, .o2k7Skin .mceOldBoxModel a.mceButton img {margin:0 0 0 1px}
+.o2k7Skin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px}
+.o2k7Skin a.mceButtonActive, .o2k7Skin a.mceButtonSelected {background-position:0 -44px}
+.o2k7Skin .mceButtonDisabled .mceIcon {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
+.o2k7Skin .mceButtonLabeled {width:auto}
+.o2k7Skin .mceButtonLabeled span.mceIcon {float:left}
+.o2k7Skin span.mceButtonLabel {display:block; font-size:10px; padding:4px 6px 0 22px; font-family:Tahoma,Verdana,Arial,Helvetica}
+.o2k7Skin .mceButtonDisabled .mceButtonLabel {color:#888}
+
+/* Separator */
+.o2k7Skin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}
+
+/* ListBox */
+.o2k7Skin .mceListBox {margin-left:3px}
+.o2k7Skin .mceListBox, .o2k7Skin .mceListBox a {display:block}
+.o2k7Skin .mceListBox .mceText {padding-left:4px; text-align:left; width:70px; border:1px solid #b3c7e1; border-right:0; background:#eaf2fb; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; height:20px; line-height:20px; overflow:hidden}
+.o2k7Skin .mceListBox .mceOpen {width:14px; height:22px; background:url(img/button_bg.png) -66px 0}
+.o2k7Skin table.mceListBoxEnabled:hover .mceText, .o2k7Skin .mceListBoxHover .mceText, .o2k7Skin .mceListBoxSelected .mceText {background:#FFF}
+.o2k7Skin table.mceListBoxEnabled:hover .mceOpen, .o2k7Skin .mceListBoxHover .mceOpen, .o2k7Skin .mceListBoxSelected .mceOpen {background-position:-66px -22px}
+.o2k7Skin .mceListBoxDisabled .mceText {color:gray}
+.o2k7Skin .mceListBoxMenu {overflow:auto; overflow-x:hidden}
+.o2k7Skin .mceOldBoxModel .mceListBox .mceText {height:22px}
+.o2k7Skin select.mceListBox {font-family:Tahoma,Verdana,Arial,Helvetica; font-size:12px; border:1px solid #b3c7e1; background:#FFF;}
+
+/* SplitButton */
+.o2k7Skin .mceSplitButton, .o2k7Skin .mceSplitButton a, .o2k7Skin .mceSplitButton span {display:block; height:22px; direction:ltr}
+.o2k7Skin .mceSplitButton {background:url(img/button_bg.png)}
+.o2k7Skin .mceSplitButton a.mceAction {width:22px}
+.o2k7Skin .mceSplitButton span.mceAction {width:22px; background-image:url(../../img/icons.gif)}
+.o2k7Skin .mceSplitButton a.mceOpen {width:10px; background:url(img/button_bg.png) -44px 0}
+.o2k7Skin .mceSplitButton span.mceOpen {display:none}
+.o2k7Skin table.mceSplitButtonEnabled:hover a.mceAction, .o2k7Skin .mceSplitButtonHover a.mceAction, .o2k7Skin .mceSplitButtonSelected {background:url(img/button_bg.png) 0 -22px}
+.o2k7Skin table.mceSplitButtonEnabled:hover a.mceOpen, .o2k7Skin .mceSplitButtonHover a.mceOpen, .o2k7Skin .mceSplitButtonSelected a.mceOpen {background-position:-44px -44px}
+.o2k7Skin .mceSplitButtonDisabled .mceAction {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
+.o2k7Skin .mceSplitButtonActive {background-position:0 -44px}
+
+/* ColorSplitButton */
+.o2k7Skin div.mceColorSplitMenu table {background:#FFF; border:1px solid gray}
+.o2k7Skin .mceColorSplitMenu td {padding:2px}
+.o2k7Skin .mceColorSplitMenu a {display:block; width:9px; height:9px; overflow:hidden; border:1px solid #808080}
+.o2k7Skin .mceColorSplitMenu td.mceMoreColors {padding:1px 3px 1px 1px}
+.o2k7Skin .mceColorSplitMenu a.mceMoreColors {width:100%; height:auto; text-align:center; font-family:Tahoma,Verdana,Arial,Helvetica; font-size:11px; line-height:20px; border:1px solid #FFF}
+.o2k7Skin .mceColorSplitMenu a.mceMoreColors:hover {border:1px solid #0A246A; background-color:#B6BDD2}
+.o2k7Skin a.mceMoreColors:hover {border:1px solid #0A246A}
+.o2k7Skin .mceColorPreview {margin-left:2px; width:16px; height:4px; overflow:hidden; background:#9a9b9a;overflow:hidden}
+.o2k7Skin .mce_forecolor span.mceAction, .o2k7Skin .mce_backcolor span.mceAction {height:15px;overflow:hidden}
+
+/* Menu */
+.o2k7Skin .mceMenu {position:absolute; left:0; top:0; z-index:1000; border:1px solid #ABC6DD}
+.o2k7Skin .mceNoIcons span.mceIcon {width:0;}
+.o2k7Skin .mceNoIcons a .mceText {padding-left:10px}
+.o2k7Skin .mceMenu table {background:#FFF}
+.o2k7Skin .mceMenu a, .o2k7Skin .mceMenu span, .o2k7Skin .mceMenu {display:block}
+.o2k7Skin .mceMenu td {height:20px}
+.o2k7Skin .mceMenu a {position:relative;padding:3px 0 4px 0}
+.o2k7Skin .mceMenu .mceText {position:relative; display:block; font-family:Tahoma,Verdana,Arial,Helvetica; color:#000; cursor:default; margin:0; padding:0 25px 0 25px; display:block}
+.o2k7Skin .mceMenu span.mceText, .o2k7Skin .mceMenu .mcePreview {font-size:11px}
+.o2k7Skin .mceMenu pre.mceText {font-family:Monospace}
+.o2k7Skin .mceMenu .mceIcon {position:absolute; top:0; left:0; width:22px;}
+.o2k7Skin .mceMenu .mceMenuItemEnabled a:hover, .o2k7Skin .mceMenu .mceMenuItemActive {background-color:#dbecf3}
+.o2k7Skin td.mceMenuItemSeparator {background:#DDD; height:1px}
+.o2k7Skin .mceMenuItemTitle a {border:0; background:#E5EFFD; border-bottom:1px solid #ABC6DD}
+.o2k7Skin .mceMenuItemTitle span.mceText {color:#000; font-weight:bold; padding-left:4px}
+.o2k7Skin .mceMenuItemDisabled .mceText {color:#888}
+.o2k7Skin .mceMenuItemSelected .mceIcon {background:url(../default/img/menu_check.gif)}
+.o2k7Skin .mceNoIcons .mceMenuItemSelected a {background:url(../default/img/menu_arrow.gif) no-repeat -6px center}
+.o2k7Skin .mceMenu span.mceMenuLine {display:none}
+.o2k7Skin .mceMenuItemSub a {background:url(../default/img/menu_arrow.gif) no-repeat top right;}
+
+/* Progress,Resize */
+.o2k7Skin .mceBlocker {position:absolute; left:0; top:0; z-index:1000; opacity:0.5; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=50); background:#FFF}
+.o2k7Skin .mceProgress {position:absolute; left:0; top:0; z-index:1001; background:url(../default/img/progress.gif) no-repeat; width:32px; height:32px; margin:-16px 0 0 -16px}
+
+/* Formats */
+.o2k7Skin .mce_formatPreview a {font-size:10px}
+.o2k7Skin .mce_p span.mceText {}
+.o2k7Skin .mce_address span.mceText {font-style:italic}
+.o2k7Skin .mce_pre span.mceText {font-family:monospace}
+.o2k7Skin .mce_h1 span.mceText {font-weight:bolder; font-size: 2em}
+.o2k7Skin .mce_h2 span.mceText {font-weight:bolder; font-size: 1.5em}
+.o2k7Skin .mce_h3 span.mceText {font-weight:bolder; font-size: 1.17em}
+.o2k7Skin .mce_h4 span.mceText {font-weight:bolder; font-size: 1em}
+.o2k7Skin .mce_h5 span.mceText {font-weight:bolder; font-size: .83em}
+.o2k7Skin .mce_h6 span.mceText {font-weight:bolder; font-size: .75em}
+
+/* Theme */
+.o2k7Skin span.mce_bold {background-position:0 0}
+.o2k7Skin span.mce_italic {background-position:-60px 0}
+.o2k7Skin span.mce_underline {background-position:-140px 0}
+.o2k7Skin span.mce_strikethrough {background-position:-120px 0}
+.o2k7Skin span.mce_undo {background-position:-160px 0}
+.o2k7Skin span.mce_redo {background-position:-100px 0}
+.o2k7Skin span.mce_cleanup {background-position:-40px 0}
+.o2k7Skin span.mce_bullist {background-position:-20px 0}
+.o2k7Skin span.mce_numlist {background-position:-80px 0}
+.o2k7Skin span.mce_justifyleft {background-position:-460px 0}
+.o2k7Skin span.mce_justifyright {background-position:-480px 0}
+.o2k7Skin span.mce_justifycenter {background-position:-420px 0}
+.o2k7Skin span.mce_justifyfull {background-position:-440px 0}
+.o2k7Skin span.mce_anchor {background-position:-200px 0}
+.o2k7Skin span.mce_indent {background-position:-400px 0}
+.o2k7Skin span.mce_outdent {background-position:-540px 0}
+.o2k7Skin span.mce_link {background-position:-500px 0}
+.o2k7Skin span.mce_unlink {background-position:-640px 0}
+.o2k7Skin span.mce_sub {background-position:-600px 0}
+.o2k7Skin span.mce_sup {background-position:-620px 0}
+.o2k7Skin span.mce_removeformat {background-position:-580px 0}
+.o2k7Skin span.mce_newdocument {background-position:-520px 0}
+.o2k7Skin span.mce_image {background-position:-380px 0}
+.o2k7Skin span.mce_help {background-position:-340px 0}
+.o2k7Skin span.mce_code {background-position:-260px 0}
+.o2k7Skin span.mce_hr {background-position:-360px 0}
+.o2k7Skin span.mce_visualaid {background-position:-660px 0}
+.o2k7Skin span.mce_charmap {background-position:-240px 0}
+.o2k7Skin span.mce_paste {background-position:-560px 0}
+.o2k7Skin span.mce_copy {background-position:-700px 0}
+.o2k7Skin span.mce_cut {background-position:-680px 0}
+.o2k7Skin span.mce_blockquote {background-position:-220px 0}
+.o2k7Skin .mce_forecolor span.mceAction {background-position:-720px 0}
+.o2k7Skin .mce_backcolor span.mceAction {background-position:-760px 0}
+.o2k7Skin span.mce_forecolorpicker {background-position:-720px 0}
+.o2k7Skin span.mce_backcolorpicker {background-position:-760px 0}
+
+/* Plugins */
+.o2k7Skin span.mce_advhr {background-position:-0px -20px}
+.o2k7Skin span.mce_ltr {background-position:-20px -20px}
+.o2k7Skin span.mce_rtl {background-position:-40px -20px}
+.o2k7Skin span.mce_emotions {background-position:-60px -20px}
+.o2k7Skin span.mce_fullpage {background-position:-80px -20px}
+.o2k7Skin span.mce_fullscreen {background-position:-100px -20px}
+.o2k7Skin span.mce_iespell {background-position:-120px -20px}
+.o2k7Skin span.mce_insertdate {background-position:-140px -20px}
+.o2k7Skin span.mce_inserttime {background-position:-160px -20px}
+.o2k7Skin span.mce_absolute {background-position:-180px -20px}
+.o2k7Skin span.mce_backward {background-position:-200px -20px}
+.o2k7Skin span.mce_forward {background-position:-220px -20px}
+.o2k7Skin span.mce_insert_layer {background-position:-240px -20px}
+.o2k7Skin span.mce_insertlayer {background-position:-260px -20px}
+.o2k7Skin span.mce_movebackward {background-position:-280px -20px}
+.o2k7Skin span.mce_moveforward {background-position:-300px -20px}
+.o2k7Skin span.mce_media {background-position:-320px -20px}
+.o2k7Skin span.mce_nonbreaking {background-position:-340px -20px}
+.o2k7Skin span.mce_pastetext {background-position:-360px -20px}
+.o2k7Skin span.mce_pasteword {background-position:-380px -20px}
+.o2k7Skin span.mce_selectall {background-position:-400px -20px}
+.o2k7Skin span.mce_preview {background-position:-420px -20px}
+.o2k7Skin span.mce_print {background-position:-440px -20px}
+.o2k7Skin span.mce_cancel {background-position:-460px -20px}
+.o2k7Skin span.mce_save {background-position:-480px -20px}
+.o2k7Skin span.mce_replace {background-position:-500px -20px}
+.o2k7Skin span.mce_search {background-position:-520px -20px}
+.o2k7Skin span.mce_styleprops {background-position:-560px -20px}
+.o2k7Skin span.mce_table {background-position:-580px -20px}
+.o2k7Skin span.mce_cell_props {background-position:-600px -20px}
+.o2k7Skin span.mce_delete_table {background-position:-620px -20px}
+.o2k7Skin span.mce_delete_col {background-position:-640px -20px}
+.o2k7Skin span.mce_delete_row {background-position:-660px -20px}
+.o2k7Skin span.mce_col_after {background-position:-680px -20px}
+.o2k7Skin span.mce_col_before {background-position:-700px -20px}
+.o2k7Skin span.mce_row_after {background-position:-720px -20px}
+.o2k7Skin span.mce_row_before {background-position:-740px -20px}
+.o2k7Skin span.mce_merge_cells {background-position:-760px -20px}
+.o2k7Skin span.mce_table_props {background-position:-980px -20px}
+.o2k7Skin span.mce_row_props {background-position:-780px -20px}
+.o2k7Skin span.mce_split_cells {background-position:-800px -20px}
+.o2k7Skin span.mce_template {background-position:-820px -20px}
+.o2k7Skin span.mce_visualchars {background-position:-840px -20px}
+.o2k7Skin span.mce_abbr {background-position:-860px -20px}
+.o2k7Skin span.mce_acronym {background-position:-880px -20px}
+.o2k7Skin span.mce_attribs {background-position:-900px -20px}
+.o2k7Skin span.mce_cite {background-position:-920px -20px}
+.o2k7Skin span.mce_del {background-position:-940px -20px}
+.o2k7Skin span.mce_ins {background-position:-960px -20px}
+.o2k7Skin span.mce_pagebreak {background-position:0 -40px}
+.o2k7Skin span.mce_restoredraft {background-position:-20px -40px}
+.o2k7Skin span.mce_spellchecker {background-position:-540px -20px}
Index: admin/js/tiny_mce/themes/advanced/skins/o2k7/ui_black.css
===================================================================
--- admin/js/tiny_mce/themes/advanced/skins/o2k7/ui_black.css	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/skins/o2k7/ui_black.css	(revision 307)
@@ -0,0 +1,8 @@
+/* Black */
+.o2k7SkinBlack .mceToolbar .mceToolbarStart span, .o2k7SkinBlack .mceToolbar .mceToolbarEnd span, .o2k7SkinBlack .mceButton, .o2k7SkinBlack .mceSplitButton, .o2k7SkinBlack .mceSeparator, .o2k7SkinBlack .mceSplitButton a.mceOpen, .o2k7SkinBlack .mceListBox a.mceOpen {background-image:url(img/button_bg_black.png)}
+.o2k7SkinBlack td.mceToolbar, .o2k7SkinBlack td.mceStatusbar, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack .mceMenuItemTitle span.mceText, .o2k7SkinBlack .mceStatusbar div, .o2k7SkinBlack .mceStatusbar span, .o2k7SkinBlack .mceStatusbar a {background:#535353; color:#FFF}
+.o2k7SkinBlack table.mceListBoxEnabled .mceText, o2k7SkinBlack .mceListBox .mceText {background:#FFF; border:1px solid #CBCFD4; border-bottom-color:#989FA9; border-right:0}
+.o2k7SkinBlack table.mceListBoxEnabled:hover .mceText, .o2k7SkinBlack .mceListBoxHover .mceText, .o2k7SkinBlack .mceListBoxSelected .mceText {background:#FFF; border:1px solid #FFBD69; border-right:0}
+.o2k7SkinBlack .mceExternalToolbar, .o2k7SkinBlack .mceListBox .mceText, .o2k7SkinBlack div.mceMenu, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceFirst td, .o2k7SkinBlack table.mceLayout, .o2k7SkinBlack .mceMenuItemTitle a, .o2k7SkinBlack table.mceLayout tr.mceLast td, .o2k7SkinBlack .mceIframeContainer {border-color: #535353;}
+.o2k7SkinBlack table.mceSplitButtonEnabled:hover a.mceAction, .o2k7SkinBlack .mceSplitButtonHover a.mceAction, .o2k7SkinBlack .mceSplitButtonSelected {background-image:url(img/button_bg_black.png)}
+.o2k7SkinBlack .mceMenu .mceMenuItemEnabled a:hover, .o2k7SkinBlack .mceMenu .mceMenuItemActive {background-color:#FFE7A1}
Index: admin/js/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css
===================================================================
--- admin/js/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/skins/o2k7/ui_silver.css	(revision 307)
@@ -0,0 +1,5 @@
+/* Silver */
+.o2k7SkinSilver .mceToolbar .mceToolbarStart span, .o2k7SkinSilver .mceButton, .o2k7SkinSilver .mceSplitButton, .o2k7SkinSilver .mceSeparator, .o2k7SkinSilver .mceSplitButton a.mceOpen, .o2k7SkinSilver .mceListBox a.mceOpen {background-image:url(img/button_bg_silver.png)}
+.o2k7SkinSilver td.mceToolbar, .o2k7SkinSilver td.mceStatusbar, .o2k7SkinSilver .mceMenuItemTitle a {background:#eee}
+.o2k7SkinSilver .mceListBox .mceText {background:#FFF}
+.o2k7SkinSilver .mceExternalToolbar, .o2k7SkinSilver .mceListBox .mceText, .o2k7SkinSilver div.mceMenu, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceFirst td, .o2k7SkinSilver table.mceLayout, .o2k7SkinSilver .mceMenuItemTitle a, .o2k7SkinSilver table.mceLayout tr.mceLast td, .o2k7SkinSilver .mceIframeContainer {border-color: #bbb}
Index: admin/js/tiny_mce/themes/advanced/source_editor.htm
===================================================================
--- admin/js/tiny_mce/themes/advanced/source_editor.htm	(revision 307)
+++ admin/js/tiny_mce/themes/advanced/source_editor.htm	(revision 307)
@@ -0,0 +1,25 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+	<title>{#advanced_dlg.code_title}</title>
+	<script type="text/javascript" src="../../tiny_mce_popup.js"></script>
+	<script type="text/javascript" src="js/source_editor.js"></script>
+</head>
+<body onresize="resizeInputs();" style="display:none; overflow:hidden;">
+	<form name="source" onsubmit="saveContent();return false;" action="#">
+		<div style="float: left" class="title"><label for="htmlSource">{#advanced_dlg.code_title}</label></div>
+
+		<div id="wrapline" style="float: right">
+			<input type="checkbox" name="wraped" id="wraped" onclick="toggleWordWrap(this);" class="wordWrapCode" /><label for="wraped">{#advanced_dlg.code_wordwrap}</label>
+		</div>
+
+		<br style="clear: both" />
+
+		<textarea name="htmlSource" id="htmlSource" rows="15" cols="100" style="width: 100%; height: 100%; font-family: 'Courier New',Courier,monospace; font-size: 12px;" dir="ltr" wrap="off" class="mceFocus"></textarea>
+
+		<div class="mceActionPanel">
+			<input type="submit" role="button" name="insert" value="{#update}" id="insert" />
+			<input type="button" role="button" name="cancel" value="{#cancel}" onclick="tinyMCEPopup.close();" id="cancel" />
+		</div>
+	</form>
+</body>
+</html>
Index: admin/js/tiny_mce/themes/simple/editor_template.js
===================================================================
--- admin/js/tiny_mce/themes/simple/editor_template.js	(revision 307)
+++ admin/js/tiny_mce/themes/simple/editor_template.js	(revision 307)
@@ -0,0 +1,1 @@
+(function(){var a=tinymce.DOM;tinymce.ThemeManager.requireLangPack("simple");tinymce.create("tinymce.themes.SimpleTheme",{init:function(c,d){var e=this,b=["Bold","Italic","Underline","Strikethrough","InsertUnorderedList","InsertOrderedList"],f=c.settings;e.editor=c;c.contentCSS.push(d+"/skins/"+f.skin+"/content.css");c.onInit.add(function(){c.onNodeChange.add(function(h,g){tinymce.each(b,function(i){g.get(i.toLowerCase()).setActive(h.queryCommandState(i))})})});a.loadCSS((f.editor_css?c.documentBaseURI.toAbsolute(f.editor_css):"")||d+"/skins/"+f.skin+"/ui.css")},renderUI:function(h){var e=this,i=h.targetNode,b,c,d=e.editor,f=d.controlManager,g;i=a.insertAfter(a.create("span",{id:d.id+"_container","class":"mceEditor "+d.settings.skin+"SimpleSkin"}),i);i=g=a.add(i,"table",{cellPadding:0,cellSpacing:0,"class":"mceLayout"});i=c=a.add(i,"tbody");i=a.add(c,"tr");i=b=a.add(a.add(i,"td"),"div",{"class":"mceIframeContainer"});i=a.add(a.add(c,"tr",{"class":"last"}),"td",{"class":"mceToolbar mceLast",align:"center"});c=e.toolbar=f.createToolbar("tools1");c.add(f.createButton("bold",{title:"simple.bold_desc",cmd:"Bold"}));c.add(f.createButton("italic",{title:"simple.italic_desc",cmd:"Italic"}));c.add(f.createButton("underline",{title:"simple.underline_desc",cmd:"Underline"}));c.add(f.createButton("strikethrough",{title:"simple.striketrough_desc",cmd:"Strikethrough"}));c.add(f.createSeparator());c.add(f.createButton("undo",{title:"simple.undo_desc",cmd:"Undo"}));c.add(f.createButton("redo",{title:"simple.redo_desc",cmd:"Redo"}));c.add(f.createSeparator());c.add(f.createButton("cleanup",{title:"simple.cleanup_desc",cmd:"mceCleanup"}));c.add(f.createSeparator());c.add(f.createButton("insertunorderedlist",{title:"simple.bullist_desc",cmd:"InsertUnorderedList"}));c.add(f.createButton("insertorderedlist",{title:"simple.numlist_desc",cmd:"InsertOrderedList"}));c.renderTo(i);return{iframeContainer:b,editorContainer:d.id+"_container",sizeContainer:g,deltaHeight:-20}},getInfo:function(){return{longname:"Simple theme",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.ThemeManager.add("simple",tinymce.themes.SimpleTheme)})();
Index: admin/js/tiny_mce/themes/simple/editor_template_src.js
===================================================================
--- admin/js/tiny_mce/themes/simple/editor_template_src.js	(revision 307)
+++ admin/js/tiny_mce/themes/simple/editor_template_src.js	(revision 307)
@@ -0,0 +1,84 @@
+/**
+ * editor_template_src.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(function() {
+	var DOM = tinymce.DOM;
+
+	// Tell it to load theme specific language pack(s)
+	tinymce.ThemeManager.requireLangPack('simple');
+
+	tinymce.create('tinymce.themes.SimpleTheme', {
+		init : function(ed, url) {
+			var t = this, states = ['Bold', 'Italic', 'Underline', 'Strikethrough', 'InsertUnorderedList', 'InsertOrderedList'], s = ed.settings;
+
+			t.editor = ed;
+			ed.contentCSS.push(url + "/skins/" + s.skin + "/content.css");
+
+			ed.onInit.add(function() {
+				ed.onNodeChange.add(function(ed, cm) {
+					tinymce.each(states, function(c) {
+						cm.get(c.toLowerCase()).setActive(ed.queryCommandState(c));
+					});
+				});
+			});
+
+			DOM.loadCSS((s.editor_css ? ed.documentBaseURI.toAbsolute(s.editor_css) : '') || url + "/skins/" + s.skin + "/ui.css");
+		},
+
+		renderUI : function(o) {
+			var t = this, n = o.targetNode, ic, tb, ed = t.editor, cf = ed.controlManager, sc;
+
+			n = DOM.insertAfter(DOM.create('span', {id : ed.id + '_container', 'class' : 'mceEditor ' + ed.settings.skin + 'SimpleSkin'}), n);
+			n = sc = DOM.add(n, 'table', {cellPadding : 0, cellSpacing : 0, 'class' : 'mceLayout'});
+			n = tb = DOM.add(n, 'tbody');
+
+			// Create iframe container
+			n = DOM.add(tb, 'tr');
+			n = ic = DOM.add(DOM.add(n, 'td'), 'div', {'class' : 'mceIframeContainer'});
+
+			// Create toolbar container
+			n = DOM.add(DOM.add(tb, 'tr', {'class' : 'last'}), 'td', {'class' : 'mceToolbar mceLast', align : 'center'});
+
+			// Create toolbar
+			tb = t.toolbar = cf.createToolbar("tools1");
+			tb.add(cf.createButton('bold', {title : 'simple.bold_desc', cmd : 'Bold'}));
+			tb.add(cf.createButton('italic', {title : 'simple.italic_desc', cmd : 'Italic'}));
+			tb.add(cf.createButton('underline', {title : 'simple.underline_desc', cmd : 'Underline'}));
+			tb.add(cf.createButton('strikethrough', {title : 'simple.striketrough_desc', cmd : 'Strikethrough'}));
+			tb.add(cf.createSeparator());
+			tb.add(cf.createButton('undo', {title : 'simple.undo_desc', cmd : 'Undo'}));
+			tb.add(cf.createButton('redo', {title : 'simple.redo_desc', cmd : 'Redo'}));
+			tb.add(cf.createSeparator());
+			tb.add(cf.createButton('cleanup', {title : 'simple.cleanup_desc', cmd : 'mceCleanup'}));
+			tb.add(cf.createSeparator());
+			tb.add(cf.createButton('insertunorderedlist', {title : 'simple.bullist_desc', cmd : 'InsertUnorderedList'}));
+			tb.add(cf.createButton('insertorderedlist', {title : 'simple.numlist_desc', cmd : 'InsertOrderedList'}));
+			tb.renderTo(n);
+
+			return {
+				iframeContainer : ic,
+				editorContainer : ed.id + '_container',
+				sizeContainer : sc,
+				deltaHeight : -20
+			};
+		},
+
+		getInfo : function() {
+			return {
+				longname : 'Simple theme',
+				author : 'Moxiecode Systems AB',
+				authorurl : 'http://tinymce.moxiecode.com',
+				version : tinymce.majorVersion + "." + tinymce.minorVersion
+			}
+		}
+	});
+
+	tinymce.ThemeManager.add('simple', tinymce.themes.SimpleTheme);
+})();
Index: admin/js/tiny_mce/themes/simple/langs/en.js
===================================================================
--- admin/js/tiny_mce/themes/simple/langs/en.js	(revision 307)
+++ admin/js/tiny_mce/themes/simple/langs/en.js	(revision 307)
@@ -0,0 +1,11 @@
+tinyMCE.addI18n('en.simple',{
+bold_desc:"Bold (Ctrl+B)",
+italic_desc:"Italic (Ctrl+I)",
+underline_desc:"Underline (Ctrl+U)",
+striketrough_desc:"Strikethrough",
+bullist_desc:"Unordered list",
+numlist_desc:"Ordered list",
+undo_desc:"Undo (Ctrl+Z)",
+redo_desc:"Redo (Ctrl+Y)",
+cleanup_desc:"Cleanup messy code"
+});
Index: admin/js/tiny_mce/themes/simple/skins/default/content.css
===================================================================
--- admin/js/tiny_mce/themes/simple/skins/default/content.css	(revision 307)
+++ admin/js/tiny_mce/themes/simple/skins/default/content.css	(revision 307)
@@ -0,0 +1,25 @@
+body, td, pre {
+	font-family: Verdana, Arial, Helvetica, sans-serif;
+	font-size: 10px;
+}
+
+body {
+	background-color: #FFFFFF;
+}
+
+.mceVisualAid {
+	border: 1px dashed #BBBBBB;
+}
+
+/* MSIE specific */
+
+* html body {
+	scrollbar-3dlight-color: #F0F0EE;
+	scrollbar-arrow-color: #676662;
+	scrollbar-base-color: #F0F0EE;
+	scrollbar-darkshadow-color: #DDDDDD;
+	scrollbar-face-color: #E0E0DD;
+	scrollbar-highlight-color: #F0F0EE;
+	scrollbar-shadow-color: #F0F0EE;
+	scrollbar-track-color: #F5F5F5;	
+}
Index: admin/js/tiny_mce/themes/simple/skins/default/ui.css
===================================================================
--- admin/js/tiny_mce/themes/simple/skins/default/ui.css	(revision 307)
+++ admin/js/tiny_mce/themes/simple/skins/default/ui.css	(revision 307)
@@ -0,0 +1,32 @@
+/* Reset */
+.defaultSimpleSkin table, .defaultSimpleSkin tbody, .defaultSimpleSkin a, .defaultSimpleSkin img, .defaultSimpleSkin tr, .defaultSimpleSkin div, .defaultSimpleSkin td, .defaultSimpleSkin iframe, .defaultSimpleSkin span, .defaultSimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000}
+
+/* Containers */
+.defaultSimpleSkin {position:relative}
+.defaultSimpleSkin table.mceLayout {background:#F0F0EE; border:1px solid #CCC;}
+.defaultSimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #CCC;}
+.defaultSimpleSkin .mceToolbar {height:24px;}
+
+/* Layout */
+.defaultSimpleSkin span.mceIcon, .defaultSimpleSkin img.mceIcon {display:block; width:20px; height:20px}
+.defaultSimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}
+
+/* Button */
+.defaultSimpleSkin .mceButton {display:block; border:1px solid #F0F0EE; width:20px; height:20px}
+.defaultSimpleSkin a.mceButtonEnabled:hover {border:1px solid #0A246A; background-color:#B2BBD0}
+.defaultSimpleSkin a.mceButtonActive {border:1px solid #0A246A; background-color:#C2CBE0}
+.defaultSimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
+
+/* Separator */
+.defaultSimpleSkin .mceSeparator {display:block; background:url(../../img/icons.gif) -180px 0; width:2px; height:20px; margin:0 2px 0 4px}
+
+/* Theme */
+.defaultSimpleSkin span.mce_bold {background-position:0 0}
+.defaultSimpleSkin span.mce_italic {background-position:-60px 0}
+.defaultSimpleSkin span.mce_underline {background-position:-140px 0}
+.defaultSimpleSkin span.mce_strikethrough {background-position:-120px 0}
+.defaultSimpleSkin span.mce_undo {background-position:-160px 0}
+.defaultSimpleSkin span.mce_redo {background-position:-100px 0}
+.defaultSimpleSkin span.mce_cleanup {background-position:-40px 0}
+.defaultSimpleSkin span.mce_insertunorderedlist {background-position:-20px 0}
+.defaultSimpleSkin span.mce_insertorderedlist {background-position:-80px 0}
Index: admin/js/tiny_mce/themes/simple/skins/o2k7/content.css
===================================================================
--- admin/js/tiny_mce/themes/simple/skins/o2k7/content.css	(revision 307)
+++ admin/js/tiny_mce/themes/simple/skins/o2k7/content.css	(revision 307)
@@ -0,0 +1,17 @@
+body, td, pre {font-family:Verdana, Arial, Helvetica, sans-serif; font-size:10px;}
+
+body {background: #FFF;}
+.mceVisualAid {border: 1px dashed #BBB;}
+
+/* IE */
+
+* html body {
+scrollbar-3dlight-color: #F0F0EE;
+scrollbar-arrow-color: #676662;
+scrollbar-base-color: #F0F0EE;
+scrollbar-darkshadow-color: #DDDDDD;
+scrollbar-face-color: #E0E0DD;
+scrollbar-highlight-color: #F0F0EE;
+scrollbar-shadow-color: #F0F0EE;
+scrollbar-track-color: #F5F5F5;	
+}
Index: admin/js/tiny_mce/themes/simple/skins/o2k7/ui.css
===================================================================
--- admin/js/tiny_mce/themes/simple/skins/o2k7/ui.css	(revision 307)
+++ admin/js/tiny_mce/themes/simple/skins/o2k7/ui.css	(revision 307)
@@ -0,0 +1,35 @@
+/* Reset */
+.o2k7SimpleSkin table, .o2k7SimpleSkin tbody, .o2k7SimpleSkin a, .o2k7SimpleSkin img, .o2k7SimpleSkin tr, .o2k7SimpleSkin div, .o2k7SimpleSkin td, .o2k7SimpleSkin iframe, .o2k7SimpleSkin span, .o2k7SimpleSkin * {border:0; margin:0; padding:0; background:transparent; white-space:nowrap; text-decoration:none; font-weight:normal; cursor:default; color:#000}
+
+/* Containers */
+.o2k7SimpleSkin {position:relative}
+.o2k7SimpleSkin table.mceLayout {background:#E5EFFD; border:1px solid #ABC6DD;}
+.o2k7SimpleSkin iframe {display:block; background:#FFF; border-bottom:1px solid #ABC6DD;}
+.o2k7SimpleSkin .mceToolbar {height:26px;}
+
+/* Layout */
+.o2k7SimpleSkin .mceToolbar .mceToolbarStart span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px; }
+.o2k7SimpleSkin .mceToolbar .mceToolbarEnd span {display:block; background:url(img/button_bg.png) -22px 0; width:1px; height:22px}
+.o2k7SimpleSkin span.mceIcon, .o2k7SimpleSkin img.mceIcon {display:block; width:20px; height:20px}
+.o2k7SimpleSkin .mceIcon {background:url(../../img/icons.gif) no-repeat 20px 20px}
+
+/* Button */
+.o2k7SimpleSkin .mceButton {display:block; background:url(img/button_bg.png); width:22px; height:22px}
+.o2k7SimpleSkin a.mceButton span, .o2k7SimpleSkin a.mceButton img {margin:1px 0 0 1px}
+.o2k7SimpleSkin a.mceButtonEnabled:hover {background-color:#B2BBD0; background-position:0 -22px}
+.o2k7SimpleSkin a.mceButtonActive {background-position:0 -44px}
+.o2k7SimpleSkin .mceButtonDisabled span {opacity:0.3; -ms-filter:'alpha(opacity=30)'; filter:alpha(opacity=30)}
+
+/* Separator */
+.o2k7SimpleSkin .mceSeparator {display:block; background:url(img/button_bg.png) -22px 0; width:5px; height:22px}
+
+/* Theme */
+.o2k7SimpleSkin span.mce_bold {background-position:0 0}
+.o2k7SimpleSkin span.mce_italic {background-position:-60px 0}
+.o2k7SimpleSkin span.mce_underline {background-position:-140px 0}
+.o2k7SimpleSkin span.mce_strikethrough {background-position:-120px 0}
+.o2k7SimpleSkin span.mce_undo {background-position:-160px 0}
+.o2k7SimpleSkin span.mce_redo {background-position:-100px 0}
+.o2k7SimpleSkin span.mce_cleanup {background-position:-40px 0}
+.o2k7SimpleSkin span.mce_insertunorderedlist {background-position:-20px 0}
+.o2k7SimpleSkin span.mce_insertorderedlist {background-position:-80px 0}
Index: admin/js/tiny_mce/tiny_mce.js
===================================================================
--- admin/js/tiny_mce/tiny_mce.js	(revision 307)
+++ admin/js/tiny_mce/tiny_mce.js	(revision 307)
@@ -0,0 +1,1 @@
+(function(d){var a=/^\s*|\s*$/g,e,c="B".replace(/A(.)|B/,"$1")==="$1";var b={majorVersion:"3",minorVersion:"4.2",releaseDate:"2011-04-07",_init:function(){var s=this,q=document,o=navigator,g=o.userAgent,m,f,l,k,j,r;s.isOpera=d.opera&&opera.buildNumber;s.isWebKit=/WebKit/.test(g);s.isIE=!s.isWebKit&&!s.isOpera&&(/MSIE/gi).test(g)&&(/Explorer/gi).test(o.appName);s.isIE6=s.isIE&&/MSIE [56]/.test(g);s.isGecko=!s.isWebKit&&/Gecko/.test(g);s.isMac=g.indexOf("Mac")!=-1;s.isAir=/adobeair/i.test(g);s.isIDevice=/(iPad|iPhone)/.test(g);if(d.tinyMCEPreInit){s.suffix=tinyMCEPreInit.suffix;s.baseURL=tinyMCEPreInit.base;s.query=tinyMCEPreInit.query;return}s.suffix="";f=q.getElementsByTagName("base");for(m=0;m<f.length;m++){if(r=f[m].href){if(/^https?:\/\/[^\/]+$/.test(r)){r+="/"}k=r?r.match(/.*\//)[0]:""}}function h(i){if(i.src&&/tiny_mce(|_gzip|_jquery|_prototype|_full)(_dev|_src)?.js/.test(i.src)){if(/_(src|dev)\.js/g.test(i.src)){s.suffix="_src"}if((j=i.src.indexOf("?"))!=-1){s.query=i.src.substring(j+1)}s.baseURL=i.src.substring(0,i.src.lastIndexOf("/"));if(k&&s.baseURL.indexOf("://")==-1&&s.baseURL.indexOf("/")!==0){s.baseURL=k+s.baseURL}return s.baseURL}return null}f=q.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}l=q.getElementsByTagName("head")[0];if(l){f=l.getElementsByTagName("script");for(m=0;m<f.length;m++){if(h(f[m])){return}}}return},is:function(g,f){if(!f){return g!==e}if(f=="array"&&(g.hasOwnProperty&&g instanceof Array)){return true}return typeof(g)==f},makeMap:function(f,j,h){var g;f=f||[];j=j||",";if(typeof(f)=="string"){f=f.split(j)}h=h||{};g=f.length;while(g--){h[f[g]]={}}return h},each:function(i,f,h){var j,g;if(!i){return 0}h=h||i;if(i.length!==e){for(j=0,g=i.length;j<g;j++){if(f.call(h,i[j],j,i)===false){return 0}}}else{for(j in i){if(i.hasOwnProperty(j)){if(f.call(h,i[j],j,i)===false){return 0}}}}return 1},trim:function(f){return(f?""+f:"").replace(a,"")},create:function(o,f,j){var n=this,g,i,k,l,h,m=0;o=/^((static) )?([\w.]+)(:([\w.]+))?/.exec(o);k=o[3].match(/(^|\.)(\w+)$/i)[2];i=n.createNS(o[3].replace(/\.\w+$/,""),j);if(i[k]){return}if(o[2]=="static"){i[k]=f;if(this.onCreate){this.onCreate(o[2],o[3],i[k])}return}if(!f[k]){f[k]=function(){};m=1}i[k]=f[k];n.extend(i[k].prototype,f);if(o[5]){g=n.resolve(o[5]).prototype;l=o[5].match(/\.(\w+)$/i)[1];h=i[k];if(m){i[k]=function(){return g[l].apply(this,arguments)}}else{i[k]=function(){this.parent=g[l];return h.apply(this,arguments)}}i[k].prototype[k]=i[k];n.each(g,function(p,q){i[k].prototype[q]=g[q]});n.each(f,function(p,q){if(g[q]){i[k].prototype[q]=function(){this.parent=g[q];return p.apply(this,arguments)}}else{if(q!=k){i[k].prototype[q]=p}}})}n.each(f["static"],function(p,q){i[k][q]=p});if(this.onCreate){this.onCreate(o[2],o[3],i[k].prototype)}},walk:function(i,h,j,g){g=g||this;if(i){if(j){i=i[j]}b.each(i,function(k,f){if(h.call(g,k,f,j)===false){return false}b.walk(k,h,j,g)})}},createNS:function(j,h){var g,f;h=h||d;j=j.split(".");for(g=0;g<j.length;g++){f=j[g];if(!h[f]){h[f]={}}h=h[f]}return h},resolve:function(j,h){var g,f;h=h||d;j=j.split(".");for(g=0,f=j.length;g<f;g++){h=h[j[g]];if(!h){break}}return h},addUnload:function(j,i){var h=this;j={func:j,scope:i||this};if(!h.unloads){function g(){var f=h.unloads,l,m;if(f){for(m in f){l=f[m];if(l&&l.func){l.func.call(l.scope,1)}}if(d.detachEvent){d.detachEvent("onbeforeunload",k);d.detachEvent("onunload",g)}else{if(d.removeEventListener){d.removeEventListener("unload",g,false)}}h.unloads=l=f=w=g=0;if(d.CollectGarbage){CollectGarbage()}}}function k(){var l=document;if(l.readyState=="interactive"){function f(){l.detachEvent("onstop",f);if(g){g()}l=0}if(l){l.attachEvent("onstop",f)}d.setTimeout(function(){if(l){l.detachEvent("onstop",f)}},0)}}if(d.attachEvent){d.attachEvent("onunload",g);d.attachEvent("onbeforeunload",k)}else{if(d.addEventListener){d.addEventListener("unload",g,false)}}h.unloads=[j]}else{h.unloads.push(j)}return j},removeUnload:function(i){var g=this.unloads,h=null;b.each(g,function(j,f){if(j&&j.func==i){g.splice(f,1);h=i;return false}});return h},explode:function(f,g){return f?b.map(f.split(g||","),b.trim):f},_addVer:function(g){var f;if(!this.query){return g}f=(g.indexOf("?")==-1?"?":"&")+this.query;if(g.indexOf("#")==-1){return g+f}return g.replace("#",f+"#")},_replace:function(h,f,g){if(c){return g.replace(h,function(){var l=f,j=arguments,k;for(k=0;k<j.length-2;k++){if(j[k]===e){l=l.replace(new RegExp("\\$"+k,"g"),"")}else{l=l.replace(new RegExp("\\$"+k,"g"),j[k])}}return l})}return g.replace(h,f)}};b._init();d.tinymce=d.tinyMCE=b})(window);(function(e,d){var c=d.is,b=/^(href|src|style)$/i,f;if(!e){return alert("Load jQuery first!")}d.$=e;d.adapter={patchEditor:function(j){var i=e.fn;function h(n,o){var m=this;if(o){m.removeAttr("data-mce-style")}return i.css.apply(m,arguments)}function g(n,o){var m=this;if(b.test(n)){if(o!==f){m.each(function(p,q){j.dom.setAttrib(q,n,o)});return m}else{return m.attr("data-mce-"+n)}}return i.attr.apply(m,arguments)}function k(m){return function(n){if(n){n=j.dom.processHTML(n)}return m.call(this,n)}}function l(m){if(m.css!==h){m.css=h;m.attr=g;m.html=k(i.html);m.append=k(i.append);m.prepend=k(i.prepend);m.after=k(i.after);m.before=k(i.before);m.replaceWith=k(i.replaceWith);m.tinymce=j;m.pushStack=function(){return l(i.pushStack.apply(this,arguments))}}return m}j.$=function(m,n){var o=j.getDoc();return l(e(m||o,o||n))}}};d.extend=e.extend;d.extend(d,{map:e.map,grep:function(g,h){return e.grep(g,h||function(){return 1})},inArray:function(g,h){return e.inArray(h,g||[])}});var a={"tinymce.dom.DOMUtils":{select:function(i,h){var g=this;return e.find(i,g.get(h)||g.get(g.settings.root_element)||g.doc,[])},is:function(h,g){return e(this.get(h)).is(g)}}};d.onCreate=function(g,i,h){d.extend(h,a[i])}})(window.jQuery,tinymce);tinymce.create("tinymce.util.Dispatcher",{scope:null,listeners:null,Dispatcher:function(a){this.scope=a||this;this.listeners=[]},add:function(a,b){this.listeners.push({cb:a,scope:b||this.scope});return a},addToTop:function(a,b){this.listeners.unshift({cb:a,scope:b||this.scope});return a},remove:function(a){var b=this.listeners,c=null;tinymce.each(b,function(e,d){if(a==e.cb){c=a;b.splice(d,1);return false}});return c},dispatch:function(){var f,d=arguments,e,b=this.listeners,g;for(e=0;e<b.length;e++){g=b[e];f=g.cb.apply(g.scope,d);if(f===false){break}}return f}});(function(){var a=tinymce.each;tinymce.create("tinymce.util.URI",{URI:function(e,g){var f=this,h,d,c;e=tinymce.trim(e);g=f.settings=g||{};if(/^(mailto|tel|news|javascript|about|data):/i.test(e)||/^\s*#/.test(e)){f.source=e;return}if(e.indexOf("/")===0&&e.indexOf("//")!==0){e=(g.base_uri?g.base_uri.protocol||"http":"http")+"://mce_host"+e}if(!/^\w*:?\/\//.test(e)){e=(g.base_uri.protocol||"http")+"://mce_host"+f.toAbsPath(g.base_uri.path,e)}e=e.replace(/@@/g,"(mce_at)");e=/^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/.exec(e);a(["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],function(b,j){var k=e[j];if(k){k=k.replace(/\(mce_at\)/g,"@@")}f[b]=k});if(c=g.base_uri){if(!f.protocol){f.protocol=c.protocol}if(!f.userInfo){f.userInfo=c.userInfo}if(!f.port&&f.host=="mce_host"){f.port=c.port}if(!f.host||f.host=="mce_host"){f.host=c.host}f.source=""}},setPath:function(c){var b=this;c=/^(.*?)\/?(\w+)?$/.exec(c);b.path=c[0];b.directory=c[1];b.file=c[2];b.source="";b.getURI()},toRelative:function(b){var c=this,d;if(b==="./"){return b}b=new tinymce.util.URI(b,{base_uri:c});if((b.host!="mce_host"&&c.host!=b.host&&b.host)||c.port!=b.port||c.protocol!=b.protocol){return b.getURI()}d=c.toRelPath(c.path,b.path);if(b.query){d+="?"+b.query}if(b.anchor){d+="#"+b.anchor}return d},toAbsolute:function(b,c){var b=new tinymce.util.URI(b,{base_uri:this});return b.getURI(this.host==b.host&&this.protocol==b.protocol?c:0)},toRelPath:function(g,h){var c,f=0,d="",e,b;g=g.substring(0,g.lastIndexOf("/"));g=g.split("/");c=h.split("/");if(g.length>=c.length){for(e=0,b=g.length;e<b;e++){if(e>=c.length||g[e]!=c[e]){f=e+1;break}}}if(g.length<c.length){for(e=0,b=c.length;e<b;e++){if(e>=g.length||g[e]!=c[e]){f=e+1;break}}}if(f==1){return h}for(e=0,b=g.length-(f-1);e<b;e++){d+="../"}for(e=f-1,b=c.length;e<b;e++){if(e!=f-1){d+="/"+c[e]}else{d+=c[e]}}return d},toAbsPath:function(e,f){var c,b=0,h=[],d,g;d=/\/$/.test(f)?"/":"";e=e.split("/");f=f.split("/");a(e,function(i){if(i){h.push(i)}});e=h;for(c=f.length-1,h=[];c>=0;c--){if(f[c].length==0||f[c]=="."){continue}if(f[c]==".."){b++;continue}if(b>0){b--;continue}h.push(f[c])}c=e.length-b;if(c<=0){g=h.reverse().join("/")}else{g=e.slice(0,c).join("/")+"/"+h.reverse().join("/")}if(g.indexOf("/")!==0){g="/"+g}if(d&&g.lastIndexOf("/")!==g.length-1){g+=d}return g},getURI:function(d){var c,b=this;if(!b.source||d){c="";if(!d){if(b.protocol){c+=b.protocol+"://"}if(b.userInfo){c+=b.userInfo+"@"}if(b.host){c+=b.host}if(b.port){c+=":"+b.port}}if(b.path){c+=b.path}if(b.query){c+="?"+b.query}if(b.anchor){c+="#"+b.anchor}b.source=c}return b.source}})})();(function(){var a=tinymce.each;tinymce.create("static tinymce.util.Cookie",{getHash:function(d){var b=this.get(d),c;if(b){a(b.split("&"),function(e){e=e.split("=");c=c||{};c[unescape(e[0])]=unescape(e[1])})}return c},setHash:function(j,b,g,f,i,c){var h="";a(b,function(e,d){h+=(!h?"":"&")+escape(d)+"="+escape(e)});this.set(j,h,g,f,i,c)},get:function(i){var h=document.cookie,g,f=i+"=",d;if(!h){return}d=h.indexOf("; "+f);if(d==-1){d=h.indexOf(f);if(d!=0){return null}}else{d+=2}g=h.indexOf(";",d);if(g==-1){g=h.length}return unescape(h.substring(d+f.length,g))},set:function(i,b,g,f,h,c){document.cookie=i+"="+escape(b)+((g)?"; expires="+g.toGMTString():"")+((f)?"; path="+escape(f):"")+((h)?"; domain="+h:"")+((c)?"; secure":"")},remove:function(e,b){var c=new Date();c.setTime(c.getTime()-1000);this.set(e,"",c,b,c)}})})();(function(){function serialize(o,quote){var i,v,t;quote=quote||'"';if(o==null){return"null"}t=typeof o;if(t=="string"){v="\bb\tt\nn\ff\rr\"\"''\\\\";return quote+o.replace(/([\u0080-\uFFFF\x00-\x1f\"\'\\])/g,function(a,b){if(quote==='"'&&a==="'"){return a}i=v.indexOf(b);if(i+1){return"\\"+v.charAt(i+1)}a=b.charCodeAt().toString(16);return"\\u"+"0000".substring(a.length)+a})+quote}if(t=="object"){if(o.hasOwnProperty&&o instanceof Array){for(i=0,v="[";i<o.length;i++){v+=(i>0?",":"")+serialize(o[i],quote)}return v+"]"}v="{";for(i in o){v+=typeof o[i]!="function"?(v.length>1?","+quote:quote)+i+quote+":"+serialize(o[i],quote):""}return v+"}"}return""+o}tinymce.util.JSON={serialize:serialize,parse:function(s){try{return eval("("+s+")")}catch(ex){}}}})();tinymce.create("static tinymce.util.XHR",{send:function(g){var a,e,b=window,h=0;g.scope=g.scope||this;g.success_scope=g.success_scope||g.scope;g.error_scope=g.error_scope||g.scope;g.async=g.async===false?false:true;g.data=g.data||"";function d(i){a=0;try{a=new ActiveXObject(i)}catch(c){}return a}a=b.XMLHttpRequest?new XMLHttpRequest():d("Microsoft.XMLHTTP")||d("Msxml2.XMLHTTP");if(a){if(a.overrideMimeType){a.overrideMimeType(g.content_type)}a.open(g.type||(g.data?"POST":"GET"),g.url,g.async);if(g.content_type){a.setRequestHeader("Content-Type",g.content_type)}a.setRequestHeader("X-Requested-With","XMLHttpRequest");a.send(g.data);function f(){if(!g.async||a.readyState==4||h++>10000){if(g.success&&h<10000&&a.status==200){g.success.call(g.success_scope,""+a.responseText,a,g)}else{if(g.error){g.error.call(g.error_scope,h>10000?"TIMED_OUT":"GENERAL",a,g)}}a=null}else{b.setTimeout(f,10)}}if(!g.async){return f()}e=b.setTimeout(f,10)}}});(function(){var c=tinymce.extend,b=tinymce.util.JSON,a=tinymce.util.XHR;tinymce.create("tinymce.util.JSONRequest",{JSONRequest:function(d){this.settings=c({},d);this.count=0},send:function(f){var e=f.error,d=f.success;f=c(this.settings,f);f.success=function(h,g){h=b.parse(h);if(typeof(h)=="undefined"){h={error:"JSON Parse error."}}if(h.error){e.call(f.error_scope||f.scope,h.error,g)}else{d.call(f.success_scope||f.scope,h.result)}};f.error=function(h,g){if(e){e.call(f.error_scope||f.scope,h,g)}};f.data=b.serialize({id:f.id||"c"+(this.count++),method:f.method,params:f.params});f.content_type="application/json";a.send(f)},"static":{sendRPC:function(d){return new tinymce.util.JSONRequest().send(d)}}})}());(function(j){var a,g,d,k=/[&\"\u007E-\uD7FF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,b=/[<>&\u007E-\uD7FF]|[\uD800-\uDBFF][\uDC00-\uDFFF]/g,f=/[<>&\"\']/g,c=/&(#)?([\w]+);/g,i={128:"\u20AC",130:"\u201A",131:"\u0192",132:"\u201E",133:"\u2026",134:"\u2020",135:"\u2021",136:"\u02C6",137:"\u2030",138:"\u0160",139:"\u2039",140:"\u0152",142:"\u017D",145:"\u2018",146:"\u2019",147:"\u201C",148:"\u201D",149:"\u2022",150:"\u2013",151:"\u2014",152:"\u02DC",153:"\u2122",154:"\u0161",155:"\u203A",156:"\u0153",158:"\u017E",159:"\u0178"};g={'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","&":"&amp;"};d={"&lt;":"<","&gt;":">","&amp;":"&","&quot;":'"',"&apos;":"'"};function h(l){var m;m=document.createElement("div");m.innerHTML=l;return m.textContent||m.innerText||l}function e(m,p){var n,o,l,q={};if(m){m=m.split(",");p=p||10;for(n=0;n<m.length;n+=2){o=String.fromCharCode(parseInt(m[n],p));if(!g[o]){l="&"+m[n+1]+";";q[o]=l;q[l]=o}}return q}}a=e("50,nbsp,51,iexcl,52,cent,53,pound,54,curren,55,yen,56,brvbar,57,sect,58,uml,59,copy,5a,ordf,5b,laquo,5c,not,5d,shy,5e,reg,5f,macr,5g,deg,5h,plusmn,5i,sup2,5j,sup3,5k,acute,5l,micro,5m,para,5n,middot,5o,cedil,5p,sup1,5q,ordm,5r,raquo,5s,frac14,5t,frac12,5u,frac34,5v,iquest,60,Agrave,61,Aacute,62,Acirc,63,Atilde,64,Auml,65,Aring,66,AElig,67,Ccedil,68,Egrave,69,Eacute,6a,Ecirc,6b,Euml,6c,Igrave,6d,Iacute,6e,Icirc,6f,Iuml,6g,ETH,6h,Ntilde,6i,Ograve,6j,Oacute,6k,Ocirc,6l,Otilde,6m,Ouml,6n,times,6o,Oslash,6p,Ugrave,6q,Uacute,6r,Ucirc,6s,Uuml,6t,Yacute,6u,THORN,6v,szlig,70,agrave,71,aacute,72,acirc,73,atilde,74,auml,75,aring,76,aelig,77,ccedil,78,egrave,79,eacute,7a,ecirc,7b,euml,7c,igrave,7d,iacute,7e,icirc,7f,iuml,7g,eth,7h,ntilde,7i,ograve,7j,oacute,7k,ocirc,7l,otilde,7m,ouml,7n,divide,7o,oslash,7p,ugrave,7q,uacute,7r,ucirc,7s,uuml,7t,yacute,7u,thorn,7v,yuml,ci,fnof,sh,Alpha,si,Beta,sj,Gamma,sk,Delta,sl,Epsilon,sm,Zeta,sn,Eta,so,Theta,sp,Iota,sq,Kappa,sr,Lambda,ss,Mu,st,Nu,su,Xi,sv,Omicron,t0,Pi,t1,Rho,t3,Sigma,t4,Tau,t5,Upsilon,t6,Phi,t7,Chi,t8,Psi,t9,Omega,th,alpha,ti,beta,tj,gamma,tk,delta,tl,epsilon,tm,zeta,tn,eta,to,theta,tp,iota,tq,kappa,tr,lambda,ts,mu,tt,nu,tu,xi,tv,omicron,u0,pi,u1,rho,u2,sigmaf,u3,sigma,u4,tau,u5,upsilon,u6,phi,u7,chi,u8,psi,u9,omega,uh,thetasym,ui,upsih,um,piv,812,bull,816,hellip,81i,prime,81j,Prime,81u,oline,824,frasl,88o,weierp,88h,image,88s,real,892,trade,89l,alefsym,8cg,larr,8ch,uarr,8ci,rarr,8cj,darr,8ck,harr,8dl,crarr,8eg,lArr,8eh,uArr,8ei,rArr,8ej,dArr,8ek,hArr,8g0,forall,8g2,part,8g3,exist,8g5,empty,8g7,nabla,8g8,isin,8g9,notin,8gb,ni,8gf,prod,8gh,sum,8gi,minus,8gn,lowast,8gq,radic,8gt,prop,8gu,infin,8h0,ang,8h7,and,8h8,or,8h9,cap,8ha,cup,8hb,int,8hk,there4,8hs,sim,8i5,cong,8i8,asymp,8j0,ne,8j1,equiv,8j4,le,8j5,ge,8k2,sub,8k3,sup,8k4,nsub,8k6,sube,8k7,supe,8kl,oplus,8kn,otimes,8l5,perp,8m5,sdot,8o8,lceil,8o9,rceil,8oa,lfloor,8ob,rfloor,8p9,lang,8pa,rang,9ea,loz,9j0,spades,9j3,clubs,9j5,hearts,9j6,diams,ai,OElig,aj,oelig,b0,Scaron,b1,scaron,bo,Yuml,m6,circ,ms,tilde,802,ensp,803,emsp,809,thinsp,80c,zwnj,80d,zwj,80e,lrm,80f,rlm,80j,ndash,80k,mdash,80o,lsquo,80p,rsquo,80q,sbquo,80s,ldquo,80t,rdquo,80u,bdquo,810,dagger,811,Dagger,81g,permil,81p,lsaquo,81q,rsaquo,85c,euro",32);j.html=j.html||{};j.html.Entities={encodeRaw:function(m,l){return m.replace(l?k:b,function(n){return g[n]||n})},encodeAllRaw:function(l){return(""+l).replace(f,function(m){return g[m]||m})},encodeNumeric:function(m,l){return m.replace(l?k:b,function(n){if(n.length>1){return"&#"+(((n.charCodeAt(0)-55296)*1024)+(n.charCodeAt(1)-56320)+65536)+";"}return g[n]||"&#"+n.charCodeAt(0)+";"})},encodeNamed:function(n,l,m){m=m||a;return n.replace(l?k:b,function(o){return g[o]||m[o]||o})},getEncodeFunc:function(l,o){var p=j.html.Entities;o=e(o)||a;function m(r,q){return r.replace(q?k:b,function(s){return g[s]||o[s]||"&#"+s.charCodeAt(0)+";"||s})}function n(r,q){return p.encodeNamed(r,q,o)}l=j.makeMap(l.replace(/\+/g,","));if(l.named&&l.numeric){return m}if(l.named){if(o){return n}return p.encodeNamed}if(l.numeric){return p.encodeNumeric}return p.encodeRaw},decode:function(l){return l.replace(c,function(n,m,o){if(m){o=parseInt(o);if(o>65535){o-=65536;return String.fromCharCode(55296+(o>>10),56320+(o&1023))}else{return i[o]||String.fromCharCode(o)}}return d[n]||a[n]||h(n)})}}})(tinymce);tinymce.html.Styles=function(d,f){var k=/rgb\s*\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/gi,h=/(?:url(?:(?:\(\s*\"([^\"]+)\"\s*\))|(?:\(\s*\'([^\']+)\'\s*\))|(?:\(\s*([^)\s]+)\s*\))))|(?:\'([^\']+)\')|(?:\"([^\"]+)\")/gi,b=/\s*([^:]+):\s*([^;]+);?/g,l=/\s+$/,m=/rgb/,e,g,a={},j;d=d||{};j="\\\" \\' \\; \\: ; : _".split(" ");for(g=0;g<j.length;g++){a[j[g]]="_"+g;a["_"+g]=j[g]}function c(n,q,p,i){function o(r){r=parseInt(r).toString(16);return r.length>1?r:"0"+r}return"#"+o(q)+o(p)+o(i)}return{toHex:function(i){return i.replace(k,c)},parse:function(r){var y={},p,n,v,q,u=d.url_converter,x=d.url_converter_scope||this;function o(C,F){var E,B,A,D;E=y[C+"-top"+F];if(!E){return}B=y[C+"-right"+F];if(E!=B){return}A=y[C+"-bottom"+F];if(B!=A){return}D=y[C+"-left"+F];if(A!=D){return}y[C+F]=D;delete y[C+"-top"+F];delete y[C+"-right"+F];delete y[C+"-bottom"+F];delete y[C+"-left"+F]}function t(B){var C=y[B],A;if(!C||C.indexOf(" ")<0){return}C=C.split(" ");A=C.length;while(A--){if(C[A]!==C[0]){return false}}y[B]=C[0];return true}function z(C,B,A,D){if(!t(B)){return}if(!t(A)){return}if(!t(D)){return}y[C]=y[B]+" "+y[A]+" "+y[D];delete y[B];delete y[A];delete y[D]}function s(A){q=true;return a[A]}function i(B,A){if(q){B=B.replace(/_[0-9]/g,function(C){return a[C]})}if(!A){B=B.replace(/\\([\'\";:])/g,"$1")}return B}if(r){r=r.replace(/\\[\"\';:_]/g,s).replace(/\"[^\"]+\"|\'[^\']+\'/g,function(A){return A.replace(/[;:]/g,s)});while(p=b.exec(r)){n=p[1].replace(l,"").toLowerCase();v=p[2].replace(l,"");if(n&&v.length>0){if(n==="font-weight"&&v==="700"){v="bold"}else{if(n==="color"||n==="background-color"){v=v.toLowerCase()}}v=v.replace(k,c);v=v.replace(h,function(B,A,E,D,F,C){F=F||C;if(F){F=i(F);return"'"+F.replace(/\'/g,"\\'")+"'"}A=i(A||E||D);if(u){A=u.call(x,A,"style")}return"url('"+A.replace(/\'/g,"\\'")+"')"});y[n]=q?i(v,true):v}b.lastIndex=p.index+p[0].length}o("border","");o("border","-width");o("border","-color");o("border","-style");o("padding","");o("margin","");z("border","border-width","border-style","border-color");if(y.border==="medium none"){delete y.border}}return y},serialize:function(p,r){var o="",n,q;function i(t){var x,u,s,t,v;x=f.styles[t];if(x){for(u=0,s=x.length;u<s;u++){t=x[u];v=p[t];if(v!==e&&v.length>0){o+=(o.length>0?" ":"")+t+": "+v+";"}}}}if(r&&f&&f.styles){i("*");i(n)}else{for(n in p){q=p[n];if(q!==e&&q.length>0){o+=(o.length>0?" ":"")+n+": "+q+";"}}}return o}}};(function(l){var g={},i,k,f,d,b,e,c=l.makeMap,j=l.each;function h(n,m){return n.split(m||",")}function a(q,p){var n,o={};function m(r){return r.replace(/[A-Z]+/g,function(s){return m(q[s])})}for(n in q){if(q.hasOwnProperty(n)){q[n]=m(q[n])}}m(p).replace(/#/g,"#text").replace(/(\w+)\[([^\]]+)\]\[([^\]]*)\]/g,function(u,s,r,t){r=h(r,"|");o[s]={attributes:c(r),attributesOrder:r,children:c(t,"|",{"#comment":{}})}});return o}k="h1,h2,h3,h4,h5,h6,hr,p,div,address,pre,form,table,tbody,thead,tfoot,th,tr,td,li,ol,ul,caption,blockquote,center,dl,dt,dd,dir,fieldset,noscript,menu,isindex,samp,header,footer,article,section,hgroup";k=c(k,",",c(k.toUpperCase()));g=a({Z:"H|K|N|O|P",Y:"X|form|R|Q",ZG:"E|span|width|align|char|charoff|valign",X:"p|T|div|U|W|isindex|fieldset|table",ZF:"E|align|char|charoff|valign",W:"pre|hr|blockquote|address|center|noframes",ZE:"abbr|axis|headers|scope|rowspan|colspan|align|char|charoff|valign|nowrap|bgcolor|width|height",ZD:"[E][S]",U:"ul|ol|dl|menu|dir",ZC:"p|Y|div|U|W|table|br|span|bdo|object|applet|img|map|K|N|Q",T:"h1|h2|h3|h4|h5|h6",ZB:"X|S|Q",S:"R|P",ZA:"a|G|J|M|O|P",R:"a|H|K|N|O",Q:"noscript|P",P:"ins|del|script",O:"input|select|textarea|label|button",N:"M|L",M:"em|strong|dfn|code|q|samp|kbd|var|cite|abbr|acronym",L:"sub|sup",K:"J|I",J:"tt|i|b|u|s|strike",I:"big|small|font|basefont",H:"G|F",G:"br|span|bdo",F:"object|applet|img|map|iframe",E:"A|B|C",D:"accesskey|tabindex|onfocus|onblur",C:"onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup",B:"lang|xml:lang|dir",A:"id|class|style|title"},"script[id|charset|type|language|src|defer|xml:space][]style[B|id|type|media|title|xml:space][]object[E|declare|classid|codebase|data|type|codetype|archive|standby|width|height|usemap|name|tabindex|align|border|hspace|vspace][#|param|Y]param[id|name|value|valuetype|type][]p[E|align][#|S]a[E|D|charset|type|name|href|hreflang|rel|rev|shape|coords|target][#|Z]br[A|clear][]span[E][#|S]bdo[A|C|B][#|S]applet[A|codebase|archive|code|object|alt|name|width|height|align|hspace|vspace][#|param|Y]h1[E|align][#|S]img[E|src|alt|name|longdesc|width|height|usemap|ismap|align|border|hspace|vspace][]map[B|C|A|name][X|form|Q|area]h2[E|align][#|S]iframe[A|longdesc|name|src|frameborder|marginwidth|marginheight|scrolling|align|width|height][#|Y]h3[E|align][#|S]tt[E][#|S]i[E][#|S]b[E][#|S]u[E][#|S]s[E][#|S]strike[E][#|S]big[E][#|S]small[E][#|S]font[A|B|size|color|face][#|S]basefont[id|size|color|face][]em[E][#|S]strong[E][#|S]dfn[E][#|S]code[E][#|S]q[E|cite][#|S]samp[E][#|S]kbd[E][#|S]var[E][#|S]cite[E][#|S]abbr[E][#|S]acronym[E][#|S]sub[E][#|S]sup[E][#|S]input[E|D|type|name|value|checked|disabled|readonly|size|maxlength|src|alt|usemap|onselect|onchange|accept|align][]select[E|name|size|multiple|disabled|tabindex|onfocus|onblur|onchange][optgroup|option]optgroup[E|disabled|label][option]option[E|selected|disabled|label|value][]textarea[E|D|name|rows|cols|disabled|readonly|onselect|onchange][]label[E|for|accesskey|onfocus|onblur][#|S]button[E|D|name|value|type|disabled][#|p|T|div|U|W|table|G|object|applet|img|map|K|N|Q]h4[E|align][#|S]ins[E|cite|datetime][#|Y]h5[E|align][#|S]del[E|cite|datetime][#|Y]h6[E|align][#|S]div[E|align][#|Y]ul[E|type|compact][li]li[E|type|value][#|Y]ol[E|type|compact|start][li]dl[E|compact][dt|dd]dt[E][#|S]dd[E][#|Y]menu[E|compact][li]dir[E|compact][li]pre[E|width|xml:space][#|ZA]hr[E|align|noshade|size|width][]blockquote[E|cite][#|Y]address[E][#|S|p]center[E][#|Y]noframes[E][#|Y]isindex[A|B|prompt][]fieldset[E][#|legend|Y]legend[E|accesskey|align][#|S]table[E|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor][caption|col|colgroup|thead|tfoot|tbody|tr]caption[E|align][#|S]col[ZG][]colgroup[ZG][col]thead[ZF][tr]tr[ZF|bgcolor][th|td]th[E|ZE][#|Y]form[E|action|method|name|enctype|onsubmit|onreset|accept|accept-charset|target][#|X|R|Q]noscript[E][#|Y]td[E|ZE][#|Y]tfoot[ZF][tr]tbody[ZF][tr]area[E|D|shape|coords|href|nohref|alt|target][]base[id|href|target][]body[E|onload|onunload|background|bgcolor|text|link|vlink|alink][#|Y]");i=c("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected,preload,autoplay,loop,controls");f=c("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed,source");d=l.extend(c("td,th,iframe,video,object"),f);b=c("pre,script,style");e=c("colgroup,dd,dt,li,options,p,td,tfoot,th,thead,tr");l.html.Schema=function(p){var x=this,m={},n={},u=[],o;p=p||{};if(p.verify_html===false){p.valid_elements="*[*]"}if(p.valid_styles){o={};j(p.valid_styles,function(z,y){o[y]=l.explode(z)})}function v(y){return new RegExp("^"+y.replace(/([?+*])/g,".$1")+"$")}function r(F){var E,A,T,P,U,z,C,O,R,K,S,W,I,D,Q,y,M,B,V,X,J,N,H=/^([#+-])?([^\[\/]+)(?:\/([^\[]+))?(?:\[([^\]]+)\])?$/,L=/^([!\-])?(\w+::\w+|[^=:<]+)?(?:([=:<])(.*))?$/,G=/[*?+]/;if(F){F=h(F);if(m["@"]){M=m["@"].attributes;B=m["@"].attributesOrder}for(E=0,A=F.length;E<A;E++){z=H.exec(F[E]);if(z){Q=z[1];K=z[2];y=z[3];R=z[4];I={};D=[];C={attributes:I,attributesOrder:D};if(Q==="#"){C.paddEmpty=true}if(Q==="-"){C.removeEmpty=true}if(M){for(X in M){I[X]=M[X]}D.push.apply(D,B)}if(R){R=h(R,"|");for(T=0,P=R.length;T<P;T++){z=L.exec(R[T]);if(z){O={};W=z[1];S=z[2].replace(/::/g,":");Q=z[3];N=z[4];if(W==="!"){C.attributesRequired=C.attributesRequired||[];C.attributesRequired.push(S);O.required=true}if(W==="-"){delete I[S];D.splice(l.inArray(D,S),1);continue}if(Q){if(Q==="="){C.attributesDefault=C.attributesDefault||[];C.attributesDefault.push({name:S,value:N});O.defaultValue=N}if(Q===":"){C.attributesForced=C.attributesForced||[];C.attributesForced.push({name:S,value:N});O.forcedValue=N}if(Q==="<"){O.validValues=c(N,"?")}}if(G.test(S)){C.attributePatterns=C.attributePatterns||[];O.pattern=v(S);C.attributePatterns.push(O)}else{if(!I[S]){D.push(S)}I[S]=O}}}}if(!M&&K=="@"){M=I;B=D}if(y){C.outputName=K;m[y]=C}if(G.test(K)){C.pattern=v(K);u.push(C)}else{m[K]=C}}}}}function t(y){m={};u=[];r(y);j(g,function(A,z){n[z]=A.children})}function q(z){var y=/^(~)?(.+)$/;if(z){j(h(z),function(C){var B=y.exec(C),D=B[1]==="~"?"span":"div",A=B[2];n[A]=n[D];j(n,function(E,F){if(E[D]){E[A]=E[D]}})})}}function s(z){var y=/^([+\-]?)(\w+)\[([^\]]+)\]$/;if(z){j(h(z),function(D){var C=y.exec(D),A,B;if(C){B=C[1];if(B){A=n[C[2]]}else{A=n[C[2]]={"#comment":{}}}A=n[C[2]];j(h(C[3],"|"),function(E){if(B==="-"){delete A[E]}else{A[E]={}}})}})}}if(!p.valid_elements){j(g,function(z,y){m[y]={attributes:z.attributes,attributesOrder:z.attributesOrder};n[y]=z.children});j(h("strong/b,em/i"),function(y){y=h(y,"/");m[y[1]].outputName=y[0]});m.img.attributesDefault=[{name:"alt",value:""}];j(h("ol,ul,li,sub,sup,blockquote,tr,div,span,font,a,table,tbody"),function(y){m[y].removeEmpty=true});j(h("p,h1,h2,h3,h4,h5,h6,th,td,pre,div,address,caption"),function(y){m[y].paddEmpty=true})}else{t(p.valid_elements)}q(p.custom_elements);s(p.valid_children);r(p.extended_valid_elements);s("+ol[ul|ol],+ul[ul|ol]");if(p.invalid_elements){l.each(l.explode(p.invalid_elements),function(y){if(m[y]){delete m[y]}})}x.children=n;x.styles=o;x.getBoolAttrs=function(){return i};x.getBlockElements=function(){return k};x.getShortEndedElements=function(){return f};x.getSelfClosingElements=function(){return e};x.getNonEmptyElements=function(){return d};x.getWhiteSpaceElements=function(){return b};x.isValidChild=function(y,A){var z=n[y];return !!(z&&z[A])};x.getElementRule=function(y){var A=m[y],z;if(A){return A}z=u.length;while(z--){A=u[z];if(A.pattern.test(y)){return A}}};x.addValidElements=r;x.setValidElements=t;x.addCustomElements=q;x.addValidChildren=s};l.html.Schema.boolAttrMap=i;l.html.Schema.blockElementsMap=k})(tinymce);(function(a){a.html.SaxParser=function(c,e){var b=this,d=function(){};c=c||{};b.schema=e=e||new a.html.Schema();if(c.fix_self_closing!==false){c.fix_self_closing=true}a.each("comment cdata text start end pi doctype".split(" "),function(f){if(f){b[f]=c[f]||d}});b.parse=function(q){var A=this,f,m=0,G,j,l=[],B,K,t,N,F,k,p,x,I,r,E,o,J,n,H,M,L,z,D,h,g,u,s=0,v=a.html.Entities.decode,y;function C(O){var Q,P;Q=l.length;while(Q--){if(l[Q].name===O){break}}if(Q>=0){for(P=l.length-1;P>=Q;P--){O=l[P];if(O.valid){A.end(O.name)}}l.length=Q}}D=new RegExp("<(?:(?:!--([\\w\\W]*?)-->)|(?:!\\[CDATA\\[([\\w\\W]*?)\\]\\]>)|(?:!DOCTYPE([\\w\\W]*?)>)|(?:\\?([^\\s\\/<>]+) ?([\\w\\W]*?)[?/]>)|(?:\\/([^>]+)>)|(?:([^\\s\\/<>]+)\\s*((?:[^\"'>]+(?:(?:\"[^\"]*\")|(?:'[^']*')|[^>]*))*)>))","g");h=/([\w:\-]+)(?:\s*=\s*(?:(?:\"((?:\\.|[^\"])*)\")|(?:\'((?:\\.|[^\'])*)\')|([^>\s]+)))?/g;g={script:/<\/script[^>]*>/gi,style:/<\/style[^>]*>/gi,noscript:/<\/noscript[^>]*>/gi};F=e.getShortEndedElements();z=e.getSelfClosingElements();k=e.getBoolAttrs();x=c.validate;y=c.fix_self_closing;while(f=D.exec(q)){if(m<f.index){A.text(v(q.substr(m,f.index-m)))}if(G=f[6]){C(G.toLowerCase())}else{if(G=f[7]){G=G.toLowerCase();p=G in F;if(y&&z[G]&&l.length>0&&l[l.length-1].name===G){C(G)}if(!x||(I=e.getElementRule(G))){r=true;if(x){J=I.attributes;n=I.attributePatterns}if(o=f[8]){B=[];B.map={};o.replace(h,function(P,O,T,S,R){var U,Q;O=O.toLowerCase();T=O in k?O:v(T||S||R||"");if(x&&O.indexOf("data-")!==0){U=J[O];if(!U&&n){Q=n.length;while(Q--){U=n[Q];if(U.pattern.test(O)){break}}if(Q===-1){U=null}}if(!U){return}if(U.validValues&&!(T in U.validValues)){return}}B.map[O]=T;B.push({name:O,value:T})})}else{B=[];B.map={}}if(x){H=I.attributesRequired;M=I.attributesDefault;L=I.attributesForced;if(L){K=L.length;while(K--){E=L[K];N=E.name;u=E.value;if(u==="{$uid}"){u="mce_"+s++}B.map[N]=u;B.push({name:N,value:u})}}if(M){K=M.length;while(K--){E=M[K];N=E.name;if(!(N in B.map)){u=E.value;if(u==="{$uid}"){u="mce_"+s++}B.map[N]=u;B.push({name:N,value:u})}}}if(H){K=H.length;while(K--){if(H[K] in B.map){break}}if(K===-1){r=false}}if(B.map["data-mce-bogus"]){r=false}}if(r){A.start(G,B,p)}}else{r=false}if(j=g[G]){j.lastIndex=m=f.index+f[0].length;if(f=j.exec(q)){if(r){t=q.substr(m,f.index-m)}m=f.index+f[0].length}else{t=q.substr(m);m=q.length}if(r&&t.length>0){A.text(t,true)}if(r){A.end(G)}D.lastIndex=m;continue}if(!p){if(!o||o.indexOf("/")!=o.length-1){l.push({name:G,valid:r})}else{if(r){A.end(G)}}}}else{if(G=f[1]){A.comment(G)}else{if(G=f[2]){A.cdata(G)}else{if(G=f[3]){A.doctype(G)}else{if(G=f[4]){A.pi(G,f[5])}}}}}}m=f.index+f[0].length}if(m<q.length){A.text(v(q.substr(m)))}for(K=l.length-1;K>=0;K--){G=l[K];if(G.valid){A.end(G.name)}}}}})(tinymce);(function(d){var c=/^[ \t\r\n]*$/,e={"#text":3,"#comment":8,"#cdata":4,"#pi":7,"#doctype":10,"#document-fragment":11};function a(k,l,j){var i,h,f=j?"lastChild":"firstChild",g=j?"prev":"next";if(k[f]){return k[f]}if(k!==l){i=k[g];if(i){return i}for(h=k.parent;h&&h!==l;h=h.parent){i=h[g];if(i){return i}}}}function b(f,g){this.name=f;this.type=g;if(g===1){this.attributes=[];this.attributes.map={}}}d.extend(b.prototype,{replace:function(g){var f=this;if(g.parent){g.remove()}f.insert(g,f);f.remove();return f},attr:function(h,l){var f=this,g,j,k;if(typeof h!=="string"){for(j in h){f.attr(j,h[j])}return f}if(g=f.attributes){if(l!==k){if(l===null){if(h in g.map){delete g.map[h];j=g.length;while(j--){if(g[j].name===h){g=g.splice(j,1);return f}}}return f}if(h in g.map){j=g.length;while(j--){if(g[j].name===h){g[j].value=l;break}}}else{g.push({name:h,value:l})}g.map[h]=l;return f}else{return g.map[h]}}},clone:function(){var g=this,n=new b(g.name,g.type),h,f,m,j,k;if(m=g.attributes){k=[];k.map={};for(h=0,f=m.length;h<f;h++){j=m[h];if(j.name!=="id"){k[k.length]={name:j.name,value:j.value};k.map[j.name]=j.value}}n.attributes=k}n.value=g.value;n.shortEnded=g.shortEnded;return n},wrap:function(g){var f=this;f.parent.insert(g,f);g.append(f);return f},unwrap:function(){var f=this,h,g;for(h=f.firstChild;h;){g=h.next;f.insert(h,f,true);h=g}f.remove()},remove:function(){var f=this,h=f.parent,g=f.next,i=f.prev;if(h){if(h.firstChild===f){h.firstChild=g;if(g){g.prev=null}}else{i.next=g}if(h.lastChild===f){h.lastChild=i;if(i){i.next=null}}else{g.prev=i}f.parent=f.next=f.prev=null}return f},append:function(h){var f=this,g;if(h.parent){h.remove()}g=f.lastChild;if(g){g.next=h;h.prev=g;f.lastChild=h}else{f.lastChild=f.firstChild=h}h.parent=f;return h},insert:function(h,f,i){var g;if(h.parent){h.remove()}g=f.parent||this;if(i){if(f===g.firstChild){g.firstChild=h}else{f.prev.next=h}h.prev=f.prev;h.next=f;f.prev=h}else{if(f===g.lastChild){g.lastChild=h}else{f.next.prev=h}h.next=f.next;h.prev=f;f.next=h}h.parent=g;return h},getAll:function(g){var f=this,h,i=[];for(h=f.firstChild;h;h=a(h,f)){if(h.name===g){i.push(h)}}return i},empty:function(){var g=this,f,h,j;if(g.firstChild){f=[];for(j=g.firstChild;j;j=a(j,g)){f.push(j)}h=f.length;while(h--){j=f[h];j.parent=j.firstChild=j.lastChild=j.next=j.prev=null}}g.firstChild=g.lastChild=null;return g},isEmpty:function(k){var f=this,j=f.firstChild,h,g;if(j){do{if(j.type===1){if(j.attributes.map["data-mce-bogus"]){continue}if(k[j.name]){return false}h=j.attributes.length;while(h--){g=j.attributes[h].name;if(g==="name"||g.indexOf("data-")===0){return false}}}if((j.type===3&&!c.test(j.value))){return false}}while(j=a(j,f))}return true}});d.extend(b,{create:function(g,f){var i,h;i=new b(g,e[g]||1);if(f){for(h in f){i.attr(h,f[h])}}return i}});d.html.Node=b})(tinymce);(function(b){var a=b.html.Node;b.html.DomParser=function(g,h){var f=this,e={},d=[],i={},c={};g=g||{};g.validate="validate" in g?g.validate:true;g.root_name=g.root_name||"body";f.schema=h=h||new b.html.Schema();function j(m){var o,p,x,v,z,n,q,l,t,u,k,s,y,r;s=b.makeMap("tr,td,th,tbody,thead,tfoot,table");k=h.getNonEmptyElements();for(o=0;o<m.length;o++){p=m[o];if(!p.parent){continue}v=[p];for(x=p.parent;x&&!h.isValidChild(x.name,p.name)&&!s[x.name];x=x.parent){v.push(x)}if(x&&v.length>1){v.reverse();z=n=f.filterNode(v[0].clone());for(t=0;t<v.length-1;t++){if(h.isValidChild(n.name,v[t].name)){q=f.filterNode(v[t].clone());n.append(q)}else{q=n}for(l=v[t].firstChild;l&&l!=v[t+1];){r=l.next;q.append(l);l=r}n=q}if(!z.isEmpty(k)){x.insert(z,v[0],true);x.insert(p,z)}else{x.insert(p,v[0],true)}x=v[0];if(x.isEmpty(k)||x.firstChild===x.lastChild&&x.firstChild.name==="br"){x.empty().remove()}}else{if(p.parent){if(p.name==="li"){y=p.prev;if(y&&(y.name==="ul"||y.name==="ul")){y.append(p);continue}y=p.next;if(y&&(y.name==="ul"||y.name==="ul")){y.insert(p,y.firstChild,true);continue}p.wrap(f.filterNode(new a("ul",1)));continue}if(h.isValidChild(p.parent.name,"div")&&h.isValidChild("div",p.name)){p.wrap(f.filterNode(new a("div",1)))}else{if(p.name==="style"||p.name==="script"){p.empty().remove()}else{p.unwrap()}}}}}}f.filterNode=function(m){var l,k,n;if(k in e){n=i[k];if(n){n.push(m)}else{i[k]=[m]}}l=d.length;while(l--){k=d[l].name;if(k in m.attributes.map){n=c[k];if(n){n.push(m)}else{c[k]=[m]}}}return m};f.addNodeFilter=function(k,l){b.each(b.explode(k),function(m){var n=e[m];if(!n){e[m]=n=[]}n.push(l)})};f.addAttributeFilter=function(k,l){b.each(b.explode(k),function(m){var n;for(n=0;n<d.length;n++){if(d[n].name===m){d[n].callbacks.push(l);return}}d.push({name:m,callbacks:[l]})})};f.parse=function(u,m){var n,F,z,y,B,A,v,q,D,I,x,o,C,H=[],s,k,r,p,t;m=m||{};i={};c={};o=b.extend(b.makeMap("script,style,head,html,body,title,meta,param"),h.getBlockElements());t=h.getNonEmptyElements();p=h.children;x=g.validate;r=h.getWhiteSpaceElements();C=/^[ \t\r\n]+/;s=/[ \t\r\n]+$/;k=/[ \t\r\n]+/g;function G(l,J){var K=new a(l,J),L;if(l in e){L=i[l];if(L){L.push(K)}else{i[l]=[K]}}return K}function E(K){var L,l,J;for(L=K.prev;L&&L.type===3;){l=L.value.replace(s,"");if(l.length>0){L.value=l;L=L.prev}else{J=L.prev;L.remove();L=J}}}n=new b.html.SaxParser({validate:x,fix_self_closing:!x,cdata:function(l){z.append(G("#cdata",4)).value=l},text:function(K,l){var J;if(!r[z.name]){K=K.replace(k," ");if(z.lastChild&&o[z.lastChild.name]){K=K.replace(C,"")}}if(K.length!==0){J=G("#text",3);J.raw=!!l;z.append(J).value=K}},comment:function(l){z.append(G("#comment",8)).value=l},pi:function(l,J){z.append(G(l,7)).value=J;E(z)},doctype:function(J){var l;l=z.append(G("#doctype",10));l.value=J;E(z)},start:function(l,R,K){var P,M,L,J,N,S,Q,O;L=x?h.getElementRule(l):{};if(L){P=G(L.outputName||l,1);P.attributes=R;P.shortEnded=K;z.append(P);O=p[z.name];if(O&&p[P.name]&&!O[P.name]){H.push(P)}M=d.length;while(M--){N=d[M].name;if(N in R.map){D=c[N];if(D){D.push(P)}else{c[N]=[P]}}}if(o[l]){E(P)}if(!K){z=P}}},end:function(l){var N,K,M,J,L;K=x?h.getElementRule(l):{};if(K){if(o[l]){if(!r[z.name]){for(N=z.firstChild;N&&N.type===3;){M=N.value.replace(C,"");if(M.length>0){N.value=M;N=N.next}else{J=N.next;N.remove();N=J}}for(N=z.lastChild;N&&N.type===3;){M=N.value.replace(s,"");if(M.length>0){N.value=M;N=N.prev}else{J=N.prev;N.remove();N=J}}}N=z.prev;if(N&&N.type===3){M=N.value.replace(C,"");if(M.length>0){N.value=M}else{N.remove()}}}if(K.removeEmpty||K.paddEmpty){if(z.isEmpty(t)){if(K.paddEmpty){z.empty().append(new a("#text","3")).value="\u00a0"}else{if(!z.attributes.map.name){L=z.parent;z.empty().remove();z=L;return}}}}z=z.parent}}},h);F=z=new a(g.root_name,11);n.parse(u);if(x){j(H)}for(I in i){D=e[I];y=i[I];v=y.length;while(v--){if(!y[v].parent){y.splice(v,1)}}for(B=0,A=D.length;B<A;B++){D[B](y,I,m)}}for(B=0,A=d.length;B<A;B++){D=d[B];if(D.name in c){y=c[D.name];v=y.length;while(v--){if(!y[v].parent){y.splice(v,1)}}for(v=0,q=D.callbacks.length;v<q;v++){D.callbacks[v](y,D.name,m)}}}return F};if(g.remove_trailing_brs){f.addNodeFilter("br",function(n,m){var r,q=n.length,o,u=h.getBlockElements(),k=h.getNonEmptyElements(),s,p,t;for(r=0;r<q;r++){o=n[r];s=o.parent;if(u[o.parent.name]&&o===s.lastChild){p=o.prev;while(p){t=p.name;if(t!=="span"||p.attr("data-mce-type")!=="bookmark"){if(t!=="br"){break}if(t==="br"){o=null;break}}p=p.prev}if(o){o.remove();if(s.isEmpty(k)){elementRule=h.getElementRule(s.name);if(elementRule.removeEmpty){s.remove()}else{if(elementRule.paddEmpty){s.empty().append(new b.html.Node("#text",3)).value="\u00a0"}}}}}}})}}})(tinymce);tinymce.html.Writer=function(e){var c=[],a,b,d,f,g;e=e||{};a=e.indent;b=tinymce.makeMap(e.indent_before||"");d=tinymce.makeMap(e.indent_after||"");f=tinymce.html.Entities.getEncodeFunc(e.entity_encoding||"raw",e.entities);g=e.element_format=="html";return{start:function(m,k,p){var n,j,h,o;if(a&&b[m]&&c.length>0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}c.push("<",m);if(k){for(n=0,j=k.length;n<j;n++){h=k[n];c.push(" ",h.name,'="',f(h.value,true),'"')}}if(!p||g){c[c.length]=">"}else{c[c.length]=" />"}if(p&&a&&d[m]&&c.length>0){o=c[c.length-1];if(o.length>0&&o!=="\n"){c.push("\n")}}},end:function(h){var i;c.push("</",h,">");if(a&&d[h]&&c.length>0){i=c[c.length-1];if(i.length>0&&i!=="\n"){c.push("\n")}}},text:function(i,h){if(i.length>0){c[c.length]=h?i:f(i)}},cdata:function(h){c.push("<![CDATA[",h,"]]>")},comment:function(h){c.push("<!--",h,"-->")},pi:function(h,i){if(i){c.push("<?",h," ",i,"?>")}else{c.push("<?",h,"?>")}if(a){c.push("\n")}},doctype:function(h){c.push("<!DOCTYPE",h,">",a?"\n":"")},reset:function(){c.length=0},getContent:function(){return c.join("").replace(/\n$/,"")}}};(function(a){a.html.Serializer=function(c,d){var b=this,e=new a.html.Writer(c);c=c||{};c.validate="validate" in c?c.validate:true;b.schema=d=d||new a.html.Schema();b.writer=e;b.serialize=function(h){var g,i;i=c.validate;g={3:function(k,j){e.text(k.value,k.raw)},8:function(j){e.comment(j.value)},7:function(j){e.pi(j.name,j.value)},10:function(j){e.doctype(j.value)},4:function(j){e.cdata(j.value)},11:function(j){if((j=j.firstChild)){do{f(j)}while(j=j.next)}}};e.reset();function f(k){var t=g[k.type],j,o,s,r,p,u,n,m,q;if(!t){j=k.name;o=k.shortEnded;s=k.attributes;if(i&&s&&s.length>1){u=[];u.map={};q=d.getElementRule(k.name);for(n=0,m=q.attributesOrder.length;n<m;n++){r=q.attributesOrder[n];if(r in s.map){p=s.map[r];u.map[r]=p;u.push({name:r,value:p})}}for(n=0,m=s.length;n<m;n++){r=s[n].name;if(!(r in u.map)){p=s.map[r];u.map[r]=p;u.push({name:r,value:p})}}s=u}e.start(k.name,s,o);if(!o){if((k=k.firstChild)){do{f(k)}while(k=k.next)}e.end(j)}}else{t(k)}}if(h.type==1&&!c.inner){f(h)}else{g[11](h)}return e.getContent()}}})(tinymce);(function(h){var f=h.each,e=h.is,d=h.isWebKit,b=h.isIE,c=h.html.Entities,a=/^([a-z0-9],?)+$/i,g=h.html.Schema.blockElementsMap,i=/^[ \t\r\n]*$/;h.create("tinymce.dom.DOMUtils",{doc:null,root:null,files:null,pixelStyles:/^(top|left|bottom|right|width|height|borderWidth)$/,props:{"for":"htmlFor","class":"className",className:"className",checked:"checked",disabled:"disabled",maxlength:"maxLength",readonly:"readOnly",selected:"selected",value:"value",id:"id",name:"name",type:"type"},DOMUtils:function(n,l){var k=this,j;k.doc=n;k.win=window;k.files={};k.cssFlicker=false;k.counter=0;k.stdMode=!h.isIE||n.documentMode>=8;k.boxModel=!h.isIE||n.compatMode=="CSS1Compat"||k.stdMode;k.hasOuterHTML="outerHTML" in n.createElement("a");k.settings=l=h.extend({keep_values:false,hex_colors:1},l);k.schema=l.schema;k.styles=new h.html.Styles({url_converter:l.url_converter,url_converter_scope:l.url_converter_scope},l.schema);if(h.isIE6){try{n.execCommand("BackgroundImageCache",false,true)}catch(m){k.cssFlicker=true}}if(b){("abbr article aside audio canvas details figcaption figure footer header hgroup mark menu meter nav output progress section summary time video").replace(/\w+/g,function(o){n.createElement(o)})}h.addUnload(k.destroy,k)},getRoot:function(){var j=this,k=j.settings;return(k&&j.get(k.root_element))||j.doc.body},getViewPort:function(k){var l,j;k=!k?this.win:k;l=k.document;j=this.boxModel?l.documentElement:l.body;return{x:k.pageXOffset||j.scrollLeft,y:k.pageYOffset||j.scrollTop,w:k.innerWidth||j.clientWidth,h:k.innerHeight||j.clientHeight}},getRect:function(m){var l,j=this,k;m=j.get(m);l=j.getPos(m);k=j.getSize(m);return{x:l.x,y:l.y,w:k.w,h:k.h}},getSize:function(m){var k=this,j,l;m=k.get(m);j=k.getStyle(m,"width");l=k.getStyle(m,"height");if(j.indexOf("px")===-1){j=0}if(l.indexOf("px")===-1){l=0}return{w:parseInt(j)||m.offsetWidth||m.clientWidth,h:parseInt(l)||m.offsetHeight||m.clientHeight}},getParent:function(l,k,j){return this.getParents(l,k,j,false)},getParents:function(u,p,l,s){var k=this,j,m=k.settings,q=[];u=k.get(u);s=s===undefined;if(m.strict_root){l=l||k.getRoot()}if(e(p,"string")){j=p;if(p==="*"){p=function(o){return o.nodeType==1}}else{p=function(o){return k.is(o,j)}}}while(u){if(u==l||!u.nodeType||u.nodeType===9){break}if(!p||p(u)){if(s){q.push(u)}else{return u}}u=u.parentNode}return s?q:null},get:function(j){var k;if(j&&this.doc&&typeof(j)=="string"){k=j;j=this.doc.getElementById(j);if(j&&j.id!==k){return this.doc.getElementsByName(k)[1]}}return j},getNext:function(k,j){return this._findSib(k,j,"nextSibling")},getPrev:function(k,j){return this._findSib(k,j,"previousSibling")},add:function(m,q,j,l,o){var k=this;return this.run(m,function(s){var r,n;r=e(q,"string")?k.doc.createElement(q):q;k.setAttribs(r,j);if(l){if(l.nodeType){r.appendChild(l)}else{k.setHTML(r,l)}}return !o?s.appendChild(r):r})},create:function(l,j,k){return this.add(this.doc.createElement(l),l,j,k,1)},createHTML:function(r,j,p){var q="",m=this,l;q+="<"+r;for(l in j){if(j.hasOwnProperty(l)){q+=" "+l+'="'+m.encode(j[l])+'"'}}if(typeof(p)!="undefined"){return q+">"+p+"</"+r+">"}return q+" />"},remove:function(j,k){return this.run(j,function(m){var n,l=m.parentNode;if(!l){return null}if(k){while(n=m.firstChild){if(!h.isIE||n.nodeType!==3||n.nodeValue){l.insertBefore(n,m)}else{m.removeChild(n)}}}return l.removeChild(m)})},setStyle:function(m,j,k){var l=this;return l.run(m,function(p){var o,n;o=p.style;j=j.replace(/-(\D)/g,function(r,q){return q.toUpperCase()});if(l.pixelStyles.test(j)&&(h.is(k,"number")||/^[\-0-9\.]+$/.test(k))){k+="px"}switch(j){case"opacity":if(b){o.filter=k===""?"":"alpha(opacity="+(k*100)+")";if(!m.currentStyle||!m.currentStyle.hasLayout){o.display="inline-block"}}o[j]=o["-moz-opacity"]=o["-khtml-opacity"]=k||"";break;case"float":b?o.styleFloat=k:o.cssFloat=k;break;default:o[j]=k||""}if(l.settings.update_styles){l.setAttrib(p,"data-mce-style")}})},getStyle:function(m,j,l){m=this.get(m);if(!m){return}if(this.doc.defaultView&&l){j=j.replace(/[A-Z]/g,function(n){return"-"+n});try{return this.doc.defaultView.getComputedStyle(m,null).getPropertyValue(j)}catch(k){return null}}j=j.replace(/-(\D)/g,function(o,n){return n.toUpperCase()});if(j=="float"){j=b?"styleFloat":"cssFloat"}if(m.currentStyle&&l){return m.currentStyle[j]}return m.style?m.style[j]:undefined},setStyles:function(m,n){var k=this,l=k.settings,j;j=l.update_styles;l.update_styles=0;f(n,function(o,p){k.setStyle(m,p,o)});l.update_styles=j;if(l.update_styles){k.setAttrib(m,l.cssText)}},removeAllAttribs:function(j){return this.run(j,function(m){var l,k=m.attributes;for(l=k.length-1;l>=0;l--){m.removeAttributeNode(k.item(l))}})},setAttrib:function(l,m,j){var k=this;if(!l||!m){return}if(k.settings.strict){m=m.toLowerCase()}return this.run(l,function(o){var n=k.settings;switch(m){case"style":if(!e(j,"string")){f(j,function(p,q){k.setStyle(o,q,p)});return}if(n.keep_values){if(j&&!k._isRes(j)){o.setAttribute("data-mce-style",j,2)}else{o.removeAttribute("data-mce-style",2)}}o.style.cssText=j;break;case"class":o.className=j||"";break;case"src":case"href":if(n.keep_values){if(n.url_converter){j=n.url_converter.call(n.url_converter_scope||k,j,m,o)}k.setAttrib(o,"data-mce-"+m,j,2)}break;case"shape":o.setAttribute("data-mce-style",j);break}if(e(j)&&j!==null&&j.length!==0){o.setAttribute(m,""+j,2)}else{o.removeAttribute(m,2)}})},setAttribs:function(k,l){var j=this;return this.run(k,function(m){f(l,function(o,p){j.setAttrib(m,p,o)})})},getAttrib:function(m,o,l){var j,k=this;m=k.get(m);if(!m||m.nodeType!==1){return false}if(!e(l)){l=""}if(/^(src|href|style|coords|shape)$/.test(o)){j=m.getAttribute("data-mce-"+o);if(j){return j}}if(b&&k.props[o]){j=m[k.props[o]];j=j&&j.nodeValue?j.nodeValue:j}if(!j){j=m.getAttribute(o,2)}if(/^(checked|compact|declare|defer|disabled|ismap|multiple|nohref|noshade|nowrap|readonly|selected)$/.test(o)){if(m[k.props[o]]===true&&j===""){return o}return j?o:""}if(m.nodeName==="FORM"&&m.getAttributeNode(o)){return m.getAttributeNode(o).nodeValue}if(o==="style"){j=j||m.style.cssText;if(j){j=k.serializeStyle(k.parseStyle(j),m.nodeName);if(k.settings.keep_values&&!k._isRes(j)){m.setAttribute("data-mce-style",j)}}}if(d&&o==="class"&&j){j=j.replace(/(apple|webkit)\-[a-z\-]+/gi,"")}if(b){switch(o){case"rowspan":case"colspan":if(j===1){j=""}break;case"size":if(j==="+0"||j===20||j===0){j=""}break;case"width":case"height":case"vspace":case"checked":case"disabled":case"readonly":if(j===0){j=""}break;case"hspace":if(j===-1){j=""}break;case"maxlength":case"tabindex":if(j===32768||j===2147483647||j==="32768"){j=""}break;case"multiple":case"compact":case"noshade":case"nowrap":if(j===65535){return o}return l;case"shape":j=j.toLowerCase();break;default:if(o.indexOf("on")===0&&j){j=h._replace(/^function\s+\w+\(\)\s+\{\s+(.*)\s+\}$/,"$1",""+j)}}}return(j!==undefined&&j!==null&&j!=="")?""+j:l},getPos:function(s,m){var k=this,j=0,q=0,o,p=k.doc,l;s=k.get(s);m=m||p.body;if(s){if(b&&!k.stdMode){s=s.getBoundingClientRect();o=k.boxModel?p.documentElement:p.body;j=k.getStyle(k.select("html")[0],"borderWidth");j=(j=="medium"||k.boxModel&&!k.isIE6)&&2||j;return{x:s.left+o.scrollLeft-j,y:s.top+o.scrollTop-j}}l=s;while(l&&l!=m&&l.nodeType){j+=l.offsetLeft||0;q+=l.offsetTop||0;l=l.offsetParent}l=s.parentNode;while(l&&l!=m&&l.nodeType){j-=l.scrollLeft||0;q-=l.scrollTop||0;l=l.parentNode}}return{x:j,y:q}},parseStyle:function(j){return this.styles.parse(j)},serializeStyle:function(k,j){return this.styles.serialize(k,j)},loadCSS:function(j){var l=this,m=l.doc,k;if(!j){j=""}k=l.select("head")[0];f(j.split(","),function(n){var o;if(l.files[n]){return}l.files[n]=true;o=l.create("link",{rel:"stylesheet",href:h._addVer(n)});if(b&&m.documentMode&&m.recalc){o.onload=function(){if(m.recalc){m.recalc()}o.onload=null}}k.appendChild(o)})},addClass:function(j,k){return this.run(j,function(l){var m;if(!k){return 0}if(this.hasClass(l,k)){return l.className}m=this.removeClass(l,k);return l.className=(m!=""?(m+" "):"")+k})},removeClass:function(l,m){var j=this,k;return j.run(l,function(o){var n;if(j.hasClass(o,m)){if(!k){k=new RegExp("(^|\\s+)"+m+"(\\s+|$)","g")}n=o.className.replace(k," ");n=h.trim(n!=" "?n:"");o.className=n;if(!n){o.removeAttribute("class");o.removeAttribute("className")}return n}return o.className})},hasClass:function(k,j){k=this.get(k);if(!k||!j){return false}return(" "+k.className+" ").indexOf(" "+j+" ")!==-1},show:function(j){return this.setStyle(j,"display","block")},hide:function(j){return this.setStyle(j,"display","none")},isHidden:function(j){j=this.get(j);return !j||j.style.display=="none"||this.getStyle(j,"display")=="none"},uniqueId:function(j){return(!j?"mce_":j)+(this.counter++)},setHTML:function(l,k){var j=this;return j.run(l,function(n){if(b){while(n.firstChild){n.removeChild(n.firstChild)}try{n.innerHTML="<br />"+k;n.removeChild(n.firstChild)}catch(m){n=j.create("div");n.innerHTML="<br />"+k;f(n.childNodes,function(p,o){if(o){n.appendChild(p)}})}}else{n.innerHTML=k}return k})},getOuterHTML:function(l){var k,j=this;l=j.get(l);if(!l){return null}if(l.nodeType===1&&j.hasOuterHTML){return l.outerHTML}k=(l.ownerDocument||j.doc).createElement("body");k.appendChild(l.cloneNode(true));return k.innerHTML},setOuterHTML:function(m,k,n){var j=this;function l(p,o,r){var s,q;q=r.createElement("body");q.innerHTML=o;s=q.lastChild;while(s){j.insertAfter(s.cloneNode(true),p);s=s.previousSibling}j.remove(p)}return this.run(m,function(p){p=j.get(p);if(p.nodeType==1){n=n||p.ownerDocument||j.doc;if(b){try{if(b&&p.nodeType==1){p.outerHTML=k}else{l(p,k,n)}}catch(o){l(p,k,n)}}else{l(p,k,n)}}})},decode:c.decode,encode:c.encodeAllRaw,insertAfter:function(j,k){k=this.get(k);return this.run(j,function(m){var l,n;l=k.parentNode;n=k.nextSibling;if(n){l.insertBefore(m,n)}else{l.appendChild(m)}return m})},isBlock:function(k){var j=k.nodeType;if(j){return !!(j===1&&g[k.nodeName])}return !!g[k]},replace:function(p,m,j){var l=this;if(e(m,"array")){p=p.cloneNode(true)}return l.run(m,function(k){if(j){f(h.grep(k.childNodes),function(n){p.appendChild(n)})}return k.parentNode.replaceChild(p,k)})},rename:function(m,j){var l=this,k;if(m.nodeName!=j.toUpperCase()){k=l.create(j);f(l.getAttribs(m),function(n){l.setAttrib(k,n.nodeName,l.getAttrib(m,n.nodeName))});l.replace(k,m,1)}return k||m},findCommonAncestor:function(l,j){var m=l,k;while(m){k=j;while(k&&m!=k){k=k.parentNode}if(m==k){break}m=m.parentNode}if(!m&&l.ownerDocument){return l.ownerDocument.documentElement}return m},toHex:function(j){var l=/^\s*rgb\s*?\(\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?,\s*?([0-9]+)\s*?\)\s*$/i.exec(j);function k(m){m=parseInt(m).toString(16);return m.length>1?m:"0"+m}if(l){j="#"+k(l[1])+k(l[2])+k(l[3]);return j}return j},getClasses:function(){var n=this,j=[],m,o={},p=n.settings.class_filter,l;if(n.classes){return n.classes}function q(r){f(r.imports,function(s){q(s)});f(r.cssRules||r.rules,function(s){switch(s.type||1){case 1:if(s.selectorText){f(s.selectorText.split(","),function(t){t=t.replace(/^\s*|\s*$|^\s\./g,"");if(/\.mce/.test(t)||!/\.[\w\-]+$/.test(t)){return}l=t;t=h._replace(/.*\.([a-z0-9_\-]+).*/i,"$1",t);if(p&&!(t=p(t,l))){return}if(!o[t]){j.push({"class":t});o[t]=1}})}break;case 3:q(s.styleSheet);break}})}try{f(n.doc.styleSheets,q)}catch(k){}if(j.length>0){n.classes=j}return j},run:function(m,l,k){var j=this,n;if(j.doc&&typeof(m)==="string"){m=j.get(m)}if(!m){return false}k=k||this;if(!m.nodeType&&(m.length||m.length===0)){n=[];f(m,function(p,o){if(p){if(typeof(p)=="string"){p=j.doc.getElementById(p)}n.push(l.call(k,p,o))}});return n}return l.call(k,m)},getAttribs:function(k){var j;k=this.get(k);if(!k){return[]}if(b){j=[];if(k.nodeName=="OBJECT"){return k.attributes}if(k.nodeName==="OPTION"&&this.getAttrib(k,"selected")){j.push({specified:1,nodeName:"selected"})}k.cloneNode(false).outerHTML.replace(/<\/?[\w:\-]+ ?|=[\"][^\"]+\"|=\'[^\']+\'|=[\w\-]+|>/gi,"").replace(/[\w:\-]+/gi,function(l){j.push({specified:1,nodeName:l})});return j}return k.attributes},isEmpty:function(o,p){var k=this,m,j,n,q,l;o=o.firstChild;if(o){q=new h.dom.TreeWalker(o);p=p||k.schema?k.schema.getNonEmptyElements():null;do{n=o.nodeType;if(n===1){if(o.getAttribute("data-mce-bogus")){continue}if(p&&p[o.nodeName.toLowerCase()]){return false}j=k.getAttribs(o);m=o.attributes.length;while(m--){l=o.attributes[m].nodeName;if(l==="name"||l.indexOf("data-")===0){return false}}}if((n===3&&!i.test(o.nodeValue))){return false}}while(o=q.next())}return true},destroy:function(k){var j=this;if(j.events){j.events.destroy()}j.win=j.doc=j.root=j.events=null;if(!k){h.removeUnload(j.destroy)}},createRng:function(){var j=this.doc;return j.createRange?j.createRange():new h.dom.Range(this)},nodeIndex:function(o,p){var j=0,m,n,l,k;if(o){for(m=o.nodeType,o=o.previousSibling,n=o;o;o=o.previousSibling){l=o.nodeType;if(p&&l==3){k=false;try{k=o.nodeValue.length}catch(q){}if(l==m||!k){continue}}j++;m=l}}return j},split:function(n,m,q){var s=this,j=s.createRng(),o,l,p;function k(v){var t,r=v.childNodes,u=v.nodeType;if(u==1&&v.getAttribute("data-mce-type")=="bookmark"){return}for(t=r.length-1;t>=0;t--){k(r[t])}if(u!=9){if(u==3&&v.nodeValue.length>0){if(!s.isBlock(v.parentNode)||h.trim(v.nodeValue).length>0){return}}else{if(u==1){r=v.childNodes;if(r.length==1&&r[0]&&r[0].nodeType==1&&r[0].getAttribute("data-mce-type")=="bookmark"){v.parentNode.insertBefore(r[0],v)}if(r.length||/^(br|hr|input|img)$/i.test(v.nodeName)){return}}}s.remove(v)}return v}if(n&&m){j.setStart(n.parentNode,s.nodeIndex(n));j.setEnd(m.parentNode,s.nodeIndex(m));o=j.extractContents();j=s.createRng();j.setStart(m.parentNode,s.nodeIndex(m)+1);j.setEnd(n.parentNode,s.nodeIndex(n)+1);l=j.extractContents();p=n.parentNode;p.insertBefore(k(o),n);if(q){p.replaceChild(q,m)}else{p.insertBefore(m,n)}p.insertBefore(k(l),n);s.remove(n);return q||m}},bind:function(n,j,m,l){var k=this;if(!k.events){k.events=new h.dom.EventUtils()}return k.events.add(n,j,m,l||this)},unbind:function(m,j,l){var k=this;if(!k.events){k.events=new h.dom.EventUtils()}return k.events.remove(m,j,l)},_findSib:function(m,j,k){var l=this,n=j;if(m){if(e(n,"string")){n=function(o){return l.is(o,j)}}for(m=m[k];m;m=m[k]){if(n(m)){return m}}}return null},_isRes:function(j){return/^(top|left|bottom|right|width|height)/i.test(j)||/;\s*(top|left|bottom|right|width|height)/i.test(j)}});h.DOM=new h.dom.DOMUtils(document,{process_html:0})})(tinymce);(function(a){function b(c){var N=this,e=c.doc,S=0,E=1,j=2,D=true,R=false,U="startOffset",h="startContainer",P="endContainer",z="endOffset",k=tinymce.extend,n=c.nodeIndex;k(N,{startContainer:e,startOffset:0,endContainer:e,endOffset:0,collapsed:D,commonAncestorContainer:e,START_TO_START:0,START_TO_END:1,END_TO_END:2,END_TO_START:3,setStart:q,setEnd:s,setStartBefore:g,setStartAfter:I,setEndBefore:J,setEndAfter:u,collapse:A,selectNode:x,selectNodeContents:F,compareBoundaryPoints:v,deleteContents:p,extractContents:H,cloneContents:d,insertNode:C,surroundContents:M,cloneRange:K});function q(V,t){B(D,V,t)}function s(V,t){B(R,V,t)}function g(t){q(t.parentNode,n(t))}function I(t){q(t.parentNode,n(t)+1)}function J(t){s(t.parentNode,n(t))}function u(t){s(t.parentNode,n(t)+1)}function A(t){if(t){N[P]=N[h];N[z]=N[U]}else{N[h]=N[P];N[U]=N[z]}N.collapsed=D}function x(t){g(t);u(t)}function F(t){q(t,0);s(t,t.nodeType===1?t.childNodes.length:t.nodeValue.length)}function v(Y,t){var ab=N[h],W=N[U],aa=N[P],V=N[z],Z=t.startContainer,ad=t.startOffset,X=t.endContainer,ac=t.endOffset;if(Y===0){return G(ab,W,Z,ad)}if(Y===1){return G(aa,V,Z,ad)}if(Y===2){return G(aa,V,X,ac)}if(Y===3){return G(ab,W,X,ac)}}function p(){m(j)}function H(){return m(S)}function d(){return m(E)}function C(Y){var V=this[h],t=this[U],X,W;if((V.nodeType===3||V.nodeType===4)&&V.nodeValue){if(!t){V.parentNode.insertBefore(Y,V)}else{if(t>=V.nodeValue.length){c.insertAfter(Y,V)}else{X=V.splitText(t);V.parentNode.insertBefore(Y,X)}}}else{if(V.childNodes.length>0){W=V.childNodes[t]}if(W){V.insertBefore(Y,W)}else{V.appendChild(Y)}}}function M(V){var t=N.extractContents();N.insertNode(V);V.appendChild(t);N.selectNode(V)}function K(){return k(new b(c),{startContainer:N[h],startOffset:N[U],endContainer:N[P],endOffset:N[z],collapsed:N.collapsed,commonAncestorContainer:N.commonAncestorContainer})}function O(t,V){var W;if(t.nodeType==3){return t}if(V<0){return t}W=t.firstChild;while(W&&V>0){--V;W=W.nextSibling}if(W){return W}return t}function l(){return(N[h]==N[P]&&N[U]==N[z])}function G(X,Z,V,Y){var aa,W,t,ab,ad,ac;if(X==V){if(Z==Y){return 0}if(Z<Y){return -1}return 1}aa=V;while(aa&&aa.parentNode!=X){aa=aa.parentNode}if(aa){W=0;t=X.firstChild;while(t!=aa&&W<Z){W++;t=t.nextSibling}if(Z<=W){return -1}return 1}aa=X;while(aa&&aa.parentNode!=V){aa=aa.parentNode}if(aa){W=0;t=V.firstChild;while(t!=aa&&W<Y){W++;t=t.nextSibling}if(W<Y){return -1}return 1}ab=c.findCommonAncestor(X,V);ad=X;while(ad&&ad.parentNode!=ab){ad=ad.parentNode}if(!ad){ad=ab}ac=V;while(ac&&ac.parentNode!=ab){ac=ac.parentNode}if(!ac){ac=ab}if(ad==ac){return 0}t=ab.firstChild;while(t){if(t==ad){return -1}if(t==ac){return 1}t=t.nextSibling}}function B(V,Y,X){var t,W;if(V){N[h]=Y;N[U]=X}else{N[P]=Y;N[z]=X}t=N[P];while(t.parentNode){t=t.parentNode}W=N[h];while(W.parentNode){W=W.parentNode}if(W==t){if(G(N[h],N[U],N[P],N[z])>0){N.collapse(V)}}else{N.collapse(V)}N.collapsed=l();N.commonAncestorContainer=c.findCommonAncestor(N[h],N[P])}function m(ab){var aa,X=0,ad=0,V,Z,W,Y,t,ac;if(N[h]==N[P]){return f(ab)}for(aa=N[P],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[h]){return r(aa,ab)}++X}for(aa=N[h],V=aa.parentNode;V;aa=V,V=V.parentNode){if(V==N[P]){return T(aa,ab)}++ad}Z=ad-X;W=N[h];while(Z>0){W=W.parentNode;Z--}Y=N[P];while(Z<0){Y=Y.parentNode;Z++}for(t=W.parentNode,ac=Y.parentNode;t!=ac;t=t.parentNode,ac=ac.parentNode){W=t;Y=ac}return o(W,Y,ab)}function f(Z){var ab,Y,X,aa,t,W,V;if(Z!=j){ab=e.createDocumentFragment()}if(N[U]==N[z]){return ab}if(N[h].nodeType==3){Y=N[h].nodeValue;X=Y.substring(N[U],N[z]);if(Z!=E){N[h].deleteData(N[U],N[z]-N[U]);N.collapse(D)}if(Z==j){return}ab.appendChild(e.createTextNode(X));return ab}aa=O(N[h],N[U]);t=N[z]-N[U];while(t>0){W=aa.nextSibling;V=y(aa,Z);if(ab){ab.appendChild(V)}--t;aa=W}if(Z!=E){N.collapse(D)}return ab}function r(ab,Y){var aa,Z,V,t,X,W;if(Y!=j){aa=e.createDocumentFragment()}Z=i(ab,Y);if(aa){aa.appendChild(Z)}V=n(ab);t=V-N[U];if(t<=0){if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}Z=ab.previousSibling;while(t>0){X=Z.previousSibling;W=y(Z,Y);if(aa){aa.insertBefore(W,aa.firstChild)}--t;Z=X}if(Y!=E){N.setEndBefore(ab);N.collapse(R)}return aa}function T(Z,Y){var ab,V,aa,t,X,W;if(Y!=j){ab=e.createDocumentFragment()}aa=Q(Z,Y);if(ab){ab.appendChild(aa)}V=n(Z);++V;t=N[z]-V;aa=Z.nextSibling;while(t>0){X=aa.nextSibling;W=y(aa,Y);if(ab){ab.appendChild(W)}--t;aa=X}if(Y!=E){N.setStartAfter(Z);N.collapse(D)}return ab}function o(Z,t,ac){var W,ae,Y,aa,ab,V,ad,X;if(ac!=j){ae=e.createDocumentFragment()}W=Q(Z,ac);if(ae){ae.appendChild(W)}Y=Z.parentNode;aa=n(Z);ab=n(t);++aa;V=ab-aa;ad=Z.nextSibling;while(V>0){X=ad.nextSibling;W=y(ad,ac);if(ae){ae.appendChild(W)}ad=X;--V}W=i(t,ac);if(ae){ae.appendChild(W)}if(ac!=E){N.setStartAfter(Z);N.collapse(D)}return ae}function i(aa,ab){var W=O(N[P],N[z]-1),ac,Z,Y,t,V,X=W!=N[P];if(W==aa){return L(W,X,R,ab)}ac=W.parentNode;Z=L(ac,R,R,ab);while(ac){while(W){Y=W.previousSibling;t=L(W,X,R,ab);if(ab!=j){Z.insertBefore(t,Z.firstChild)}X=D;W=Y}if(ac==aa){return Z}W=ac.previousSibling;ac=ac.parentNode;V=L(ac,R,R,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function Q(aa,ab){var X=O(N[h],N[U]),Y=X!=N[h],ac,Z,W,t,V;if(X==aa){return L(X,Y,D,ab)}ac=X.parentNode;Z=L(ac,R,D,ab);while(ac){while(X){W=X.nextSibling;t=L(X,Y,D,ab);if(ab!=j){Z.appendChild(t)}Y=D;X=W}if(ac==aa){return Z}X=ac.nextSibling;ac=ac.parentNode;V=L(ac,R,D,ab);if(ab!=j){V.appendChild(Z)}Z=V}}function L(t,Y,ab,ac){var X,W,Z,V,aa;if(Y){return y(t,ac)}if(t.nodeType==3){X=t.nodeValue;if(ab){V=N[U];W=X.substring(V);Z=X.substring(0,V)}else{V=N[z];W=X.substring(0,V);Z=X.substring(V)}if(ac!=E){t.nodeValue=Z}if(ac==j){return}aa=t.cloneNode(R);aa.nodeValue=W;return aa}if(ac==j){return}return t.cloneNode(R)}function y(V,t){if(t!=j){return t==E?V.cloneNode(D):V}V.parentNode.removeChild(V)}}a.Range=b})(tinymce.dom);(function(){function a(g){var i=this,j="\uFEFF",e,h,d=g.dom,c=true,f=false;function b(){var n=g.getRng(),k=d.createRng(),m,o;m=n.item?n.item(0):n.parentElement();if(m.ownerDocument!=d.doc){return k}o=g.isCollapsed();if(n.item||!m.hasChildNodes()){if(o){k.setStart(m,0);k.setEnd(m,0)}else{k.setStart(m.parentNode,d.nodeIndex(m));k.setEnd(k.startContainer,k.startOffset+1)}return k}function l(s){var u,q,t,p,A=0,x,y,z,r,v;r=n.duplicate();r.collapse(s);u=d.create("a");z=r.parentElement();if(!z.hasChildNodes()){k[s?"setStart":"setEnd"](z,0);return}z.appendChild(u);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){k[s?"setStartAfter":"setEndAfter"](z);d.remove(u);return}p=tinymce.grep(z.childNodes);x=p.length-1;while(A<=x){y=Math.floor((A+x)/2);z.insertBefore(u,p[y]);r.moveToElementText(u);v=n.compareEndPoints(s?"StartToStart":"EndToEnd",r);if(v>0){A=y+1}else{if(v<0){x=y-1}else{found=true;break}}}q=v>0||y==0?u.nextSibling:u.previousSibling;if(q.nodeType==1){d.remove(u);t=d.nodeIndex(q);q=q.parentNode;if(!s||y>0){t++}}else{if(v>0||y==0){r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=r.text.length}else{r.setEndPoint(s?"StartToStart":"EndToEnd",n);t=q.nodeValue.length-r.text.length}d.remove(u)}k[s?"setStart":"setEnd"](q,t)}l(true);if(!o){l()}return k}this.addRange=function(k){var p,n,m,r,u,s,t=g.dom.doc,o=t.body;function l(B){var x,A,v,z,y;v=d.create("a");x=B?m:u;A=B?r:s;z=p.duplicate();if(x==t||x==t.documentElement){x=o;A=0}if(x.nodeType==3){x.parentNode.insertBefore(v,x);z.moveToElementText(v);z.moveStart("character",A);d.remove(v);p.setEndPoint(B?"StartToStart":"EndToEnd",z)}else{y=x.childNodes;if(y.length){if(A>=y.length){d.insertAfter(v,y[y.length-1])}else{x.insertBefore(v,y[A])}z.moveToElementText(v)}else{v=t.createTextNode(j);x.appendChild(v);z.moveToElementText(v.parentNode);z.collapse(c)}p.setEndPoint(B?"StartToStart":"EndToEnd",z);d.remove(v)}}this.destroy();m=k.startContainer;r=k.startOffset;u=k.endContainer;s=k.endOffset;p=o.createTextRange();if(m==u&&m.nodeType==1&&r==s-1){if(r==s-1){try{n=o.createControlRange();n.addElement(m.childNodes[r]);n.select();return}catch(q){}}}l(true);l();p.select()};this.getRangeAt=function(){if(!e||!tinymce.dom.RangeUtils.compareRanges(h,g.getRng())){e=b();h=g.getRng()}try{e.startContainer.nextSibling}catch(k){e=b();h=null}return e};this.destroy=function(){h=e=null}}tinymce.dom.TridentSelection=a})();(function(d){var f=d.each,c=d.DOM,b=d.isIE,e=d.isWebKit,a;d.create("tinymce.dom.EventUtils",{EventUtils:function(){this.inits=[];this.events=[]},add:function(m,p,l,j){var g,h=this,i=h.events,k;if(p instanceof Array){k=[];f(p,function(o){k.push(h.add(m,o,l,j))});return k}if(m&&m.hasOwnProperty&&m instanceof Array){k=[];f(m,function(n){n=c.get(n);k.push(h.add(n,p,l,j))});return k}m=c.get(m);if(!m){return}g=function(n){if(h.disabled){return}n=n||window.event;if(n&&b){if(!n.target){n.target=n.srcElement}d.extend(n,h._stoppers)}if(!j){return l(n)}return l.call(j,n)};if(p=="unload"){d.unloads.unshift({func:g});return g}if(p=="init"){if(h.domLoaded){g()}else{h.inits.push(g)}return g}i.push({obj:m,name:p,func:l,cfunc:g,scope:j});h._add(m,p,g);return l},remove:function(l,m,k){var h=this,g=h.events,i=false,j;if(l&&l.hasOwnProperty&&l instanceof Array){j=[];f(l,function(n){n=c.get(n);j.push(h.remove(n,m,k))});return j}l=c.get(l);f(g,function(o,n){if(o.obj==l&&o.name==m&&(!k||(o.func==k||o.cfunc==k))){g.splice(n,1);h._remove(l,m,o.cfunc);i=true;return false}});return i},clear:function(l){var j=this,g=j.events,h,k;if(l){l=c.get(l);for(h=g.length-1;h>=0;h--){k=g[h];if(k.obj===l){j._remove(k.obj,k.name,k.cfunc);k.obj=k.cfunc=null;g.splice(h,1)}}}},cancel:function(g){if(!g){return false}this.stop(g);return this.prevent(g)},stop:function(g){if(g.stopPropagation){g.stopPropagation()}else{g.cancelBubble=true}return false},prevent:function(g){if(g.preventDefault){g.preventDefault()}else{g.returnValue=false}return false},destroy:function(){var g=this;f(g.events,function(j,h){g._remove(j.obj,j.name,j.cfunc);j.obj=j.cfunc=null});g.events=[];g=null},_add:function(h,i,g){if(h.attachEvent){h.attachEvent("on"+i,g)}else{if(h.addEventListener){h.addEventListener(i,g,false)}else{h["on"+i]=g}}},_remove:function(i,j,h){if(i){try{if(i.detachEvent){i.detachEvent("on"+j,h)}else{if(i.removeEventListener){i.removeEventListener(j,h,false)}else{i["on"+j]=null}}}catch(g){}}},_pageInit:function(h){var g=this;if(g.domLoaded){return}g.domLoaded=true;f(g.inits,function(i){i()});g.inits=[]},_wait:function(i){var g=this,h=i.document;if(i.tinyMCE_GZ&&tinyMCE_GZ.loaded){g.domLoaded=1;return}if(h.attachEvent){h.attachEvent("onreadystatechange",function(){if(h.readyState==="complete"){h.detachEvent("onreadystatechange",arguments.callee);g._pageInit(i)}});if(h.documentElement.doScroll&&i==i.top){(function(){if(g.domLoaded){return}try{h.documentElement.doScroll("left")}catch(j){setTimeout(arguments.callee,0);return}g._pageInit(i)})()}}else{if(h.addEventListener){g._add(i,"DOMContentLoaded",function(){g._pageInit(i)})}}g._add(i,"load",function(){g._pageInit(i)})},_stoppers:{preventDefault:function(){this.returnValue=false},stopPropagation:function(){this.cancelBubble=true}}});a=d.dom.Event=new d.dom.EventUtils();a._wait(window);d.addUnload(function(){a.destroy()})})(tinymce);(function(a){a.dom.Element=function(f,d){var b=this,e,c;b.settings=d=d||{};b.id=f;b.dom=e=d.dom||a.DOM;if(!a.isIE){c=e.get(b.id)}a.each(("getPos,getRect,getParent,add,setStyle,getStyle,setStyles,setAttrib,setAttribs,getAttrib,addClass,removeClass,hasClass,getOuterHTML,setOuterHTML,remove,show,hide,isHidden,setHTML,get").split(/,/),function(g){b[g]=function(){var h=[f],j;for(j=0;j<arguments.length;j++){h.push(arguments[j])}h=e[g].apply(e,h);b.update(g);return h}});a.extend(b,{on:function(i,h,g){return a.dom.Event.add(b.id,i,h,g)},getXY:function(){return{x:parseInt(b.getStyle("left")),y:parseInt(b.getStyle("top"))}},getSize:function(){var g=e.get(b.id);return{w:parseInt(b.getStyle("width")||g.clientWidth),h:parseInt(b.getStyle("height")||g.clientHeight)}},moveTo:function(g,h){b.setStyles({left:g,top:h})},moveBy:function(g,i){var h=b.getXY();b.moveTo(h.x+g,h.y+i)},resizeTo:function(g,i){b.setStyles({width:g,height:i})},resizeBy:function(g,j){var i=b.getSize();b.resizeTo(i.w+g,i.h+j)},update:function(h){var g;if(a.isIE6&&d.blocker){h=h||"";if(h.indexOf("get")===0||h.indexOf("has")===0||h.indexOf("is")===0){return}if(h=="remove"){e.remove(b.blocker);return}if(!b.blocker){b.blocker=e.uniqueId();g=e.add(d.container||e.getRoot(),"iframe",{id:b.blocker,style:"position:absolute;",frameBorder:0,src:'javascript:""'});e.setStyle(g,"opacity",0)}else{g=e.get(b.blocker)}e.setStyles(g,{left:b.getStyle("left",1),top:b.getStyle("top",1),width:b.getStyle("width",1),height:b.getStyle("height",1),display:b.getStyle("display",1),zIndex:parseInt(b.getStyle("zIndex",1)||0)-1})}}})}})(tinymce);(function(c){function e(f){return f.replace(/[\n\r]+/g,"")}var b=c.is,a=c.isIE,d=c.each;c.create("tinymce.dom.Selection",{Selection:function(i,h,g){var f=this;f.dom=i;f.win=h;f.serializer=g;d(["onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent"],function(j){f[j]=new c.util.Dispatcher(f)});if(!f.win.getSelection){f.tridentSel=new c.dom.TridentSelection(f)}if(c.isIE&&i.boxModel){this._fixIESelection()}c.addUnload(f.destroy,f)},getContent:function(g){var f=this,h=f.getRng(),l=f.dom.create("body"),j=f.getSel(),i,k,m;g=g||{};i=k="";g.get=true;g.format=g.format||"html";f.onBeforeGetContent.dispatch(f,g);if(g.format=="text"){return f.isCollapsed()?"":(h.text||(j.toString?j.toString():""))}if(h.cloneContents){m=h.cloneContents();if(m){l.appendChild(m)}}else{if(b(h.item)||b(h.htmlText)){l.innerHTML=h.item?h.item(0).outerHTML:h.htmlText}else{l.innerHTML=h.toString()}}if(/^\s/.test(l.innerHTML)){i=" "}if(/\s+$/.test(l.innerHTML)){k=" "}g.getInner=true;g.content=f.isCollapsed()?"":i+f.serializer.serialize(l,g)+k;f.onGetContent.dispatch(f,g);return g.content},setContent:function(k,j){var h=this,f=h.getRng(),i,l=h.win.document,m,g;j=j||{format:"html"};j.set=true;k=j.content=k;if(!j.no_events){h.onBeforeSetContent.dispatch(h,j)}k=j.content;if(f.insertNode){k+='<span id="__caret">_</span>';if(f.startContainer==l&&f.endContainer==l){l.body.innerHTML=k}else{f.deleteContents();if(l.body.childNodes.length==0){l.body.innerHTML=k}else{if(f.createContextualFragment){f.insertNode(f.createContextualFragment(k))}else{m=l.createDocumentFragment();g=l.createElement("div");m.appendChild(g);g.outerHTML=k;f.insertNode(m)}}}i=h.dom.get("__caret");f=l.createRange();f.setStartBefore(i);f.setEndBefore(i);h.setRng(f);h.dom.remove("__caret");h.setRng(f)}else{if(f.item){l.execCommand("Delete",false,null);f=h.getRng()}f.pasteHTML(k)}if(!j.no_events){h.onSetContent.dispatch(h,j)}},getStart:function(){var g=this.getRng(),h,f,j,i;if(g.duplicate||g.item){if(g.item){return g.item(0)}j=g.duplicate();j.collapse(1);h=j.parentElement();f=i=g.parentElement();while(i=i.parentNode){if(i==h){h=f;break}}return h}else{h=g.startContainer;if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[Math.min(h.childNodes.length-1,g.startOffset)]}if(h&&h.nodeType==3){return h.parentNode}return h}},getEnd:function(){var g=this,h=g.getRng(),i,f;if(h.duplicate||h.item){if(h.item){return h.item(0)}h=h.duplicate();h.collapse(0);i=h.parentElement();if(i&&i.nodeName=="BODY"){return i.lastChild||i}return i}else{i=h.endContainer;f=h.endOffset;if(i.nodeType==1&&i.hasChildNodes()){i=i.childNodes[f>0?f-1:f]}if(i&&i.nodeType==3){return i.parentNode}return i}},getBookmark:function(r,s){var v=this,m=v.dom,g,j,i,n,h,o,p,l="\uFEFF",u;function f(x,y){var t=0;d(m.select(x),function(A,z){if(A==y){t=z}});return t}if(r==2){function k(){var x=v.getRng(true),t=m.getRoot(),y={};function z(C,H){var B=C[H?"startContainer":"endContainer"],G=C[H?"startOffset":"endOffset"],A=[],D,F,E=0;if(B.nodeType==3){if(s){for(D=B.previousSibling;D&&D.nodeType==3;D=D.previousSibling){G+=D.nodeValue.length}}A.push(G)}else{F=B.childNodes;if(G>=F.length&&F.length){E=1;G=Math.max(0,F.length-1)}A.push(v.dom.nodeIndex(F[G],s)+E)}for(;B&&B!=t;B=B.parentNode){A.push(v.dom.nodeIndex(B,s))}return A}y.start=z(x,true);if(!v.isCollapsed()){y.end=z(x)}return y}return k()}if(r){return{rng:v.getRng()}}g=v.getRng();i=m.uniqueId();n=tinyMCE.activeEditor.selection.isCollapsed();u="overflow:hidden;line-height:0px";if(g.duplicate||g.item){if(!g.item){j=g.duplicate();try{g.collapse();g.pasteHTML('<span data-mce-type="bookmark" id="'+i+'_start" style="'+u+'">'+l+"</span>");if(!n){j.collapse(false);g.moveToElementText(j.parentElement());if(g.compareEndPoints("StartToEnd",j)==0){j.move("character",-1)}j.pasteHTML('<span data-mce-type="bookmark" id="'+i+'_end" style="'+u+'">'+l+"</span>")}}catch(q){return null}}else{o=g.item(0);h=o.nodeName;return{name:h,index:f(h,o)}}}else{o=v.getNode();h=o.nodeName;if(h=="IMG"){return{name:h,index:f(h,o)}}j=g.cloneRange();if(!n){j.collapse(false);j.insertNode(m.create("span",{"data-mce-type":"bookmark",id:i+"_end",style:u},l))}g.collapse(true);g.insertNode(m.create("span",{"data-mce-type":"bookmark",id:i+"_start",style:u},l))}v.moveToBookmark({id:i,keep:1});return{id:i}},moveToBookmark:function(n){var r=this,l=r.dom,i,h,f,q,j,s,o,p;if(r.tridentSel){r.tridentSel.destroy()}if(n){if(n.start){f=l.createRng();q=l.getRoot();function g(z){var t=n[z?"start":"end"],v,x,y,u;if(t){y=t[0];for(x=q,v=t.length-1;v>=1;v--){u=x.childNodes;if(t[v]>u.length-1){return}x=u[t[v]]}if(x.nodeType===3){y=Math.min(t[0],x.nodeValue.length)}if(x.nodeType===1){y=Math.min(t[0],x.childNodes.length)}if(z){f.setStart(x,y)}else{f.setEnd(x,y)}}return true}if(g(true)&&g()){r.setRng(f)}}else{if(n.id){function k(A){var u=l.get(n.id+"_"+A),z,t,x,y,v=n.keep;if(u){z=u.parentNode;if(A=="start"){if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}j=s=z;o=p=t}else{if(!v){t=l.nodeIndex(u)}else{z=u.firstChild;t=1}s=z;p=t}if(!v){y=u.previousSibling;x=u.nextSibling;d(c.grep(u.childNodes),function(B){if(B.nodeType==3){B.nodeValue=B.nodeValue.replace(/\uFEFF/g,"")}});while(u=l.get(n.id+"_"+A)){l.remove(u,1)}if(y&&x&&y.nodeType==x.nodeType&&y.nodeType==3&&!c.isOpera){t=y.nodeValue.length;y.appendData(x.nodeValue);l.remove(x);if(A=="start"){j=s=y;o=p=t}else{s=y;p=t}}}}}function m(t){if(l.isBlock(t)&&!t.innerHTML){t.innerHTML=!a?'<br data-mce-bogus="1" />':" "}return t}k("start");k("end");if(j){f=l.createRng();f.setStart(m(j),o);f.setEnd(m(s),p);r.setRng(f)}}else{if(n.name){r.select(l.select(n.name)[n.index])}else{if(n.rng){r.setRng(n.rng)}}}}}},select:function(k,j){var i=this,l=i.dom,g=l.createRng(),f;if(k){f=l.nodeIndex(k);g.setStart(k.parentNode,f);g.setEnd(k.parentNode,f+1);if(j){function h(m,o){var n=new c.dom.TreeWalker(m,m);do{if(m.nodeType==3&&c.trim(m.nodeValue).length!=0){if(o){g.setStart(m,0)}else{g.setEnd(m,m.nodeValue.length)}return}if(m.nodeName=="BR"){if(o){g.setStartBefore(m)}else{g.setEndBefore(m)}return}}while(m=(o?n.next():n.prev()))}h(k,1);h(k)}i.setRng(g)}return k},isCollapsed:function(){var f=this,h=f.getRng(),g=f.getSel();if(!h||h.item){return false}if(h.compareEndPoints){return h.compareEndPoints("StartToEnd",h)===0}return !g||h.collapsed},collapse:function(f){var h=this,g=h.getRng(),i;if(g.item){i=g.item(0);g=h.win.document.body.createTextRange();g.moveToElementText(i)}g.collapse(!!f);h.setRng(g)},getSel:function(){var g=this,f=this.win;return f.getSelection?f.getSelection():f.document.selection},getRng:function(l){var g=this,h,i,k,j=g.win.document;if(l&&g.tridentSel){return g.tridentSel.getRangeAt(0)}try{if(h=g.getSel()){i=h.rangeCount>0?h.getRangeAt(0):(h.createRange?h.createRange():j.createRange())}}catch(f){}if(c.isIE&&i&&i.setStart&&j.selection.createRange().item){k=j.selection.createRange().item(0);i=j.createRange();i.setStartBefore(k);i.setEndAfter(k)}if(!i){i=j.createRange?j.createRange():j.body.createTextRange()}if(g.selectedRange&&g.explicitRange){if(i.compareBoundaryPoints(i.START_TO_START,g.selectedRange)===0&&i.compareBoundaryPoints(i.END_TO_END,g.selectedRange)===0){i=g.explicitRange}else{g.selectedRange=null;g.explicitRange=null}}return i},setRng:function(i){var h,g=this;if(!g.tridentSel){h=g.getSel();if(h){g.explicitRange=i;try{h.removeAllRanges()}catch(f){}h.addRange(i);g.selectedRange=h.getRangeAt(0)}}else{if(i.cloneRange){g.tridentSel.addRange(i);return}try{i.select()}catch(f){}}},setNode:function(g){var f=this;f.setContent(f.dom.getOuterHTML(g));return g},getNode:function(){var h=this,g=h.getRng(),i=h.getSel(),l,k=g.startContainer,f=g.endContainer;if(!g){return h.dom.getRoot()}if(g.setStart){l=g.commonAncestorContainer;if(!g.collapsed){if(g.startContainer==g.endContainer){if(g.endOffset-g.startOffset<2){if(g.startContainer.hasChildNodes()){l=g.startContainer.childNodes[g.startOffset]}}}if(k.nodeType===3&&f.nodeType===3){function j(p,m){var o=p;while(p&&p.nodeType===3&&p.length===0){p=m?p.nextSibling:p.previousSibling}return p||o}if(k.length===g.startOffset){k=j(k.nextSibling,true)}else{k=k.parentNode}if(g.endOffset===0){f=j(f.previousSibling,false)}else{f=f.parentNode}if(k&&k===f){return k}}}if(l&&l.nodeType==3){return l.parentNode}return l}return g.item?g.item(0):g.parentElement()},getSelectedBlocks:function(g,f){var i=this,j=i.dom,m,h,l,k=[];m=j.getParent(g||i.getStart(),j.isBlock);h=j.getParent(f||i.getEnd(),j.isBlock);if(m){k.push(m)}if(m&&h&&m!=h){l=m;while((l=l.nextSibling)&&l!=h){if(j.isBlock(l)){k.push(l)}}}if(h&&m!=h){k.push(h)}return k},destroy:function(g){var f=this;f.win=null;if(f.tridentSel){f.tridentSel.destroy()}if(!g){c.removeUnload(f.destroy)}},_fixIESelection:function(){var g=this.dom,m=g.doc,h=m.body,j,n,f;m.documentElement.unselectable=true;function i(o,r){var p=h.createTextRange();try{p.moveToPoint(o,r)}catch(q){p=null}return p}function l(p){var o;if(p.button){o=i(p.x,p.y);if(o){if(o.compareEndPoints("StartToStart",n)>0){o.setEndPoint("StartToStart",n)}else{o.setEndPoint("EndToEnd",n)}o.select()}}else{k()}}function k(){var o=m.selection.createRange();if(n&&!o.item&&o.compareEndPoints("StartToEnd",o)===0){n.select()}g.unbind(m,"mouseup",k);g.unbind(m,"mousemove",l);n=j=0}g.bind(m,["mousedown","contextmenu"],function(o){if(o.target.nodeName==="HTML"){if(j){k()}f=m.documentElement;if(f.scrollHeight>f.clientHeight){return}j=1;n=i(o.x,o.y);if(n){g.bind(m,"mouseup",k);g.bind(m,"mousemove",l);g.win.focus();n.select()}}})}})})(tinymce);(function(a){a.dom.Serializer=function(e,i,f){var h,b,d=a.isIE,g=a.each,c;if(!e.apply_source_formatting){e.indent=false}e.remove_trailing_brs=true;i=i||a.DOM;f=f||new a.html.Schema(e);e.entity_encoding=e.entity_encoding||"named";h=new a.util.Dispatcher(self);b=new a.util.Dispatcher(self);c=new a.html.DomParser(e,f);c.addAttributeFilter("src,href,style",function(k,j){var o=k.length,l,q,n="data-mce-"+j,p=e.url_converter,r=e.url_converter_scope,m;while(o--){l=k[o];q=l.attributes.map[n];if(q!==m){l.attr(j,q.length>0?q:null);l.attr(n,null)}else{q=l.attributes.map[j];if(j==="style"){q=i.serializeStyle(i.parseStyle(q),l.name)}else{if(p){q=p.call(r,q,j,l.name)}}l.attr(j,q.length>0?q:null)}}});c.addAttributeFilter("class",function(j,k){var l=j.length,m,n;while(l--){m=j[l];n=m.attr("class").replace(/\s*mce(Item\w+|Selected)\s*/g,"");m.attr("class",n.length>0?n:null)}});c.addAttributeFilter("data-mce-type",function(j,l,k){var m=j.length,n;while(m--){n=j[m];if(n.attributes.map["data-mce-type"]==="bookmark"&&!k.cleanup){n.remove()}}});c.addNodeFilter("script,style",function(k,l){var m=k.length,n,o;function j(p){return p.replace(/(<!--\[CDATA\[|\]\]-->)/g,"\n").replace(/^[\r\n]*|[\r\n]*$/g,"").replace(/^\s*(\/\/\s*<!--|\/\/\s*<!\[CDATA\[|<!--|<!\[CDATA\[)[\r\n]*/g,"").replace(/\s*(\/\/\s*\]\]>|\/\/\s*-->|\]\]>|-->|\]\]-->)\s*$/g,"")}while(m--){n=k[m];o=n.firstChild?n.firstChild.value:"";if(l==="script"){n.attr("type",(n.attr("type")||"text/javascript").replace(/^mce\-/,""));if(o.length>0){n.firstChild.value="// <![CDATA[\n"+j(o)+"\n// ]]>"}}else{if(o.length>0){n.firstChild.value="<!--\n"+j(o)+"\n-->"}}}});c.addNodeFilter("#comment",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.value.indexOf("[CDATA[")===0){m.name="#cdata";m.type=4;m.value=m.value.replace(/^\[CDATA\[|\]\]$/g,"")}else{if(m.value.indexOf("mce:protected ")===0){m.name="#text";m.type=3;m.raw=true;m.value=unescape(m.value).substr(14)}}}});c.addNodeFilter("xml:namespace,input",function(j,k){var l=j.length,m;while(l--){m=j[l];if(m.type===7){m.remove()}else{if(m.type===1){if(k==="input"&&!("type" in m.attributes.map)){m.attr("type","text")}}}}});if(e.fix_list_elements){c.addNodeFilter("ul,ol",function(k,l){var m=k.length,n,j;while(m--){n=k[m];j=n.parent;if(j.name==="ul"||j.name==="ol"){if(n.prev&&n.prev.name==="li"){n.prev.append(n)}}}})}c.addAttributeFilter("data-mce-src,data-mce-href,data-mce-style",function(j,k){var l=j.length;while(l--){j[l].attr(k,null)}});return{schema:f,addNodeFilter:c.addNodeFilter,addAttributeFilter:c.addAttributeFilter,onPreProcess:h,onPostProcess:b,serialize:function(o,m){var l,p,k,j,n;if(d&&i.select("script,style,select").length>0){n=o.innerHTML;o=o.cloneNode(false);i.setHTML(o,n)}else{o=o.cloneNode(true)}l=o.ownerDocument.implementation;if(l.createHTMLDocument){p=l.createHTMLDocument("");g(o.nodeName=="BODY"?o.childNodes:[o],function(q){p.body.appendChild(p.importNode(q,true))});if(o.nodeName!="BODY"){o=p.body.firstChild}else{o=p.body}k=i.doc;i.doc=p}m=m||{};m.format=m.format||"html";if(!m.no_events){m.node=o;h.dispatch(self,m)}j=new a.html.Serializer(e,f);m.content=j.serialize(c.parse(m.getInner?o.innerHTML:a.trim(i.getOuterHTML(o),m),m));if(!m.cleanup){m.content=m.content.replace(/\uFEFF/g,"")}if(!m.no_events){b.dispatch(self,m)}if(k){i.doc=k}m.node=null;return m.content},addRules:function(j){f.addValidElements(j)},setRules:function(j){f.setValidElements(j)}}}})(tinymce);(function(a){a.dom.ScriptLoader=function(h){var c=0,k=1,i=2,l={},j=[],f={},d=[],g=0,e;function b(m,v){var x=this,q=a.DOM,s,o,r,n;function p(){q.remove(n);if(s){s.onreadystatechange=s.onload=s=null}v()}function u(){if(typeof(console)!=="undefined"&&console.log){console.log("Failed to load: "+m)}}n=q.uniqueId();if(a.isIE6){o=new a.util.URI(m);r=location;if(o.host==r.hostname&&o.port==r.port&&(o.protocol+":")==r.protocol&&o.protocol.toLowerCase()!="file"){a.util.XHR.send({url:a._addVer(o.getURI()),success:function(y){var t=q.create("script",{type:"text/javascript"});t.text=y;document.getElementsByTagName("head")[0].appendChild(t);q.remove(t);p()},error:u});return}}s=q.create("script",{id:n,type:"text/javascript",src:a._addVer(m)});if(!a.isIE){s.onload=p}s.onerror=u;if(!a.isOpera){s.onreadystatechange=function(){var t=s.readyState;if(t=="complete"||t=="loaded"){p()}}}(document.getElementsByTagName("head")[0]||document.body).appendChild(s)}this.isDone=function(m){return l[m]==i};this.markDone=function(m){l[m]=i};this.add=this.load=function(m,q,n){var o,p=l[m];if(p==e){j.push(m);l[m]=c}if(q){if(!f[m]){f[m]=[]}f[m].push({func:q,scope:n||this})}};this.loadQueue=function(n,m){this.loadScripts(j,n,m)};this.loadScripts=function(m,q,p){var o;function n(r){a.each(f[r],function(s){s.func.call(s.scope)});f[r]=e}d.push({func:q,scope:p||this});o=function(){var r=a.grep(m);m.length=0;a.each(r,function(s){if(l[s]==i){n(s);return}if(l[s]!=k){l[s]=k;g++;b(s,function(){l[s]=i;g--;n(s);o()})}});if(!g){a.each(d,function(s){s.func.call(s.scope)});d.length=0}};o()}};a.ScriptLoader=new a.dom.ScriptLoader()})(tinymce);tinymce.dom.TreeWalker=function(a,c){var b=a;function d(i,f,e,j){var h,g;if(i){if(!j&&i[f]){return i[f]}if(i!=c){h=i[e];if(h){return h}for(g=i.parentNode;g&&g!=c;g=g.parentNode){h=g[e];if(h){return h}}}}}this.current=function(){return b};this.next=function(e){return(b=d(b,"firstChild","nextSibling",e))};this.prev=function(e){return(b=d(b,"lastChild","previousSibling",e))}};(function(a){a.dom.RangeUtils=function(c){var b="\uFEFF";this.walk=function(d,r){var h=d.startContainer,k=d.startOffset,s=d.endContainer,l=d.endOffset,i,f,n,g,q,p,e;e=c.select("td.mceSelected,th.mceSelected");if(e.length>0){a.each(e,function(t){r([t])});return}function o(v,u,t){var x=[];for(;v&&v!=t;v=v[u]){x.push(v)}return x}function m(u,t){do{if(u.parentNode==t){return u}u=u.parentNode}while(u)}function j(v,u,x){var t=x?"nextSibling":"previousSibling";for(g=v,q=g.parentNode;g&&g!=u;g=q){q=g.parentNode;p=o(g==v?g:g[t],t);if(p.length){if(!x){p.reverse()}r(p)}}}if(h.nodeType==1&&h.hasChildNodes()){h=h.childNodes[k]}if(s.nodeType==1&&s.hasChildNodes()){s=s.childNodes[Math.min(l-1,s.childNodes.length-1)]}i=c.findCommonAncestor(h,s);if(h==s){return r([h])}for(g=h;g;g=g.parentNode){if(g==s){return j(h,i,true)}if(g==i){break}}for(g=s;g;g=g.parentNode){if(g==h){return j(s,i)}if(g==i){break}}f=m(h,i)||h;n=m(s,i)||s;j(h,f,true);p=o(f==h?f:f.nextSibling,"nextSibling",n==s?n.nextSibling:n);if(p.length){r(p)}j(s,n)}};a.dom.RangeUtils.compareRanges=function(c,b){if(c&&b){if(c.item||c.duplicate){if(c.item&&b.item&&c.item(0)===b.item(0)){return true}if(c.isEqual&&b.isEqual&&b.isEqual(c)){return true}}else{return c.startContainer==b.startContainer&&c.startOffset==b.startOffset}}return false}})(tinymce);(function(b){var a=b.dom.Event,c=b.each;b.create("tinymce.ui.KeyboardNavigation",{KeyboardNavigation:function(e,f){var p=this,m=e.root,l=e.items,n=e.enableUpDown,i=e.enableLeftRight||!e.enableUpDown,k=e.excludeFromTabOrder,j,h,o,d,g;f=f||b.DOM;j=function(q){g=q.target.id};h=function(q){f.setAttrib(q.target.id,"tabindex","-1")};d=function(q){var r=f.get(g);f.setAttrib(r,"tabindex","0");r.focus()};p.focus=function(){f.get(g).focus()};p.destroy=function(){c(l,function(q){f.unbind(f.get(q.id),"focus",j);f.unbind(f.get(q.id),"blur",h)});f.unbind(f.get(m),"focus",d);f.unbind(f.get(m),"keydown",o);l=f=m=p.focus=j=h=o=d=null;p.destroy=function(){}};p.moveFocus=function(u,r){var q=-1,t=p.controls,s;if(!g){return}c(l,function(x,v){if(x.id===g){q=v;return false}});q+=u;if(q<0){q=l.length-1}else{if(q>=l.length){q=0}}s=l[q];f.setAttrib(g,"tabindex","-1");f.setAttrib(s.id,"tabindex","0");f.get(s.id).focus();if(e.actOnFocus){e.onAction(s.id)}if(r){a.cancel(r)}};o=function(y){var u=37,t=39,x=38,z=40,q=27,s=14,r=13,v=32;switch(y.keyCode){case u:if(i){p.moveFocus(-1)}break;case t:if(i){p.moveFocus(1)}break;case x:if(n){p.moveFocus(-1)}break;case z:if(n){p.moveFocus(1)}break;case q:if(e.onCancel){e.onCancel();a.cancel(y)}break;case s:case r:case v:if(e.onAction){e.onAction(g);a.cancel(y)}break}};c(l,function(s,q){var r;if(!s.id){s.id=f.uniqueId("_mce_item_")}if(k){f.bind(s.id,"blur",h);r="-1"}else{r=(q===0?"0":"-1")}f.setAttrib(s.id,"tabindex",r);f.bind(f.get(s.id),"focus",j)});if(l[0]){g=l[0].id}f.setAttrib(m,"tabindex","-1");f.bind(f.get(m),"focus",d);f.bind(f.get(m),"keydown",o)}})})(tinymce);(function(c){var b=c.DOM,a=c.is;c.create("tinymce.ui.Control",{Control:function(f,e,d){this.id=f;this.settings=e=e||{};this.rendered=false;this.onRender=new c.util.Dispatcher(this);this.classPrefix="";this.scope=e.scope||this;this.disabled=0;this.active=0;this.editor=d},setAriaProperty:function(f,e){var d=b.get(this.id+"_aria")||b.get(this.id);if(d){b.setAttrib(d,"aria-"+f,!!e)}},focus:function(){b.get(this.id).focus()},setDisabled:function(d){if(d!=this.disabled){this.setAriaProperty("disabled",d);this.setState("Disabled",d);this.setState("Enabled",!d);this.disabled=d}},isDisabled:function(){return this.disabled},setActive:function(d){if(d!=this.active){this.setState("Active",d);this.active=d;this.setAriaProperty("pressed",d)}},isActive:function(){return this.active},setState:function(f,d){var e=b.get(this.id);f=this.classPrefix+f;if(d){b.addClass(e,f)}else{b.removeClass(e,f)}},isRendered:function(){return this.rendered},renderHTML:function(){},renderTo:function(d){b.setHTML(d,this.renderHTML())},postRender:function(){var e=this,d;if(a(e.disabled)){d=e.disabled;e.disabled=-1;e.setDisabled(d)}if(a(e.active)){d=e.active;e.active=-1;e.setActive(d)}},remove:function(){b.remove(this.id);this.destroy()},destroy:function(){c.dom.Event.clear(this.id)}})})(tinymce);tinymce.create("tinymce.ui.Container:tinymce.ui.Control",{Container:function(c,b,a){this.parent(c,b,a);this.controls=[];this.lookup={}},add:function(a){this.lookup[a.id]=a;this.controls.push(a);return a},get:function(a){return this.lookup[a]}});tinymce.create("tinymce.ui.Separator:tinymce.ui.Control",{Separator:function(b,a){this.parent(b,a);this.classPrefix="mceSeparator";this.setDisabled(true)},renderHTML:function(){return tinymce.DOM.createHTML("span",{"class":this.classPrefix,role:"separator","aria-orientation":"vertical",tabindex:"-1"})}});(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.MenuItem:tinymce.ui.Control",{MenuItem:function(g,f){this.parent(g,f);this.classPrefix="mceMenuItem"},setSelected:function(f){this.setState("Selected",f);this.setAriaProperty("checked",!!f);this.selected=f},isSelected:function(){return this.selected},postRender:function(){var f=this;f.parent();if(c(f.selected)){f.setSelected(f.selected)}}})})(tinymce);(function(d){var c=d.is,b=d.DOM,e=d.each,a=d.walk;d.create("tinymce.ui.Menu:tinymce.ui.MenuItem",{Menu:function(h,g){var f=this;f.parent(h,g);f.items={};f.collapsed=false;f.menuCount=0;f.onAddItem=new d.util.Dispatcher(this)},expand:function(g){var f=this;if(g){a(f,function(h){if(h.expand){h.expand()}},"items",f)}f.collapsed=false},collapse:function(g){var f=this;if(g){a(f,function(h){if(h.collapse){h.collapse()}},"items",f)}f.collapsed=true},isCollapsed:function(){return this.collapsed},add:function(f){if(!f.settings){f=new d.ui.MenuItem(f.id||b.uniqueId(),f)}this.onAddItem.dispatch(this,f);return this.items[f.id]=f},addSeparator:function(){return this.add({separator:true})},addMenu:function(f){if(!f.collapse){f=this.createMenu(f)}this.menuCount++;return this.add(f)},hasMenus:function(){return this.menuCount!==0},remove:function(f){delete this.items[f.id]},removeAll:function(){var f=this;a(f,function(g){if(g.removeAll){g.removeAll()}else{g.remove()}g.destroy()},"items",f);f.items={}},createMenu:function(g){var f=new d.ui.Menu(g.id||b.uniqueId(),g);f.onAddItem.add(this.onAddItem.dispatch,this.onAddItem);return f}})})(tinymce);(function(e){var d=e.is,c=e.DOM,f=e.each,a=e.dom.Event,b=e.dom.Element;e.create("tinymce.ui.DropMenu:tinymce.ui.Menu",{DropMenu:function(h,g){g=g||{};g.container=g.container||c.doc.body;g.offset_x=g.offset_x||0;g.offset_y=g.offset_y||0;g.vp_offset_x=g.vp_offset_x||0;g.vp_offset_y=g.vp_offset_y||0;if(d(g.icons)&&!g.icons){g["class"]+=" mceNoIcons"}this.parent(h,g);this.onShowMenu=new e.util.Dispatcher(this);this.onHideMenu=new e.util.Dispatcher(this);this.classPrefix="mceMenu"},createMenu:function(j){var h=this,i=h.settings,g;j.container=j.container||i.container;j.parent=h;j.constrain=j.constrain||i.constrain;j["class"]=j["class"]||i["class"];j.vp_offset_x=j.vp_offset_x||i.vp_offset_x;j.vp_offset_y=j.vp_offset_y||i.vp_offset_y;j.keyboard_focus=i.keyboard_focus;g=new e.ui.DropMenu(j.id||c.uniqueId(),j);g.onAddItem.add(h.onAddItem.dispatch,h.onAddItem);return g},focus:function(){var g=this;if(g.keyboardNav){g.keyboardNav.focus()}},update:function(){var i=this,j=i.settings,g=c.get("menu_"+i.id+"_tbl"),l=c.get("menu_"+i.id+"_co"),h,k;h=j.max_width?Math.min(g.clientWidth,j.max_width):g.clientWidth;k=j.max_height?Math.min(g.clientHeight,j.max_height):g.clientHeight;if(!c.boxModel){i.element.setStyles({width:h+2,height:k+2})}else{i.element.setStyles({width:h,height:k})}if(j.max_width){c.setStyle(l,"width",h)}if(j.max_height){c.setStyle(l,"height",k);if(g.clientHeight<j.max_height){c.setStyle(l,"overflow","hidden")}}},showMenu:function(p,n,r){var z=this,A=z.settings,o,g=c.getViewPort(),u,l,v,q,i=2,k,j,m=z.classPrefix;z.collapse(1);if(z.isMenuVisible){return}if(!z.rendered){o=c.add(z.settings.container,z.renderNode());f(z.items,function(h){h.postRender()});z.element=new b("menu_"+z.id,{blocker:1,container:A.container})}else{o=c.get("menu_"+z.id)}if(!e.isOpera){c.setStyles(o,{left:-65535,top:-65535})}c.show(o);z.update();p+=A.offset_x||0;n+=A.offset_y||0;g.w-=4;g.h-=4;if(A.constrain){u=o.clientWidth-i;l=o.clientHeight-i;v=g.x+g.w;q=g.y+g.h;if((p+A.vp_offset_x+u)>v){p=r?r-u:Math.max(0,(v-A.vp_offset_x)-u)}if((n+A.vp_offset_y+l)>q){n=Math.max(0,(q-A.vp_offset_y)-l)}}c.setStyles(o,{left:p,top:n});z.element.update();z.isMenuVisible=1;z.mouseClickFunc=a.add(o,"click",function(s){var h;s=s.target;if(s&&(s=c.getParent(s,"tr"))&&!c.hasClass(s,m+"ItemSub")){h=z.items[s.id];if(h.isDisabled()){return}k=z;while(k){if(k.hideMenu){k.hideMenu()}k=k.settings.parent}if(h.settings.onclick){h.settings.onclick(s)}return a.cancel(s)}});if(z.hasMenus()){z.mouseOverFunc=a.add(o,"mouseover",function(x){var h,t,s;x=x.target;if(x&&(x=c.getParent(x,"tr"))){h=z.items[x.id];if(z.lastMenu){z.lastMenu.collapse(1)}if(h.isDisabled()){return}if(x&&c.hasClass(x,m+"ItemSub")){t=c.getRect(x);h.showMenu((t.x+t.w-i),t.y-i,t.x);z.lastMenu=h;c.addClass(c.get(h.id).firstChild,m+"ItemActive")}}})}a.add(o,"keydown",z._keyHandler,z);z.onShowMenu.dispatch(z);if(A.keyboard_focus){z._setupKeyboardNav()}},hideMenu:function(j){var g=this,i=c.get("menu_"+g.id),h;if(!g.isMenuVisible){return}if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(i,"mouseover",g.mouseOverFunc);a.remove(i,"click",g.mouseClickFunc);a.remove(i,"keydown",g._keyHandler);c.hide(i);g.isMenuVisible=0;if(!j){g.collapse(1)}if(g.element){g.element.hide()}if(h=c.get(g.id)){c.removeClass(h.firstChild,g.classPrefix+"ItemActive")}g.onHideMenu.dispatch(g)},add:function(i){var g=this,h;i=g.parent(i);if(g.isRendered&&(h=c.get("menu_"+g.id))){g._add(c.select("tbody",h)[0],i)}return i},collapse:function(g){this.parent(g);this.hideMenu(1)},remove:function(g){c.remove(g.id);this.destroy();return this.parent(g)},destroy:function(){var g=this,h=c.get("menu_"+g.id);if(g.keyboardNav){g.keyboardNav.destroy()}a.remove(h,"mouseover",g.mouseOverFunc);a.remove(c.select("a",h),"focus",g.mouseOverFunc);a.remove(h,"click",g.mouseClickFunc);a.remove(h,"keydown",g._keyHandler);if(g.element){g.element.remove()}c.remove(h)},renderNode:function(){var i=this,j=i.settings,l,h,k,g;g=c.create("div",{role:"listbox",id:"menu_"+i.id,"class":j["class"],style:"position:absolute;left:0;top:0;z-index:200000;outline:0"});if(i.settings.parent){c.setAttrib(g,"aria-parent","menu_"+i.settings.parent.id)}k=c.add(g,"div",{role:"presentation",id:"menu_"+i.id+"_co","class":i.classPrefix+(j["class"]?" "+j["class"]:"")});i.element=new b("menu_"+i.id,{blocker:1,container:j.container});if(j.menu_line){c.add(k,"span",{"class":i.classPrefix+"Line"})}l=c.add(k,"table",{role:"presentation",id:"menu_"+i.id+"_tbl",border:0,cellPadding:0,cellSpacing:0});h=c.add(l,"tbody");f(i.items,function(m){i._add(h,m)});i.rendered=true;return g},_setupKeyboardNav:function(){var i,h,g=this;i=c.select("#menu_"+g.id)[0];h=c.select("a[role=option]","menu_"+g.id);h.splice(0,0,i);g.keyboardNav=new e.ui.KeyboardNavigation({root:"menu_"+g.id,items:h,onCancel:function(){g.hideMenu()},enableUpDown:true});i.focus()},_keyHandler:function(g){var h=this,i;switch(g.keyCode){case 37:if(h.settings.parent){h.hideMenu();h.settings.parent.focus();a.cancel(g)}break;case 39:if(h.mouseOverFunc){h.mouseOverFunc(g)}break}},_add:function(j,h){var i,q=h.settings,p,l,k,m=this.classPrefix,g;if(q.separator){l=c.add(j,"tr",{id:h.id,"class":m+"ItemSeparator"});c.add(l,"td",{"class":m+"ItemSeparator"});if(i=l.previousSibling){c.addClass(i,"mceLast")}return}i=l=c.add(j,"tr",{id:h.id,"class":m+"Item "+m+"ItemEnabled"});i=k=c.add(i,q.titleItem?"th":"td");i=p=c.add(i,"a",{id:h.id+"_aria",role:q.titleItem?"presentation":"option",href:"javascript:;",onclick:"return false;",onmousedown:"return false;"});if(q.parent){c.setAttrib(p,"aria-haspopup","true");c.setAttrib(p,"aria-owns","menu_"+h.id)}c.addClass(k,q["class"]);g=c.add(i,"span",{"class":"mceIcon"+(q.icon?" mce_"+q.icon:"")});if(q.icon_src){c.add(g,"img",{src:q.icon_src})}i=c.add(i,q.element||"span",{"class":"mceText",title:h.settings.title},h.settings.title);if(h.settings.style){c.setAttrib(i,"style",h.settings.style)}if(j.childNodes.length==1){c.addClass(l,"mceFirst")}if((i=l.previousSibling)&&c.hasClass(i,m+"ItemSeparator")){c.addClass(l,"mceFirst")}if(h.collapse){c.addClass(l,m+"ItemSub")}if(i=l.previousSibling){c.removeClass(i,"mceLast")}c.addClass(l,"mceLast")}})})(tinymce);(function(b){var a=b.DOM;b.create("tinymce.ui.Button:tinymce.ui.Control",{Button:function(e,d,c){this.parent(e,d,c);this.classPrefix="mceButton"},renderHTML:function(){var f=this.classPrefix,e=this.settings,d,c;c=a.encode(e.label||"");d='<a role="button" id="'+this.id+'" href="javascript:;" class="'+f+" "+f+"Enabled "+e["class"]+(c?" "+f+"Labeled":"")+'" onmousedown="return false;" onclick="return false;" aria-labelledby="'+this.id+'_voice" title="'+a.encode(e.title)+'">';if(e.image){d+='<img class="mceIcon" src="'+e.image+'" alt="'+a.encode(e.title)+'" />'+c}else{d+='<span class="mceIcon '+e["class"]+'"></span>'+(c?'<span class="'+f+'Label">'+c+"</span>":"")}d+='<span class="mceVoiceLabel mceIconOnly" style="display: none;" id="'+this.id+'_voice">'+e.title+"</span>";d+="</a>";return d},postRender:function(){var c=this,d=c.settings;b.dom.Event.add(c.id,"click",function(f){if(!c.isDisabled()){return d.onclick.call(d.scope,f)}})}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.ListBox:tinymce.ui.Control",{ListBox:function(i,h,f){var g=this;g.parent(i,h,f);g.items=[];g.onChange=new a(g);g.onPostRender=new a(g);g.onAdd=new a(g);g.onRenderMenu=new d.util.Dispatcher(this);g.classPrefix="mceListBox"},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){var g=this,h,i;if(f!=g.selectedIndex){h=c.get(g.id+"_text");i=g.items[f];if(i){g.selectedValue=i.value;g.selectedIndex=f;c.setHTML(h,c.encode(i.title));c.removeClass(h,"mceTitle");c.setAttrib(g.id,"aria-valuenow",i.title)}else{c.setHTML(h,c.encode(g.settings.title));c.addClass(h,"mceTitle");g.selectedValue=g.selectedIndex=null;c.setAttrib(g.id,"aria-valuenow",g.settings.title)}h=0}},add:function(i,f,h){var g=this;h=h||{};h=d.extend(h,{title:i,value:f});g.items.push(h);g.onAdd.dispatch(g,h)},getLength:function(){return this.items.length},renderHTML:function(){var i="",f=this,g=f.settings,j=f.classPrefix;i='<span role="button" aria-haspopup="true" aria-labelledby="'+f.id+'_text" aria-describedby="'+f.id+'_voiceDesc"><table role="presentation" tabindex="0" id="'+f.id+'" cellpadding="0" cellspacing="0" class="'+j+" "+j+"Enabled"+(g["class"]?(" "+g["class"]):"")+'"><tbody><tr>';i+="<td>"+c.createHTML("span",{id:f.id+"_voiceDesc","class":"voiceLabel",style:"display:none;"},f.settings.title);i+=c.createHTML("a",{id:f.id+"_text",tabindex:-1,href:"javascript:;","class":"mceText",onclick:"return false;",onmousedown:"return false;"},c.encode(f.settings.title))+"</td>";i+="<td>"+c.createHTML("a",{id:f.id+"_open",tabindex:-1,href:"javascript:;","class":"mceOpen",onclick:"return false;",onmousedown:"return false;"},'<span><span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span></span>')+"</td>";i+="</tr></tbody></table></span>";return i},showMenu:function(){var g=this,j,i,h=c.get(this.id),f;if(g.isDisabled()||g.items.length==0){return}if(g.menu&&g.menu.isMenuVisible){return g.hideMenu()}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}j=c.getPos(this.settings.menu_container);i=c.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.keyboard_focus=!d.isOpera;if(g.oldID){f.items[g.oldID].setSelected(0)}e(g.items,function(k){if(k.value===g.selectedValue){f.items[k.id].setSelected(1);g.oldID=k.id}});f.showMenu(0,h.clientHeight);b.add(c.doc,"mousedown",g.hideMenu,g);c.addClass(g.id,g.classPrefix+"Selected")},hideMenu:function(g){var f=this;if(f.menu&&f.menu.isMenuVisible){c.removeClass(f.id,f.classPrefix+"Selected");if(g&&g.type=="mousedown"&&(g.target.id==f.id+"_text"||g.target.id==f.id+"_open")){return}if(!g||!c.getParent(g.target,".mceMenu")){c.removeClass(f.id,f.classPrefix+"Selected");b.remove(c.doc,"mousedown",f.hideMenu,f);f.menu.hideMenu()}}},renderMenu:function(){var g=this,f;f=g.settings.control_manager.createDropMenu(g.id+"_menu",{menu_line:1,"class":g.classPrefix+"Menu mceNoIcons",max_width:150,max_height:150});f.onHideMenu.add(function(){g.hideMenu();g.focus()});f.add({title:g.settings.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}});e(g.items,function(h){if(h.value===undefined){f.add({title:h.title,"class":"mceMenuItemTitle",onclick:function(){if(g.settings.onselect("")!==false){g.select("")}}})}else{h.id=c.uniqueId();h.onclick=function(){if(g.settings.onselect(h.value)!==false){g.select(h.value)}};f.add(h)}});g.onRenderMenu.dispatch(g,f);g.menu=f},postRender:function(){var f=this,g=f.classPrefix;b.add(f.id,"click",f.showMenu,f);b.add(f.id,"keydown",function(h){if(h.keyCode==32){f.showMenu(h);b.cancel(h)}});b.add(f.id,"focus",function(){if(!f._focused){f.keyDownHandler=b.add(f.id,"keydown",function(h){if(h.keyCode==40){f.showMenu();b.cancel(h)}});f.keyPressHandler=b.add(f.id,"keypress",function(i){var h;if(i.keyCode==13){h=f.selectedValue;f.selectedValue=null;b.cancel(i);f.settings.onselect(h)}})}f._focused=1});b.add(f.id,"blur",function(){b.remove(f.id,"keydown",f.keyDownHandler);b.remove(f.id,"keypress",f.keyPressHandler);f._focused=0});if(d.isIE6||!c.boxModel){b.add(f.id,"mouseover",function(){if(!c.hasClass(f.id,g+"Disabled")){c.addClass(f.id,g+"Hover")}});b.add(f.id,"mouseout",function(){if(!c.hasClass(f.id,g+"Disabled")){c.removeClass(f.id,g+"Hover")}})}f.onPostRender.dispatch(f,c.get(f.id))},destroy:function(){this.parent();b.clear(this.id+"_text");b.clear(this.id+"_open")}})})(tinymce);(function(d){var c=d.DOM,b=d.dom.Event,e=d.each,a=d.util.Dispatcher;d.create("tinymce.ui.NativeListBox:tinymce.ui.ListBox",{NativeListBox:function(g,f){this.parent(g,f);this.classPrefix="mceNativeListBox"},setDisabled:function(f){c.get(this.id).disabled=f;this.setAriaProperty("disabled",f)},isDisabled:function(){return c.get(this.id).disabled},select:function(h){var g=this,j,i;if(h==undefined){return g.selectByIndex(-1)}if(h&&h.call){i=h}else{i=function(f){return f==h}}if(h!=g.selectedValue){e(g.items,function(k,f){if(i(k.value)){j=1;g.selectByIndex(f);return false}});if(!j){g.selectByIndex(-1)}}},selectByIndex:function(f){c.get(this.id).selectedIndex=f+1;this.selectedValue=this.items[f]?this.items[f].value:null},add:function(j,g,f){var i,h=this;f=f||{};f.value=g;if(h.isRendered()){c.add(c.get(this.id),"option",f,j)}i={title:j,value:g,attribs:f};h.items.push(i);h.onAdd.dispatch(h,i)},getLength:function(){return this.items.length},renderHTML:function(){var g,f=this;g=c.createHTML("option",{value:""},"-- "+f.settings.title+" --");e(f.items,function(h){g+=c.createHTML("option",{value:h.value},h.title)});g=c.createHTML("select",{id:f.id,"class":"mceNativeListBox","aria-labelledby":f.id+"_aria"},g);g+=c.createHTML("span",{id:f.id+"_aria",style:"display: none"},f.settings.title);return g},postRender:function(){var g=this,h,i=true;g.rendered=true;function f(k){var j=g.items[k.target.selectedIndex-1];if(j&&(j=j.value)){g.onChange.dispatch(g,j);if(g.settings.onselect){g.settings.onselect(j)}}}b.add(g.id,"change",f);b.add(g.id,"keydown",function(k){var j;b.remove(g.id,"change",h);i=false;j=b.add(g.id,"blur",function(){if(i){return}i=true;b.add(g.id,"change",f);b.remove(g.id,"blur",j)});if(k.keyCode==13||k.keyCode==32){f(k);return b.cancel(k)}});g.onPostRender.dispatch(g,c.get(g.id))}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.MenuButton:tinymce.ui.Button",{MenuButton:function(g,f,e){this.parent(g,f,e);this.onRenderMenu=new c.util.Dispatcher(this);f.menu_container=f.menu_container||b.doc.body},showMenu:function(){var g=this,j,i,h=b.get(g.id),f;if(g.isDisabled()){return}if(!g.isMenuRendered){g.renderMenu();g.isMenuRendered=true}if(g.isMenuVisible){return g.hideMenu()}j=b.getPos(g.settings.menu_container);i=b.getPos(h);f=g.menu;f.settings.offset_x=i.x;f.settings.offset_y=i.y;f.settings.vp_offset_x=i.x;f.settings.vp_offset_y=i.y;f.settings.keyboard_focus=g._focused;f.showMenu(0,h.clientHeight);a.add(b.doc,"mousedown",g.hideMenu,g);g.setState("Selected",1);g.isMenuVisible=1},renderMenu:function(){var f=this,e;e=f.settings.control_manager.createDropMenu(f.id+"_menu",{menu_line:1,"class":this.classPrefix+"Menu",icons:f.settings.icons});e.onHideMenu.add(function(){f.hideMenu();f.focus()});f.onRenderMenu.dispatch(f,e);f.menu=e},hideMenu:function(g){var f=this;if(g&&g.type=="mousedown"&&b.getParent(g.target,function(h){return h.id===f.id||h.id===f.id+"_open"})){return}if(!g||!b.getParent(g.target,".mceMenu")){f.setState("Selected",0);a.remove(b.doc,"mousedown",f.hideMenu,f);if(f.menu){f.menu.hideMenu()}}f.isMenuVisible=0},postRender:function(){var e=this,f=e.settings;a.add(e.id,"click",function(){if(!e.isDisabled()){if(f.onclick){f.onclick(e.value)}e.showMenu()}})}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each;c.create("tinymce.ui.SplitButton:tinymce.ui.MenuButton",{SplitButton:function(g,f,e){this.parent(g,f,e);this.classPrefix="mceSplitButton"},renderHTML:function(){var i,f=this,g=f.settings,e;i="<tbody><tr>";if(g.image){e=b.createHTML("img ",{src:g.image,role:"presentation","class":"mceAction "+g["class"]})}else{e=b.createHTML("span",{"class":"mceAction "+g["class"]},"")}e+=b.createHTML("span",{"class":"mceVoiceLabel mceIconOnly",id:f.id+"_voice",style:"display:none;"},g.title);i+="<td >"+b.createHTML("a",{role:"button",id:f.id+"_action",tabindex:"-1",href:"javascript:;","class":"mceAction "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";e=b.createHTML("span",{"class":"mceOpen "+g["class"]},'<span style="display:none;" class="mceIconOnly" aria-hidden="true">\u25BC</span>');i+="<td >"+b.createHTML("a",{role:"button",id:f.id+"_open",tabindex:"-1",href:"javascript:;","class":"mceOpen "+g["class"],onclick:"return false;",onmousedown:"return false;",title:g.title},e)+"</td>";i+="</tr></tbody>";i=b.createHTML("table",{id:f.id,role:"presentation",tabindex:"0","class":"mceSplitButton mceSplitButtonEnabled "+g["class"],cellpadding:"0",cellspacing:"0",title:g.title},i);return b.createHTML("span",{role:"button","aria-labelledby":f.id+"_voice","aria-haspopup":"true"},i)},postRender:function(){var e=this,g=e.settings,f;if(g.onclick){f=function(h){if(!e.isDisabled()){g.onclick(e.value);a.cancel(h)}};a.add(e.id+"_action","click",f);a.add(e.id,["click","keydown"],function(h){var k=32,m=14,i=13,j=38,l=40;if((h.keyCode===32||h.keyCode===13||h.keyCode===14)&&!h.altKey&&!h.ctrlKey&&!h.metaKey){f();a.cancel(h)}else{if(h.type==="click"||h.keyCode===l){e.showMenu();a.cancel(h)}}})}a.add(e.id+"_open","click",function(h){e.showMenu();a.cancel(h)});a.add([e.id,e.id+"_open"],"focus",function(){e._focused=1});a.add([e.id,e.id+"_open"],"blur",function(){e._focused=0});if(c.isIE6||!b.boxModel){a.add(e.id,"mouseover",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.addClass(e.id,"mceSplitButtonHover")}});a.add(e.id,"mouseout",function(){if(!b.hasClass(e.id,"mceSplitButtonDisabled")){b.removeClass(e.id,"mceSplitButtonHover")}})}},destroy:function(){this.parent();a.clear(this.id+"_action");a.clear(this.id+"_open");a.clear(this.id)}})})(tinymce);(function(d){var c=d.DOM,a=d.dom.Event,b=d.is,e=d.each;d.create("tinymce.ui.ColorSplitButton:tinymce.ui.SplitButton",{ColorSplitButton:function(i,h,f){var g=this;g.parent(i,h,f);g.settings=h=d.extend({colors:"000000,993300,333300,003300,003366,000080,333399,333333,800000,FF6600,808000,008000,008080,0000FF,666699,808080,FF0000,FF9900,99CC00,339966,33CCCC,3366FF,800080,999999,FF00FF,FFCC00,FFFF00,00FF00,00FFFF,00CCFF,993366,C0C0C0,FF99CC,FFCC99,FFFF99,CCFFCC,CCFFFF,99CCFF,CC99FF,FFFFFF",grid_width:8,default_color:"#888888"},g.settings);g.onShowMenu=new d.util.Dispatcher(g);g.onHideMenu=new d.util.Dispatcher(g);g.value=h.default_color},showMenu:function(){var f=this,g,j,i,h;if(f.isDisabled()){return}if(!f.isMenuRendered){f.renderMenu();f.isMenuRendered=true}if(f.isMenuVisible){return f.hideMenu()}i=c.get(f.id);c.show(f.id+"_menu");c.addClass(i,"mceSplitButtonSelected");h=c.getPos(i);c.setStyles(f.id+"_menu",{left:h.x,top:h.y+i.clientHeight,zIndex:200000});i=0;a.add(c.doc,"mousedown",f.hideMenu,f);f.onShowMenu.dispatch(f);if(f._focused){f._keyHandler=a.add(f.id+"_menu","keydown",function(k){if(k.keyCode==27){f.hideMenu()}});c.select("a",f.id+"_menu")[0].focus()}f.isMenuVisible=1},hideMenu:function(g){var f=this;if(f.isMenuVisible){if(g&&g.type=="mousedown"&&c.getParent(g.target,function(h){return h.id===f.id+"_open"})){return}if(!g||!c.getParent(g.target,".mceSplitButtonMenu")){c.removeClass(f.id,"mceSplitButtonSelected");a.remove(c.doc,"mousedown",f.hideMenu,f);a.remove(f.id+"_menu","keydown",f._keyHandler);c.hide(f.id+"_menu")}f.isMenuVisible=0}},renderMenu:function(){var p=this,h,k=0,q=p.settings,g,j,l,o,f;o=c.add(q.menu_container,"div",{role:"listbox",id:p.id+"_menu","class":q.menu_class+" "+q["class"],style:"position:absolute;left:0;top:-1000px;"});h=c.add(o,"div",{"class":q["class"]+" mceSplitButtonMenu"});c.add(h,"span",{"class":"mceMenuLine"});g=c.add(h,"table",{role:"presentation","class":"mceColorSplitMenu"});j=c.add(g,"tbody");k=0;e(b(q.colors,"array")?q.colors:q.colors.split(","),function(i){i=i.replace(/^#/,"");if(!k--){l=c.add(j,"tr");k=q.grid_width-1}g=c.add(l,"td");g=c.add(g,"a",{role:"option",href:"javascript:;",style:{backgroundColor:"#"+i},title:p.editor.getLang("colors."+i,i),"data-mce-color":"#"+i});if(p.editor.forcedHighContrastMode){g=c.add(g,"canvas",{width:16,height:16,"aria-hidden":"true"});if(g.getContext&&(f=g.getContext("2d"))){f.fillStyle="#"+i;f.fillRect(0,0,16,16)}else{c.remove(g)}}});if(q.more_colors_func){g=c.add(j,"tr");g=c.add(g,"td",{colspan:q.grid_width,"class":"mceMoreColors"});g=c.add(g,"a",{role:"option",id:p.id+"_more",href:"javascript:;",onclick:"return false;","class":"mceMoreColors"},q.more_colors_title);a.add(g,"click",function(i){q.more_colors_func.call(q.more_colors_scope||this);return a.cancel(i)})}c.addClass(h,"mceColorSplitMenu");new d.ui.KeyboardNavigation({root:p.id+"_menu",items:c.select("a",p.id+"_menu"),onCancel:function(){p.hideMenu();p.focus()}});a.add(p.id+"_menu","mousedown",function(i){return a.cancel(i)});a.add(p.id+"_menu","click",function(i){var m;i=c.getParent(i.target,"a",j);if(i&&i.nodeName.toLowerCase()=="a"&&(m=i.getAttribute("data-mce-color"))){p.setColor(m)}return a.cancel(i)});return o},setColor:function(f){this.displayColor(f);this.hideMenu();this.settings.onselect(f)},displayColor:function(g){var f=this;c.setStyle(f.id+"_preview","backgroundColor",g);f.value=g},postRender:function(){var f=this,g=f.id;f.parent();c.add(g+"_action","div",{id:g+"_preview","class":"mceColorPreview"});c.setStyle(f.id+"_preview","backgroundColor",f.value)},destroy:function(){this.parent();a.clear(this.id+"_menu");a.clear(this.id+"_more");c.remove(this.id+"_menu")}})})(tinymce);(function(b){var d=b.DOM,c=b.each,a=b.dom.Event;b.create("tinymce.ui.ToolbarGroup:tinymce.ui.Container",{renderHTML:function(){var f=this,i=[],e=f.controls,j=b.each,g=f.settings;i.push('<div id="'+f.id+'" role="group" aria-labelledby="'+f.id+'_voice">');i.push("<span role='application'>");i.push('<span id="'+f.id+'_voice" class="mceVoiceLabel" style="display:none;">'+d.encode(g.name)+"</span>");j(e,function(h){i.push(h.renderHTML())});i.push("</span>");i.push("</div>");return i.join("")},focus:function(){this.keyNav.focus()},postRender:function(){var f=this,e=[];c(f.controls,function(g){c(g.controls,function(h){if(h.id){e.push(h)}})});f.keyNav=new b.ui.KeyboardNavigation({root:f.id,items:e,onCancel:function(){f.editor.focus()},excludeFromTabOrder:!f.settings.tab_focus_toolbar})},destroy:function(){var e=this;e.parent();e.keyNav.destroy();a.clear(e.id)}})})(tinymce);(function(a){var c=a.DOM,b=a.each;a.create("tinymce.ui.Toolbar:tinymce.ui.Container",{renderHTML:function(){var m=this,f="",j,k,n=m.settings,e,d,g,l;l=m.controls;for(e=0;e<l.length;e++){k=l[e];d=l[e-1];g=l[e+1];if(e===0){j="mceToolbarStart";if(k.Button){j+=" mceToolbarStartButton"}else{if(k.SplitButton){j+=" mceToolbarStartSplitButton"}else{if(k.ListBox){j+=" mceToolbarStartListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,"<!-- IE -->"))}if(d&&k.ListBox){if(d.Button||d.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarEnd"},c.createHTML("span",null,"<!-- IE -->"))}}if(c.stdMode){f+='<td style="position: relative">'+k.renderHTML()+"</td>"}else{f+="<td>"+k.renderHTML()+"</td>"}if(g&&k.ListBox){if(g.Button||g.SplitButton){f+=c.createHTML("td",{"class":"mceToolbarStart"},c.createHTML("span",null,"<!-- IE -->"))}}}j="mceToolbarEnd";if(k.Button){j+=" mceToolbarEndButton"}else{if(k.SplitButton){j+=" mceToolbarEndSplitButton"}else{if(k.ListBox){j+=" mceToolbarEndListBox"}}}f+=c.createHTML("td",{"class":j},c.createHTML("span",null,"<!-- IE -->"));return c.createHTML("table",{id:m.id,"class":"mceToolbar"+(n["class"]?" "+n["class"]:""),cellpadding:"0",cellspacing:"0",align:m.settings.align||"",role:"presentation",tabindex:"-1"},"<tbody><tr>"+f+"</tr></tbody>")}})})(tinymce);(function(b){var a=b.util.Dispatcher,c=b.each;b.create("tinymce.AddOnManager",{AddOnManager:function(){var d=this;d.items=[];d.urls={};d.lookup={};d.onAdd=new a(d)},get:function(d){return this.lookup[d]},requireLangPack:function(e){var d=b.settings;if(d&&d.language&&d.language_load!==false){b.ScriptLoader.add(this.urls[e]+"/langs/"+d.language+".js")}},add:function(e,d){this.items.push(d);this.lookup[e]=d;this.onAdd.dispatch(this,e,d);return d},load:function(h,e,d,g){var f=this;if(f.urls[h]){return}if(e.indexOf("/")!=0&&e.indexOf("://")==-1){e=b.baseURL+"/"+e}f.urls[h]=e.substring(0,e.lastIndexOf("/"));if(!f.lookup[h]){b.ScriptLoader.add(e,d,g)}}});b.PluginManager=new b.AddOnManager();b.ThemeManager=new b.AddOnManager()}(tinymce));(function(j){var g=j.each,d=j.extend,k=j.DOM,i=j.dom.Event,f=j.ThemeManager,b=j.PluginManager,e=j.explode,h=j.util.Dispatcher,a,c=0;j.documentBaseURL=window.location.href.replace(/[\?#].*$/,"").replace(/[\/\\][^\/]+$/,"");if(!/[\/\\]$/.test(j.documentBaseURL)){j.documentBaseURL+="/"}j.baseURL=new j.util.URI(j.documentBaseURL).toAbsolute(j.baseURL);j.baseURI=new j.util.URI(j.baseURL);j.onBeforeUnload=new h(j);i.add(window,"beforeunload",function(l){j.onBeforeUnload.dispatch(j,l)});j.onAddEditor=new h(j);j.onRemoveEditor=new h(j);j.EditorManager=d(j,{editors:[],i18n:{},activeEditor:null,init:function(q){var n=this,p,l=j.ScriptLoader,u,o=[],m;function r(x,y,t){var v=x[y];if(!v){return}if(j.is(v,"string")){t=v.replace(/\.\w+$/,"");t=t?j.resolve(t):0;v=j.resolve(v)}return v.apply(t||this,Array.prototype.slice.call(arguments,2))}q=d({theme:"simple",language:"en"},q);n.settings=q;i.add(document,"init",function(){var s,v;r(q,"onpageload");switch(q.mode){case"exact":s=q.elements||"";if(s.length>0){g(e(s),function(x){if(k.get(x)){m=new j.Editor(x,q);o.push(m);m.render(1)}else{g(document.forms,function(y){g(y.elements,function(z){if(z.name===x){x="mce_editor_"+c++;k.setAttrib(z,"id",x);m=new j.Editor(x,q);o.push(m);m.render(1)}})})}})}break;case"textareas":case"specific_textareas":function t(y,x){return x.constructor===RegExp?x.test(y.className):k.hasClass(y,x)}g(k.select("textarea"),function(x){if(q.editor_deselector&&t(x,q.editor_deselector)){return}if(!q.editor_selector||t(x,q.editor_selector)){u=k.get(x.name);if(!x.id&&!u){x.id=x.name}if(!x.id||n.get(x.id)){x.id=k.uniqueId()}m=new j.Editor(x.id,q);o.push(m);m.render(1)}});break}if(q.oninit){s=v=0;g(o,function(x){v++;if(!x.initialized){x.onInit.add(function(){s++;if(s==v){r(q,"oninit")}})}else{s++}if(s==v){r(q,"oninit")}})}})},get:function(l){if(l===a){return this.editors}return this.editors[l]},getInstanceById:function(l){return this.get(l)},add:function(m){var l=this,n=l.editors;n[m.id]=m;n.push(m);l._setActive(m);l.onAddEditor.dispatch(l,m);if(j.adapter){j.adapter.patchEditor(m)}return m},remove:function(n){var m=this,l,o=m.editors;if(!o[n.id]){return null}delete o[n.id];for(l=0;l<o.length;l++){if(o[l]==n){o.splice(l,1);break}}if(m.activeEditor==n){m._setActive(o[0])}n.destroy();m.onRemoveEditor.dispatch(m,n);return n},execCommand:function(r,p,o){var q=this,n=q.get(o),l;switch(r){case"mceFocus":n.focus();return true;case"mceAddEditor":case"mceAddControl":if(!q.get(o)){new j.Editor(o,q.settings).render()}return true;case"mceAddFrameControl":l=o.window;l.tinyMCE=tinyMCE;l.tinymce=j;j.DOM.doc=l.document;j.DOM.win=l;n=new j.Editor(o.element_id,o);n.render();if(j.isIE){function m(){n.destroy();l.detachEvent("onunload",m);l=l.tinyMCE=l.tinymce=null}l.attachEvent("onunload",m)}o.page_window=null;return true;case"mceRemoveEditor":case"mceRemoveControl":if(n){n.remove()}return true;case"mceToggleEditor":if(!n){q.execCommand("mceAddControl",0,o);return true}if(n.isHidden()){n.show()}else{n.hide()}return true}if(q.activeEditor){return q.activeEditor.execCommand(r,p,o)}return false},execInstanceCommand:function(p,o,n,m){var l=this.get(p);if(l){return l.execCommand(o,n,m)}return false},triggerSave:function(){g(this.editors,function(l){l.save()})},addI18n:function(n,q){var l,m=this.i18n;if(!j.is(n,"string")){g(n,function(r,p){g(r,function(t,s){g(t,function(v,u){if(s==="common"){m[p+"."+u]=v}else{m[p+"."+s+"."+u]=v}})})})}else{g(q,function(r,p){m[n+"."+p]=r})}},_setActive:function(l){this.selectedInstance=this.activeEditor=l}})})(tinymce);(function(m){var n=m.DOM,j=m.dom.Event,f=m.extend,k=m.util.Dispatcher,i=m.each,a=m.isGecko,b=m.isIE,e=m.isWebKit,d=m.is,h=m.ThemeManager,c=m.PluginManager,o=m.inArray,l=m.grep,g=m.explode;m.create("tinymce.Editor",{Editor:function(r,q){var p=this;p.id=p.editorId=r;p.execCommands={};p.queryStateCommands={};p.queryValueCommands={};p.isNotDirty=false;p.plugins={};i(["onPreInit","onBeforeRenderUI","onPostRender","onInit","onRemove","onActivate","onDeactivate","onClick","onEvent","onMouseUp","onMouseDown","onDblClick","onKeyDown","onKeyUp","onKeyPress","onContextMenu","onSubmit","onReset","onPaste","onPreProcess","onPostProcess","onBeforeSetContent","onBeforeGetContent","onSetContent","onGetContent","onLoadContent","onSaveContent","onNodeChange","onChange","onBeforeExecCommand","onExecCommand","onUndo","onRedo","onVisualAid","onSetProgressState"],function(s){p[s]=new k(p)});p.settings=q=f({id:r,language:"en",docs_language:"en",theme:"simple",skin:"default",delta_width:0,delta_height:0,popup_css:"",plugins:"",document_base_url:m.documentBaseURL,add_form_submit_trigger:1,submit_patch:1,add_unload_trigger:1,convert_urls:1,relative_urls:1,remove_script_host:1,table_inline_editing:0,object_resizing:1,cleanup:1,accessibility_focus:1,custom_shortcuts:1,custom_undo_redo_keyboard_shortcuts:1,custom_undo_redo_restore_selection:1,custom_undo_redo:1,doctype:m.isIE6?'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">':"<!DOCTYPE>",visual_table_class:"mceItemTable",visual:1,font_size_style_values:"xx-small,x-small,small,medium,large,x-large,xx-large",apply_source_formatting:1,directionality:"ltr",forced_root_block:"p",hidden_input:1,padd_empty_editor:1,render_ui:1,init_theme:1,force_p_newlines:1,indentation:"30px",keep_styles:1,fix_table_elements:1,inline_styles:1,convert_fonts_to_spans:true,indent:"simple",indent_before:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr",indent_after:"p,h1,h2,h3,h4,h5,h6,blockquote,div,title,style,pre,script,td,ul,li,area,table,thead,tfoot,tbody,tr",validate:true,entity_encoding:"named",url_converter:p.convertURL,url_converter_scope:p,ie7_compat:true},q);p.documentBaseURI=new m.util.URI(q.document_base_url||m.documentBaseURL,{base_uri:tinyMCE.baseURI});p.baseURI=m.baseURI;p.contentCSS=[];p.execCallback("setup",p)},render:function(r){var u=this,v=u.settings,x=u.id,p=m.ScriptLoader;if(!j.domLoaded){j.add(document,"init",function(){u.render()});return}tinyMCE.settings=v;if(!u.getElement()){return}if(m.isIDevice){return}if(!/TEXTAREA|INPUT/i.test(u.getElement().nodeName)&&v.hidden_input&&n.getParent(x,"form")){n.insertAfter(n.create("input",{type:"hidden",name:x}),x)}if(m.WindowManager){u.windowManager=new m.WindowManager(u)}if(v.encoding=="xml"){u.onGetContent.add(function(s,t){if(t.save){t.content=n.encode(t.content)}})}if(v.add_form_submit_trigger){u.onSubmit.addToTop(function(){if(u.initialized){u.save();u.isNotDirty=1}})}if(v.add_unload_trigger){u._beforeUnload=tinyMCE.onBeforeUnload.add(function(){if(u.initialized&&!u.destroyed&&!u.isHidden()){u.save({format:"raw",no_events:true})}})}m.addUnload(u.destroy,u);if(v.submit_patch){u.onBeforeRenderUI.add(function(){var s=u.getElement().form;if(!s){return}if(s._mceOldSubmit){return}if(!s.submit.nodeType&&!s.submit.length){u.formElement=s;s._mceOldSubmit=s.submit;s.submit=function(){m.triggerSave();u.isNotDirty=1;return u.formElement._mceOldSubmit(u.formElement)}}s=null})}function q(){if(v.language&&v.language_load!==false){p.add(m.baseURL+"/langs/"+v.language+".js")}if(v.theme&&v.theme.charAt(0)!="-"&&!h.urls[v.theme]){h.load(v.theme,"themes/"+v.theme+"/editor_template"+m.suffix+".js")}i(g(v.plugins),function(s){if(s&&s.charAt(0)!="-"&&!c.urls[s]){if(s=="safari"){return}c.load(s,"plugins/"+s+"/editor_plugin"+m.suffix+".js")}});p.loadQueue(function(){if(!u.removed){u.init()}})}q()},init:function(){var r,F=this,G=F.settings,C,z,B=F.getElement(),q,p,D,x,A,E,y;m.add(F);G.aria_label=G.aria_label||n.getAttrib(B,"aria-label",F.getLang("aria.rich_text_area"));if(G.theme){G.theme=G.theme.replace(/-/,"");q=h.get(G.theme);F.theme=new q();if(F.theme.init&&G.init_theme){F.theme.init(F,h.urls[G.theme]||m.documentBaseURL.replace(/\/$/,""))}}i(g(G.plugins.replace(/\-/g,"")),function(H){var I=c.get(H),t=c.urls[H]||m.documentBaseURL.replace(/\/$/,""),s;if(I){s=new I(F,t);F.plugins[H]=s;if(s.init){s.init(F,t)}}});if(G.popup_css!==false){if(G.popup_css){G.popup_css=F.documentBaseURI.toAbsolute(G.popup_css)}else{G.popup_css=F.baseURI.toAbsolute("themes/"+G.theme+"/skins/"+G.skin+"/dialog.css")}}if(G.popup_css_add){G.popup_css+=","+F.documentBaseURI.toAbsolute(G.popup_css_add)}F.controlManager=new m.ControlManager(F);if(G.custom_undo_redo){F.onBeforeExecCommand.add(function(t,H,u,I,s){if(H!="Undo"&&H!="Redo"&&H!="mceRepaint"&&(!s||!s.skip_undo)){F.undoManager.beforeChange()}});F.onExecCommand.add(function(t,H,u,I,s){if(H!="Undo"&&H!="Redo"&&H!="mceRepaint"&&(!s||!s.skip_undo)){F.undoManager.add()}})}F.onExecCommand.add(function(s,t){if(!/^(FontName|FontSize)$/.test(t)){F.nodeChanged()}});if(a){function v(s,t){if(!t||!t.initial){F.execCommand("mceRepaint")}}F.onUndo.add(v);F.onRedo.add(v);F.onSetContent.add(v)}F.onBeforeRenderUI.dispatch(F,F.controlManager);if(G.render_ui){C=G.width||B.style.width||B.offsetWidth;z=G.height||B.style.height||B.offsetHeight;F.orgDisplay=B.style.display;E=/^[0-9\.]+(|px)$/i;if(E.test(""+C)){C=Math.max(parseInt(C)+(q.deltaWidth||0),100)}if(E.test(""+z)){z=Math.max(parseInt(z)+(q.deltaHeight||0),100)}q=F.theme.renderUI({targetNode:B,width:C,height:z,deltaWidth:G.delta_width,deltaHeight:G.delta_height});F.editorContainer=q.editorContainer}if(document.domain&&location.hostname!=document.domain){m.relaxedDomain=document.domain}n.setStyles(q.sizeContainer||q.editorContainer,{width:C,height:z});if(G.content_css){m.each(g(G.content_css),function(s){F.contentCSS.push(F.documentBaseURI.toAbsolute(s))})}z=(q.iframeHeight||z)+(typeof(z)=="number"?(q.deltaHeight||0):"");if(z<100){z=100}F.iframeHTML=G.doctype+'<html><head xmlns="http://www.w3.org/1999/xhtml">';if(G.document_base_url!=m.documentBaseURL){F.iframeHTML+='<base href="'+F.documentBaseURI.getURI()+'" />'}if(G.ie7_compat){F.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=7" />'}else{F.iframeHTML+='<meta http-equiv="X-UA-Compatible" content="IE=edge" />'}F.iframeHTML+='<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />';if(!a||!/Firefox\/2/.test(navigator.userAgent)){for(y=0;y<F.contentCSS.length;y++){F.iframeHTML+='<link type="text/css" rel="stylesheet" href="'+F.contentCSS[y]+'" />'}F.contentCSS=[]}x=G.body_id||"tinymce";if(x.indexOf("=")!=-1){x=F.getParam("body_id","","hash");x=x[F.id]||x}A=G.body_class||"";if(A.indexOf("=")!=-1){A=F.getParam("body_class","","hash");A=A[F.id]||""}F.iframeHTML+='</head><body id="'+x+'" class="mceContentBody '+A+'"></body></html>';if(m.relaxedDomain&&(b||(m.isOpera&&parseFloat(opera.version())<11))){D='javascript:(function(){document.open();document.domain="'+document.domain+'";var ed = window.parent.tinyMCE.get("'+F.id+'");document.write(ed.iframeHTML);document.close();ed.setupIframe();})()'}r=n.add(q.iframeContainer,"iframe",{id:F.id+"_ifr",src:D||'javascript:""',frameBorder:"0",title:G.aria_label,style:{width:"100%",height:z}});F.contentAreaContainer=q.iframeContainer;n.get(q.editorContainer).style.display=F.orgDisplay;n.get(F.id).style.display="none";n.setAttrib(F.id,"aria-hidden",true);if(!m.relaxedDomain||!D){F.setupIframe()}B=r=q=null},setupIframe:function(){var r=this,x=r.settings,y=n.get(r.id),z=r.getDoc(),v,p;if(!b||!m.relaxedDomain){z.open();z.write(r.iframeHTML);z.close();if(m.relaxedDomain){z.domain=m.relaxedDomain}}if(!b){try{if(!x.readonly){z.designMode="On"}}catch(q){}}if(b){p=r.getBody();n.hide(p);if(!x.readonly){p.contentEditable=true}n.show(p)}r.schema=new m.html.Schema(x);r.dom=new m.dom.DOMUtils(r.getDoc(),{keep_values:true,url_converter:r.convertURL,url_converter_scope:r,hex_colors:x.force_hex_style_colors,class_filter:x.class_filter,update_styles:1,fix_ie_paragraphs:1,schema:r.schema});r.parser=new m.html.DomParser(x,r.schema);r.parser.addAttributeFilter("name",function(s,t){var B=s.length,D,A,C,E;while(B--){E=s[B];if(E.name==="a"&&E.firstChild){C=E.parent;D=E.lastChild;do{A=D.prev;C.insert(D,E);D=A}while(D)}}});r.parser.addAttributeFilter("src,href,style",function(s,t){var A=s.length,B,D=r.dom,C;while(A--){B=s[A];C=B.attr(t);if(t==="style"){B.attr("data-mce-style",D.serializeStyle(D.parseStyle(C),B.name))}else{B.attr("data-mce-"+t,r.convertURL(C,t,B.name))}}});r.parser.addNodeFilter("script",function(s,t){var A=s.length;while(A--){s[A].attr("type","mce-text/javascript")}});r.parser.addNodeFilter("#cdata",function(s,t){var A=s.length,B;while(A--){B=s[A];B.type=8;B.name="#comment";B.value="[CDATA["+B.value+"]]"}});r.parser.addNodeFilter("p,h1,h2,h3,h4,h5,h6,div",function(t,A){var B=t.length,C,s=r.schema.getNonEmptyElements();while(B--){C=t[B];if(C.isEmpty(s)){C.empty().append(new m.html.Node("br",1)).shortEnded=true}}});r.serializer=new m.dom.Serializer(x,r.dom,r.schema);r.selection=new m.dom.Selection(r.dom,r.getWin(),r.serializer);r.formatter=new m.Formatter(this);r.formatter.register({alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"}},{selector:"img,table",collapsed:false,styles:{"float":"left"}}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"}},{selector:"img",collapsed:false,styles:{display:"block",marginLeft:"auto",marginRight:"auto"}},{selector:"table",collapsed:false,styles:{marginLeft:"auto",marginRight:"auto"}}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"}},{selector:"img,table",collapsed:false,styles:{"float":"right"}}],alignfull:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"justify"}}],bold:[{inline:"strong",remove:"all"},{inline:"span",styles:{fontWeight:"bold"}},{inline:"b",remove:"all"}],italic:[{inline:"em",remove:"all"},{inline:"span",styles:{fontStyle:"italic"}},{inline:"i",remove:"all"}],underline:[{inline:"span",styles:{textDecoration:"underline"},exact:true},{inline:"u",remove:"all"}],strikethrough:[{inline:"span",styles:{textDecoration:"line-through"},exact:true},{inline:"strike",remove:"all"}],forecolor:{inline:"span",styles:{color:"%value"},wrap_links:false},hilitecolor:{inline:"span",styles:{backgroundColor:"%value"},wrap_links:false},fontname:{inline:"span",styles:{fontFamily:"%value"}},fontsize:{inline:"span",styles:{fontSize:"%value"}},fontsize_class:{inline:"span",attributes:{"class":"%value"}},blockquote:{block:"blockquote",wrapper:1,remove:"all"},subscript:{inline:"sub"},superscript:{inline:"sup"},removeformat:[{selector:"b,strong,em,i,font,u,strike",remove:"all",split:true,expand:false,block_expand:true,deep:true},{selector:"span",attributes:["style","class"],remove:"empty",split:true,expand:false,deep:true},{selector:"*",attributes:["style","class"],split:false,expand:false,deep:true}]});i("p h1 h2 h3 h4 h5 h6 div address pre div code dt dd samp".split(/\s/),function(s){r.formatter.register(s,{block:s,remove:"all"})});r.formatter.register(r.settings.formats);r.undoManager=new m.UndoManager(r);r.undoManager.onAdd.add(function(t,s){if(t.hasUndo()){return r.onChange.dispatch(r,s,t)}});r.undoManager.onUndo.add(function(t,s){return r.onUndo.dispatch(r,s,t)});r.undoManager.onRedo.add(function(t,s){return r.onRedo.dispatch(r,s,t)});r.forceBlocks=new m.ForceBlocks(r,{forced_root_block:x.forced_root_block});r.editorCommands=new m.EditorCommands(r);r.serializer.onPreProcess.add(function(s,t){return r.onPreProcess.dispatch(r,t,s)});r.serializer.onPostProcess.add(function(s,t){return r.onPostProcess.dispatch(r,t,s)});r.onPreInit.dispatch(r);if(!x.gecko_spellcheck){r.getBody().spellcheck=0}if(!x.readonly){r._addEvents()}r.controlManager.onPostRender.dispatch(r,r.controlManager);r.onPostRender.dispatch(r);if(x.directionality){r.getBody().dir=x.directionality}if(x.nowrap){r.getBody().style.whiteSpace="nowrap"}if(x.handle_node_change_callback){r.onNodeChange.add(function(t,s,A){r.execCallback("handle_node_change_callback",r.id,A,-1,-1,true,r.selection.isCollapsed())})}if(x.save_callback){r.onSaveContent.add(function(s,A){var t=r.execCallback("save_callback",r.id,A.content,r.getBody());if(t){A.content=t}})}if(x.onchange_callback){r.onChange.add(function(t,s){r.execCallback("onchange_callback",r,s)})}if(x.protect){r.onBeforeSetContent.add(function(s,t){if(x.protect){i(x.protect,function(A){t.content=t.content.replace(A,function(B){return"<!--mce:protected "+escape(B)+"-->"})})}})}if(x.convert_newlines_to_brs){r.onBeforeSetContent.add(function(s,t){if(t.initial){t.content=t.content.replace(/\r?\n/g,"<br />")}})}if(x.preformatted){r.onPostProcess.add(function(s,t){t.content=t.content.replace(/^\s*<pre.*?>/,"");t.content=t.content.replace(/<\/pre>\s*$/,"");if(t.set){t.content='<pre class="mceItemHidden">'+t.content+"</pre>"}})}if(x.verify_css_classes){r.serializer.attribValueFilter=function(C,A){var B,t;if(C=="class"){if(!r.classesRE){t=r.dom.getClasses();if(t.length>0){B="";i(t,function(s){B+=(B?"|":"")+s["class"]});r.classesRE=new RegExp("("+B+")","gi")}}return !r.classesRE||/(\bmceItem\w+\b|\bmceTemp\w+\b)/g.test(A)||r.classesRE.test(A)?A:""}return A}}if(x.cleanup_callback){r.onBeforeSetContent.add(function(s,t){t.content=r.execCallback("cleanup_callback","insert_to_editor",t.content,t)});r.onPreProcess.add(function(s,t){if(t.set){r.execCallback("cleanup_callback","insert_to_editor_dom",t.node,t)}if(t.get){r.execCallback("cleanup_callback","get_from_editor_dom",t.node,t)}});r.onPostProcess.add(function(s,t){if(t.set){t.content=r.execCallback("cleanup_callback","insert_to_editor",t.content,t)}if(t.get){t.content=r.execCallback("cleanup_callback","get_from_editor",t.content,t)}})}if(x.save_callback){r.onGetContent.add(function(s,t){if(t.save){t.content=r.execCallback("save_callback",r.id,t.content,r.getBody())}})}if(x.handle_event_callback){r.onEvent.add(function(s,t,A){if(r.execCallback("handle_event_callback",t,s,A)===false){j.cancel(t)}})}r.onSetContent.add(function(){r.addVisual(r.getBody())});if(x.padd_empty_editor){r.onPostProcess.add(function(s,t){t.content=t.content.replace(/^(<p[^>]*>(&nbsp;|&#160;|\s|\u00a0|)<\/p>[\r\n]*|<br \/>[\r\n]*)$/,"")})}if(a){function u(s,t){i(s.dom.select("a"),function(B){var A=B.parentNode;if(s.dom.isBlock(A)&&A.lastChild===B){s.dom.add(A,"br",{"data-mce-bogus":1})}})}r.onExecCommand.add(function(s,t){if(t==="CreateLink"){u(s)}});r.onSetContent.add(r.selection.onSetContent.add(u));if(!x.readonly){try{z.designMode="Off";z.designMode="On"}catch(q){}}}setTimeout(function(){if(r.removed){return}r.load({initial:true,format:"html"});r.startContent=r.getContent({format:"raw"});r.undoManager.add();r.initialized=true;r.onInit.dispatch(r);r.execCallback("setupcontent_callback",r.id,r.getBody(),r.getDoc());r.execCallback("init_instance_callback",r);r.focus(true);r.nodeChanged({initial:1});i(r.contentCSS,function(s){r.dom.loadCSS(s)});if(x.auto_focus){setTimeout(function(){var s=m.get(x.auto_focus);s.selection.select(s.getBody(),1);s.selection.collapse(1);s.getWin().focus()},100)}},1);y=null},focus:function(s){var x,q=this,v=q.settings.content_editable,r,p,u=q.getDoc();if(!s){r=q.selection.getRng();if(r.item){p=r.item(0)}if(!v){q.getWin().focus()}if(p&&p.ownerDocument==u){r=u.body.createControlRange();r.addElement(p);r.select()}}if(m.activeEditor!=q){if((x=m.activeEditor)!=null){x.onDeactivate.dispatch(x,q)}q.onActivate.dispatch(q,x)}m._setActive(q)},execCallback:function(u){var p=this,r=p.settings[u],q;if(!r){return}if(p.callbackLookup&&(q=p.callbackLookup[u])){r=q.func;q=q.scope}if(d(r,"string")){q=r.replace(/\.\w+$/,"");q=q?m.resolve(q):0;r=m.resolve(r);p.callbackLookup=p.callbackLookup||{};p.callbackLookup[u]={func:r,scope:q}}return r.apply(q||p,Array.prototype.slice.call(arguments,1))},translate:function(p){var r=this.settings.language||"en",q=m.i18n;if(!p){return""}return q[r+"."+p]||p.replace(/{\#([^}]+)\}/g,function(t,s){return q[r+"."+s]||"{#"+s+"}"})},getLang:function(q,p){return m.i18n[(this.settings.language||"en")+"."+q]||(d(p)?p:"{#"+q+"}")},getParam:function(u,r,p){var s=m.trim,q=d(this.settings[u])?this.settings[u]:r,t;if(p==="hash"){t={};if(d(q,"string")){i(q.indexOf("=")>0?q.split(/[;,](?![^=;,]*(?:[;,]|$))/):q.split(","),function(x){x=x.split("=");if(x.length>1){t[s(x[0])]=s(x[1])}else{t[s(x[0])]=s(x)}})}else{t=q}return t}return q},nodeChanged:function(r){var p=this,q=p.selection,u=q.getStart()||p.getBody();if(p.initialized){r=r||{};u=b&&u.ownerDocument!=p.getDoc()?p.getBody():u;r.parents=[];p.dom.getParent(u,function(s){if(s.nodeName=="BODY"){return true}r.parents.push(s)});p.onNodeChange.dispatch(p,r?r.controlManager||p.controlManager:p.controlManager,u,q.isCollapsed(),r)}},addButton:function(r,q){var p=this;p.buttons=p.buttons||{};p.buttons[r]=q},addCommand:function(p,r,q){this.execCommands[p]={func:r,scope:q||this}},addQueryStateHandler:function(p,r,q){this.queryStateCommands[p]={func:r,scope:q||this}},addQueryValueHandler:function(p,r,q){this.queryValueCommands[p]={func:r,scope:q||this}},addShortcut:function(r,u,p,s){var q=this,v;if(!q.settings.custom_shortcuts){return false}q.shortcuts=q.shortcuts||{};if(d(p,"string")){v=p;p=function(){q.execCommand(v,false,null)}}if(d(p,"object")){v=p;p=function(){q.execCommand(v[0],v[1],v[2])}}i(g(r),function(t){var x={func:p,scope:s||this,desc:u,alt:false,ctrl:false,shift:false};i(g(t,"+"),function(y){switch(y){case"alt":case"ctrl":case"shift":x[y]=true;break;default:x.charCode=y.charCodeAt(0);x.keyCode=y.toUpperCase().charCodeAt(0)}});q.shortcuts[(x.ctrl?"ctrl":"")+","+(x.alt?"alt":"")+","+(x.shift?"shift":"")+","+x.keyCode]=x});return true},execCommand:function(x,v,z,p){var r=this,u=0,y,q;if(!/^(mceAddUndoLevel|mceEndUndoLevel|mceBeginUndoLevel|mceRepaint|SelectAll)$/.test(x)&&(!p||!p.skip_focus)){r.focus()}y={};r.onBeforeExecCommand.dispatch(r,x,v,z,y);if(y.terminate){return false}if(r.execCallback("execcommand_callback",r.id,r.selection.getNode(),x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(y=r.execCommands[x]){q=y.func.call(y.scope,v,z);if(q!==true){r.onExecCommand.dispatch(r,x,v,z,p);return q}}i(r.plugins,function(s){if(s.execCommand&&s.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);u=1;return false}});if(u){return true}if(r.theme&&r.theme.execCommand&&r.theme.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}if(r.editorCommands.execCommand(x,v,z)){r.onExecCommand.dispatch(r,x,v,z,p);return true}r.getDoc().execCommand(x,v,z);r.onExecCommand.dispatch(r,x,v,z,p)},queryCommandState:function(u){var q=this,v,r;if(q._isHidden()){return}if(v=q.queryStateCommands[u]){r=v.func.call(v.scope);if(r!==true){return r}}v=q.editorCommands.queryCommandState(u);if(v!==-1){return v}try{return this.getDoc().queryCommandState(u)}catch(p){}},queryCommandValue:function(v){var q=this,u,r;if(q._isHidden()){return}if(u=q.queryValueCommands[v]){r=u.func.call(u.scope);if(r!==true){return r}}u=q.editorCommands.queryCommandValue(v);if(d(u)){return u}try{return this.getDoc().queryCommandValue(v)}catch(p){}},show:function(){var p=this;n.show(p.getContainer());n.hide(p.id);p.load()},hide:function(){var p=this,q=p.getDoc();if(b&&q){q.execCommand("SelectAll")}p.save();n.hide(p.getContainer());n.setStyle(p.id,"display",p.orgDisplay)},isHidden:function(){return !n.isHidden(this.id)},setProgressState:function(p,q,r){this.onSetProgressState.dispatch(this,p,q,r);return p},load:function(s){var p=this,r=p.getElement(),q;if(r){s=s||{};s.load=true;q=p.setContent(d(r.value)?r.value:r.innerHTML,s);s.element=r;if(!s.no_events){p.onLoadContent.dispatch(p,s)}s.element=r=null;return q}},save:function(u){var p=this,s=p.getElement(),q,r;if(!s||!p.initialized){return}u=u||{};u.save=true;if(!u.no_events){p.undoManager.typing=false;p.undoManager.add()}u.element=s;q=u.content=p.getContent(u);if(!u.no_events){p.onSaveContent.dispatch(p,u)}q=u.content;if(!/TEXTAREA|INPUT/i.test(s.nodeName)){s.innerHTML=q;if(r=n.getParent(p.id,"form")){i(r.elements,function(t){if(t.name==p.id){t.value=q;return false}})}}else{s.value=q}u.element=s=null;return q},setContent:function(t,s){var r=this,q,p=r.getBody();s=s||{};s.format=s.format||"html";s.set=true;s.content=t;if(!s.no_events){r.onBeforeSetContent.dispatch(r,s)}t=s.content;if(!m.isIE&&(t.length===0||/^\s+$/.test(t))){p.innerHTML='<br data-mce-bogus="1" />';return}if(s.format!=="raw"){t=new m.html.Serializer({},r.schema).serialize(r.parser.parse(t))}s.content=m.trim(t);r.dom.setHTML(p,s.content);if(!s.no_events){r.onSetContent.dispatch(r,s)}return s.content},getContent:function(q){var p=this,r;q=q||{};q.format=q.format||"html";q.get=true;if(!q.no_events){p.onBeforeGetContent.dispatch(p,q)}if(q.format=="raw"){r=p.getBody().innerHTML}else{r=p.serializer.serialize(p.getBody(),q)}q.content=m.trim(r);if(!q.no_events){p.onGetContent.dispatch(p,q)}return q.content},isDirty:function(){var p=this;return m.trim(p.startContent)!=m.trim(p.getContent({format:"raw",no_events:1}))&&!p.isNotDirty},getContainer:function(){var p=this;if(!p.container){p.container=n.get(p.editorContainer||p.id+"_parent")}return p.container},getContentAreaContainer:function(){return this.contentAreaContainer},getElement:function(){return n.get(this.settings.content_element||this.id)},getWin:function(){var p=this,q;if(!p.contentWindow){q=n.get(p.id+"_ifr");if(q){p.contentWindow=q.contentWindow}}return p.contentWindow},getDoc:function(){var q=this,p;if(!q.contentDocument){p=q.getWin();if(p){q.contentDocument=p.document}}return q.contentDocument},getBody:function(){return this.bodyElement||this.getDoc().body},convertURL:function(p,x,v){var q=this,r=q.settings;if(r.urlconverter_callback){return q.execCallback("urlconverter_callback",p,v,true,x)}if(!r.convert_urls||(v&&v.nodeName=="LINK")||p.indexOf("file:")===0){return p}if(r.relative_urls){return q.documentBaseURI.toRelative(p)}p=q.documentBaseURI.toAbsolute(p,r.remove_script_host);return p},addVisual:function(r){var p=this,q=p.settings;r=r||p.getBody();if(!d(p.hasVisual)){p.hasVisual=q.visual}i(p.dom.select("table,a",r),function(t){var s;switch(t.nodeName){case"TABLE":s=p.dom.getAttrib(t,"border");if(!s||s=="0"){if(p.hasVisual){p.dom.addClass(t,q.visual_table_class)}else{p.dom.removeClass(t,q.visual_table_class)}}return;case"A":s=p.dom.getAttrib(t,"name");if(s){if(p.hasVisual){p.dom.addClass(t,"mceItemAnchor")}else{p.dom.removeClass(t,"mceItemAnchor")}}return}});p.onVisualAid.dispatch(p,r,p.hasVisual)},remove:function(){var p=this,q=p.getContainer();p.removed=1;p.hide();p.execCallback("remove_instance_callback",p);p.onRemove.dispatch(p);p.onExecCommand.listeners=[];m.remove(p);n.remove(q)},destroy:function(q){var p=this;if(p.destroyed){return}if(!q){m.removeUnload(p.destroy);tinyMCE.onBeforeUnload.remove(p._beforeUnload);if(p.theme&&p.theme.destroy){p.theme.destroy()}p.controlManager.destroy();p.selection.destroy();p.dom.destroy();if(!p.settings.content_editable){j.clear(p.getWin());j.clear(p.getDoc())}j.clear(p.getBody());j.clear(p.formElement)}if(p.formElement){p.formElement.submit=p.formElement._mceOldSubmit;p.formElement._mceOldSubmit=null}p.contentAreaContainer=p.formElement=p.container=p.settings.content_element=p.bodyElement=p.contentDocument=p.contentWindow=null;if(p.selection){p.selection=p.selection.win=p.selection.dom=p.selection.dom.doc=null}p.destroyed=1},_addEvents:function(){var B=this,r,C=B.settings,q=B.dom,x={mouseup:"onMouseUp",mousedown:"onMouseDown",click:"onClick",keyup:"onKeyUp",keydown:"onKeyDown",keypress:"onKeyPress",submit:"onSubmit",reset:"onReset",contextmenu:"onContextMenu",dblclick:"onDblClick",paste:"onPaste"};function p(t,D){var s=t.type;if(B.removed){return}if(B.onEvent.dispatch(B,t,D)!==false){B[x[t.fakeType||t.type]].dispatch(B,t,D)}}i(x,function(t,s){switch(s){case"contextmenu":q.bind(B.getDoc(),s,p);break;case"paste":q.bind(B.getBody(),s,function(D){p(D)});break;case"submit":case"reset":q.bind(B.getElement().form||n.getParent(B.id,"form"),s,p);break;default:q.bind(C.content_editable?B.getBody():B.getDoc(),s,p)}});q.bind(C.content_editable?B.getBody():(a?B.getDoc():B.getWin()),"focus",function(s){B.focus(true)});if(m.isGecko){q.bind(B.getDoc(),"DOMNodeInserted",function(t){var s;t=t.target;if(t.nodeType===1&&t.nodeName==="IMG"&&(s=t.getAttribute("data-mce-src"))){t.src=B.documentBaseURI.toAbsolute(s)}})}if(a){function u(){var E=this,G=E.getDoc(),F=E.settings;if(a&&!F.readonly){if(E._isHidden()){try{if(!F.content_editable){G.designMode="On"}}catch(D){}}try{G.execCommand("styleWithCSS",0,false)}catch(D){if(!E._isHidden()){try{G.execCommand("useCSS",0,true)}catch(D){}}}if(!F.table_inline_editing){try{G.execCommand("enableInlineTableEditing",false,false)}catch(D){}}if(!F.object_resizing){try{G.execCommand("enableObjectResizing",false,false)}catch(D){}}}}B.onBeforeExecCommand.add(u);B.onMouseDown.add(u)}if(m.isWebKit){B.onClick.add(function(s,t){t=t.target;if(t.nodeName=="IMG"||(t.nodeName=="A"&&q.hasClass(t,"mceItemAnchor"))){B.selection.getSel().setBaseAndExtent(t,0,t,1);B.nodeChanged()}})}B.onMouseUp.add(B.nodeChanged);B.onKeyUp.add(function(s,t){var D=t.keyCode;if((D>=33&&D<=36)||(D>=37&&D<=40)||D==13||D==45||D==46||D==8||(m.isMac&&(D==91||D==93))||t.ctrlKey){B.nodeChanged()}});B.onReset.add(function(){B.setContent(B.startContent,{format:"raw"})});if(C.custom_shortcuts){if(C.custom_undo_redo_keyboard_shortcuts){B.addShortcut("ctrl+z",B.getLang("undo_desc"),"Undo");B.addShortcut("ctrl+y",B.getLang("redo_desc"),"Redo")}B.addShortcut("ctrl+b",B.getLang("bold_desc"),"Bold");B.addShortcut("ctrl+i",B.getLang("italic_desc"),"Italic");B.addShortcut("ctrl+u",B.getLang("underline_desc"),"Underline");for(r=1;r<=6;r++){B.addShortcut("ctrl+"+r,"",["FormatBlock",false,"h"+r])}B.addShortcut("ctrl+7","",["FormatBlock",false,"<p>"]);B.addShortcut("ctrl+8","",["FormatBlock",false,"<div>"]);B.addShortcut("ctrl+9","",["FormatBlock",false,"<address>"]);function v(t){var s=null;if(!t.altKey&&!t.ctrlKey&&!t.metaKey){return s}i(B.shortcuts,function(D){if(m.isMac&&D.ctrl!=t.metaKey){return}else{if(!m.isMac&&D.ctrl!=t.ctrlKey){return}}if(D.alt!=t.altKey){return}if(D.shift!=t.shiftKey){return}if(t.keyCode==D.keyCode||(t.charCode&&t.charCode==D.charCode)){s=D;return false}});return s}B.onKeyUp.add(function(s,t){var D=v(t);if(D){return j.cancel(t)}});B.onKeyPress.add(function(s,t){var D=v(t);if(D){return j.cancel(t)}});B.onKeyDown.add(function(s,t){var D=v(t);if(D){D.func.call(D.scope);return j.cancel(t)}})}if(m.isIE){q.bind(B.getDoc(),"controlselect",function(D){var t=B.resizeInfo,s;D=D.target;if(D.nodeName!=="IMG"){return}if(t){q.unbind(t.node,t.ev,t.cb)}if(!q.hasClass(D,"mceItemNoResize")){ev="resizeend";s=q.bind(D,ev,function(F){var E;F=F.target;if(E=q.getStyle(F,"width")){q.setAttrib(F,"width",E.replace(/[^0-9%]+/g,""));q.setStyle(F,"width","")}if(E=q.getStyle(F,"height")){q.setAttrib(F,"height",E.replace(/[^0-9%]+/g,""));q.setStyle(F,"height","")}})}else{ev="resizestart";s=q.bind(D,"resizestart",j.cancel,j)}t=B.resizeInfo={node:D,ev:ev,cb:s}});B.onKeyDown.add(function(s,D){var t;switch(D.keyCode){case 8:t=B.getDoc().selection;if(t.createRange&&t.createRange().item){s.dom.remove(t.createRange().item(0));return j.cancel(D)}}})}if(m.isOpera){B.onClick.add(function(s,t){j.prevent(t)})}if(C.custom_undo_redo){function y(){B.undoManager.typing=false;B.undoManager.add()}q.bind(B.getDoc(),"focusout",function(s){if(!B.removed&&B.undoManager.typing){y()}});B.dom.bind(B.dom.getRoot(),"dragend",function(s){y()});B.onKeyUp.add(function(t,F){var s,E,D;if(b&&F.keyCode==8){s=B.selection.getRng();if(s.parentElement){E=s.parentElement();D=B.selection.getBookmark();E.innerHTML=E.innerHTML;B.selection.moveToBookmark(D)}}if((F.keyCode>=33&&F.keyCode<=36)||(F.keyCode>=37&&F.keyCode<=40)||F.keyCode==13||F.keyCode==45||F.ctrlKey){y()}});B.onKeyDown.add(function(t,H){var s,F,E,G=H.keyCode;if(b&&G==46){s=B.selection.getRng();if(s.parentElement){F=s.parentElement();if(!B.undoManager.typing){B.undoManager.beforeChange();B.undoManager.typing=true;B.undoManager.add()}if(H.ctrlKey){s.moveEnd("word",1);s.select()}B.selection.getSel().clear();if(s.parentElement()==F){E=B.selection.getBookmark();try{F.innerHTML=F.innerHTML}catch(D){}B.selection.moveToBookmark(E)}H.preventDefault();return}}if((G>=33&&G<=36)||(G>=37&&G<=40)||G==13||G==45){if(m.isIE&&G==13){B.undoManager.beforeChange()}if(B.undoManager.typing){y()}return}if((G<16||G>20)&&G!=224&&G!=91&&!B.undoManager.typing){B.undoManager.beforeChange();B.undoManager.add();B.undoManager.typing=true}});B.onMouseDown.add(function(){if(B.undoManager.typing){y()}})}if(m.isGecko){function A(){var s=B.dom.getAttribs(B.selection.getStart().cloneNode(false));return function(){var t=B.selection.getStart();B.dom.removeAllAttribs(t);i(s,function(D){t.setAttributeNode(D.cloneNode(true))})}}function z(){var t=B.selection;return !t.isCollapsed()&&t.getStart()!=t.getEnd()}B.onKeyPress.add(function(s,D){var t;if((D.keyCode==8||D.keyCode==46)&&z()){t=A();B.getDoc().execCommand("delete",false,null);t();return j.cancel(D)}});B.dom.bind(B.getDoc(),"cut",function(t){var s;if(z()){s=A();B.onKeyUp.addToTop(j.cancel,j);setTimeout(function(){s();B.onKeyUp.remove(j.cancel,j)},0)}})}},_isHidden:function(){var p;if(!a){return 0}p=this.selection.getSel();return(!p||!p.rangeCount||p.rangeCount==0)}})})(tinymce);(function(c){var d=c.each,e,a=true,b=false;c.EditorCommands=function(n){var l=n.dom,p=n.selection,j={state:{},exec:{},value:{}},k=n.settings,o;function q(y,x,v){var u;y=y.toLowerCase();if(u=j.exec[y]){u(y,x,v);return a}return b}function m(v){var u;v=v.toLowerCase();if(u=j.state[v]){return u(v)}return -1}function h(v){var u;v=v.toLowerCase();if(u=j.value[v]){return u(v)}return b}function t(u,v){v=v||"exec";d(u,function(y,x){d(x.toLowerCase().split(","),function(z){j[v][z]=y})})}c.extend(this,{execCommand:q,queryCommandState:m,queryCommandValue:h,addCommands:t});function f(x,v,u){if(v===e){v=b}if(u===e){u=null}return n.getDoc().execCommand(x,v,u)}function s(u){return n.formatter.match(u)}function r(u,v){n.formatter.toggle(u,v?{value:v}:e)}function i(u){o=p.getBookmark(u)}function g(){p.moveToBookmark(o)}t({"mceResetDesignMode,mceBeginUndoLevel":function(){},"mceEndUndoLevel,mceAddUndoLevel":function(){n.undoManager.add()},"Cut,Copy,Paste":function(y){var x=n.getDoc(),u;try{f(y)}catch(v){u=a}if(u||!x.queryCommandSupported(y)){if(c.isGecko){n.windowManager.confirm(n.getLang("clipboard_msg"),function(z){if(z){open("http://www.mozilla.org/editor/midasdemo/securityprefs.html","_blank")}})}else{n.windowManager.alert(n.getLang("clipboard_no_support"))}}},unlink:function(u){if(p.isCollapsed()){p.select(p.getNode())}f(u);p.collapse(b)},"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){var v=u.substring(7);d("left,center,right,full".split(","),function(x){if(v!=x){n.formatter.remove("align"+x)}});r("align"+v);q("mceRepaint")},"InsertUnorderedList,InsertOrderedList":function(x){var u,v;f(x);u=l.getParent(p.getNode(),"ol,ul");if(u){v=u.parentNode;if(/^(H[1-6]|P|ADDRESS|PRE)$/.test(v.nodeName)){i();l.split(v,u);g()}}},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(u){r(u)},"ForeColor,HiliteColor,FontName":function(x,v,u){r(x,u)},FontSize:function(y,x,v){var u,z;if(v>=1&&v<=7){z=c.explode(k.font_size_style_values);u=c.explode(k.font_size_classes);if(u){v=u[v-1]||v}else{v=z[v-1]||v}}r(y,v)},RemoveFormat:function(u){n.formatter.remove(u)},mceBlockQuote:function(u){r("blockquote")},FormatBlock:function(x,v,u){return r(u||"p")},mceCleanup:function(){var u=p.getBookmark();n.setContent(n.getContent({cleanup:a}),{cleanup:a});p.moveToBookmark(u)},mceRemoveNode:function(y,x,v){var u=v||p.getNode();if(u!=n.getBody()){i();n.dom.remove(u,a);g()}},mceSelectNodeDepth:function(y,x,v){var u=0;l.getParent(p.getNode(),function(z){if(z.nodeType==1&&u++==v){p.select(z);return b}},n.getBody())},mceSelectNode:function(x,v,u){p.select(u)},mceInsertContent:function(z,D,E){var C,u,x,F,y,u,A,G,B;function v(I,J,H){var K=new c.dom.TreeWalker(H?I.nextSibling:I.previousSibling,J);while((I=K.current())){if((I.nodeType==3&&c.trim(I.nodeValue).length)||I.nodeName=="BR"||I.nodeName=="IMG"){return I}if(H){K.next()}else{K.prev()}}}B={content:E,format:"html"};p.onBeforeSetContent.dispatch(p,B);E=B.content;if(E.indexOf("{$caret}")==-1){E+="{$caret}"}p.setContent('<span id="__mce">\uFEFF</span>',{no_events:false});l.setOuterHTML("__mce",E.replace(/\{\$caret\}/,'<span data-mce-type="bookmark" id="__mce">\uFEFF</span>'));C=l.select("#__mce")[0];x=l.getRoot();if(C.previousSibling&&l.isBlock(C.previousSibling)||C.parentNode==x){y=v(C,x);if(y){if(y.nodeName=="BR"){y.parentNode.insertBefore(C,y)}else{l.insertAfter(C,y)}}}while(C){if(C===x){l.setOuterHTML(F,new c.html.Serializer({},n.schema).serialize(n.parser.parse(l.getOuterHTML(F))));break}F=C;C=C.parentNode}C=l.select("#__mce")[0];if(C){y=v(C,x)||v(C,x,true);l.remove(C);if(y){u=l.createRng();if(y.nodeType==3){u.setStart(y,y.length);u.setEnd(y,y.length)}else{if(y.nodeName=="BR"){u.setStartBefore(y);u.setEndBefore(y)}else{u.setStartAfter(y);u.setEndAfter(y)}}p.setRng(u);if(!c.isIE){y=l.create("span",null,"\u00a0");u.insertNode(y);A=l.getRect(y);G=l.getViewPort(n.getWin());if((A.y>G.y+G.h||A.y<G.y)||(A.x>G.x+G.w||A.x<G.x)){n.getBody().scrollLeft=A.x;n.getBody().scrollTop=A.y}l.remove(y)}p.collapse(true)}}p.onSetContent.dispatch(p,B);n.addVisual()},mceInsertRawHTML:function(x,v,u){p.setContent("tiny_mce_marker");n.setContent(n.getContent().replace(/tiny_mce_marker/g,function(){return u}))},mceSetContent:function(x,v,u){n.setContent(u)},"Indent,Outdent":function(y){var v,u,x;v=k.indentation;u=/[a-z%]+$/i.exec(v);v=parseInt(v);if(!m("InsertUnorderedList")&&!m("InsertOrderedList")){d(p.getSelectedBlocks(),function(z){if(y=="outdent"){x=Math.max(0,parseInt(z.style.paddingLeft||0)-v);l.setStyle(z,"paddingLeft",x?x+u:"")}else{l.setStyle(z,"paddingLeft",(parseInt(z.style.paddingLeft||0)+v)+u)}})}else{f(y)}},mceRepaint:function(){var v;if(c.isGecko){try{i(a);if(p.getSel()){p.getSel().selectAllChildren(n.getBody())}p.collapse(a);g()}catch(u){}}},mceToggleFormat:function(x,v,u){n.formatter.toggle(u)},InsertHorizontalRule:function(){n.execCommand("mceInsertContent",false,"<hr />")},mceToggleVisualAid:function(){n.hasVisual=!n.hasVisual;n.addVisual()},mceReplaceContent:function(x,v,u){n.execCommand("mceInsertContent",false,u.replace(/\{\$selection\}/g,p.getContent({format:"text"})))},mceInsertLink:function(A,z,y){var x=l.getParent(p.getNode(),"a"),v,u;if(c.is(y,"string")){y={href:y}}y.href=y.href.replace(" ","%20");if(!x){if(c.isWebKit){v=l.getParent(p.getNode(),"img");if(v){u=v.style.cssFloat;v.style.cssFloat=null}}f("CreateLink",b,"javascript:mctmp(0);");if(u){v.style.cssFloat=u}d(l.select("a[href='javascript:mctmp(0);']"),function(B){l.setAttribs(B,y)})}else{if(y.href){l.setAttribs(x,y)}else{n.dom.remove(x,a)}}},selectAll:function(){var v=l.getRoot(),u=l.createRng();u.setStart(v,0);u.setEnd(v,v.childNodes.length);n.selection.setRng(u)}});t({"JustifyLeft,JustifyCenter,JustifyRight,JustifyFull":function(u){return s("align"+u.substring(7))},"Bold,Italic,Underline,Strikethrough,Superscript,Subscript":function(u){return s(u)},mceBlockQuote:function(){return s("blockquote")},Outdent:function(){var u;if(k.inline_styles){if((u=l.getParent(p.getStart(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}if((u=l.getParent(p.getEnd(),l.isBlock))&&parseInt(u.style.paddingLeft)>0){return a}}return m("InsertUnorderedList")||m("InsertOrderedList")||(!k.inline_styles&&!!l.getParent(p.getNode(),"BLOCKQUOTE"))},"InsertUnorderedList,InsertOrderedList":function(u){return l.getParent(p.getNode(),u=="insertunorderedlist"?"UL":"OL")}},"state");t({"FontSize,FontName":function(x){var v=0,u;if(u=l.getParent(p.getNode(),"span")){if(x=="fontsize"){v=u.style.fontSize}else{v=u.style.fontFamily.replace(/, /g,",").replace(/[\'\"]/g,"").toLowerCase()}}return v}},"value");if(k.custom_undo_redo){t({Undo:function(){n.undoManager.undo()},Redo:function(){n.undoManager.redo()}})}}})(tinymce);(function(b){var a=b.util.Dispatcher;b.UndoManager=function(e){var c,d=0,g=[];function f(){return b.trim(e.getContent({format:"raw",no_events:1}))}return c={typing:false,onAdd:new a(c),onUndo:new a(c),onRedo:new a(c),beforeChange:function(){if(g[d]){g[d].beforeBookmark=e.selection.getBookmark(2,true)}},add:function(l){var h,j=e.settings,k;l=l||{};l.content=f();k=g[d];if(k&&k.content==l.content){return null}if(j.custom_undo_redo_levels){if(g.length>j.custom_undo_redo_levels){for(h=0;h<g.length-1;h++){g[h]=g[h+1]}g.length--;d=g.length}}l.bookmark=e.selection.getBookmark(2,true);if(d<g.length-1){g.length=d+1}g.push(l);d=g.length-1;c.onAdd.dispatch(c,l);e.isNotDirty=0;return l},undo:function(){var j,h;if(c.typing){c.add();c.typing=false}if(d>0){j=g[--d];e.setContent(j.content,{format:"raw"});e.selection.moveToBookmark(j.beforeBookmark);c.onUndo.dispatch(c,j)}return j},redo:function(){var h;if(d<g.length-1){h=g[++d];e.setContent(h.content,{format:"raw"});e.selection.moveToBookmark(h.bookmark);c.onRedo.dispatch(c,h)}return h},clear:function(){g=[];d=0;c.typing=false},hasUndo:function(){return d>0||this.typing},hasRedo:function(){return d<g.length-1&&!this.typing}}}})(tinymce);(function(l){var j=l.dom.Event,c=l.isIE,a=l.isGecko,b=l.isOpera,i=l.each,h=l.extend,d=true,g=false;function k(o){var p,n,m;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(o.nodeName)){if(p){n=o.cloneNode(false);n.appendChild(p);p=n}else{p=m=o.cloneNode(false)}p.removeAttribute("id")}}while(o=o.parentNode);if(p){return{wrapper:p,inner:m}}}function f(n,o){var m=o.ownerDocument.createRange();m.setStart(n.endContainer,n.endOffset);m.setEndAfter(o);return m.cloneContents().textContent.length==0}function e(o,q,m){var n,p;if(q.isEmpty(m)){n=q.getParent(m,"ul,ol");if(!q.getParent(n.parentNode,"ul,ol")){q.split(n,m);p=q.create("p",0,'<br data-mce-bogus="1" />');q.replace(p,m);o.select(p,1)}return g}return d}l.create("tinymce.ForceBlocks",{ForceBlocks:function(m){var n=this,o=m.settings,p;n.editor=m;n.dom=m.dom;p=(o.forced_root_block||"p").toLowerCase();o.element=p.toUpperCase();m.onPreInit.add(n.setup,n);if(o.forced_root_block){m.onInit.add(n.forceRoots,n);m.onSetContent.add(n.forceRoots,n);m.onBeforeGetContent.add(n.forceRoots,n);m.onExecCommand.add(function(q,r){if(r=="mceInsertContent"){n.forceRoots();q.nodeChanged()}})}},setup:function(){var n=this,m=n.editor,p=m.settings,r=m.dom,o=m.selection;if(p.forced_root_block){m.onBeforeExecCommand.add(n.forceRoots,n);m.onKeyUp.add(n.forceRoots,n);m.onPreProcess.add(n.forceRoots,n)}if(p.force_br_newlines){if(c){m.onKeyPress.add(function(s,t){var u;if(t.keyCode==13&&o.getNode().nodeName!="LI"){o.setContent('<br id="__" /> ',{format:"raw"});u=r.get("__");u.removeAttribute("id");o.select(u);o.collapse();return j.cancel(t)}})}}if(p.force_p_newlines){if(!c){m.onKeyPress.add(function(s,t){if(t.keyCode==13&&!t.shiftKey&&!n.insertPara(t)){j.cancel(t)}})}else{l.addUnload(function(){n._previousFormats=0});m.onKeyPress.add(function(s,t){n._previousFormats=0;if(t.keyCode==13&&!t.shiftKey&&s.selection.isCollapsed()&&p.keep_styles){n._previousFormats=k(s.selection.getStart())}});m.onKeyUp.add(function(t,v){if(v.keyCode==13&&!v.shiftKey){var u=t.selection.getStart(),s=n._previousFormats;if(!u.hasChildNodes()&&s){u=r.getParent(u,r.isBlock);if(u&&u.nodeName!="LI"){u.innerHTML="";if(n._previousFormats){u.appendChild(s.wrapper);s.inner.innerHTML="\uFEFF"}else{u.innerHTML="\uFEFF"}o.select(u,1);o.collapse(true);t.getDoc().execCommand("Delete",false,null);n._previousFormats=0}}}})}if(a){m.onKeyDown.add(function(s,t){if((t.keyCode==8||t.keyCode==46)&&!t.shiftKey){n.backspaceDelete(t,t.keyCode==8)}})}}if(l.isWebKit){function q(t){var s=o.getRng(),u,y=r.create("div",null," "),x,v=r.getViewPort(t.getWin()).h;s.insertNode(u=r.create("br"));s.setStartAfter(u);s.setEndAfter(u);o.setRng(s);if(o.getSel().focusNode==u.previousSibling){o.select(r.insertAfter(r.doc.createTextNode("\u00a0"),u));o.collapse(d)}r.insertAfter(y,u);x=r.getPos(y).y;r.remove(y);if(x>v){t.getWin().scrollTo(0,x)}}m.onKeyPress.add(function(s,t){if(t.keyCode==13&&(t.shiftKey||(p.force_br_newlines&&!r.getParent(o.getNode(),"h1,h2,h3,h4,h5,h6,ol,ul")))){q(s);j.cancel(t)}})}if(c){if(p.element!="P"){m.onKeyPress.add(function(s,t){n.lastElm=o.getNode().nodeName});m.onKeyUp.add(function(t,u){var x,v=o.getNode(),s=t.getBody();if(s.childNodes.length===1&&v.nodeName=="P"){v=r.rename(v,p.element);o.select(v);o.collapse();t.nodeChanged()}else{if(u.keyCode==13&&!u.shiftKey&&n.lastElm!="P"){x=r.getParent(v,"p");if(x){r.rename(x,p.element);t.nodeChanged()}}}})}}},find:function(u,p,q){var o=this.editor,m=o.getDoc().createTreeWalker(u,4,null,g),r=-1;while(u=m.nextNode()){r++;if(p==0&&u==q){return r}if(p==1&&r==q){return u}}return -1},forceRoots:function(v,H){var y=this,v=y.editor,L=v.getBody(),I=v.getDoc(),O=v.selection,z=O.getSel(),A=O.getRng(),M=-2,u,F,m,o,J=-16777215;var K,p,N,E,B,q=L.childNodes,D,C,x;for(D=q.length-1;D>=0;D--){K=q[D];if(K.nodeType===1&&K.getAttribute("data-mce-type")){p=null;continue}if(K.nodeType===3||(!y.dom.isBlock(K)&&K.nodeType!==8&&!/^(script|mce:script|style|mce:style)$/i.test(K.nodeName))){if(!p){if(K.nodeType!=3||/[^\s]/g.test(K.nodeValue)){if(M==-2&&A){if(!c||A.setStart){if(A.startContainer.nodeType==1&&(C=A.startContainer.childNodes[A.startOffset])&&C.nodeType==1){x=C.getAttribute("id");C.setAttribute("id","__mce")}else{if(v.dom.getParent(A.startContainer,function(n){return n===L})){F=A.startOffset;m=A.endOffset;M=y.find(L,0,A.startContainer);u=y.find(L,0,A.endContainer)}}}else{if(A.item){o=I.body.createTextRange();o.moveToElementText(A.item(0));A=o}o=I.body.createTextRange();o.moveToElementText(L);o.collapse(1);N=o.move("character",J)*-1;o=A.duplicate();o.collapse(1);E=o.move("character",J)*-1;o=A.duplicate();o.collapse(0);B=(o.move("character",J)*-1)-E;M=E-N;u=B}}p=v.dom.create(v.settings.forced_root_block);K.parentNode.replaceChild(p,K);p.appendChild(K)}}else{if(p.hasChildNodes()){p.insertBefore(K,p.firstChild)}else{p.appendChild(K)}}}else{p=null}}if(M!=-2){if(!c||A.setStart){p=L.getElementsByTagName(v.settings.element)[0];A=I.createRange();if(M!=-1){A.setStart(y.find(L,1,M),F)}else{A.setStart(p,0)}if(u!=-1){A.setEnd(y.find(L,1,u),m)}else{A.setEnd(p,0)}if(z){z.removeAllRanges();z.addRange(A)}}else{try{A=z.createRange();A.moveToElementText(L);A.collapse(1);A.moveStart("character",M);A.moveEnd("character",u);A.select()}catch(G){}}}else{if((!c||A.setStart)&&(C=v.dom.get("__mce"))){if(x){C.setAttribute("id",x)}else{C.removeAttribute("id")}A=I.createRange();A.setStartBefore(C);A.setEndBefore(C);O.setRng(A)}}},getParentBlock:function(o){var m=this.dom;return m.getParent(o,m.isBlock)},insertPara:function(R){var F=this,v=F.editor,N=v.dom,S=v.getDoc(),W=v.settings,G=v.selection.getSel(),H=G.getRangeAt(0),V=S.body;var K,L,I,P,O,q,o,u,z,m,D,U,p,x,J,M=N.getViewPort(v.getWin()),C,E,B;v.undoManager.beforeChange();K=S.createRange();K.setStart(G.anchorNode,G.anchorOffset);K.collapse(d);L=S.createRange();L.setStart(G.focusNode,G.focusOffset);L.collapse(d);I=K.compareBoundaryPoints(K.START_TO_END,L)<0;P=I?G.anchorNode:G.focusNode;O=I?G.anchorOffset:G.focusOffset;q=I?G.focusNode:G.anchorNode;o=I?G.focusOffset:G.anchorOffset;if(P===q&&/^(TD|TH)$/.test(P.nodeName)){if(P.firstChild.nodeName=="BR"){N.remove(P.firstChild)}if(P.childNodes.length==0){v.dom.add(P,W.element,null,"<br />");U=v.dom.add(P,W.element,null,"<br />")}else{J=P.innerHTML;P.innerHTML="";v.dom.add(P,W.element,null,J);U=v.dom.add(P,W.element,null,"<br />")}H=S.createRange();H.selectNodeContents(U);H.collapse(1);v.selection.setRng(H);return g}if(P==V&&q==V&&V.firstChild&&v.dom.isBlock(V.firstChild)){P=q=P.firstChild;O=o=0;K=S.createRange();K.setStart(P,0);L=S.createRange();L.setStart(q,0)}P=P.nodeName=="HTML"?S.body:P;P=P.nodeName=="BODY"?P.firstChild:P;q=q.nodeName=="HTML"?S.body:q;q=q.nodeName=="BODY"?q.firstChild:q;u=F.getParentBlock(P);z=F.getParentBlock(q);m=u?u.nodeName:W.element;if(J=F.dom.getParent(u,"li,pre")){if(J.nodeName=="LI"){return e(v.selection,F.dom,J)}return d}if(u&&(u.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(N.getStyle(u,"position",1)))){m=W.element;u=null}if(z&&(z.nodeName=="CAPTION"||/absolute|relative|fixed/gi.test(N.getStyle(u,"position",1)))){m=W.element;z=null}if(/(TD|TABLE|TH|CAPTION)/.test(m)||(u&&m=="DIV"&&/left|right/gi.test(N.getStyle(u,"float",1)))){m=W.element;u=z=null}D=(u&&u.nodeName==m)?u.cloneNode(0):v.dom.create(m);U=(z&&z.nodeName==m)?z.cloneNode(0):v.dom.create(m);U.removeAttribute("id");if(/^(H[1-6])$/.test(m)&&f(H,u)){U=v.dom.create(W.element)}J=p=P;do{if(J==V||J.nodeType==9||F.dom.isBlock(J)||/(TD|TABLE|TH|CAPTION)/.test(J.nodeName)){break}p=J}while((J=J.previousSibling?J.previousSibling:J.parentNode));J=x=q;do{if(J==V||J.nodeType==9||F.dom.isBlock(J)||/(TD|TABLE|TH|CAPTION)/.test(J.nodeName)){break}x=J}while((J=J.nextSibling?J.nextSibling:J.parentNode));if(p.nodeName==m){K.setStart(p,0)}else{K.setStartBefore(p)}K.setEnd(P,O);D.appendChild(K.cloneContents()||S.createTextNode(""));try{L.setEndAfter(x)}catch(Q){}L.setStart(q,o);U.appendChild(L.cloneContents()||S.createTextNode(""));H=S.createRange();if(!p.previousSibling&&p.parentNode.nodeName==m){H.setStartBefore(p.parentNode)}else{if(K.startContainer.nodeName==m&&K.startOffset==0){H.setStartBefore(K.startContainer)}else{H.setStart(K.startContainer,K.startOffset)}}if(!x.nextSibling&&x.parentNode.nodeName==m){H.setEndAfter(x.parentNode)}else{H.setEnd(L.endContainer,L.endOffset)}H.deleteContents();if(b){v.getWin().scrollTo(0,M.y)}if(D.firstChild&&D.firstChild.nodeName==m){D.innerHTML=D.firstChild.innerHTML}if(U.firstChild&&U.firstChild.nodeName==m){U.innerHTML=U.firstChild.innerHTML}if(N.isEmpty(D)){D.innerHTML="<br />"}function T(y,s){var r=[],Y,X,t;y.innerHTML="";if(W.keep_styles){X=s;do{if(/^(SPAN|STRONG|B|EM|I|FONT|STRIKE|U)$/.test(X.nodeName)){Y=X.cloneNode(g);N.setAttrib(Y,"id","");r.push(Y)}}while(X=X.parentNode)}if(r.length>0){for(t=r.length-1,Y=y;t>=0;t--){Y=Y.appendChild(r[t])}r[0].innerHTML=b?"\u00a0":"<br />";return r[0]}else{y.innerHTML=b?"\u00a0":"<br />"}}if(N.isEmpty(U)){B=T(U,q)}if(b&&parseFloat(opera.version())<9.5){H.insertNode(D);H.insertNode(U)}else{H.insertNode(U);H.insertNode(D)}U.normalize();D.normalize();function A(r){return S.createTreeWalker(r,NodeFilter.SHOW_TEXT,null,g).nextNode()||r}H=S.createRange();H.selectNodeContents(a?A(B||U):B||U);H.collapse(1);G.removeAllRanges();G.addRange(H);C=v.dom.getPos(U).y;if(C<M.y||C+25>M.y+M.h){v.getWin().scrollTo(0,C<M.y?C:C-M.h+25)}v.undoManager.add();return g},backspaceDelete:function(u,B){var C=this,s=C.editor,y=s.getBody(),q=s.dom,p,v=s.selection,o=v.getRng(),x=o.startContainer,p,z,A,m;if(!B&&o.collapsed&&x.nodeType==1&&o.startOffset==x.childNodes.length){m=new l.dom.TreeWalker(x.lastChild,x);for(p=x.lastChild;p;p=m.prev()){if(p.nodeType==3){o.setStart(p,p.nodeValue.length);o.collapse(true);v.setRng(o);return}}}if(x&&s.dom.isBlock(x)&&!/^(TD|TH)$/.test(x.nodeName)&&B){if(x.childNodes.length==0||(x.childNodes.length==1&&x.firstChild.nodeName=="BR")){p=x;while((p=p.previousSibling)&&!s.dom.isBlock(p)){}if(p){if(x!=y.firstChild){z=s.dom.doc.createTreeWalker(p,NodeFilter.SHOW_TEXT,null,g);while(A=z.nextNode()){p=A}o=s.getDoc().createRange();o.setStart(p,p.nodeValue?p.nodeValue.length:0);o.setEnd(p,p.nodeValue?p.nodeValue.length:0);v.setRng(o);s.dom.remove(x)}return j.cancel(u)}}}}})})(tinymce);(function(c){var b=c.DOM,a=c.dom.Event,d=c.each,e=c.extend;c.create("tinymce.ControlManager",{ControlManager:function(f,j){var h=this,g;j=j||{};h.editor=f;h.controls={};h.onAdd=new c.util.Dispatcher(h);h.onPostRender=new c.util.Dispatcher(h);h.prefix=j.prefix||f.id+"_";h._cls={};h.onPostRender.add(function(){d(h.controls,function(i){i.postRender()})})},get:function(f){return this.controls[this.prefix+f]||this.controls[f]},setActive:function(h,f){var g=null;if(g=this.get(h)){g.setActive(f)}return g},setDisabled:function(h,f){var g=null;if(g=this.get(h)){g.setDisabled(f)}return g},add:function(g){var f=this;if(g){f.controls[g.id]=g;f.onAdd.dispatch(g,f)}return g},createControl:function(i){var h,g=this,f=g.editor;d(f.plugins,function(j){if(j.createControl){h=j.createControl(i,g);if(h){return false}}});switch(i){case"|":case"separator":return g.createSeparator()}if(!h&&f.buttons&&(h=f.buttons[i])){return g.createButton(i,h)}return g.add(h)},createDropMenu:function(f,n,h){var m=this,i=m.editor,j,g,k,l;n=e({"class":"mceDropDown",constrain:i.settings.constrain_menus},n);n["class"]=n["class"]+" "+i.getParam("skin")+"Skin";if(k=i.getParam("skin_variant")){n["class"]+=" "+i.getParam("skin")+"Skin"+k.substring(0,1).toUpperCase()+k.substring(1)}f=m.prefix+f;l=h||m._cls.dropmenu||c.ui.DropMenu;j=m.controls[f]=new l(f,n);j.onAddItem.add(function(r,q){var p=q.settings;p.title=i.getLang(p.title,p.title);if(!p.onclick){p.onclick=function(o){if(p.cmd){i.execCommand(p.cmd,p.ui||false,p.value)}}}});i.onRemove.add(function(){j.destroy()});if(c.isIE){j.onShowMenu.add(function(){i.focus();g=i.selection.getBookmark(1)});j.onHideMenu.add(function(){if(g){i.selection.moveToBookmark(g);g=0}})}return m.add(j)},createListBox:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;if(g.settings.use_native_selects){k=new c.ui.NativeListBox(m,i)}else{f=l||h._cls.listbox||c.ui.ListBox;k=new f(m,i,g)}h.controls[m]=k;if(c.isWebKit){k.onPostRender.add(function(p,o){a.add(o,"mousedown",function(){g.bookmark=g.selection.getBookmark(1)});a.add(o,"focus",function(){g.selection.moveToBookmark(g.bookmark);g.bookmark=null})})}if(k.hideMenu){g.onMouseDown.add(k.hideMenu,k)}return h.add(k)},createButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.label=g.translate(i.label);i.scope=i.scope||g;if(!i.onclick&&!i.menu_button){i.onclick=function(){g.execCommand(i.cmd,i.ui||false,i.value)}}i=e({title:i.title,"class":"mce_"+m,unavailable_prefix:g.getLang("unavailable",""),scope:i.scope,control_manager:h},i);m=h.prefix+m;if(i.menu_button){f=l||h._cls.menubutton||c.ui.MenuButton;k=new f(m,i,g);g.onMouseDown.add(k.hideMenu,k)}else{f=h._cls.button||c.ui.Button;k=new f(m,i)}return h.add(k)},createMenuButton:function(h,f,g){f=f||{};f.menu_button=1;return this.createButton(h,f,g)},createSplitButton:function(m,i,l){var h=this,g=h.editor,j,k,f;if(h.get(m)){return null}i.title=g.translate(i.title);i.scope=i.scope||g;if(!i.onclick){i.onclick=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}if(!i.onselect){i.onselect=function(n){g.execCommand(i.cmd,i.ui||false,n||i.value)}}i=e({title:i.title,"class":"mce_"+m,scope:i.scope,control_manager:h},i);m=h.prefix+m;f=l||h._cls.splitbutton||c.ui.SplitButton;k=h.add(new f(m,i,g));g.onMouseDown.add(k.hideMenu,k);return k},createColorSplitButton:function(f,n,h){var l=this,j=l.editor,i,k,m,g;if(l.get(f)){return null}n.title=j.translate(n.title);n.scope=n.scope||j;if(!n.onclick){n.onclick=function(o){if(c.isIE){g=j.selection.getBookmark(1)}j.execCommand(n.cmd,n.ui||false,o||n.value)}}if(!n.onselect){n.onselect=function(o){j.execCommand(n.cmd,n.ui||false,o||n.value)}}n=e({title:n.title,"class":"mce_"+f,menu_class:j.getParam("skin")+"Skin",scope:n.scope,more_colors_title:j.getLang("more_colors")},n);f=l.prefix+f;m=h||l._cls.colorsplitbutton||c.ui.ColorSplitButton;k=new m(f,n,j);j.onMouseDown.add(k.hideMenu,k);j.onRemove.add(function(){k.destroy()});if(c.isIE){k.onShowMenu.add(function(){j.focus();g=j.selection.getBookmark(1)});k.onHideMenu.add(function(){if(g){j.selection.moveToBookmark(g);g=0}})}return l.add(k)},createToolbar:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||g._cls.toolbar||c.ui.Toolbar;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createToolbarGroup:function(k,h,j){var i,g=this,f;k=g.prefix+k;f=j||this._cls.toolbarGroup||c.ui.ToolbarGroup;i=new f(k,h,g.editor);if(g.get(k)){return null}return g.add(i)},createSeparator:function(g){var f=g||this._cls.separator||c.ui.Separator;return new f()},setControlType:function(g,f){return this._cls[g.toLowerCase()]=f},destroy:function(){d(this.controls,function(f){f.destroy()});this.controls=null}})})(tinymce);(function(d){var a=d.util.Dispatcher,e=d.each,c=d.isIE,b=d.isOpera;d.create("tinymce.WindowManager",{WindowManager:function(f){var g=this;g.editor=f;g.onOpen=new a(g);g.onClose=new a(g);g.params={};g.features={}},open:function(z,h){var v=this,k="",n,m,i=v.editor.settings.dialog_type=="modal",q,o,j,g=d.DOM.getViewPort(),r;z=z||{};h=h||{};o=b?g.w:screen.width;j=b?g.h:screen.height;z.name=z.name||"mc_"+new Date().getTime();z.width=parseInt(z.width||320);z.height=parseInt(z.height||240);z.resizable=true;z.left=z.left||parseInt(o/2)-(z.width/2);z.top=z.top||parseInt(j/2)-(z.height/2);h.inline=false;h.mce_width=z.width;h.mce_height=z.height;h.mce_auto_focus=z.auto_focus;if(i){if(c){z.center=true;z.help=false;z.dialogWidth=z.width+"px";z.dialogHeight=z.height+"px";z.scroll=z.scrollbars||false}}e(z,function(p,f){if(d.is(p,"boolean")){p=p?"yes":"no"}if(!/^(name|url)$/.test(f)){if(c&&i){k+=(k?";":"")+f+":"+p}else{k+=(k?",":"")+f+"="+p}}});v.features=z;v.params=h;v.onOpen.dispatch(v,z,h);r=z.url||z.file;r=d._addVer(r);try{if(c&&i){q=1;window.showModalDialog(r,window,k)}else{q=window.open(r,z.name,k)}}catch(l){}if(!q){alert(v.editor.getLang("popup_blocked"))}},close:function(f){f.close();this.onClose.dispatch(this)},createInstance:function(i,h,g,m,l,k){var j=d.resolve(i);return new j(h,g,m,l,k)},confirm:function(h,f,i,g){g=g||window;f.call(i||this,g.confirm(this._decode(this.editor.getLang(h,h))))},alert:function(h,f,j,g){var i=this;g=g||window;g.alert(i._decode(i.editor.getLang(h,h)));if(f){f.call(j||i)}},resizeBy:function(f,g,h){h.resizeBy(f,g)},_decode:function(f){return d.DOM.decode(f).replace(/\\n/g,"\n")}})}(tinymce));(function(a){a.Formatter=function(V){var M={},O=a.each,c=V.dom,q=V.selection,t=a.dom.TreeWalker,K=new a.dom.RangeUtils(c),d=V.schema.isValidChild,F=c.isBlock,l=V.settings.forced_root_block,s=c.nodeIndex,E="\uFEFF",e=/^(src|href|style)$/,S=false,B=true,p,P={apply:[],remove:[]};function z(W){return W instanceof Array}function m(X,W){return c.getParents(X,W,c.getRoot())}function b(W){return W.nodeType===1&&(W.face==="mceinline"||W.style.fontFamily==="mceinline")}function R(W){return W?M[W]:M}function k(W,X){if(W){if(typeof(W)!=="string"){O(W,function(Z,Y){k(Y,Z)})}else{X=X.length?X:[X];O(X,function(Y){if(Y.deep===p){Y.deep=!Y.selector}if(Y.split===p){Y.split=!Y.selector||Y.inline}if(Y.remove===p&&Y.selector&&!Y.inline){Y.remove="none"}if(Y.selector&&Y.inline){Y.mixed=true;Y.block_expand=true}if(typeof(Y.classes)==="string"){Y.classes=Y.classes.split(/\s+/)}});M[W]=X}}}var i=function(X){var W;V.dom.getParent(X,function(Y){W=V.dom.getStyle(Y,"text-decoration");return W&&W!=="none"});return W};var I=function(W){var X;if(W.nodeType===1&&W.parentNode&&W.parentNode.nodeType===1){X=i(W.parentNode);if(V.dom.getStyle(W,"color")&&X){V.dom.setStyle(W,"text-decoration",X)}else{if(V.dom.getStyle(W,"textdecoration")===X){V.dom.setStyle(W,"text-decoration",null)}}}};function T(Y,af,aa){var ab=R(Y),ag=ab[0],ae,X,ad,ac=q.isCollapsed();function Z(ak){var aj=ak.startContainer,an=ak.startOffset,am,al;if(aj.nodeType==1||aj.nodeValue===""){aj=aj.nodeType==1?aj.childNodes[an]:aj;if(aj){am=new t(aj,aj.parentNode);for(al=am.current();al;al=am.next()){if(al.nodeType==3&&!f(al)){ak.setStart(al,0);break}}}}return ak}function W(ak,aj){aj=aj||ag;if(ak){O(aj.styles,function(am,al){c.setStyle(ak,al,r(am,af))});O(aj.attributes,function(am,al){c.setAttrib(ak,al,r(am,af))});O(aj.classes,function(al){al=r(al,af);if(!c.hasClass(ak,al)){c.addClass(ak,al)}})}}function ah(ak){var aj=[],am,al;am=ag.inline||ag.block;al=c.create(am);W(al);K.walk(ak,function(an){var ao;function ap(aq){var au=aq.nodeName.toLowerCase(),at=aq.parentNode.nodeName.toLowerCase(),ar;if(g(au,"br")){ao=0;if(ag.block){c.remove(aq)}return}if(ag.wrapper&&x(aq,Y,af)){ao=0;return}if(ag.block&&!ag.wrapper&&G(au)){aq=c.rename(aq,am);W(aq);aj.push(aq);ao=0;return}if(ag.selector){O(ab,function(av){if("collapsed" in av&&av.collapsed!==ac){return}if(c.is(aq,av.selector)&&!b(aq)){W(aq,av);ar=true}});if(!ag.inline||ar){ao=0;return}}if(d(am,au)&&d(at,am)&&!(aq.nodeType===3&&aq.nodeValue.length===1&&aq.nodeValue.charCodeAt(0)===65279)){if(!ao){ao=al.cloneNode(S);aq.parentNode.insertBefore(ao,aq);aj.push(ao)}ao.appendChild(aq)}else{ao=0;O(a.grep(aq.childNodes),ap);ao=0}}O(an,ap)});if(ag.wrap_links===false){O(aj,function(an){function ao(at){var ar,aq,ap;if(at.nodeName==="A"){aq=al.cloneNode(S);aj.push(aq);ap=a.grep(at.childNodes);for(ar=0;ar<ap.length;ar++){aq.appendChild(ap[ar])}at.appendChild(aq)}O(a.grep(at.childNodes),ao)}ao(an)})}O(aj,function(ap){var an;function aq(at){var ar=0;O(at.childNodes,function(au){if(!f(au)&&!H(au)){ar++}});return ar}function ao(ar){var au,at;O(ar.childNodes,function(av){if(av.nodeType==1&&!H(av)&&!b(av)){au=av;return S}});if(au&&h(au,ag)){at=au.cloneNode(S);W(at);c.replace(at,ar,B);c.remove(au,1)}return at||ar}an=aq(ap);if((aj.length>1||!F(ap))&&an===0){c.remove(ap,1);return}if(ag.inline||ag.wrapper){if(!ag.exact&&an===1){ap=ao(ap)}O(ab,function(ar){O(c.select(ar.inline,ap),function(au){var at;if(ar.wrap_links===false){at=au.parentNode;do{if(at.nodeName==="A"){return}}while(at=at.parentNode)}U(ar,af,au,ar.exact?au:null)})});if(x(ap.parentNode,Y,af)){c.remove(ap,1);ap=0;return B}if(ag.merge_with_parents){c.getParent(ap.parentNode,function(ar){if(x(ar,Y,af)){c.remove(ap,1);ap=0;return B}})}if(ap){ap=u(C(ap),ap);ap=u(ap,C(ap,B))}}})}if(ag){if(aa){X=c.createRng();X.setStartBefore(aa);X.setEndAfter(aa);ah(o(X,ab))}else{if(!ac||!ag.inline||c.select("td.mceSelected,th.mceSelected").length){var ai=V.selection.getNode();ae=q.getBookmark();ah(o(q.getRng(B),ab));if(ag.styles&&(ag.styles.color||ag.styles.textDecoration)){a.walk(ai,I,"childNodes");I(ai)}q.moveToBookmark(ae);q.setRng(Z(q.getRng(B)));V.nodeChanged()}else{Q("apply",Y,af)}}}}function A(Y,ah,ab){var ac=R(Y),aj=ac[0],ag,af,X;function aa(am){var al=am.startContainer,ar=am.startOffset,aq,ap,an,ao;if(al.nodeType==3&&ar>=al.nodeValue.length-1){al=al.parentNode;ar=s(al)+1}if(al.nodeType==1){an=al.childNodes;al=an[Math.min(ar,an.length-1)];aq=new t(al);if(ar>an.length-1){aq.next()}for(ap=aq.current();ap;ap=aq.next()){if(ap.nodeType==3&&!f(ap)){ao=c.create("a",null,E);ap.parentNode.insertBefore(ao,ap);am.setStart(ap,0);q.setRng(am);c.remove(ao);return}}}}function Z(ao){var an,am,al;an=a.grep(ao.childNodes);for(am=0,al=ac.length;am<al;am++){if(U(ac[am],ah,ao,ao)){break}}if(aj.deep){for(am=0,al=an.length;am<al;am++){Z(an[am])}}}function ad(al){var am;O(m(al.parentNode).reverse(),function(an){var ao;if(!am&&an.id!="_start"&&an.id!="_end"){ao=x(an,Y,ah);if(ao&&ao.split!==false){am=an}}});return am}function W(ao,al,aq,au){var av,at,ar,an,ap,am;if(ao){am=ao.parentNode;for(av=al.parentNode;av&&av!=am;av=av.parentNode){at=av.cloneNode(S);for(ap=0;ap<ac.length;ap++){if(U(ac[ap],ah,at,at)){at=0;break}}if(at){if(ar){at.appendChild(ar)}if(!an){an=at}ar=at}}if(au&&(!aj.mixed||!F(ao))){al=c.split(ao,al)}if(ar){aq.parentNode.insertBefore(ar,aq);an.appendChild(aq)}}return al}function ai(al){return W(ad(al),al,al,true)}function ae(an){var am=c.get(an?"_start":"_end"),al=am[an?"firstChild":"lastChild"];if(H(al)){al=al[an?"firstChild":"lastChild"]}c.remove(am,true);return al}function ak(al){var am,an;al=o(al,ac,B);if(aj.split){am=J(al,B);an=J(al);if(am!=an){am=N(am,"span",{id:"_start","data-mce-type":"bookmark"});an=N(an,"span",{id:"_end","data-mce-type":"bookmark"});ai(am);ai(an);am=ae(B);an=ae()}else{am=an=ai(am)}al.startContainer=am.parentNode;al.startOffset=s(am);al.endContainer=an.parentNode;al.endOffset=s(an)+1}K.walk(al,function(ao){O(ao,function(ap){Z(ap);if(ap.nodeType===1&&V.dom.getStyle(ap,"text-decoration")==="underline"&&ap.parentNode&&i(ap.parentNode)==="underline"){U({deep:false,exact:true,inline:"span",styles:{textDecoration:"underline"}},null,ap)}})})}if(ab){X=c.createRng();X.setStartBefore(ab);X.setEndAfter(ab);ak(X);return}if(!q.isCollapsed()||!aj.inline||c.select("td.mceSelected,th.mceSelected").length){ag=q.getBookmark();ak(q.getRng(B));q.moveToBookmark(ag);if(j(Y,ah,q.getStart())){aa(q.getRng(true))}V.nodeChanged()}else{Q("remove",Y,ah)}}function D(X,Z,Y){var W=R(X);if(j(X,Z,Y)&&(!("toggle" in W[0])||W[0]["toggle"])){A(X,Z,Y)}else{T(X,Z,Y)}}function x(X,W,ac,aa){var Y=R(W),ad,ab,Z;function ae(ai,ak,al){var ah,aj,af=ak[al],ag;if(af){if(af.length===p){for(ah in af){if(af.hasOwnProperty(ah)){if(al==="attributes"){aj=c.getAttrib(ai,ah)}else{aj=L(ai,ah)}if(aa&&!aj&&!ak.exact){return}if((!aa||ak.exact)&&!g(aj,r(af[ah],ac))){return}}}}else{for(ag=0;ag<af.length;ag++){if(al==="attributes"?c.getAttrib(ai,af[ag]):L(ai,af[ag])){return ak}}}}return ak}if(Y&&X){for(ab=0;ab<Y.length;ab++){ad=Y[ab];if(h(X,ad)&&ae(X,ad,"attributes")&&ae(X,ad,"styles")){if(Z=ad.classes){for(ab=0;ab<Z.length;ab++){if(!c.hasClass(X,Z[ab])){return}}}return ad}}}}function j(Y,ab,aa){var X,Z;function W(ac){ac=c.getParent(ac,function(ad){return !!x(ad,Y,ab,true)});return x(ac,Y,ab)}if(aa){return W(aa)}if(q.isCollapsed()){for(Z=P.apply.length-1;Z>=0;Z--){if(P.apply[Z].name==Y){return true}}for(Z=P.remove.length-1;Z>=0;Z--){if(P.remove[Z].name==Y){return false}}return W(q.getNode())}aa=q.getNode();if(W(aa)){return B}X=q.getStart();if(X!=aa){if(W(X)){return B}}return S}function v(ad,ac){var aa,ab=[],Z={},Y,X,W;if(q.isCollapsed()){for(X=0;X<ad.length;X++){for(Y=P.remove.length-1;Y>=0;Y--){W=ad[X];if(P.remove[Y].name==W){Z[W]=true;break}}}for(Y=P.apply.length-1;Y>=0;Y--){for(X=0;X<ad.length;X++){W=ad[X];if(!Z[W]&&P.apply[Y].name==W){Z[W]=true;ab.push(W)}}}}aa=q.getStart();c.getParent(aa,function(ag){var af,ae;for(af=0;af<ad.length;af++){ae=ad[af];if(!Z[ae]&&x(ag,ae,ac)){Z[ae]=true;ab.push(ae)}}});return ab}function y(aa){var ac=R(aa),Z,Y,ab,X,W;if(ac){Z=q.getStart();Y=m(Z);for(X=ac.length-1;X>=0;X--){W=ac[X].selector;if(!W){return B}for(ab=Y.length-1;ab>=0;ab--){if(c.is(Y[ab],W)){return B}}}}return S}a.extend(this,{get:R,register:k,apply:T,remove:A,toggle:D,match:j,matchAll:v,matchNode:x,canApply:y});function h(W,X){if(g(W,X.inline)){return B}if(g(W,X.block)){return B}if(X.selector){return c.is(W,X.selector)}}function g(X,W){X=X||"";W=W||"";X=""+(X.nodeName||X);W=""+(W.nodeName||W);return X.toLowerCase()==W.toLowerCase()}function L(X,W){var Y=c.getStyle(X,W);if(W=="color"||W=="backgroundColor"){Y=c.toHex(Y)}if(W=="fontWeight"&&Y==700){Y="bold"}return""+Y}function r(W,X){if(typeof(W)!="string"){W=W(X)}else{if(X){W=W.replace(/%(\w+)/g,function(Z,Y){return X[Y]||Z})}}return W}function f(W){return W&&W.nodeType===3&&/^([\s\r\n]+|)$/.test(W.nodeValue)}function N(Y,X,W){var Z=c.create(X,W);Y.parentNode.insertBefore(Z,Y);Z.appendChild(Y);return Z}function o(W,ag,Z){var Y=W.startContainer,ad=W.startOffset,aj=W.endContainer,ae=W.endOffset,ai,af,ac;function ah(am,an,ak,al){var ao,ap;al=al||c.getRoot();for(;;){ao=am.parentNode;if(ao==al||(!ag[0].block_expand&&F(ao))){return am}for(ai=ao[an];ai&&ai!=am;ai=ai[ak]){if(ai.nodeType==1&&!H(ai)){return am}if(ai.nodeType==3&&!f(ai)){return am}}am=am.parentNode}return am}function ab(ak,al){if(al===p){al=ak.nodeType===3?ak.length:ak.childNodes.length}while(ak&&ak.hasChildNodes()){ak=ak.childNodes[al];if(ak){al=ak.nodeType===3?ak.length:ak.childNodes.length}}return{node:ak,offset:al}}if(Y.nodeType==1&&Y.hasChildNodes()){af=Y.childNodes.length-1;Y=Y.childNodes[ad>af?af:ad];if(Y.nodeType==3){ad=0}}if(aj.nodeType==1&&aj.hasChildNodes()){af=aj.childNodes.length-1;aj=aj.childNodes[ae>af?af:ae-1];if(aj.nodeType==3){ae=aj.nodeValue.length}}if(H(Y.parentNode)){Y=Y.parentNode}if(H(Y)){Y=Y.nextSibling||Y}if(H(aj.parentNode)){ae=c.nodeIndex(aj);aj=aj.parentNode}if(H(aj)&&aj.previousSibling){aj=aj.previousSibling;ae=aj.length}if(ag[0].inline){ac=ab(aj,ae);if(ac.node){while(ac.node&&ac.offset===0&&ac.node.previousSibling){ac=ab(ac.node.previousSibling)}if(ac.node&&ac.offset>0&&ac.node.nodeType===3&&ac.node.nodeValue.charAt(ac.offset-1)===" "){if(ac.offset>1){aj=ac.node;aj.splitText(ac.offset-1)}else{if(ac.node.previousSibling){aj=ac.node.previousSibling}}}}}if(ag[0].inline||ag[0].block_expand){Y=ah(Y,"firstChild","nextSibling");aj=ah(aj,"lastChild","previousSibling")}if(ag[0].selector&&ag[0].expand!==S&&!ag[0].inline){function aa(al,ak){var am,an,ap,ao;if(al.nodeType==3&&al.nodeValue.length==0&&al[ak]){al=al[ak]}am=m(al);for(an=0;an<am.length;an++){for(ap=0;ap<ag.length;ap++){ao=ag[ap];if("collapsed" in ao&&ao.collapsed!==W.collapsed){continue}if(c.is(am[an],ao.selector)){return am[an]}}}return al}Y=aa(Y,"previousSibling");aj=aa(aj,"nextSibling")}if(ag[0].block||ag[0].selector){function X(al,ak,an){var am;if(!ag[0].wrapper){am=c.getParent(al,ag[0].block)}if(!am){am=c.getParent(al.nodeType==3?al.parentNode:al,F)}if(am&&ag[0].wrapper){am=m(am,"ul,ol").reverse()[0]||am}if(!am){am=al;while(am[ak]&&!F(am[ak])){am=am[ak];if(g(am,"br")){break}}}return am||al}Y=X(Y,"previousSibling");aj=X(aj,"nextSibling");if(ag[0].block){if(!F(Y)){Y=ah(Y,"firstChild","nextSibling")}if(!F(aj)){aj=ah(aj,"lastChild","previousSibling")}}}if(Y.nodeType==1){ad=s(Y);Y=Y.parentNode}if(aj.nodeType==1){ae=s(aj)+1;aj=aj.parentNode}return{startContainer:Y,startOffset:ad,endContainer:aj,endOffset:ae}}function U(ac,ab,Z,W){var Y,X,aa;if(!h(Z,ac)){return S}if(ac.remove!="all"){O(ac.styles,function(ae,ad){ae=r(ae,ab);if(typeof(ad)==="number"){ad=ae;W=0}if(!W||g(L(W,ad),ae)){c.setStyle(Z,ad,"")}aa=1});if(aa&&c.getAttrib(Z,"style")==""){Z.removeAttribute("style");Z.removeAttribute("data-mce-style")}O(ac.attributes,function(af,ad){var ae;af=r(af,ab);if(typeof(ad)==="number"){ad=af;W=0}if(!W||g(c.getAttrib(W,ad),af)){if(ad=="class"){af=c.getAttrib(Z,ad);if(af){ae="";O(af.split(/\s+/),function(ag){if(/mce\w+/.test(ag)){ae+=(ae?" ":"")+ag}});if(ae){c.setAttrib(Z,ad,ae);return}}}if(ad=="class"){Z.removeAttribute("className")}if(e.test(ad)){Z.removeAttribute("data-mce-"+ad)}Z.removeAttribute(ad)}});O(ac.classes,function(ad){ad=r(ad,ab);if(!W||c.hasClass(W,ad)){c.removeClass(Z,ad)}});X=c.getAttribs(Z);for(Y=0;Y<X.length;Y++){if(X[Y].nodeName.indexOf("_")!==0){return S}}}if(ac.remove!="none"){n(Z,ac);return B}}function n(Y,Z){var W=Y.parentNode,X;if(Z.block){if(!l){function aa(ac,ab,ad){ac=C(ac,ab,ad);return !ac||(ac.nodeName=="BR"||F(ac))}if(F(Y)&&!F(W)){if(!aa(Y,S)&&!aa(Y.firstChild,B,1)){Y.insertBefore(c.create("br"),Y.firstChild)}if(!aa(Y,B)&&!aa(Y.lastChild,S,1)){Y.appendChild(c.create("br"))}}}else{if(W==c.getRoot()){if(!Z.list_block||!g(Y,Z.list_block)){O(a.grep(Y.childNodes),function(ab){if(d(l,ab.nodeName.toLowerCase())){if(!X){X=N(ab,l)}else{X.appendChild(ab)}}else{X=0}})}}}}if(Z.selector&&Z.inline&&!g(Z.inline,Y)){return}c.remove(Y,1)}function C(X,W,Y){if(X){W=W?"nextSibling":"previousSibling";for(X=Y?X:X[W];X;X=X[W]){if(X.nodeType==1||!f(X)){return X}}}}function H(W){return W&&W.nodeType==1&&W.getAttribute("data-mce-type")=="bookmark"}function u(aa,Z){var W,Y,X;function ac(af,ae){if(af.nodeName!=ae.nodeName){return S}function ad(ah){var ai={};O(c.getAttribs(ah),function(aj){var ak=aj.nodeName.toLowerCase();if(ak.indexOf("_")!==0&&ak!=="style"){ai[ak]=c.getAttrib(ah,ak)}});return ai}function ag(ak,aj){var ai,ah;for(ah in ak){if(ak.hasOwnProperty(ah)){ai=aj[ah];if(ai===p){return S}if(ak[ah]!=ai){return S}delete aj[ah]}}for(ah in aj){if(aj.hasOwnProperty(ah)){return S}}return B}if(!ag(ad(af),ad(ae))){return S}if(!ag(c.parseStyle(c.getAttrib(af,"style")),c.parseStyle(c.getAttrib(ae,"style")))){return S}return B}if(aa&&Z){function ab(ae,ad){for(Y=ae;Y;Y=Y[ad]){if(Y.nodeType==3&&Y.nodeValue.length!==0){return ae}if(Y.nodeType==1&&!H(Y)){return Y}}return ae}aa=ab(aa,"previousSibling");Z=ab(Z,"nextSibling");if(ac(aa,Z)){for(Y=aa.nextSibling;Y&&Y!=Z;){X=Y;Y=Y.nextSibling;aa.appendChild(X)}c.remove(Z);O(a.grep(Z.childNodes),function(ad){aa.appendChild(ad)});return aa}}return Z}function G(W){return/^(h[1-6]|p|div|pre|address|dl|dt|dd)$/.test(W)}function J(X,aa){var W,Z,Y;W=X[aa?"startContainer":"endContainer"];Z=X[aa?"startOffset":"endOffset"];if(W.nodeType==1){Y=W.childNodes.length-1;if(!aa&&Z){Z--}W=W.childNodes[Z>Y?Y:Z]}return W}function Q(ab,X,aa){var Y,W=P[ab],ac=P[ab=="apply"?"remove":"apply"];function ad(){return P.apply.length||P.remove.length}function Z(){P.apply=[];P.remove=[]}function ae(af){O(P.apply.reverse(),function(ag){T(ag.name,ag.vars,af);if(ag.name==="forecolor"&&ag.vars.value){I(af.parentNode)}});O(P.remove.reverse(),function(ag){A(ag.name,ag.vars,af)});c.remove(af,1);Z()}for(Y=W.length-1;Y>=0;Y--){if(W[Y].name==X){return}}W.push({name:X,vars:aa});for(Y=ac.length-1;Y>=0;Y--){if(ac[Y].name==X){ac.splice(Y,1)}}if(ad()){V.getDoc().execCommand("FontName",false,"mceinline");P.lastRng=q.getRng();O(c.select("font,span"),function(ag){var af;if(b(ag)){af=q.getBookmark();ae(ag);q.moveToBookmark(af);V.nodeChanged()}});if(!P.isListening&&ad()){P.isListening=true;O("onKeyDown,onKeyUp,onKeyPress,onMouseUp".split(","),function(af){V[af].addToTop(function(ag,ah){if(ad()&&!a.dom.RangeUtils.compareRanges(P.lastRng,q.getRng())){O(c.select("font,span"),function(aj){var ak,ai;if(b(aj)){ak=aj.firstChild;if(ak){ae(aj);ai=c.createRng();ai.setStart(ak,ak.nodeValue.length);ai.setEnd(ak,ak.nodeValue.length);q.setRng(ai);ag.nodeChanged()}else{c.remove(aj)}}});if(ah.type=="keyup"||ah.type=="mouseup"){Z()}}})})}}}}})(tinymce);tinymce.onAddEditor.add(function(e,a){var d,h,g,c=a.settings;if(c.inline_styles){h=e.explode(c.font_size_style_values);function b(j,i){e.each(i,function(l,k){if(l){g.setStyle(j,k,l)}});g.rename(j,"span")}d={font:function(j,i){b(i,{backgroundColor:i.style.backgroundColor,color:i.color,fontFamily:i.face,fontSize:h[parseInt(i.size)-1]})},u:function(j,i){b(i,{textDecoration:"underline"})},strike:function(j,i){b(i,{textDecoration:"line-through"})}};function f(i,j){g=i.dom;if(c.convert_fonts_to_spans){e.each(g.select("font,u,strike",j.node),function(k){d[k.nodeName.toLowerCase()](a.dom,k)})}}a.onPreProcess.add(f);a.onSetContent.add(f);a.onInit.add(function(){a.selection.onSetContent.add(f)})}});
Index: admin/js/tiny_mce/tiny_mce_popup.js
===================================================================
--- admin/js/tiny_mce/tiny_mce_popup.js	(revision 326)
+++ admin/js/tiny_mce/tiny_mce_popup.js	(revision 326)
@@ -0,0 +1,5 @@
+
+// Uncomment and change this document.domain value if you are loading the script cross subdomains
+// document.domain = 'moxiecode.com';
+
+var tinymce=null,tinyMCEPopup,tinyMCE;tinyMCEPopup={init:function(){var b=this,a,c;a=b.getWin();tinymce=a.tinymce;tinyMCE=a.tinyMCE;b.editor=tinymce.EditorManager.activeEditor;b.params=b.editor.windowManager.params;b.features=b.editor.windowManager.features;b.dom=b.editor.windowManager.createInstance("tinymce.dom.DOMUtils",document);if(b.features.popup_css!==false){b.dom.loadCSS(b.features.popup_css||b.editor.settings.popup_css)}b.listeners=[];b.onInit={add:function(e,d){b.listeners.push({func:e,scope:d})}};b.isWindow=!b.getWindowArg("mce_inline");b.id=b.getWindowArg("mce_window_id");b.editor.windowManager.onOpen.dispatch(b.editor.windowManager,window)},getWin:function(){return(!window.frameElement&&window.dialogArguments)||opener||parent||top},getWindowArg:function(c,b){var a=this.params[c];return tinymce.is(a)?a:b},getParam:function(b,a){return this.editor.getParam(b,a)},getLang:function(b,a){return this.editor.getLang(b,a)},execCommand:function(d,c,e,b){b=b||{};b.skip_focus=1;this.restoreSelection();return this.editor.execCommand(d,c,e,b)},resizeToInnerSize:function(){var a=this;setTimeout(function(){var b=a.dom.getViewPort(window);a.editor.windowManager.resizeBy(a.getWindowArg("mce_width")-b.w,a.getWindowArg("mce_height")-b.h,a.id||window)},10)},executeOnLoad:function(s){this.onInit.add(function(){eval(s)})},storeSelection:function(){this.editor.windowManager.bookmark=tinyMCEPopup.editor.selection.getBookmark(1)},restoreSelection:function(){var a=tinyMCEPopup;if(!a.isWindow&&tinymce.isIE){a.editor.selection.moveToBookmark(a.editor.windowManager.bookmark)}},requireLangPack:function(){var b=this,a=b.getWindowArg("plugin_url")||b.getWindowArg("theme_url");if(a&&b.editor.settings.language&&b.features.translate_i18n!==false&&b.editor.settings.language_load!==false){a+="/langs/"+b.editor.settings.language+"_dlg.js";if(!tinymce.ScriptLoader.isDone(a)){document.write('<script type="text/javascript" src="'+tinymce._addVer(a)+'"><\/script>');tinymce.ScriptLoader.markDone(a)}}},pickColor:function(b,a){this.execCommand("mceColorPicker",true,{color:document.getElementById(a).value,func:function(e){document.getElementById(a).value=e;try{document.getElementById(a).onchange()}catch(d){}}})},openBrowser:function(a,c,b){tinyMCEPopup.restoreSelection();this.editor.execCallback("file_browser_callback",a,document.getElementById(a).value,c,window)},confirm:function(b,a,c){this.editor.windowManager.confirm(b,a,c,window)},alert:function(b,a,c){this.editor.windowManager.alert(b,a,c,window)},close:function(){var a=this;function b(){a.editor.windowManager.close(window);tinymce=tinyMCE=a.editor=a.params=a.dom=a.dom.doc=null}if(tinymce.isOpera){a.getWin().setTimeout(b,0)}else{b()}},_restoreSelection:function(){var a=window.event.srcElement;if(a.nodeName=="INPUT"&&(a.type=="submit"||a.type=="button")){tinyMCEPopup.restoreSelection()}},_onDOMLoaded:function(){var b=tinyMCEPopup,d=document.title,e,c,a;if(b.domLoaded){return}b.domLoaded=1;if(b.features.translate_i18n!==false){c=document.body.innerHTML;if(tinymce.isIE){c=c.replace(/ (value|title|alt)=([^"][^\s>]+)/gi,' $1="$2"')}document.dir=b.editor.getParam("directionality","");if((a=b.editor.translate(c))&&a!=c){document.body.innerHTML=a}if((a=b.editor.translate(d))&&a!=d){document.title=d=a}}if(!b.editor.getParam("browser_preferred_colors",false)||!b.isWindow){b.dom.addClass(document.body,"forceColors")}document.body.style.display="";if(tinymce.isIE){document.attachEvent("onmouseup",tinyMCEPopup._restoreSelection);b.dom.add(b.dom.select("head")[0],"base",{target:"_self"})}b.restoreSelection();b.resizeToInnerSize();if(!b.isWindow){b.editor.windowManager.setTitle(window,d)}else{window.focus()}if(!tinymce.isIE&&!b.isWindow){tinymce.dom.Event._add(document,"focus",function(){b.editor.windowManager.focus(b.id)})}tinymce.each(b.dom.select("select"),function(f){f.onkeydown=tinyMCEPopup._accessHandler});tinymce.each(b.listeners,function(f){f.func.call(f.scope,b.editor)});if(b.getWindowArg("mce_auto_focus",true)){window.focus();tinymce.each(document.forms,function(g){tinymce.each(g.elements,function(f){if(b.dom.hasClass(f,"mceFocus")&&!f.disabled){f.focus();return false}})})}document.onkeyup=tinyMCEPopup._closeWinKeyHandler},_accessHandler:function(a){a=a||window.event;if(a.keyCode==13||a.keyCode==32){a=a.target||a.srcElement;if(a.onchange){a.onchange()}return tinymce.dom.Event.cancel(a)}},_closeWinKeyHandler:function(a){a=a||window.event;if(a.keyCode==27){tinyMCEPopup.close()}},_wait:function(){if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);tinyMCEPopup._onDOMLoaded()}});if(document.documentElement.doScroll&&window==window.top){(function(){if(tinyMCEPopup.domLoaded){return}try{document.documentElement.doScroll("left")}catch(a){setTimeout(arguments.callee,0);return}tinyMCEPopup._onDOMLoaded()})()}document.attachEvent("onload",tinyMCEPopup._onDOMLoaded)}else{if(document.addEventListener){window.addEventListener("DOMContentLoaded",tinyMCEPopup._onDOMLoaded,false);window.addEventListener("load",tinyMCEPopup._onDOMLoaded,false)}}}};tinyMCEPopup.init();tinyMCEPopup._wait();
Index: admin/js/tiny_mce/utils/editable_selects.js
===================================================================
--- admin/js/tiny_mce/utils/editable_selects.js	(revision 307)
+++ admin/js/tiny_mce/utils/editable_selects.js	(revision 307)
@@ -0,0 +1,70 @@
+/**
+ * editable_selects.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+var TinyMCE_EditableSelects = {
+	editSelectElm : null,
+
+	init : function() {
+		var nl = document.getElementsByTagName("select"), i, d = document, o;
+
+		for (i=0; i<nl.length; i++) {
+			if (nl[i].className.indexOf('mceEditableSelect') != -1) {
+				o = new Option('(value)', '__mce_add_custom__');
+
+				o.className = 'mceAddSelectValue';
+
+				nl[i].options[nl[i].options.length] = o;
+				nl[i].onchange = TinyMCE_EditableSelects.onChangeEditableSelect;
+			}
+		}
+	},
+
+	onChangeEditableSelect : function(e) {
+		var d = document, ne, se = window.event ? window.event.srcElement : e.target;
+
+		if (se.options[se.selectedIndex].value == '__mce_add_custom__') {
+			ne = d.createElement("input");
+			ne.id = se.id + "_custom";
+			ne.name = se.name + "_custom";
+			ne.type = "text";
+
+			ne.style.width = se.offsetWidth + 'px';
+			se.parentNode.insertBefore(ne, se);
+			se.style.display = 'none';
+			ne.focus();
+			ne.onblur = TinyMCE_EditableSelects.onBlurEditableSelectInput;
+			ne.onkeydown = TinyMCE_EditableSelects.onKeyDown;
+			TinyMCE_EditableSelects.editSelectElm = se;
+		}
+	},
+
+	onBlurEditableSelectInput : function() {
+		var se = TinyMCE_EditableSelects.editSelectElm;
+
+		if (se) {
+			if (se.previousSibling.value != '') {
+				addSelectValue(document.forms[0], se.id, se.previousSibling.value, se.previousSibling.value);
+				selectByValue(document.forms[0], se.id, se.previousSibling.value);
+			} else
+				selectByValue(document.forms[0], se.id, '');
+
+			se.style.display = 'inline';
+			se.parentNode.removeChild(se.previousSibling);
+			TinyMCE_EditableSelects.editSelectElm = null;
+		}
+	},
+
+	onKeyDown : function(e) {
+		e = e || window.event;
+
+		if (e.keyCode == 13)
+			TinyMCE_EditableSelects.onBlurEditableSelectInput();
+	}
+};
Index: admin/js/tiny_mce/utils/form_utils.js
===================================================================
--- admin/js/tiny_mce/utils/form_utils.js	(revision 307)
+++ admin/js/tiny_mce/utils/form_utils.js	(revision 307)
@@ -0,0 +1,210 @@
+/**
+ * form_utils.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+var themeBaseURL = tinyMCEPopup.editor.baseURI.toAbsolute('themes/' + tinyMCEPopup.getParam("theme"));
+
+function getColorPickerHTML(id, target_form_element) {
+	var h = "", dom = tinyMCEPopup.dom;
+
+	if (label = dom.select('label[for=' + target_form_element + ']')[0]) {
+		label.id = label.id || dom.uniqueId();
+	}
+
+	h += '<a role="button" aria-labelledby="' + id + '_label" id="' + id + '_link" href="javascript:;" onclick="tinyMCEPopup.pickColor(event,\'' + target_form_element +'\');" onmousedown="return false;" class="pickcolor">';
+	h += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;<span id="' + id + '_label" class="mceVoiceLabel mceIconOnly" style="display:none;">' + tinyMCEPopup.getLang('browse') + '</span></span></a>';
+
+	return h;
+}
+
+function updateColor(img_id, form_element_id) {
+	document.getElementById(img_id).style.backgroundColor = document.forms[0].elements[form_element_id].value;
+}
+
+function setBrowserDisabled(id, state) {
+	var img = document.getElementById(id);
+	var lnk = document.getElementById(id + "_link");
+
+	if (lnk) {
+		if (state) {
+			lnk.setAttribute("realhref", lnk.getAttribute("href"));
+			lnk.removeAttribute("href");
+			tinyMCEPopup.dom.addClass(img, 'disabled');
+		} else {
+			if (lnk.getAttribute("realhref"))
+				lnk.setAttribute("href", lnk.getAttribute("realhref"));
+
+			tinyMCEPopup.dom.removeClass(img, 'disabled');
+		}
+	}
+}
+
+function getBrowserHTML(id, target_form_element, type, prefix) {
+	var option = prefix + "_" + type + "_browser_callback", cb, html;
+
+	cb = tinyMCEPopup.getParam(option, tinyMCEPopup.getParam("file_browser_callback"));
+
+	if (!cb)
+		return "";
+
+	html = "";
+	html += '<a id="' + id + '_link" href="javascript:openBrowser(\'' + id + '\',\'' + target_form_element + '\', \'' + type + '\',\'' + option + '\');" onmousedown="return false;" class="browse">';
+	html += '<span id="' + id + '" title="' + tinyMCEPopup.getLang('browse') + '">&nbsp;</span></a>';
+
+	return html;
+}
+
+function openBrowser(img_id, target_form_element, type, option) {
+	var img = document.getElementById(img_id);
+
+	if (img.className != "mceButtonDisabled")
+		tinyMCEPopup.openBrowser(target_form_element, type, option);
+}
+
+function selectByValue(form_obj, field_name, value, add_custom, ignore_case) {
+	if (!form_obj || !form_obj.elements[field_name])
+		return;
+
+	if (!value)
+		value = "";
+
+	var sel = form_obj.elements[field_name];
+
+	var found = false;
+	for (var i=0; i<sel.options.length; i++) {
+		var option = sel.options[i];
+
+		if (option.value == value || (ignore_case && option.value.toLowerCase() == value.toLowerCase())) {
+			option.selected = true;
+			found = true;
+		} else
+			option.selected = false;
+	}
+
+	if (!found && add_custom && value != '') {
+		var option = new Option(value, value);
+		option.selected = true;
+		sel.options[sel.options.length] = option;
+		sel.selectedIndex = sel.options.length - 1;
+	}
+
+	return found;
+}
+
+function getSelectValue(form_obj, field_name) {
+	var elm = form_obj.elements[field_name];
+
+	if (elm == null || elm.options == null || elm.selectedIndex === -1)
+		return "";
+
+	return elm.options[elm.selectedIndex].value;
+}
+
+function addSelectValue(form_obj, field_name, name, value) {
+	var s = form_obj.elements[field_name];
+	var o = new Option(name, value);
+	s.options[s.options.length] = o;
+}
+
+function addClassesToList(list_id, specific_option) {
+	// Setup class droplist
+	var styleSelectElm = document.getElementById(list_id);
+	var styles = tinyMCEPopup.getParam('theme_advanced_styles', false);
+	styles = tinyMCEPopup.getParam(specific_option, styles);
+
+	if (styles) {
+		var stylesAr = styles.split(';');
+
+		for (var i=0; i<stylesAr.length; i++) {
+			if (stylesAr != "") {
+				var key, value;
+
+				key = stylesAr[i].split('=')[0];
+				value = stylesAr[i].split('=')[1];
+
+				styleSelectElm.options[styleSelectElm.length] = new Option(key, value);
+			}
+		}
+	} else {
+		tinymce.each(tinyMCEPopup.editor.dom.getClasses(), function(o) {
+			styleSelectElm.options[styleSelectElm.length] = new Option(o.title || o['class'], o['class']);
+		});
+	}
+}
+
+function isVisible(element_id) {
+	var elm = document.getElementById(element_id);
+
+	return elm && elm.style.display != "none";
+}
+
+function convertRGBToHex(col) {
+	var re = new RegExp("rgb\\s*\\(\\s*([0-9]+).*,\\s*([0-9]+).*,\\s*([0-9]+).*\\)", "gi");
+
+	var rgb = col.replace(re, "$1,$2,$3").split(',');
+	if (rgb.length == 3) {
+		r = parseInt(rgb[0]).toString(16);
+		g = parseInt(rgb[1]).toString(16);
+		b = parseInt(rgb[2]).toString(16);
+
+		r = r.length == 1 ? '0' + r : r;
+		g = g.length == 1 ? '0' + g : g;
+		b = b.length == 1 ? '0' + b : b;
+
+		return "#" + r + g + b;
+	}
+
+	return col;
+}
+
+function convertHexToRGB(col) {
+	if (col.indexOf('#') != -1) {
+		col = col.replace(new RegExp('[^0-9A-F]', 'gi'), '');
+
+		r = parseInt(col.substring(0, 2), 16);
+		g = parseInt(col.substring(2, 4), 16);
+		b = parseInt(col.substring(4, 6), 16);
+
+		return "rgb(" + r + "," + g + "," + b + ")";
+	}
+
+	return col;
+}
+
+function trimSize(size) {
+	return size.replace(/([0-9\.]+)(px|%|in|cm|mm|em|ex|pt|pc)/i, '$1$2');
+}
+
+function getCSSSize(size) {
+	size = trimSize(size);
+
+	if (size == "")
+		return "";
+
+	// Add px
+	if (/^[0-9]+$/.test(size))
+		size += 'px';
+	// Sanity check, IE doesn't like broken values
+	else if (!(/^[0-9\.]+(px|%|in|cm|mm|em|ex|pt|pc)$/i.test(size)))
+		return "";
+
+	return size;
+}
+
+function getStyle(elm, attrib, style) {
+	var val = tinyMCEPopup.dom.getAttrib(elm, attrib);
+
+	if (val != '')
+		return '' + val;
+
+	if (typeof(style) == 'undefined')
+		style = attrib;
+
+	return tinyMCEPopup.dom.getStyle(elm, style);
+}
Index: admin/js/tiny_mce/utils/mctabs.js
===================================================================
--- admin/js/tiny_mce/utils/mctabs.js	(revision 307)
+++ admin/js/tiny_mce/utils/mctabs.js	(revision 307)
@@ -0,0 +1,162 @@
+/**
+ * mctabs.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+function MCTabs() {
+	this.settings = [];
+	this.onChange = tinyMCEPopup.editor.windowManager.createInstance('tinymce.util.Dispatcher');
+};
+
+MCTabs.prototype.init = function(settings) {
+	this.settings = settings;
+};
+
+MCTabs.prototype.getParam = function(name, default_value) {
+	var value = null;
+
+	value = (typeof(this.settings[name]) == "undefined") ? default_value : this.settings[name];
+
+	// Fix bool values
+	if (value == "true" || value == "false")
+		return (value == "true");
+
+	return value;
+};
+
+MCTabs.prototype.showTab =function(tab){
+	tab.className = 'current';
+	tab.setAttribute("aria-selected", true);
+	tab.setAttribute("aria-expanded", true);
+	tab.tabIndex = 0;
+};
+
+MCTabs.prototype.hideTab =function(tab){
+	var t=this;
+
+	tab.className = '';
+	tab.setAttribute("aria-selected", false);
+	tab.setAttribute("aria-expanded", false);
+	tab.tabIndex = -1;
+};
+
+MCTabs.prototype.showPanel = function(panel) {
+	panel.className = 'current'; 
+	panel.setAttribute("aria-hidden", false);
+};
+
+MCTabs.prototype.hidePanel = function(panel) {
+	panel.className = 'panel';
+	panel.setAttribute("aria-hidden", true);
+}; 
+
+MCTabs.prototype.getPanelForTab = function(tabElm) {
+	return tinyMCEPopup.dom.getAttrib(tabElm, "aria-controls");
+};
+
+MCTabs.prototype.displayTab = function(tab_id, panel_id, avoid_focus) {
+	var panelElm, panelContainerElm, tabElm, tabContainerElm, selectionClass, nodes, i, t = this;
+
+	tabElm = document.getElementById(tab_id);
+
+	if (panel_id === undefined) {
+		panel_id = t.getPanelForTab(tabElm);
+	}
+
+	panelElm= document.getElementById(panel_id);
+	panelContainerElm = panelElm ? panelElm.parentNode : null;
+	tabContainerElm = tabElm ? tabElm.parentNode : null;
+	selectionClass = t.getParam('selection_class', 'current');
+
+	if (tabElm && tabContainerElm) {
+		nodes = tabContainerElm.childNodes;
+
+		// Hide all other tabs
+		for (i = 0; i < nodes.length; i++) {
+			if (nodes[i].nodeName == "LI") {
+				t.hideTab(nodes[i]);
+			}
+		}
+
+		// Show selected tab
+		t.showTab(tabElm);
+	}
+
+	if (panelElm && panelContainerElm) {
+		nodes = panelContainerElm.childNodes;
+
+		// Hide all other panels
+		for (i = 0; i < nodes.length; i++) {
+			if (nodes[i].nodeName == "DIV")
+				t.hidePanel(nodes[i]);
+		}
+
+		if (!avoid_focus) { 
+			tabElm.focus();
+		}
+
+		// Show selected panel
+		t.showPanel(panelElm);
+	}
+};
+
+MCTabs.prototype.getAnchor = function() {
+	var pos, url = document.location.href;
+
+	if ((pos = url.lastIndexOf('#')) != -1)
+		return url.substring(pos + 1);
+
+	return "";
+};
+
+
+//Global instance
+var mcTabs = new MCTabs();
+
+tinyMCEPopup.onInit.add(function() {
+	var tinymce = tinyMCEPopup.getWin().tinymce, dom = tinyMCEPopup.dom, each = tinymce.each;
+
+	each(dom.select('div.tabs'), function(tabContainerElm) {
+		var keyNav;
+
+		dom.setAttrib(tabContainerElm, "role", "tablist"); 
+
+		var items = tinyMCEPopup.dom.select('li', tabContainerElm);
+		var action = function(id) {
+			mcTabs.displayTab(id, mcTabs.getPanelForTab(id));
+			mcTabs.onChange.dispatch(id);
+		};
+
+		each(items, function(item) {
+			dom.setAttrib(item, 'role', 'tab');
+			dom.bind(item, 'click', function(evt) {
+				action(item.id);
+			});
+		});
+
+		dom.bind(dom.getRoot(), 'keydown', function(evt) {
+			if (evt.keyCode === 9 && evt.ctrlKey && !evt.altKey) { // Tab
+				keyNav.moveFocus(evt.shiftKey ? -1 : 1);
+				tinymce.dom.Event.cancel(evt);
+			}
+		});
+
+		each(dom.select('a', tabContainerElm), function(a) {
+			dom.setAttrib(a, 'tabindex', '-1');
+		});
+
+		keyNav = tinyMCEPopup.editor.windowManager.createInstance('tinymce.ui.KeyboardNavigation', {
+			root: tabContainerElm,
+			items: items,
+			onAction: action,
+			actOnFocus: true,
+			enableLeftRight: true,
+			enableUpDown: true
+		}, tinyMCEPopup.dom);
+	});
+});
Index: admin/js/tiny_mce/utils/validate.js
===================================================================
--- admin/js/tiny_mce/utils/validate.js	(revision 307)
+++ admin/js/tiny_mce/utils/validate.js	(revision 307)
@@ -0,0 +1,252 @@
+/**
+ * validate.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+/**
+	// String validation:
+
+	if (!Validator.isEmail('myemail'))
+		alert('Invalid email.');
+
+	// Form validation:
+
+	var f = document.forms['myform'];
+
+	if (!Validator.isEmail(f.myemail))
+		alert('Invalid email.');
+*/
+
+var Validator = {
+	isEmail : function(s) {
+		return this.test(s, '^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+@[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$');
+	},
+
+	isAbsUrl : function(s) {
+		return this.test(s, '^(news|telnet|nttp|file|http|ftp|https)://[-A-Za-z0-9\\.]+\\/?.*$');
+	},
+
+	isSize : function(s) {
+		return this.test(s, '^[0-9.]+(%|in|cm|mm|em|ex|pt|pc|px)?$');
+	},
+
+	isId : function(s) {
+		return this.test(s, '^[A-Za-z_]([A-Za-z0-9_])*$');
+	},
+
+	isEmpty : function(s) {
+		var nl, i;
+
+		if (s.nodeName == 'SELECT' && s.selectedIndex < 1)
+			return true;
+
+		if (s.type == 'checkbox' && !s.checked)
+			return true;
+
+		if (s.type == 'radio') {
+			for (i=0, nl = s.form.elements; i<nl.length; i++) {
+				if (nl[i].type == "radio" && nl[i].name == s.name && nl[i].checked)
+					return false;
+			}
+
+			return true;
+		}
+
+		return new RegExp('^\\s*$').test(s.nodeType == 1 ? s.value : s);
+	},
+
+	isNumber : function(s, d) {
+		return !isNaN(s.nodeType == 1 ? s.value : s) && (!d || !this.test(s, '^-?[0-9]*\\.[0-9]*$'));
+	},
+
+	test : function(s, p) {
+		s = s.nodeType == 1 ? s.value : s;
+
+		return s == '' || new RegExp(p).test(s);
+	}
+};
+
+var AutoValidator = {
+	settings : {
+		id_cls : 'id',
+		int_cls : 'int',
+		url_cls : 'url',
+		number_cls : 'number',
+		email_cls : 'email',
+		size_cls : 'size',
+		required_cls : 'required',
+		invalid_cls : 'invalid',
+		min_cls : 'min',
+		max_cls : 'max'
+	},
+
+	init : function(s) {
+		var n;
+
+		for (n in s)
+			this.settings[n] = s[n];
+	},
+
+	validate : function(f) {
+		var i, nl, s = this.settings, c = 0;
+
+		nl = this.tags(f, 'label');
+		for (i=0; i<nl.length; i++) {
+			this.removeClass(nl[i], s.invalid_cls);
+			nl[i].setAttribute('aria-invalid', false);
+		}
+
+		c += this.validateElms(f, 'input');
+		c += this.validateElms(f, 'select');
+		c += this.validateElms(f, 'textarea');
+
+		return c == 3;
+	},
+
+	invalidate : function(n) {
+		this.mark(n.form, n);
+	},
+	
+	getErrorMessages : function(f) {
+		var nl, i, s = this.settings, field, msg, values, messages = [], ed = tinyMCEPopup.editor;
+		nl = this.tags(f, "label");
+		for (i=0; i<nl.length; i++) {
+			if (this.hasClass(nl[i], s.invalid_cls)) {
+				field = document.getElementById(nl[i].getAttribute("for"));
+				values = { field: nl[i].textContent };
+				if (this.hasClass(field, s.min_cls, true)) {
+					message = ed.getLang('invalid_data_min');
+					values.min = this.getNum(field, s.min_cls);
+				} else if (this.hasClass(field, s.number_cls)) {
+					message = ed.getLang('invalid_data_number');
+				} else if (this.hasClass(field, s.size_cls)) {
+					message = ed.getLang('invalid_data_size');
+				} else {
+					message = ed.getLang('invalid_data');
+				}
+				
+				message = message.replace(/{\#([^}]+)\}/g, function(a, b) {
+					return values[b] || '{#' + b + '}';
+				});
+				messages.push(message);
+			}
+		}
+		return messages;
+	},
+
+	reset : function(e) {
+		var t = ['label', 'input', 'select', 'textarea'];
+		var i, j, nl, s = this.settings;
+
+		if (e == null)
+			return;
+
+		for (i=0; i<t.length; i++) {
+			nl = this.tags(e.form ? e.form : e, t[i]);
+			for (j=0; j<nl.length; j++) {
+				this.removeClass(nl[j], s.invalid_cls);
+				nl[j].setAttribute('aria-invalid', false);
+			}
+		}
+	},
+
+	validateElms : function(f, e) {
+		var nl, i, n, s = this.settings, st = true, va = Validator, v;
+
+		nl = this.tags(f, e);
+		for (i=0; i<nl.length; i++) {
+			n = nl[i];
+
+			this.removeClass(n, s.invalid_cls);
+
+			if (this.hasClass(n, s.required_cls) && va.isEmpty(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.number_cls) && !va.isNumber(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.int_cls) && !va.isNumber(n, true))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.url_cls) && !va.isAbsUrl(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.email_cls) && !va.isEmail(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.size_cls) && !va.isSize(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.id_cls) && !va.isId(n))
+				st = this.mark(f, n);
+
+			if (this.hasClass(n, s.min_cls, true)) {
+				v = this.getNum(n, s.min_cls);
+
+				if (isNaN(v) || parseInt(n.value) < parseInt(v))
+					st = this.mark(f, n);
+			}
+
+			if (this.hasClass(n, s.max_cls, true)) {
+				v = this.getNum(n, s.max_cls);
+
+				if (isNaN(v) || parseInt(n.value) > parseInt(v))
+					st = this.mark(f, n);
+			}
+		}
+
+		return st;
+	},
+
+	hasClass : function(n, c, d) {
+		return new RegExp('\\b' + c + (d ? '[0-9]+' : '') + '\\b', 'g').test(n.className);
+	},
+
+	getNum : function(n, c) {
+		c = n.className.match(new RegExp('\\b' + c + '([0-9]+)\\b', 'g'))[0];
+		c = c.replace(/[^0-9]/g, '');
+
+		return c;
+	},
+
+	addClass : function(n, c, b) {
+		var o = this.removeClass(n, c);
+		n.className = b ? c + (o != '' ? (' ' + o) : '') : (o != '' ? (o + ' ') : '') + c;
+	},
+
+	removeClass : function(n, c) {
+		c = n.className.replace(new RegExp("(^|\\s+)" + c + "(\\s+|$)"), ' ');
+		return n.className = c != ' ' ? c : '';
+	},
+
+	tags : function(f, s) {
+		return f.getElementsByTagName(s);
+	},
+
+	mark : function(f, n) {
+		var s = this.settings;
+
+		this.addClass(n, s.invalid_cls);
+		n.setAttribute('aria-invalid', 'true');
+		this.markLabels(f, n, s.invalid_cls);
+
+		return false;
+	},
+
+	markLabels : function(f, n, ic) {
+		var nl, i;
+
+		nl = this.tags(f, "label");
+		for (i=0; i<nl.length; i++) {
+			if (nl[i].getAttribute("for") == n.id || nl[i].htmlFor == n.id)
+				this.addClass(nl[i], ic);
+		}
+
+		return null;
+	}
+};
Index: admin/langs.php
===================================================================
--- admin/langs.php	(revision 500)
+++ admin/langs.php	(revision 66)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -133,5 +133,5 @@
 
 echo
-'<h2 class="page-title">'.__('Languages management').'</h2>';
+'<h2>'.__('Languages management').'</h2>';
 
 if (!empty($_GET['removed'])) {
Index: admin/media.php
===================================================================
--- admin/media.php	(revision 557)
+++ admin/media.php	(revision 217)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -68,4 +68,5 @@
 	unset($post);
 }
+
 $d = isset($_REQUEST['d']) ? $_REQUEST['d'] : null;
 $dir = null;
@@ -222,5 +223,5 @@
 	call_user_func($open_f,__('Media manager'));
 	
-	echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.__('Media manager').' &rsaquo; <span class="page-title">'.__('confirm removal').'</span></h2>';
+	echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.__('Media manager').' &rsaquo; '.__('confirm removal').'</h2>';
 	
 	echo
@@ -228,6 +229,6 @@
 	'<p>'.sprintf(__('Are you sure you want to remove %s?'),
 	html::escapeHTML($_GET['remove'])).'</p>'.
-	'<p><input type="submit" value="'.__('Cancel').'" /> '.
-	' &nbsp; <input type="submit" name="rmyes" value="'.__('Yes').'" />'.
+	'<p><input type="submit" value="'.__('cancel').'" /> '.
+	' &nbsp; <input type="submit" name="rmyes" value="'.__('yes').'" />'.
 	form::hidden('d',$d).
 	$core->formNonce().
@@ -241,16 +242,7 @@
 /* DISPLAY Main page
 -------------------------------------------------------- */
-$core->auth->user_prefs->addWorkspace('interface');
-$user_ui_enhanceduploader = $core->auth->user_prefs->interface->enhanceduploader;
-
 call_user_func($open_f,__('Media manager'),
-	'<script type="text/javascript">'."\n".
-	"//<![CDATA["."\n".
-	dcPage::jsVar('dotclear.candyUpload_force_init',$user_ui_enhanceduploader)."\n".
-	"//]]>".
-	"</script>".
 	dcPage::jsLoad('js/_media.js').
-	(($user_ui_enhanceduploader && $core_media_writable) ? dcPage::jsCandyUpload(array('d='.$d)) : '')
-	);
+	($core_media_writable ? dcPage::jsCandyUpload(array('d='.$d)) : ''));
 
 if (!empty($_GET['mkdok'])) {
@@ -278,15 +270,6 @@
 }
 
-echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; ';
-if (!isset($core->media)) {
-	echo '<span class="page-title">'.__('Media manager').'</span></h2>';
-} else {
-	$breadcrumb = $core->media->breadCrumb(html::escapeURL($page_url).'&amp;d=%s','<span class="page-title">%s</span>');
-	if ($breadcrumb == '') {
-		echo '<span class="page-title">'.__('Media manager').'</span></h2>';
-	} else {
-		echo '<a href="'.html::escapeURL($page_url.'&d=').'">'.__('Media manager').'</a>'.' / '.$breadcrumb.'</h2>';
-	}
-}
+echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <a href="'.html::escapeURL($page_url.'&d=').'">'.__('Media manager').'</a>'.
+' / '.(isset($core->media) ? $core->media->breadCrumb(html::escapeURL($page_url).'&amp;d=%s') : '').'</h2>';
 
 if (!$dir) {
@@ -323,5 +306,5 @@
 	form::hidden(array('popup'),$popup).
 	form::hidden(array('post_id'),$post_id).
-	'<input type="submit" value="'.__('Sort').'" /></p>'.
+	'<input type="submit" value="'.__('ok').'" /></p>'.
 	'</form>'.
 	
@@ -344,20 +327,18 @@
 	
 	echo
-	'<div class="col">'.
-	'<fieldset id="add-file-f"><legend>'.__('Add files').'</legend>'.
-	'<p>'.__('Please take care to publish media that you own and that are not protected by copyright.').'</p>'.
+	'<div class="col"><h3 id="add-file">'.__('Add files').'</h3>'.
+	'<p class="form-note info">'.__('Please take care to publish media that you own and that are not protected by copyright.').'</p>'.
 	'<form id="media-upload" class="clear" action="'.html::escapeURL($page_url).'" method="post" enctype="multipart/form-data">'.
 	'<div>'.form::hidden(array('MAX_FILE_SIZE'),DC_MAX_UPLOAD_SIZE).
 	$core->formNonce().'</div>'.
+	'<fieldset id="add-file-f">'.
 	'<p><label for="upfile">'.__('Choose a file:').
 	' ('.sprintf(__('Maximum size %s'),files::size(DC_MAX_UPLOAD_SIZE)).')'.
 	'<input type="file" id="upfile" name="upfile" size="20" />'.
 	'</label></p>'.
-	'<p><label for="upfiletitle">'.__('Title:').form::field(array('upfiletitle','upfiletitle'),35,255).'</label></p>'.
-	'<p><label for="upfilepriv" class="classic">'.form::checkbox(array('upfilepriv','upfilepriv'),1).' '.
+	'<p><label for="upfiletitle">'.__('Title:').form::field(array('upfiletitle'),35,255).'</label></p>'.
+	'<p><label for="upfilepriv" class="classic">'.form::checkbox(array('upfilepriv'),1).' '.
 	__('Private').'</label></p>'.
-	'<p class="form-help info">'.__('To send several files at the same time, you can activate the enhanced uploader in').
-	'<a href="preferences.php?tab=user-options"> '.__('My preferences').'</a></p>'.
-	'<p><input type="submit" value="'.__('Send').'" />'.
+	'<p><input type="submit" value="'.__('send').'" />'.
 	form::hidden(array('d'),$d).'</p>'.
 	'</fieldset>'.
@@ -366,12 +347,11 @@
 	
 	echo
-	'<div class="col">'.
+	'<div class="col"><h3 id="new-dir">'.__('New directory').'</h3>'.
 	'<form class="clear" action="'.html::escapeURL($page_url).'" method="post">'.
 	'<fieldset id="new-dir-f">'.
-	'<legend>'.__('New directory').'</legend>'.
 	$core->formNonce().
 	'<p><label for="newdir">'.__('Directory Name:').
-	form::field(array('newdir','newdir'),35,255).'</label></p>'.
-	'<p><input type="submit" value="'.__('Create').'" />'.
+	form::field(array('newdir'),35,255).'</label></p>'.
+	'<p><input type="submit" value="'.__('Save').'" />'.
 	form::hidden(array('d'),html::escapeHTML($d)).'</p>'.
 	'</fieldset>'.
Index: admin/media_item.php
===================================================================
--- admin/media_item.php	(revision 557)
+++ admin/media_item.php	(revision 411)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -160,5 +160,6 @@
 if ($popup) {
 	$starting_scripts .=
-	dcPage::jsLoad('js/jsToolBar/popup_media.js');
+	dcPage::jsLoad('js/tiny_mce/tiny_mce_popup.js').
+	dcPage::jsLoad('js/tiny_mce/plugins/dcControls/js/popup_media.js');
 }
 call_user_func($open_f,__('Media manager'),
@@ -182,5 +183,5 @@
 echo '<h2><a href="'.html::escapeURL($media_page_url).'">'.__('Media manager').'</a>'.
 ' / '.$core->media->breadCrumb(html::escapeURL($media_page_url).'&amp;d=%s').
-'<span class="page-title">'.$file->basename.'</span></h2>';
+$file->basename.'</h2>';
 
 # Insertion popup
@@ -247,5 +248,4 @@
 		
 		echo '<h3>'.__('MP3 disposition').'</h3>'.
-		'<p class="message">'.__("Please note that you cannot insert mp3 files with visual editor.").'</p>';
 		
 		$i_align = array(
@@ -270,7 +270,4 @@
 	{
 		$media_type = 'flv';
-		
-		echo
-		'<p class="message">'.__("Please note that you cannot insert video files with visual editor.").'</p>';
 		
 		echo
@@ -309,6 +306,6 @@
 	
 	echo
-	'<p><a id="media-insert-cancel" class="button" href="#">'.__('Cancel').'</a> - '.
-	'<strong><a id="media-insert-ok" class="button" href="#">'.__('Insert').'</a></strong>'.
+	'<p><a id="media-insert-cancel" class="button cancel" href="#">'.__('cancel').'</a>'.
+	'<a id="media-insert-ok" class="button insert" href="#">'.__('insert').'</a>'.
 	form::hidden(array('type'),html::escapeHTML($media_type)).
 	form::hidden(array('title'),html::escapeHTML($file->media_title)).
@@ -394,9 +391,5 @@
 	if ($file->media_image)
 	{ # We look for thumbnails too
-		if (preg_match('#^http(s)?://#',$this->core->blog->settings->system->public_url)) {
-			$media_root = $core->blog->settings->system->public_url;
-		} else {
-			$media_root = $core->blog->host.path::clean($core->blog->settings->system->public_url).'/';
-		}
+		$media_root = $core->blog->host.path::clean($core->blog->settings->system->public_url).'/';
 		foreach ($file->media_thumb as $v) {
 			$v = preg_replace('/^'.preg_quote($media_root,'/').'/','',$v);
@@ -456,5 +449,5 @@
 		'<fieldset><legend>'.__('Update thumbnails').'</legend>'.
 		'<p>'.__('This will create or update thumbnails for this image.').'</p>'.
-		'<p><input type="submit" name="thumbs" value="'.__('Update thumbnails').'" />'.
+		'<p><input type="submit" name="thumbs" value="'.__('update thumbnails').'" />'.
 		form::hidden(array('id'),$id).
 		$core->formNonce().'</p>'.
@@ -480,5 +473,5 @@
 		'<p><label for="inflate_mode" class="classic">'.__('Extract mode:').' '.
 		form::combo('inflate_mode',$inflate_combo,'new').'</label> '.
-		'<input type="submit" name="unzip" value="'.__('Extract').'" />'.
+		'<input type="submit" name="unzip" value="'.__('extract').'" />'.
 		form::hidden(array('id'),$id).
 		$core->formNonce().'</p>'.
@@ -512,5 +505,5 @@
 	'<input type="file" id="upfile" name="upfile" size="35" />'.
 	'</label></p>'.
-	'<p><input type="submit" value="'.__('Send').'" />'.
+	'<p><input type="submit" value="'.__('send').'" />'.
 	form::hidden(array('id'),$id).
 	$core->formNonce().'</p>'.
Index: admin/permissions.php
===================================================================
--- admin/permissions.php	(revision 536)
+++ admin/permissions.php	(revision 217)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -98,5 +98,5 @@
 );
 
-echo '<h2><a href="users.php">'.__('Users').'</a> &rsaquo; <span class="page-title">'.__('Permissions').'</span></h2>';
+echo '<h2><a href="users.php">'.__('Users').'</a> &rsaquo; '.__('Permissions').'</h2>';
 
 if (!empty($_GET['upd'])) {
@@ -143,7 +143,7 @@
 	
 	echo
-	'<fieldset><legend>'.__('Validate permissions').'</legend>'.
+	'<fieldset>'.
 	'<p><label for="your_pwd">'.__('Your password:').
-	form::password('your_pwd',20,255).'</label></p>'.
+	form::password('your_pwd',20,255,'','',15).'</label></p>'.
 	'</fieldset>'.
 	'<p><input type="submit" accesskey="s" value="'.__('Save').'" />'.
Index: admin/permissions_blog.php
===================================================================
--- admin/permissions_blog.php	(revision 557)
+++ admin/permissions_blog.php	(revision 68)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -90,5 +90,5 @@
 dcPage::open(__('choose a blog'),$starting_script);
 
-echo '<h2><a href="users.php">'.__('Users').'</a> &rsaquo; <span class="page-title">'.__('Choose a blog').'</span></h2>';
+echo '<h2><a href="users.php">'.__('Users').'</a> &rsaquo; '.__('Choose a blog').'</h2>';
 
 if (!$core->error->flag())
@@ -165,5 +165,5 @@
 		'<p class="checkboxes-helpers"></p>'.
 		
-		'<p><input type="submit" value="'.__('Set permissions').'" />'.
+		'<p><input type="submit" value="'.__('set permissions').'" />'.
 		$hidden_fields.
 		$core->formNonce().'</p>'.
Index: admin/plugin.php
===================================================================
--- admin/plugin.php	(revision 500)
+++ admin/plugin.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -83,5 +83,5 @@
 	call_user_func($open_f,__('Plugin not found'));
 	
-	echo '<h2 class="page-title">'.__('Plugin not found').'</h2>';
+	echo '<h2>'.__('Plugin not found').'</h2>';
 	
 	echo '<p>'.__('The plugin you reached does not exist or does not have an admin page.').'</p>';
Index: admin/plugins.php
===================================================================
--- admin/plugins.php	(revision 500)
+++ admin/plugins.php	(revision 211)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -173,5 +173,5 @@
 
 echo
-'<h2 class="page-title">'.__('Plugins management').'</h2>';
+'<h2>'.__('Plugins management').'</h2>';
 
 if (!empty($_GET['removed'])) {
Index: admin/popup_link.php
===================================================================
--- admin/popup_link.php	(revision 500)
+++ admin/popup_link.php	(revision 411)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -15,11 +15,27 @@
 dcPage::check('usage,contentadmin');
 
-$href = !empty($_GET['href']) ? $_GET['href'] : '';
-$hreflang = !empty($_GET['hreflang']) ? $_GET['hreflang'] : '';
-$title = !empty($_GET['title']) ? $_GET['title'] : '';
+$href	= !empty($_GET['href']) ? $_GET['href'] : '';
+$hreflang	= !empty($_GET['hreflang']) ? $_GET['hreflang'] : '';
+$title	= !empty($_GET['title']) ? $_GET['title'] : '';
+$q		= !empty($_GET['q']) ? $_GET['q'] : null;
+$page	= !empty($_GET['page']) ? (integer) $_GET['page'] : 1;
+$nb_per_page = 10;
 
-dcPage::openPopup(__('Add a link'),dcPage::jsLoad('js/jsToolBar/popup_link.js'));
+$params = array();
+$params['limit'] = array((($page-1)*$nb_per_page),$nb_per_page);
+$params['no_content'] = true;
+$params['order'] = 'post_dt DESC';
 
-echo '<h2 class="page-title">'.__('Add a link').'</h2>';
+if ($q) {
+	$params['search'] = $q;
+}
+
+dcPage::openPopup(__('Add a link'),
+	dcPage::jsLoad('js/_posts_list.js').
+	dcPage::jsLoad('js/tiny_mce/tiny_mce_popup.js').
+	dcPage::jsLoad('js/tiny_mce/plugins/dcControls/js/popup_link.js')
+);
+
+echo '<h2>'.__('Add a link').'</h2>';
 
 # Languages combo
@@ -40,4 +56,5 @@
 echo
 '<form id="link-insert-form" action="#" method="get">'.
+'<h4>'.__('Enter a destination URL').'</h4>'.
 '<p><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Link URL:').' '.
 form::field('href',35,512,html::escapeHTML($href)).'</label></p>'.
@@ -47,9 +64,27 @@
 form::combo('hreflang',$lang_combo,$hreflang).
 '</label></p>'.
+'<p><a class="button cancel" href="#" id="link-insert-cancel">'.__('cancel').'</a>'.
+'<a class="button insert" href="#" id="link-insert-ok">'.__('insert').'</a></p>'."\n".
 
+'<div id="div-entries">'.
+'<h4>'.__('Or link to existing content').'</h4>'.
+'<p class="form-note">'.__('Click on a title to select the link').'</p>'.
+'<p><label for="q" class="classic">'.__('Search entry:').' '.form::field('q',30,255,html::escapeHTML($q)).'</label> '.
+' <input type="submit" value="'.__('ok').'" /></p>';
+
+try {
+	$posts = $core->blog->getPosts($params);
+	$counter = $core->blog->getPosts($params,true);
+	$post_list = new adminPostMiniList($core,$posts,$counter->f(0));
+} catch (Exception $e) {
+	$core->error->add($e->getMessage());
+}
+
+echo '<div id="form-entries">'; # I know it's not a form but we just need the ID
+$post_list->display($page,$nb_per_page);
+echo
+'</div>'.
+'</div>'.
 '</form>'.
-
-'<p><a class="button reset" href="#" id="link-insert-cancel">'.__('cancel').'</a> - '.
-'<strong><a class="button" href="#" id="link-insert-ok">'.__('insert').'</a></strong></p>'."\n".
 
 '<script type="text/javascript">'."\n".
@@ -60,3 +95,4 @@
 
 dcPage::closePopup();
+
 ?>
Index: admin/popup_posts.php
===================================================================
--- admin/popup_posts.php	(revision 557)
+++ 	(revision )
@@ -1,57 +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 -----------------------------------------
-
-require dirname(__FILE__).'/../inc/admin/prepend.php';
-
-dcPage::check('usage,contentadmin');
-
-$q = !empty($_GET['q']) ? $_GET['q'] : null;
-
-$page = !empty($_GET['page']) ? (integer) $_GET['page'] : 1;
-$nb_per_page =  10;
-
-$params = array();
-$params['limit'] = array((($page-1)*$nb_per_page),$nb_per_page);
-$params['no_content'] = true;
-$params['order'] = 'post_dt DESC';
-
-if ($q) {
-	$params['search'] = $q;
-}
-
-dcPage::openPopup(__('Add a link to an entry'),
-	dcPage::jsLoad('js/_posts_list.js').
-	dcPage::jsLoad('js/jsToolBar/popup_posts.js'));
-
-echo '<h2 class="page-title">'.__('Add a link to an entry').'</h2>';
-
-echo '<form action="popup_posts.php" method="get">'.
-'<p><label for="q" class="classic">'.__('Search entry:').' '.form::field('q',30,255,html::escapeHTML($q)).'</label> '.
-' <input type="submit" value="'.__('Search').'" /></p>'.
-'</form>';
-
-try {
-	$posts = $core->blog->getPosts($params);
-	$counter = $core->blog->getPosts($params,true);
-	$post_list = new adminPostMiniList($core,$posts,$counter->f(0));
-} catch (Exception $e) {
-	$core->error->add($e->getMessage());
-}
-
-echo '<div id="form-entries">'; # I know it's not a form but we just need the ID
-$post_list->display($page,$nb_per_page);
-echo '</div>';
-
-echo '<p><a class="button" href="#" id="link-insert-cancel">'.__('cancel').'</a></p>';
-
-dcPage::closePopup();
-?>
Index: admin/popup_web_media.php
===================================================================
--- admin/popup_web_media.php	(revision 411)
+++ admin/popup_web_media.php	(revision 411)
@@ -0,0 +1,85 @@
+<?php
+# -- BEGIN LICENSE BLOCK ---------------------------------------
+#
+# This file is part of Dotclear 2.
+#
+# Copyright (c) 2003-2010 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 -----------------------------------------
+
+require dirname(__FILE__).'/../inc/admin/prepend.php';
+
+dcPage::check('usage,contentadmin');
+
+dcPage::openPopup(__('Add a web media'),
+	dcPage::jsOEmbed().
+	dcPage::jsLoad('js/tiny_mce/tiny_mce_popup.js').
+	dcPage::jsLoad('js/tiny_mce/plugins/dcControls/js/popup_web_media.js')
+);
+
+$align = array(
+	'none' => array(__('None'),1),
+	'left' => array(__('Left'),0),
+	'right' => array(__('Right'),0),
+	'center' => array(__('Center'),0)
+);
+$v_insert = array(
+	'media' => array(__('Full media'),1),
+	'thumbnail' => array(__('Media thumbnail'),0),
+	'link' => array(__('Media link'),0),
+);
+
+echo
+'<h2>'.__('Add a web media').'</h2>'.
+
+'<p class="error" style="display: none;"></p>'.
+'<form id="video-insert-form" action="#" method="get">'.
+'<p><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Source URL:').'</label>'.
+form::field('src',65,512,'').'&nbsp;'.
+'<a class="button" href="#" id="webmedia-insert-search">'.__('preview').'</a>'.
+'<a class="button insert" href="#" id="webmedia-insert-ok">'.__('insert').'</a>'.
+'<a class="button cancel" href="#" id="webmedia-insert-cancel">'.__('cancel').'</a></p>'.
+
+'<div class="two-cols" style="display:none;"><div class="col">'.
+'<p><label class="required"><abbr title="'.__('Width').'">*</abbr> '.__('Width:').'</label>'.
+form::field('width',35,4,'').'</p>'.
+'<p><label class="required"><abbr title="'.__('Height').'">*</abbr> '.__('Height:').'</label>'.
+form::field('height',35,4,'').'</label></p>'.
+'<p><label for="alt">'.__('Alternative text:').' '.
+form::field('alt',35,512,'').'</label></p>'.
+'<p><label for="title">'.__('Title:').' '.
+form::field('title',35,512,'').'</label></p>'.
+'<p><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Insertion').' '.
+'</label></p>'.
+'<p>';
+foreach ($v_insert as $k => $v) {
+	echo '<label class="classic">'.
+	form::radio(array('insertion'),$k,$v[1]).' '.$v[0].'</label><br /> ';
+}
+echo
+'</p>'.
+'<p><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Alignment').' '.
+'</label></p>'.
+'<p>';
+foreach ($align as $k => $v) {
+	echo '<label class="classic">'.
+	form::radio(array('alignment'),$k,$v[1]).' '.$v[0].'</label><br /> ';
+}
+echo
+'</p>'."\n".
+'</div><div class="col preview">'.
+'</div></div>'.
+'</form>'.
+
+'<script type="text/javascript">'."\n".
+'//<![CDATA['."\n".
+'$(\'input[name="src"]\').get(0).focus();'."\n".
+'//]]>'."\n".
+'</script>'."\n";
+
+dcPage::closePopup();
+
+?>
Index: admin/post.php
===================================================================
--- admin/post.php	(revision 559)
+++ admin/post.php	(revision 219)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -33,4 +33,6 @@
 $post_open_tb = $core->blog->settings->system->allow_trackbacks;
 
+$post_media = array();
+
 $page_title = __('New entry');
 
@@ -144,4 +146,5 @@
 		try {
 			$core->media = new dcMedia($core);
+			$post_media = $core->media->getPostMedia($post_id);
 		} catch (Exception $e) {}
 	}
@@ -314,5 +317,4 @@
 	$post_excerpt = $post_excerpt_xhtml;
 	$post_content = $post_content_xhtml;
-	$post_title = $post_title_xhtml;
 	$post_format = 'xhtml';
 	
@@ -320,14 +322,19 @@
 }
 
-echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.'<a href="posts.php">'.__('Entries').'</a> &rsaquo; <span class="page-title">'.$page_title;
-
-	if ($post_id) {
-		echo ' &ldquo;'.$post_title.'&rdquo;';
-	}
-echo	'</span></h2>';
+echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.'<a href="posts.php">'.__('Entries').'</a> &rsaquo; '.$page_title;
 
 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>';
-}
+	echo ' - <a id="post-preview" href="'.$post->getURL().'" class="button">'.__('View entry').'</a>';
+} elseif ($post_id) {
+	$preview_url =
+	$core->blog->url.$core->url->getBase('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 entry').'</a>';
+}
+
+echo '</h2>';
+
 if ($post_id)
 {
@@ -356,88 +363,43 @@
 	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->getBase('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').
+	form::combo('cat_id',$categories_combo,$cat_id,'maximal',3).
 	'</label></p>'.
 	
 	'<p><label for="post_status">'.__('Entry status:').
-	form::combo('post_status',$status_combo,$post_status,'','',!$can_publish).
+	form::combo('post_status',$status_combo,$post_status,'',3,!$can_publish).
 	'</label></p>'.
 	
 	'<p><label for="post_dt">'.__('Published on:').
-	form::field('post_dt',16,16,$post_dt).
+	form::field('post_dt',16,16,$post_dt,'',3).
 	'</label></p>'.
 	
 	'<p><label for="post_format">'.__('Text formating:').
-	form::combo('post_format',$formaters_combo,$post_format).
+	form::combo('post_format',$formaters_combo,$post_format,'',3).
 	'</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).' '.
+	'<p><label for="post_open_comment" class="classic">'.form::checkbox('post_open_comment',1,$post_open_comment,'',3).' '.
 	__('Accept comments').'</label></p>'.
-	'<p><label for="post_open_tb" class="classic">'.form::checkbox('post_open_tb',1,$post_open_tb).' '.
+	'<p><label for="post_open_tb" class="classic">'.form::checkbox('post_open_tb',1,$post_open_tb,'',3).' '.
 	__('Accept trackbacks').'</label></p>'.
-	'<p><label for="post_selected" class="classic">'.form::checkbox('post_selected',1,$post_selected).' '.
+	'<p><label for="post_selected" class="classic">'.form::checkbox('post_selected',1,$post_selected,'',3).' '.
 	__('Selected entry').'</label></p>'.
 	
 	'<p><label for="post_lang">'.__('Entry lang:').
-	form::combo('post_lang',$lang_combo,$post_lang).
+	form::combo('post_lang',$lang_combo,$post_lang,'',5).
 	'</label></p>'.
 	
 	'<p><label for="post_password">'.__('Entry password:').
-	form::field('post_password',10,32,html::escapeHTML($post_password),'maximal').
+	form::field('post_password',10,32,html::escapeHTML($post_password),'maximal',3).
 	'</label></p>'.
 	
 	'<div class="lockable">'.
 	'<p><label for="post_url">'.__('Basename:').
-	form::field('post_url',10,255,html::escapeHTML($post_url),'maximal').
+	form::field('post_url',10,255,html::escapeHTML($post_url),'maximal',3).
 	'</label></p>'.
 	'<p class="form-note warn">'.
@@ -446,14 +408,80 @@
 	'</div>';
 	
+	if ($post_id)
+	{
+		echo
+		'<h3 class="clear">'.__('Attachments').'</h3>';
+		foreach ($post_media as $f)
+		{
+			$ftitle = $f->media_title;
+			if (strlen($ftitle) > 18) {
+				$ftitle = substr($ftitle,0,16).'...';
+			}
+			echo
+			'<div class="media-item">'.
+			'<a class="media-icon" href="media_item.php?id='.$f->media_id.'">'.
+			'<img src="'.$f->media_icon.'" alt="" title="'.$f->basename.'" /></a>'.
+			'<ul>'.
+			'<li><a class="media-link" href="media_item.php?id='.$f->media_id.'"'.
+			'title="'.$f->basename.'">'.$ftitle.'</a></li>'.
+			'<li>'.$f->media_dtstr.'</li>'.
+			'<li>'.files::size($f->size).' - '.
+			'<a href="'.$f->file_url.'">'.__('open').'</a>'.'</li>'.
+			
+			'<li class="media-action"><a class="attachment-remove" id="attachment-'.$f->media_id.'" '.
+			'href="post_media.php?post_id='.$post_id.'&amp;media_id='.$f->media_id.'&amp;remove=1">'.
+			'<img src="images/check-off.png" alt="'.__('remove').'" /></a>'.
+			'</li>'.
+			
+			'</ul>'.
+			'</div>';
+		}
+		unset($f);
+		
+		if (empty($post_media)) {
+			echo '<p>'.__('No attachment.').'</p>';
+		}
+		echo '<p><a class="button" href="media.php?post_id='.$post_id.'">'.__('Add files to this entry').'</a></p>';
+	}
+	
 	# --BEHAVIOR-- adminPostFormSidebar
 	$core->callBehavior('adminPostFormSidebar',isset($post) ? $post : null);
 	
 	echo '</div>';		// End #entry-sidebar
-
+	
+	echo '<div id="entry-content"><fieldset 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',2).
+	'</label></p>'.
+	
+	'<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:').'</label> '.
+	form::textarea('post_excerpt',50,5,html::escapeHTML($post_excerpt),'',2).
+	'</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),'',2).
+	'</p>'.
+	
+	'<p class="area" id="notes-area"><label for="post_notes">'.__('Notes:').'</label>'.
+	form::textarea('post_notes',50,5,html::escapeHTML($post_notes),'',2).
+	'</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)" tabindex="4" '.
+	'accesskey="s" name="save" /> '.
+	($can_delete ? '<input type="submit" class="delete" value="'.__('Delete').'" name="delete" />' : '').
+	$core->formNonce().
+	'</p>';
+	
+	echo '</fieldset></div>';		// End #entry-content
 	echo '</form>';
-	
-	# --BEHAVIOR-- adminPostForm
-	$core->callBehavior('adminPostAfterForm',isset($post) ? $post : null);
-	
 	echo '</div>';
 	
@@ -463,4 +491,13 @@
 	}
 	
+	if ($post_id && !empty($post_media))
+	{
+		echo
+		'<form action="post_media.php" id="attachment-remove-hide" method="post">'.
+		'<div>'.form::hidden(array('post_id'),$post_id).
+		form::hidden(array('media_id'),'').
+		form::hidden(array('remove'),1).
+		$core->formNonce().'</div></form>';
+	}
 }
 
@@ -489,7 +526,4 @@
 		$combo_action[__('delete')] = 'delete';
 	}
-	
-	# --BEHAVIOR-- adminCommentsActionsCombo
-	$core->callBehavior('adminCommentsActionsCombo',array(&$combo_action));
 	
 	$has_action = !empty($combo_action) && (!$trackbacks->isEmpty() || !$comments->isEmpty());
@@ -543,5 +577,5 @@
 	
 	'<form action="comment.php" method="post" id="comment-form">'.
-	'<div class="constrained">'.
+	'<fieldset 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'))).
@@ -564,5 +598,5 @@
 	$core->formNonce().
 	'<input type="submit" name="add" value="'.__('Save').'" /></p>'.
-	'</div>'.
+	'</fieldset>'.
 	'</form>'.
 	'</div>';
Index: admin/post_media.php
===================================================================
--- admin/post_media.php	(revision 557)
+++ admin/post_media.php	(revision 70)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -61,11 +61,11 @@
 		dcPage::open(__('Remove attachment'));
 		
-		echo '<h2>'.__('Attachment').' &rsaquo; <span class="page-title">'.__('confirm removal').'</span></h2>';
+		echo '<h2>'.__('Attachment').' &rsaquo; '.__('confirm removal').'</h2>';
 		
 		echo
 		'<form action="post_media.php" method="post">'.
 		'<p>'.__('Are you sure you want to remove this attachment?').'</p>'.
-		'<p><input type="submit" class="reset" value="'.__('Cancel').'" /> '.
-		' &nbsp; <input type="submit" class="delete" name="remove" value="'.__('Yes').'" />'.
+		'<p><input type="submit" class="reset" value="'.__('cancel').'" /> '.
+		' &nbsp; <input type="submit" class="delete" name="remove" value="'.__('yes').'" />'.
 		form::hidden('post_id',$post_id).
 		form::hidden('media_id',$media_id).
Index: admin/posts.php
===================================================================
--- admin/posts.php	(revision 500)
+++ admin/posts.php	(revision 276)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -48,5 +48,4 @@
 	# Filter form we'll put in html_block
 	$users_combo = $categories_combo = array();
-	$users_combo['-'] = $categories_combo['-'] = '';
 	while ($users->fetch())
 	{
@@ -63,5 +62,5 @@
 	$categories_combo[__('None')] = 'NULL';
 	while ($categories->fetch()) {
-		$categories_combo[str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').
+		$categories_combo[str_repeat('&nbsp;&nbsp;',$categories->level-1).'&bull; '.
 			html::escapeHTML($categories->cat_title).
 			' ('.$categories->nb_post.')'] = $categories->cat_id;
@@ -69,5 +68,4 @@
 	
 	$status_combo = array(
-	'-' => ''
 	);
 	foreach ($core->blog->getAllPostStatus() as $k => $v) {
@@ -76,5 +74,4 @@
 	
 	$selected_combo = array(
-	'-' => '',
 	__('selected') => '1',
 	__('not selected') => '0'
@@ -82,10 +79,8 @@
 	
 	# Months array
-	$dt_m_combo['-'] = '';
 	while ($dates->fetch()) {
 		$dt_m_combo[dt::str('%B %Y',$dates->ts())] = $dates->year().$dates->month();
 	}
 	
-	$lang_combo['-'] = '';
 	while ($langs->fetch()) {
 		$lang_combo[$langs->post_lang] = $langs->post_lang;
@@ -138,15 +133,4 @@
 /* Get posts
 -------------------------------------------------------- */
-$user_id = !empty($_GET['user_id']) ?	$_GET['user_id'] : '';
-$cat_id = !empty($_GET['cat_id']) ?	$_GET['cat_id'] : '';
-$status = isset($_GET['status']) ?	$_GET['status'] : '';
-$selected = isset($_GET['selected']) ?	$_GET['selected'] : '';
-$month = !empty($_GET['month']) ?		$_GET['month'] : '';
-$lang = !empty($_GET['lang']) ?		$_GET['lang'] : '';
-$sortby = !empty($_GET['sortby']) ?	$_GET['sortby'] : 'post_dt';
-$order = !empty($_GET['order']) ?		$_GET['order'] : 'desc';
-
-$show_filters = false;
-
 $page = !empty($_GET['page']) ? (integer) $_GET['page'] : 1;
 $nb_per_page =  30;
@@ -159,70 +143,55 @@
 }
 
+$params = new ArrayObject();
 $params['limit'] = array((($page-1)*$nb_per_page),$nb_per_page);
 $params['no_content'] = true;
 
-# - User filter
-if ($user_id !== '' && in_array($user_id,$users_combo)) {
-	$params['user_id'] = $user_id;
-	$show_filters = true;
-}
-
-# - Categories filter
-if ($cat_id !== '' && in_array($cat_id,$categories_combo)) {
-	$params['cat_id'] = $cat_id;
-	$show_filters = true;
-}
-
-# - Status filter
-if ($status !== '' && in_array($status,$status_combo)) {
-	$params['post_status'] = $status;
-	$show_filters = true;
-}
-
-# - Selected filter
-if ($selected !== '' && in_array($selected,$selected_combo)) {
-	$params['post_selected'] = $selected;
-	$show_filters = true;
-}
-
-# - Month filter
-if ($month !== '' && in_array($month,$dt_m_combo)) {
-	$params['post_month'] = substr($month,4,2);
-	$params['post_year'] = substr($month,0,4);
-	$show_filters = true;
-}
-
-# - Lang filter
-if ($lang !== '' && in_array($lang,$lang_combo)) {
-	$params['post_lang'] = $lang;
-	$show_filters = true;
-}
-
-# - Sortby and order filter
-if ($sortby !== '' && in_array($sortby,$sortby_combo)) {
-	if ($order !== '' && in_array($order,$order_combo)) {
-		$params['order'] = $sortby.' '.$order;
-	}
-	
-	if ($sortby != 'post_dt' || $order != 'desc') {
-		$show_filters = true;
-	}
-}
+$filterSet = new dcFilterSet('posts.php');
+class monthComboFilter extends comboFilter {
+	public function applyFilter($params) {
+		$month=$this->values[0];
+		$params['post_month'] = substr($month,4,2);
+		$params['post_year'] = substr($month,0,4);
+	}
+}
+$filterSet
+	->addFilter(new comboFilter(
+		'users',__('Author'), 'user', $users_combo))
+	->addFilter(new comboFilter(
+		'category',__('Category'), 'cat_id', $categories_combo))
+	->addFilter(new comboFilter(
+		'post_status',__('Status'), 'post_status', $status_combo,array('singleval' => 1)))
+	->addFilter(new comboFilter(
+		'post_selected',__('Selected'), 'post_selected', $selected_combo))
+	->addFilter(new comboFilter(
+		'lang',__('Lang'), 'post_lang', $lang_combo))
+	->addFilter(new monthComboFilter(
+		'month',__('Month'), 'post_month', $dt_m_combo,array('singleval' => 1)));
+$filterSet->setValues($_GET);
 
 # Get posts
 try {
+	$nfparams = $params->getArrayCopy();
+	$filtered = $filterSet->applyFilters($params);
 	$posts = $core->blog->getPosts($params);
 	$counter = $core->blog->getPosts($params,true);
+	if ($filtered) {
+		$totalcounter = $core->blog->getPosts($nfparams,true);
+		$page_title = sprintf(__('Entries / %s filtered out of %s'),$counter->f(0),$totalcounter->f(0));
+	} else {
+		$page_title = __('Entries');
+	}
 	$post_list = new adminPostList($core,$posts,$counter->f(0));
 } catch (Exception $e) {
 	$core->error->add($e->getMessage());
 }
+
+$filterSet->setColumnsForm($post_list->getColumnsForm());
 
 /* DISPLAY
 -------------------------------------------------------- */
 $starting_script = dcPage::jsLoad('js/_posts_list.js');
-if (!$show_filters) {
-	$starting_script .= dcPage::jsLoad('js/filter-controls.js');
-}
+
+$starting_script .= $filterSet->header();
 
 dcPage::open(__('Entries'),$starting_script);
@@ -231,48 +200,9 @@
 {
 	echo 
-	'<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Entries').'</span></h2>'.
+	'<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.$page_title.'</h2>'.
 	'<p class="top-add"><a class="button add" href="post.php">'.__('New entry').'</a></p>';
-	
-	if (!$show_filters) {
-		echo '<p><a id="filter-control" class="form-control" href="#">'.
-		__('Filters').'</a></p>';
-	}
-	
-	echo
-	'<form action="posts.php" method="get" id="filters-form">'.
-	'<fieldset><legend>'.__('Filters').'</legend>'.
-	'<div class="three-cols">'.
-	'<div class="col">'.
-	'<label for="user_id">'.__('Author:').
-	form::combo('user_id',$users_combo,$user_id).'</label> '.
-	'<label for="cat_id">'.__('Category:').
-	form::combo('cat_id',$categories_combo,$cat_id).'</label> '.
-	'<label for="status">'.__('Status:').
-	form::combo('status',$status_combo,$status).'</label> '.
-	'</div>'.
-	
-	'<div class="col">'.
-	'<label for="selected">'.__('Selected:').
-	form::combo('selected',$selected_combo,$selected).'</label> '.
-	'<label for="month">'.__('Month:').
-	form::combo('month',$dt_m_combo,$month).'</label> '.
-	'<label for="lang">'.__('Lang:').
-	form::combo('lang',$lang_combo,$lang).'</label> '.
-	'</div>'.
-	
-	'<div class="col">'.
-	'<p><label for="sortby">'.__('Order by:').
-	form::combo('sortby',$sortby_combo,$sortby).'</label> '.
-	'<label for="order">'.__('Sort:').
-	form::combo('order',$order_combo,$order).'</label></p>'.
-	'<p><label for="nb" class="classic">'.	form::field('nb',3,3,$nb_per_page).' '.
-	__('Entries per page').'</label></p> '.
-	'<p><input type="submit" value="'.__('Apply filters').'" /></p>'.
-	'</div>'.
-	'</div>'.
-	'<br class="clear" />'. //Opera sucks
-	'</fieldset>'.
-	'</form>';
-	
+
+	$filterSet->display();
+
 	# Show posts
 	$post_list->display($page,$nb_per_page,
@@ -287,14 +217,5 @@
 	form::combo('action',$combo_action).
 	'<input type="submit" value="'.__('ok').'" /></p>'.
-	form::hidden(array('user_id'),$user_id).
-	form::hidden(array('cat_id'),$cat_id).
-	form::hidden(array('status'),$status).
-	form::hidden(array('selected'),$selected).
-	form::hidden(array('month'),$month).
-	form::hidden(array('lang'),$lang).
-	form::hidden(array('sortby'),$sortby).
-	form::hidden(array('order'),$order).
-	form::hidden(array('page'),$page).
-	form::hidden(array('nb'),$nb_per_page).
+	$filterSet->getFormFieldsAsHidden().
 	$core->formNonce().
 	'</div>'.
Index: admin/posts_actions.php
===================================================================
--- admin/posts_actions.php	(revision 500)
+++ admin/posts_actions.php	(revision 217)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -207,5 +207,5 @@
 if ($action == 'category')
 {
-	echo '<h2 class="page-title">'.__('Change category for entries').'</h2>';
+	echo '<h2>'.__('Change category for entries').'</h2>';
 	
 	# categories list
@@ -216,6 +216,5 @@
 		while ($categories->fetch()) {
 			$categories_combo[] = new formSelectOption(
-				str_repeat('&nbsp;&nbsp;',$categories->level-1).
-				($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title),
+				str_repeat('&nbsp;&nbsp;',$categories->level-1).'&bull; '.html::escapeHTML($categories->cat_title),
 				$categories->cat_id
 			);
@@ -238,5 +237,5 @@
 elseif ($action == 'author' && $core->auth->check('admin',$core->blog->id))
 {
-	echo '<h2 class="page-title">'.__('Change author for entries').'</h2>';
+	echo '<h2>'.__('Change author for entries').'</h2>';
 	
 	echo
Index: admin/preferences.php
===================================================================
--- admin/preferences.php	(revision 590)
+++ admin/preferences.php	(revision 190)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -34,22 +34,12 @@
 
 $core->auth->user_prefs->addWorkspace('accessibility');
-$user_acc_nodragdrop = $core->auth->user_prefs->accessibility->nodragdrop;
-
-$core->auth->user_prefs->addWorkspace('interface');
-$user_ui_enhanceduploader = $core->auth->user_prefs->interface->enhanceduploader;
-if ($core->auth->isSuperAdmin()) {
-	$user_ui_hide_std_favicon = $core->auth->user_prefs->interface->hide_std_favicon;
-}
-
-$default_tab = !empty($_GET['tab']) ? html::escapeHTML($_GET['tab']) : 'user-profile';
-
-if (!empty($_GET['append']) || !empty($_GET['removed']) || !empty($_GET['neworder']) || 
-	!empty($_GET['replaced']) || !empty($_POST['appendaction']) || !empty($_POST['removeaction'])) {
+$user_dm_nodragdrop = $core->auth->user_prefs->accessibility->nodragdrop;
+
+$default_tab = 'user-profile';
+
+if (!empty($_GET['append']) || !empty($_GET['removed']) || !empty($_GET['neworder']) || !empty($_GET['replaced'])) {
 	$default_tab = 'user-favorites';
 } elseif (!empty($_GET['updated'])) {
 	$default_tab = 'user-options';
-}
-if (($default_tab != 'user-profile') && ($default_tab != 'user-options') && ($default_tab != 'user-favorites')) {
-	$default_tab = 'user-profile';
 }
 
@@ -123,6 +113,5 @@
 
 # Update user options
-if (isset($_POST['user_post_format'])) 
-{
+if (isset($_POST['user_post_format'])) {
 	try
 	{
@@ -155,10 +144,5 @@
 		$core->auth->user_prefs->dashboard->put('dcnews',!empty($_POST['user_dm_dcnews']),'boolean');
 		$core->auth->user_prefs->dashboard->put('quickentry',!empty($_POST['user_dm_quickentry']),'boolean');
-		$core->auth->user_prefs->accessibility->put('nodragdrop',!empty($_POST['user_acc_nodragdrop']),'boolean');
-		$core->auth->user_prefs->interface->put('enhanceduploader',!empty($_POST['user_ui_enhanceduploader']),'boolean');
-		if ($core->auth->isSuperAdmin()) {
-			# Applied to all users
-			$core->auth->user_prefs->interface->put('hide_std_favicon',!empty($_POST['user_ui_hide_std_favicon']),'boolean',null,true,true);
-		}
+		$core->auth->user_prefs->accessibility->put('nodragdrop',!empty($_POST['user_dm_nodragdrop']),'boolean');
 		
 		# Udate user
@@ -177,75 +161,23 @@
 
 # Add selected favorites
-if (!empty($_POST['appendaction'])) 
-{
-	try {
-		if (empty($_POST['append'])) {
-			throw new Exception(__('No favorite selected'));
-		}
-
-		$ws = $core->auth->user_prefs->addWorkspace('favorites');
-		$user_favs = $ws->DumpLocalPrefs();
-		$count = count($user_favs);
-		foreach ($_POST['append'] as $k => $v)
-		{
-			try {
-				$found = false;
-				foreach ($user_favs as $f) {
-					$f = unserialize($f['value']);
-					if ($f['name'] == $v) {
-						$found = true;
-						break;
-					}
+if (!empty($_POST['appendaction']) && !empty($_POST['append'])) {
+	$ws = $core->auth->user_prefs->addWorkspace('favorites');
+	$user_favs = $ws->DumpLocalPrefs();
+	$count = count($user_favs);
+	foreach ($_POST['append'] as $k => $v)
+	{
+		try {
+			$found = false;
+			foreach ($user_favs as $f) {
+				$f = unserialize($f['value']);
+				if ($f['name'] == $v) {
+					$found = true;
+					break;
 				}
-				if (!$found) {
-					$uid = sprintf("u%03s",$count);
-					$fav = array('name' => $_fav[$v][0],'title' => $_fav[$v][1],'url' => $_fav[$v][2],'small-icon' => $_fav[$v][3],
-						'large-icon' => $_fav[$v][4],'permissions' => $_fav[$v][5],'id' => $_fav[$v][6],'class' => $_fav[$v][7]);
-					$core->auth->user_prefs->favorites->put($uid,serialize($fav),'string');
-					$count++;
-				}
-			} catch (Exception $e) {
-				$core->error->add($e->getMessage());
-				break;
 			}
-		}
-	
-		if (!$core->error->flag()) {
-			http::redirect('preferences.php?append=1');
-		}
-	} catch (Exception $e) {
-		$core->error->add($e->getMessage());
-	}
-}
-
-# Delete selected favorites
-if (!empty($_POST['removeaction']))
-{
-	try {
-		if (empty($_POST['remove'])) {
-			throw new Exception(__('No favorite selected'));
-		}
-		
-		$ws = $core->auth->user_prefs->addWorkspace('favorites');
-		foreach ($_POST['remove'] as $k => $v)
-		{
-			try {
-				$core->auth->user_prefs->favorites->drop($v);
-			} catch (Exception $e) {
-				$core->error->add($e->getMessage());
-				break;
-			}
-		}
-		// Update pref_id values
-		try {
-			$user_favs = $ws->DumpLocalPrefs();
-			$core->auth->user_prefs->favorites->dropAll();
-			$count = 0;
-			foreach ($user_favs as $k => $v)
-			{
+			if (!$found) {
 				$uid = sprintf("u%03s",$count);
-				$f = unserialize($v['value']);
-				$fav = array('name' => $f['name'],'title' => $f['title'],'url' => $f['url'],'small-icon' => $f['small-icon'],
-					'large-icon' => $f['large-icon'],'permissions' => $f['permissions'],'id' => $f['id'],'class' => $f['class']);
+				$fav = array('name' => $_fav[$v][0],'title' => $_fav[$v][1],'url' => $_fav[$v][2],'small-icon' => $_fav[$v][3],
+					'large-icon' => $_fav[$v][4],'permissions' => $_fav[$v][5],'id' => $_fav[$v][6],'class' => $_fav[$v][7]);
 				$core->auth->user_prefs->favorites->put($uid,serialize($fav),'string');
 				$count++;
@@ -253,11 +185,45 @@
 		} catch (Exception $e) {
 			$core->error->add($e->getMessage());
-		}
+			break;
+		}
+	}
 	
-		if (!$core->error->flag()) {
-			http::redirect('preferences.php?removed=1');
+	if (!$core->error->flag()) {
+		http::redirect('preferences.php?append=1');
+	}
+}
+
+# Delete selected favorites
+if (!empty($_POST['removeaction']) && !empty($_POST['remove'])) {
+	$ws = $core->auth->user_prefs->addWorkspace('favorites');
+	foreach ($_POST['remove'] as $k => $v)
+	{
+		try {
+			$core->auth->user_prefs->favorites->drop($v);
+		} catch (Exception $e) {
+			$core->error->add($e->getMessage());
+			break;
+		}
+	}
+	// Update pref_id values
+	try {
+		$user_favs = $ws->DumpLocalPrefs();
+		$core->auth->user_prefs->favorites->dropAll();
+		$count = 0;
+		foreach ($user_favs as $k => $v)
+		{
+			$uid = sprintf("u%03s",$count);
+			$f = unserialize($v['value']);
+			$fav = array('name' => $f['name'],'title' => $f['title'],'url' => $f['url'],'small-icon' => $f['small-icon'],
+				'large-icon' => $f['large-icon'],'permissions' => $f['permissions'],'id' => $f['id'],'class' => $f['class']);
+			$core->auth->user_prefs->favorites->put($uid,serialize($fav),'string');
+			$count++;
 		}
 	} catch (Exception $e) {
 		$core->error->add($e->getMessage());
+	}
+	
+	if (!$core->error->flag()) {
+		http::redirect('preferences.php?removed=1');
 	}
 }
@@ -326,5 +292,5 @@
 dcPage::open($page_title,
 	dcPage::jsLoad('js/_preferences.js').
-	($user_acc_nodragdrop ? '' : dcPage::jsLoad('js/_preferences-dragdrop.js')).
+	($user_dm_nodragdrop ? '' : dcPage::jsLoad('js/_preferences-dragdrop.js')).
 	dcPage::jsLoad('js/jquery/jquery-ui-1.8.12.custom.min.js').
 	dcPage::jsPageTabs($default_tab).
@@ -354,5 +320,5 @@
 }
 
-echo '<h2 class="page-title">'.$page_title.'</h2>';
+echo '<h2>'.$page_title.'</h2>';
 
 # User profile
@@ -365,17 +331,17 @@
 '<div class="col">'.
 '<p><label for="user_name">'.__('Last Name:').
-form::field('user_name',20,255,html::escapeHTML($user_name)).'</label></p>'.
+form::field('user_name',20,255,html::escapeHTML($user_name),'',2).'</label></p>'.
 
 '<p><label for="user_firstname">'.__('First Name:').
-form::field('user_firstname',20,255,html::escapeHTML($user_firstname)).'</label></p>'.
+form::field('user_firstname',20,255,html::escapeHTML($user_firstname),'',3).'</label></p>'.
 
 '<p><label for="user_displayname">'.__('Display name:').
-form::field('user_displayname',20,255,html::escapeHTML($user_displayname)).'</label></p>'.
+form::field('user_displayname',20,255,html::escapeHTML($user_displayname),'',4).'</label></p>'.
 
 '<p><label for="user_email">'.__('Email:').
-form::field('user_email',20,255,html::escapeHTML($user_email)).'</label></p>'.
+form::field('user_email',20,255,html::escapeHTML($user_email),'',5).'</label></p>'.
 
 '<p><label for="user_url">'.__('URL:').
-form::field('user_url',30,255,html::escapeHTML($user_url)).'</label></p>'.
+form::field('user_url',30,255,html::escapeHTML($user_url),'',6).'</label></p>'.
 
 '</div>'.
@@ -384,8 +350,8 @@
 
 '<p><label for="user_lang">'.__('User language:').
-form::combo('user_lang',$lang_combo,$user_lang,'l10n').'</label></p>'.
+form::combo('user_lang',$lang_combo,$user_lang,'l10n',10).'</label></p>'.
 
 '<p><label for="user_tz">'.__('User timezone:').
-form::combo('user_tz',dt::getZones(true,true),$user_tz).'</label></p>'.
+form::combo('user_tz',dt::getZones(true,true),$user_tz,'',11).'</label></p>'.
 
 '</div>'.
@@ -401,13 +367,15 @@
 	
 	'<p><label for="new_pwd">'.__('New password:').
-	form::password('new_pwd',20,255).'</label></p>'.
+	form::password('new_pwd',20,255,'','',30).'</label></p>'.
 	
 	'<p><label for="new_pwd_c">'.__('Confirm password:').
-	form::password('new_pwd_c',20,255).'</label></p>'.
+	form::password('new_pwd_c',20,255,'','',31).'</label></p>'.
 	'</fieldset>'.
 	
-	'<p>'.__('If you have changed this user email or password you must provide your current password to save these modifications.').'</p>'.
+	'<fieldset>'.
+	'<p>'.__('If you want to change your email or password you must provide your current password.').'</p>'.
 	'<p><label for="cur_pwd">'.__('Your password:').
-	form::password('cur_pwd',20,255).'</label></p>';
+	form::password('cur_pwd',20,255,'','',32).'</label></p>'.
+	'</fieldset>';
 }
 
@@ -415,5 +383,5 @@
 '<p class="clear">'.
 $core->formNonce().
-'<input type="submit" accesskey="s" value="'.__('Save').'" /></p>'.
+'<input type="submit" accesskey="s" value="'.__('Save').'" tabindex="33" /></p>'.
 '</form>';
 
@@ -428,29 +396,15 @@
 
 '<p><label for="user_post_format">'.__('Preferred format:').
-form::combo('user_post_format',$formaters_combo,$user_options['post_format']).'</label></p>'.
+form::combo('user_post_format',$formaters_combo,$user_options['post_format'],'',7).'</label></p>'.
 
 '<p><label for="user_post_status">'.__('Default entry status:').
-form::combo('user_post_status',$status_combo,$user_post_status).'</label></p>'.
+form::combo('user_post_status',$status_combo,$user_post_status,'',8).'</label></p>'.
 
 '<p><label for="user_edit_size">'.__('Entry edit field height:').
-form::field('user_edit_size',5,4,(integer) $user_options['edit_size']).'</label></p>'.
+form::field('user_edit_size',5,4,(integer) $user_options['edit_size'],'',9).'</label></p>'.
 
 '<p><label for="user_wysiwyg" class="classic">'.
-form::checkbox('user_wysiwyg',1,$user_options['enable_wysiwyg']).' '.
+form::checkbox('user_wysiwyg',1,$user_options['enable_wysiwyg'],'',12).' '.
 __('Enable WYSIWYG mode').'</label></p>'.
-
-'<p><label for="user_ui_enhanceduploader" class="classic">'.
-form::checkbox('user_ui_enhanceduploader',1,$user_ui_enhanceduploader).' '.
-__('Activate enhanced uploader in media manager').'</label></p>';
-
-if ($core->auth->isSuperAdmin()) {
-	echo
-	'<p><label for="user_ui_hide_std_favicon" class="classic">'.
-	form::checkbox('user_ui_hide_std_favicon',1,$user_ui_hide_std_favicon).' '.
-	__('Do not use standard favicon').'</label></p>'.
-	'<p class="clear form-note info">'.__('This will be applied for all users').'</p>';
-}
-
-echo 
 '<br class="clear" />'. //Opera sucks
 '</fieldset>';
@@ -459,6 +413,6 @@
 '<fieldset><legend>'.__('Accessibility options').'</legend>'.
 
-'<p><label for="user_acc_nodragdrop" class="classic">'.
-form::checkbox('user_acc_nodragdrop',1,$user_acc_nodragdrop).' '.
+'<p><label for="user_dm_nodragdrop" class="classic">'.
+form::checkbox('user_dm_nodragdrop',1,$user_dm_nodragdrop,'',13).' '.
 __('Disable javascript powered drag and drop for ordering items').'</label></p>'.
 
@@ -470,13 +424,13 @@
 
 '<p><label for="user_dm_doclinks" class="classic">'.
-form::checkbox('user_dm_doclinks',1,$user_dm_doclinks).' '.
+form::checkbox('user_dm_doclinks',1,$user_dm_doclinks,'',14).' '.
 __('Display documentation links').'</label></p>'.
 
 '<p><label for="user_dm_dcnews" class="classic">'.
-form::checkbox('user_dm_dcnews',1,$user_dm_dcnews).' '.
+form::checkbox('user_dm_dcnews',1,$user_dm_dcnews,'',15).' '.
 __('Display Dotclear news').'</label></p>'.
 
 '<p><label for="user_dm_quickentry" class="classic">'.
-form::checkbox('user_dm_quickentry',1,$user_dm_quickentry).' '.
+form::checkbox('user_dm_quickentry',1,$user_dm_quickentry,'',16).' '.
 __('Display quick entry form').'</label></p>'.
 
@@ -490,5 +444,5 @@
 '<p class="clear">'.
 $core->formNonce().
-'<input type="submit" accesskey="s" value="'.__('Save').'" /></p>'.
+'<input type="submit" accesskey="s" value="'.__('Save').'" tabindex="33" /></p>'.
 '</form>';
 
@@ -515,5 +469,5 @@
 				form::field(array('order['.$k.']'),2,3,$count,'position','',false,'title="'.sprintf(__('position of %s'),$fav['title']).'"').
 				form::hidden(array('dynorder[]','dynorder-'.$k.''),$k).
-				'<label for="fuk-'.$k.'">'.form::checkbox(array('remove[]','fuk-'.$k),$k).__($fav['title']).'</label>'.
+				'<label for="fuk-'.$k.'">'.form::checkbox(array('remove[]','fuk-'.$k),$k).$fav['title'].'</label>'.
 				'</li>';
 		}
@@ -558,5 +512,5 @@
 			$count++;
 			echo '<li id="fd-'.$k.'">'.
-			'<img src="'.$fav['small-icon'].'" alt="" /> '.__($fav['title']).'</li>';
+			'<img src="'.$fav['small-icon'].'" alt="" /> '.$fav['title'].'</li>';
 		}
 	}
@@ -571,8 +525,8 @@
 $array = $_fav;
 function cmp($a,$b) {
-    if (__($a[1]) == __($b[1])) {
+    if ($a[1] == $b[1]) {
         return 0;
     }
-    return (__($a[1]) < __($b[1])) ? -1 : 1;
+    return ($a[1] < $b[1]) ? -1 : 1;
 }
 $array=$array->getArrayCopy();
@@ -584,6 +538,6 @@
 		echo '<li id="fa-'.$fav[0].'">'.'<label for="fak-'.$fav[0].'">'.
 			form::checkbox(array('append[]','fak-'.$fav[0]),$k).
-			'<img src="'.$fav[3].'" alt="" /> '.'<span class="zoom"><img src="'.$fav[4].'" alt="" /></span>'.
-			__($fav[1]).'</label>'.'</li>';
+			'<img src="'.$fav[3].'" alt="" /> '.'<span class="zoom"><img src="'.$fav[4].'" alt="" /></span>'.$fav[1].
+			'</label>'.'</li>';
 	}
 }	
Index: admin/search.php
===================================================================
--- admin/search.php	(revision 557)
+++ admin/search.php	(revision 125)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -73,12 +73,12 @@
 
 echo
-'<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Search').'</span></h2>'.
+'<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.__('Search').'</h2>'.
 '<form action="search.php" method="get">'.
-'<div class="fieldset"><h3>'.__('Search options').'</h3>'.
-'<p><label for="q">'.__('Query:').' </label>'.form::field('q',30,255,html::escapeHTML($q)).'</p>'.
-'<p><label for="qtype1" class="classic">'.form::radio(array('qtype','qtype1'),'p',$qtype == 'p').' '.__('Search entries').'</label> '.
-'<label for="qtype2" class="classic">'.form::radio(array('qtype','qtype2'),'c',$qtype == 'c').' '.__('Search comments').'</label></p>'.
-'</p><input type="submit" value="'.__('Search').'" /></p>'.
-'</div>'.
+'<fieldset><legend>'.__('Search options').'</legend>'.
+'<p><label for="q" class="classic">'.__('Query:').' '.form::field('q',30,255,html::escapeHTML($q)).'</label> '.
+'<label for="qtype1" class="classic">'.form::radio(array('qtype','qtype1'),'p',$qtype == 'p').' '.__('search entries').'</label> '.
+'<label for="qtype2" class="classic">'.form::radio(array('qtype','qtype2'),'c',$qtype == 'c').' '.__('search comments').'</label> '.
+' <input type="submit" value="'.__('ok').'" /></p>'.
+'</fieldset>'.
 '</form>';
 
Index: admin/services.php
===================================================================
--- admin/services.php	(revision 323)
+++ admin/services.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -133,5 +133,6 @@
 			$rsp->comment_ip($rs->comment_ip);
 			$rsp->comment_email($rs->comment_email);
-			$rsp->comment_spam_disp(dcAntispam::statusMessage($rs));
+			# --BEHAVIOR-- adminAfterCommentDesc
+			$rsp->comment_spam_disp($core->callBehavior('adminAfterCommentDesc', $rs));
 		}
 		
Index: admin/style/candyUpload/style.css
===================================================================
--- admin/style/candyUpload/style.css	(revision 536)
+++ admin/style/candyUpload/style.css	(revision 3)
@@ -1,27 +1,33 @@
 
-.cu-ctrl {
+div.cu-ctrl {
 	background: #f5f5f5;
-	padding: .5em 0 0 0;
+	padding: 5px 0 0 0;
 	margin: 0 0 1em 0;
 	overflow: hidden;
+	border-color: #ccc;
+	border-width: 1px 0;
+	border-style: solid;
 }
-.cu-msg {
+
+div.cu-msg {
+	padding: 0 0.5em;
 	font-weight: bold;
 }
-.cu-msg.cu-error {
+div.cu-msg.cu-error {
 	color: #c00;
 }
-.cu-files {
+
+div.cu-files {
 	padding: 0 0.5em;
 	margin: 10px 0;
 }
-.cu-file {
+div.cu-file {
 	margin: 0 0 8px 0;
 	position: relative;
 }
-.cu-fileinfo {
+div.cu-fileinfo {
 	margin-left: 16px;
 }
-.cu-fileinfo span.cu-filecancel {
+div.cu-fileinfo span.cu-filecancel {
 	display: block;
 	position: absolute;
@@ -30,5 +36,5 @@
 	left: -16px;
 }
-.cu-filecancel a {
+div.cu-files span.cu-filecancel a {
 	display: block;
 	width: 12px;
@@ -39,15 +45,16 @@
 	outline: none;
 }
-.cu-filemsg {
+div.cu-files span.cu-filemsg {
 	font-weight: bold;
 	color: green;
 }
-span.cu-filemsg.cu-error {
+div.cu-files span.cu-filemsg.cu-error {
 	color: #c00;
 }
-.cu-progress {
+
+div.cu-progress {
 	margin-left: 16px;
 }
-.cu-progress div {
+div.cu-progress div {
 	height: 10px;
 	width: 0;
@@ -62,5 +69,6 @@
 	-moz-border-radius: 2px;
 }
-.cu-btn {
+
+div.cu-btn {
 	padding: 0 0.5em;
 	line-height: 1.2em;
@@ -69,23 +77,20 @@
 	position: relative;
 }
-.cu-btn span {
+div.cu-btn span {
 	display: block;
-	margin: 0 1em 0 0;
+	margin: 0 0 0 .5em;
 	float: right;
 }
-.cu-btn span a {
+div.cu-btn span a {
 	display: block;
 	padding: .3em 1.5em;
 }
-span.cu-btn-browse {
+div.cu-btn span.cu-btn-browse {
 	float: none;
 	position: absolute;
-	left: 0;
+	left: 0.5em;
 	margin: 0;
 }
-span.cu-btn-upload, span.cu-btn-clean {
-	margin-right: 0;
-}
-span.cu-btn-upload a.button {
+div.cu-btn span.cu-btn-upload a.button {
 	color: #fff;
 	border: 1px solid #2373A8;
@@ -94,6 +99,5 @@
 	background: -moz-linear-gradient(top,  #2C8FD1,  #2373A8);
 }
-span.cu-btn-upload a.button:hover, 
-span.cu-btn-upload a.button:focus {
+div.cu-btn span.cu-btn-upload a.button:hover, div.cu-btn span.cu-btn-upload a.button:focus {
 	color: #fff;
 	border: 1px solid #2C8FD1;
@@ -103,10 +107,11 @@
 	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#2373A8', endColorstr='#2C8FD1');
 }
-.cu-maxsize.form-note {
+div.cu-maxsize {
 	clear: both;
-	margin: 1.5em 0 0;
+	margin: .75em 0 0 0.5em;
 	font-style: italic;
 }
-.cu-disable {
+
+div.cu-disable {
 	margin: 1em 0;
 	padding: 0 0 0.5em 0.5em;
Index: admin/style/default.css
===================================================================
--- admin/style/default.css	(revision 565)
+++ admin/style/default.css	(revision 251)
@@ -11,8 +11,6 @@
 # -- END LICENSE BLOCK -----------------------------------------
 */
-
-/* ------------------------------------------------------------------ html */
 body {
-	font: 75%/1.5em Helvetica,Arial,sans-serif;
+	font: 76%/1.5em Helvetica,Arial,sans-serif;
 	color: #333;
 	background: #f5f5f5;
@@ -23,4 +21,6 @@
 	background: #fff;
 }
+
+a img,:link img,:visited img { border:none }
 
 a, a:link, a:visited {
@@ -32,7 +32,4 @@
 	text-decoration: underline;
 }
-a img, a:link img, a:visited img { 
-	border:none;
-}
 
 h1, h2, h3, h4, h5, h6, p {
@@ -40,4 +37,5 @@
 	margin-bottom: 0.6em;
 }
+
 h2 {
 	color: #666;
@@ -45,14 +43,14 @@
 	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;
@@ -61,4 +59,5 @@
 	border-style: solid;
 }
+
 pre, code {
 	font: 100% "Andale Mono","Courier New",monospace;
@@ -78,35 +77,12 @@
 }
 
+
 /* 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;
+	background: #575859 url(dc_bg.png) repeat-x 0 3em;
 }
 #top h1 {
@@ -127,57 +103,49 @@
 	color: #fff;
 }
-#info-boxes {
+
+#info-box {
 	background: #575859;
-	font-size: .95em;
-	height: 3em;
-}
-#info-box1 {
-	margin: 0;
-	padding: .5em 3px 4px 0;
+	position: absolute;
+	left: 13em;
+	top: 3px;
+	margin: 0;
+	padding: 3px 3px 4px 0;
 	color: #fff;
-	float: left;
+}
+#info-box2 {
 	background: #575859;
-}
-#info-box2 {
-	margin: .1em 0 0 0;
-	padding: .5em 1.3em 4px 0;
+	position: absolute;
+	right: 1em;
+	top: 3px;
+	margin: 0;
+	padding: 3px 3px 4px 0;
 	color: #fff;
-	float: right;
-	text-align: right;
-	background: #575859;
-	height: 2em;
-}
-#info-box1 select {
-	width: 15em;
-}
-#info-box1 a img, #info-box2 a img {
+}
+#info-box div, #info-box2 div {
+	margin: 0; padding: 0;
+}
+#info-box div div, #info-box2 div div {
+	display: inline;
+}
+#info-box>form>div, #info-box2>form>div {
+	line-height: 1.5;
+}
+#info-box select {
+	width: 20em;
+}
+#info-box a img, #info-box2 a img {
 	vertical-align: middle;
 	padding-left: .3em;
 	}
-#info-box1 a, #info-box2 a {
+#info-box 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 */
+}
+#info-box a {
+	margin-left: 2em;
+}
+
 #wrapper {
 	width: 100%;
@@ -190,5 +158,5 @@
 }
 #content {
-	margin: 1.5em 1.5em 4em 13em;
+	margin: .5em 1.5em 4em 13em;
 	padding: 1em;
 	background: #fff;
@@ -201,86 +169,16 @@
 	#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;
-	-webkit-border-top-left-radius: .3em;
-	-webkit-border-top-right-radius: .3em;
-	-moz-border-radius-topleft: .3em;
-	-moz-border-radius-topright: .3em;
-	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-top: 1em;
 	margin-bottom: 1em;
 }
+#main-menu * {
+}
+
 #main-menu h3 {
-	margin: 0 0 0.5em;
+	margin: 0 0 0.5em 0;
 	padding: .5em 0 0 .5em;
 	text-transform: uppercase;
@@ -296,5 +194,5 @@
 #main-menu li {
 	display: block;
-	margin: 0.5em 0 0;
+	margin: 0.5em 0 0 0;
 	padding: .2em 0 0 32px;
 	background-repeat: no-repeat;
@@ -308,5 +206,5 @@
 	color: #333;
 }
-#main-menu .active {
+#main-menu li.active {
 	background-color: #fff;
 	padding: .4em 0 .1em 32px;
@@ -316,23 +214,8 @@
 	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 */
+#main-menu #dashboard-menu li {
+	margin-left: 0;
+}
+
 #footer {
 	clear: both;
@@ -358,36 +241,27 @@
 	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;
-	-moz-border-radius: 4px;
-	-webkit-border-radius: 4px;
-	border-radius: 4px;
-}
-#login-screen input[type=text], #login-screen input[type=password], #login-screen input[type=submit] {
+
+#debug {
+	position: absolute;
+	top: 0;
 	width: 100%;
-}
-#login-screen #issue {
-	margin-left: 1em;
-	font-size: 1em;
-}
-#login-screen #issue strong {font-weight: normal;}
-
-
-/* ------------------------------------------------------------------ dashboard */
+	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;
+}
+
+/* DASHBOARD */
 #dashboard-main {
 	float: left;
@@ -401,10 +275,10 @@
 	float: none;
 }
-#icons {
+#dashboard-main #icons {
 	overflow: hidden;
 	padding-bottom: 1em;
 	text-align: center;
 }
-#icons p {
+#dashboard-main #icons p {
 	width: 210px;
 	text-align: center;
@@ -412,27 +286,23 @@
 	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 {
+#dashboard-main #icons span {
+	display: block;
+}
+#dashboard-main #icons a {
+	border-bottom-width: 0;
+}
+#dashboard-main #icons span a {
+	border-bottom-width: 1px;
+}
+
+#dashboard-main #quick {
 	clear: left;
 	margin-top: 2em;
 }
-#quick h3 {
+#dashboard-main #quick h3 {
 	margin-bottom: 0.2em;
 	font-size: 1.2em;
 }
-#quick p.qinfo {
+#dashboard-main #quick p.qinfo {
 	margin: -.7em -1em 1em;
 	background: #eef url(info.png) no-repeat .2em .2em;
@@ -441,4 +311,5 @@
 	color: #666;
 }
+
 #dashboard-items {
 	float: left;
@@ -448,5 +319,5 @@
 	padding-top: 3em;
 }
-#dashboard-items img {
+#dashboard-items p img {
 	vertical-align: middle;
 }
@@ -460,12 +331,12 @@
 	color: #666;
 }
-#news dt {
+#dashboard-items #news dt {
 	font-weight: bold;
 	margin: 0 0 0.4em 0;
 }
-#news dd {
+#dashboard-items #news dd {
 	margin: 0 0 1em 0;
 }
-#news dd p {
+#dashboard-items #news dd p {
 	margin: 0.2em 0 0 0;
 }
@@ -479,21 +350,18 @@
 	color: #fff;
 }
-/* ------------------------------------------------------------------ post */
-#entry-wrapper {
-	float: left;
-	width: 100%;
-	margin-right: -18em;
-}
-#entry-content {
-	margin-right: 18em;
-}
+
+/* POST */
 #entry-sidebar {
 	width: 17em;
 	float: right;
 }
+#entry-content {
+	margin-right: 18em;
+}
 #comments {
 	clear: both;
 }
-/* ------------------------------------------------------------------ categories */
+
+/* CATEGORIES */
 #categories {
 	margin: 1em 0 2em;
@@ -504,5 +372,5 @@
 	padding: 0;
 }
-#categories li {
+#categories ul li {
 	margin: .5em 0;
 	padding: .3em 1.5em;
@@ -513,11 +381,11 @@
 	border-radius: .3em;
 }
-#categories h4 {
-	margin: 0;
-}
-#categories h4 span {
+#categories ul li h4 {
+	margin: 0;
+}
+#categories ul li h4 span {
 	font-weight: normal;
 }
-#categories li p {
+#categories ul li p {
 	margin: 0;
 }
@@ -525,5 +393,6 @@
 	width: 100%;
 }
-/* ------------------------------------------------------------------ media */
+
+/* MEDIA */
 #media-icon {
 	float: left;
@@ -548,4 +417,5 @@
 	height: 500px;
 }
+
 #add-file-f {
 	position: relative;
@@ -558,52 +428,6 @@
 	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 */
+
+/* favorites */
 #my-favs ul {
 	list-style-type: none;
@@ -612,5 +436,5 @@
 	line-height: 1.2;
 }
-#my-favs li {
+#my-favs ul li {
 	display: block;
 	float: left;
@@ -631,8 +455,10 @@
 	display: inline;
 }
+
 #default-favs h3 {
 	margin-top: 2em;
 	margin-bottom: 1em;
 }
+
 .fav-list {
 	list-style-type: none;
@@ -646,5 +472,5 @@
 	position: relative;
 }
-.fav-list img {
+.fav-list li img {
 	vertical-align: middle;
 	margin-right: .2em;
@@ -665,130 +491,6 @@
 	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;
-	-moz-border-radius: 4px;
-	-webkit-border-radius: 4px;
-	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 */
 #help {
 	margin-top: 2em;
@@ -837,16 +539,8 @@
 	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 */
+
+/* POPUP */
 body.popup #wrapper, body.popup #top {
 	margin-top: -1.5em;
-	float: none;
 }
 body.popup #top h1 {
@@ -868,59 +562,9 @@
 	border: none;
 }
-/* ------------------------------------------------------------------ messages */
-div.error, p.error, 
-div.message, p.message, 
-div.static-msg, p.static-msg {
-	padding: 0.5em 0.5em 0.5em 40px;
-	margin-bottom: 1em;
-	-moz-border-radius: 8px;
-	-webkit-border-radius: 8px;
-	border-radius: 8px;
-}
-p.error, p.message, p.static-msg {
-	padding-top: 1em;
-	padding-bottom: 1em;
-}
-div.error, p.error {
-	background: #e5bfbf url(msg-error.png) no-repeat 5px 5px;
-	color: #600;
-}
-div.message, p.message, 
-div.static-msg, p.static-msg {
-	background: #666 url(msg-std.png) no-repeat 5px 5px;
-	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 */
+
+/* CLASSES
+-------------------------------------------------------- */
+
+/* -------------- paragraphe pour bouton Nouveau bidule ----------- */
 p.top-add {
 	text-align: right;
@@ -935,4 +579,5 @@
 	vertical-align: middle;
 }
+
 /* Si quelque chose a besoin d'être caché sauf pour les revues d'écran */
 .hidden {
@@ -946,4 +591,15 @@
     overflow: hidden;
     }
+
+/* -------------- aide ----------- */
+.help-content dt {
+	font-weight: bold;
+	color: #626262;
+	margin: 0;
+}
+.help-content dd {
+	margin: 0.3em 0 1.5em 0;
+}
+
 .clear {
 	clear: both;
@@ -969,13 +625,40 @@
 	overflow: auto;
 }
+
 .grid {
 	background: transparent repeat url('grid.png') 0 0;
 }
+
 .line p {
 	margin: 0;
 }
+
+div.error, p.error, div.message, p.message, div.static-msg, p.static-msg {
+	padding: 0.5em 0.5em 0.5em 40px;
+	margin-bottom: 1em;
+	-moz-border-radius: 8px;
+	-webkit-border-radius: 8px;
+	border-radius: 8px;
+}
+p.error, p.message, p.static-msg {
+	padding-top: 1em;
+	padding-bottom: 1em;
+}
+div.error, p.error {
+	background: #e5bfbf url(msg-error.png) no-repeat 5px 5px;
+	color: #600;
+}
+div.message, p.message, div.static-msg, p.static-msg {
+	background: #666 url(msg-std.png) no-repeat 5px 5px;
+	color: #fff;
+}
+div.message a, p.message a, div.static-msg a, p.static-msg a {
+	color: #fff;
+}
+
 .offline {
 	color: #666;
 }
+
 ul.nice {
 	margin: 1em 0;
@@ -987,9 +670,39 @@
 	padding: 0;
 }
-.zip-dl {
-	background: transparent url(package.png) no-repeat 0 50%;
-	padding: 5px 0 5px 20px;
-}
-/* pas trouvé dans le code */
+
+.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;
+}
+
 .comment {
 	border-top: 2px solid #ccc;
@@ -1004,4 +717,224 @@
 	right: 0;
 }
+
+/* -------- 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;
+	-webkit-border-top-left-radius: .3em;
+	-webkit-border-top-right-radius: .3em;
+	-moz-border-radius-topleft: .3em;
+	-moz-border-radius-topright: .3em;
+	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;
+}
+
+/* Themes list */
+#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;
+	-moz-border-radius: 4px;
+	-webkit-border-radius: 4px;
+	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;
+}
+.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;
+}
+
+.zip-dl {
+	background: transparent url(package.png) no-repeat 0 50%;
+	padding: 5px 0 5px 20px;
+}
+
+select.l10n option {
+	padding-left: 16px;
+}
+option.avail10n {
+	background: transparent url(../images/check-on.png) no-repeat 0 50%;
+}
+
 /* TABLES
 -------------------------------------------------------- */
@@ -1014,12 +947,4 @@
 	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;
@@ -1033,7 +958,9 @@
 	border-bottom-color: #666;
 }
+
 .noborder td, td.noborder, .noborder th, th.noborder {
 	border-width: 0;
 }
+
 table .maximal, table.maximal {
 	width: 100%;
@@ -1042,8 +969,10 @@
 	width: 1px;
 }
+
 table .nowrap {
 	white-space: nowrap;
 	vertical-align: top;
 }
+
 td.status {
 	vertical-align: middle;
@@ -1085,5 +1014,6 @@
 }
 
-/* ----------------------------------------------------------------- FORMS */
+/* FORMS
+-------------------------------------------------------- */
 form {
 	display: block;
@@ -1091,5 +1021,6 @@
 	padding: 0;
 }
-fieldset, .fieldset {
+
+fieldset {
 	display: block;
 	margin: 0 0 1em 0;
@@ -1116,4 +1047,5 @@
 	font-weight: normal;
 }
+
 input, textarea, select {
 	background: #f9f9f9;
@@ -1142,4 +1074,5 @@
 	background: transparent;
 }
+
 label {
 	display: block;
@@ -1147,4 +1080,7 @@
 label input, label select, label span {
 	display: block;
+}
+#filters-form label {
+	display: inline;
 }
 p.form-note {
@@ -1180,6 +1116,6 @@
 	display: block;
 	width: 100%;
-	resize: vertical;
-}
+}
+
 label.required {
 	font-weight: bold;
@@ -1206,9 +1142,7 @@
 	top: 0;
 }
+
 label .maximal, textarea.maximal, input.maximal {
 	width: 100%;
-}
-textarea.maximal {
-	resize: vertical;
 }
 
@@ -1220,5 +1154,6 @@
 	padding-left: 20px;
 }
-.constrained {
+
+fieldset.constrained {
 	margin: 0;
 	padding: 0;
@@ -1227,5 +1162,34 @@
 }
 
-/* --------------------------------------------------------------- buttons */
+#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;
+}
+#login-screen fieldset {
+	border: 1px solid #999;
+	padding: 1em 1em 0 1em;
+	-moz-border-radius: 4px;
+	-webkit-border-radius: 4px;
+	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;}
+
+
+/* ------------------  Tous les boutons -------------------- */
 h2 a.button {
 	color: #333;
@@ -1246,5 +1210,5 @@
 	text-align: center;
 	text-decoration: none;
-	padding: .1em .5em 0 .5em;
+	padding: .1em .5em;
 	text-shadow: 0 1px 1px rgba(0,0,0,.3);
 	-webkit-border-radius: .2em;
@@ -1306,8 +1270,4 @@
 input[type=submit].delete {
 	color: #c00;
-	padding-bottom: .1em;
-}
-#entry-content .delete {
-	margin-left: 1em;
 }
 a.delete:hover,
@@ -1335,7 +1295,7 @@
 	border-radius: .5em;
 	margin-bottom: .1em;	
-	background: #2C8FD1 url(add.png) no-repeat 6px center;
+	background: #2C8FD1 url(add.png) no-repeat .2em center;
 	color: #fff;
-	padding: .2em 16px .2em 30px;
+	padding: .1em 1em .2em 28px;
 	border: 1px solid #2373A8;
 }
@@ -1343,2 +1303,23 @@
 	background-color: #2373A8;
 }
+
+form#filters {font-size: 100%; background: #f0f0f0; padding: 1em; border-radius: .5em; border: 1px solid #ddd;}
+form#filters .margintop {padding-top: 1.33em;}
+form#filters ul {list-style-type:none;margin: 0; padding: 0; margin-left: 1em;}
+form#filters .col30 {border-left: 1px solid #999;}
+form#filters .col30 h3 {margin-left: 1em;}
+p.line, li.line { position: relative; padding: 3px 0 0 28px; margin: 0 0 1em 0;}
+p.line input[type=submit] {position: absolute; left:0;top:0; padding: 0 .1em; margin: 0;}
+p.line input[type=checkbox], li.line input[type=checkbox] {position: absolute; left: 0; top: .2em; padding: 0 .1em; margin: 0;}
+p.line select { margin-right: 2em;}
+p.line label { display: block; width: 8em; float: left;}
+p.line label img {margin-right: 8px;}
+p.line label.or {
+	text-align: right;
+	margin-left: 5em;
+	font-weight: bold;
+}
+p.line label.or + select {margin-left: 2em;}
+li.line { padding: 0 0 0 20px; height: 1em;}
+li.line label {width: auto;}
+#available_filters input[type=submit] {padding: 0 .1em; margin-left: .5em;}
Index: admin/style/install.css
===================================================================
--- admin/style/install.css	(revision 269)
+++ admin/style/install.css	(revision 69)
@@ -7,11 +7,10 @@
 */
 body.install {
-	font: 0.875em Helvetica,Arial,sans-serif;
+	font: 0.8em "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;
 	color: #000;
 	background-color: #fff;
-	line-height: 1.5em;
 }
 body.install #content {
-	width:32em;
+	width:500px;
 	margin:1em auto;
 }
@@ -21,5 +20,4 @@
 	-moz-border-radius:8px;
 	-webkit-border-radius:8px;
-	border-radius: 8px;
 }
 body.install h1,h2 {
@@ -42,9 +40,10 @@
 }
 body.install label {
+	font-weight: bold;
 	color: #555;
 }
 
 body.install .msg {
-	padding:10px 10px 10px 60px;
+	padding:10px 10px 10px 42px;
 	-moz-border-radius:8px;
 	-webkit-border-radius:8px;
@@ -56,15 +55,7 @@
 	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;
+	padding: 0.5em 0.5em 0.5em 40px;
 	margin-bottom: 1em;
 	-moz-border-radius: 8px;
@@ -76,9 +67,9 @@
 }
 div.error, p.error {
-	background: #e5bfbf url(install/process_warning.png) no-repeat 5px 5px;
+	background: #e5bfbf url(msg-error.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;
+	background: #666 url(msg-std.png) no-repeat 5px 5px;
 	color: #fff;
 }
@@ -96,7 +87,7 @@
 	font-weight : bold;
 }
-label.required abbr {
-	color: #dd0000;
-	font-size: 1.3em;
+label.required:before {
+	content : '* ';
+	color : #c00;
 }
 
@@ -132,31 +123,2 @@
 	-webkit-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);
-	-webkit-border-radius: .2em;
-	-moz-border-radius: .2em;
-	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: admin/trackbacks.php
===================================================================
--- admin/trackbacks.php	(revision 510)
+++ admin/trackbacks.php	(revision 196)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -95,5 +95,5 @@
 }
 
-echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.$page_title.'</span></h2>';
+echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.$page_title.'</h2>';
 
 echo '<p><a class="back" href="'.$core->getPostAdminURL($post->post_type,$id).'">'.
Index: admin/update.php
===================================================================
--- admin/update.php	(revision 270)
+++ admin/update.php	(revision 166)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
Index: admin/user.php
===================================================================
--- admin/user.php	(revision 557)
+++ admin/user.php	(revision 181)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -96,8 +96,4 @@
 		$cur->user_post_status = $user_post_status = $_POST['user_post_status'];
 		
-		if ($cur->user_id == $core->auth->userID() && $core->auth->isSuperAdmin()) {
-			// force super_user to true if current user
-			$cur->user_super = $user_super = true;
-		}
 		if ($core->auth->allowPassChange()) {
 			$cur->user_change_pwd = !empty($_POST['user_change_pwd']) ? 1 : 0;
@@ -154,9 +150,5 @@
 			$core->callBehavior('adminAfterUserCreate',$cur,$new_id);
 			
-			if (!empty($_POST['saveplus'])) {
-				http::redirect('user.php?add=1');
-			} else {
-				http::redirect('user.php?id='.$new_id.'&add=1');
-			}
+			http::redirect('user.php?id='.$new_id.'&add=1');
 		}
 	}
@@ -185,5 +177,5 @@
 }
 
-echo '<h2><a href="users.php">'.__('Users').'</a> &rsaquo; <span class="page-title">'.$page_title.'</span></h2>';
+echo '<h2><a href="users.php">'.__('Users').'</a> &rsaquo; '.$page_title.'</h2>';
 
 if ($user_id == $core->auth->userID()) {
@@ -199,5 +191,5 @@
 '<div class="col">'.
 '<p><label for="user_id" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Username:').' '.
-form::field('user_id',20,255,html::escapeHTML($user_id)).
+form::field('user_id',20,255,html::escapeHTML($user_id),'',2).
 '</label></p>'.
 '<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p>'.
@@ -206,5 +198,5 @@
 ($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> ').
 ($user_id != '' ? __('New password:') : __('Password:')).' '.
-form::password('new_pwd',20,255).
+form::password('new_pwd',20,255,'','',3).
 '</label></p>'.
 '<p class="form-note">'.__('Password must contain at least 6 characters.').'</p>'.
@@ -212,47 +204,46 @@
 '<p><label for="new_pwd_c" '.($user_id != '' ? '' : 'class="required"').'>'.
 ($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> ').__('Confirm password:').' '.
-form::password('new_pwd_c',20,255).
+form::password('new_pwd_c',20,255,'','',4).
 '</label></p>'.
 
 '<p><label for="user_name">'.__('Last Name:').' '.
-form::field('user_name',20,255,html::escapeHTML($user_name)).
+form::field('user_name',20,255,html::escapeHTML($user_name),'',5).
 '</label></p>'.
 
 '<p><label for="user_firstname">'.__('First Name:').' '.
-form::field('user_firstname',20,255,html::escapeHTML($user_firstname)).
+form::field('user_firstname',20,255,html::escapeHTML($user_firstname),'',6).
 '</label></p>'.
 
 '<p><label for="user_displayname">'.__('Display name:').' '.
-form::field('user_displayname',20,255,html::escapeHTML($user_displayname)).
+form::field('user_displayname',20,255,html::escapeHTML($user_displayname),'',7).
 '</label></p>'.
 
 '<p><label for="user_email">'.__('Email:').' '.
-form::field('user_email',20,255,html::escapeHTML($user_email)).
-'</label></p>'.
-'<p class="form-note">'.__('Mandatory for password recovering procedure.').'</p>'.
+form::field('user_email',20,255,html::escapeHTML($user_email),'',8).
+'</label></p>'.
 '</div>'.
 
 '<div class="col">'.
 '<p><label for="user_url">'.__('URL:').' '.
-form::field('user_url',30,255,html::escapeHTML($user_url)).
+form::field('user_url',30,255,html::escapeHTML($user_url),'',9).
 '</label></p>'.
 '<p><label for="user_post_format">'.__('Preferred format:').' '.
-form::combo('user_post_format',$formaters_combo,$user_options['post_format']).
+form::combo('user_post_format',$formaters_combo,$user_options['post_format'],'',10).
 '</label></p>'.
 
 '<p><label for="user_post_status">'.__('Default entry status:').' '.
-form::combo('user_post_status',$status_combo,$user_post_status).
-'</label></p>'.
-
-'<p><label for="user_edit_size">'.__('Entry edit field height:').' '.
-form::field('user_edit_size',5,4,(integer) $user_options['edit_size']).
-'</label></p>'.
-
-'<p><label for="user_lang">'.__('User language:').' '.
-form::combo('user_lang',$lang_combo,$user_lang,'l10n').
+form::combo('user_post_status',$status_combo,$user_post_status,'',11).
+'</label></p>'.
+
+'<p><label>'.__('Entry edit field height:').' '.
+form::field('user_edit_size',5,4,(integer) $user_options['edit_size'],'',12).
+'</label></p>'.
+
+'<p><label for="user_edit_size">'.__('User language:').' '.
+form::combo('user_lang',$lang_combo,$user_lang,'l10n',13).
 '</label></p>'.
 
 '<p><label for="user_tz">'.__('User timezone:').' '.
-form::combo('user_tz',dt::getZones(true,true),$user_tz).
+form::combo('user_tz',dt::getZones(true,true),$user_tz,'',14).
 '</label></p>';
 
@@ -260,12 +251,10 @@
 	echo
 	'<p><label for="user_change_pwd" class="classic">'.
-	form::checkbox('user_change_pwd','1',$user_change_pwd).' '.
+	form::checkbox('user_change_pwd','1',$user_change_pwd,'',15).' '.
 	__('Password change required to connect').'</label></p>';
 }
 
-$super_disabled = $user_super && $user_id == $core->auth->userID();
-
 echo
-'<p><label for="user_super" class="classic">'.form::checkbox('user_super','1',$user_super,'','',$super_disabled).' '.
+'<p><label for="user_super" class="classic">'.form::checkbox('user_super','1',$user_super,'',16).' '.
 __('Super administrator').'</label></p>'.
 '</div>'.
@@ -277,9 +266,10 @@
 
 echo
+'<fieldset>'.
 '<p><label for="your_pwd" '.($user_id != '' ? '' : 'class="required"').'>'.
 ($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> ').__('Your password:').
-form::password('your_pwd',20,255).'</label></p>'.
-'<p class="clear"><input type="submit" name="save" accesskey="s" value="'.__('Save').'" />'.
-($user_id != '' ? '' : ' <input type="submit" name="saveplus" value="'.__('Save and create another').'" />').
+form::password('your_pwd',20,255,'','',17).'</label></p>'.
+'</fieldset>'.
+'<p class="clear"><input type="submit" accesskey="s" value="'.__('Save').'" tabindex="16" />'.
 ($user_id != '' ? form::hidden('id',$user_id) : '').
 $core->formNonce().
@@ -290,5 +280,5 @@
 if ($user_id)
 {
-	echo '<div class="clear fieldset"><h3>'.__('Permissions').'</h3>';
+	echo '<fieldset class="clear"><legend>'.__('Permissions').'</legend>';
 	
 	$permissions = $core->getUserPermissions($user_id);
@@ -308,5 +298,5 @@
 				html::escapeHTML($v['name']).'</a> ('.html::escapeHTML($k).') - '.
 				'<a href="permissions.php?blog_id[]='.$k.'&amp;user_id[]='.$user_id.'">'
-				.__('Change permissions').'</a></h4>';
+				.__('change permissions').'</a></h4>';
 				
 				echo '<ul>';
@@ -324,5 +314,5 @@
 	'<p><a href="permissions_blog.php?user_id[]='.$user_id.'">'.
 	__('Add new permissions').'</a></p>'.
-	'</div>';
+	'</fieldset>';
 }
 
Index: admin/users.php
===================================================================
--- admin/users.php	(revision 565)
+++ admin/users.php	(revision 158)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
@@ -24,7 +24,6 @@
 			# --BEHAVIOR-- adminBeforeUserDelete
 			$core->callBehavior('adminBeforeUserDelete',$u);
-			if ($u != $core->auth->userID()) {
-				$core->delUser($u);
-			}
+			
+			$core->delUser($u);
 		}
 		catch (Exception $e)
@@ -33,4 +32,5 @@
 		}
 	}
+	
 	if (!$core->error->flag()) {
 		http::redirect('users.php?del=1');
@@ -59,5 +59,5 @@
 );
 
-# --BEHAVIOR-- adminUsersActionsCombo
+# --BEHAVIOR-- adminUser	sActionsCombo
 $core->callBehavior('adminUsersActionsCombo',array(&$combo_action));
 
@@ -118,5 +118,5 @@
 	
 	echo 
-	'<h2 class="post-title">'.__('Users').'</h2>'.
+	'<h2>'.__('Users').'</h2>'.
 	'<p class="top-add"><strong><a class="button add" href="user.php">'.__('Create a new user').'</a></strong></p>';
 	
Index: admin/xmlrpc.php
===================================================================
--- admin/xmlrpc.php	(revision 270)
+++ admin/xmlrpc.php	(revision 0)
@@ -4,5 +4,5 @@
 # This file is part of Dotclear 2.
 #
-# Copyright (c) 2003-2011 Olivier Meunier & Association Dotclear
+# Copyright (c) 2003-2010 Olivier Meunier & Association Dotclear
 # Licensed under the GPL version 2.0 license.
 # See LICENSE file or
