Index: admin/auth.php
===================================================================
--- admin/auth.php	(revision 1179)
+++ admin/auth.php	(revision 1558)
@@ -265,4 +265,5 @@
   <meta name="ROBOTS" content="NOARCHIVE,NOINDEX,NOFOLLOW" />
   <meta name="GOOGLEBOT" content="NOSNIPPET" />
+  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
   <title><?php echo html::escapeHTML(DC_VENDOR_NAME); ?></title>
   
@@ -323,5 +324,5 @@
 }
 if ($msg) {
-	echo '<p class="message">'.$msg.'</p>';
+	echo '<p class="success">'.$msg.'</p>';
 }
 
@@ -333,5 +334,5 @@
 {
 	echo
-	'<fieldset><legend>'.__('Request a new password').'</legend>'.
+	'<div class="fieldset"><h2>'.__('Request a new password').'</h2>'.
 	'<p><label for="user_id">'.__('Username:').'</label> '.
 	form::field(array('user_id','user_id'),20,32,html::escapeHTML($user_id)).'</p>'.
@@ -342,13 +343,14 @@
 	'<p><input type="submit" value="'.__('recover').'" />'.
 	form::hidden(array('recover'),1).'</p>'.
-	'</fieldset>'.
+	'</div>'.
 	
 	'<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>'.
+	'</div>';
 }
 elseif ($change_pwd)
 {
 	echo
-	'<fieldset><legend>'.__('Change your password').'</legend>'.
+	'<div class="fieldset"><h2>'.__('Change your password').'</h2>'.
 	'<p><label for="new_pwd">'.__('New password:').'</label> '.
 	form::password(array('new_pwd','new_pwd'),20,255).'</p>'.
@@ -356,5 +358,5 @@
 	'<p><label for="new_pwd_c">'.__('Confirm password:').'</label> '.
 	form::password(array('new_pwd_c','new_pwd_c'),20,255).'</p>'.
-	'</fielset>'.
+	'</div>'.
 	
 	'<p><input type="submit" value="'.__('change').'" />'.
@@ -370,10 +372,10 @@
 	{
 		if ($safe_mode) {
-			echo '<fieldset>';
-			echo '<legend>'.__('Safe mode login').'</legend>';
+			echo '<div class="fieldset">';
+			echo '<h2>'.__('Safe mode login').'</h2>';
 			echo 
-				'<p class="form-note info">'.
-				__('This mode allows you to login without activating any of your plugins. This may be useful to solve compatibility problems').'&nbsp;<br />'.
-				__('Disable or delete any plugin suspected to cause trouble, then log out and log back in normally.').
+				'<p class="form-note">'.
+				__('This mode allows you to login without activating any of your plugins. This may be useful to solve compatibility problems').'&nbsp;</p>'.
+				'<p class="form-note">'.__('Disable or delete any plugin suspected to cause trouble, then log out and log back in normally.').
 				'</p>';
 		}
@@ -394,5 +396,5 @@
 		__('Remember my ID on this computer').'</label></p>'.
 		
-		'<p><input type="submit" value="'.__('log in').'" /></p>';
+		'<p><input type="submit" value="'.__('log in').'" class="login" /></p>';
 		
 		if (!empty($_REQUEST['blog'])) {
@@ -402,5 +404,5 @@
 			echo 
 			form::hidden('safe_mode',1).
-			'</fieldset>';
+			'</div>';
 		}
 		else {
Index: admin/blog.php
===================================================================
--- admin/blog.php	(revision 1277)
+++ admin/blog.php	(revision 1615)
@@ -67,28 +67,37 @@
 else
 {
-	dcPage::open(__('New blog'),dcPage::jsConfirmClose('blog-form'));
+	dcPage::open(__('New blog'),dcPage::jsConfirmClose('blog-form'),
+		dcPage::breadcrumb(
+			array(
+				__('System') => '',
+				__('Blogs') => 'blogs.php',
+				'<span class="page-title">'.__('New blog').'</span>' => ''
+			))
+	);
 	
 	echo
-	'<h2><a href="blogs.php">'.__('Blogs').'</a> &rsaquo; <span class="page-title">'.__('New blog').'</span></h2>'.
+	'<form action="blog.php" method="post" id="blog-form">'.
 	
-	'<form action="blog.php" method="post" id="blog-form" class="fieldset">'.
+	'<div>'.$core->formNonce().'</div>'.
+	'<p><label class="required" for="blog_id"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog ID:').'</label> '.
+	form::field('blog_id',30,32,html::escapeHTML($blog_id)).'</p>'.
+	'<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p> ';
+
+	if ($blog_id) {
+		echo
+		'<p class="form-note warn">'.__('Please note that changing your blog ID may require changes in your public index.php file.').'</p>';
+	}
 	
-	'<p><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog ID:').' '.
-	form::field('blog_id',30,32,html::escapeHTML($blog_id)).'</label></p>'.
-	'<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p> '.
-	'<p class="form-note warn">'.__('Please note that changing your blog ID may require changes in your public index.php file.').'</p>'.
+	echo
+	'<p><label class="required" for="blog_name"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog name:').'</label> '.
+	form::field('blog_name',30,255,html::escapeHTML($blog_name)).'</p>'.
 	
-	'<p><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog name:').' '.
-	form::field('blog_name',30,255,html::escapeHTML($blog_name)).'</label></p>'.
-	
-	'<p><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog URL:').' '.
-	form::field('blog_url',30,255,html::escapeHTML($blog_url)).'</label></p>'.
+	'<p><label class="required" for="blog_url"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog URL:').'</label> '.
+	form::field('blog_url',30,255,html::escapeHTML($blog_url)).'</p>'.
 	
 	'<p class="area"><label for="blog_desc">'.__('Blog description:').'</label> '.
 	form::textarea('blog_desc',60,5,html::escapeHTML($blog_desc)).'</p>'.
 	
-	'<p><input type="submit" accesskey="s" value="'.__('Create').'" />'.
-	$core->formNonce().
-	'</p>'.
+	'<p><input type="submit" accesskey="s" value="'.__('Create').'" /></p>'.
 	'</form>';
 
Index: admin/blog_del.php
===================================================================
--- admin/blog_del.php	(revision 1288)
+++ admin/blog_del.php	(revision 1399)
@@ -49,10 +49,16 @@
 }
 
-dcPage::open(__('Delete a blog'));
+dcPage::open(__('Delete a blog'),'',
+	dcPage::breadcrumb(
+		array(
+			__('System') => '',
+			__('Blogs') => 'blogs.php',
+			'<span class="page-title">'.__('Delete a blog').'</span>' => ''
+		))
+);
 
 if (!$core->error->flag())
 {
 	echo
-	'<h2 class="page-title">'.__('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.'),
@@ -63,6 +69,6 @@
 	'<form action="blog_del.php" method="post">'.
 	'<div>'.$core->formNonce().'</div>'.
-	'<p><label for="pwd">'.__('Your password:').' '.
-	form::password('pwd',20,255).'</label></p>'.
+	'<p><label for="pwd">'.__('Your password:').'</label> '.
+	form::password('pwd',20,255).'</p>'.
 	'<p><input type="submit" class="delete" name="del" value="'.__('Delete this blog').'" />'.
 	form::hidden('blog_id',$blog_id).'</p>'.
Index: admin/blog_pref.php
===================================================================
--- admin/blog_pref.php	(revision 1537)
+++ admin/blog_pref.php	(revision 1719)
@@ -60,14 +60,8 @@
 
 # Language codes
-$langs = l10n::getISOcodes(1,1);
-foreach ($langs as $k => $v) {
-	$lang_avail = $v == 'en' || is_dir(DC_L10N_ROOT.'/'.$v);
-	$lang_combo[] = new formSelectOption($k,$v,$lang_avail ? 'avail10n' : '');
-}
+$lang_combo = dcAdminCombos::getAdminLangsCombo();
 
 # Status combo
-foreach ($core->getAllBlogStatus() as $k => $v) {
-	$status_combo[$v] = (string) $k;
-}
+$status_combo = dcAdminCombos::getBlogStatusescombo();
 
 # URL scan modes
@@ -174,5 +168,5 @@
 			
 			if ($rs) {
-				throw new Exception(__('That blog Id is already in use.'));
+				throw new Exception(__('This blog ID is already used.'));
 			}
 		}
@@ -256,4 +250,19 @@
 }
 
+if ($standalone) {
+	$breadcrumb = dcPage::breadcrumb(
+		array(
+			html::escapeHTML($blog_name) => '',
+			'<span class="page-title">'.__('Blog settings').'</span>' => ''
+		));
+} else {
+	$breadcrumb = dcPage::breadcrumb(
+		array(
+			__('System') => '',
+			__('Blogs') => 'blogs.php',
+			'<span class="page-title">'.__('Blog settings').' : '.html::escapeHTML($blog_name).'</span>' => ''
+		));
+}
+
 dcPage::open(__('Blog settings'),
 	'<script type="text/javascript">'."\n".
@@ -272,19 +281,16 @@
 	$core->callBehavior('adminBlogPreferencesHeaders').
 	
-	dcPage::jsPageTabs()
+	dcPage::jsPageTabs(),
+	$breadcrumb
 );
 
 if ($blog_id)
 {
-	echo '<h2>'.(!$standalone ? '<a href="blogs.php">'.__('Blogs').'</a> &rsaquo; ' : '').
-	html::escapeHTML($blog_name).' &rsaquo; <span class="page-title">'.
-	__('Blog settings').'</span></h2>';
-	
 	if (!empty($_GET['add'])) {
-		dcPage::message(__('Blog has been successfully created.'));
+		dcPage::success(__('Blog has been successfully created.'));
 	}
 	
 	if (!empty($_GET['upd'])) {
-		dcPage::message(__('Blog has been successfully updated.'));
+		dcPage::success(__('Blog has been successfully updated.'));
 	}
 	
@@ -295,5 +301,5 @@
 	
 	echo
-	'<fieldset><legend>'.__('Blog details').'</legend>'.
+	'<div class="fieldset"><h4>'.__('Blog details').'</h4>'.
 	$core->formNonce();
 	
@@ -301,6 +307,6 @@
 	{
 		echo
-		'<p><label for="blog_id" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog ID:').
-		form::field('blog_id',30,32,html::escapeHTML($blog_id)).'</label></p>'.
+		'<p><label for="blog_id" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog ID:').'</label>'.
+		form::field('blog_id',30,32,html::escapeHTML($blog_id)).'</p>'.
 		'<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p> '.
 		'<p class="form-note warn">'.__('Please note that changing your blog ID may require changes in your public index.php file.').'</p>';
@@ -308,18 +314,18 @@
 	
 	echo
-	'<p><label for="blog_name" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog name:').
-	form::field('blog_name',30,255,html::escapeHTML($blog_name)).'</label></p>';
+	'<p><label for="blog_name" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog name:').'</label>'.
+	form::field('blog_name',30,255,html::escapeHTML($blog_name)).'</p>';
 	
 	if ($core->auth->isSuperAdmin())
 	{
 		echo
-		'<p><label for="blog_url" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog URL:').
-		form::field('blog_url',30,255,html::escapeHTML($blog_url)).'</label></p>'.
-		
-		'<p><label for="url_scan">'.__('URL scan method:').
-		form::combo('url_scan',$url_scan_combo,$blog_settings->system->url_scan).'</label></p>'.
-		
-		'<p><label for="blog_status">'.__('Blog status:').
-		form::combo('blog_status',$status_combo,$blog_status).'</label></p>';
+		'<p><label for="blog_url" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Blog URL:').'</label>'.
+		form::field('blog_url',30,255,html::escapeHTML($blog_url)).'</p>'.
+		
+		'<p><label for="url_scan">'.__('URL scan method:').'</label>'.
+		form::combo('url_scan',$url_scan_combo,$blog_settings->system->url_scan).'</p>'.
+		
+		'<p><label for="blog_status">'.__('Blog status:').'</label>'.
+		form::combo('blog_status',$status_combo,$blog_status).'</p>';
 	}
 	
@@ -327,40 +333,40 @@
 	'<p class="area"><label for="blog_desc">'.__('Blog description:').'</label>'.
 	form::textarea('blog_desc',60,5,html::escapeHTML($blog_desc)).'</p>'.
-	'</fieldset>';
-	
-	
-	echo
-	'<fieldset><legend>'.__('Blog configuration').'</legend>'.
+	'</div>';
+	
+	
+	echo
+	'<div class="fieldset"><h4>'.__('Blog configuration').'</h4>'.
 	'<div class="two-cols">'.
 	'<div class="col">'.
-	'<p><label for="editor">'.__('Blog editor name:').
+	'<p><label for="editor">'.__('Blog editor name:').'</label>'.
 	form::field('editor',30,255,html::escapeHTML($blog_settings->system->editor)).
-	'</label></p>'.
-	
-	'<p><label for="lang">'.__('Default language:').
+	'</p>'.
+	
+	'<p><label for="lang">'.__('Default language:').'</label>'.
 	form::combo('lang',$lang_combo,$blog_settings->system->lang,'l10n').
-	'</label></p>'.
-	
-	'<p><label for="blog_timezone">'.__('Blog timezone:').
+	'</p>'.
+	
+	'<p><label for="blog_timezone">'.__('Blog timezone:').'</label>'.
 	form::combo('blog_timezone',dt::getZones(true,true),html::escapeHTML($blog_settings->system->blog_timezone)).
-	'</label></p>'.
-
-	'<p><label for="copyright_notice">'.__('Copyright notice:').
+	'</p>'.
+
+	'<p><label for="copyright_notice">'.__('Copyright notice:').'</label>'.
 	form::field('copyright_notice',30,255,html::escapeHTML($blog_settings->system->copyright_notice)).
-	'</label></p>'.
-	'</div>'.
-	
-	'<div class="col">'.
-	'<p><label for="post_url_format">'.__('New post URL format:').
+	'</p>'.
+	'</div>'.
+	
+	'<div class="col">'.
+	'<p><label for="post_url_format">'.__('New post URL format:').'</label>'.
 	form::combo('post_url_format',$post_url_combo,html::escapeHTML($blog_settings->system->post_url_format)).
-	'</label></p>'.
-
-	'<p><label for="note_title_tag">'.__('Note title HTML tag:').
+	'</p>'.
+
+	'<p><label for="note_title_tag">'.__('Note title HTML tag:').'</label>'.
 	form::combo('note_title_tag',$note_title_tag_combo,$blog_settings->system->note_title_tag).
-	'</label></p>'.
-		
-	'<p><label for="enable_xmlrpc" class="classic">'.
+	'</p>'.
+		
+	'<p><label for="enable_xmlrpc" class="classic">'.'</label>'.
 	form::checkbox('enable_xmlrpc','1',$blog_settings->system->enable_xmlrpc).
-	__('Enable XML/RPC interface').'</label></p>';
+	__('Enable XML/RPC interface').'</p>';
 
 	echo
@@ -385,23 +391,22 @@
 	'</div>'.
 	'<br class="clear" />'. //Opera sucks
-	'</fieldset>';
-	
-	echo
-	'<fieldset><legend>'.__('Comments and trackbacks').'</legend>'.
+	'</div>';
+	
+	echo
+	'<div class="fieldset"><h4>'.__('Comments and trackbacks').'</h4>'.
+
 	'<div class="two-cols">'.
+
 	'<div class="col">'.
 	'<p><label for="allow_comments" class="classic">'.
 	form::checkbox('allow_comments','1',$blog_settings->system->allow_comments).
-	__('Accept comments').'</label></p>'.
-	
+	__('Accept comments').'</label></p>'.	
 	'<p><label for="comments_pub" class="classic">'.
 	form::checkbox('comments_pub','1',!$blog_settings->system->comments_pub).
-	__('Moderate comments').'</label></p>'.
-	
+	__('Moderate comments').'</label></p>'.	
 	'<p><label for="comments_ttl" class="classic">'.sprintf(__('Leave comments open for %s days'),
 	form::field('comments_ttl',2,3,$blog_settings->system->comments_ttl)).
 	'</label></p>'.
-	'<p class="form-note">'.__('Leave blank to disable this feature.').'</p>'.
-	
+	'<p class="form-note">'.__('Leave blank to disable this feature.').'</p>'.	
 	'<p><label for="wiki_comments" class="classic">'.
 	form::checkbox('wiki_comments','1',$blog_settings->system->wiki_comments).
@@ -412,33 +417,32 @@
 	'<p><label for="allow_trackbacks" class="classic">'.
 	form::checkbox('allow_trackbacks','1',$blog_settings->system->allow_trackbacks).
-	__('Accept trackbacks').'</label></p>'.
-	
+	__('Accept trackbacks').'</label></p>'.	
 	'<p><label for="trackbacks_pub" class="classic">'.
 	form::checkbox('trackbacks_pub','1',!$blog_settings->system->trackbacks_pub).
-	__('Moderate trackbacks').'</label></p>'.
-	
+	__('Moderate trackbacks').'</label></p>'.	
 	'<p><label for="trackbacks_ttl" class="classic">'.sprintf(__('Leave trackbacks open for %s days'),
 	form::field('trackbacks_ttl',2,3,$blog_settings->system->trackbacks_ttl)).'</label></p>'.
-	'<p class="form-note">'.__('Leave blank to disable this feature.').'</p>'.
-	
+	'<p class="form-note">'.__('Leave blank to disable this feature.').'</p>'.	
 	'<p><label for="comments_nofollow" class="classic">'.
 	form::checkbox('comments_nofollow','1',$blog_settings->system->comments_nofollow).
 	__('Add "nofollow" relation on comments and trackbacks links').'</label></p>'.
 	'</div>'.
-	'</div>'.
 	'<br class="clear" />'. //Opera sucks
-	'</fieldset>';
-	
-	echo
-	'<fieldset><legend>'.__('Blog presentation').'</legend>'.
+
+	'</div>'.
+	'<br class="clear" />'. //Opera sucks
+	'</div>';
+	
+	echo
+	'<div class="fieldset"><h4>'.__('Blog presentation').'</h4>'.
 	'<div class="two-cols">'.
 	'<div class="col">'.
-	'<p><label for="date_format">'.__('Date format:').
+	'<p><label for="date_format">'.__('Date format:').'</label>'.
 	form::field('date_format',30,255,html::escapeHTML($blog_settings->system->date_format)).
-	'</label></p>'.
-	
-	'<p><label for="time_format">'.__('Time format:').
+	'</p>'.
+	
+	'<p><label for="time_format">'.__('Time format:').'</label>'.
 	form::field('time_format',30,255,html::escapeHTML($blog_settings->system->time_format)).
-	'</label></p>'.
+	'</p>'.
 	
 	'<p><label for="use_smilies" class="classic">'.
@@ -466,11 +470,11 @@
     '</div>'.
 	'<br class="clear" />'. //Opera sucks
-	'</fieldset>';
-	
-	echo
-	'<fieldset><legend>'.__('Media and images').'</legend>'.
+	'</div>';
+	
+	echo
+	'<div class="fieldset"><h4>'.__('Media and images').'</h4>'.
 	'<div class="two-cols">'.
 	'<div class="col">'.
-	'<h4>'.__('Generated image sizes (in pixels)').'</h4>'.
+	'<h5>'.__('Generated image sizes (in pixels)').'</h5>'.
 	'<p class="field"><label for="media_img_t_size">'.__('Thumbnails:').' '.
 	form::field('media_img_t_size',3,3,$blog_settings->system->media_img_t_size).'</label></p>'.
@@ -484,5 +488,5 @@
 	
 	'<div class="col">'.
-	'<h4><label for="media_img_title_pattern">'.__('Inserted image title').'</label></h4>'.
+	'<h5><label for="media_img_title_pattern">'.__('Inserted image title').'</label></h5>'.
 	'<p>'.__('This defines image tag title when you insert it in a post from the media manager. It is retrieved from the picture\'s metadata.').'</p>'.
 	'<p>'.form::combo('media_img_title_pattern',$img_title_combo,html::escapeHTML($blog_settings->system->media_img_title_pattern)).'</p>'.
@@ -491,12 +495,12 @@
 	__('Use original media date if possible').'</label></p>'.
 
-	'<h4>'.__('Default image insertion attributes').'</h4>'.
-	'<p><label for="media_img_default_size">'.__('Image size:').
+	'<h5>'.__('Default image insertion attributes').'</h5>'.
+	'<p><label for="media_img_default_size">'.__('Image size:').'</label>'.
 	form::combo('media_img_default_size',$img_default_size_combo,
 		(html::escapeHTML($blog_settings->system->media_img_default_size) != '' ? html::escapeHTML($blog_settings->system->media_img_default_size) : 'm')).
-	'</label></p>'.
-	'<p><label for="media_img_default_alignment">'.__('Image alignment').
+	'</p>'.
+	'<p><label for="media_img_default_alignment">'.__('Image alignment:').'</label>'.
 	form::combo('media_img_default_alignment',$img_default_alignment_combo,html::escapeHTML($blog_settings->system->media_img_default_alignment)).
-	'</label></p>'.
+	'</p>'.
 	'<p><label for="media_img_default_link" class="classic">'.
 	form::checkbox('media_img_default_link','1',$blog_settings->system->media_img_default_link).
@@ -504,9 +508,10 @@
 	'</div>'.
 	'</div>'.
-
-	'</fieldset>';
-	
-	echo
-	'<fieldset><legend>'.__('Search engines robots policy').'</legend>';
+	'<br class="clear" />'. //Opera sucks
+
+	'</div>';
+	
+	echo
+	'<div class="fieldset"><h4>'.__('Search engines robots policy').'</h4>';
 	
 	$i = 0;
@@ -518,5 +523,5 @@
 	}
 	
-	echo '</fieldset>';
+	echo '</div>';
 	
 	
@@ -540,7 +545,7 @@
 	} else {
 		if ($blog_id == $core->blog->id) {
-			echo '<p class="message">'.__('The current blog cannot be deleted').'</p>';
+			echo '<p class="message">'.__('The current blog cannot be deleted.').'</p>';
 		} else {
-			echo '<p class="message">'.__('Only superadmin can delete a blog').'</p>';
+			echo '<p class="message">'.__('Only superadmin can delete a blog.').'</p>';
 		}
 	}
@@ -569,5 +574,14 @@
 			$user_url_p = '%1$s';
 		}
-		
+
+		# Sort users list on user_id key
+		ksort($blog_users);
+
+		$post_type = $core->getPostTypes();
+		$current_blog_id = $core->blog->id;
+		if ($blog_id != $core->blog->id) {
+			$core->setBlog($blog_id);
+		}
+
 		foreach ($blog_users as $k => $v)
 		{
@@ -575,23 +589,47 @@
 			{
 				echo
+				'<div class="user-perm">'.
 				'<h4>'.sprintf($user_url_p,html::escapeHTML($k)).
 				' ('.html::escapeHTML(dcUtils::getUserCN(
 					$k, $v['name'], $v['firstname'], $v['displayname']
 				)).')</h4>';
-				
-				echo '<ul>';
+
+				if ($core->auth->isSuperAdmin()) {
+					echo 
+					'<p>'.__('Email:').' '.
+					($v['email'] != '' ? '<a href="mailto:'.$v['email'].'">'.$v['email'].'</a>' : __('(none)')).
+					'</p>';
+				}
+
+				echo
+				'<h5>'.__('Publications on this blog:').'</h5>'.
+				'<ul>';
+				foreach ($post_type as $type => $pt_info) {
+					$params = array(
+						'post_type' => $type,
+						'user_id' => $k
+						);
+					echo '<li>'.sprintf(__('%1$s: %2$s'),__($pt_info['label']),$core->blog->getPosts($params,true)->f(0)).'</li>';
+				}
+				echo
+				'</ul>';
+
+				echo
+				'<h5>'.__('Permissions:').'</h5>'.
+				'<ul>';
 				if ($v['super']) {
-					echo '<li>'.__('Super administrator').'</li>';
+					echo '<li class="user_super">'.__('Super administrator').'</li>';
 				} else {
 					foreach ($v['p'] as $p => $V) {
-						echo '<li>'.__($perm_types[$p]).'</li>';
+						echo '<li '.($p == 'admin' ? 'class="user_admin"' : '').'>'.__($perm_types[$p]).'</li>';
 					}
 				}
-				echo '</ul>';
+				echo 
+				'</ul>';
 				
 				if (!$v['super'] && $core->auth->isSuperAdmin()) {
 					echo 
 					'<form action="users_actions.php" method="post">'.
-					'<p><input type="submit" value="'.__('Change permissions').'" />'.
+					'<p class="change-user-perm"><input type="submit" class="reset" value="'.__('Change permissions').'" />'.
 					form::hidden(array('redir'),'blog_pref.php?id='.$k).
 					form::hidden(array('action'),'perms').
@@ -602,5 +640,9 @@
 					'</form>';
 				}
+				echo '</div>';
 			}
+		}
+		if ($current_blog_id != $core->blog->id) {
+			$core->setBlog($current_blog_id);
 		}
 	}
Index: admin/blog_theme.php
===================================================================
--- admin/blog_theme.php	(revision 1263)
+++ admin/blog_theme.php	(revision 1553)
@@ -173,7 +173,7 @@
 	'<div class="theme-shot"><img src="'.$screenshot.'" alt="" /></div>'.
 	'<div class="theme-info">'.
-		'<h3>'.form::radio(array('theme',$radio_id),html::escapeHTML($id),$current,'','',($has_parent && !$is_parent_present)).' '.
+		'<h4>'.form::radio(array('theme',$radio_id),html::escapeHTML($id),$current,'','',($has_parent && !$is_parent_present)).' '.
 		'<label class="classic" for="'.$radio_id.'">'.
-		html::escapeHTML($details['name']).'</label></h3>'.
+		html::escapeHTML($details['name']).'</label></h4>'.
 		'<p><span class="theme-desc">'.html::escapeHTML($details['desc']).'</span> '.
 		'<span class="theme-author">'.sprintf(__('by %s'),html::escapeHTML($details['author'])).'</span> '.
@@ -187,5 +187,5 @@
 		}
 		if ($has_css) {
-			$res .= '<a class="theme-css" href="'.$theme_url.'/style.css">'.__('Stylesheet').'</a>';
+			$res .= '<span class="theme-css"><a href="'.$theme_url.'/style.css">'.__('Stylesheet').'</a></span>';
 		}
 		$res .= '</p>';
@@ -207,41 +207,48 @@
 }
 
+if (!$theme_conf_mode)
+{
+	$breadcrumb = dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			'<span class="page-title">'.__('Blog appearance').'</span>' => ''
+		));
+} else {
+	$breadcrumb = dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			__('Blog appearance') => 'blog_theme.php',
+			'<span class="page-title">'.__('Theme configuration').'</span>' => ''
+		));
+}
+
 dcPage::open(__('Blog appearance'),
 	(!$theme_conf_mode ? dcPage::jsLoad('js/_blog_theme.js') : '').
 	dcPage::jsPageTabs($default_tab).
-	dcPage::jsColorPicker()
+	dcPage::jsColorPicker(),
+	$breadcrumb
 );
 
 if (!$theme_conf_mode)
 {
-	echo
-	'<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Blog appearance').'</span></h2>';
-	
 	if (!empty($_GET['upd'])) {
-		dcPage::message(__('Theme has been successfully changed.'));
+		dcPage::success(__('Theme has been successfully changed.'));
 	}
 	
 	if (!empty($_GET['added'])) {
-		dcPage::message(($_GET['added'] == 2 ? __('Theme has been successfully upgraded') : __('Theme has been successfully installed.')));
+		dcPage::success(($_GET['added'] == 2 ? __('Theme has been successfully upgraded') : __('Theme has been successfully installed.')));
 	}
 	
 	if (!empty($_GET['del'])) {
-		dcPage::message(__('Theme has been successfully deleted.'));
-	}
-	
-	if ($can_install) {
-		echo
-		'<p><strong>'.sprintf(__('You can find additional themes for your blog on %s.'),
-		'<a href="http://themes.dotaddict.org/galerie-dc2/">Dotaddict</a>').'</strong> '.
-		__('To install or upgrade a theme you generally just need to upload it '.
-		'in "Install or upgrade a theme" section.').'</p>';
+		dcPage::success(__('Theme has been successfully deleted.'));
 	}
 	
 	# Themes list
-	echo '<div class="multi-part" id="themes-list" title="'.__('Themes').'">';
+	echo '<div class="multi-part" id="themes-list" title="'.__('Themes').'">'.
+	'<h3>'.__('Available themes in your installation').'</h3>';
 	
 	$themes = $core->themes->getModules();
 	if (isset($themes[$core->blog->settings->system->theme])) {
-		echo '<h3>'.sprintf(__('You are currently using "%s"'),$themes[$core->blog->settings->system->theme]['name']).'</h3>';
+		echo '<p>'.sprintf(__('You are currently using <strong>%s</strong>'),$themes[$core->blog->settings->system->theme]['name']).'.</p>';
 	}
 	
@@ -265,13 +272,12 @@
 	
 	echo
-	'<div class="two-cols clear" id="themes-actions">'.
-	$core->formNonce().
-	'<p class="col"><input type="submit" name="select" value="'.__('Use selected theme').'" /></p>';
-	
+	'<div id="themes-actions">'.
+	
+	'<p>'.$core->formNonce().'<input type="submit" name="select" value="'.__('Use selected theme').'" /> ';	
 	if ($can_install) {
-		echo '<p class="col right"><input type="submit" class="delete" name="remove" value="'.__('Delete selected theme').'" /></p>';
-	}
-	
-	echo
+		echo ' <input type="submit" class="delete" name="remove" value="'.__('Delete selected theme').'" />';
+	}
+	echo '</p>'.
+	
 	'</div>'.
 	'</form>'.
@@ -282,36 +288,35 @@
 	{
 		echo
-		'<div class="multi-part clear" id="add-theme" title="'.__('Install or upgrade a theme').'">';
+		'<div class="multi-part clear" id="add-theme" title="'.__('Install or upgrade a theme').'">'.
+		'<h3>'.__('Add themes to your installation').'</h3>'.
+		'<p class="form-note info">'.sprintf(__('You can find additional themes for your blog on %s.'),
+		'<a href="http://themes.dotaddict.org/galerie-dc2/">Dotaddict</a>').'</p>';
 		
 		if ($is_writable)
 		{
-			echo '<p>'.__('You can install themes by uploading or downloading zip files.').'</p>';
+			echo '<p>'.__('You can also install themes by uploading or downloading zip files.').'</p>';
 			
 			# 'Upload theme' form
 			echo
-			'<form method="post" action="blog_theme.php" id="uploadpkg" enctype="multipart/form-data">'.
-			'<fieldset>'.
-			'<legend>'.__('Upload a zip file').'</legend>'.
-			'<p class="field"><label for="pkg_file" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Theme zip file:').' '.
-			'<input type="file" name="pkg_file" id="pkg_file" /></label></p>'.
-			'<p class="field"><label for="your_pwd1" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').' '.
-			form::password(array('your_pwd','your_pwd1'),20,255).'</label></p>'.
-			'<input type="submit" name="upload_pkg" value="'.__('Upload theme').'" />'.
-			$core->formNonce().
-			'</fieldset>'.
+			'<form method="post" action="blog_theme.php" id="uploadpkg" enctype="multipart/form-data" class="fieldset">'.
+			'<h4>'.__('Upload a zip file').'</h4>'.
+			'<p class="field"><label for="pkg_file" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Theme zip file:').'</label> '.
+			'<input type="file" name="pkg_file" id="pkg_file" /></p>'.
+			'<p class="field"><label for="your_pwd1" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label> '.
+			form::password(array('your_pwd','your_pwd1'),20,255).'</p>'.
+			'<p><input type="submit" name="upload_pkg" value="'.__('Upload theme').'" />'.
+			$core->formNonce().'</p>'.
 			'</form>';
 			
 			# 'Fetch theme' form
 			echo
-			'<form method="post" action="blog_theme.php" id="fetchpkg">'.
-			'<fieldset>'.
-			'<legend>'.__('Download a zip file').'</legend>'.
-			'<p class="field"><label for="pkg_url" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Theme zip file URL:').' '.
-			form::field(array('pkg_url','pkg_url'),40,255).'</label></p>'.
-			'<p class="field"><label for="your_pwd2" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').' '.
-			form::password(array('your_pwd','your_pwd2'),20,255).'</label></p>'.
-			'<input type="submit" name="fetch_pkg" value="'.__('Download theme').'" />'.
-			$core->formNonce().
-			'</fieldset>'.
+			'<form method="post" action="blog_theme.php" id="fetchpkg" class="fieldset">'.
+			'<h4>'.__('Download a zip file').'</h4>'.
+			'<p class="field"><label for="pkg_url" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Theme zip file URL:').'</label> '.
+			form::field(array('pkg_url','pkg_url'),40,255).'</p>'.
+			'<p class="field"><label for="your_pwd2" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label> '.
+			form::password(array('your_pwd','your_pwd2'),20,255).'</p>'.
+			'<p><input type="submit" name="fetch_pkg" value="'.__('Download theme').'" />'.
+			$core->formNonce().'</p>'.
 			'</form>';
 		}
@@ -330,8 +335,7 @@
 	$theme_name = $core->themes->moduleInfo($core->blog->settings->system->theme,'name');
 	$core->themes->loadModuleL10Nresources($core->blog->settings->system->theme,$_lang);
+
 	echo
-	'<h2>'.html::escapeHTML($core->blog->name).
-	' &rsaquo; <a href="blog_theme.php">'.__('Blog appearance').'</a> &rsaquo; <span class="page-title">'.__('Theme configuration').'</span></h2>'.
-	'<p><a class="back" href="blog_theme.php">'.__('back').'</a></p>';
+	'<p><a class="back" href="blog_theme.php">'.__('Back to Blog appearance').'</a></p>';
 	
 	try
Index: admin/blogs.php
===================================================================
--- admin/blogs.php	(revision 1179)
+++ admin/blogs.php	(revision 1668)
@@ -73,11 +73,15 @@
 	$starting_script .= dcPage::jsLoad('js/filter-controls.js');
 }
-dcPage::open(__('List of blogs'),$starting_script);
+dcPage::open(__('List of blogs'),$starting_script,
+	dcPage::breadcrumb(
+		array(
+			__('System') => '',
+			'<span class="page-title">'.__('List of blogs').'</span>' => ''
+		))
+);
 
 if (!empty($_GET['del'])) {
-	dcPage::message(__('Blog has been successfully deleted.'));
+	dcPage::success(__('Blog has been successfully deleted.'));
 }
-
-echo '<h2 class="page-title">'.__('List of blogs').'</h2>';
 
 if (!$core->error->flag())
@@ -88,31 +92,31 @@
 	
 	if (!$show_filters) {
-		echo '<p><a id="filter-control" class="form-control" href="#">'.__('Filters').'</a></p>';
+		echo '<p><a id="filter-control" class="form-control" href="#">'.__('Filter blogs list').'</a></p>';
 	}
 	
 	echo
 	'<form action="blogs.php" method="get" id="filters-form">'.
-	'<fieldset class="two-cols"><legend>'.__('Filters').'</legend>'.
+	'<h3 class="hidden">'.__('Filter blogs list').'</h3>'.
 	
-	'<div class="col">'.
-	'<p><label for="sortby">'.__('Order by:').' '.
-	form::combo('sortby',$sortby_combo,html::escapeHTML($sortby)).
-	'</label> '.
-	'<label for="order">'.__('Sort:').' '.
-	form::combo('order',$order_combo,html::escapeHTML($order)).
-	'</label></p>'.
+	'<div class="table">'.
+	'<div class="cell">'.
+	'<h4>'.__('Filters').'</h4>'.
+	'<p><label for="q" class="ib">'.__('Search:').'</label> '.
+	form::field('q',20,255,html::escapeHTML($q)).'</p>'.
 	'</div>'.
 	
-	'<div class="col">'.
-	'<p><label for="q">'.__('Search:').' '.
-	form::field('q',20,255,html::escapeHTML($q)).
-	'</label></p>'.
-	'<p><label for="nb" class="classic">'.	form::field('nb',3,3,$nb_per_page).' '.
-	__('Blogs per page').'</label> '.
-	'<input type="submit" value="'.__('Apply filters').'" /></p>'.
+	'<div class="cell filters-options">'.
+	'<h4>'.__('Display options').'</h4>'.
+	'<p><label for="sortby" class="ib">'.__('Order by:').'</label> '.
+	form::combo('sortby',$sortby_combo,html::escapeHTML($sortby)).'</p>'.
+	'<p><label for="order" class="ib">'.__('Sort:').'</label> '.
+	form::combo('order',$order_combo,html::escapeHTML($order)).'</p>'.
+	'<p><span class="label ib">'.__('Show').'</span> <label for="nb" class="classic">'.	
+	form::field('nb',3,3,$nb_per_page).' '.__('blogs per page').'</label></p>'.
 	'</div>'.
-	
-	'<br class="clear" />'. //Opera sucks
-	'</fieldset>'.
+	'</div>'.
+
+	'<p><input type="submit" value="'.__('Apply filters and display options').'" />'.
+	'<br class="clear" /></p>'. //Opera sucks
 	'</form>';
 	
@@ -127,14 +131,13 @@
 		$pager->var_page = 'page';
 		
-		echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>';
+		echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>';
 		
 		echo
-		'<table class="clear"><tr>'.
-		'<th>'.__('Blog name').'</th>'.
-		'<th class="nowrap">'.__('Last update').'</th>'.
-		'<th class="nowrap">'.__('Entries (all types)').'</th>'.
-		'<th class="nowrap">'.__('Blog ID').'</th>'.
-		'<th>&nbsp;</th>'.
-		'<th class="nowrap">'.__('Status').'</th>'.
+		'<table class="clear"><caption class="hidden">'.__('Blogs list').'</caption><tr>'.
+		'<th scope="col" class="nowrap">'.__('Blog id').'</th>'.
+		'<th scope="col">'.__('Blog name').'</th>'.
+		'<th scope="col" class="nowrap">'.__('Entries (all types)').'</th>'.
+		'<th scope="col" class="nowrap">'.__('Last update').'</th>'.
+		'<th scope="col" class="nowrap">'.__('Status').'</th>'.
 		'</tr>';
 		
@@ -145,5 +148,5 @@
 		echo '</table>';
 		
-		echo '<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>';
+		echo '<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>';
 	}
 }
@@ -160,7 +163,6 @@
 	if ($GLOBALS['core']->auth->isSuperAdmin()) {
 		$edit_link = 
-		'<a href="blog.php?id='.$blog_id.'" '.
-		'title="'.sprintf(__('Edit blog %s'),$blog_id).'">'.
-		__('edit').'</a>';
+		'<a href="blog.php?id='.$blog_id.'"  title="'.sprintf(__('Edit blog settings for %s'),$blog_id).'">'.
+		'<img src="images/edit-mini.png" alt="'.__('Edit blog settings').'" /> '.$blog_id.'</a> ';
 	}
 	
@@ -173,11 +175,10 @@
 	return
 	'<tr class="line">'.
+	'<td class="nowrap">'.$edit_link.'</td>'.
 	'<td class="maximal"><a href="index.php?switchblog='.$rs->blog_id.'" '.
 	'title="'.sprintf(__('Switch to blog %s'),$rs->blog_id).'">'.
 	html::escapeHTML($rs->blog_name).'</a></td>'.
-	'<td class="nowrap">'.$blog_upddt.'</td>'.
-	'<td class="nowrap">'.$core->countBlogPosts($rs->blog_id).'</td>'.
-	'<td class="nowrap">'.$blog_id.'</td>'.
-	'<td>'.$edit_link.'</td>'.
+	'<td class="nowrap count">'.$core->countBlogPosts($rs->blog_id).'</td>'.
+	'<td class="nowrap count">'.$blog_upddt.'</td>'.
 	'<td class="status">'.$img_status.'</td>'.
 	'</tr>';
Index: admin/categories.php
===================================================================
--- admin/categories.php	(revision 1421)
+++ admin/categories.php	(revision 1719)
@@ -15,42 +15,55 @@
 dcPage::check('categories');
 
-# Remove a category
-if (!empty($_POST['del_cat']))
-{
-	try
-	{
-		# Check if category to delete exists
-		$c = $core->blog->getCategory((integer) $_POST['del_cat']);
-		if ($c->isEmpty()) {
-			throw new Exception(__('This category does not exist.'));
-		}
-		unset($c);
-		
+# Remove a categories
+if (!empty($_POST['categories']) && !empty($_POST['delete'])) {
+	try {
 		# Check if category where to move posts exists
-		$mov_cat = (integer) $_POST['mov_cat'];
+		$mov_cat = (int) $_POST['mov_cat'];
 		$mov_cat = $mov_cat ? $mov_cat : null;
 		if ($mov_cat !== null) {
-			$c = $core->blog->getCategory((integer) $_POST['mov_cat']);
+			$c = $core->blog->getCategory($mov_cat);
 			if ($c->isEmpty()) {
-				throw new Exception(__('This category does not exist.'));
-			}
-			if ($mov_cat == $_POST['del_cat']) {
+				throw new Exception(__('Category where to move posts does not exist'));
+			}
+			unset($c);
+
+			if (in_array($mov_cat, $_POST['categories'])) {
 				throw new Exception(__('The entries cannot be moved to the category you choose to delete.'));
 			}
+		}
+
+		foreach ($_POST['categories'] as $cat_id) {
+			# Check if category to delete exists
+			$c = $core->blog->getCategory((integer) $cat_id);
+			if ($c->isEmpty()) {
+				continue;
+			}
 			unset($c);
-		}
-		
-		# Move posts
-		$core->blog->changePostsCategory($_POST['del_cat'],$mov_cat);
-		
-		# Delete category
-		$core->blog->delCategory($_POST['del_cat']);
-		
-		http::redirect('categories.php?del=1');
-	}
-	catch (Exception $e)
-	{
+
+			# Move posts
+			if ($mov_cat != $cat_id) {
+			        $core->blog->changePostsCategory($cat_id,$mov_cat);
+			}
+
+			# Delete category
+			$core->blog->delCategory($cat_id);
+		}
+		http::redirect('categories.php?del='.count($_POST['categories']));
+	} catch (Exception $e) {
 		$core->error->add($e->getMessage());
 	}
+}
+
+# Update order
+if (!empty($_POST['save_order']) && !empty($_POST['categories_order'])) {
+	$categories = json_decode($_POST['categories_order']);
+
+	foreach ($categories as $category) {
+		if (!empty($category->item_id)) {
+			$core->blog->updCategoryPosition($category->item_id, $category->left, $category->right);
+		}
+	}
+
+	http::redirect('categories.php?reord=1');
 }
 
@@ -69,49 +82,59 @@
 }
 
+
 /* Display
 -------------------------------------------------------- */
-dcPage::open(__('Categories'),
-	dcPage::jsToolMan()."\n".
-	dcPage::jsLoad('js/_categories.js')
+$rs = $core->blog->getCategories(array('post_type'=>'post'));
+
+$starting_script = "";
+if (!$core->auth->user_prefs->accessibility->nodragdrop
+	&& $core->auth->check('categories',$core->blog->id)
+	&& $rs->count()>1) {
+		$starting_script .= dcPage::jsLoad('js/jquery/jquery-ui.custom.js');
+		$starting_script .= dcPage::jsLoad('js/jquery/jquery.mjs.nestedSortable.js');
+}
+$starting_script .= dcPage::jsLoad('js/_categories.js');
+
+dcPage::open(__('Categories'),$starting_script,
+	dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			'<span class="page-title">'.__('Categories').'</span>' => ''
+		))
 );
 
-if (!empty($_GET['add'])) {
-	dcPage::message(__('The category has been successfully created.'));
-}
 if (!empty($_GET['del'])) {
-	dcPage::message(__('The category has been successfully removed.'));
+        dcPage::success(__('The category has been successfully removed.',
+			   'The categories have been successfully removed.',
+			   (int) $_GET['del']
+			   )
+			);
 }
 if (!empty($_GET['reord'])) {
-	dcPage::message(__('Categories have been successfully reordered.'));
-}
-if (!empty($_GET['moved'])) {
-	dcPage::message(__('The category has been successfully moved.'));
-}
-
-echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Categories').'</span></h2>';
-
-$rs = $core->blog->getCategories(array('post_type'=>'post'));
+	dcPage::success(__('Categories have been successfully reordered.'));
+}
+$categories_combo = dcAdminCombos::getCategoriesCombo($rs);
 
 echo
-'<div class="two-cols">'.
+'<p class="top-add"><a class="button add" href="category.php">'.__('New category').'</a></p>';
+
+echo
 '<div class="col">';
 if ($rs->isEmpty())
 {
-	echo '<p>'.__('No category yet.').'</p>';
+	echo '<p>'.__('No category so far.').'</p>';
 }
 else
 {
 	echo
-	'<h3>'.__('Categories list').'</h3>'.
+	'<form action="categories.php" method="post" id="form-categories">'.
+	'<h3>'.__('List of blog\'s categories').'</h3>'.
 	'<div id="categories">';
-	
+
 	$ref_level = $level = $rs->level-1;
 	while ($rs->fetch())
 	{
-		$attr = 'id="cat'.$rs->cat_id.'"';
-		if ($rs->nb_total == 0) {
-			$attr .= ' class="deletable"';
-		}
-		
+		$attr = 'id="cat_'.$rs->cat_id.'"';
+
 		if ($rs->level > $level) {
 			echo str_repeat('<ul><li '.$attr.'>',$rs->level - $level);
@@ -119,76 +142,60 @@
 			echo str_repeat('</li></ul>',-($rs->level - $level));
 		}
-		
+
 		if ($rs->level <= $level) {
 			echo '</li><li '.$attr.'>';
 		}
-		
+
 		echo
-		'<p><strong><a href="category.php?id='.$rs->cat_id.'">'.html::escapeHTML($rs->cat_title).'</a></strong>'.
+		'<p>'.
+		form::checkbox(array('categories[]','cat-'.$rs->cat_id),$rs->cat_id,null,$rs->nb_total>0?'notempty':'').
+		'<label class="classic" for="cat-'.$rs->cat_id.'"><a href="category.php?id='.$rs->cat_id.'">'.html::escapeHTML($rs->cat_title).'</a></label>'.
 		' (<a href="posts.php?cat_id='.$rs->cat_id.'">'.
 		sprintf(($rs->nb_post > 1 ? __('%d entries') : __('%d entry') ),$rs->nb_post).'</a>'.
-		', '.__('total:').' '.$rs->nb_total.')</p>'.
-		'<p>'.__('URL:').' '.html::escapeHTML($rs->cat_url).'</p>';
-		
+		', '.__('total:').' '.$rs->nb_total.') '.
+		'<span class="cat-url">'.__('URL:').' <code>'.html::escapeHTML($rs->cat_url).'</code></span></p>';
+
 		$level = $rs->level;
 	}
-	
+
 	if ($ref_level - $level < 0) {
 		echo str_repeat('</li></ul>',-($ref_level - $level));
 	}
-	echo '</div>';
-}
-echo '</div>';
-
-$categories_combo = array();
-if (!$rs->isEmpty())
-{
-	while ($rs->fetch()) {
-		$catparents_combo[] = $categories_combo[] = new formSelectOption(
-			str_repeat('&nbsp;&nbsp;',$rs->level-1).($rs->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($rs->cat_title),
-			$rs->cat_id
-		);
-	}
-}
-
-echo '<div class="col">'.
-
-'<form action="category.php" method="post">'.
-'<fieldset><legend>'.__('Add a new category').'</legend>'.
-'<p><label class="required" for="cat_title"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').' '.
-form::field('cat_title',30,255,'','maximal').'</label></p>'.
-'<p><label for="new_cat_parent">'.__('Parent:').' '.
-form::combo('new_cat_parent',array_merge(array(__('(No cat)') => 0),$categories_combo),'','maximal').
-'</label></p>'.
-'<p><input type="submit" value="'.__('Create').'" /></p>'.
-$core->formNonce().
-'</fieldset>'.
-'</form>';
-
-if (!$rs->isEmpty())
-{
-	echo
-	'<form action="categories.php" method="post" id="delete-category">'.
-	'<fieldset><legend>'.__('Remove a category').'</legend>'.
-	'<p><label for="del_cat">'.__('Choose a category to remove:').' '.
-	form::combo('del_cat',$categories_combo,'','maximal').'</label></p> '.
-	'<p><label for="mov_cat">'.__('And choose the category which will receive its entries:').' '.
-	form::combo('mov_cat',array_merge(array(__('(No cat)') => ''),$categories_combo),'','maximal').'</label></p> '.
-	'<p><input type="submit" value="'.__('Delete').'" class="delete" /></p>'.
-	$core->formNonce().
-	'</fieldset>'.
+	echo
+	'</div>';
+
+	echo
+	'<div class="two-cols">'.
+	'<p class="col checkboxes-helpers"></p>'.
+	'<p class="col right" id="mov-cat">'.
+	'<label for="mov_cat" class="classic">'.__('Category which will receive entries of deleted categories:').'</label> '.
+	form::combo('mov_cat',$categories_combo,'','').
+	'</p>'.
+	'<p class="right">'.
+	'<input type="submit" class="delete" name="delete" value="'.__('Delete selected categories').'"/>'.
+	'</p>'.
+	'</div>';
+
+	echo '<h3 class="clear hidden-if-no-js">'.__('Categories order').'</h3>';
+
+	if ($core->auth->check('categories',$core->blog->id) && $rs->count()>1) {
+		if (!$core->auth->user_prefs->accessibility->nodragdrop) {
+			echo '<p class="hidden-if-no-js">'.__('To rearrange categories order, move items by drag and drop, then click on “Save categories order” button.').'</p>';
+		}
+		echo
+		'<p class="hidden-if-no-js">'.
+		'<input type="hidden" id="categories_order" name="categories_order" value=""/>'.
+		'<input type="submit" name="save_order" id="save-set-order" value="'.__('Save categories order').'" />'.
+		'</p>';
+	}
+
+	echo
+	'<p class="hidden-if-js right"><input type="submit" name="reset" value="'.__('Reorder all categories on the top level and delete selected categories').'" />'.
+	$core->formNonce().'</p>'.
+	'<p class="hidden-if-no-js"><input type="submit" name="reset" value="'.__('Reorder all categories on the top level').'" />'.
+	$core->formNonce().'</p>'.
 	'</form>';
-	
-	echo
-	'<form action="categories.php" method="post" id="reset-order">'.
-	'<fieldset><legend>'.__('Reorder categories').'</legend>'.
-	'<p>'.__('This will relocate all categories on the top level').'</p> '.
-	'<p><input type="submit" value="'.__('Reorder').'" /></p>'.
-	form::hidden(array('reset'),1).
-	$core->formNonce().
-	'</fieldset>'.
-	'</form>';
-}
-echo '</div>';
+}
+
 echo '</div>';
 
Index: admin/category.php
===================================================================
--- admin/category.php	(revision 1179)
+++ admin/category.php	(revision 1571)
@@ -157,34 +157,32 @@
 $title = $cat_id ? html::escapeHTML($cat_title) : __('New category');
 
+$elements = array(
+	html::escapeHTML($core->blog->name) => '',
+	__('Categories') => 'categories.php'
+	);
+if ($cat_id) {
+	while($parents->fetch()) {
+		$elements[html::escapeHTML($parents->cat_title)] = 'category.php?id='.$parents->cat_id;
+	}
+}
+$elements['<span class="page-title">'.$title.'</span>'] = '';
+
 dcPage::open($title,
 	dcPage::jsConfirmClose('category-form').
 	dcPage::jsToolBar().
-	dcPage::jsLoad('js/_category.js')
+	dcPage::jsLoad('js/_category.js'),
+	dcPage::breadcrumb($elements)
 );
 
 if (!empty($_GET['upd'])) {
-	dcPage::message(__('Category has been successfully updated.'));
-}
-
-echo
-'<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <a href="categories.php">'.
-__('Categories').'</a> &rsaquo; ';
-
-if ($cat_id)
-{
-	while($parents->fetch()) {
-		echo '<a href="category.php?id='.$parents->cat_id.'">'.html::escapeHTML($parents->cat_title).'</a>';
-		echo " &rsaquo; ";
-	}
-}
-
-echo '<span class="page-title">'.$title.'</span></h2>';
+	dcPage::success(__('Category has been successfully updated.'));
+}
 
 echo
 '<form action="category.php" method="post" id="category-form">'.
-'<fieldset><legend>'.__('Category information').'</legend>'.
-'<p><label class="required" for="cat_title"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').' '.
+'<h3>'.__('Category information').'</h3>'.
+'<p><label class="required" for="cat_title"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label> '.
 form::field('cat_title',40,255,html::escapeHTML($cat_title)).
-'</label></p>';
+'</p>';
 if (!$cat_id)
 {
@@ -193,8 +191,8 @@
 	'<p><label for="new_cat_parent">'.__('Parent:').' '.
 	'<select id="new_cat_parent" name="new_cat_parent" >'.
-	'<option value="0">'.__('Top level').'</option>';
+	'<option value="0">'.__('(none)').'</option>';
 	while ($rs->fetch()) {
 		echo '<option value="'.$rs->cat_id.'" '.(!empty($_POST['new_cat_parent']) && $_POST['new_cat_parent'] == $rs->cat_id ? 'selected="selected"' : '').'>'.
-		str_repeat('&nbsp;&nbsp;',$rs->level).html::escapeHTML($rs->cat_title).'</option>';
+		str_repeat('&nbsp;&nbsp;',$rs->level-1).($rs->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($rs->cat_title).'</option>';	
 	}
 	echo
@@ -204,6 +202,7 @@
 echo
 '<div class="lockable">'.
-'<p><label for="cat_url">'.__('URL:').' '.form::field('cat_url',40,255,html::escapeHTML($cat_url)).
-'</label></p>'.
+'<p><label for="cat_url">'.__('URL:').'</label> '
+.form::field('cat_url',40,255,html::escapeHTML($cat_url)).
+'</p>'.
 '<p class="form-note warn" id="note-cat-url">'.
 __('Warning: If you set the URL manually, it may conflict with another category.').'</p>'.
@@ -218,5 +217,4 @@
 $core->formNonce().
 '</p>'.
-'</fieldset>'.
 '</form>';
 
@@ -224,15 +222,14 @@
 {
 	echo
-	'<h3>'.__('Move this category').'</h3>'.
+	'<h3 class="border-top">'.__('Move this category').'</h3>'.
 	'<div class="two-cols">'.
 	'<div class="col">'.
 	
-	'<form action="category.php" method="post">'.
-	'<fieldset><legend>'.__('Category parent').'</legend>'.
-	'<p><label for="cat_parent" class="classic">'.__('Parent:').' '.
-	form::combo('cat_parent',$allowed_parents,$cat_parent).'</label></p>'.
+	'<form action="category.php" method="post" class="fieldset">'.
+	'<h4>'.__('Category parent').'</h4>'.
+	'<p><label for="cat_parent" class="classic">'.__('Parent:').'</label> '.
+	form::combo('cat_parent',$allowed_parents,$cat_parent).'</p>'.
 	'<p><input type="submit" accesskey="s" value="'.__('Save').'" />'.
 	form::hidden(array('id'),$cat_id).$core->formNonce().'</p>'.
-	'</fieldset>'.
 	'</form>'.
 	'</div>';
@@ -241,6 +238,6 @@
 		echo
 		'<div class="col">'.
-		'<form action="category.php" method="post">'.
-		'<fieldset><legend>'.__('Category sibling').'</legend>'.
+		'<form action="category.php" method="post" class="fieldset">'.
+		'<h4>'.__('Category sibling').'</h4>'.
 		'<p><label class="classic" for="cat_sibling">'.__('Move current category').'</label> '.
 		form::combo('cat_move',array(__('before')=>'before',__('after')=>'after'),'','','',false,'title="'.__('position: ').'"').' '.
@@ -248,5 +245,4 @@
 		'<p><input type="submit" accesskey="s" value="'.__('Save').'" />'.
 		form::hidden(array('id'),$cat_id).$core->formNonce().'</p>'.
-		'</fieldset>'.
 		'</form>'.
 		'</div>';
Index: admin/comment.php
===================================================================
--- admin/comment.php	(revision 1179)
+++ admin/comment.php	(revision 1719)
@@ -26,8 +26,7 @@
 $comment_spam_status = '';
 
+
 # Status combo
-foreach ($core->blog->getAllCommentStatus() as $k => $v) {
-	$status_combo[$v] = (string) $k;
-}
+$status_combo = dcAdminCombos::getCommentStatusescombo();
 
 # Adding comment
@@ -160,4 +159,20 @@
 /* DISPLAY
 -------------------------------------------------------- */
+if ($comment_id) {
+	$breadcrumb = dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			html::escapeHTML($post_title) => $core->getPostAdminURL($post_type,$post_id).'&amp;co=1#c'.$comment_id,
+			'<span class="page-title">'.__('Edit comment').'</span>' => ''
+		));
+} else {
+	$breadcrumb = dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			html::escapeHTML($post_title) => $core->getPostAdminURL($post_type,$post_id),
+			'<span class="page-title">'.__('Edit comment').'</span>' => ''
+		));
+}
+
 dcPage::open(__('Edit comment'),
 	dcPage::jsConfirmClose('comment-form').
@@ -165,5 +180,6 @@
 	dcPage::jsLoad('js/_comment.js').
 	# --BEHAVIOR-- adminCommentHeaders
-	$core->callBehavior('adminCommentHeaders')
+	$core->callBehavior('adminCommentHeaders'),
+	$breadcrumb
 );
 
@@ -171,5 +187,5 @@
 {
 	if (!empty($_GET['upd'])) {
-		dcPage::message(__('Comment has been successfully updated.'));
+		dcPage::success(__('Comment has been successfully updated.'));
 	}
 	
@@ -183,33 +199,33 @@
 		.'">'.__('Send an e-mail').'</a>';
 	}
-	
-	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
 	'<form action="comment.php" method="post" id="comment-form">'.
-	'<p>'.__('IP address:').'<br /> '.
+	'<div class="fieldset">'.
+	'<h3>'.__('Information collected').'</h3>'.
+	'<p>'.__('IP address:').' '.
 	'<a href="comments.php?ip='.$comment_ip.'">'.$comment_ip.'</a></p>'.
 	
-	'<p>'.__('Date:').'<br /> '.
+	'<p>'.__('Date:').' '.
 	dt::dt2str(__('%Y-%m-%d %H:%M'),$comment_dt).'</p>'.
-	
-	'<p><label for="comment_author" class="required"><abbr title="'.__('Required field').'">*</abbr>'.__('Author:').
+	'</div>'.
+
+	'<h3>'.__('Comment submitted').'</h3>'.	
+	'<p><label for="comment_author" class="required"><abbr title="'.__('Required field').'">*</abbr>'.__('Author:').'</label>'.
 	form::field('comment_author',30,255,html::escapeHTML($comment_author)).
-	'</label></p>'.
-	
-	'<p><label for="comment_email">'.__('Email:').
+	'</p>'.
+	
+	'<p><label for="comment_email">'.__('Email:').'</label>'.
 	form::field('comment_email',30,255,html::escapeHTML($comment_email)).
-	$comment_mailto.
-	'</label></p>'.
-	
-	'<p><label for="comment_site">'.__('Web site:').
+	'<span>'.$comment_mailto.'</span>'.
+	'</p>'.
+	
+	'<p><label for="comment_site">'.__('Web site:').'</label>'.
 	form::field('comment_site',30,255,html::escapeHTML($comment_site)).
-	'</label></p>'.
-	
-	'<p><label for="comment_status">'.__('Status:').
+	'</p>'.
+	
+	'<p><label for="comment_status">'.__('Status:').'</label>'.
 	form::combo('comment_status',$status_combo,$comment_status,'','',!$can_publish).
-	'</label></p>'.
+	'</p>'.
 	
 	# --BEHAVIOR-- adminAfterCommentDesc
Index: admin/comments.php
===================================================================
--- admin/comments.php	(revision 1179)
+++ admin/comments.php	(revision 1719)
@@ -28,15 +28,14 @@
 # Creating filter combo boxes
 # Filter form we'll put in html_block
-$status_combo = array(
-'-' => ''
-);
-foreach ($core->blog->getAllCommentStatus() as $k => $v) {
-	$status_combo[$v] = (string) $k;
-}
+$status_combo = array_merge(
+	array('-' => ''),
+	dcAdminCombos::getCommentStatusescombo()
+);
+
 
 $type_combo = array(
 '-' => '',
-__('comment') => 'co',
-__('trackback') => 'tb'
+__('Comment') => 'co',
+__('Trackback') => 'tb'
 );
 
@@ -134,8 +133,8 @@
 if ($core->auth->check('publish,contentadmin',$core->blog->id))
 {
-	$combo_action[__('publish')] = 'publish';
-	$combo_action[__('unpublish')] = 'unpublish';
-	$combo_action[__('mark as pending')] = 'pending';
-	$combo_action[__('mark as junk')] = 'junk';
+	$combo_action[__('Publish')] = 'publish';
+	$combo_action[__('Unpublish')] = 'unpublish';
+	$combo_action[__('Mark as pending')] = 'pending';
+	$combo_action[__('Mark as junk')] = 'junk';
 }
 if ($core->auth->check('delete,contentadmin',$core->blog->id))
@@ -169,7 +168,11 @@
 $starting_script .= $core->callBehavior('adminCommentsHeaders');
 
-dcPage::open(__('Comments and trackbacks'),$starting_script);
-
-echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Comments and trackbacks').'</span></h2>';
+dcPage::open(__('Comments and trackbacks'),$starting_script,
+	dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			'<span class="page-title">'.__('Comments and trackbacks').'</span>' => ''
+		))
+);
 
 if (!$core->error->flag())
@@ -179,49 +182,4 @@
 		unset($_SESSION['comments_del_spam']);
 	}
-	
-	# Filters
-	if (!$show_filters) {
-		echo '<p><a id="filter-control" class="form-control" href="#">'.
-		__('Filters').'</a></p>';
-	}
-	
-	echo
-	'<form action="comments.php" method="get" id="filters-form">'.
-	'<fieldset><legend>'.__('Filters').'</legend>'.
-	'<div class="three-cols">'.
-	'<div class="col">'.
-	'<label for="type">'.__('Type:').' '.
-	form::combo('type',$type_combo,$type).
-	'</label> '.
-	'<label for="status">'.__('Status:').' '.
-	form::combo('status',$status_combo,$status).
-	'</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).' '.
-	__('Comments per page').'</label></p>'.
-	'</div>'.
-	
-	'<div class="col">'.
-	'<p><label for="author">'.__('Comment author:').' '.
-	form::field('author',20,255,html::escapeHTML($author)).
-	'</label>'.
-	'<label for="ip">'.__('IP address:').' '.
-	form::field('ip',20,39,html::escapeHTML($ip)).
-	'</label></p>'.
-	'<p><input type="submit" value="'.__('Apply filters').'" /></p>'.
-	'</div>'.
-	
-	'</div>'.
-	'<br class="clear" />'. //Opera sucks
-	'</fieldset>'.
-	'</form>';
 	
 	$spam_count = $core->blog->getComments(array('comment_status'=>-2),true)->f(0);
@@ -233,13 +191,14 @@
 		if (!$with_spam || ($status != -2)) {
 			if ($spam_count == 1) {
-				echo '<p>'.sprintf(__('You have one spam comments.'),'<strong>'.$spam_count.'</strong>').' '.
-				'<a href="comments.php?status=-2">'.__('Show it.').'</a></p>';
+				echo '<p>'.sprintf(__('You have one spam comment.'),'<strong>'.$spam_count.'</strong>').' '.
+				'<a href="comments.php?status=-2">'.__('Show it.').'</a>.</p>';
 			} elseif ($spam_count > 1) {
 				echo '<p>'.sprintf(__('You have %s spam comments.'),'<strong>'.$spam_count.'</strong>').' '.
-				'<a href="comments.php?status=-2">'.__('Show them.').'</a></p>';
+				'<a href="comments.php?status=-2">'.__('Show them.').'</a>.</p>';
 			}
 		}
 		
 		echo
+			'<p class="no-margin">'.
 			$core->formNonce().
 			'<input name="delete_all_spam" class="delete" type="submit" value="'.__('Delete all spams').'" /></p>';
@@ -250,4 +209,46 @@
 		echo '</form>';
 	}
+
+	# Filters
+	if (!$show_filters) {
+		echo '<p><a id="filter-control" class="form-control" href="#">'.
+		__('Filter comments and trackbacks list').'</a></p>';
+	}
+	
+	echo
+	'<form action="comments.php" method="get" id="filters-form">'.
+	'<h3 class="hidden">'.__('Filter comments and trackbacks list').'</h3>'.
+	'<div class="table">'.
+
+	'<div class="cell">'.
+	'<h4>'.__('Filters').'</h4>'.
+	'<p><label for="type" class="ib">'.__('Type:').'</label> '.
+	form::combo('type',$type_combo,$type).'</p> '.
+	'<p><label for="status" class="ib">'.__('Status:').'</label> '.
+	form::combo('status',$status_combo,$status).'</p>'.
+	'</div>'.
+	
+	'<div class="cell filters-sibling-cell">'.
+	'<p><label for="author" class="ib">'.__('Author:').'</label> '.
+	form::field('author',20,255,html::escapeHTML($author)).'</p>'.
+	'<p><label for="ip" class="ib">'.__('IP address:').'</label> '.
+	form::field('ip',20,39,html::escapeHTML($ip)).'</p>'.
+	'</div>'.
+	
+	'<div class="cell filters-options">'.
+	'<h4>'.__('Display options').'</h4>'.
+	'<p><label for="sortby" class="ib">'.__('Order by:').'</label> '.
+	form::combo('sortby',$sortby_combo,$sortby).'</p>'.
+	'<p><label for="order" class="ib">'.__('Sort:').'</label> '.
+	form::combo('order',$order_combo,$order).'</p>'.
+	'<p><span class="label ib">Afficher</span> <label for="nb" class="classic">'.
+	form::field('nb',3,3,$nb_per_page).' '.
+	__('comments per page').'</label></p>'.
+	'</div>'.
+	
+	'</div>'.
+	'<p><input type="submit" value="'.__('Apply filters and display options').'" />'.
+	'<br class="clear" /></p>'. //Opera sucks
+	'</form>';
 	
 	# Show comments
@@ -261,5 +262,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,$default,'','','','title="'.__('Actions').'"').
 	$core->formNonce().
 	'<input type="submit" value="'.__('ok').'" /></p>'.
Index: admin/comments_actions.php
===================================================================
--- admin/comments_actions.php	(revision 1179)
+++ admin/comments_actions.php	(revision 1474)
@@ -137,5 +137,5 @@
 $core->callBehavior('adminCommentsActionsContent',$core,$action,$hidden_fields);
 
-echo '<p><a class="back" href="'.str_replace('&','&amp;',$redir).'">'.__('back').'</a></p>';
+echo '<p><a class="back" href="'.str_replace('&','&amp;',$redir).'">'.__('Back to comments list').'</a></p>';
 
 dcPage::close();
Index: admin/index.php
===================================================================
--- admin/index.php	(revision 1730)
+++ admin/index.php	(revision 1731)
@@ -63,4 +63,11 @@
 	$core->auth->user_prefs->dashboard->put('quickentry',false,'boolean');
 }
+
+// Handle folded/unfolded sections in admin from user preferences
+$ws = $core->auth->user_prefs->addWorkspace('toggles');
+if (!$core->auth->user_prefs->toggles->prefExists('unfolded_sections')) {
+	$core->auth->user_prefs->toggles->put('unfolded_sections','','string','Folded sections in admin',null,true);
+}
+
 
 # Dashboard icons
@@ -121,20 +128,5 @@
 $__dashboard_items = new ArrayObject(array(new ArrayObject,new ArrayObject));
 
-# Documentation links
 $dashboardItem = 0;
-if ($core->auth->user_prefs->dashboard->doclinks) {
-	if (!empty($__resources['doc']))
-	{
-		$doc_links = '<h3>'.__('Documentation and support').'</h3><ul>';
-	
-		foreach ($__resources['doc'] as $k => $v) {
-			$doc_links .= '<li><a href="'.$v.'" title="'.$k.' '.__('(external link)').'">'.$k.'</a></li>';
-		}
-	
-		$doc_links .= '</ul>';
-		$__dashboard_items[$dashboardItem][] = $doc_links;
-		$dashboardItem++;
-	}
-}
 
 if ($core->auth->user_prefs->dashboard->dcnews) {
@@ -152,10 +144,10 @@
 		if ($feed)
 		{
-			$latest_news = '<h3>'.__('Latest news').'</h3><dl id="news">';
+			$latest_news = '<h3>'.__('Dotclear news').'</h3><dl id="news">';
 			$i = 1;
 			foreach ($feed->items as $item)
 			{
-				$dt = isset($item->link) ? '<a href="'.$item->link.'" title="'.$item->title.' '.__('(external link)').'">'.
-					$item->title.'</a>' : $item->title;
+				$dt = isset($item->link) ? '<a href="'.$item->link.'" title="'.$item->title.' ('.__('new window').')">'.
+					$item->title.' <img src="images/outgoing-blue.png" alt="" /></a>' : $item->title;
 			
 				if ($i < 3) {
@@ -180,4 +172,21 @@
 }
 
+# Documentation links
+if ($core->auth->user_prefs->dashboard->doclinks) {
+	if (!empty($__resources['doc']))
+	{
+		$doc_links = '<h3>'.__('Documentation and support').'</h3><ul>';
+	
+		foreach ($__resources['doc'] as $k => $v) {
+			$doc_links .= '<li><a href="'.$v.'" title="'.$k.' ('.__('new window').')">'.$k.
+			' <img src="images/outgoing-blue.png" alt="" /></a></li>';
+		}
+	
+		$doc_links .= '</ul>';
+		$__dashboard_items[$dashboardItem][] = $doc_links;
+		$dashboardItem++;
+	}
+}
+
 $core->callBehavior('adminDashboardItems', $core, $__dashboard_items);
 
@@ -193,8 +202,29 @@
 	dcPage::jsLoad('js/_index.js').
 	# --BEHAVIOR-- adminDashboardHeaders
-	$core->callBehavior('adminDashboardHeaders')
+	$core->callBehavior('adminDashboardHeaders'),
+	dcPage::breadcrumb(
+		array(
+		'<span class="page-title">'.__('Dashboard').' : '.html::escapeHTML($core->blog->name).'</span>' => ''
+		),
+		false)
 );
 
-echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Dashboard').'</span></h2>';
+# Dotclear updates notifications
+if ($core->auth->isSuperAdmin() && is_readable(DC_DIGESTS))
+{
+	$updater = new dcUpdate(DC_UPDATE_URL,'dotclear',DC_UPDATE_VERSION,DC_TPL_CACHE.'/versions');
+	$new_v = $updater->check(DC_VERSION);
+	$version_info = $new_v ? $updater->getInfoURL() : '';
+
+	if ($updater->getNotify() && $new_v) {
+		echo
+		'<div class="dc-update"><h3>'.sprintf(__('Dotclear %s is available!'),$new_v).'</h3> '.
+		'<p><a class="button submit" href="update.php">'.sprintf(__('Upgrade now'),$new_v).'</a> '.
+		'<a href="update.php?hide_msg=1">'.__('Remind me later').'</a>'.
+		($version_info ? ' </p>'.
+		'<p><a href="'.$version_info.'" class="info">'.__('information about this version').'</a>' : '').'</p>'.
+		'</div>';
+	}
+}
 
 if ($core->auth->getInfo('user_default_blog') != $core->blog->id && $core->auth->blog_count > 1) {
@@ -204,7 +234,7 @@
 
 if ($core->blog->status == 0) {
-	echo '<p class="static-msg">'.__('This blog is offline').'</p>';
+	echo '<p class="static-msg">'.__('This blog is offline').'.</p>';
 } elseif ($core->blog->status == -1) {
-	echo '<p class="static-msg">'.__('This blog is removed').'</p>';
+	echo '<p class="static-msg">'.__('This blog is removed').'.</p>';
 }
 
@@ -272,25 +302,4 @@
 	echo '</ul></div>';
 }
-
-# Dashboard columns (processed first, as we need to know the result before displaying the icons.)
-$dashboardItems = '';
-
-# Dotclear updates notifications
-if ($core->auth->isSuperAdmin() && is_readable(DC_DIGESTS))
-{
-	$updater = new dcUpdate(DC_UPDATE_URL,'dotclear',DC_UPDATE_VERSION,DC_TPL_CACHE.'/versions');
-	$new_v = $updater->check(DC_VERSION);
-	$version_info = $new_v ? $updater->getInfoURL() : '';
-	
-	if ($updater->getNotify() && $new_v) {
-		$dashboardItems .=
-		'<div id="upg-notify" class="static-msg"><p>'.sprintf(__('Dotclear %s is available!'),$new_v).'</p> '.
-		'<ul><li><strong><a href="update.php">'.sprintf(__('Upgrade now'),$new_v).'</a></strong>'.
-		'</li><li><a href="update.php?hide_msg=1">'.__('Remind me later').'</a>'.
-		($version_info ? ' </li><li>'.sprintf(__('<a href="%s">Information about this version</a>.'),$version_info) : '').
-		'</li></ul></div>';
-	}
-}
-
 # Errors modules notifications
 if ($core->auth->isSuperAdmin())
@@ -302,10 +311,12 @@
 	
 	if (count($list) > 0) {
-		$dashboardItems .=
-		'<div id="module-errors" class="error"><p>'.__('Some plugins are installed twice:').'</p> '.
+		echo 
+		'<div class="error" id="module-errors" class="error"><p>'.__('Some plugins are installed twice:').'</p> '.
 		'<ul>'.implode("\n",$list).'</ul></div>';
 	}
-	
-}
+}
+
+# Dashboard columns (processed first, as we need to know the result before displaying the icons.)
+$dashboardItems = '';
 
 foreach ($__dashboard_items as $i)
@@ -313,5 +324,5 @@
 	if ($i->count() > 0)
 	{
-		$dashboardItems .= '<div>';
+		$dashboardItems .= '<div class="db-box">';
 		foreach ($i as $v) {
 			$dashboardItems .= $v;
@@ -322,5 +333,5 @@
 
 # Dashboard icons
-echo '<div id="dashboard-main"'.($dashboardItems ? '' : ' class="fullwidth"').'><div id="icons">';
+echo '<div id="dashboard-main"><div id="icons">';
 foreach ($__dashboard_icons as $i)
 {
@@ -335,40 +346,31 @@
 	{
 		# Getting categories
-		$categories_combo = array(__('(No cat)') => '');
-		try {
-			$categories = $core->blog->getCategories(array('post_type'=>'post'));
-			if (!$categories->isEmpty()) {
-				while ($categories->fetch()) {
-					$catparents_combo[] = $categories_combo[] = new formSelectOption(
-						str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title),
-						$categories->cat_id
-					);
-				}
-			}
-		} catch (Exception $e) { }
-		
+		$categories_combo = dcAdminCombos::getCategoriesCombo(
+			$core->blog->getCategories(array('post_type'=>'post'))
+		);
+	
 		echo
 		'<div id="quick">'.
 		'<h3>'.__('Quick entry').'</h3>'.
-		'<form id="quick-entry" action="post.php" method="post">'.
-		'<fieldset><legend>'.__('New entry').'</legend>'.
-		'<p class="col"><label for="post_title" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').
+		'<form id="quick-entry" action="post.php" method="post" class="fieldset">'.
+		'<h4>'.__('New entry').'</h4>'.
+		'<p class="col"><label for="post_title" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label>'.
 		form::field('post_title',20,255,'','maximal').
-		'</label></p>'.
+		'</p>'.
 		'<p class="area"><label class="required" '.
 		'for="post_content"><abbr title="'.__('Required field').'">*</abbr> '.__('Content:').'</label> '.
 		form::textarea('post_content',50,7).
 		'</p>'.
-		'<p><label for="cat_id" class="classic">'.__('Category:').' '.
-		form::combo('cat_id',$categories_combo).'</label></p>'.
+		'<p><label for="cat_id" class="classic">'.__('Category:').'</label> '.
+		form::combo('cat_id',$categories_combo).'</p>'.
 		($core->auth->check('categories', $core->blog->id)
 			? '<div>'.
-			'<p id="new_cat">'.__('Add a new category').'</p>'.
+			'<p id="new_cat" class="q-cat">'.__('Add a new category').'</p>'.
+			'<p class="q-cat"><label for="new_cat_title">'.__('Title:').'</label> '.
+			form::field('new_cat_title',30,255,'','').'</p>'.
+			'<p class="q-cat"><label for="new_cat_parent">'.__('Parent:').'</label> '.
+			form::combo('new_cat_parent',$categories_combo,'','').
+			'</p>'.
 			'<p class="form-note info clear">'.__('This category will be created when you will save your post.').'</p>'.
-			'<p><label for="new_cat_title">'.__('Title:').' '.
-			form::field('new_cat_title',30,255,'','maximal').'</label></p>'.
-			'<p><label for="new_cat_parent">'.__('Parent:').' '.
-			form::combo('new_cat_parent',$categories_combo,'','maximal').
-			'</label></p>'.
 			'</div>'
 			: '').
@@ -384,5 +386,4 @@
 		form::hidden('post_notes','').
 		'</p>'.
-		'</fieldset>'.
 		'</form>'.
 		'</div>';
@@ -394,5 +395,5 @@
 	if ($i->count() > 0)
 	{
-		$dashboardContents .= '<div>';
+		$dashboardContents .= '<div class="db-box">';
 		foreach ($i as $v) {
 			$dashboardContents .= $v;
@@ -401,9 +402,17 @@
 	}
 }
-echo ($dashboardContents ? '<div id="dashboard-contents">'.$dashboardContents.'</div>' : '');
+
+$class = ' '.(($dashboardItems != '') && ($dashboardContents != '') ? 'two-db' : 'one-db');
+
+if ($dashboardContents != '' || $dashboardItems != '') {
+	echo 
+	'<div id="dashboard-widgets">';
+		echo ($dashboardContents ? '<div class="db-contents'.$class.'">'.$dashboardContents.'</div>' : '');
+		echo ($dashboardItems ? '<div class="db-items'.$class.'">'.$dashboardItems.'</div>' : '');
+	echo
+	'</div>';		
+}
 
 echo '</div>';
-
-echo ($dashboardItems ? '<div id="dashboard-items">'.$dashboardItems.'</div>' : '');
 
 dcPage::close();
Index: admin/install/index.php
===================================================================
--- admin/install/index.php	(revision 1583)
+++ admin/install/index.php	(revision 1620)
@@ -190,5 +190,5 @@
 		$core->auth->user_prefs->dashboard->put('doclinks',true,'boolean','',null,true);
 		$core->auth->user_prefs->dashboard->put('dcnews',true,'boolean','',null,true);
-		$core->auth->user_prefs->dashboard->put('quickentry',false,'boolean','',null,true);
+		$core->auth->user_prefs->dashboard->put('quickentry',true,'boolean','',null,true);
 
 		# Add accessibility options
@@ -307,4 +307,8 @@
 '<div id="main">';
 
+if (!is_writable(DC_TPL_CACHE)) {
+	echo '<div class="error"><p>'.sprintf(__('Cache directory %s is not writable.'),DC_TPL_CACHE).'</p></div>';
+}
+
 if ($can_install && !empty($err)) {
 	echo '<div class="error"><p><strong>'.__('Errors:').'</strong></p>'.$err.'</div>';
@@ -312,5 +316,5 @@
 
 if (!empty($_GET['wiz'])) {
-	echo '<p class="message">'.__('Configuration file has been successfully created.').'</p>';
+	echo '<p class="success">'.__('Configuration file has been successfully created.').'</p>';
 }
 
@@ -324,10 +328,10 @@
 	'<form action="index.php" method="post">'.
 	'<fieldset><legend>'.__('User information').'</legend>'.
-	'<p><label for="u_firstname">'.__('First Name:').' '.
-	form::field('u_firstname',30,255,html::escapeHTML($u_firstname)).'</label></p>'.
-	'<p><label for="u_name">'.__('Last Name:').' '.
-	form::field('u_name',30,255,html::escapeHTML($u_name)).'</label></p>'.
-	'<p><label for="u_email">'.__('Email:').' '.
-	form::field('u_email',30,255,html::escapeHTML($u_email)).'</label></p>'.
+	'<p><label for="u_firstname">'.__('First Name:').'</label> '.
+	form::field('u_firstname',30,255,html::escapeHTML($u_firstname)).'</p>'.
+	'<p><label for="u_name">'.__('Last Name:').'</label> '.
+	form::field('u_name',30,255,html::escapeHTML($u_name)).'</p>'.
+	'<p><label for="u_email">'.__('Email:').'</label> '.
+	form::field('u_email',30,255,html::escapeHTML($u_email)).'</p>'.
 	'</fieldset>'.
 	
@@ -378,5 +382,5 @@
 	$plugins_install_result.
 	
-	'<p>'.__('Dotclear has been successfully installed. Here is some useful information you should keep.').'</p>'.
+	'<p class="success">'.__('Dotclear has been successfully installed. Here is some useful information you should keep.').'</p>'.
 	
 	'<h3>'.__('Your account').'</h3>'.
Index: admin/install/wizard.php
===================================================================
--- admin/install/wizard.php	(revision 1179)
+++ admin/install/wizard.php	(revision 1399)
@@ -178,16 +178,16 @@
 
 '<form action="wizard.php" method="post">'.
-'<p><label class="required" for="DBDRIVER"><abbr title="'.__('Required field').'">*</abbr> '.__('Database type:').' '.
-form::combo('DBDRIVER',array('MySQL'=>'mysql','PostgreSQL'=>'pgsql'),$DBDRIVER).'</label></p>'.
-'<p><label for="DBHOST">'.__('Database Host Name:').' '.
-form::field('DBHOST',30,255,html::escapeHTML($DBHOST)).'</label></p>'.
-'<p><label for="DBNAME">'.__('Database Name:').' '.
-form::field('DBNAME',30,255,html::escapeHTML($DBNAME)).'</label></p>'.
-'<p><label for="DBUSER">'.__('Database User Name:').' '.
-form::field('DBUSER',30,255,html::escapeHTML($DBUSER)).'</label></p>'.
-'<p><label for="DBPASSWORD">'.__('Database Password:').' '.
-form::password('DBPASSWORD',30,255).'</label></p>'.
-'<p><label for="DBPREFIX" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Database Tables Prefix:').' '.
-form::field('DBPREFIX',30,255,html::escapeHTML($DBPREFIX)).'</label></p>'.
+'<p><label class="required" for="DBDRIVER"><abbr title="'.__('Required field').'">*</abbr> '.__('Database type:').'</label> '.
+form::combo('DBDRIVER',array('MySQL'=>'mysql','PostgreSQL'=>'pgsql'),$DBDRIVER).'</p>'.
+'<p><label for="DBHOST">'.__('Database Host Name:').'</label> '.
+form::field('DBHOST',30,255,html::escapeHTML($DBHOST)).'</p>'.
+'<p><label for="DBNAME">'.__('Database Name:').'</label> '.
+form::field('DBNAME',30,255,html::escapeHTML($DBNAME)).'</p>'.
+'<p><label for="DBUSER">'.__('Database User Name:').'</label> '.
+form::field('DBUSER',30,255,html::escapeHTML($DBUSER)).'</p>'.
+'<p><label for="DBPASSWORD">'.__('Database Password:').'</label> '.
+form::password('DBPASSWORD',30,255).'</p>'.
+'<p><label for="DBPREFIX" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Database Tables Prefix:').'</label> '.
+form::field('DBPREFIX',30,255,html::escapeHTML($DBPREFIX)).'</p>'.
 
 '<p><input type="submit" value="'.__('Continue').'" /></p>'.
Index: admin/js/_categories.js
===================================================================
--- admin/js/_categories.js	(revision 0)
+++ admin/js/_categories.js	(revision 1595)
@@ -1,13 +1,31 @@
-/* TODO: Some nice drag and drop on categories */
 $(function() {
-	$('form#delete-category').submit(function() {
-		var c_id = $('#del_cat').val();
-		var c_name = $('#del_cat option[value='+c_id+']').text();
-		return window.confirm(dotclear.msg.confirm_delete_category.replace('%s',c_name));
+	if ($.fn['nestedSortable']!==undefined) {
+		$('#categories ul li').css('cursor','move');
+		$('#save-set-order').prop('disabled',true).addClass('disabled');
+		$('#categories ul').nestedSortable({
+			listType: 'ul',
+			items: 'li',
+			placeholder: 'placeholder',
+			update: function() {
+				$('#categories_order').attr('value',JSON.stringify($('#categories ul').nestedSortable('toArray')));
+				$('#save-set-order').prop('disabled',false).removeClass('disabled');
+			}
+		});
+	}
+
+	$('.checkboxes-helpers').each(function() {
+		dotclear.checkboxesHelpers(this);
 	});
-});
 
-$(function() {
-	$('form#reset-order').submit(function() {
+	$('input[name="delete"]').click(function() {
+		var nb_ckecked = $('input[name="categories[]"]:checked').length;
+		if (nb_ckecked==0) {
+			return false;
+		}
+
+		return window.confirm(dotclear.msg.confirm_delete_categories.replace('%s',nb_ckecked));
+	});
+
+	$('input[name="reset"]').click(function() {
 		return window.confirm(dotclear.msg.confirm_reorder_categories);
 	});
Index: admin/js/_index.js
===================================================================
--- admin/js/_index.js	(revision 1500)
+++ admin/js/_index.js	(revision 1699)
@@ -66,13 +66,14 @@
 			});
 		}
-		$('#new_cat').toggleWithLegend(
-			$('#new_cat').parent().children().not('#new_cat'),
-			{} // no cookie on new category as we don't use this every day
-		);
+		$('#new_cat').toggleWithLegend($('#new_cat').parent().children().not('#new_cat'), {
+			// no cookie on new category as we don't use this every day
+			legend_click: true
+		});
 	}
 
 	// allow to hide quick entry div, and remember choice
 	$('#quick h3').toggleWithLegend($('#quick').children().not('h3'),{
-		cookie: 'dcx_quick_entry'
+		legend_click: true,
+		user_pref: 'dcx_quick_entry'
 	});
 });
Index: admin/js/_media.js
===================================================================
--- admin/js/_media.js	(revision 1234)
+++ admin/js/_media.js	(revision 1724)
@@ -1,79 +1,132 @@
+(function($) {
+	$.fn.enhancedUploader = function() {
+		return this.each(function() {
+			var me = $(this);
+
+			function enableButton(button) {
+				button.prop('disabled',false).removeClass('disabled');
+			}
+
+			function disableButton(button) {
+				button.prop('disabled',true).addClass('disabled');
+			}
+			
+			function displayMessageInQueue(n) {
+				var msg = '';
+				if (n==1) {
+					msg = dotclear.jsUpload.msg.file_in_queue;
+				} else if (n>1) {
+					msg = dotclear.jsUpload.msg.files_in_queue;
+					msg = msg.replace(/%d/,n);
+				} else {
+					msg = dotclear.jsUpload.msg.no_file_in_queue;
+				}
+				$('.queue-message',me).html(msg);
+			}
+			
+			$('.button.add').click(function(e) {
+				// Use the native click() of the file input.
+				$('#upfile').click();
+				e.preventDefault();
+			});
+			
+			$('.button.cancel', '#fileupload .fileupload-buttonbar').click(function(e) {
+				$('.button.cancel','#fileupload .fileupload-buttonbar').hide();
+				disableButton($('.button.start','#fileupload .fileupload-buttonbar'));
+				displayMessageInQueue(0);
+			});
+			
+			$('.cancel').live('click', function(e) {
+				if ($('.fileupload-ctrl .files .template-upload', me).length==0) {
+					$('.button.cancel','#fileupload .fileupload-buttonbar').hide();
+					disableButton($('.button.start','#fileupload .fileupload-buttonbar'));
+				}
+				displayMessageInQueue($('.files .template-upload',me).length);
+			});
+			
+			$('.button.clean', me).click(function(e) {
+				$('.fileupload-ctrl .files .template-download', me).slideUp(500, function() {
+					$(this).remove();
+				});
+				$(this).hide();
+				e.preventDefault();
+			});
+			
+			$(me).fileupload({
+				url: $(me).attr('action'),
+				autoUpload: false,
+				sequentialUploads: true,
+				uploadTemplateId: null,
+				downloadTemplateId: null,
+				uploadTemplate: template_upload,
+				downloadTemplate: template_download
+			}).bind('fileuploadadd', function(e, data) {
+				$('.button.cancel','#fileupload .fileupload-buttonbar').show();
+				enableButton($('.button.start','#fileupload .fileupload-buttonbar'));
+			}).bind('fileuploadadded', function(e, data) {
+				displayMessageInQueue($('.files .template-upload',me).length);
+			}).bind('fileuploaddone', function(e, data) {
+				if (data.result.files[0].html !==undefined) {
+					$('.media-list p.clear').before(data.result.files[0].html);
+				}
+				$('.button.clean',me).show();
+			}).bind('fileuploadalways', function(e, data) {
+				displayMessageInQueue($('.files .template-upload',me).length);
+				if ($('.fileupload-ctrl .files .template-upload',me).length==0) {
+					$('.button.cancel','#fileupload .fileupload-buttonbar').hide();
+					disableButton($('.button.start','#fileupload .fileupload-buttonbar'));
+				}
+			});
+			
+			var $container = $(me).parent();
+			var $msg,label;
+
+			if ($container.hasClass('enhanced_uploader')) {
+				$msg = dotclear.msg.enhanced_uploader_disable;
+				label = dotclear.jsUpload.msg.choose_files;
+				$(me).fileupload({disabled:false});
+				displayMessageInQueue(0);
+				disableButton($('.button.start','#fileupload .fileupload-buttonbar'));
+			} else {
+				$msg = dotclear.msg.enhanced_uploader_activate;
+				label = dotclear.jsUpload.msg.choose_file;
+			}
+
+			$('<p class="clear"><a class="enhanced-toggle" href="#">' + $msg + '</a></p>').click(function() {
+				if ($container.hasClass('enhanced_uploader')) {
+					$msg = dotclear.msg.enhanced_uploader_activate;
+					label = dotclear.jsUpload.msg.choose_file;
+					$('#upfile').attr('multiple', false);
+					enableButton($('.button.start','#fileupload .fileupload-buttonbar'));
+					
+					// when a user has clicked enhanced_uploader, and has added files
+					// We must remove files in table
+					$('.files .upload-file', me).remove();
+					$('.button.cancel,.button.clean','#fileupload .fileupload-buttonbar').hide();
+					$(me).fileupload({disabled:true});
+					$('.queue-message',me).html('').hide();
+				} else {
+					$msg = dotclear.msg.enhanced_uploader_disable;
+					label = dotclear.jsUpload.msg.choose_files;
+					$('#upfile').attr('multiple', true);
+					var startButton = $('.button.start','#fileupload .fileupload-buttonbar');
+					disableButton(startButton);
+					startButton.show();
+					$(me).fileupload({disabled:false});
+					$('.queue-message',me).show();
+					displayMessageInQueue(0);
+				}
+				$(this).find('a').text($msg);
+				$('.add-label', me).text(label);
+				
+				$container.toggleClass('enhanced_uploader');
+			}).appendTo(me);
+		});
+	};
+})(jQuery);
+
+
 $(function() {
-	if ($('#fileupload').length==0) {
-		return;
-	}
-
-	$('.button.add').click(function(e) {
-		// Use the native click() of the file input.
-		$('#upfile').click();
-		e.preventDefault();
-	});
-
-	$('.button.cancel', '#fileupload').click(function(e) {
-		$('.button.cancel, .button.start','#fileupload .fileupload-buttonbar').hide();
-	});
-
-	$('.button.clean', '#fileupload').click(function(e) {
-		$('.fileupload-ctrl .files .template-download', '#fileupload').slideUp(500, function() {
-			$(this).remove();
-		});
-		$(this).hide();
-		e.preventDefault();
-	});
-
-	$('#fileupload').fileupload({
-		url: $('#fileupload').attr('action'),
-		autoUpload: false,
-		sequentialUploads: true,
-		disabled: true
-	}).bind('fileuploadadd', function(e, data) {
-		$('.button.cancel, .button.start', '#fileupload .fileupload-buttonbar').show();
-	}).bind('fileuploaddone', function(e, data) {
-		if (data.result.files[0].html !==undefined) {
-			$('.media-list p.clear').before(data.result.files[0].html);
-		}
-		$('.button.clean','#fileupload').show();
-	}).bind('fileuploadalways', function(e, data) {
-	    if ($('.fileupload-ctrl .files .template-upload', '#fileupload').length==0) {
-		$('.button.start, .button.cancel','#fileupload .fileupload-buttonbar').hide();
-	    }
-	});
-
-	var $container = $('#add-file-f').parent().parent();
-	var $msg,label;
-
-	if ($container.hasClass('enhanced_uploader')) {
-		$msg = dotclear.msg.enhanced_uploader_disable;
-		label = dotclear.jsUpload.msg.choose_files;
-		$('#fileupload').fileupload({disabled:false});
-	} else {
-		$msg = dotclear.msg.enhanced_uploader_activate;
-		label = dotclear.jsUpload.msg.choose_file;
-	}
-
-	$('<p class="clear"><a class="enhanced-toggle" href="#">' + $msg + '</a></p>').click( function() {
-		if ($container.hasClass('enhanced_uploader')) {
-			$msg = dotclear.msg.enhanced_uploader_activate;
-			label = dotclear.jsUpload.msg.choose_file;
-			$('#upfile').attr('multiple', false);
-
-			// when a user has clicked enhanced_uploader, and has added files
-			// We must remove files in table
-			$('.files .upload-file', '#fileupload').remove();
-			$('.button.cancel, .button.start','#fileupload .fileupload-buttonbar').hide();
-			$('.button.start','#fileupload').show();
-			$('#fileupload').fileupload({disabled:true});
-		} else {
-			$msg = dotclear.msg.enhanced_uploader_disable;
-			label = dotclear.jsUpload.msg.choose_files;
-			$('#upfile').attr('multiple', true);
-			$('.button.start','#fileupload').hide();
-			$('#fileupload').fileupload({disabled:false});
-		}
-		$(this).find('a').text($msg);
-		$('.add-label', '#fileupload').text(label);
-
-		$container.toggleClass('enhanced_uploader');
-	}).appendTo($('#add-file-f'));
+	$('#fileupload').enhancedUploader();
 
 	// Replace remove links by a POST on hidden form
Index: admin/js/_post.js
===================================================================
--- admin/js/_post.js	(revision 1515)
+++ admin/js/_post.js	(revision 1717)
@@ -1,5 +1,5 @@
 dotclear.commentExpander = function(line) {
 	var td = line.firstChild;
-	
+
 	var img = document.createElement('img');
 	img.src = dotclear.img_plus_src;
@@ -9,5 +9,5 @@
 	img.line = line;
 	img.onclick = function() { dotclear.viewCommentContent(this,this.line); };
-	
+
 	td.insertBefore(img,td.firstChild);
 };
@@ -15,7 +15,7 @@
 dotclear.viewCommentContent = function(img,line) {
 	var commentId = line.id.substr(1);
-	
+
 	var tr = document.getElementById('ce'+commentId);
-	
+
 	if (!tr) {
 		tr = document.createElement('tr');
@@ -25,15 +25,15 @@
 		td.className = 'expand';
 		tr.appendChild(td);
-		
+
 		img.src = dotclear.img_minus_src;
 		img.alt = dotclear.img_minus_alt;
-		
+
 		// Get comment content
 		$.get('services.php',{f:'getCommentById',id: commentId},function(data) {
 			var rsp = $(data).children('rsp')[0];
-			
+
 			if (rsp.attributes[0].value == 'ok') {
 				var comment = $(rsp).find('comment_display_content').text();
-				
+
 				if (comment) {
 					$(td).append(comment);
@@ -42,5 +42,5 @@
 					var comment_ip = $(rsp).find('comment_ip').text();
 					var comment_spam_disp = $(rsp).find('comment_spam_disp').text();
-					
+
 					$(td).append('<p><strong>' + dotclear.msg.website +
 					'</strong> ' + comment_site + '<br />' +
@@ -52,5 +52,5 @@
 			}
 		});
-		
+
 		$(line).toggleClass('expand');
 		line.parentNode.insertBefore(tr,line.nextSibling);
@@ -74,5 +74,5 @@
 $(function() {
 	if (!document.getElementById) { return; }
-	
+
 	if (document.getElementById('edit-entry'))
 	{
@@ -91,58 +91,85 @@
 			}
 		});
-		
+
 		var excerptTb = new jsToolBar(document.getElementById('post_excerpt'));
 		var contentTb = new jsToolBar(document.getElementById('post_content'));
 		excerptTb.context = contentTb.context = 'post';
 	}
-	
+
 	if (document.getElementById('comment_content')) {
 		var commentTb = new jsToolBar(document.getElementById('comment_content'));
 	}
-	
+
 	// Post preview
 	$('#post-preview').modalWeb($(window).width()-40,$(window).height()-40);
-	
+
 	// Tabs events
 	$('#edit-entry').onetabload(function() {
 		dotclear.hideLockable();
-		
+
 		// Add date picker
 		var post_dtPick = new datePicker($('#post_dt').get(0));
 		post_dtPick.img_top = '1.5em';
 		post_dtPick.draw();
-		
+
 		// Confirm post deletion
 		$('input[name="delete"]').click(function() {
-				return window.confirm(dotclear.msg.confirm_delete_post);
-		});
-		
+			return window.confirm(dotclear.msg.confirm_delete_post);
+		});
+
 		// Hide some fields
 		$('#notes-area label').toggleWithLegend($('#notes-area').children().not('label'),{
-			cookie: 'dcx_post_notes',
+			user_pref: 'dcx_post_notes',
+			legend_click:true,
 			hide: $('#post_notes').val() == ''
 		});
-		$('#new_cat').toggleWithLegend(
-			$('#new_cat').parent().children().not('#new_cat'),
-			{} // no cookie on new category as we don't use this every day
-		);
-		$('#post_lang').parent().toggleWithLegend($('#post_lang'),{
-			cookie: 'dcx_post_lang'
-		});
-		$('#post_password').parent().toggleWithLegend($('#post_password'),{
-			cookie: 'dcx_post_password',
+		$('#create_cat').toggleWithLegend($('#create_cat').parent().children().not('#create_cat'),{
+			// no cookie on new category as we don't use this every day
+			legend_click: true
+		});
+		$('#post_lang').parent().children('label').toggleWithLegend($('#post_lang'),{
+			user_pref: 'dcx_post_lang',
+			legend_click: true
+		});
+		$('#post_password').parent().children('label').toggleWithLegend($('#post_password'),{
+			user_pref: 'dcx_post_password',
+			legend_click: true,
 			hide: $('#post_password').val() == ''
 		});
-		
+		$('#post_status').parent().children('label').toggleWithLegend($('#post_status'),{
+			user_pref: 'dcx_post_status',
+			legend_click: true
+		});
+		$('#post_dt').parent().children('label').toggleWithLegend($('#post_dt').parent().children().not('label'),{
+			user_pref: 'dcx_post_dt',
+			legend_click: true
+		});
+		$('#label_format').toggleWithLegend($('#label_format').parent().children().not('#label_format'),{
+			user_pref: 'dcx_post_format',
+			legend_click: true
+		});
+		$('#cat_id').parent().children('label').toggleWithLegend($('#cat_id'),{
+			user_pref: 'cat_id',
+			legend_click: true
+		});
+		$('#label_comment_tb').toggleWithLegend($('#label_comment_tb').parent().children().not('#label_comment_tb'),{
+			user_pref: 'dcx_comment_tb',
+			legend_click: true
+		});
+		$('#post_url').parent().children('label').toggleWithLegend($('#post_url').parent().children().not('label'),{
+			user_pref: 'post_url',
+			legend_click: true
+		});
 		// We load toolbar on excerpt only when it's ready
 		$('#excerpt-area label').toggleWithLegend($('#excerpt-area').children().not('label'),{
-			cookie: 'dcx_post_excerpt',
+			user_pref: 'dcx_post_excerpt',
+			legend_click: true,
 			hide: $('#post_excerpt').val() == ''
 		});
-		
+
 		// Load toolbars
 		contentTb.switchMode(formatField.value);
 		excerptTb.switchMode(formatField.value);
-		
+
 		// Replace attachment remove links by a POST form submit
 		$('a.attachment-remove').click(function() {
@@ -156,9 +183,10 @@
 			return false;
 		});
-		
+
 		// Markup validator
 		var h = document.createElement('h4');
 		var a = document.createElement('a');
 		a.href = '#';
+		a.className = 'button';
 		$(a).click(function() {
 			var params = {
@@ -170,5 +198,5 @@
 				lang: $('#post_lang').get(0).value
 			};
-			
+
 			$.post('services.php',params,function(data) {
 				if ($(data).find('rsp').attr('status') != 'ok') {
@@ -176,13 +204,13 @@
 					return false;
 				}
-				
+
 				if ($(data).find('valid').text() == 1) {
 					var p = document.createElement('p');
 					p.id = 'markup-validator';
-					
+
 					if ($('#markup-validator').length > 0) {
 						$('#markup-validator').remove();
 					}
-					
+
 					$(p).addClass('message');
 					$(p).text(dotclear.msg.xhtml_valid);
@@ -194,27 +222,27 @@
 					var div = document.createElement('div');
 					div.id = 'markup-validator';
-					
+
 					if ($('#markup-validator').length > 0) {
 						$('#markup-validator').remove();
 					}
-					
+
 					$(div).addClass('error');
 					$(div).html('<p><strong>' + dotclear.msg.xhtml_not_valid + '</strong></p>' + $(data).find('errors').text());
 					$(div).insertAfter(h);
-					$(div).backgroundFade({sColor:'#ffffff',eColor:'#ff9999',steps:50},function() {
-							$(this).backgroundFade({sColor:'#ff9999',eColor:'#ffffff'});
+					$(div).backgroundFade({sColor:'#ffffff',eColor:'#FFBABA',steps:50},function() {
+							$(this).backgroundFade({sColor:'#ffbaba',eColor:'#ffffff'});
 					});
 				}
-				
+
 				return false;
 			});
-			
+
 			return false;
 		});
-		
+
 		a.appendChild(document.createTextNode(dotclear.msg.xhtml_validator));
 		h.appendChild(a);
 		$(h).appendTo('#entry-content');
-		
+
 		// Check unsaved changes before XHTML conversion
 		var excerpt = $('#post_excerpt').val();
@@ -223,8 +251,8 @@
 			if (excerpt != $('#post_excerpt').val() || content != $('#post_content').val()) {
 				return window.confirm(dotclear.msg.confirm_change_post_format);
-			}	
+			}
 		});
 	});
-	
+
 	$('#comments').onetabload(function() {
 		$('.comments-list tr.line').each(function() {
@@ -234,8 +262,8 @@
 			dotclear.checkboxesHelpers(this);
 		});
-		
+
 		dotclear.commentsActionsHelper();
 	});
-	
+
 	$('#add-comment').onetabload(function() {
 		commentTb.draw('xhtml');
Index: admin/js/_posts_actions.js
===================================================================
--- admin/js/_posts_actions.js	(revision 1419)
+++ admin/js/_posts_actions.js	(revision 1638)
@@ -1,4 +1,4 @@
 $(function() {
-	$('#new_auth_id').autocomplete(usersList, 
+	$('#new_auth_id').autocomplete(usersList,
 	{
 		delay: 1000,
@@ -6,7 +6,7 @@
 		matchContains: true
 	});
-	$('#new_cat').toggleWithLegend(
-		$('#new_cat').parent().children().not('#new_cat'),
-		{} // no cookie on new category as we don't use this every day
-	);
+	$('#new_cat').toggleWithLegend($('#new_cat').parent().children().not('#new_cat'), {
+		// no cookie on new category as we don't use this every day
+		legend_click: true
+	});
 });
Index: admin/js/_posts_list.js
===================================================================
--- admin/js/_posts_list.js	(revision 1034)
+++ admin/js/_posts_list.js	(revision 1640)
@@ -28,23 +28,30 @@
 
 dotclear.viewPostsContent = function(img,lines) {
-	lines.each(function() {
-		var td = this.firstChild;
-		td.firstChild.click();
-	});
+	
+	action = 'toggle';
 
 	if (img.alt == dotclear.img_plus_alt) {
 		img.src = dotclear.img_minus_src;
 		img.alt = dotclear.img_minus_alt;
+		action = 'open';
 	} else {
 		img.src = dotclear.img_plus_src;
 		img.alt = dotclear.img_plus_alt;
+		action = 'close';
 	}
+	
+	lines.each(function() {
+		var td = this.firstChild;
+		dotclear.viewPostContent(td.firstChild,td.firstChild.line,action);
+	});
 };
 
-dotclear.viewPostContent = function(img,line) {
+dotclear.viewPostContent = function(img,line,action) {
+	
+	var action = action || 'toggle';
 	var postId = line.id.substr(1);
 	var tr = document.getElementById('pe'+postId);
 	
-	if (!tr) {
+	if ( !tr && ( action == 'toggle' || action == 'open' ) ) {
 		tr = document.createElement('tr');
 		tr.id = 'pe'+postId;
@@ -78,21 +85,35 @@
 		});
 		
-		$(line).toggleClass('expand');
+		$(line).addClass('expand');
 		line.parentNode.insertBefore(tr,line.nextSibling);
 	}
-	else if (tr.style.display == 'none')
+	else if (tr && tr.style.display == 'none' && ( action == 'toggle' || action == 'open' ) )
 	{
-		$(tr).toggle();
-		$(line).toggleClass('expand');
+		$(tr).css('display', 'table-row');
+		$(line).addClass('expand');
 		img.src = dotclear.img_minus_src;
 		img.alt = dotclear.img_minus_alt;
 	}
-	else
+	else if (tr && tr.style.display != 'none' && ( action == 'toggle' || action == 'close' ) )
 	{
-		$(tr).toggle();
-		$(line).toggleClass('expand');
+		$(tr).css('display', 'none');
+		$(line).removeClass('expand');
 		img.src = dotclear.img_plus_src;
 		img.alt = dotclear.img_plus_alt;
 	}
+	
+	parentTable = $(line).parents('table');
+	if( parentTable.find('tr.expand').length == parentTable.find('tr.line').length ) {
+		img = parentTable.find('tr:not(.line) th:first img');
+		img.attr('src',dotclear.img_minus_src);
+		img.attr('alt',dotclear.img_minus_alt);
+	}
+	
+	if( parentTable.find('tr.expand').length == 0 ) {
+		img = parentTable.find('tr:not(.line) th:first img');
+		img.attr('src',dotclear.img_plus_src);
+		img.attr('alt',dotclear.img_plus_alt);
+	}
+	
 };
 
Index: admin/js/_preferences.js
===================================================================
--- admin/js/_preferences.js	(revision 160)
+++ admin/js/_preferences.js	(revision 1516)
@@ -13,6 +13,6 @@
 		if ($('#user_email').val() != user_email || $('#new_pwd').val() != '') {
 			e.focus();
-			$(e).backgroundFade({sColor:'#ffffff',eColor:'#ff9999',steps:50},function() {
-				$(this).backgroundFade({sColor:'#ff9999',eColor:'#ffffff'});
+			$(e).backgroundFade({sColor:'#ffffff',eColor:'#ffbaba',steps:50},function() {
+				$(this).backgroundFade({sColor:'#ffbaba',eColor:'#ffffff'});
 			});
 			return false;
Index: admin/js/common.js
===================================================================
--- admin/js/common.js	(revision 1140)
+++ admin/js/common.js	(revision 1699)
@@ -63,10 +63,13 @@
 		img_off_src: dotclear.img_minus_src,
 		img_off_alt: dotclear.img_minus_alt,
+		unfolded_sections: dotclear.unfolded_sections,
 		hide: true,
 		speed: 0,
 		legend_click: false,
 		fn: false, // A function called on first display,
-		cookie: false,
-		reverse_cookie: false // Reverse cookie behavior
+		user_pref: false,
+		reverse_user_pref: false, // Reverse cookie behavior
+		user_pref:false,
+		reverse_user_pref: false
 	};
 	var p = jQuery.extend(defaults,s);
@@ -78,5 +81,9 @@
 		p.hide = p.reverse_cookie;
 	}
-
+	
+	var set_user_pref = p.hide ^ p.reverse_user_pref;
+	if (p.user_pref && (p.user_pref in p.unfolded_sections)) {
+		p.hide = p.reverse_user_pref;
+	}
 	var toggle = function(i,speed) {
 		speed = speed || 0;
@@ -102,5 +109,4 @@
 			}
 		}
-
 		p.hide = !p.hide;
 	};
@@ -121,5 +127,20 @@
 
 		$(ctarget).css('cursor','pointer');
+		if (p.legend_click) {
+			$(ctarget).find('label').css('cursor','pointer');
+		}
 		$(ctarget).click(function() {
+			if (p.user_pref && set_user_pref) {
+				if (p.hide ^ p.reverse_user_pref) {
+					jQuery.post('services.php', 
+						{'f':'setSectionFold','section':p.user_pref,'value':1,xd_check: dotclear.nonce},
+						function(data) {});
+				} else {
+					jQuery.post('services.php', 
+						{'f':'setSectionFold','section':p.user_pref,'value':0,xd_check: dotclear.nonce},
+						function(data) {});
+				}
+				jQuery.cookie(p.user_pref,'',{expires: -1});
+			}
 			toggle(i,p.speed);
 			return false;
@@ -153,4 +174,5 @@
 			}
 		}
+		$('p#help-button span').text($('#content').hasClass('with-help') ? dotclear.msg.help_hide : dotclear.msg.help);
 		sizeBox();
 		return false;
@@ -172,5 +194,5 @@
 		o.click(function() {
 			$(this).nextAll().each(function() {
-				if ($(this).is('h3')) {
+				if ($(this).is('h4')) {
 					return false;
 				}
@@ -192,9 +214,9 @@
 	this.find('>hr').remove();
 
-	this.find('h3').each(function() { textToggler($(this)); });
-	this.find('h3:first').nextAll('*:not(h3)').hide();
+	this.find('h4').each(function() { textToggler($(this)); });
+	this.find('h4:first').nextAll('*:not(h4)').hide();
 	sizeBox();
 
-	var img = $('<span id="help-button">'+dotclear.msg.help+'</span>');
+	var img = $('<p id="help-button"><span>'+dotclear.msg.help+'</span></p>');
 	var select = $();
 	img.click(function() { return toggle(); });
@@ -223,4 +245,5 @@
 				imgE.style.top = '1.7em';
 				imgE.style.left = ($(this).width()+4)+'px';
+				imgE.alt=dotclear.msg.click_to_unlock;
 				$(imgE).css('cursor','pointer');
 
@@ -241,4 +264,7 @@
 
 	checkboxesHelpers: function(e) {
+		$(e).append(document.createTextNode(dotclear.msg.to_select));
+		$(e).append(document.createTextNode(' '));
+
 		var a = document.createElement('a');
 		a.href='#';
@@ -250,5 +276,5 @@
 		$(e).append(a);
 
-		$(e).append(document.createTextNode(' - '));
+		$(e).append(document.createTextNode(' | '));
 
 		a = document.createElement('a');
@@ -319,4 +345,13 @@
 -------------------------------------------------------- */
 $(function() {
+	// remove class no-js from html tag; cf style/default.css for examples
+	$('body').removeClass('no-js');
+
+	$('#wrapper').contents().each(function() {
+		if (this.nodeType==8) {
+			$('#footer a').attr('title', $('#footer a').attr('title') + this.data );
+		}
+	});
+
 	// Blog switcher
 	$('#switchblog').change(function() {
@@ -331,14 +366,14 @@
 	}
 	$('#blog-menu h3:first').toggleWithLegend($('#blog-menu ul:first'),
-		$.extend({cookie:'dc_blog_menu'},menu_settings)
+		$.extend({user_pref:'dc_blog_menu'},menu_settings)
 	);
 	$('#system-menu h3:first').toggleWithLegend($('#system-menu ul:first'),
-		$.extend({cookie:'dc_system_menu'},menu_settings)
+		$.extend({user_pref:'dc_system_menu'},menu_settings)
 	);
 	$('#plugins-menu h3:first').toggleWithLegend($('#plugins-menu ul:first'),
-		$.extend({cookie:'dc_plugins_menu'},menu_settings)
+		$.extend({user_pref:'dc_plugins_menu'},menu_settings)
 	);
 	$('#favorites-menu h3:first').toggleWithLegend($('#favorites-menu ul:first'),
-		$.extend({cookie:'dc_favorites_menu',hide:false,reverse_cookie:true},menu_settings)
+		$.extend({user_pref:'dc_favorites_menu',hide:false,reverse_user_pref:true},menu_settings)
 	);
 
@@ -346,5 +381,6 @@
 
 	$('.message').backgroundFade({sColor:'#cccccc',eColor:'#666666',steps:20});
-	$('.error').backgroundFade({sColor:'#ffeee3',eColor:'#ffdec8',steps:20});
+	$('.error').backgroundFade({sColor:'#ffdec8',eColor:'#ffbaba',steps:20});
+	$('.success').backgroundFade({sColor:'#9BCA1C',eColor:'#bee74b',steps:20});
 
 	$('form:has(input[type=password][name=your_pwd])').submit(function() {
@@ -352,6 +388,6 @@
 		if (e.value == '') {
 			e.focus();
-			$(e).backgroundFade({sColor:'#ffffff',eColor:'#ff9999',steps:50},function() {
-				$(this).backgroundFade({sColor:'#ff9999',eColor:'#ffffff'});
+			$(e).backgroundFade({sColor:'#ffffff',eColor:'#ffbaba',steps:50},function() {
+				$(this).backgroundFade({sColor:'#ffbaba',eColor:'#ffffff'});
 			});
 			return false;
Index: admin/js/ie7/IE9.js
===================================================================
--- admin/js/ie7/IE9.js	(revision 1456)
+++ admin/js/ie7/IE9.js	(revision 1456)
@@ -0,0 +1,2901 @@
+/*
+  IE7/IE8/IE9.js - copyright 2004-2010, Dean Edwards
+  http://code.google.com/p/ie7-js/
+  http://www.opensource.org/licenses/mit-license.php
+*/
+
+/* W3C compliance for Microsoft Internet Explorer */
+
+/* credits/thanks:
+  Shaggy, Martijn Wargers, Jimmy Cerra, Mark D Anderson,
+  Lars Dieckow, Erik Arvidsson, Gellért Gyuris, James Denny,
+  Unknown W Brackets, Benjamin Westfarer, Rob Eberhardt,
+  Bill Edney, Kevin Newman, James Crompton, Matthew Mastracci,
+  Doug Wright, Richard York, Kenneth Kolano, MegaZone,
+  Thomas Verelst, Mark 'Tarquin' Wilton-Jones, Rainer Åhlfors,
+  David Zulaica, Ken Kolano, Kevin Newman, Sjoerd Visscher,
+  Ingo Chao
+*/
+
+// timestamp: Fri, 30 Apr 2010 20:59:18
+
+(function(window, document) {
+
+var IE7 = window.IE7 = {
+  version: "2.1(beta4)",
+  toString: K("[IE7]")
+};
+IE7.compat = 9;
+var appVersion = IE7.appVersion = navigator.appVersion.match(/MSIE (\d\.\d)/)[1] - 0;
+
+if (/ie7_off/.test(top.location.search) || appVersion < 5.5 || appVersion >= IE7.compat) return;
+
+var MSIE5 = appVersion < 6;
+
+var Undefined = K();
+var documentElement = document.documentElement, body, viewport;
+var ANON = "!";
+var HEADER = ":link{ie7-link:link}:visited{ie7-link:visited}";
+
+// -----------------------------------------------------------------------
+// external
+// -----------------------------------------------------------------------
+
+var RELATIVE = /^[\w\.]+[^:]*$/;
+function makePath(href, path) {
+  if (RELATIVE.test(href)) href = (path || "") + href;
+  return href;
+};
+
+function getPath(href, path) {
+  href = makePath(href, path);
+  return href.slice(0, href.lastIndexOf("/") + 1);
+};
+
+// Get the path to this script
+var script = document.scripts[document.scripts.length - 1];
+var path = getPath(script.src);
+
+// Use microsoft's http request object to load external files
+try {
+  var httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
+} catch (ex) {
+  // ActiveX disabled
+}
+
+var fileCache = {};
+function loadFile(href, path) {
+  try {
+    href = makePath(href, path);
+    if (!fileCache[href]) {
+      httpRequest.open("GET", href, false);
+      httpRequest.send();
+      if (httpRequest.status == 0 || httpRequest.status == 200) {
+        fileCache[href] = httpRequest.responseText;
+      }
+    }
+  } catch (ex) {
+    // ignore errors
+  }
+  return fileCache[href] || "";
+};
+
+// -----------------------------------------------------------------------
+// OO support
+// -----------------------------------------------------------------------
+
+
+// This is a cut-down version of base2 (http://code.google.com/p/base2/)
+
+var _slice = Array.prototype.slice;
+
+// private
+var _FORMAT = /%([1-9])/g;
+var _LTRIM = /^\s\s*/;
+var _RTRIM = /\s\s*$/;
+var _RESCAPE = /([\/()[\]{}|*+-.,^$?\\])/g;           // safe regular expressions
+var _BASE = /\bbase\b/;
+var _HIDDEN = ["constructor", "toString"];            // only override these when prototyping
+
+var prototyping;
+
+function Base(){};
+Base.extend = function(_instance, _static) {
+  // Build the prototype.
+  prototyping = true;
+  var _prototype = new this;
+  extend(_prototype, _instance);
+  prototyping = false;
+
+  // Create the wrapper for the constructor function.
+  var _constructor = _prototype.constructor;
+  function klass() {
+    // Don't call the constructor function when prototyping.
+    if (!prototyping) _constructor.apply(this, arguments);
+  };
+  _prototype.constructor = klass;
+
+  // Build the static interface.
+  klass.extend = arguments.callee;
+  extend(klass, _static);
+  klass.prototype = _prototype;
+  return klass;
+};
+Base.prototype.extend = function(source) {
+  return extend(this, source);
+};
+
+
+// A collection of regular expressions and their associated replacement values.
+// A Base class for creating parsers.
+
+var HASH     = "#";
+var ITEMS    = "#";
+var KEYS     = ".";
+var COMPILED = "/";
+
+var REGGRP_BACK_REF        = /\\(\d+)/g,
+    REGGRP_ESCAPE_COUNT    = /\[(\\.|[^\]\\])+\]|\\.|\(\?/g,
+    REGGRP_PAREN           = /\(/g,
+    REGGRP_LOOKUP          = /\$(\d+)/,
+    REGGRP_LOOKUP_SIMPLE   = /^\$\d+$/,
+    REGGRP_LOOKUPS         = /(\[(\\.|[^\]\\])+\]|\\.|\(\?)|\(/g,
+    REGGRP_DICT_ENTRY      = /^<#\w+>$/,
+    REGGRP_DICT_ENTRIES    = /<#(\w+)>/g;
+
+var RegGrp = Base.extend({
+  constructor: function(values) {
+    this[KEYS] = [];
+    this[ITEMS] = {};
+    this.merge(values);
+  },
+
+  //dictionary: null,
+  //ignoreCase: false,
+
+  add: function(expression, replacement) {
+    delete this[COMPILED];
+    if (expression instanceof RegExp) {
+      expression = expression.source;
+    }
+    if (!this[HASH + expression]) this[KEYS].push(String(expression));
+    return this[ITEMS][HASH + expression] = new RegGrp.Item(expression, replacement, this);
+  },
+
+  compile: function(recompile) {
+    if (recompile || !this[COMPILED]) {
+      this[COMPILED] = new RegExp(this, this.ignoreCase ? "gi" : "g");
+    }
+    return this[COMPILED];
+  },
+
+  merge: function(values) {
+    for (var i in values) this.add(i, values[i]);
+  },
+
+  exec: function(string) {
+    var group = this,
+        patterns = group[KEYS],
+        items = group[ITEMS], item;
+    var result = this.compile(true).exec(string);
+    if (result) {
+      // Loop through the RegGrp items.
+      var i = 0, offset = 1;
+      while ((item = items[HASH + patterns[i++]])) {
+        var next = offset + item.length + 1;
+        if (result[offset]) { // do we have a result?
+          if (item.replacement === 0) {
+            return group.exec(string);
+          } else {
+            var args = result.slice(offset, next), j = args.length;
+            while (--j) args[j] = args[j] || ""; // some platforms return null/undefined for non-matching sub-expressions
+            args[0] = {match: args[0], item: item};
+            return args;
+          }
+        }
+        offset = next;
+      }
+    }
+    return null;
+  },
+
+  parse: function(string) {
+    string += ""; // type safe
+    var group = this,
+        patterns = group[KEYS],
+        items = group[ITEMS];
+    return string.replace(this.compile(), function(match) {
+      var args = [], item, offset = 1, i = arguments.length;
+      while (--i) args[i] = arguments[i] || ""; // some platforms return null/undefined for non-matching sub-expressions
+      // Loop through the RegGrp items.
+      while ((item = items[HASH + patterns[i++]])) {
+        var next = offset + item.length + 1;
+        if (args[offset]) { // do we have a result?
+          var replacement = item.replacement;
+          switch (typeof replacement) {
+            case "function":
+              return replacement.apply(group, args.slice(offset, next));
+            case "number":
+              return args[offset + replacement];
+            default:
+              return replacement;
+          }
+        }
+        offset = next;
+      }
+      return match;
+    });
+  },
+
+  toString: function() {
+    var strings = [],
+        keys = this[KEYS],
+        items = this[ITEMS], item;
+    for (var i = 0; item = items[HASH + keys[i]]; i++) {
+      strings[i] = item.source;
+    }
+    return "(" + strings.join(")|(") + ")";
+  }
+}, {
+  IGNORE: null, // a null replacement value means that there is no replacement.
+
+  Item: Base.extend({
+    constructor: function(source, replacement, owner) {
+      var length = source.indexOf("(") === -1 ? 0 : RegGrp.count(source);
+
+      var dictionary = owner.dictionary;
+      if (dictionary && source.indexOf("<#") !== -1) {
+        if (REGGRP_DICT_ENTRY.test(source)) {
+          var entry = dictionary[ITEMS][HASH + source.slice(2, -1)];
+          source = entry.replacement;
+          length = entry._length;
+        } else {
+          source = dictionary.parse(source);
+        }
+      }
+
+      if (typeof replacement == "number") replacement = String(replacement);
+      else if (replacement == null) replacement = 0;
+
+      // Does the expression use sub-expression lookups?
+      if (typeof replacement == "string" && REGGRP_LOOKUP.test(replacement)) {
+        if (REGGRP_LOOKUP_SIMPLE.test(replacement)) { // A simple lookup? (e.g. "$2").
+          // Store the index (used for fast retrieval of matched strings).
+          var index = replacement.slice(1) - 0;
+          if (index && index <= length) replacement = index;
+        } else {
+          // A complicated lookup (e.g. "Hello $2 $1.").
+          var lookup = replacement, regexp;
+          replacement = function(match) {
+            if (!regexp) {
+              regexp = new RegExp(source, "g" + (this.ignoreCase ? "i": ""));
+            }
+            return match.replace(regexp, lookup);
+          };
+        }
+      }
+
+      this.length = length;
+      this.source = String(source);
+      this.replacement = replacement;
+    }
+  }),
+
+  count: function(expression) {
+    return (String(expression).replace(REGGRP_ESCAPE_COUNT, "").match(REGGRP_PAREN) || "").length;
+  }
+});
+
+var Dictionary = RegGrp.extend({
+  parse: function(phrase) {
+    // Prevent sub-expressions in dictionary entries from capturing.
+    var entries = this[ITEMS];
+    return phrase.replace(REGGRP_DICT_ENTRIES, function(match, entry) {
+      entry = entries[HASH + entry];
+      return entry ? entry._nonCapturing : match;
+    });
+  },
+
+  add: function(expression, replacement) {
+    // Get the underlying replacement value.
+    if (replacement instanceof RegExp) {
+      replacement = replacement.source;
+    }
+    // Translate the replacement.
+    // The result is the original replacement recursively parsed by this dictionary.
+    var nonCapturing = replacement.replace(REGGRP_LOOKUPS, _nonCapture);
+    if (replacement.indexOf("(") !== -1) {
+      var realLength = RegGrp.count(replacement);
+    }
+    if (replacement.indexOf("<#") !== -1) {
+      replacement = this.parse(replacement);
+      nonCapturing = this.parse(nonCapturing);
+    }
+    var item = this.base(expression, replacement);
+    item._nonCapturing = nonCapturing;
+    item._length = realLength || item.length; // underlying number of sub-groups
+    return item;
+  },
+
+  toString: function() {
+    return "(<#" + this[PATTERNS].join(">)|(<#") + ">)";
+  }
+});
+
+function _nonCapture(match, escaped) {
+  return escaped || "(?:"; // non-capturing
+};
+
+// =========================================================================
+// lang/extend.js
+// =========================================================================
+
+function extend(object, source) { // or extend(object, key, value)
+  if (object && source) {
+    var proto = (typeof source == "function" ? Function : Object).prototype;
+    // Add constructor, toString etc
+    var i = _HIDDEN.length, key;
+    if (prototyping) while (key = _HIDDEN[--i]) {
+      var value = source[key];
+      if (value != proto[key]) {
+        if (_BASE.test(value)) {
+          _override(object, key, value)
+        } else {
+          object[key] = value;
+        }
+      }
+    }
+    // Copy each of the source object's properties to the target object.
+    for (key in source) if (typeof proto[key] == "undefined") {
+      var value = source[key];
+      // Check for method overriding.
+      if (object[key] && typeof value == "function" && _BASE.test(value)) {
+        _override(object, key, value);
+      } else {
+        object[key] = value;
+      }
+    }
+  }
+  return object;
+};
+
+function _override(object, name, method) {
+  // Override an existing method.
+  var ancestor = object[name];
+  object[name] = function() {
+    var previous = this.base;
+    this.base = ancestor;
+    var returnValue = method.apply(this, arguments);
+    this.base = previous;
+    return returnValue;
+  };
+};
+
+function combine(keys, values) {
+  // Combine two arrays to make a hash.
+  if (!values) values = keys;
+  var hash = {};
+  for (var i in keys) hash[i] = values[i];
+  return hash;
+};
+
+function format(string) {
+  // Replace %n with arguments[n].
+  // e.g. format("%1 %2%3 %2a %1%3", "she", "se", "lls");
+  // ==> "she sells sea shells"
+  // Only %1 - %9 supported.
+  var args = arguments;
+  var _FORMAT = new RegExp("%([1-" + arguments.length + "])", "g");
+  return String(string).replace(_FORMAT, function(match, index) {
+    return index < args.length ? args[index] : match;
+  });
+};
+
+function match(string, expression) {
+  // Same as String.match() except that this function will return an empty
+  // array if there is no match.
+  return String(string).match(expression) || [];
+};
+
+function rescape(string) {
+  // Make a string safe for creating a RegExp.
+  return String(string).replace(_RESCAPE, "\\$1");
+};
+
+// http://blog.stevenlevithan.com/archives/faster-trim-javascript
+function trim(string) {
+  return String(string).replace(_LTRIM, "").replace(_RTRIM, "");
+};
+
+function K(k) {
+  return function() {
+    return k;
+  };
+};
+
+// -----------------------------------------------------------------------
+// parsing
+// -----------------------------------------------------------------------
+
+var Parser = RegGrp.extend({ignoreCase: true});
+
+var SINGLE_QUOTES       = /'/g,
+    ESCAPED             = /'(\d+)'/g,
+    ESCAPE              = /\\/g,
+    UNESCAPE            = /\\([nrtf'"])/g;
+
+var strings = [];
+
+var encoder = new Parser({
+  // comments
+  "<!\\-\\-|\\-\\->": "",
+  "\\/\\*[^*]*\\*+([^\\/][^*]*\\*+)*\\/": "",
+  // get rid
+  "@(namespace|import)[^;\\n]+[;\\n]": "",
+  // strings
+  "'(\\\\.|[^'\\\\])*'": encodeString,
+  '"(\\\\.|[^"\\\\])*"': encodeString,
+  // white space
+  "\\s+": " "
+});
+
+function encode(selector) {
+  return encoder.parse(selector).replace(UNESCAPE, "$1");
+};
+
+function decode(query) {
+  // put string values back
+  return query.replace(ESCAPED, decodeString);
+};
+
+function encodeString(string) {
+  var index = strings.length;
+  strings[index] = string.slice(1, -1)
+    .replace(UNESCAPE, "$1")
+    .replace(SINGLE_QUOTES, "\\'");
+  return "'" + index + "'";
+};
+
+function decodeString(match, index) {
+  var string = strings[index];
+  if (string == null) return match;
+  return "'" + strings[index] + "'";
+};
+
+function getString(value) {
+  return value.indexOf("'") === 0 ? strings[value.slice(1, - 1)] : value;
+};
+
+// clone a "width" function to create a "height" function
+var rotater = new RegGrp({
+  Width: "Height",
+  width: "height",
+  Left:  "Top",
+  left:  "top",
+  Right: "Bottom",
+  right: "bottom",
+  onX:   "onY"
+});
+
+function rotate(fn) {
+  return rotater.parse(fn);
+};
+
+// -----------------------------------------------------------------------
+// event handling
+// -----------------------------------------------------------------------
+
+var eventHandlers = [];
+
+function addResize(handler) {
+  addRecalc(handler);
+  addEventHandler(window, "onresize", handler);
+};
+
+// add an event handler (function) to an element
+function addEventHandler(element, type, handler) {
+  element.attachEvent(type, handler);
+  // store the handler so it can be detached later
+  eventHandlers.push(arguments);
+};
+
+// remove an event handler assigned to an element by IE7
+function removeEventHandler(element, type, handler) {
+  try {
+    element.detachEvent(type, handler);
+  } catch (ex) {
+    // write a letter of complaint to microsoft..
+  }
+};
+
+// remove event handlers (they eat memory)
+addEventHandler(window, "onunload", function() {
+  var handler;
+  while (handler = eventHandlers.pop()) {
+    removeEventHandler(handler[0], handler[1], handler[2]);
+  }
+});
+
+function register(handler, element, condition) { // -@DRE
+  //var set = handler[element.uniqueID];
+  if (!handler.elements) handler.elements = {};
+  if (condition) handler.elements[element.uniqueID] = element;
+  else delete handler.elements[element.uniqueID];
+  //return !set && condition;
+  return condition;
+};
+
+addEventHandler(window, "onbeforeprint", function() {
+  if (!IE7.CSS.print) new StyleSheet("print");
+  IE7.CSS.print.recalc();
+});
+
+// -----------------------------------------------------------------------
+// pixel conversion
+// -----------------------------------------------------------------------
+
+// this is handy because it means that web developers can mix and match
+//  measurement units in their style sheets. it is not uncommon to
+//  express something like padding in "em" units whilst border thickness
+//  is most often expressed in pixels.
+
+var PIXEL = /^\d+(px)?$/i;
+var PERCENT = /^\d+%$/;
+var getPixelValue = function(element, value) {
+  if (PIXEL.test(value)) return parseInt(value);
+  var style = element.style.left;
+  var runtimeStyle = element.runtimeStyle.left;
+  element.runtimeStyle.left = element.currentStyle.left;
+  element.style.left = value || 0;
+  value = element.style.pixelLeft;
+  element.style.left = style;
+  element.runtimeStyle.left = runtimeStyle;
+  return value;
+};
+
+// -----------------------------------------------------------------------
+// generic
+// -----------------------------------------------------------------------
+
+var $IE7 = "ie7-";
+
+var Fix = Base.extend({
+  constructor: function() {
+    this.fixes = [];
+    this.recalcs = [];
+  },
+  init: Undefined
+});
+
+// a store for functions that will be called when refreshing IE7
+var recalcs = [];
+function addRecalc(recalc) {
+  recalcs.push(recalc);
+};
+
+IE7.recalc = function() {
+  IE7.HTML.recalc();
+  // re-apply style sheet rules (re-calculate ie7 classes)
+  IE7.CSS.recalc();
+  // apply global fixes to the document
+  for (var i = 0; i < recalcs.length; i++) recalcs[i]();
+};
+
+function isFixed(element) {
+  return element.currentStyle["ie7-position"] == "fixed";
+};
+
+// original style
+function getDefinedStyle(element, propertyName) {
+  return element.currentStyle[$IE7 + propertyName] || element.currentStyle[propertyName];
+};
+
+function setOverrideStyle(element, propertyName, value) {
+  if (element.currentStyle[$IE7 + propertyName] == null) {
+    element.runtimeStyle[$IE7 + propertyName] = element.currentStyle[propertyName];
+  }
+  element.runtimeStyle[propertyName] = value;
+};
+
+// Create a temporary element which is used to inherit styles
+// from the target element.
+function createTempElement(tagName) {
+  var element = document.createElement(tagName || "object");
+  element.style.cssText = "position:absolute;padding:0;display:block;border:none;clip:rect(0 0 0 0);left:-9999";
+  element.ie7_anon = true;
+  return element;
+};
+
+
+// =========================================================================
+// ie7-css.js
+// =========================================================================
+
+var NEXT_SIBLING        = "(e.nextSibling&&IE7._getElementSibling(e,'next'))",
+    PREVIOUS_SIBLING    = NEXT_SIBLING.replace(/next/g, "previous"),
+    IS_ELEMENT          = "e.nodeName>'@'",
+    IF_ELEMENT          = "if(" + IS_ELEMENT + "){";
+
+var ID_ATTRIBUTE  = "(e.nodeName==='FORM'?IE7._getAttribute(e,'id'):e.id)";
+
+var HYPERLINK = /a(#[\w-]+)?(\.[\w-]+)?:(hover|active)/i;
+var FIRST_LINE_LETTER = /(.*)(:first-(line|letter))/;
+var SPACE = /\s/;
+var RULE = /((?:\\.|[^{\\])+)\{((?:\\.|[^}\\])+)\}/g;
+var SELECTOR = /(?:\\.|[^,\\])+/g;
+
+var styleSheets = document.styleSheets;
+
+var inheritedProperties = [];
+
+IE7.CSS = new (Fix.extend({ // single instance
+  parser: new Parser,
+  screen: "",
+  print: "",
+  styles: [],
+  rules: [],
+  pseudoClasses: appVersion < 7 ? "first\\-child" : "",
+  dynamicPseudoClasses: {
+    toString: function() {
+      var strings = [];
+      for (var pseudoClass in this) strings.push(pseudoClass);
+      return strings.join("|");
+    }
+  },
+  
+  init: function() {
+    var NONE = "^\x01$";
+    var CLASS = "\\[class=?[^\\]]*\\]";
+    var pseudoClasses = [];
+    if (this.pseudoClasses) pseudoClasses.push(this.pseudoClasses);
+    var dynamicPseudoClasses = this.dynamicPseudoClasses.toString(); 
+    if (dynamicPseudoClasses) pseudoClasses.push(dynamicPseudoClasses);
+    pseudoClasses = pseudoClasses.join("|");
+    var unknown = appVersion < 7 ? ["[>+~\\[(]|([:.])[\\w-]+\\1"] : [CLASS];
+    if (pseudoClasses) unknown.push(":(" + pseudoClasses + ")");
+    this.UNKNOWN = new RegExp(unknown.join("|") || NONE, "i");
+    var complex = appVersion < 7 ? ["\\[[^\\]]+\\]|[^\\s(\\[]+\\s*[+~]"] : [CLASS];
+    var complexRule = complex.concat();
+    if (pseudoClasses) complexRule.push(":(" + pseudoClasses + ")");
+    Rule.COMPLEX = new RegExp(complexRule.join("|") || NONE, "ig");
+    if (this.pseudoClasses) complex.push(":(" + this.pseudoClasses + ")");
+    DynamicRule.COMPLEX = new RegExp(complex.join("|") || NONE, "i");
+    dynamicPseudoClasses = "not\\(:" + dynamicPseudoClasses.split("|").join("\\)|not\\(:") + "\\)|" + dynamicPseudoClasses;
+    DynamicRule.MATCH = new RegExp(dynamicPseudoClasses ? "(.*?):(" + dynamicPseudoClasses + ")(.*)" : NONE, "i");
+    
+    this.createStyleSheet();
+    this.refresh();
+  },
+  
+	addEventHandler: function() {
+		addEventHandler.apply(null, arguments);
+	},
+  
+  addFix: function(expression, replacement) {
+    this.parser.add(expression, replacement);
+  },
+  
+  addRecalc: function(propertyName, test, handler, replacement) {
+    // recalcs occur whenever the document is refreshed using document.recalc()
+    propertyName = propertyName.source || propertyName;
+    test = new RegExp("([{;\\s])" + propertyName + "\\s*:\\s*" + test + "[^;}]*");
+    var id = this.recalcs.length;
+    if (typeof replacement == "string") replacement = propertyName + ":" + replacement;
+    this.addFix(test, function(match) {
+      if (typeof replacement == "function") replacement = replacement(match);
+      return (replacement ? replacement : match) + ";ie7-" + match.slice(1) + ";ie7_recalc" + id + ":1";
+    });
+    this.recalcs.push(arguments);
+    return id;
+  },
+  
+  apply: function() {
+    this.getInlineCSS();
+    new StyleSheet("screen");
+    this.trash();
+  },
+  
+  createStyleSheet: function() {
+    // create the IE7 style sheet
+    document.getElementsByTagName("head")[0].appendChild(document.createElement("style"));
+    this.styleSheet = styleSheets[styleSheets.length - 1];
+    // flag it so we can ignore it during parsing
+    this.styleSheet.ie7 = true;
+    this.styleSheet.owningElement.ie7 = true;
+    this.styleSheet.cssText = HEADER;
+  },
+  
+  getInlineCSS: function() {// load inline styles
+    var styleSheets = document.getElementsByTagName("style"), styleSheet;
+    for (var i = styleSheets.length - 1; styleSheet = styleSheets[i]; i--) {
+      if (!styleSheet.disabled && !styleSheet.ie7) {
+        styleSheet._cssText = styleSheet.innerHTML;
+      }
+    }
+  },
+  
+  getText: function(styleSheet, path) {
+    // Internet Explorer will trash unknown selectors (it converts them to "UNKNOWN").
+    // So we must reload external style sheets (internal style sheets can have their text
+    // extracted through the innerHTML property).
+
+    // load the style sheet text from an external file
+    try {
+      var cssText = styleSheet.cssText;
+    } catch (e) {
+      cssText = "";
+    }
+    if (httpRequest) cssText = loadFile(styleSheet.href, path) || cssText;
+    return cssText;
+  },
+  
+  recalc: function() {
+    this.screen.recalc();
+    // we're going to read through all style rules.
+    //  certain rules have had ie7 properties added to them.
+    //   e.g. p{top:0; ie7_recalc2:1; left:0}
+    //  this flags a property in the rule as needing a fix.
+    //  the selector text is then used to query the document.
+    //  we can then loop through the results of the query
+    //  and fix the elements.
+    // we ignore the IE7 rules - so count them in the header
+    var RECALCS = /ie7_recalc\d+/g;
+    var start = HEADER.match(/[{,]/g).length;
+    // only calculate screen fixes. print fixes don't show up anyway
+    var rules = this.styleSheet.rules, rule;
+    var calcs, calc, elements, element, i, j, k, id;
+    // loop through all rules
+    for (i = start; rule = rules[i]; i++) {
+      var cssText = rule.style.cssText;
+      // search for the "ie7_recalc" flag (there may be more than one)
+      if (calcs = cssText.match(RECALCS)) {
+        // use the selector text to query the document
+        elements = cssQuery(rule.selectorText);
+        // if there are matching elements then loop
+        //  through the recalc functions and apply them
+        //  to each element
+        if (elements.length) for (j = 0; j < calcs.length; j++) {
+          // get the matching flag (e.g. ie7_recalc3)
+          id = calcs[j];
+          // extract the numeric id from the end of the flag
+          //  and use it to index the collection of recalc
+          //  functions
+          calc = IE7.CSS.recalcs[id.slice(10)][2];
+          for (k = 0; (element = elements[k]); k++) {
+            // apply the fix
+            if (element.currentStyle[id]) calc(element, cssText);
+          }
+        }
+      }
+    }
+  },
+  
+  refresh: function() {
+    this.styleSheet.cssText = HEADER + this.screen + this.print;
+  },
+  
+  trash: function() {
+    // trash the old style sheets
+    for (var i = 0; i < styleSheets.length; i++) {
+      if (!styleSheets[i].ie7) {
+        try {
+          var cssText = styleSheets[i].cssText;
+        } catch (e) {
+          cssText = "";
+        }
+        if (cssText) styleSheets[i].cssText = "";
+      }
+    }
+  }
+}));
+
+// -----------------------------------------------------------------------
+//  IE7 StyleSheet class
+// -----------------------------------------------------------------------
+
+var StyleSheet = Base.extend({
+  constructor: function(media) {
+    this.media = media;
+    this.load();
+    IE7.CSS[media] = this;
+    IE7.CSS.refresh();
+  },
+  
+  createRule: function(selector, cssText) {
+    var match;
+    if (PseudoElement && (match = selector.match(PseudoElement.MATCH))) {
+      return new PseudoElement(match[1], match[2], cssText);
+    } else if (match = selector.match(DynamicRule.MATCH)) {
+      if (!HYPERLINK.test(match[0]) || DynamicRule.COMPLEX.test(match[0])) {
+        return new DynamicRule(selector, match[1], match[2], match[3], cssText);
+      }
+    } else {
+      return new Rule(selector, cssText);
+    }
+    return selector + " {" + cssText + "}";
+  },
+  
+  getText: function() {
+    // store for style sheet text
+    // parse media decalarations
+    var MEDIA        = /@media\s+([^{]+?)\s*\{([^@]+\})\s*\}/gi;
+    var IMPORTS      = /@import[^;\n]+/gi;
+    var TRIM_IMPORTS = /@import\s+url\s*\(\s*["']?|["']?\s*\)\s*/gi;
+    var URL          = /(url\s*\(\s*['"]?)([\w\.]+[^:\)]*['"]?\))/gi;
+
+    var self = this;
+    
+    // Store loaded cssText URLs
+    var fileCache = {};
+    
+    function getCSSText(styleSheet, path, media, level) {
+      var cssText = "";
+      if (!level) {
+        media = toSimpleMedia(styleSheet.media);
+        level = 0;
+      }
+      if (media === "none") {
+        styleSheet.disabled = true;
+        return "";
+      }
+      if (media === "all" || media === self.media) {
+        // IE only allows importing style sheets three levels deep.
+        // it will crash if you try to access a level below this
+        try {
+          var canAcess = !!styleSheet.cssText;
+        } catch (exe) {}
+        if (level < 3 && canAcess) {
+          var hrefs = styleSheet.cssText.match(IMPORTS);
+          // loop through imported style sheets
+          for (var i = 0, imported; i < styleSheet.imports.length; i++) {
+            var imported = styleSheet.imports[i];
+            var href = styleSheet._href || styleSheet.href;
+            imported._href = hrefs[i].replace(TRIM_IMPORTS, "");
+            // call this function recursively to get all imported style sheets
+            cssText += getCSSText(imported, getPath(href, path), media, level + 1);
+          }
+        }
+        // retrieve inline style or load an external style sheet
+        cssText += encode(styleSheet.href ? loadStyleSheet(styleSheet, path) : styleSheet.owningElement._cssText);
+        cssText = parseMedia(cssText, self.media);
+      }
+      return cssText;
+    };
+
+    // Load all style sheets in the document
+    for (var i = 0; i < styleSheets.length; i++) {
+      var styleSheet = styleSheets[i];
+      if (!styleSheet.disabled && !styleSheet.ie7) this.cssText += getCSSText(styleSheet);
+    }
+    
+    // helper functions
+    function parseMedia(cssText, media) {
+      filterMedia.value = media;
+      return cssText.replace(MEDIA, filterMedia);
+    };
+    
+    function filterMedia(match, media, cssText) {
+      media = toSimpleMedia(media);
+      switch (media) {
+        case "screen":
+        case "print":
+          if (media !== filterMedia.value) return "";
+        case "all":
+          return cssText;
+      }
+      return "";
+    };
+    
+    function toSimpleMedia(media) {
+      if (!media) return "all";
+      var split = media.toLowerCase().split(/\s*,\s*/);
+      media = "none";
+      for (var i = 0; i < split.length; i++) {
+        if (split[i] === "all") return "all";
+        if (split[i] === "screen") {
+          if (media === "print") return "all";
+          media = "screen";
+        } else if (split[i] === "print") {
+          if (media === "screen") return "all";
+          media = "print";
+        }
+      }
+      return media;
+    };
+    
+    // Load an external style sheet
+    function loadStyleSheet(styleSheet, path) {
+      var href = styleSheet._href || styleSheet.href;
+      var url = makePath(href, path);
+      // If the style sheet has already loaded then don't reload it
+      if (fileCache[url]) return "";
+      // Load from source
+      fileCache[url] = styleSheet.disabled ? "" :
+        fixUrls(IE7.CSS.getText(styleSheet, path), getPath(href, path));
+      return fileCache[url];
+    };
+
+    // Fix CSS paths.
+    // We're lumping all css text into one big style sheet so relative
+    // paths have to be fixed. This is necessary anyway because of other
+    // Internet Explorer bugs.
+    function fixUrls(cssText, pathname) {
+      // hack & slash
+      return cssText.replace(URL, "$1" + pathname.slice(0, pathname.lastIndexOf("/") + 1) + "$2");
+    };
+  },
+  
+  load: function() {
+    this.cssText = "";
+    this.getText();
+    this.parse();
+    if (inheritedProperties.length) {
+      this.cssText = parseInherited(this.cssText);
+    }
+    this.cssText = decode(this.cssText);
+    fileCache = {};
+  },
+  
+  parse: function() {
+    var cssText = IE7.CSS.parser.parse(this.cssText);
+    
+    var declarations = "";
+    this.cssText = cssText.replace(/@charset[^;]+;|@font\-face[^\}]+\}/g, function(match) {
+      declarations += match + "\n";
+      return "";
+    });
+    this.declarations = decode(declarations);
+    
+    // Parse the style sheet
+    var offset = IE7.CSS.rules.length;
+    var rules = [], rule;
+    while ((rule = RULE.exec(this.cssText))) {
+      var cssText = rule[2];
+      if (cssText) {
+        var fixDescendants = appVersion < 7 && cssText.indexOf("AlphaImageLoader") !== -1;
+        var selectors = rule[1].match(SELECTOR), selector;
+        for (var i = 0; selector = selectors[i]; i++) {
+          selector = trim(selector);
+          var isUnknown = IE7.CSS.UNKNOWN.test(selector);
+          selectors[i] = isUnknown ? this.createRule(selector, cssText) : selector + "{" + cssText + "}";
+          if (fixDescendants) selectors[i] += this.createRule(selector + ">*", "position:relative");
+        }
+        rules.push(selectors.join("\n"));
+      }
+    }
+    this.cssText = rules.join("\n");
+    this.rules = IE7.CSS.rules.slice(offset);
+  },
+  
+  recalc: function() {
+    var rule, i;
+    for (i = 0; (rule = this.rules[i]); i++) rule.recalc();
+  },
+  
+  toString: function() {
+    return this.declarations + "@media " + this.media + "{" + this.cssText + "}";
+  }
+});
+
+var PseudoElement;
+
+// -----------------------------------------------------------------------
+// IE7 style rules
+// -----------------------------------------------------------------------
+
+var Rule = IE7.Rule = Base.extend({
+  constructor: function(selector, cssText) {
+    this.id = IE7.CSS.rules.length;
+    this.className = Rule.PREFIX + this.id;
+    var pseudoElement = selector.match(FIRST_LINE_LETTER);
+    this.selector = (pseudoElement ? pseudoElement[1] : selector) || "*";
+    this.selectorText = this.parse(this.selector) + (pseudoElement ? pseudoElement[2] : "");
+    this.cssText = cssText;
+    this.MATCH = new RegExp("\\s" + this.className + "(\\s|$)", "g");
+    IE7.CSS.rules.push(this);
+    this.init();
+  },
+  
+  init: Undefined,
+  
+  add: function(element) {
+    // allocate this class
+    element.className += " " + this.className;
+  },
+  
+  recalc: function() {
+    // execute the underlying css query for this class
+    var match = cssQuery(this.selector);
+    // add the class name for all matching elements
+    for (var i = 0; i < match.length; i++) this.add(match[i]);
+  },
+
+  parse: function(selector) {
+    // attempt to preserve specificity for "loose" parsing by
+    //  removing unknown tokens from a css selector but keep as
+    //  much as we can..
+    var simple = selector.replace(Rule.CHILD, " ").replace(Rule.COMPLEX, "");
+    if (appVersion < 7) simple = simple.replace(Rule.MULTI, "");
+    var tags = match(simple, Rule.TAGS).length - match(selector, Rule.TAGS).length;
+    var classes = match(simple, Rule.CLASSES).length - match(selector, Rule.CLASSES).length + 1;
+    while (classes > 0 && Rule.CLASS.test(simple)) {
+      simple = simple.replace(Rule.CLASS, "");
+      classes--;
+    }
+    while (tags > 0 && Rule.TAG.test(simple)) {
+      simple = simple.replace(Rule.TAG, "$1*");
+      tags--;
+    }
+    simple += "." + this.className;
+    classes = Math.min(classes, 2);
+    tags = Math.min(tags, 2);
+    var score = -10 * classes - tags;
+    if (score > 0) {
+      simple = simple + "," + Rule.MAP[score] + " " + simple;
+    }
+    return simple;
+  },
+  
+  remove: function(element) {
+    // deallocate this class
+    element.className = element.className.replace(this.MATCH, "$1");
+  },
+  
+  toString: function() {
+    return format("%1 {%2}", this.selectorText, this.cssText);
+  }
+}, {
+  CHILD: />/g,
+  CLASS: /\.[\w-]+/,
+  CLASSES: /[.:\[]/g,
+  MULTI: /(\.[\w-]+)+/g,
+  PREFIX: "ie7_class",
+  TAG: /^\w+|([\s>+~])\w+/,
+  TAGS: /^\w|[\s>+~]\w/g,
+  MAP: {
+    "1":  "html",
+    "2":  "html body",
+    "10": ".ie7_html",
+    "11": "html.ie7_html",
+    "12": "html.ie7_html body",
+    "20": ".ie7_html .ie7_body",
+    "21": "html.ie7_html .ie7_body",
+    "22": "html.ie7_html body.ie7_body"
+  }
+});
+
+// -----------------------------------------------------------------------
+// IE7 dynamic style
+// -----------------------------------------------------------------------
+
+// object properties:
+// attach: the element that an event handler will be attached to
+// target: the element that will have the IE7 class applied
+
+var DynamicRule = Rule.extend({
+  // properties
+  constructor: function(selector, attach, dynamicPseudoClass, target, cssText) {
+    this.negated = dynamicPseudoClass.indexOf("not") === 0;
+    if (this.negated) dynamicPseudoClass = dynamicPseudoClass.slice(5, -1);
+    // initialise object properties
+    this.attach = attach || "*";
+    this.dynamicPseudoClass = IE7.CSS.dynamicPseudoClasses[dynamicPseudoClass];
+    this.target = target;
+    this.base(selector, cssText);
+  },
+  
+  recalc: function() {
+    // execute the underlying css query for this class
+    var attaches = cssQuery(this.attach), attach;
+    // process results
+    for (var i = 0; attach = attaches[i]; i++) {
+      // retrieve the event handler's target element(s)
+      var target = this.target ? cssQuery(this.target, attach) : [attach];
+      // attach event handlers for dynamic pseudo-classes
+      if (target.length) this.dynamicPseudoClass.apply(attach, target, this);
+    }
+  }
+});
+
+// -----------------------------------------------------------------------
+//  IE7 dynamic pseudo-classes
+// -----------------------------------------------------------------------
+
+var DynamicPseudoClass = Base.extend({
+  constructor: function(name, apply) {
+    this.name = name;
+    this.apply = apply;
+    this.instances = {};
+    IE7.CSS.dynamicPseudoClasses[name] = this;
+  },
+  
+  register: function(instance, negated) {
+    // an "instance" is actually an Arguments object
+    var _class = instance[2];
+    if (!negated && _class.negated) {
+      this.unregister(instance, true);
+    } else {
+      instance.id = _class.id + instance[0].uniqueID;
+      if (!this.instances[instance.id]) {
+        var target = instance[1], j;
+        for (j = 0; j < target.length; j++) _class.add(target[j]);
+        this.instances[instance.id] = instance;
+      }
+    }
+  },
+  
+  unregister: function(instance, negated) {
+    var _class = instance[2];
+    if (!negated && _class.negated) {
+      this.register(instance, true);
+    } else {
+      if (this.instances[instance.id]) {
+        var target = instance[1], j;
+        for (j = 0; j < target.length; j++) _class.remove(target[j]);
+        delete this.instances[instance.id];
+      }
+    }
+  }
+});
+  
+// -----------------------------------------------------------------------
+// dynamic pseudo-classes
+// -----------------------------------------------------------------------
+
+var Hover = new DynamicPseudoClass("hover", function(element) {
+  var instance = arguments;
+  IE7.CSS.addEventHandler(element, "onmouseenter", function() {
+    Hover.register(instance);
+  });
+  IE7.CSS.addEventHandler(element, "onmouseleave", function() {
+    Hover.unregister(instance);
+  });
+});
+
+// globally trap the mouseup event (thanks Martijn!)
+addEventHandler(document, "onmouseup", function() {
+  var instances = Hover.instances;
+  for (var i in instances)
+    if (!instances[i][0].contains(event.srcElement))
+      Hover.unregister(instances[i]);
+});
+
+var ATTR = {
+  "=":  "%1==='%2'",                           // "[@%1='%2']"
+  "~=": "(' '+%1+' ').indexOf(' %2 ')!==-1",   // "[contains(concat(' ',@%1,' '),' %2 ')]",
+  "|=": "%1==='%2'||%1.indexOf('%2-')===0",    // "[@%1='%2' or starts-with(@%1,'%2-')]",
+  "^=": "%1.indexOf('%2')===0",                // "[starts-with(@%1,'%2')]",
+  "$=": "%1.slice(-'%2'.length)==='%2'",       // "[ends-with(@%1,'%2')]",
+  "*=": "%1.indexOf('%2')!==-1"                // "[contains(@%1,'%2')]"
+};
+ATTR[""] = "%1!=null";                         // "[@%1]"
+
+var FILTER = {
+  "<#attr>": function(match, name, operator, value) {
+    var attr = "IE7._getAttribute(e,'" + name + "')";
+    value = getString(value);
+    if (operator.length > 1) {
+      if (!value || operator === "~=" && SPACE.test(value)) {
+        return "false&&";
+      }
+      attr = "(" + attr + "||'')";
+    }
+    return "(" + format(ATTR[operator], attr, value) + ")&&";
+  },
+
+  "<#id>":    ID_ATTRIBUTE + "==='$1'&&",
+
+  "<#class>": "e.className&&(' '+e.className+' ').indexOf(' $1 ')!==-1&&",
+
+  // PSEDUO
+  ":first-child":     "!" + PREVIOUS_SIBLING + "&&",
+  ":link":           "e.currentStyle['ie7-link']=='link'&&",
+  ":visited":        "e.currentStyle['ie7-link']=='visited'&&"
+};
+
+// =========================================================================
+// ie7-html.js
+// =========================================================================
+
+// default font-sizes
+//HEADER += "h1{font-size:2em}h2{font-size:1.5em;}h3{font-size:1.17em;}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.67em}";
+
+IE7.HTML = new (Fix.extend({ // single instance  
+  fixed: {},
+  
+  init: Undefined,
+  
+  addFix: function() {
+    // fixes are a one-off, they are applied when the document is loaded
+    this.fixes.push(arguments);
+  },
+  
+  apply: function() {
+    for (var i = 0; i < this.fixes.length; i++) {
+      var match = cssQuery(this.fixes[i][0]);
+      var fix = this.fixes[i][1];
+      for (var j = 0; j < match.length; j++) fix(match[j]);
+    }
+  },
+  
+  addRecalc: function() {
+    // recalcs occur whenever the document is refreshed using document.recalc()
+    this.recalcs.push(arguments);
+  },
+  
+  recalc: function() {
+    // loop through the fixes
+    for (var i = 0; i < this.recalcs.length; i++) {
+      var match = cssQuery(this.recalcs[i][0]);
+      var recalc = this.recalcs[i][1], element;
+      var key = Math.pow(2, i);
+      for (var j = 0; (element = match[j]); j++) {
+        var uniqueID = element.uniqueID;
+        if ((this.fixed[uniqueID] & key) === 0) {
+          element = recalc(element) || element;
+          this.fixed[uniqueID] |= key;
+        }
+      }
+    }
+  }
+}));
+
+if (appVersion < 7) {  
+  // provide support for the <abbr> tag.
+  document.createElement("abbr");
+  
+  // bind to the first child control
+  IE7.HTML.addRecalc("label", function(label) {
+    if (!label.htmlFor) {
+      var firstChildControl = cssQuery("input,textarea", label, true);
+      if (firstChildControl) {
+        addEventHandler(label, "onclick", function() {
+          firstChildControl.click();
+        });
+      }
+    }
+  });
+}
+
+// =========================================================================
+// ie7-layout.js
+// =========================================================================
+
+var NUMERIC = "[.\\d]";
+
+(function() {
+  var layout = IE7.Layout = {};
+
+  // big, ugly box-model hack + min/max stuff
+
+  // #tantek > #erik > #dean { voice-family: hacker; }
+
+  // -----------------------------------------------------------------------
+  // "layout"
+  // -----------------------------------------------------------------------
+
+  HEADER += "*{boxSizing:content-box}";
+
+  // give an element "layout"
+  layout.boxSizing = function(element) {
+    if (!element.currentStyle.hasLayout) {
+    //#  element.runtimeStyle.fixedHeight =
+      element.style.height = "0cm";
+      if (element.currentStyle.verticalAlign === "auto")
+        element.runtimeStyle.verticalAlign = "top";
+      // when an element acquires "layout", margins no longer collapse correctly
+      collapseMargins(element);
+    }
+  };
+
+  // -----------------------------------------------------------------------
+  // Margin Collapse
+  // -----------------------------------------------------------------------
+
+  function collapseMargins(element) {
+    if (element != viewport && element.currentStyle.position !== "absolute") {
+      collapseMargin(element, "marginTop");
+      collapseMargin(element, "marginBottom");
+    }
+  };
+
+  function collapseMargin(element, type) {
+    if (!element.runtimeStyle[type]) {
+      var parentElement = element.parentElement;
+      var isTopMargin = type === "marginTop";
+      if (parentElement && parentElement.currentStyle.hasLayout && !IE7._getElementSibling(element, isTopMargin ? "previous" : "next")) return;
+      var child = element[isTopMargin ? "firstChild" : "lastChild"];
+      if (child && child.nodeName < "@") child = IE7._getElementSibling(child, isTopMargin ? "next" : "previous");
+      if (child && child.currentStyle.styleFloat === "none" && child.currentStyle.hasLayout) {
+        collapseMargin(child, type);
+        margin = _getMargin(element, element.currentStyle[type]);
+        childMargin = _getMargin(child, child.currentStyle[type]);
+        if (margin < 0 || childMargin < 0) {
+          element.runtimeStyle[type] = margin + childMargin;
+        } else {
+          element.runtimeStyle[type] = Math.max(childMargin, margin);
+        }
+        child.runtimeStyle[type] = "0px";
+      }
+    }
+  };
+
+  function _getMargin(element, value) {
+    return value === "auto" ? 0 : getPixelValue(element, value);
+  };
+
+  // -----------------------------------------------------------------------
+  // box-model
+  // -----------------------------------------------------------------------
+
+  // constants
+  var UNIT = /^[.\d][\w]*$/, AUTO = /^(auto|0cm)$/;
+
+  var apply = {};
+  layout.borderBox = function(element){
+    apply.Width(element);
+    apply.Height(element);
+  };
+
+  var _fixWidth = function(HEIGHT) {
+    apply.Width = function(element) {
+      if (!PERCENT.test(element.currentStyle.width)) _fixWidth(element);
+      if (HEIGHT) collapseMargins(element);
+    };
+
+    function _fixWidth(element, value) {
+      if (!element.runtimeStyle.fixedWidth) {
+        if (!value) value = element.currentStyle.width;
+        element.runtimeStyle.fixedWidth = UNIT.test(value) ? Math.max(0, getFixedWidth(element, value)) + "px" : value;
+        setOverrideStyle(element, "width", element.runtimeStyle.fixedWidth);
+      }
+    };
+
+    function layoutWidth(element) {
+      if (!isFixed(element)) {
+        var layoutParent = element.offsetParent;
+        while (layoutParent && !layoutParent.currentStyle.hasLayout) layoutParent = layoutParent.offsetParent;
+      }
+      return (layoutParent || viewport).clientWidth;
+    };
+
+    function getPixelWidth(element, value) {
+      if (PERCENT.test(value)) return parseInt(parseFloat(value) / 100 * layoutWidth(element));
+      return getPixelValue(element, value);
+    };
+
+    var getFixedWidth = function(element, value) {
+      var borderBox = element.currentStyle["ie7-box-sizing"] === "border-box";
+      var adjustment = 0;
+      if (MSIE5 && !borderBox)
+        adjustment += getBorderWidth(element) + getWidth(element, "padding");
+      else if (!MSIE5 && borderBox)
+        adjustment -= getBorderWidth(element) + getWidth(element, "padding");
+      return getPixelWidth(element, value) + adjustment;
+    };
+
+    // easy way to get border thickness for elements with "layout"
+    function getBorderWidth(element) {
+      return element.offsetWidth - element.clientWidth;
+    };
+
+    // have to do some pixel conversion to get padding/margin thickness :-(
+    function getWidth(element, type) {
+      return getPixelWidth(element, element.currentStyle[type + "Left"]) + getPixelWidth(element, element.currentStyle[type + "Right"]);
+    };
+
+    // -----------------------------------------------------------------------
+    // min/max
+    // -----------------------------------------------------------------------
+
+    HEADER += "*{minWidth:none;maxWidth:none;min-width:none;max-width:none}";
+
+    // handle min-width property
+    layout.minWidth = function(element) {
+      // IE6 supports min-height so we frig it here
+      //#if (element.currentStyle.minHeight === "auto") element.runtimeStyle.minHeight = 0;
+      if (element.currentStyle["min-width"] != null) {
+        element.style.minWidth = element.currentStyle["min-width"];
+      }
+      if (register(arguments.callee, element, element.currentStyle.minWidth !== "none")) {
+        layout.boxSizing(element);
+        _fixWidth(element);
+        resizeWidth(element);
+      }
+    };
+
+    // clone the minWidth function to make a maxWidth function
+    eval("IE7.Layout.maxWidth=" + String(layout.minWidth).replace(/min/g, "max"));
+
+    // apply min/max restrictions
+    function resizeWidth(element) {
+      // check boundaries
+      if (element == document.body) {
+        var width = element.clientWidth;
+      } else {
+        var rect = element.getBoundingClientRect();
+        width = rect.right - rect.left;
+      }
+      if (element.currentStyle.minWidth !== "none" && width < getFixedWidth(element, element.currentStyle.minWidth)) {
+        element.runtimeStyle.width = element.currentStyle.minWidth;
+      } else if (element.currentStyle.maxWidth !== "none" && width >= getFixedWidth(element, element.currentStyle.maxWidth)) {
+        element.runtimeStyle.width = element.currentStyle.maxWidth;
+      } else {
+        element.runtimeStyle.width = element.runtimeStyle.fixedWidth;
+      }
+    };
+
+    // -----------------------------------------------------------------------
+    // right/bottom
+    // -----------------------------------------------------------------------
+
+    function fixRight(element) {
+      if (register(fixRight, element, /^(fixed|absolute)$/.test(element.currentStyle.position) &&
+        getDefinedStyle(element, "left") !== "auto" &&
+        getDefinedStyle(element, "right") !== "auto" &&
+        AUTO.test(getDefinedStyle(element, "width")))) {
+          resizeRight(element);
+          layout.boxSizing(element);
+      }
+    };
+    layout.fixRight = fixRight;
+
+    function resizeRight(element) {
+      var left = getPixelWidth(element, element.runtimeStyle._left || element.currentStyle.left);
+      var width = layoutWidth(element) - getPixelWidth(element, element.currentStyle.right) -  left - getWidth(element, "margin");
+      if (parseInt(element.runtimeStyle.width) === width) return;
+      element.runtimeStyle.width = "";
+      if (isFixed(element) || HEIGHT || element.offsetWidth < width) {
+        if (!MSIE5) width -= getBorderWidth(element) + getWidth(element, "padding");
+        if (width < 0) width = 0;
+        element.runtimeStyle.fixedWidth = width;
+        setOverrideStyle(element, "width", width);
+      }
+    };
+
+  // -----------------------------------------------------------------------
+  // window.onresize
+  // -----------------------------------------------------------------------
+
+    // handle window resize
+    var clientWidth = 0;
+    addResize(function() {
+      if (!viewport) return;
+      var i, wider = (clientWidth < viewport.clientWidth);
+      clientWidth = viewport.clientWidth;
+      // resize elements with "min-width" set
+      var elements = layout.minWidth.elements;
+      for (i in elements) {
+        var element = elements[i];
+        var fixedWidth = (parseInt(element.runtimeStyle.width) === getFixedWidth(element, element.currentStyle.minWidth));
+        if (wider && fixedWidth) element.runtimeStyle.width = "";
+        if (wider == fixedWidth) resizeWidth(element);
+      }
+      // resize elements with "max-width" set
+      var elements = layout.maxWidth.elements;
+      for (i in elements) {
+        var element = elements[i];
+        var fixedWidth = (parseInt(element.runtimeStyle.width) === getFixedWidth(element, element.currentStyle.maxWidth));
+        if (!wider && fixedWidth) element.runtimeStyle.width = "";
+        if (wider !== fixedWidth) resizeWidth(element);
+      }
+      // resize elements with "right" set
+      for (i in fixRight.elements) resizeRight(fixRight.elements[i]);
+    });
+
+  // -----------------------------------------------------------------------
+  // fix CSS
+  // -----------------------------------------------------------------------
+    if (MSIE5) {
+      IE7.CSS.addRecalc("width", NUMERIC, apply.Width);
+    }
+    if (appVersion < 7) {
+      IE7.CSS.addRecalc("max-width", NUMERIC, layout.maxWidth);
+      IE7.CSS.addRecalc("right", NUMERIC, fixRight);
+    } else if (appVersion == 7) {
+      if (HEIGHT) IE7.CSS.addRecalc("height", "[\\d.]+%", function(element) {
+        element.runtimeStyle.pixelHeight = parseInt(layoutWidth(element) * element.currentStyle["ie7-height"].slice(0, -1) / 100);
+      });
+    }
+  };
+
+  eval("var _fixHeight=" + rotate(_fixWidth));
+
+  // apply box-model + min/max fixes
+  _fixWidth();
+  _fixHeight(true);
+  
+  if (appVersion < 7) {
+    IE7.CSS.addRecalc("min-width", NUMERIC, layout.minWidth);
+    IE7.CSS.addFix(/\bmin-height\s*/, "height");
+  }
+})();
+
+// =========================================================================
+// ie7-graphics.js
+// =========================================================================
+
+// a small transparent image used as a placeholder
+var BLANK_GIF = makePath("blank.gif", path);
+
+var ALPHA_IMAGE_LOADER = "DXImageTransform.Microsoft.AlphaImageLoader";
+var PNG_FILTER = "progid:" + ALPHA_IMAGE_LOADER + "(src='%1',sizingMethod='%2')";
+  
+// regular expression version of the above
+var PNG;
+
+var filtered = [];
+
+function fixImage(element) {
+  if (PNG.test(element.src)) {
+    // we have to preserve width and height
+    var image = new Image(element.width, element.height);
+    image.onload = function() {
+      element.width = image.width;
+      element.height = image.height;
+      image = null;
+    };
+    image.src = element.src;
+    // store the original url (we'll put it back when it's printed)
+    element.pngSrc = element.src;
+    // add the AlphaImageLoader thingy
+    addFilter(element);
+  }
+};
+
+if (appVersion < 7) {
+  // ** IE7 VARIABLE
+  // e.g. apply the hack to all files ending in ".png"
+  // IE7_PNG_SUFFIX = ".png";
+  // You can also set it to a RegExp
+  // IE7_PNG_SUFFIX = /\d+\.png$/;
+
+  // replace background(-image): url(..) ..  with background(-image): .. ;filter: ..;
+  IE7.CSS.addFix(/background(-image)?\s*:\s*([^};]*)?url\(([^\)]+)\)([^;}]*)?/, function(match, $1, $2, url, $4) {
+    url = getString(url);
+    return PNG.test(url) ? "filter:" + format(PNG_FILTER, url, $4.indexOf("no-repeat") === -1 ? "scale" : "crop") +
+      ";zoom:1;background" + ($1||"") + ":" + ($2||"") + "none" + ($4||"") : match;
+  });
+
+  // list-style-image
+  IE7.CSS.addRecalc(/list\-style(\-image)?/, "[^};]*url", function(element) {
+    var url = element.currentStyle.listStyleImage.slice(5, -2);
+    if (PNG.test(url)) {
+      if (element.nodeName === "LI") {
+        fixListStyleImage(element, url)
+      } else if (element.nodeName === "UL") {
+        for (var i = 0, li; li = element.childNodes[i]; i++) {
+          if (li.nodeName === "LI") fixListStyleImage(li, url);
+        }
+      }
+    }
+  });
+
+  function fixListStyleImage(element, src) {
+    var style = element.runtimeStyle;
+    var originalHeight = element.offsetHeight;
+    var image = new Image;
+    image.onload = function() {
+      var paddingLeft = element.currentStyle.paddingLeft;
+      paddingLeft = paddingLeft === "0px" ? 0 : getPixelValue(element, paddingLeft);
+      style.paddingLeft = (paddingLeft + this.width) + "px";
+      style.marginLeft = -this.width + "px";
+      style.listStyleType = "none";
+      style.listStyleImage = "none";
+      style.paddingTop = Math.max(originalHeight - element.offsetHeight, 0) + "px";
+      addFilter(element, "crop", src);
+      element.style.zoom = "100%";
+    };
+    image.src = src;
+  };
+  
+  // -----------------------------------------------------------------------
+  //  fix PNG transparency (HTML images)
+  // -----------------------------------------------------------------------
+
+  IE7.HTML.addRecalc("img,input", function(element) {
+    if (element.nodeName === "INPUT" && element.type !== "image") return;
+    fixImage(element);
+    addEventHandler(element, "onpropertychange", function() {
+      if (!printing && event.propertyName === "src" &&
+        element.src.indexOf(BLANK_GIF) === -1) fixImage(element);
+    });
+  });
+
+  // assume that background images should not be printed
+  //  (if they are not transparent then they'll just obscure content)
+  // but we'll put foreground images back...
+  var printing = false;
+  addEventHandler(window, "onbeforeprint", function() {
+    printing = true;
+    for (var i = 0; i < filtered.length; i++) removeFilter(filtered[i]);
+  });
+  addEventHandler(window, "onafterprint", function() {
+    for (var i = 0; i < filtered.length; i++) addFilter(filtered[i]);
+    printing = false;
+  });
+}
+
+// apply a filter
+function addFilter(element, sizingMethod, src) {
+  var filter = element.filters[ALPHA_IMAGE_LOADER];
+  if (filter) {
+    filter.src = src || element.src;
+    filter.enabled = true;
+  } else {
+    element.runtimeStyle.filter = format(PNG_FILTER, src || element.src, sizingMethod || "scale");
+    filtered.push(element);
+  }
+  // remove the real image
+  element.src = BLANK_GIF;
+};
+
+function removeFilter(element) {
+  element.src = element.pngSrc;
+  element.filters[ALPHA_IMAGE_LOADER].enabled = false;
+};
+
+// =========================================================================
+// ie7-fixed.js
+// =========================================================================
+
+(function() {
+  if (appVersion >= 7) return;
+  
+  // some things to consider for this hack.
+  // the document body requires a fixed background. even if
+  //  it is just a blank image.
+  // you have to use setExpression instead of onscroll, this
+  //  together with a fixed body background helps avoid the
+  //  annoying screen flicker of other solutions.
+  
+  IE7.CSS.addRecalc("position", "fixed", _positionFixed, "absolute");
+  IE7.CSS.addRecalc("background(-attachment)?", "[^};]*fixed", _backgroundFixed);
+  
+  // scrolling is relative to the documentElement (HTML tag) when in
+  //  standards mode, otherwise it's relative to the document body
+  var $viewport = MSIE5 ? "body" : "documentElement";
+  
+  function _fixBackground() {
+    // this is required by both position:fixed and background-attachment:fixed.
+    // it is necessary for the document to also have a fixed background image.
+    // we can fake this with a blank image if necessary
+    if (body.currentStyle.backgroundAttachment !== "fixed") {
+      if (body.currentStyle.backgroundImage === "none") {
+        body.runtimeStyle.backgroundRepeat = "no-repeat";
+        body.runtimeStyle.backgroundImage = "url(" + BLANK_GIF + ")"; // dummy
+      }
+      body.runtimeStyle.backgroundAttachment = "fixed";
+    }
+    _fixBackground = Undefined;
+  };
+  
+  var _tmp = createTempElement("img");
+  
+  function _isFixed(element) {
+    return element ? isFixed(element) || _isFixed(element.parentElement) : false;
+  };
+  
+  function _setExpression(element, propertyName, expression) {
+    setTimeout("document.all." + element.uniqueID + ".runtimeStyle.setExpression('" + propertyName + "','" + expression + "')", 0);
+  };
+  
+  // -----------------------------------------------------------------------
+  //  backgroundAttachment: fixed
+  // -----------------------------------------------------------------------
+  
+  function _backgroundFixed(element) {
+    if (register(_backgroundFixed, element, element.currentStyle.backgroundAttachment === "fixed" && !element.contains(body))) {
+      _fixBackground();
+      util.bgLeft(element);
+      util.bgTop(element);
+      _backgroundPosition(element);
+    }
+  };
+  
+  function _backgroundPosition(element) {
+    _tmp.src = element.currentStyle.backgroundImage.slice(5, -2);
+    var parentElement = element.canHaveChildren ? element : element.parentElement;
+    parentElement.appendChild(_tmp);
+    util.setOffsetLeft(element);
+    util.setOffsetTop(element);
+    parentElement.removeChild(_tmp);
+  };
+  
+  // -----------------------------------------------------------------------
+  //  position: fixed
+  // -----------------------------------------------------------------------
+  
+  function _positionFixed(element) {
+    if (register(_positionFixed, element, isFixed(element))) {
+      setOverrideStyle(element, "position",  "absolute");
+      setOverrideStyle(element, "left",  element.currentStyle.left);
+      setOverrideStyle(element, "top",  element.currentStyle.top);
+      _fixBackground();
+      IE7.Layout.fixRight(element);
+      //IE7.Layout.fixBottom(element);
+      _foregroundPosition(element);
+    }
+  };
+  
+  function _foregroundPosition(element, recalc) {
+    document.body.getBoundingClientRect(); // force a reflow
+    util.positionTop(element, recalc);
+    util.positionLeft(element, recalc, true);
+    if (!element.runtimeStyle.autoLeft && element.currentStyle.marginLeft === "auto" &&
+      element.currentStyle.right !== "auto") {
+      var left = viewport.clientWidth - util.getPixelWidth(element, element.currentStyle.right) -
+        util.getPixelWidth(element, element.runtimeStyle._left) - element.clientWidth;
+      if (element.currentStyle.marginRight === "auto") left = parseInt(left / 2);
+      if (_isFixed(element.offsetParent)) element.runtimeStyle.pixelLeft += left;
+      else element.runtimeStyle.shiftLeft = left;
+    }
+    if (!element.runtimeStyle.fixedWidth) util.clipWidth(element);
+    if (!element.runtimeStyle.fixedHeight) util.clipHeight(element);
+  };
+  
+  // -----------------------------------------------------------------------
+  //  capture window resize
+  // -----------------------------------------------------------------------
+  
+  function _resize() {
+    // if the window has been resized then some positions need to be
+    //  recalculated (especially those aligned to "right" or "top"
+    var elements = _backgroundFixed.elements;
+    for (var i in elements) _backgroundPosition(elements[i]);
+    elements = _positionFixed.elements;
+    for (i in elements) {
+      _foregroundPosition(elements[i], true);
+      _foregroundPosition(elements[i], true);
+    }
+    _timer = 0;
+  };
+  
+  // use a timer (sometimes this is a good way to prevent resize loops)
+  var _timer;
+  addResize(function() {
+    if (!_timer) _timer = setTimeout(_resize, 100);
+  });
+
+  // -----------------------------------------------------------------------
+  //  rotated
+  // -----------------------------------------------------------------------
+
+  var util = {};
+  
+  var _horizontal = function(util) {
+    util.bgLeft = function(element) {
+      element.style.backgroundPositionX = element.currentStyle.backgroundPositionX;
+      if (!_isFixed(element)) {
+        _setExpression(element, "backgroundPositionX", "(parseInt(runtimeStyle.offsetLeft)+document." + $viewport + ".scrollLeft)||0");
+      }
+    };
+
+    util.setOffsetLeft = function(element) {
+      var propertyName = _isFixed(element) ? "backgroundPositionX" : "offsetLeft";
+      element.runtimeStyle[propertyName] =
+        util.getOffsetLeft(element, element.style.backgroundPositionX) -
+        element.getBoundingClientRect().left - element.clientLeft + 2;
+    };
+
+    util.getOffsetLeft = function(element, position) {
+      switch (position) {
+        case "left":
+        case "top":
+          return 0;
+        case "right":
+        case "bottom":
+          return viewport.clientWidth - _tmp.offsetWidth;
+        case "center":
+          return (viewport.clientWidth - _tmp.offsetWidth) / 2;
+        default:
+          if (PERCENT.test(position)) {
+            return parseInt((viewport.clientWidth - _tmp.offsetWidth) * parseFloat(position) / 100);
+          }
+          _tmp.style.left = position;
+          return _tmp.offsetLeft;
+      }
+    };
+
+    util.clipWidth = function(element) {
+      var fixWidth = element.runtimeStyle.fixWidth;
+      element.runtimeStyle.borderRightWidth = "";
+      element.runtimeStyle.width = fixWidth ? util.getPixelWidth(element, fixWidth) + "px" : "";
+      if (element.currentStyle.width !== "auto") {
+        var rect = element.getBoundingClientRect();
+        var width = element.offsetWidth - viewport.clientWidth + rect.left - 2;
+        if (width >= 0) {
+          element.runtimeStyle.borderRightWidth = "0px";
+          width = Math.max(getPixelValue(element, element.currentStyle.width) - width, 0);
+          setOverrideStyle(element, "width",  width);
+          return width;
+        }
+      }
+    };
+
+    util.positionLeft = function(element, recalc) {
+      // if the element's width is in % units then it must be recalculated
+      //  with respect to the viewport
+      if (!recalc && PERCENT.test(element.currentStyle.width)) {
+        element.runtimeStyle.fixWidth = element.currentStyle.width;
+      }
+      if (element.runtimeStyle.fixWidth) {
+        element.runtimeStyle.width = util.getPixelWidth(element, element.runtimeStyle.fixWidth);
+      }
+      //if (recalc) {
+      //  // if the element is fixed on the right then no need to recalculate
+      //  if (!element.runtimeStyle.autoLeft) return;
+      //} else {
+        element.runtimeStyle.shiftLeft = 0;
+        element.runtimeStyle._left = element.currentStyle.left;
+        // is the element fixed on the right?
+        element.runtimeStyle.autoLeft = element.currentStyle.right !== "auto" && element.currentStyle.left === "auto";
+      //}
+      // reset the element's "left" value and get it's natural position
+      element.runtimeStyle.left = "";
+      element.runtimeStyle.screenLeft = util.getScreenLeft(element);
+      element.runtimeStyle.pixelLeft = element.runtimeStyle.screenLeft;
+      // if the element is contained by another fixed element then there is no need to
+      //  continually recalculate it's left position
+      if (!recalc && !_isFixed(element.offsetParent)) {
+        // onsrcoll produces jerky movement, so we use an expression
+        _setExpression(element, "pixelLeft", "runtimeStyle.screenLeft+runtimeStyle.shiftLeft+document." + $viewport + ".scrollLeft");
+      }
+    };
+
+    // I've forgotten how this works...
+    util.getScreenLeft = function(element) { // thanks to kevin newman (captainn)
+      var screenLeft = element.offsetLeft, nested = 1;
+      if (element.runtimeStyle.autoLeft) {
+        screenLeft = viewport.clientWidth - element.offsetWidth - util.getPixelWidth(element, element.currentStyle.right);
+      }
+      // accommodate margins
+      if (element.currentStyle.marginLeft !== "auto") {
+        screenLeft -= util.getPixelWidth(element, element.currentStyle.marginLeft);
+      }
+      while (element = element.offsetParent) {
+        if (element.currentStyle.position !== "static") nested = -1;
+        screenLeft += element.offsetLeft * nested;
+      }
+      return screenLeft;
+    };
+
+    util.getPixelWidth = function(element, value) {
+      return PERCENT.test(value) ? parseInt(parseFloat(value) / 100 * viewport.clientWidth) : getPixelValue(element, value);
+    };
+  };
+  eval("var _vertical=" + rotate(_horizontal));
+  _horizontal(util);
+  _vertical(util);
+})();
+
+// =========================================================================
+// ie7-oveflow.js
+// =========================================================================
+
+/* ---------------------------------------------------------------------
+
+  This module alters the structure of the document.
+  It may adversely affect other CSS rules. Be warned.
+
+--------------------------------------------------------------------- */
+
+if (appVersion < 7) {
+  var WRAPPER_STYLE = {
+    backgroundColor: "transparent",
+    backgroundImage: "none",
+    backgroundPositionX: null,
+    backgroundPositionY: null,
+    backgroundRepeat: null,
+    borderTopWidth: 0,
+    borderRightWidth: 0,
+    borderBottomWidth: 0,
+    borderLeftStyle: "none",
+    borderTopStyle: "none",
+    borderRightStyle: "none",
+    borderBottomStyle: "none",
+    borderLeftWidth: 0,
+    borderLeftColor: "#000",
+    borderTopColor: "#000",
+    borderRightColor: "#000",
+    borderBottomColor: "#000",
+    height: null,
+    marginTop: 0,
+    marginBottom: 0,
+    marginRight: 0,
+    marginLeft: 0,
+    width: "100%"
+  };
+
+  IE7.CSS.addRecalc("overflow", "visible", function(element) {
+    if (element.currentStyle.position === "absolute") return;
+    
+    // don't do this again
+    if (element.parentNode.ie7_wrapped) return;
+
+    // if max-height is applied, makes sure it gets applied first
+    if (IE7.Layout && element.currentStyle["max-height"] !== "auto") {
+      IE7.Layout.maxHeight(element);
+    }
+
+    if (element.currentStyle.marginLeft === "auto") element.style.marginLeft = 0;
+    if (element.currentStyle.marginRight === "auto") element.style.marginRight = 0;
+
+    var wrapper = document.createElement(ANON);
+    wrapper.ie7_wrapped = element;
+    for (var propertyName in WRAPPER_STYLE) {
+      wrapper.style[propertyName] = element.currentStyle[propertyName];
+      if (WRAPPER_STYLE[propertyName] != null) {
+        element.runtimeStyle[propertyName] = WRAPPER_STYLE[propertyName];
+      }
+    }
+    wrapper.style.display = "block";
+    wrapper.style.position = "relative";
+    element.runtimeStyle.position = "absolute";
+    element.parentNode.insertBefore(wrapper, element);
+    wrapper.appendChild(element);
+  });
+}
+
+// =========================================================================
+// ie7-quirks.js
+// =========================================================================
+
+function ie7Quirks() {
+  var FONT_SIZES = "xx-small,x-small,small,medium,large,x-large,xx-large".split(",");
+  for (var i = 0; i < FONT_SIZES.length; i++) {
+    FONT_SIZES[FONT_SIZES[i]] = FONT_SIZES[i - 1] || "0.67em";
+  }
+  
+  IE7.CSS.addFix(/(font(-size)?\s*:\s*)([\w.-]+)/, function(match, label, size, value) {
+    return label + (FONT_SIZES[value] || value);
+  });
+  
+  var NEGATIVE = /^\-/, LENGTH = /(em|ex)$/i;
+  var EM = /em$/i, EX = /ex$/i;
+
+  getPixelValue = function(element, value) {
+    if (PIXEL.test(value)) return parseInt(value)||0;
+    var scale = NEGATIVE.test(value)? -1 : 1;
+    if (LENGTH.test(value)) scale *= getFontScale(element);
+    temp.style.width = scale < 0 ? value.slice(1) : value;
+    body.appendChild(temp);
+    // retrieve pixel width
+    value = scale * temp.offsetWidth;
+    // remove the temporary element
+    temp.removeNode();
+    return parseInt(value);
+  };
+
+  var temp = createTempElement();
+  function getFontScale(element) {
+    var scale = 1;
+    temp.style.fontFamily = element.currentStyle.fontFamily;
+    temp.style.lineHeight = element.currentStyle.lineHeight;
+    //temp.style.fontSize = "";
+    while (element != body) {
+      var fontSize = element.currentStyle["ie7-font-size"];
+      if (fontSize) {
+        if (EM.test(fontSize)) scale *= parseFloat(fontSize);
+        else if (PERCENT.test(fontSize)) scale *= (parseFloat(fontSize) / 100);
+        else if (EX.test(fontSize)) scale *= (parseFloat(fontSize) / 2);
+        else {
+          temp.style.fontSize = fontSize;
+          return 1;
+        }
+      }
+      element = element.parentElement;
+    }
+    return scale;
+  };
+
+  // cursor:pointer (IE5.x)
+  IE7.CSS.addFix(/cursor\s*:\s*pointer/, "cursor:hand");
+  // display:list-item (IE5.x)
+  IE7.CSS.addFix(/display\s*:\s*list-item/, "display:block");
+  
+  // -----------------------------------------------------------------------
+  //  margin:auto
+  // -----------------------------------------------------------------------
+  
+  function fixMargin(element) {
+    var parent = element.parentElement;
+    var margin = parent.offsetWidth - element.offsetWidth - getPaddingWidth(parent);
+    var autoRight = (element.currentStyle["ie7-margin"] && element.currentStyle.marginRight === "auto") ||
+      element.currentStyle["ie7-margin-right"] === "auto";
+    switch (parent.currentStyle.textAlign) {
+      case "right":
+        margin = autoRight ? parseInt(margin / 2) : 0;
+        element.runtimeStyle.marginRight = margin + "px";
+        break;
+      case "center":
+        if (autoRight) margin = 0;
+      default:
+        if (autoRight) margin /= 2;
+        element.runtimeStyle.marginLeft = parseInt(margin) + "px";
+    }
+  };
+
+  function getPaddingWidth(element) {
+    return getPixelValue(element, element.currentStyle.paddingLeft) +
+      getPixelValue(element, element.currentStyle.paddingRight);
+  };
+  
+  IE7.CSS.addRecalc("margin(-left|-right)?", "[^};]*auto", function(element) {
+    if (register(fixMargin, element,
+      element.parentElement &&
+      element.currentStyle.display === "block" &&
+      element.currentStyle.marginLeft === "auto" &&
+      element.currentStyle.position !== "absolute")) {
+        fixMargin(element);
+    }
+  });
+  
+  addResize(function() {
+    for (var i in fixMargin.elements) {
+      var element = fixMargin.elements[i];
+      element.runtimeStyle.marginLeft =
+      element.runtimeStyle.marginRight = "";
+      fixMargin(element);
+    }
+  });
+};
+
+
+// =========================================================================
+// ie8-css.js
+// =========================================================================
+
+var BRACKETS = "\\([^)]+\\)";
+
+// pseudo-elements can be declared with a double colon
+encoder.add(/::(before|after)/, ":$1");
+
+if (appVersion < 8) {
+
+  if (IE7.CSS.pseudoClasses) IE7.CSS.pseudoClasses += "|";
+  IE7.CSS.pseudoClasses += "before|after|lang" + BRACKETS;
+
+  // -----------------------------------------------------------------------
+  // propertyName: inherit;
+  // -----------------------------------------------------------------------
+  
+  function parseInherited(cssText) {
+    return cssText.replace(new RegExp("([{;\\s])(" + inheritedProperties.join("|") + ")\\s*:\\s*([^;}]+)", "g"), "$1$2:$3;ie7-$2:$3");
+  };
+
+  var INHERITED = /[\w-]+\s*:\s*inherit/g;
+  var STRIP_IE7_FLAGS = /ie7\-|\s*:\s*inherit/g;
+  var DASH_LOWER = /\-([a-z])/g;
+  function toUpper(match, chr) {return chr.toUpperCase()};
+  
+  IE7.CSS.addRecalc("[\\w-]+", "inherit", function(element, cssText) {
+    if (element.parentElement) {
+      var inherited = cssText.match(INHERITED);
+      for (var i = 0; i < inherited.length; i++) {
+        var propertyName = inherited[i].replace(STRIP_IE7_FLAGS, "");
+        if (element.currentStyle["ie7-" + propertyName] === "inherit") {
+          propertyName = propertyName.replace(DASH_LOWER, toUpper);
+          element.runtimeStyle[propertyName] = element.parentElement.currentStyle[propertyName];
+        }
+      }
+    }
+  }, function(match) {
+    inheritedProperties.push(rescape(match.slice(1).split(":")[0]));
+    return match;
+  });
+
+  // -----------------------------------------------------------------------
+  // dynamic pseudo-classes
+  // -----------------------------------------------------------------------
+
+  var Focus = new DynamicPseudoClass("focus", function(element) {
+    var instance = arguments;
+
+    IE7.CSS.addEventHandler(element, "onfocus", function() {
+      Focus.unregister(instance); // in case it starts with focus
+      Focus.register(instance);
+    });
+
+    IE7.CSS.addEventHandler(element, "onblur", function() {
+      Focus.unregister(instance);
+    });
+
+    // check the active element for initial state
+    if (element == document.activeElement) {
+      Focus.register(instance)
+    }
+  });
+
+  var Active = new DynamicPseudoClass("active", function(element) {
+    var instance = arguments;
+    IE7.CSS.addEventHandler(element, "onmousedown", function() {
+      Active.register(instance);
+    });
+  });
+
+  // globally trap the mouseup event (thanks Martijn!)
+  addEventHandler(document, "onmouseup", function() {
+    var instances = Active.instances;
+    for (var i in instances) Active.unregister(instances[i]);
+  });
+
+  // -----------------------------------------------------------------------
+  // IE7 pseudo elements
+  // -----------------------------------------------------------------------
+
+  // constants
+  var URL = /^url\s*\(\s*([^)]*)\)$/;
+  var POSITION_MAP = {
+    before0: "beforeBegin",
+    before1: "afterBegin",
+    after0: "afterEnd",
+    after1: "beforeEnd"
+  };
+
+  var PseudoElement = IE7.PseudoElement = Rule.extend({
+    constructor: function(selector, position, cssText) {
+      // initialise object properties
+      this.position = position;
+      var content = cssText.match(PseudoElement.CONTENT), match, entity;
+      if (content) {
+        content = content[1];
+        match = content.split(/\s+/);
+        for (var i = 0; (entity = match[i]); i++) {
+          match[i] = /^attr/.test(entity) ? {attr: entity.slice(5, -1)} :
+            entity.charAt(0) === "'" ? getString(entity) : decode(entity);
+        }
+        content = match;
+      }
+      this.content = content;
+      // CSS text needs to be decoded immediately
+      this.base(selector, decode(cssText));
+    },
+
+    init: function() {
+      // execute the underlying css query for this class
+      this.match = cssQuery(this.selector);
+      for (var i = 0; i < this.match.length; i++) {
+        var runtimeStyle = this.match[i].runtimeStyle;
+        if (!runtimeStyle[this.position]) runtimeStyle[this.position] = {cssText:""};
+        runtimeStyle[this.position].cssText += ";" + this.cssText;
+        if (this.content != null) runtimeStyle[this.position].content = this.content;
+      }
+    },
+
+    create: function(target) {
+      var generated = target.runtimeStyle[this.position];
+      if (generated) {
+        // copy the array of values
+        var content = [].concat(generated.content || "");
+        for (var j = 0; j < content.length; j++) {
+          if (typeof content[j] == "object") {
+            content[j] = target.getAttribute(content[j].attr);
+          }
+        }
+        content = content.join("");
+        var url = content.match(URL);
+        var cssText = "overflow:hidden;" + generated.cssText.replace(/'/g, '"');
+        var position = POSITION_MAP[this.position + Number(target.canHaveChildren)];
+        var id = 'ie7_pseudo' + PseudoElement.count++;
+        target.insertAdjacentHTML(position, format(PseudoElement.ANON, this.className, id, cssText, url ? "" : content));
+        if (url) {
+          var src = getString(url[1]);
+          var pseudoElement = document.getElementById(id);
+          pseudoElement.src = src;
+          addFilter(pseudoElement, "crop");
+          var targetIsFloated = target.currentStyle.styleFloat !== "none";
+          if (pseudoElement.currentStyle.display === "inline" || targetIsFloated) {
+            if (appVersion < 7 && targetIsFloated && target.canHaveChildren) {
+              target.runtimeStyle.display = "inline";
+              target.runtimeStyle.position = "relative";
+              pseudoElement.runtimeStyle.position = "absolute";
+            }
+            pseudoElement.style.display = "inline-block";
+            if (target.currentStyle.styleFloat !== "none") {
+              pseudoElement.style.pixelWidth = target.offsetWidth;
+            }
+            var image = new Image;
+            image.onload = function() {
+              pseudoElement.style.pixelWidth = this.width;
+              pseudoElement.style.pixelHeight = Math.max(this.height, pseudoElement.offsetHeight);
+            };
+            image.src = src;
+          }
+        }
+        target.runtimeStyle[this.position] = null;
+      }
+    },
+
+    recalc: function() {
+      if (this.content == null) return;
+      for (var i = 0; i < this.match.length; i++) {
+        this.create(this.match[i]);
+      }
+    },
+
+    toString: function() {
+      return "." + this.className + "{display:inline}";
+    }
+  }, {
+    CONTENT: /content\s*:\s*([^;]*)(;|$)/,
+    ANON: "<ie7:! class='ie7_anon %1' id=%2 style='%3'>%4</ie7:!>",
+    MATCH: /(.*):(before|after).*/,
+
+    count: 0
+  });
+
+  IE7._getLang = function(element) {
+    var lang = "";
+    while (element && element.nodeType === 1) {
+      lang = element.lang || element.getAttribute("lang") || "";
+      if (lang) break;
+      element = element.parentNode;
+    }
+    return lang;
+  };
+
+  FILTER = extend(FILTER, {
+    ":lang\\(([^)]+)\\)":    "((ii=IE7._getLang(e))==='$1'||ii.indexOf('$1-')===0)&&"
+  });
+}
+
+// =========================================================================
+// ie8-html.js
+// =========================================================================
+
+var UNSUCCESSFUL = /^(submit|reset|button)$/;
+
+// -----------------------------------------------------------------------
+// <button>
+// -----------------------------------------------------------------------
+
+// IE bug means that innerText is submitted instead of "value"
+IE7.HTML.addRecalc("button,input", function(button) {
+  if (button.nodeName === "BUTTON") {
+    var match = button.outerHTML.match(/ value="([^"]*)"/i);
+    button.runtimeStyle.value = match ? match[1] : "";
+  }
+  // flag the button/input that was used to submit the form
+  if (button.type === "submit") {
+    addEventHandler(button, "onclick", function() {
+      button.runtimeStyle.clicked = true;
+      setTimeout("document.all." + button.uniqueID + ".runtimeStyle.clicked=false", 1);
+    });
+  }
+});
+
+// -----------------------------------------------------------------------
+// <form>
+// -----------------------------------------------------------------------
+
+// only submit "successful controls
+IE7.HTML.addRecalc("form", function(form) {
+  addEventHandler(form, "onsubmit", function() {
+    for (var element, i = 0; element = form[i]; i++) {
+      if (UNSUCCESSFUL.test(element.type) && !element.disabled && !element.runtimeStyle.clicked) {
+        element.disabled = true;
+        setTimeout("document.all." + element.uniqueID + ".disabled=false", 1);
+      } else if (element.nodeName === "BUTTON" && element.type === "submit") {
+        setTimeout("document.all." + element.uniqueID + ".value='" + element.value + "'", 1);
+        element.value = element.runtimeStyle.value;
+      }
+    }
+  });
+});
+
+// -----------------------------------------------------------------------
+// <img>
+// -----------------------------------------------------------------------
+
+// get rid of the spurious tooltip produced by the alt attribute on images
+IE7.HTML.addRecalc("img", function(img) {
+  if (img.alt && !img.title) img.title = "";
+});
+
+// =========================================================================
+// ie8-layout.js
+// =========================================================================
+
+if (appVersion < 8) {
+  IE7.CSS.addRecalc("border-spacing", NUMERIC, function(element) {
+    if (element.currentStyle.borderCollapse !== "collapse") {
+      element.cellSpacing = getPixelValue(element, element.currentStyle["ie7-border-spacing"].split(" ")[0]);
+    }
+  });
+  IE7.CSS.addRecalc("box-sizing", "content-box", IE7.Layout.boxSizing);
+  IE7.CSS.addRecalc("box-sizing", "border-box", IE7.Layout.borderBox);
+}
+
+// =========================================================================
+// ie8-graphics.js
+// =========================================================================
+
+if (appVersion < 8) {
+  // fix object[type=image/*]
+  var IMAGE = /^image/i;
+  IE7.HTML.addRecalc("object", function(element) {
+    if (IMAGE.test(element.type)) {
+      element.body.style.cssText = "margin:0;padding:0;border:none;overflow:hidden";
+      return element;
+    }
+  });
+}
+
+// =========================================================================
+// ie9-css.js
+// =========================================================================
+
+var NOT_NEXT_BY_TYPE     = "!IE7._getElementSiblingByType(e,'next')&&",
+    NOT_PREVIOUS_BY_TYPE = NOT_NEXT_BY_TYPE.replace("next", "previous");
+
+if (IE7.CSS.pseudoClasses) IE7.CSS.pseudoClasses += "|";
+IE7.CSS.pseudoClasses += "(?:first|last|only)\\-(?:child|of\\-type)|empty|root|target|" +
+  ("not|nth\\-child|nth\\-last\\-child|nth\\-of\\-type|nth\\-last\\-of\\-type".split("|").join(BRACKETS + "|") + BRACKETS);
+  
+// :checked
+var Checked = new DynamicPseudoClass("checked", function(element) {
+  if (typeof element.checked !== "boolean") return;
+  var instance = arguments;
+  IE7.CSS.addEventHandler(element, "onpropertychange", function() {
+    if (event.propertyName === "checked") {
+      if (element.checked === true) Checked.register(instance);
+      else Checked.unregister(instance);
+    }
+  });
+  // check current checked state
+  if (element.checked === true) Checked.register(instance);
+});
+
+// :enabled
+var Enabled = new DynamicPseudoClass("enabled", function(element) {
+  if (typeof element.disabled !== "boolean") return;
+  var instance = arguments;
+  IE7.CSS.addEventHandler(element, "onpropertychange", function() {
+    if (event.propertyName === "disabled") {
+      if (element.disabled === false) Enabled.register(instance);
+      else Enabled.unregister(instance);
+    }
+  });
+  // check current disabled state
+  if (element.disabled === false) Enabled.register(instance);
+});
+
+// :disabled
+var Disabled = new DynamicPseudoClass("disabled", function(element) {
+  if (typeof element.disabled !== "boolean") return;
+  var instance = arguments;
+  IE7.CSS.addEventHandler(element, "onpropertychange", function() {
+    if (event.propertyName === "disabled") {
+      if (element.disabled === true) Disabled.register(instance);
+      else Disabled.unregister(instance);
+    }
+  });
+  // check current disabled state
+  if (element.disabled === true) Disabled.register(instance);
+});
+
+// :indeterminate (Kevin Newman)
+var Indeterminate = new DynamicPseudoClass("indeterminate", function(element) {
+  if (typeof element.indeterminate !== "boolean") return;
+  var instance = arguments;
+  IE7.CSS.addEventHandler(element, "onpropertychange", function() {
+    if (event.propertyName === "indeterminate") {
+      if (element.indeterminate === true) Indeterminate.register(instance);
+      else Indeterminate.unregister(instance);
+    }
+  });
+  IE7.CSS.addEventHandler(element, "onclick", function() {
+    Indeterminate.unregister(instance);
+  });
+  // clever Kev says no need to check this up front
+});
+
+// :target
+var Target = new DynamicPseudoClass("target", function(element) {
+  var instance = arguments;
+  // if an element has a tabIndex then it can become "active".
+  //  The default is zero anyway but it works...
+  if (!element.tabIndex) element.tabIndex = 0;
+  // this doesn't detect the back button. I don't know how to do that without adding an iframe :-(
+  IE7.CSS.addEventHandler(document, "onpropertychange", function() {
+    if (event.propertyName === "activeElement") {
+      if (element.id && element.id === location.hash.slice(1)) Target.register(instance);
+      else Target.unregister(instance);
+    }
+  });
+  // check the current location
+  if (element.id && element.id === location.hash.slice(1)) Target.register(instance);
+});
+
+// Register a node and index its siblings.
+var _currentIndex = 1, // -@DRE
+    allIndexes = {_currentIndex: 1};
+
+IE7._indexOf = function(element, last, ofType) {
+  var parent = element.parentNode;
+  if (!parent || parent.nodeType !== 1) return NaN;
+
+  var tagName = ofType ? element.nodeName : "";
+  if (tagName === "TR" && element.sectionRowIndex >= 0) {
+    var index = element.sectionRowIndex;
+    return last ? element.parentNode.rows.length - index + 1 : index;
+  }
+  if ((tagName === "TD" || tagName === "TH") && element.cellIndex >= 0) {
+    index = element.cellIndex;
+    return last ? element.parentNode.cells.length - index + 1 : index;
+  }
+  if (allIndexes._currentIndex !== _currentIndex) {
+    allIndexes = {_currentIndex: _currentIndex};
+  }
+  var id = (parent.uniqueID) + "-" + tagName,
+      indexes = allIndexes[id];
+  if (!indexes) {
+    indexes = {};
+    var index = 0,
+        child = parent.firstChild;
+    while (child) {
+      if (ofType ? child.nodeName === tagName : child.nodeName > "@") {
+        indexes[child.uniqueID] = ++index;
+      }
+      child = child.nextSibling;
+    }
+    indexes.length = index;
+    allIndexes[id] = indexes;
+  }
+  index = indexes[element.uniqueID];
+  return last ? indexes.length - index + 1 : index;
+};
+
+IE7._isEmpty = function(node) {
+  node = node.firstChild;
+  while (node) {
+    if (node.nodeType === 3 || node.nodeName > "@") return false;
+    node = node.nextSibling;
+  }
+  return true;
+};
+
+IE7._getElementSiblingByType = function(node, direction) {
+  var tagName = node.nodeName;
+  direction += "Sibling";
+  do {
+    node = node[direction];
+    if (node && node.nodeName === tagName) break;
+  } while (node);
+  return node;
+};
+
+var ONE = {"+": 1, "-": -1}, SPACES = / /g;
+
+FILTER = extend(extend({
+  ":nth(-last)?-(?:child|(of-type))\\((<#nth_arg>)\\)(<#filter>)?": function(match, last, ofType, args, filters) { // :nth- pseudo classes
+    args = args.replace(SPACES, "");
+
+    var index = "IE7._indexOf(e," + !!last + "," + !!ofType + ")";
+
+    if (args === "even") args = "2n";
+    else if (args === "odd") args = "2n+1";
+    else if (!isNaN(args)) args = "0n" + ~~args;
+
+    args = args.split("n");
+    var a = ~~(ONE[args[0]] || args[0] || 1),
+        b = ~~args[1];
+    if (a === 0) {
+      var expr = index + "===" + b;
+    } else {
+      expr = "((ii=" + index + ")-(" + b + "))%" + a + "===0&&ii" + (a < 0 ? "<" : ">") + "=" + b;
+    }
+    return this.parse(filters) + expr + "&&";
+  },
+
+  "<#negation>": function(match, simple) {
+    if (/:not/i.test(simple)) throwSelectorError();
+
+    if (/^[#.:\[]/.test(simple)) {
+      simple = "*" + simple;
+    }
+    return "!(" + MATCHER.parse(simple).slice(3, -2) + ")&&";
+  }
+}, FILTER), {
+  ":checked":         "e.checked===true&&",
+  ":disabled":        "e.disabled===true&&",
+  ":enabled":         "e.disabled===false&&",
+  ":last-child":      "!" + NEXT_SIBLING + "&&",
+  ":only-child":      "!" + PREVIOUS_SIBLING + "&&!" + NEXT_SIBLING + "&&",
+  ":first-of-type":   NOT_PREVIOUS_BY_TYPE,
+  ":last-of-type":    NOT_NEXT_BY_TYPE,
+  ":only-of-type":    NOT_PREVIOUS_BY_TYPE + NOT_NEXT_BY_TYPE,
+
+  ":empty":          "IE7._isEmpty(e)&&",
+  ":root":           "e==R&&",
+  ":target":         "H&&" + ID_ATTRIBUTE + "===H&&"
+});
+
+var HTML5 = "article,aside,audio,canvas,details,figcaption,figure,footer,header,hgroup,mark,menu,meter,nav,output,progress,section,summary,time,video".split(",");
+for (var i = 0, tagName; tagName = HTML5[i]; i++) document.createElement(tagName);
+
+HEADER += "datalist{display:none}\
+details{padding-left:40px;display:block;margin:1em 0}\
+meter,progress{vertical-align:-0.2em;width:5em;height:1em;display:inline-block}\
+progress{width:10em;}\
+article,aside,figcaption,footer,header,hgroup,summary,section,nav{display:block;margin:1em 0}\
+figure{margin:1em 40px;display:block}\
+mark{background:yellow}";
+
+// =========================================================================
+// ie9-layout.js
+// =========================================================================
+
+// =========================================================================
+// ie9-graphics.js
+// =========================================================================
+
+IE7.CSS.addFix(/\bopacity\s*:\s*([\d.]+)/, function(match, value) {
+  return "zoom:1;filter:Alpha(opacity=" + ((value * 100) || 1) + ")";
+});
+
+var MATCHER;
+
+var cssQuery = (function() {
+  var CONTEXT = /^[>+~]/;
+  
+  var useContext = false;
+  
+  // This is not a selector engine in the strictest sense. So it's best to silently error.
+  function cssQuery(selector, context, single) {
+    selector = trim(selector);
+    if (!context) context = document;
+    var ref = context;
+    useContext = CONTEXT.test(selector);
+    if (useContext) {
+      context = context.parentNode;
+      selector = "*" + selector;
+    }
+    try {
+      return selectQuery.create(selector, useContext)(context, single ? null : [], ref);
+    } catch (ex) {
+      return single ? null : [];
+    }
+  };
+
+  var VALID_SELECTOR = /^(\\.|[' >+~#.\[\]:*(),\w-\^|$=]|[^\x00-\xa0])+$/;
+
+  var _EVALUATED = /^(href|src)$/;
+  var _ATTRIBUTES = {
+    "class": "className",
+    "for": "htmlFor"
+  };
+
+  var IE7_CLASS_NAMES = /\sie7_\w+/g;
+
+  var USE_IFLAG = /^(action|cite|codebase|data|dynsrc|href|longdesc|lowsrc|src|usemap|url)$/i;
+
+  IE7._getAttribute = function(element, name) {
+    if (element.getAttributeNode) {
+      var attribute = element.getAttributeNode(name);
+    }
+    name = _ATTRIBUTES[name.toLowerCase()] || name;
+    if (!attribute) attribute = element.attributes[name];
+    var specified = attribute && attribute.specified;
+
+    if (element[name] && typeof element[name] == "boolean") return name.toLowerCase();
+    if ((specified && USE_IFLAG.test(name)) || (!attribute && MSIE5) || name === "value" || name === "type") {
+      return element.getAttribute(name, 2);
+    }
+    if (name === "style") return element.style.cssText.toLowerCase() || null;
+
+    return specified ? String(attribute.nodeValue) : null;
+  };
+
+  var names = "colSpan,rowSpan,vAlign,dateTime,accessKey,tabIndex,encType,maxLength,readOnly,longDesc";
+  // Convert the list of strings to a hash, mapping the lowercase name to the camelCase name.
+  extend(_ATTRIBUTES, combine(names.toLowerCase().split(","), names.split(",")));
+
+  IE7._getElementSibling = function(node, direction) {
+    direction += "Sibling";
+    do {
+      node = node[direction];
+      if (node && node.nodeName > "@") break;
+    } while (node);
+    return node;
+  };
+
+  var IMPLIED_ASTERISK    = /(^|[, >+~])([#.:\[])/g,
+      BLOCKS              = /\)\{/g,
+      COMMA               = /,/,
+      QUOTED              = /^['"]/,
+      HEX_ESCAPE          = /\\([\da-f]{2,2})/gi,
+      LAST_CHILD          = /last/i;
+
+  IE7._byId = function(document, id) {
+    var result = document.all[id] || null;
+    // Returns a single element or a collection.
+    if (!result || (result.nodeType && IE7._getAttribute(result, "id") === id)) return result;
+    // document.all has returned a collection of elements with name/id
+    for (var i = 0; i < result.length; i++) {
+      if (IE7._getAttribute(result[i], "id") === id) return result[i];
+    }
+    return null;
+  };
+
+  // =========================================================================
+  // dom/selectors-api/CSSSelectorParser.js
+  // =========================================================================
+
+  // http://www.w3.org/TR/css3-selectors/#w3cselgrammar (kinda)
+  var CSSSelectorParser = RegGrp.extend({
+    dictionary: new Dictionary({
+      ident:           /\-?(\\.|[_a-z]|[^\x00-\xa0])(\\.|[\w-]|[^\x00-\xa0])*/,
+      combinator:      /[\s>+~]/,
+      operator:        /[\^~|$*]?=/,
+      nth_arg:         /[+-]?\d+|[+-]?\d*n(?:\s*[+-]\s*\d+)?|even|odd/,
+      tag:             /\*|<#ident>/,
+      id:              /#(<#ident>)/,
+      'class':         /\.(<#ident>)/,
+      pseudo:          /\:([\w-]+)(?:\(([^)]+)\))?/,
+      attr:            /\[(<#ident>)(?:(<#operator>)((?:\\.|[^\[\]#.:])+))?\]/,
+      negation:        /:not\((<#tag>|<#id>|<#class>|<#attr>|<#pseudo>)\)/,
+      sequence:        /(\\.|[~*]=|\+\d|\+?\d*n\s*\+\s*\d|[^\s>+~,\*])+/,
+      filter:          /[#.:\[]<#sequence>/,
+      selector:        /[^>+~](\\.|[^,])*?/,
+      grammar:         /^(<#selector>)((,<#selector>)*)$/
+    }),
+
+    ignoreCase: true
+  });
+
+  var normalizer = new CSSSelectorParser({
+    "\\\\.|[~*]\\s+=|\\+\\s+\\d": RegGrp.IGNORE,
+    "\\[\\s+": "[",
+    "\\(\\s+": "(",
+    "\\s+\\)": ")",
+    "\\s+\\]": "]",
+    "\\s*([,>+~]|<#operator>)\\s*": "$1",
+    "\\s+$": "",
+    "\\s+": " "
+  });
+
+  function normalize(selector) {
+    selector = normalizer.parse(selector.replace(HEX_ESCAPE, "\\x$1"))
+      .replace(UNESCAPE, "$1")
+      .replace(IMPLIED_ASTERISK, "$1*$2");
+    if (!VALID_SELECTOR.test(selector)) throwSelectorError();
+    return selector;
+  };
+
+  function unescape(query) {
+    // put string values back
+    return query.replace(ESCAPED, unescapeString);
+  };
+
+  function unescapeString(match, index) {
+    return strings[index];
+  };
+
+  var BRACES = /\{/g, BRACES_ESCAPED = /\\{/g;
+
+  function closeBlock(group) {
+    return Array((group.replace(BRACES_ESCAPED, "").match(BRACES) || "").length + 1).join("}");
+  };
+
+  FILTER = new CSSSelectorParser(FILTER);
+
+  var TARGET = /:target/i, ROOT = /:root/i;
+
+  function getConstants(selector) {
+    var constants = "";
+    if (ROOT.test(selector)) constants += ",R=d.documentElement";
+    if (TARGET.test(selector)) constants += ",H=d.location;H=H&&H.hash.replace('#','')";
+    if (constants || selector.indexOf("#") !== -1) {
+      constants = ",t=c.nodeType,d=t===9?c:c.ownerDocument||(c.document||c).parentWindow.document" + constants;
+    }
+    return "var ii" + constants + ";";
+  };
+
+  var COMBINATOR = {
+    " ":   ";while(e!=s&&(e=e.parentNode)&&e.nodeType===1){",
+    ">":   ".parentElement;if(e){",
+    "+":   ";while((e=e.previousSibling)&&!(" + IS_ELEMENT + "))continue;if(e){",
+    "~":   ";while((e=e.previousSibling)){" + IF_ELEMENT
+  };
+
+  var TOKEN = /\be\b/g;
+
+  MATCHER = new CSSSelectorParser({
+    "(?:(<#selector>)(<#combinator>))?(<#tag>)(<#filter>)?$": function(match, before, combinator, tag, filters) {
+      var group = "";
+      if (tag !== "*") {
+        var TAG = tag.toUpperCase();
+        group += "if(e.nodeName==='" + TAG + (TAG === tag ? "" : "'||e.nodeName==='" + tag) + "'){";
+      }
+      if (filters) {
+        group += "if(" + FILTER.parse(filters).slice(0, -2) + "){";
+      }
+      group = group.replace(TOKEN, "e" + this.index);
+      if (combinator) {
+        group += "var e=e" + (this.index++) + COMBINATOR[combinator];
+        group = group.replace(TOKEN, "e" + this.index);
+      }
+      if (before) {
+        group += this.parse(before);
+      }
+      return group;
+    }
+  });
+  
+  var BY_ID       = "e0=IE7._byId(d,'%1');if(e0){",
+      BY_TAG_NAME = "var n=c.getElementsByTagName('%1');",
+      STORE       = "if(r==null)return e0;r[k++]=e0;";
+
+  var TAG_NAME = 1;
+
+  var SELECTOR = new CSSSelectorParser({
+    "^((?:<#selector>)?(?:<#combinator>))(<#tag>)(<#filter>)?$": true
+  });
+
+  var cache = {};
+
+  var selectById = new CSSSelectorParser({
+    "^(<#tag>)#(<#ident>)(<#filter>)?( [^,]*)?$": function(match, tagName, id, filters, after) {
+      var block = format(BY_ID, id), endBlock = "}";
+      if (filters) {
+        block += MATCHER.parse(tagName + filters);
+        endBlock = closeBlock(block);
+      }
+      if (after) {
+        block += "s=c=e0;" + selectQuery.parse("*" + after);
+      } else {
+        block += STORE;
+      }
+      return block + endBlock;
+    },
+
+    "^([^#,]+)#(<#ident>)(<#filter>)?$": function(match, before, id, filters) {
+      var block = format(BY_ID, id);
+      if (before === "*") {
+        block += STORE;
+      } else {
+        block += MATCHER.parse(before + filters) + STORE + "break";
+      }
+      return block + closeBlock(block);
+    },
+
+    "^.*$": ""
+  });
+
+  var selectQuery = new CSSSelectorParser({
+    "<#grammar>": function(match, selector, remainingSelectors) {
+      if (!this.groups) this.groups = [];
+
+      var group = SELECTOR.exec(" " + selector);
+
+      if (!group) throwSelectorError();
+
+      this.groups.push(group.slice(1));
+
+      if (remainingSelectors) {
+        return this.parse(remainingSelectors.replace(COMMA, ""));
+      }
+
+      var groups = this.groups,
+          tagName = groups[0][TAG_NAME]; // first tag name
+
+      for (var i = 1; group = groups[i]; i++) { // search tag names
+        if (tagName !== group[TAG_NAME]) {
+          tagName = "*"; // mixed tag names, so use "*"
+          break;
+        }
+      }
+
+      var matcher = "", store = STORE + "continue filtering;";
+
+      for (var i = 0; group = groups[i]; i++) {
+        MATCHER.index = 0;
+        if (tagName !== "*") group[TAG_NAME] = "*"; // we are already filtering by tagName
+        group = group.join("");
+        if (group === " *") { // select all
+          matcher = store;
+          break;
+        } else {
+          group = MATCHER.parse(group);
+          if (useContext) group += "if(e" + MATCHER.index + "==s){";
+          matcher += group + store + closeBlock(group);
+        }
+      }
+
+      // reduce to a single loop
+      var isWild = tagName === "*";
+      return (isWild ? "var n=c.all;" : format(BY_TAG_NAME, tagName)) +
+        "filtering:while((e0=n[i++]))" +
+        (isWild ? IF_ELEMENT.replace(TOKEN, "e0") : "{") +
+          matcher +
+        "}";
+    },
+
+    "^.*$": throwSelectorError
+  });
+
+  var REDUNDANT_NODETYPE_CHECKS = /\&\&(e\d+)\.nodeType===1(\)\{\s*if\(\1\.nodeName=)/g;
+
+  selectQuery.create = function(selector) {
+    if (!cache[selector]) {
+      selector = normalize(selector);
+      this.groups = null;
+      MATCHER.index = 0;
+      var block = this.parse(selector);
+      this.groups = null;
+      MATCHER.index = 0;
+      if (selector.indexOf("#") !== -1) {
+        var byId  = selectById.parse(selector);
+        if (byId) {
+          block =
+            "if(t===1||t===11|!c.getElementById){" +
+              block +
+            "}else{" +
+              byId +
+            "}";
+        }
+      }
+      // remove redundant nodeType==1 checks
+      block = block.replace(REDUNDANT_NODETYPE_CHECKS, "$2");
+      block = getConstants(selector) + decode(block);
+      cache[selector] = new Function("return function(c,r,s){var i=0,k=0,e0;" + block + "return r}")();
+    }
+    return cache[selector];
+  };
+
+  return cssQuery;
+})();
+
+function throwSelectorError() {
+  throw new SyntaxError("Invalid selector.");
+};
+
+// -----------------------------------------------------------------------
+// initialisation
+// -----------------------------------------------------------------------
+
+IE7.loaded = true;
+
+(function() {
+  try {
+    // http://javascript.nwbox.com/IEContentLoaded/
+    if (!document.body) throw "continue";
+    documentElement.doScroll("left");
+  } catch (ex) {
+    setTimeout(arguments.callee, 1);
+    return;
+  }
+  // execute the inner text of the IE7 script
+  try {
+    eval(script.innerHTML);
+  } catch (ex) {
+    // ignore errors
+  }
+  if (typeof IE7_PNG_SUFFIX == "object") {
+    PNG = IE7_PNG_SUFFIX;
+  } else {
+    PNG = new RegExp(rescape(window.IE7_PNG_SUFFIX || "-trans.png") + "(\\?.*)?$", "i");
+  }
+
+  // frequently used references
+  body = document.body;
+  viewport = MSIE5 ? body : documentElement;
+
+  // classes
+  body.className += " ie7_body";
+  documentElement.className += " ie7_html";
+
+  if (MSIE5) ie7Quirks();
+
+  IE7.CSS.init();
+  IE7.HTML.init();
+
+  IE7.HTML.apply();
+  IE7.CSS.apply();
+
+  IE7.recalc();
+})();
+
+})(this, document);
Index: admin/js/jquery/jquery-ui.custom.js
===================================================================
--- admin/js/jquery/jquery-ui.custom.js	(revision 1048)
+++ admin/js/jquery/jquery-ui.custom.js	(revision 1648)
@@ -1,6 +1,6 @@
-/*! jQuery UI - v1.9.2 - 2012-11-29
+/*! jQuery UI - v1.10.3 - 2013-08-23
 * http://jqueryui.com
-* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.sortable.js, jquery.ui.accordion.js
-* Copyright (c) 2012 jQuery Foundation and other contributors Licensed MIT */
+* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.draggable.js, jquery.ui.sortable.js, jquery.ui.accordion.js
+* Copyright 2013 jQuery Foundation and other contributors Licensed MIT */
 
 (function( $, undefined ) {
@@ -9,14 +9,9 @@
 	runiqueId = /^ui-id-\d+$/;
 
-// prevent duplicate loading
-// this is only a problem because we proxy existing functions
-// and we don't want to double proxy them
+// $.ui might exist from components with no dependencies, e.g., $.ui.position
 $.ui = $.ui || {};
-if ( $.ui.version ) {
-	return;
-}
 
 $.extend( $.ui, {
-	version: "1.9.2",
+	version: "1.10.3",
 
 	keyCode: {
@@ -48,32 +43,33 @@
 // plugins
 $.fn.extend({
-	_focus: $.fn.focus,
-	focus: function( delay, fn ) {
-		return typeof delay === "number" ?
-			this.each(function() {
-				var elem = this;
-				setTimeout(function() {
-					$( elem ).focus();
-					if ( fn ) {
-						fn.call( elem );
-					}
-				}, delay );
-			}) :
-			this._focus.apply( this, arguments );
-	},
+	focus: (function( orig ) {
+		return function( delay, fn ) {
+			return typeof delay === "number" ?
+				this.each(function() {
+					var elem = this;
+					setTimeout(function() {
+						$( elem ).focus();
+						if ( fn ) {
+							fn.call( elem );
+						}
+					}, delay );
+				}) :
+				orig.apply( this, arguments );
+		};
+	})( $.fn.focus ),
 
 	scrollParent: function() {
 		var scrollParent;
-		if (($.ui.ie && (/(static|relative)/).test(this.css('position'))) || (/absolute/).test(this.css('position'))) {
+		if (($.ui.ie && (/(static|relative)/).test(this.css("position"))) || (/absolute/).test(this.css("position"))) {
 			scrollParent = this.parents().filter(function() {
-				return (/(relative|absolute|fixed)/).test($.css(this,'position')) && (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));
+				return (/(relative|absolute|fixed)/).test($.css(this,"position")) && (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));
 			}).eq(0);
 		} else {
 			scrollParent = this.parents().filter(function() {
-				return (/(auto|scroll)/).test($.css(this,'overflow')+$.css(this,'overflow-y')+$.css(this,'overflow-x'));
+				return (/(auto|scroll)/).test($.css(this,"overflow")+$.css(this,"overflow-y")+$.css(this,"overflow-x"));
 			}).eq(0);
 		}
 
-		return (/fixed/).test(this.css('position')) || !scrollParent.length ? $(document) : scrollParent;
+		return (/fixed/).test(this.css("position")) || !scrollParent.length ? $(document) : scrollParent;
 	},
 
@@ -148,5 +144,5 @@
 function visible( element ) {
 	return $.expr.filters.visible( element ) &&
-		!$( element ).parents().andSelf().filter(function() {
+		!$( element ).parents().addBack().filter(function() {
 			return $.css( this, "visibility" ) === "hidden";
 		}).length;
@@ -176,29 +172,4 @@
 });
 
-// support
-$(function() {
-	var body = document.body,
-		div = body.appendChild( div = document.createElement( "div" ) );
-
-	// access offsetHeight before setting the style to prevent a layout bug
-	// in IE 9 which causes the element to continue to take up space even
-	// after it is removed from the DOM (#8026)
-	div.offsetHeight;
-
-	$.extend( div.style, {
-		minHeight: "100px",
-		height: "auto",
-		padding: 0,
-		borderWidth: 0
-	});
-
-	$.support.minHeight = div.offsetHeight === 100;
-	$.support.selectstart = "onselectstart" in div;
-
-	// set display to none to avoid a layout bug in IE
-	// http://dev.jquery.com/ticket/4014
-	body.removeChild( div ).style.display = "none";
-});
-
 // support: jQuery <1.8
 if ( !$( "<a>" ).outerWidth( 1 ).jquery ) {
@@ -248,4 +219,13 @@
 }
 
+// support: jQuery <1.8
+if ( !$.fn.addBack ) {
+	$.fn.addBack = function( selector ) {
+		return this.add( selector == null ?
+			this.prevObject : this.prevObject.filter( selector )
+		);
+	};
+}
+
 // support: jQuery 1.6.1, 1.6.2 (http://bugs.jquery.com/ticket/9413)
 if ( $( "<a>" ).data( "a-b", "a" ).removeData( "a-b" ).data( "a-b" ) ) {
@@ -266,11 +246,7 @@
 
 // deprecated
-
-(function() {
-	var uaMatch = /msie ([\w.]+)/.exec( navigator.userAgent.toLowerCase() ) || [];
-	$.ui.ie = uaMatch.length ? true : false;
-	$.ui.ie6 = parseFloat( uaMatch[ 1 ], 10 ) === 6;
-})();
-
+$.ui.ie = !!/msie [\w.]+/.exec( navigator.userAgent.toLowerCase() );
+
+$.support.selectstart = "onselectstart" in document.createElement( "div" );
 $.fn.extend({
 	disableSelection: function() {
@@ -287,5 +263,5 @@
 
 $.extend( $.ui, {
-	// $.ui.plugin is deprecated.  Use the proxy pattern instead.
+	// $.ui.plugin is deprecated. Use $.widget() extensions instead.
 	plugin: {
 		add: function( module, option, set ) {
@@ -312,6 +288,4 @@
 	},
 
-	contains: $.contains,
-
 	// only used by resizable
 	hasScroll: function( el, a ) {
@@ -336,14 +310,4 @@
 		el[ scroll ] = 0;
 		return has;
-	},
-
-	// these are odd functions, fix the API or move into individual plugins
-	isOverAxis: function( x, reference, size ) {
-		//Determines when x coordinate is over "b" element axis
-		return ( x > reference ) && ( x < ( reference + size ) );
-	},
-	isOver: function( y, x, top, left, height, width ) {
-		//Determines when x, y coordinates is over "b" element
-		return $.ui.isOverAxis( y, top, height ) && $.ui.isOverAxis( x, left, width );
 	}
 });
@@ -367,4 +331,7 @@
 $.widget = function( name, base, prototype ) {
 	var fullName, existingConstructor, constructor, basePrototype,
+		// proxiedPrototype allows the provided prototype to remain unmodified
+		// so that it can be used as a mixin for multiple widgets (#8876)
+		proxiedPrototype = {},
 		namespace = name.split( "." )[ 0 ];
 
@@ -413,29 +380,31 @@
 	basePrototype.options = $.widget.extend( {}, basePrototype.options );
 	$.each( prototype, function( prop, value ) {
-		if ( $.isFunction( value ) ) {
-			prototype[ prop ] = (function() {
-				var _super = function() {
-						return base.prototype[ prop ].apply( this, arguments );
-					},
-					_superApply = function( args ) {
-						return base.prototype[ prop ].apply( this, args );
-					};
-				return function() {
-					var __super = this._super,
-						__superApply = this._superApply,
-						returnValue;
-
-					this._super = _super;
-					this._superApply = _superApply;
-
-					returnValue = value.apply( this, arguments );
-
-					this._super = __super;
-					this._superApply = __superApply;
-
-					return returnValue;
+		if ( !$.isFunction( value ) ) {
+			proxiedPrototype[ prop ] = value;
+			return;
+		}
+		proxiedPrototype[ prop ] = (function() {
+			var _super = function() {
+					return base.prototype[ prop ].apply( this, arguments );
+				},
+				_superApply = function( args ) {
+					return base.prototype[ prop ].apply( this, args );
 				};
-			})();
-		}
+			return function() {
+				var __super = this._super,
+					__superApply = this._superApply,
+					returnValue;
+
+				this._super = _super;
+				this._superApply = _superApply;
+
+				returnValue = value.apply( this, arguments );
+
+				this._super = __super;
+				this._superApply = __superApply;
+
+				return returnValue;
+			};
+		})();
 	});
 	constructor.prototype = $.widget.extend( basePrototype, {
@@ -444,10 +413,8 @@
 		// don't prefix for widgets that aren't DOM-based
 		widgetEventPrefix: existingConstructor ? basePrototype.widgetEventPrefix : name
-	}, prototype, {
+	}, proxiedPrototype, {
 		constructor: constructor,
 		namespace: namespace,
 		widgetName: name,
-		// TODO remove widgetBaseClass, see #8155
-		widgetBaseClass: fullName,
 		widgetFullName: fullName
 	});
@@ -575,7 +542,4 @@
 
 		if ( element !== this ) {
-			// 1.9 BC for #7810
-			// TODO remove dual storage
-			$.data( element, this.widgetName, this );
 			$.data( element, this.widgetFullName, this );
 			this._on( true, this.element, {
@@ -844,5 +808,5 @@
 			element.delay( options.delay );
 		}
-		if ( hasOptions && $.effects && ( $.effects.effect[ effectName ] || $.uiBackCompat !== false && $.effects[ effectName ] ) ) {
+		if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
 			element[ method ]( options );
 		} else if ( effectName !== method && element[ effectName ] ) {
@@ -860,23 +824,16 @@
 });
 
-// DEPRECATED
-if ( $.uiBackCompat !== false ) {
-	$.Widget.prototype._getCreateOptions = function() {
-		return $.metadata && $.metadata.get( this.element[0] )[ this.widgetName ];
-	};
-}
-
 })( jQuery );
 (function( $, undefined ) {
 
 var mouseHandled = false;
-$( document ).mouseup( function( e ) {
+$( document ).mouseup( function() {
 	mouseHandled = false;
 });
 
 $.widget("ui.mouse", {
-	version: "1.9.2",
+	version: "1.10.3",
 	options: {
-		cancel: 'input,textarea,button,select,option',
+		cancel: "input,textarea,button,select,option",
 		distance: 1,
 		delay: 0
@@ -886,10 +843,10 @@
 
 		this.element
-			.bind('mousedown.'+this.widgetName, function(event) {
+			.bind("mousedown."+this.widgetName, function(event) {
 				return that._mouseDown(event);
 			})
-			.bind('click.'+this.widgetName, function(event) {
-				if (true === $.data(event.target, that.widgetName + '.preventClickEvent')) {
-					$.removeData(event.target, that.widgetName + '.preventClickEvent');
+			.bind("click."+this.widgetName, function(event) {
+				if (true === $.data(event.target, that.widgetName + ".preventClickEvent")) {
+					$.removeData(event.target, that.widgetName + ".preventClickEvent");
 					event.stopImmediatePropagation();
 					return false;
@@ -903,9 +860,9 @@
 	// other instances of mouse
 	_mouseDestroy: function() {
-		this.element.unbind('.'+this.widgetName);
+		this.element.unbind("."+this.widgetName);
 		if ( this._mouseMoveDelegate ) {
 			$(document)
-				.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
-				.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+				.unbind("mousemove."+this.widgetName, this._mouseMoveDelegate)
+				.unbind("mouseup."+this.widgetName, this._mouseUpDelegate);
 		}
 	},
@@ -945,6 +902,6 @@
 
 		// Click event may never have fired (Gecko & Opera)
-		if (true === $.data(event.target, this.widgetName + '.preventClickEvent')) {
-			$.removeData(event.target, this.widgetName + '.preventClickEvent');
+		if (true === $.data(event.target, this.widgetName + ".preventClickEvent")) {
+			$.removeData(event.target, this.widgetName + ".preventClickEvent");
 		}
 
@@ -957,6 +914,6 @@
 		};
 		$(document)
-			.bind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
-			.bind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+			.bind("mousemove."+this.widgetName, this._mouseMoveDelegate)
+			.bind("mouseup."+this.widgetName, this._mouseUpDelegate);
 
 		event.preventDefault();
@@ -968,5 +925,5 @@
 	_mouseMove: function(event) {
 		// IE mouseup check - mouseup happened when mouse was out of window
-		if ($.ui.ie && !(document.documentMode >= 9) && !event.button) {
+		if ($.ui.ie && ( !document.documentMode || document.documentMode < 9 ) && !event.button) {
 			return this._mouseUp(event);
 		}
@@ -988,6 +945,6 @@
 	_mouseUp: function(event) {
 		$(document)
-			.unbind('mousemove.'+this.widgetName, this._mouseMoveDelegate)
-			.unbind('mouseup.'+this.widgetName, this._mouseUpDelegate);
+			.unbind("mousemove."+this.widgetName, this._mouseMoveDelegate)
+			.unbind("mouseup."+this.widgetName, this._mouseUpDelegate);
 
 		if (this._mouseStarted) {
@@ -995,5 +952,5 @@
 
 			if (event.target === this._mouseDownEvent.target) {
-				$.data(event.target, this.widgetName + '.preventClickEvent', true);
+				$.data(event.target, this.widgetName + ".preventClickEvent", true);
 			}
 
@@ -1012,13 +969,13 @@
 	},
 
-	_mouseDelayMet: function(event) {
+	_mouseDelayMet: function(/* event */) {
 		return this.mouseDelayMet;
 	},
 
 	// These are placeholder methods, to be overriden by extending plugin
-	_mouseStart: function(event) {},
-	_mouseDrag: function(event) {},
-	_mouseStop: function(event) {},
-	_mouseCapture: function(event) { return true; }
+	_mouseStart: function(/* event */) {},
+	_mouseDrag: function(/* event */) {},
+	_mouseStop: function(/* event */) {},
+	_mouseCapture: function(/* event */) { return true; }
 });
 
@@ -1026,6 +983,959 @@
 (function( $, undefined ) {
 
+$.widget("ui.draggable", $.ui.mouse, {
+	version: "1.10.3",
+	widgetEventPrefix: "drag",
+	options: {
+		addClasses: true,
+		appendTo: "parent",
+		axis: false,
+		connectToSortable: false,
+		containment: false,
+		cursor: "auto",
+		cursorAt: false,
+		grid: false,
+		handle: false,
+		helper: "original",
+		iframeFix: false,
+		opacity: false,
+		refreshPositions: false,
+		revert: false,
+		revertDuration: 500,
+		scope: "default",
+		scroll: true,
+		scrollSensitivity: 20,
+		scrollSpeed: 20,
+		snap: false,
+		snapMode: "both",
+		snapTolerance: 20,
+		stack: false,
+		zIndex: false,
+
+		// callbacks
+		drag: null,
+		start: null,
+		stop: null
+	},
+	_create: function() {
+
+		if (this.options.helper === "original" && !(/^(?:r|a|f)/).test(this.element.css("position"))) {
+			this.element[0].style.position = "relative";
+		}
+		if (this.options.addClasses){
+			this.element.addClass("ui-draggable");
+		}
+		if (this.options.disabled){
+			this.element.addClass("ui-draggable-disabled");
+		}
+
+		this._mouseInit();
+
+	},
+
+	_destroy: function() {
+		this.element.removeClass( "ui-draggable ui-draggable-dragging ui-draggable-disabled" );
+		this._mouseDestroy();
+	},
+
+	_mouseCapture: function(event) {
+
+		var o = this.options;
+
+		// among others, prevent a drag on a resizable-handle
+		if (this.helper || o.disabled || $(event.target).closest(".ui-resizable-handle").length > 0) {
+			return false;
+		}
+
+		//Quit if we're not on a valid handle
+		this.handle = this._getHandle(event);
+		if (!this.handle) {
+			return false;
+		}
+
+		$(o.iframeFix === true ? "iframe" : o.iframeFix).each(function() {
+			$("<div class='ui-draggable-iframeFix' style='background: #fff;'></div>")
+			.css({
+				width: this.offsetWidth+"px", height: this.offsetHeight+"px",
+				position: "absolute", opacity: "0.001", zIndex: 1000
+			})
+			.css($(this).offset())
+			.appendTo("body");
+		});
+
+		return true;
+
+	},
+
+	_mouseStart: function(event) {
+
+		var o = this.options;
+
+		//Create and append the visible helper
+		this.helper = this._createHelper(event);
+
+		this.helper.addClass("ui-draggable-dragging");
+
+		//Cache the helper size
+		this._cacheHelperProportions();
+
+		//If ddmanager is used for droppables, set the global draggable
+		if($.ui.ddmanager) {
+			$.ui.ddmanager.current = this;
+		}
+
+		/*
+		 * - Position generation -
+		 * This block generates everything position related - it's the core of draggables.
+		 */
+
+		//Cache the margins of the original element
+		this._cacheMargins();
+
+		//Store the helper's css position
+		this.cssPosition = this.helper.css( "position" );
+		this.scrollParent = this.helper.scrollParent();
+		this.offsetParent = this.helper.offsetParent();
+		this.offsetParentCssPosition = this.offsetParent.css( "position" );
+
+		//The element's absolute position on the page minus margins
+		this.offset = this.positionAbs = this.element.offset();
+		this.offset = {
+			top: this.offset.top - this.margins.top,
+			left: this.offset.left - this.margins.left
+		};
+
+		//Reset scroll cache
+		this.offset.scroll = false;
+
+		$.extend(this.offset, {
+			click: { //Where the click happened, relative to the element
+				left: event.pageX - this.offset.left,
+				top: event.pageY - this.offset.top
+			},
+			parent: this._getParentOffset(),
+			relative: this._getRelativeOffset() //This is a relative to absolute position minus the actual position calculation - only used for relative positioned helper
+		});
+
+		//Generate the original position
+		this.originalPosition = this.position = this._generatePosition(event);
+		this.originalPageX = event.pageX;
+		this.originalPageY = event.pageY;
+
+		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
+		(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
+
+		//Set a containment if given in the options
+		this._setContainment();
+
+		//Trigger event + callbacks
+		if(this._trigger("start", event) === false) {
+			this._clear();
+			return false;
+		}
+
+		//Recache the helper size
+		this._cacheHelperProportions();
+
+		//Prepare the droppable offsets
+		if ($.ui.ddmanager && !o.dropBehaviour) {
+			$.ui.ddmanager.prepareOffsets(this, event);
+		}
+
+
+		this._mouseDrag(event, true); //Execute the drag once - this causes the helper not to be visible before getting its correct position
+
+		//If the ddmanager is used for droppables, inform the manager that dragging has started (see #5003)
+		if ( $.ui.ddmanager ) {
+			$.ui.ddmanager.dragStart(this, event);
+		}
+
+		return true;
+	},
+
+	_mouseDrag: function(event, noPropagation) {
+		// reset any necessary cached properties (see #5009)
+		if ( this.offsetParentCssPosition === "fixed" ) {
+			this.offset.parent = this._getParentOffset();
+		}
+
+		//Compute the helpers position
+		this.position = this._generatePosition(event);
+		this.positionAbs = this._convertPositionTo("absolute");
+
+		//Call plugins and callbacks and use the resulting position if something is returned
+		if (!noPropagation) {
+			var ui = this._uiHash();
+			if(this._trigger("drag", event, ui) === false) {
+				this._mouseUp({});
+				return false;
+			}
+			this.position = ui.position;
+		}
+
+		if(!this.options.axis || this.options.axis !== "y") {
+			this.helper[0].style.left = this.position.left+"px";
+		}
+		if(!this.options.axis || this.options.axis !== "x") {
+			this.helper[0].style.top = this.position.top+"px";
+		}
+		if($.ui.ddmanager) {
+			$.ui.ddmanager.drag(this, event);
+		}
+
+		return false;
+	},
+
+	_mouseStop: function(event) {
+
+		//If we are using droppables, inform the manager about the drop
+		var that = this,
+			dropped = false;
+		if ($.ui.ddmanager && !this.options.dropBehaviour) {
+			dropped = $.ui.ddmanager.drop(this, event);
+		}
+
+		//if a drop comes from outside (a sortable)
+		if(this.dropped) {
+			dropped = this.dropped;
+			this.dropped = false;
+		}
+
+		//if the original element is no longer in the DOM don't bother to continue (see #8269)
+		if ( this.options.helper === "original" && !$.contains( this.element[ 0 ].ownerDocument, this.element[ 0 ] ) ) {
+			return false;
+		}
+
+		if((this.options.revert === "invalid" && !dropped) || (this.options.revert === "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
+			$(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
+				if(that._trigger("stop", event) !== false) {
+					that._clear();
+				}
+			});
+		} else {
+			if(this._trigger("stop", event) !== false) {
+				this._clear();
+			}
+		}
+
+		return false;
+	},
+
+	_mouseUp: function(event) {
+		//Remove frame helpers
+		$("div.ui-draggable-iframeFix").each(function() {
+			this.parentNode.removeChild(this);
+		});
+
+		//If the ddmanager is used for droppables, inform the manager that dragging has stopped (see #5003)
+		if( $.ui.ddmanager ) {
+			$.ui.ddmanager.dragStop(this, event);
+		}
+
+		return $.ui.mouse.prototype._mouseUp.call(this, event);
+	},
+
+	cancel: function() {
+
+		if(this.helper.is(".ui-draggable-dragging")) {
+			this._mouseUp({});
+		} else {
+			this._clear();
+		}
+
+		return this;
+
+	},
+
+	_getHandle: function(event) {
+		return this.options.handle ?
+			!!$( event.target ).closest( this.element.find( this.options.handle ) ).length :
+			true;
+	},
+
+	_createHelper: function(event) {
+
+		var o = this.options,
+			helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event])) : (o.helper === "clone" ? this.element.clone().removeAttr("id") : this.element);
+
+		if(!helper.parents("body").length) {
+			helper.appendTo((o.appendTo === "parent" ? this.element[0].parentNode : o.appendTo));
+		}
+
+		if(helper[0] !== this.element[0] && !(/(fixed|absolute)/).test(helper.css("position"))) {
+			helper.css("position", "absolute");
+		}
+
+		return helper;
+
+	},
+
+	_adjustOffsetFromHelper: function(obj) {
+		if (typeof obj === "string") {
+			obj = obj.split(" ");
+		}
+		if ($.isArray(obj)) {
+			obj = {left: +obj[0], top: +obj[1] || 0};
+		}
+		if ("left" in obj) {
+			this.offset.click.left = obj.left + this.margins.left;
+		}
+		if ("right" in obj) {
+			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
+		}
+		if ("top" in obj) {
+			this.offset.click.top = obj.top + this.margins.top;
+		}
+		if ("bottom" in obj) {
+			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
+		}
+	},
+
+	_getParentOffset: function() {
+
+		//Get the offsetParent and cache its position
+		var po = this.offsetParent.offset();
+
+		// This is a special case where we need to modify a offset calculated on start, since the following happened:
+		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
+		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
+		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
+		if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
+			po.left += this.scrollParent.scrollLeft();
+			po.top += this.scrollParent.scrollTop();
+		}
+
+		//This needs to be actually done for all browsers, since pageX/pageY includes this information
+		//Ugly IE fix
+		if((this.offsetParent[0] === document.body) ||
+			(this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
+			po = { top: 0, left: 0 };
+		}
+
+		return {
+			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
+			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
+		};
+
+	},
+
+	_getRelativeOffset: function() {
+
+		if(this.cssPosition === "relative") {
+			var p = this.element.position();
+			return {
+				top: p.top - (parseInt(this.helper.css("top"),10) || 0) + this.scrollParent.scrollTop(),
+				left: p.left - (parseInt(this.helper.css("left"),10) || 0) + this.scrollParent.scrollLeft()
+			};
+		} else {
+			return { top: 0, left: 0 };
+		}
+
+	},
+
+	_cacheMargins: function() {
+		this.margins = {
+			left: (parseInt(this.element.css("marginLeft"),10) || 0),
+			top: (parseInt(this.element.css("marginTop"),10) || 0),
+			right: (parseInt(this.element.css("marginRight"),10) || 0),
+			bottom: (parseInt(this.element.css("marginBottom"),10) || 0)
+		};
+	},
+
+	_cacheHelperProportions: function() {
+		this.helperProportions = {
+			width: this.helper.outerWidth(),
+			height: this.helper.outerHeight()
+		};
+	},
+
+	_setContainment: function() {
+
+		var over, c, ce,
+			o = this.options;
+
+		if ( !o.containment ) {
+			this.containment = null;
+			return;
+		}
+
+		if ( o.containment === "window" ) {
+			this.containment = [
+				$( window ).scrollLeft() - this.offset.relative.left - this.offset.parent.left,
+				$( window ).scrollTop() - this.offset.relative.top - this.offset.parent.top,
+				$( window ).scrollLeft() + $( window ).width() - this.helperProportions.width - this.margins.left,
+				$( window ).scrollTop() + ( $( window ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
+			];
+			return;
+		}
+
+		if ( o.containment === "document") {
+			this.containment = [
+				0,
+				0,
+				$( document ).width() - this.helperProportions.width - this.margins.left,
+				( $( document ).height() || document.body.parentNode.scrollHeight ) - this.helperProportions.height - this.margins.top
+			];
+			return;
+		}
+
+		if ( o.containment.constructor === Array ) {
+			this.containment = o.containment;
+			return;
+		}
+
+		if ( o.containment === "parent" ) {
+			o.containment = this.helper[ 0 ].parentNode;
+		}
+
+		c = $( o.containment );
+		ce = c[ 0 ];
+
+		if( !ce ) {
+			return;
+		}
+
+		over = c.css( "overflow" ) !== "hidden";
+
+		this.containment = [
+			( parseInt( c.css( "borderLeftWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingLeft" ), 10 ) || 0 ),
+			( parseInt( c.css( "borderTopWidth" ), 10 ) || 0 ) + ( parseInt( c.css( "paddingTop" ), 10 ) || 0 ) ,
+			( over ? Math.max( ce.scrollWidth, ce.offsetWidth ) : ce.offsetWidth ) - ( parseInt( c.css( "borderRightWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingRight" ), 10 ) || 0 ) - this.helperProportions.width - this.margins.left - this.margins.right,
+			( over ? Math.max( ce.scrollHeight, ce.offsetHeight ) : ce.offsetHeight ) - ( parseInt( c.css( "borderBottomWidth" ), 10 ) || 0 ) - ( parseInt( c.css( "paddingBottom" ), 10 ) || 0 ) - this.helperProportions.height - this.margins.top  - this.margins.bottom
+		];
+		this.relative_container = c;
+	},
+
+	_convertPositionTo: function(d, pos) {
+
+		if(!pos) {
+			pos = this.position;
+		}
+
+		var mod = d === "absolute" ? 1 : -1,
+			scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent;
+
+		//Cache the scroll
+		if (!this.offset.scroll) {
+			this.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()};
+		}
+
+		return {
+			top: (
+				pos.top	+																// The absolute mouse position
+				this.offset.relative.top * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
+				this.offset.parent.top * mod -										// The offsetParent's offset without borders (offset + border)
+				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top ) * mod )
+			),
+			left: (
+				pos.left +																// The absolute mouse position
+				this.offset.relative.left * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
+				this.offset.parent.left * mod	-										// The offsetParent's offset without borders (offset + border)
+				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : this.offset.scroll.left ) * mod )
+			)
+		};
+
+	},
+
+	_generatePosition: function(event) {
+
+		var containment, co, top, left,
+			o = this.options,
+			scroll = this.cssPosition === "absolute" && !( this.scrollParent[ 0 ] !== document && $.contains( this.scrollParent[ 0 ], this.offsetParent[ 0 ] ) ) ? this.offsetParent : this.scrollParent,
+			pageX = event.pageX,
+			pageY = event.pageY;
+
+		//Cache the scroll
+		if (!this.offset.scroll) {
+			this.offset.scroll = {top : scroll.scrollTop(), left : scroll.scrollLeft()};
+		}
+
+		/*
+		 * - Position constraining -
+		 * Constrain the position to a mix of grid, containment.
+		 */
+
+		// If we are not dragging yet, we won't check for options
+		if ( this.originalPosition ) {
+			if ( this.containment ) {
+				if ( this.relative_container ){
+					co = this.relative_container.offset();
+					containment = [
+						this.containment[ 0 ] + co.left,
+						this.containment[ 1 ] + co.top,
+						this.containment[ 2 ] + co.left,
+						this.containment[ 3 ] + co.top
+					];
+				}
+				else {
+					containment = this.containment;
+				}
+
+				if(event.pageX - this.offset.click.left < containment[0]) {
+					pageX = containment[0] + this.offset.click.left;
+				}
+				if(event.pageY - this.offset.click.top < containment[1]) {
+					pageY = containment[1] + this.offset.click.top;
+				}
+				if(event.pageX - this.offset.click.left > containment[2]) {
+					pageX = containment[2] + this.offset.click.left;
+				}
+				if(event.pageY - this.offset.click.top > containment[3]) {
+					pageY = containment[3] + this.offset.click.top;
+				}
+			}
+
+			if(o.grid) {
+				//Check for grid elements set to 0 to prevent divide by 0 error causing invalid argument errors in IE (see ticket #6950)
+				top = o.grid[1] ? this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1] : this.originalPageY;
+				pageY = containment ? ((top - this.offset.click.top >= containment[1] || top - this.offset.click.top > containment[3]) ? top : ((top - this.offset.click.top >= containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+				left = o.grid[0] ? this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0] : this.originalPageX;
+				pageX = containment ? ((left - this.offset.click.left >= containment[0] || left - this.offset.click.left > containment[2]) ? left : ((left - this.offset.click.left >= containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+			}
+
+		}
+
+		return {
+			top: (
+				pageY -																	// The absolute mouse position
+				this.offset.click.top	-												// Click offset (relative to the element)
+				this.offset.relative.top -												// Only for relative positioned nodes: Relative offset from element to offset parent
+				this.offset.parent.top +												// The offsetParent's offset without borders (offset + border)
+				( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : this.offset.scroll.top )
+			),
+			left: (
+				pageX -																	// The absolute mouse position
+				this.offset.click.left -												// Click offset (relative to the element)
+				this.offset.relative.left -												// Only for relative positioned nodes: Relative offset from element to offset parent
+				this.offset.parent.left +												// The offsetParent's offset without borders (offset + border)
+				( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : this.offset.scroll.left )
+			)
+		};
+
+	},
+
+	_clear: function() {
+		this.helper.removeClass("ui-draggable-dragging");
+		if(this.helper[0] !== this.element[0] && !this.cancelHelperRemoval) {
+			this.helper.remove();
+		}
+		this.helper = null;
+		this.cancelHelperRemoval = false;
+	},
+
+	// From now on bulk stuff - mainly helpers
+
+	_trigger: function(type, event, ui) {
+		ui = ui || this._uiHash();
+		$.ui.plugin.call(this, type, [event, ui]);
+		//The absolute position has to be recalculated after plugins
+		if(type === "drag") {
+			this.positionAbs = this._convertPositionTo("absolute");
+		}
+		return $.Widget.prototype._trigger.call(this, type, event, ui);
+	},
+
+	plugins: {},
+
+	_uiHash: function() {
+		return {
+			helper: this.helper,
+			position: this.position,
+			originalPosition: this.originalPosition,
+			offset: this.positionAbs
+		};
+	}
+
+});
+
+$.ui.plugin.add("draggable", "connectToSortable", {
+	start: function(event, ui) {
+
+		var inst = $(this).data("ui-draggable"), o = inst.options,
+			uiSortable = $.extend({}, ui, { item: inst.element });
+		inst.sortables = [];
+		$(o.connectToSortable).each(function() {
+			var sortable = $.data(this, "ui-sortable");
+			if (sortable && !sortable.options.disabled) {
+				inst.sortables.push({
+					instance: sortable,
+					shouldRevert: sortable.options.revert
+				});
+				sortable.refreshPositions();	// Call the sortable's refreshPositions at drag start to refresh the containerCache since the sortable container cache is used in drag and needs to be up to date (this will ensure it's initialised as well as being kept in step with any changes that might have happened on the page).
+				sortable._trigger("activate", event, uiSortable);
+			}
+		});
+
+	},
+	stop: function(event, ui) {
+
+		//If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
+		var inst = $(this).data("ui-draggable"),
+			uiSortable = $.extend({}, ui, { item: inst.element });
+
+		$.each(inst.sortables, function() {
+			if(this.instance.isOver) {
+
+				this.instance.isOver = 0;
+
+				inst.cancelHelperRemoval = true; //Don't remove the helper in the draggable instance
+				this.instance.cancelHelperRemoval = false; //Remove it in the sortable instance (so sortable plugins like revert still work)
+
+				//The sortable revert is supported, and we have to set a temporary dropped variable on the draggable to support revert: "valid/invalid"
+				if(this.shouldRevert) {
+					this.instance.options.revert = this.shouldRevert;
+				}
+
+				//Trigger the stop of the sortable
+				this.instance._mouseStop(event);
+
+				this.instance.options.helper = this.instance.options._helper;
+
+				//If the helper has been the original item, restore properties in the sortable
+				if(inst.options.helper === "original") {
+					this.instance.currentItem.css({ top: "auto", left: "auto" });
+				}
+
+			} else {
+				this.instance.cancelHelperRemoval = false; //Remove the helper in the sortable instance
+				this.instance._trigger("deactivate", event, uiSortable);
+			}
+
+		});
+
+	},
+	drag: function(event, ui) {
+
+		var inst = $(this).data("ui-draggable"), that = this;
+
+		$.each(inst.sortables, function() {
+
+			var innermostIntersecting = false,
+				thisSortable = this;
+
+			//Copy over some variables to allow calling the sortable's native _intersectsWith
+			this.instance.positionAbs = inst.positionAbs;
+			this.instance.helperProportions = inst.helperProportions;
+			this.instance.offset.click = inst.offset.click;
+
+			if(this.instance._intersectsWith(this.instance.containerCache)) {
+				innermostIntersecting = true;
+				$.each(inst.sortables, function () {
+					this.instance.positionAbs = inst.positionAbs;
+					this.instance.helperProportions = inst.helperProportions;
+					this.instance.offset.click = inst.offset.click;
+					if (this !== thisSortable &&
+						this.instance._intersectsWith(this.instance.containerCache) &&
+						$.contains(thisSortable.instance.element[0], this.instance.element[0])
+					) {
+						innermostIntersecting = false;
+					}
+					return innermostIntersecting;
+				});
+			}
+
+
+			if(innermostIntersecting) {
+				//If it intersects, we use a little isOver variable and set it once, so our move-in stuff gets fired only once
+				if(!this.instance.isOver) {
+
+					this.instance.isOver = 1;
+					//Now we fake the start of dragging for the sortable instance,
+					//by cloning the list group item, appending it to the sortable and using it as inst.currentItem
+					//We can then fire the start event of the sortable with our passed browser event, and our own helper (so it doesn't create a new one)
+					this.instance.currentItem = $(that).clone().removeAttr("id").appendTo(this.instance.element).data("ui-sortable-item", true);
+					this.instance.options._helper = this.instance.options.helper; //Store helper option to later restore it
+					this.instance.options.helper = function() { return ui.helper[0]; };
+
+					event.target = this.instance.currentItem[0];
+					this.instance._mouseCapture(event, true);
+					this.instance._mouseStart(event, true, true);
+
+					//Because the browser event is way off the new appended portlet, we modify a couple of variables to reflect the changes
+					this.instance.offset.click.top = inst.offset.click.top;
+					this.instance.offset.click.left = inst.offset.click.left;
+					this.instance.offset.parent.left -= inst.offset.parent.left - this.instance.offset.parent.left;
+					this.instance.offset.parent.top -= inst.offset.parent.top - this.instance.offset.parent.top;
+
+					inst._trigger("toSortable", event);
+					inst.dropped = this.instance.element; //draggable revert needs that
+					//hack so receive/update callbacks work (mostly)
+					inst.currentItem = inst.element;
+					this.instance.fromOutside = inst;
+
+				}
+
+				//Provided we did all the previous steps, we can fire the drag event of the sortable on every draggable drag, when it intersects with the sortable
+				if(this.instance.currentItem) {
+					this.instance._mouseDrag(event);
+				}
+
+			} else {
+
+				//If it doesn't intersect with the sortable, and it intersected before,
+				//we fake the drag stop of the sortable, but make sure it doesn't remove the helper by using cancelHelperRemoval
+				if(this.instance.isOver) {
+
+					this.instance.isOver = 0;
+					this.instance.cancelHelperRemoval = true;
+
+					//Prevent reverting on this forced stop
+					this.instance.options.revert = false;
+
+					// The out event needs to be triggered independently
+					this.instance._trigger("out", event, this.instance._uiHash(this.instance));
+
+					this.instance._mouseStop(event, true);
+					this.instance.options.helper = this.instance.options._helper;
+
+					//Now we remove our currentItem, the list group clone again, and the placeholder, and animate the helper back to it's original size
+					this.instance.currentItem.remove();
+					if(this.instance.placeholder) {
+						this.instance.placeholder.remove();
+					}
+
+					inst._trigger("fromSortable", event);
+					inst.dropped = false; //draggable revert needs that
+				}
+
+			}
+
+		});
+
+	}
+});
+
+$.ui.plugin.add("draggable", "cursor", {
+	start: function() {
+		var t = $("body"), o = $(this).data("ui-draggable").options;
+		if (t.css("cursor")) {
+			o._cursor = t.css("cursor");
+		}
+		t.css("cursor", o.cursor);
+	},
+	stop: function() {
+		var o = $(this).data("ui-draggable").options;
+		if (o._cursor) {
+			$("body").css("cursor", o._cursor);
+		}
+	}
+});
+
+$.ui.plugin.add("draggable", "opacity", {
+	start: function(event, ui) {
+		var t = $(ui.helper), o = $(this).data("ui-draggable").options;
+		if(t.css("opacity")) {
+			o._opacity = t.css("opacity");
+		}
+		t.css("opacity", o.opacity);
+	},
+	stop: function(event, ui) {
+		var o = $(this).data("ui-draggable").options;
+		if(o._opacity) {
+			$(ui.helper).css("opacity", o._opacity);
+		}
+	}
+});
+
+$.ui.plugin.add("draggable", "scroll", {
+	start: function() {
+		var i = $(this).data("ui-draggable");
+		if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {
+			i.overflowOffset = i.scrollParent.offset();
+		}
+	},
+	drag: function( event ) {
+
+		var i = $(this).data("ui-draggable"), o = i.options, scrolled = false;
+
+		if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {
+
+			if(!o.axis || o.axis !== "x") {
+				if((i.overflowOffset.top + i.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
+					i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop + o.scrollSpeed;
+				} else if(event.pageY - i.overflowOffset.top < o.scrollSensitivity) {
+					i.scrollParent[0].scrollTop = scrolled = i.scrollParent[0].scrollTop - o.scrollSpeed;
+				}
+			}
+
+			if(!o.axis || o.axis !== "y") {
+				if((i.overflowOffset.left + i.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
+					i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft + o.scrollSpeed;
+				} else if(event.pageX - i.overflowOffset.left < o.scrollSensitivity) {
+					i.scrollParent[0].scrollLeft = scrolled = i.scrollParent[0].scrollLeft - o.scrollSpeed;
+				}
+			}
+
+		} else {
+
+			if(!o.axis || o.axis !== "x") {
+				if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
+					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
+				} else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
+					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+				}
+			}
+
+			if(!o.axis || o.axis !== "y") {
+				if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
+					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
+				} else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
+					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+				}
+			}
+
+		}
+
+		if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
+			$.ui.ddmanager.prepareOffsets(i, event);
+		}
+
+	}
+});
+
+$.ui.plugin.add("draggable", "snap", {
+	start: function() {
+
+		var i = $(this).data("ui-draggable"),
+			o = i.options;
+
+		i.snapElements = [];
+
+		$(o.snap.constructor !== String ? ( o.snap.items || ":data(ui-draggable)" ) : o.snap).each(function() {
+			var $t = $(this),
+				$o = $t.offset();
+			if(this !== i.element[0]) {
+				i.snapElements.push({
+					item: this,
+					width: $t.outerWidth(), height: $t.outerHeight(),
+					top: $o.top, left: $o.left
+				});
+			}
+		});
+
+	},
+	drag: function(event, ui) {
+
+		var ts, bs, ls, rs, l, r, t, b, i, first,
+			inst = $(this).data("ui-draggable"),
+			o = inst.options,
+			d = o.snapTolerance,
+			x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
+			y1 = ui.offset.top, y2 = y1 + inst.helperProportions.height;
+
+		for (i = inst.snapElements.length - 1; i >= 0; i--){
+
+			l = inst.snapElements[i].left;
+			r = l + inst.snapElements[i].width;
+			t = inst.snapElements[i].top;
+			b = t + inst.snapElements[i].height;
+
+			if ( x2 < l - d || x1 > r + d || y2 < t - d || y1 > b + d || !$.contains( inst.snapElements[ i ].item.ownerDocument, inst.snapElements[ i ].item ) ) {
+				if(inst.snapElements[i].snapping) {
+					(inst.options.snap.release && inst.options.snap.release.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+				}
+				inst.snapElements[i].snapping = false;
+				continue;
+			}
+
+			if(o.snapMode !== "inner") {
+				ts = Math.abs(t - y2) <= d;
+				bs = Math.abs(b - y1) <= d;
+				ls = Math.abs(l - x2) <= d;
+				rs = Math.abs(r - x1) <= d;
+				if(ts) {
+					ui.position.top = inst._convertPositionTo("relative", { top: t - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+				}
+				if(bs) {
+					ui.position.top = inst._convertPositionTo("relative", { top: b, left: 0 }).top - inst.margins.top;
+				}
+				if(ls) {
+					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l - inst.helperProportions.width }).left - inst.margins.left;
+				}
+				if(rs) {
+					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r }).left - inst.margins.left;
+				}
+			}
+
+			first = (ts || bs || ls || rs);
+
+			if(o.snapMode !== "outer") {
+				ts = Math.abs(t - y1) <= d;
+				bs = Math.abs(b - y2) <= d;
+				ls = Math.abs(l - x1) <= d;
+				rs = Math.abs(r - x2) <= d;
+				if(ts) {
+					ui.position.top = inst._convertPositionTo("relative", { top: t, left: 0 }).top - inst.margins.top;
+				}
+				if(bs) {
+					ui.position.top = inst._convertPositionTo("relative", { top: b - inst.helperProportions.height, left: 0 }).top - inst.margins.top;
+				}
+				if(ls) {
+					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: l }).left - inst.margins.left;
+				}
+				if(rs) {
+					ui.position.left = inst._convertPositionTo("relative", { top: 0, left: r - inst.helperProportions.width }).left - inst.margins.left;
+				}
+			}
+
+			if(!inst.snapElements[i].snapping && (ts || bs || ls || rs || first)) {
+				(inst.options.snap.snap && inst.options.snap.snap.call(inst.element, event, $.extend(inst._uiHash(), { snapItem: inst.snapElements[i].item })));
+			}
+			inst.snapElements[i].snapping = (ts || bs || ls || rs || first);
+
+		}
+
+	}
+});
+
+$.ui.plugin.add("draggable", "stack", {
+	start: function() {
+		var min,
+			o = this.data("ui-draggable").options,
+			group = $.makeArray($(o.stack)).sort(function(a,b) {
+				return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0);
+			});
+
+		if (!group.length) { return; }
+
+		min = parseInt($(group[0]).css("zIndex"), 10) || 0;
+		$(group).each(function(i) {
+			$(this).css("zIndex", min + i);
+		});
+		this.css("zIndex", (min + group.length));
+	}
+});
+
+$.ui.plugin.add("draggable", "zIndex", {
+	start: function(event, ui) {
+		var t = $(ui.helper), o = $(this).data("ui-draggable").options;
+		if(t.css("zIndex")) {
+			o._zIndex = t.css("zIndex");
+		}
+		t.css("zIndex", o.zIndex);
+	},
+	stop: function(event, ui) {
+		var o = $(this).data("ui-draggable").options;
+		if(o._zIndex) {
+			$(ui.helper).css("zIndex", o._zIndex);
+		}
+	}
+});
+
+})(jQuery);
+(function( $, undefined ) {
+
+/*jshint loopfunc: true */
+
+function isOverAxis( x, reference, size ) {
+	return ( x > reference ) && ( x < ( reference + size ) );
+}
+
+function isFloating(item) {
+	return (/left|right/).test(item.css("float")) || (/inline|table-cell/).test(item.css("display"));
+}
+
 $.widget("ui.sortable", $.ui.mouse, {
-	version: "1.9.2",
+	version: "1.10.3",
 	widgetEventPrefix: "sort",
 	ready: false,
@@ -1035,5 +1945,5 @@
 		connectWith: false,
 		containment: false,
-		cursor: 'auto',
+		cursor: "auto",
 		cursorAt: false,
 		dropOnEmpty: true,
@@ -1043,5 +1953,5 @@
 		handle: false,
 		helper: "original",
-		items: '> *',
+		items: "> *",
 		opacity: false,
 		placeholder: false,
@@ -1052,5 +1962,19 @@
 		scope: "default",
 		tolerance: "intersect",
-		zIndex: 1000
+		zIndex: 1000,
+
+		// callbacks
+		activate: null,
+		beforeStop: null,
+		change: null,
+		deactivate: null,
+		out: null,
+		over: null,
+		receive: null,
+		remove: null,
+		sort: null,
+		start: null,
+		stop: null,
+		update: null
 	},
 	_create: function() {
@@ -1064,5 +1988,5 @@
 
 		//Let's determine if the items are being displayed horizontally
-		this.floating = this.items.length ? o.axis === 'x' || (/left|right/).test(this.items[0].item.css('float')) || (/inline|table-cell/).test(this.items[0].item.css('display')) : false;
+		this.floating = this.items.length ? o.axis === "x" || isFloating(this.items[0].item) : false;
 
 		//Let's determine the parent's offset
@@ -1073,5 +1997,5 @@
 
 		//We're ready to go
-		this.ready = true
+		this.ready = true;
 
 	},
@@ -1082,6 +2006,7 @@
 		this._mouseDestroy();
 
-		for ( var i = this.items.length - 1; i >= 0; i-- )
+		for ( var i = this.items.length - 1; i >= 0; i-- ) {
 			this.items[i].item.removeData(this.widgetName + "-item");
+		}
 
 		return this;
@@ -1100,5 +2025,7 @@
 
 	_mouseCapture: function(event, overrideHandle) {
-		var that = this;
+		var currentItem = null,
+			validHandle = false,
+			that = this;
 
 		if (this.reverting) {
@@ -1106,5 +2033,7 @@
 		}
 
-		if(this.options.disabled || this.options.type == 'static') return false;
+		if(this.options.disabled || this.options.type === "static") {
+			return false;
+		}
 
 		//We have to refresh the items data once first
@@ -1112,18 +2041,26 @@
 
 		//Find out if the clicked node (or one of its parents) is a actual item in this.items
-		var currentItem = null, nodes = $(event.target).parents().each(function() {
-			if($.data(this, that.widgetName + '-item') == that) {
+		$(event.target).parents().each(function() {
+			if($.data(this, that.widgetName + "-item") === that) {
 				currentItem = $(this);
 				return false;
 			}
 		});
-		if($.data(event.target, that.widgetName + '-item') == that) currentItem = $(event.target);
-
-		if(!currentItem) return false;
+		if($.data(event.target, that.widgetName + "-item") === that) {
+			currentItem = $(event.target);
+		}
+
+		if(!currentItem) {
+			return false;
+		}
 		if(this.options.handle && !overrideHandle) {
-			var validHandle = false;
-
-			$(this.options.handle, currentItem).find("*").andSelf().each(function() { if(this == event.target) validHandle = true; });
-			if(!validHandle) return false;
+			$(this.options.handle, currentItem).find("*").addBack().each(function() {
+				if(this === event.target) {
+					validHandle = true;
+				}
+			});
+			if(!validHandle) {
+				return false;
+			}
 		}
 
@@ -1136,5 +2073,7 @@
 	_mouseStart: function(event, overrideHandle, noActivation) {
 
-		var o = this.options;
+		var i, body,
+			o = this.options;
+
 		this.currentContainer = this;
 
@@ -1185,5 +2124,5 @@
 		this.originalPageY = event.pageY;
 
-		//Adjust the mouse offset relative to the helper if 'cursorAt' is supplied
+		//Adjust the mouse offset relative to the helper if "cursorAt" is supplied
 		(o.cursorAt && this._adjustOffsetFromHelper(o.cursorAt));
 
@@ -1192,5 +2131,5 @@
 
 		//If the helper is not the original, hide the original so it's not playing any role during the drag, won't cause anything bad this way
-		if(this.helper[0] != this.currentItem[0]) {
+		if(this.helper[0] !== this.currentItem[0]) {
 			this.currentItem.hide();
 		}
@@ -1200,25 +2139,36 @@
 
 		//Set a containment if given in the options
-		if(o.containment)
+		if(o.containment) {
 			this._setContainment();
-
-		if(o.cursor) { // cursor option
-			if ($('body').css("cursor")) this._storedCursor = $('body').css("cursor");
-			$('body').css("cursor", o.cursor);
+		}
+
+		if( o.cursor && o.cursor !== "auto" ) { // cursor option
+			body = this.document.find( "body" );
+
+			// support: IE
+			this.storedCursor = body.css( "cursor" );
+			body.css( "cursor", o.cursor );
+
+			this.storedStylesheet = $( "<style>*{ cursor: "+o.cursor+" !important; }</style>" ).appendTo( body );
 		}
 
 		if(o.opacity) { // opacity option
-			if (this.helper.css("opacity")) this._storedOpacity = this.helper.css("opacity");
+			if (this.helper.css("opacity")) {
+				this._storedOpacity = this.helper.css("opacity");
+			}
 			this.helper.css("opacity", o.opacity);
 		}
 
 		if(o.zIndex) { // zIndex option
-			if (this.helper.css("zIndex")) this._storedZIndex = this.helper.css("zIndex");
+			if (this.helper.css("zIndex")) {
+				this._storedZIndex = this.helper.css("zIndex");
+			}
 			this.helper.css("zIndex", o.zIndex);
 		}
 
 		//Prepare scrolling
-		if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML')
+		if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") {
 			this.overflowOffset = this.scrollParent.offset();
+		}
 
 		//Call callbacks
@@ -1226,19 +2176,24 @@
 
 		//Recache the helper size
-		if(!this._preserveHelperProportions)
+		if(!this._preserveHelperProportions) {
 			this._cacheHelperProportions();
-
-
-		//Post 'activate' events to possible containers
-		if(!noActivation) {
-			 for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i]._trigger("activate", event, this._uiHash(this)); }
+		}
+
+
+		//Post "activate" events to possible containers
+		if( !noActivation ) {
+			for ( i = this.containers.length - 1; i >= 0; i-- ) {
+				this.containers[ i ]._trigger( "activate", event, this._uiHash( this ) );
+			}
 		}
 
 		//Prepare possible droppables
-		if($.ui.ddmanager)
+		if($.ui.ddmanager) {
 			$.ui.ddmanager.current = this;
-
-		if ($.ui.ddmanager && !o.dropBehaviour)
+		}
+
+		if ($.ui.ddmanager && !o.dropBehaviour) {
 			$.ui.ddmanager.prepareOffsets(this, event);
+		}
 
 		this.dragging = true;
@@ -1251,4 +2206,7 @@
 
 	_mouseDrag: function(event) {
+		var i, item, itemElement, intersection,
+			o = this.options,
+			scrolled = false;
 
 		//Compute the helpers position
@@ -1262,33 +2220,37 @@
 		//Do scrolling
 		if(this.options.scroll) {
-			var o = this.options, scrolled = false;
-			if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {
-
-				if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
+			if(this.scrollParent[0] !== document && this.scrollParent[0].tagName !== "HTML") {
+
+				if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity) {
 					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
-				else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
+				} else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity) {
 					this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
-
-				if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
+				}
+
+				if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity) {
 					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
-				else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
+				} else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity) {
 					this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
+				}
 
 			} else {
 
-				if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
+				if(event.pageY - $(document).scrollTop() < o.scrollSensitivity) {
 					scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
-				else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
+				} else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity) {
 					scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
-
-				if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
+				}
+
+				if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity) {
 					scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
-				else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
+				} else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity) {
 					scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
-
-			}
-
-			if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
+				}
+
+			}
+
+			if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour) {
 				$.ui.ddmanager.prepareOffsets(this, event);
+			}
 		}
 
@@ -1297,13 +2259,21 @@
 
 		//Set the helper position
-		if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
-		if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
+		if(!this.options.axis || this.options.axis !== "y") {
+			this.helper[0].style.left = this.position.left+"px";
+		}
+		if(!this.options.axis || this.options.axis !== "x") {
+			this.helper[0].style.top = this.position.top+"px";
+		}
 
 		//Rearrange
-		for (var i = this.items.length - 1; i >= 0; i--) {
+		for (i = this.items.length - 1; i >= 0; i--) {
 
 			//Cache variables and intersection, continue if no intersection
-			var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);
-			if (!intersection) continue;
+			item = this.items[i];
+			itemElement = item.item[0];
+			intersection = this._intersectsWithPointer(item);
+			if (!intersection) {
+				continue;
+			}
 
 			// Only put the placeholder inside the current Container, skip all
@@ -1314,16 +2284,20 @@
 			// Without this moving items in "sub-sortables" can cause the placeholder to jitter
 			// beetween the outer and inner container.
-			if (item.instance !== this.currentContainer) continue;
-
-			if (itemElement != this.currentItem[0] //cannot intersect with itself
-				&&	this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before
-				&&	!$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked
-				&& (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)
-				//&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container
+			if (item.instance !== this.currentContainer) {
+				continue;
+			}
+
+			// cannot intersect with itself
+			// no useless actions that have been done before
+			// no action if the item moved is the parent of the item checked
+			if (itemElement !== this.currentItem[0] &&
+				this.placeholder[intersection === 1 ? "next" : "prev"]()[0] !== itemElement &&
+				!$.contains(this.placeholder[0], itemElement) &&
+				(this.options.type === "semi-dynamic" ? !$.contains(this.element[0], itemElement) : true)
 			) {
 
-				this.direction = intersection == 1 ? "down" : "up";
-
-				if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {
+				this.direction = intersection === 1 ? "down" : "up";
+
+				if (this.options.tolerance === "pointer" || this._intersectsWithSides(item)) {
 					this._rearrange(event, item);
 				} else {
@@ -1340,8 +2314,10 @@
 
 		//Interconnect with droppables
-		if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
+		if($.ui.ddmanager) {
+			$.ui.ddmanager.drag(this, event);
+		}
 
 		//Call callbacks
-		this._trigger('sort', event, this._uiHash());
+		this._trigger("sort", event, this._uiHash());
 
 		this.lastPositionAbs = this.positionAbs;
@@ -1352,20 +2328,27 @@
 	_mouseStop: function(event, noPropagation) {
 
-		if(!event) return;
+		if(!event) {
+			return;
+		}
 
 		//If we are using droppables, inform the manager about the drop
-		if ($.ui.ddmanager && !this.options.dropBehaviour)
+		if ($.ui.ddmanager && !this.options.dropBehaviour) {
 			$.ui.ddmanager.drop(this, event);
+		}
 
 		if(this.options.revert) {
-			var that = this;
-			var cur = this.placeholder.offset();
-
+			var that = this,
+				cur = this.placeholder.offset(),
+				axis = this.options.axis,
+				animation = {};
+
+			if ( !axis || axis === "x" ) {
+				animation.left = cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollLeft);
+			}
+			if ( !axis || axis === "y" ) {
+				animation.top = cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] === document.body ? 0 : this.offsetParent[0].scrollTop);
+			}
 			this.reverting = true;
-
-			$(this.helper).animate({
-				left: cur.left - this.offset.parent.left - this.margins.left + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollLeft),
-				top: cur.top - this.offset.parent.top - this.margins.top + (this.offsetParent[0] == document.body ? 0 : this.offsetParent[0].scrollTop)
-			}, parseInt(this.options.revert, 10) || 500, function() {
+			$(this.helper).animate( animation, parseInt(this.options.revert, 10) || 500, function() {
 				that._clear(event);
 			});
@@ -1384,8 +2367,9 @@
 			this._mouseUp({ target: null });
 
-			if(this.options.helper == "original")
+			if(this.options.helper === "original") {
 				this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
-			else
+			} else {
 				this.currentItem.show();
+			}
 
 			//Post deactivating events to containers
@@ -1402,6 +2386,10 @@
 		if (this.placeholder) {
 			//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
-			if(this.placeholder[0].parentNode) this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
-			if(this.options.helper != "original" && this.helper && this.helper[0].parentNode) this.helper.remove();
+			if(this.placeholder[0].parentNode) {
+				this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
+			}
+			if(this.options.helper !== "original" && this.helper && this.helper[0].parentNode) {
+				this.helper.remove();
+			}
 
 			$.extend(this, {
@@ -1425,17 +2413,20 @@
 	serialize: function(o) {
 
-		var items = this._getItemsAsjQuery(o && o.connected);
-		var str = []; o = o || {};
+		var items = this._getItemsAsjQuery(o && o.connected),
+			str = [];
+		o = o || {};
 
 		$(items).each(function() {
-			var res = ($(o.item || this).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
-			if(res) str.push((o.key || res[1]+'[]')+'='+(o.key && o.expression ? res[1] : res[2]));
+			var res = ($(o.item || this).attr(o.attribute || "id") || "").match(o.expression || (/(.+)[\-=_](.+)/));
+			if (res) {
+				str.push((o.key || res[1]+"[]")+"="+(o.key && o.expression ? res[1] : res[2]));
+			}
 		});
 
 		if(!str.length && o.key) {
-			str.push(o.key + '=');
-		}
-
-		return str.join('&');
+			str.push(o.key + "=");
+		}
+
+		return str.join("&");
 
 	},
@@ -1443,8 +2434,10 @@
 	toArray: function(o) {
 
-		var items = this._getItemsAsjQuery(o && o.connected);
-		var ret = []; o = o || {};
-
-		items.each(function() { ret.push($(o.item || this).attr(o.attribute || 'id') || ''); });
+		var items = this._getItemsAsjQuery(o && o.connected),
+			ret = [];
+
+		o = o || {};
+
+		items.each(function() { ret.push($(o.item || this).attr(o.attribute || "id") || ""); });
 		return ret;
 
@@ -1457,27 +2450,26 @@
 			x2 = x1 + this.helperProportions.width,
 			y1 = this.positionAbs.top,
-			y2 = y1 + this.helperProportions.height;
-
-		var l = item.left,
+			y2 = y1 + this.helperProportions.height,
+			l = item.left,
 			r = l + item.width,
 			t = item.top,
-			b = t + item.height;
-
-		var dyClick = this.offset.click.top,
-			dxClick = this.offset.click.left;
-
-		var isOverElement = (y1 + dyClick) > t && (y1 + dyClick) < b && (x1 + dxClick) > l && (x1 + dxClick) < r;
-
-		if(	   this.options.tolerance == "pointer"
-			|| this.options.forcePointerForContainers
-			|| (this.options.tolerance != "pointer" && this.helperProportions[this.floating ? 'width' : 'height'] > item[this.floating ? 'width' : 'height'])
+			b = t + item.height,
+			dyClick = this.offset.click.top,
+			dxClick = this.offset.click.left,
+			isOverElementHeight = ( this.options.axis === "x" ) || ( ( y1 + dyClick ) > t && ( y1 + dyClick ) < b ),
+			isOverElementWidth = ( this.options.axis === "y" ) || ( ( x1 + dxClick ) > l && ( x1 + dxClick ) < r ),
+			isOverElement = isOverElementHeight && isOverElementWidth;
+
+		if ( this.options.tolerance === "pointer" ||
+			this.options.forcePointerForContainers ||
+			(this.options.tolerance !== "pointer" && this.helperProportions[this.floating ? "width" : "height"] > item[this.floating ? "width" : "height"])
 		) {
 			return isOverElement;
 		} else {
 
-			return (l < x1 + (this.helperProportions.width / 2) // Right Half
-				&& x2 - (this.helperProportions.width / 2) < r // Left Half
-				&& t < y1 + (this.helperProportions.height / 2) // Bottom Half
-				&& y2 - (this.helperProportions.height / 2) < b ); // Top Half
+			return (l < x1 + (this.helperProportions.width / 2) && // Right Half
+				x2 - (this.helperProportions.width / 2) < r && // Left Half
+				t < y1 + (this.helperProportions.height / 2) && // Bottom Half
+				y2 - (this.helperProportions.height / 2) < b ); // Top Half
 
 		}
@@ -1486,16 +2478,17 @@
 	_intersectsWithPointer: function(item) {
 
-		var isOverElementHeight = (this.options.axis === 'x') || $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
-			isOverElementWidth = (this.options.axis === 'y') || $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
+		var isOverElementHeight = (this.options.axis === "x") || isOverAxis(this.positionAbs.top + this.offset.click.top, item.top, item.height),
+			isOverElementWidth = (this.options.axis === "y") || isOverAxis(this.positionAbs.left + this.offset.click.left, item.left, item.width),
 			isOverElement = isOverElementHeight && isOverElementWidth,
 			verticalDirection = this._getDragVerticalDirection(),
 			horizontalDirection = this._getDragHorizontalDirection();
 
-		if (!isOverElement)
+		if (!isOverElement) {
 			return false;
+		}
 
 		return this.floating ?
-			( ((horizontalDirection && horizontalDirection == "right") || verticalDirection == "down") ? 2 : 1 )
-			: ( verticalDirection && (verticalDirection == "down" ? 2 : 1) );
+			( ((horizontalDirection && horizontalDirection === "right") || verticalDirection === "down") ? 2 : 1 )
+			: ( verticalDirection && (verticalDirection === "down" ? 2 : 1) );
 
 	},
@@ -1503,13 +2496,13 @@
 	_intersectsWithSides: function(item) {
 
-		var isOverBottomHalf = $.ui.isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
-			isOverRightHalf = $.ui.isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
+		var isOverBottomHalf = isOverAxis(this.positionAbs.top + this.offset.click.top, item.top + (item.height/2), item.height),
+			isOverRightHalf = isOverAxis(this.positionAbs.left + this.offset.click.left, item.left + (item.width/2), item.width),
 			verticalDirection = this._getDragVerticalDirection(),
 			horizontalDirection = this._getDragHorizontalDirection();
 
 		if (this.floating && horizontalDirection) {
-			return ((horizontalDirection == "right" && isOverRightHalf) || (horizontalDirection == "left" && !isOverRightHalf));
+			return ((horizontalDirection === "right" && isOverRightHalf) || (horizontalDirection === "left" && !isOverRightHalf));
 		} else {
-			return verticalDirection && ((verticalDirection == "down" && isOverBottomHalf) || (verticalDirection == "up" && !isOverBottomHalf));
+			return verticalDirection && ((verticalDirection === "down" && isOverBottomHalf) || (verticalDirection === "up" && !isOverBottomHalf));
 		}
 
@@ -1518,10 +2511,10 @@
 	_getDragVerticalDirection: function() {
 		var delta = this.positionAbs.top - this.lastPositionAbs.top;
-		return delta != 0 && (delta > 0 ? "down" : "up");
+		return delta !== 0 && (delta > 0 ? "down" : "up");
 	},
 
 	_getDragHorizontalDirection: function() {
 		var delta = this.positionAbs.left - this.lastPositionAbs.left;
-		return delta != 0 && (delta > 0 ? "right" : "left");
+		return delta !== 0 && (delta > 0 ? "right" : "left");
 	},
 
@@ -1534,34 +2527,33 @@
 	_connectWith: function() {
 		var options = this.options;
-		return options.connectWith.constructor == String
-			? [options.connectWith]
-			: options.connectWith;
+		return options.connectWith.constructor === String ? [options.connectWith] : options.connectWith;
 	},
 
 	_getItemsAsjQuery: function(connected) {
 
-		var items = [];
-		var queries = [];
-		var connectWith = this._connectWith();
+		var i, j, cur, inst,
+			items = [],
+			queries = [],
+			connectWith = this._connectWith();
 
 		if(connectWith && connected) {
-			for (var i = connectWith.length - 1; i >= 0; i--){
-				var cur = $(connectWith[i]);
-				for (var j = cur.length - 1; j >= 0; j--){
-					var inst = $.data(cur[j], this.widgetName);
-					if(inst && inst != this && !inst.options.disabled) {
-						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), inst]);
+			for (i = connectWith.length - 1; i >= 0; i--){
+				cur = $(connectWith[i]);
+				for ( j = cur.length - 1; j >= 0; j--){
+					inst = $.data(cur[j], this.widgetFullName);
+					if(inst && inst !== this && !inst.options.disabled) {
+						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element) : $(inst.options.items, inst.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), inst]);
 					}
-				};
-			};
-		}
-
-		queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not('.ui-sortable-placeholder'), this]);
-
-		for (var i = queries.length - 1; i >= 0; i--){
+				}
+			}
+		}
+
+		queries.push([$.isFunction(this.options.items) ? this.options.items.call(this.element, null, { options: this.options, item: this.currentItem }) : $(this.options.items, this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"), this]);
+
+		for (i = queries.length - 1; i >= 0; i--){
 			queries[i][0].each(function() {
 				items.push(this);
 			});
-		};
+		}
 
 		return $(items);
@@ -1575,7 +2567,8 @@
 		this.items = $.grep(this.items, function (item) {
 			for (var j=0; j < list.length; j++) {
-				if(list[j] == item.item[0])
+				if(list[j] === item.item[0]) {
 					return false;
-			};
+				}
+			}
 			return true;
 		});
@@ -1587,29 +2580,31 @@
 		this.items = [];
 		this.containers = [this];
-		var items = this.items;
-		var queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]];
-		var connectWith = this._connectWith();
+
+		var i, j, cur, inst, targetData, _queries, item, queriesLength,
+			items = this.items,
+			queries = [[$.isFunction(this.options.items) ? this.options.items.call(this.element[0], event, { item: this.currentItem }) : $(this.options.items, this.element), this]],
+			connectWith = this._connectWith();
 
 		if(connectWith && this.ready) { //Shouldn't be run the first time through due to massive slow-down
-			for (var i = connectWith.length - 1; i >= 0; i--){
-				var cur = $(connectWith[i]);
-				for (var j = cur.length - 1; j >= 0; j--){
-					var inst = $.data(cur[j], this.widgetName);
-					if(inst && inst != this && !inst.options.disabled) {
+			for (i = connectWith.length - 1; i >= 0; i--){
+				cur = $(connectWith[i]);
+				for (j = cur.length - 1; j >= 0; j--){
+					inst = $.data(cur[j], this.widgetFullName);
+					if(inst && inst !== this && !inst.options.disabled) {
 						queries.push([$.isFunction(inst.options.items) ? inst.options.items.call(inst.element[0], event, { item: this.currentItem }) : $(inst.options.items, inst.element), inst]);
 						this.containers.push(inst);
 					}
-				};
-			};
-		}
-
-		for (var i = queries.length - 1; i >= 0; i--) {
-			var targetData = queries[i][1];
-			var _queries = queries[i][0];
-
-			for (var j=0, queriesLength = _queries.length; j < queriesLength; j++) {
-				var item = $(_queries[j]);
-
-				item.data(this.widgetName + '-item', targetData); // Data for target checking (mouse manager)
+				}
+			}
+		}
+
+		for (i = queries.length - 1; i >= 0; i--) {
+			targetData = queries[i][1];
+			_queries = queries[i][0];
+
+			for (j=0, queriesLength = _queries.length; j < queriesLength; j++) {
+				item = $(_queries[j]);
+
+				item.data(this.widgetName + "-item", targetData); // Data for target checking (mouse manager)
 
 				items.push({
@@ -1619,6 +2614,6 @@
 					left: 0, top: 0
 				});
-			};
-		};
+			}
+		}
 
 	},
@@ -1631,12 +2626,15 @@
 		}
 
-		for (var i = this.items.length - 1; i >= 0; i--){
-			var item = this.items[i];
+		var i, item, t, p;
+
+		for (i = this.items.length - 1; i >= 0; i--){
+			item = this.items[i];
 
 			//We ignore calculating positions of all connected containers when we're not over them
-			if(item.instance != this.currentContainer && this.currentContainer && item.item[0] != this.currentItem[0])
+			if(item.instance !== this.currentContainer && this.currentContainer && item.item[0] !== this.currentItem[0]) {
 				continue;
-
-			var t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
+			}
+
+			t = this.options.toleranceElement ? $(this.options.toleranceElement, item.item) : item.item;
 
 			if (!fast) {
@@ -1645,19 +2643,19 @@
 			}
 
-			var p = t.offset();
+			p = t.offset();
 			item.left = p.left;
 			item.top = p.top;
-		};
+		}
 
 		if(this.options.custom && this.options.custom.refreshContainers) {
 			this.options.custom.refreshContainers.call(this);
 		} else {
-			for (var i = this.containers.length - 1; i >= 0; i--){
-				var p = this.containers[i].element.offset();
+			for (i = this.containers.length - 1; i >= 0; i--){
+				p = this.containers[i].element.offset();
 				this.containers[i].containerCache.left = p.left;
 				this.containers[i].containerCache.top = p.top;
 				this.containers[i].containerCache.width	= this.containers[i].element.outerWidth();
 				this.containers[i].containerCache.height = this.containers[i].element.outerHeight();
-			};
+			}
 		}
 
@@ -1667,19 +2665,32 @@
 	_createPlaceholder: function(that) {
 		that = that || this;
-		var o = that.options;
-
-		if(!o.placeholder || o.placeholder.constructor == String) {
-			var className = o.placeholder;
+		var className,
+			o = that.options;
+
+		if(!o.placeholder || o.placeholder.constructor === String) {
+			className = o.placeholder;
 			o.placeholder = {
 				element: function() {
 
-					var el = $(document.createElement(that.currentItem[0].nodeName))
-						.addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
-						.removeClass("ui-sortable-helper")[0];
-
-					if(!className)
-						el.style.visibility = "hidden";
-
-					return el;
+					var nodeName = that.currentItem[0].nodeName.toLowerCase(),
+						element = $( "<" + nodeName + ">", that.document[0] )
+							.addClass(className || that.currentItem[0].className+" ui-sortable-placeholder")
+							.removeClass("ui-sortable-helper");
+
+					if ( nodeName === "tr" ) {
+						that.currentItem.children().each(function() {
+							$( "<td>&#160;</td>", that.document[0] )
+								.attr( "colspan", $( this ).attr( "colspan" ) || 1 )
+								.appendTo( element );
+						});
+					} else if ( nodeName === "img" ) {
+						element.attr( "src", that.currentItem.attr( "src" ) );
+					}
+
+					if ( !className ) {
+						element.css( "visibility", "hidden" );
+					}
+
+					return element;
 				},
 				update: function(container, p) {
@@ -1687,9 +2698,11 @@
 					// 1. If a className is set as 'placeholder option, we don't force sizes - the class is responsible for that
 					// 2. The option 'forcePlaceholderSize can be enabled to force it even if a class name is specified
-					if(className && !o.forcePlaceholderSize) return;
+					if(className && !o.forcePlaceholderSize) {
+						return;
+					}
 
 					//If the element doesn't have a actual height by itself (without styles coming from a stylesheet), it receives the inline height from the dragged item
-					if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css('paddingTop')||0, 10) - parseInt(that.currentItem.css('paddingBottom')||0, 10)); };
-					if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css('paddingLeft')||0, 10) - parseInt(that.currentItem.css('paddingRight')||0, 10)); };
+					if(!p.height()) { p.height(that.currentItem.innerHeight() - parseInt(that.currentItem.css("paddingTop")||0, 10) - parseInt(that.currentItem.css("paddingBottom")||0, 10)); }
+					if(!p.width()) { p.width(that.currentItem.innerWidth() - parseInt(that.currentItem.css("paddingLeft")||0, 10) - parseInt(that.currentItem.css("paddingRight")||0, 10)); }
 				}
 			};
@@ -1708,20 +2721,22 @@
 
 	_contactContainers: function(event) {
+		var i, j, dist, itemWithLeastDistance, posProperty, sizeProperty, base, cur, nearBottom, floating,
+			innermostContainer = null,
+			innermostIndex = null;
 
 		// get innermost container that intersects with item
-		var innermostContainer = null, innermostIndex = null;
-
-
-		for (var i = this.containers.length - 1; i >= 0; i--){
+		for (i = this.containers.length - 1; i >= 0; i--) {
 
 			// never consider a container that's located within the item itself
-			if($.contains(this.currentItem[0], this.containers[i].element[0]))
+			if($.contains(this.currentItem[0], this.containers[i].element[0])) {
 				continue;
+			}
 
 			if(this._intersectsWith(this.containers[i].containerCache)) {
 
 				// if we've already found a container and it's more "inner" than this, then continue
-				if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0]))
+				if(innermostContainer && $.contains(this.containers[i].element[0], innermostContainer.element[0])) {
 					continue;
+				}
 
 				innermostContainer = this.containers[i];
@@ -1739,22 +2754,35 @@
 
 		// if no intersecting containers found, return
-		if(!innermostContainer) return;
+		if(!innermostContainer) {
+			return;
+		}
 
 		// move the item into the container if it's not there already
 		if(this.containers.length === 1) {
-			this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
-			this.containers[innermostIndex].containerCache.over = 1;
+			if (!this.containers[innermostIndex].containerCache.over) {
+				this.containers[innermostIndex]._trigger("over", event, this._uiHash(this));
+				this.containers[innermostIndex].containerCache.over = 1;
+			}
 		} else {
 
 			//When entering a new container, we will find the item with the least distance and append our item near it
-			var dist = 10000; var itemWithLeastDistance = null;
-			var posProperty = this.containers[innermostIndex].floating ? 'left' : 'top';
-			var sizeProperty = this.containers[innermostIndex].floating ? 'width' : 'height';
-			var base = this.positionAbs[posProperty] + this.offset.click[posProperty];
-			for (var j = this.items.length - 1; j >= 0; j--) {
-				if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) continue;
-				if(this.items[j].item[0] == this.currentItem[0]) continue;
-				var cur = this.items[j].item.offset()[posProperty];
-				var nearBottom = false;
+			dist = 10000;
+			itemWithLeastDistance = null;
+			floating = innermostContainer.floating || isFloating(this.currentItem);
+			posProperty = floating ? "left" : "top";
+			sizeProperty = floating ? "width" : "height";
+			base = this.positionAbs[posProperty] + this.offset.click[posProperty];
+			for (j = this.items.length - 1; j >= 0; j--) {
+				if(!$.contains(this.containers[innermostIndex].element[0], this.items[j].item[0])) {
+					continue;
+				}
+				if(this.items[j].item[0] === this.currentItem[0]) {
+					continue;
+				}
+				if (floating && !isOverAxis(this.positionAbs.top + this.offset.click.top, this.items[j].top, this.items[j].height)) {
+					continue;
+				}
+				cur = this.items[j].item.offset()[posProperty];
+				nearBottom = false;
 				if(Math.abs(cur - base) > Math.abs(cur + this.items[j][sizeProperty] - base)){
 					nearBottom = true;
@@ -1768,11 +2796,17 @@
 			}
 
-			if(!itemWithLeastDistance && !this.options.dropOnEmpty) //Check if dropOnEmpty is enabled
+			//Check if dropOnEmpty is enabled
+			if(!itemWithLeastDistance && !this.options.dropOnEmpty) {
 				return;
-
-			this.currentContainer = this.containers[innermostIndex];
+			}
+
+			if(this.currentContainer === this.containers[innermostIndex]) {
+				return;
+			}
+
 			itemWithLeastDistance ? this._rearrange(event, itemWithLeastDistance, null, true) : this._rearrange(event, null, this.containers[innermostIndex].element, true);
 			this._trigger("change", event, this._uiHash());
 			this.containers[innermostIndex]._trigger("change", event, this._uiHash(this));
+			this.currentContainer = this.containers[innermostIndex];
 
 			//Update the placeholder
@@ -1788,15 +2822,22 @@
 	_createHelper: function(event) {
 
-		var o = this.options;
-		var helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper == 'clone' ? this.currentItem.clone() : this.currentItem);
-
-		if(!helper.parents('body').length) //Add the helper to the DOM if that didn't happen already
-			$(o.appendTo != 'parent' ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
-
-		if(helper[0] == this.currentItem[0])
+		var o = this.options,
+			helper = $.isFunction(o.helper) ? $(o.helper.apply(this.element[0], [event, this.currentItem])) : (o.helper === "clone" ? this.currentItem.clone() : this.currentItem);
+
+		//Add the helper to the DOM if that didn't happen already
+		if(!helper.parents("body").length) {
+			$(o.appendTo !== "parent" ? o.appendTo : this.currentItem[0].parentNode)[0].appendChild(helper[0]);
+		}
+
+		if(helper[0] === this.currentItem[0]) {
 			this._storedCSS = { width: this.currentItem[0].style.width, height: this.currentItem[0].style.height, position: this.currentItem.css("position"), top: this.currentItem.css("top"), left: this.currentItem.css("left") };
-
-		if(helper[0].style.width == '' || o.forceHelperSize) helper.width(this.currentItem.width());
-		if(helper[0].style.height == '' || o.forceHelperSize) helper.height(this.currentItem.height());
+		}
+
+		if(!helper[0].style.width || o.forceHelperSize) {
+			helper.width(this.currentItem.width());
+		}
+		if(!helper[0].style.height || o.forceHelperSize) {
+			helper.height(this.currentItem.height());
+		}
 
 		return helper;
@@ -1805,20 +2846,20 @@
 
 	_adjustOffsetFromHelper: function(obj) {
-		if (typeof obj == 'string') {
-			obj = obj.split(' ');
+		if (typeof obj === "string") {
+			obj = obj.split(" ");
 		}
 		if ($.isArray(obj)) {
 			obj = {left: +obj[0], top: +obj[1] || 0};
 		}
-		if ('left' in obj) {
+		if ("left" in obj) {
 			this.offset.click.left = obj.left + this.margins.left;
 		}
-		if ('right' in obj) {
+		if ("right" in obj) {
 			this.offset.click.left = this.helperProportions.width - obj.right + this.margins.left;
 		}
-		if ('top' in obj) {
+		if ("top" in obj) {
 			this.offset.click.top = obj.top + this.margins.top;
 		}
-		if ('bottom' in obj) {
+		if ("bottom" in obj) {
 			this.offset.click.top = this.helperProportions.height - obj.bottom + this.margins.top;
 		}
@@ -1836,12 +2877,14 @@
 		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
 		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
-		if(this.cssPosition == 'absolute' && this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
+		if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
 			po.left += this.scrollParent.scrollLeft();
 			po.top += this.scrollParent.scrollTop();
 		}
 
-		if((this.offsetParent[0] == document.body) //This needs to be actually done for all browsers, since pageX/pageY includes this information
-		|| (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() == 'html' && $.ui.ie)) //Ugly IE fix
+		// This needs to be actually done for all browsers, since pageX/pageY includes this information
+		// with an ugly IE fix
+		if( this.offsetParent[0] === document.body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
 			po = { top: 0, left: 0 };
+		}
 
 		return {
@@ -1854,5 +2897,5 @@
 	_getRelativeOffset: function() {
 
-		if(this.cssPosition == "relative") {
+		if(this.cssPosition === "relative") {
 			var p = this.currentItem.position();
 			return {
@@ -1882,17 +2925,22 @@
 	_setContainment: function() {
 
-		var o = this.options;
-		if(o.containment == 'parent') o.containment = this.helper[0].parentNode;
-		if(o.containment == 'document' || o.containment == 'window') this.containment = [
-			0 - this.offset.relative.left - this.offset.parent.left,
-			0 - this.offset.relative.top - this.offset.parent.top,
-			$(o.containment == 'document' ? document : window).width() - this.helperProportions.width - this.margins.left,
-			($(o.containment == 'document' ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
-		];
+		var ce, co, over,
+			o = this.options;
+		if(o.containment === "parent") {
+			o.containment = this.helper[0].parentNode;
+		}
+		if(o.containment === "document" || o.containment === "window") {
+			this.containment = [
+				0 - this.offset.relative.left - this.offset.parent.left,
+				0 - this.offset.relative.top - this.offset.parent.top,
+				$(o.containment === "document" ? document : window).width() - this.helperProportions.width - this.margins.left,
+				($(o.containment === "document" ? document : window).height() || document.body.parentNode.scrollHeight) - this.helperProportions.height - this.margins.top
+			];
+		}
 
 		if(!(/^(document|window|parent)$/).test(o.containment)) {
-			var ce = $(o.containment)[0];
-			var co = $(o.containment).offset();
-			var over = ($(ce).css("overflow") != 'hidden');
+			ce = $(o.containment)[0];
+			co = $(o.containment).offset();
+			over = ($(ce).css("overflow") !== "hidden");
 
 			this.containment = [
@@ -1908,20 +2956,23 @@
 	_convertPositionTo: function(d, pos) {
 
-		if(!pos) pos = this.position;
-		var mod = d == "absolute" ? 1 : -1;
-		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+		if(!pos) {
+			pos = this.position;
+		}
+		var mod = d === "absolute" ? 1 : -1,
+			scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent,
+			scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
 
 		return {
 			top: (
-				pos.top																	// The absolute mouse position
-				+ this.offset.relative.top * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
-				+ this.offset.parent.top * mod											// The offsetParent's offset without borders (offset + border)
-				- ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
+				pos.top	+																// The absolute mouse position
+				this.offset.relative.top * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
+				this.offset.parent.top * mod -											// The offsetParent's offset without borders (offset + border)
+				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ) * mod)
 			),
 			left: (
-				pos.left																// The absolute mouse position
-				+ this.offset.relative.left * mod										// Only for relative positioned nodes: Relative offset from element to offset parent
-				+ this.offset.parent.left * mod											// The offsetParent's offset without borders (offset + border)
-				- ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
+				pos.left +																// The absolute mouse position
+				this.offset.relative.left * mod +										// Only for relative positioned nodes: Relative offset from element to offset parent
+				this.offset.parent.left * mod	-										// The offsetParent's offset without borders (offset + border)
+				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ) * mod)
 			)
 		};
@@ -1931,5 +2982,9 @@
 	_generatePosition: function(event) {
 
-		var o = this.options, scroll = this.cssPosition == 'absolute' && !(this.scrollParent[0] != document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
+		var top, left,
+			o = this.options,
+			pageX = event.pageX,
+			pageY = event.pageY,
+			scroll = this.cssPosition === "absolute" && !(this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) ? this.offsetParent : this.scrollParent, scrollIsRootNode = (/(html|body)/i).test(scroll[0].tagName);
 
 		// This is another very weird special case that only happens for relative elements:
@@ -1937,10 +2992,7 @@
 		// 2. and the scroll parent is the document or similar to the offset parent
 		// we have to refresh the relative offset during the scroll so there are no jumps
-		if(this.cssPosition == 'relative' && !(this.scrollParent[0] != document && this.scrollParent[0] != this.offsetParent[0])) {
+		if(this.cssPosition === "relative" && !(this.scrollParent[0] !== document && this.scrollParent[0] !== this.offsetParent[0])) {
 			this.offset.relative = this._getRelativeOffset();
 		}
-
-		var pageX = event.pageX;
-		var pageY = event.pageY;
 
 		/*
@@ -1952,16 +3004,24 @@
 
 			if(this.containment) {
-				if(event.pageX - this.offset.click.left < this.containment[0]) pageX = this.containment[0] + this.offset.click.left;
-				if(event.pageY - this.offset.click.top < this.containment[1]) pageY = this.containment[1] + this.offset.click.top;
-				if(event.pageX - this.offset.click.left > this.containment[2]) pageX = this.containment[2] + this.offset.click.left;
-				if(event.pageY - this.offset.click.top > this.containment[3]) pageY = this.containment[3] + this.offset.click.top;
+				if(event.pageX - this.offset.click.left < this.containment[0]) {
+					pageX = this.containment[0] + this.offset.click.left;
+				}
+				if(event.pageY - this.offset.click.top < this.containment[1]) {
+					pageY = this.containment[1] + this.offset.click.top;
+				}
+				if(event.pageX - this.offset.click.left > this.containment[2]) {
+					pageX = this.containment[2] + this.offset.click.left;
+				}
+				if(event.pageY - this.offset.click.top > this.containment[3]) {
+					pageY = this.containment[3] + this.offset.click.top;
+				}
 			}
 
 			if(o.grid) {
-				var top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
-				pageY = this.containment ? (!(top - this.offset.click.top < this.containment[1] || top - this.offset.click.top > this.containment[3]) ? top : (!(top - this.offset.click.top < this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
-
-				var left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
-				pageX = this.containment ? (!(left - this.offset.click.left < this.containment[0] || left - this.offset.click.left > this.containment[2]) ? left : (!(left - this.offset.click.left < this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
+				top = this.originalPageY + Math.round((pageY - this.originalPageY) / o.grid[1]) * o.grid[1];
+				pageY = this.containment ? ( (top - this.offset.click.top >= this.containment[1] && top - this.offset.click.top <= this.containment[3]) ? top : ((top - this.offset.click.top >= this.containment[1]) ? top - o.grid[1] : top + o.grid[1])) : top;
+
+				left = this.originalPageX + Math.round((pageX - this.originalPageX) / o.grid[0]) * o.grid[0];
+				pageX = this.containment ? ( (left - this.offset.click.left >= this.containment[0] && left - this.offset.click.left <= this.containment[2]) ? left : ((left - this.offset.click.left >= this.containment[0]) ? left - o.grid[0] : left + o.grid[0])) : left;
 			}
 
@@ -1970,16 +3030,16 @@
 		return {
 			top: (
-				pageY																// The absolute mouse position
-				- this.offset.click.top													// Click offset (relative to the element)
-				- this.offset.relative.top												// Only for relative positioned nodes: Relative offset from element to offset parent
-				- this.offset.parent.top												// The offsetParent's offset without borders (offset + border)
-				+ ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
+				pageY -																// The absolute mouse position
+				this.offset.click.top -													// Click offset (relative to the element)
+				this.offset.relative.top	-											// Only for relative positioned nodes: Relative offset from element to offset parent
+				this.offset.parent.top +												// The offsetParent's offset without borders (offset + border)
+				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollTop() : ( scrollIsRootNode ? 0 : scroll.scrollTop() ) ))
 			),
 			left: (
-				pageX																// The absolute mouse position
-				- this.offset.click.left												// Click offset (relative to the element)
-				- this.offset.relative.left												// Only for relative positioned nodes: Relative offset from element to offset parent
-				- this.offset.parent.left												// The offsetParent's offset without borders (offset + border)
-				+ ( ( this.cssPosition == 'fixed' ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
+				pageX -																// The absolute mouse position
+				this.offset.click.left -												// Click offset (relative to the element)
+				this.offset.relative.left	-											// Only for relative positioned nodes: Relative offset from element to offset parent
+				this.offset.parent.left +												// The offsetParent's offset without borders (offset + border)
+				( ( this.cssPosition === "fixed" ? -this.scrollParent.scrollLeft() : scrollIsRootNode ? 0 : scroll.scrollLeft() ))
 			)
 		};
@@ -1989,5 +3049,5 @@
 	_rearrange: function(event, i, a, hardRefresh) {
 
-		a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction == 'down' ? i.item[0] : i.item[0].nextSibling));
+		a ? a[0].appendChild(this.placeholder[0]) : i.item[0].parentNode.insertBefore(this.placeholder[0], (this.direction === "down" ? i.item[0] : i.item[0].nextSibling));
 
 		//Various things done here to improve the performance:
@@ -2000,5 +3060,7 @@
 
 		this._delay(function() {
-			if(counter == this.counter) this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
+			if(counter === this.counter) {
+				this.refreshPositions(!hardRefresh); //Precompute after each DOM insertion, NOT on mousemove
+			}
 		});
 
@@ -2010,14 +3072,19 @@
 		// We delay all events that have to be triggered to after the point where the placeholder has been removed and
 		// everything else normalized again
-		var delayedTriggers = [];
+		var i,
+			delayedTriggers = [];
 
 		// We first have to update the dom position of the actual currentItem
 		// Note: don't do it if the current item is already removed (by a user), or it gets reappended (see #4088)
-		if(!this._noFinalSort && this.currentItem.parent().length) this.placeholder.before(this.currentItem);
+		if(!this._noFinalSort && this.currentItem.parent().length) {
+			this.placeholder.before(this.currentItem);
+		}
 		this._noFinalSort = null;
 
-		if(this.helper[0] == this.currentItem[0]) {
-			for(var i in this._storedCSS) {
-				if(this._storedCSS[i] == 'auto' || this._storedCSS[i] == 'static') this._storedCSS[i] = '';
+		if(this.helper[0] === this.currentItem[0]) {
+			for(i in this._storedCSS) {
+				if(this._storedCSS[i] === "auto" || this._storedCSS[i] === "static") {
+					this._storedCSS[i] = "";
+				}
 			}
 			this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper");
@@ -2026,6 +3093,10 @@
 		}
 
-		if(this.fromOutside && !noPropagation) delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
-		if((this.fromOutside || this.domPosition.prev != this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent != this.currentItem.parent()[0]) && !noPropagation) delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
+		if(this.fromOutside && !noPropagation) {
+			delayedTriggers.push(function(event) { this._trigger("receive", event, this._uiHash(this.fromOutside)); });
+		}
+		if((this.fromOutside || this.domPosition.prev !== this.currentItem.prev().not(".ui-sortable-helper")[0] || this.domPosition.parent !== this.currentItem.parent()[0]) && !noPropagation) {
+			delayedTriggers.push(function(event) { this._trigger("update", event, this._uiHash()); }); //Trigger update callback if the DOM position has changed
+		}
 
 		// Check if the items Container has Changed and trigger appropriate
@@ -2041,6 +3112,8 @@
 
 		//Post events to containers
-		for (var i = this.containers.length - 1; i >= 0; i--){
-			if(!noPropagation) delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
+		for (i = this.containers.length - 1; i >= 0; i--){
+			if(!noPropagation) {
+				delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
+			}
 			if(this.containers[i].containerCache.over) {
 				delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
@@ -2050,7 +3123,14 @@
 
 		//Do what was originally in plugins
-		if(this._storedCursor) $('body').css("cursor", this._storedCursor); //Reset cursor
-		if(this._storedOpacity) this.helper.css("opacity", this._storedOpacity); //Reset opacity
-		if(this._storedZIndex) this.helper.css("zIndex", this._storedZIndex == 'auto' ? '' : this._storedZIndex); //Reset z-index
+		if ( this.storedCursor ) {
+			this.document.find( "body" ).css( "cursor", this.storedCursor );
+			this.storedStylesheet.remove();
+		}
+		if(this._storedOpacity) {
+			this.helper.css("opacity", this._storedOpacity);
+		}
+		if(this._storedZIndex) {
+			this.helper.css("zIndex", this._storedZIndex === "auto" ? "" : this._storedZIndex);
+		}
 
 		this.dragging = false;
@@ -2058,5 +3138,7 @@
 			if(!noPropagation) {
 				this._trigger("beforeStop", event, this._uiHash());
-				for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
+				for (i=0; i < delayedTriggers.length; i++) {
+					delayedTriggers[i].call(this, event);
+				} //Trigger all delayed events
 				this._trigger("stop", event, this._uiHash());
 			}
@@ -2066,13 +3148,20 @@
 		}
 
-		if(!noPropagation) this._trigger("beforeStop", event, this._uiHash());
+		if(!noPropagation) {
+			this._trigger("beforeStop", event, this._uiHash());
+		}
 
 		//$(this.placeholder[0]).remove(); would have been the jQuery way - unfortunately, it unbinds ALL events from the original node!
 		this.placeholder[0].parentNode.removeChild(this.placeholder[0]);
 
-		if(this.helper[0] != this.currentItem[0]) this.helper.remove(); this.helper = null;
+		if(this.helper[0] !== this.currentItem[0]) {
+			this.helper.remove();
+		}
+		this.helper = null;
 
 		if(!noPropagation) {
-			for (var i=0; i < delayedTriggers.length; i++) { delayedTriggers[i].call(this, event); }; //Trigger all delayed events
+			for (i=0; i < delayedTriggers.length; i++) {
+				delayedTriggers[i].call(this, event);
+			} //Trigger all delayed events
 			this._trigger("stop", event, this._uiHash());
 		}
@@ -2117,5 +3206,5 @@
 
 $.widget( "ui.accordion", {
-	version: "1.9.2",
+	version: "1.10.3",
 	options: {
 		active: 0,
@@ -2136,19 +3225,9 @@
 
 	_create: function() {
-		var accordionId = this.accordionId = "ui-accordion-" +
-				(this.element.attr( "id" ) || ++uid),
-			options = this.options;
-
+		var options = this.options;
 		this.prevShow = this.prevHide = $();
-		this.element.addClass( "ui-accordion ui-widget ui-helper-reset" );
-
-		this.headers = this.element.find( options.header )
-			.addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" );
-		this._hoverable( this.headers );
-		this._focusable( this.headers );
-
-		this.headers.next()
-			.addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
-			.hide();
+		this.element.addClass( "ui-accordion ui-widget ui-helper-reset" )
+			// ARIA
+			.attr( "role", "tablist" );
 
 		// don't allow collapsible: false and active: false / null
@@ -2156,73 +3235,11 @@
 			options.active = 0;
 		}
+
+		this._processPanels();
 		// handle negative values
 		if ( options.active < 0 ) {
 			options.active += this.headers.length;
 		}
-		this.active = this._findActive( options.active )
-			.addClass( "ui-accordion-header-active ui-state-active" )
-			.toggleClass( "ui-corner-all ui-corner-top" );
-		this.active.next()
-			.addClass( "ui-accordion-content-active" )
-			.show();
-
-		this._createIcons();
-		this.refresh();
-
-		// ARIA
-		this.element.attr( "role", "tablist" );
-
-		this.headers
-			.attr( "role", "tab" )
-			.each(function( i ) {
-				var header = $( this ),
-					headerId = header.attr( "id" ),
-					panel = header.next(),
-					panelId = panel.attr( "id" );
-				if ( !headerId ) {
-					headerId = accordionId + "-header-" + i;
-					header.attr( "id", headerId );
-				}
-				if ( !panelId ) {
-					panelId = accordionId + "-panel-" + i;
-					panel.attr( "id", panelId );
-				}
-				header.attr( "aria-controls", panelId );
-				panel.attr( "aria-labelledby", headerId );
-			})
-			.next()
-				.attr( "role", "tabpanel" );
-
-		this.headers
-			.not( this.active )
-			.attr({
-				"aria-selected": "false",
-				tabIndex: -1
-			})
-			.next()
-				.attr({
-					"aria-expanded": "false",
-					"aria-hidden": "true"
-				})
-				.hide();
-
-		// make sure at least one header is in the tab order
-		if ( !this.active.length ) {
-			this.headers.eq( 0 ).attr( "tabIndex", 0 );
-		} else {
-			this.active.attr({
-				"aria-selected": "true",
-				tabIndex: 0
-			})
-			.next()
-				.attr({
-					"aria-expanded": "true",
-					"aria-hidden": "false"
-				});
-		}
-
-		this._on( this.headers, { keydown: "_keydown" });
-		this._on( this.headers.next(), { keydown: "_panelKeyDown" });
-		this._setupEvents( options.event );
+		this._refresh();
 	},
 
@@ -2230,4 +3247,5 @@
 		return {
 			header: this.active,
+			panel: !this.active.length ? $() : this.active.next(),
 			content: !this.active.length ? $() : this.active.next()
 		};
@@ -2331,4 +3349,5 @@
 
 	_keydown: function( event ) {
+		/*jshint maxcomplexity:15*/
 		if ( event.altKey || event.ctrlKey ) {
 			return;
@@ -2376,18 +3395,114 @@
 
 	refresh: function() {
-		var maxHeight, overflow,
-			heightStyle = this.options.heightStyle,
-			parent = this.element.parent();
-
+		var options = this.options;
+		this._processPanels();
+
+		// was collapsed or no panel
+		if ( ( options.active === false && options.collapsible === true ) || !this.headers.length ) {
+			options.active = false;
+			this.active = $();
+		// active false only when collapsible is true
+		} else if ( options.active === false ) {
+			this._activate( 0 );
+		// was active, but active panel is gone
+		} else if ( this.active.length && !$.contains( this.element[ 0 ], this.active[ 0 ] ) ) {
+			// all remaining panel are disabled
+			if ( this.headers.length === this.headers.find(".ui-state-disabled").length ) {
+				options.active = false;
+				this.active = $();
+			// activate previous panel
+			} else {
+				this._activate( Math.max( 0, options.active - 1 ) );
+			}
+		// was active, active panel still exists
+		} else {
+			// make sure active index is correct
+			options.active = this.headers.index( this.active );
+		}
+
+		this._destroyIcons();
+
+		this._refresh();
+	},
+
+	_processPanels: function() {
+		this.headers = this.element.find( this.options.header )
+			.addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" );
+
+		this.headers.next()
+			.addClass( "ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom" )
+			.filter(":not(.ui-accordion-content-active)")
+			.hide();
+	},
+
+	_refresh: function() {
+		var maxHeight,
+			options = this.options,
+			heightStyle = options.heightStyle,
+			parent = this.element.parent(),
+			accordionId = this.accordionId = "ui-accordion-" +
+				(this.element.attr( "id" ) || ++uid);
+
+		this.active = this._findActive( options.active )
+			.addClass( "ui-accordion-header-active ui-state-active ui-corner-top" )
+			.removeClass( "ui-corner-all" );
+		this.active.next()
+			.addClass( "ui-accordion-content-active" )
+			.show();
+
+		this.headers
+			.attr( "role", "tab" )
+			.each(function( i ) {
+				var header = $( this ),
+					headerId = header.attr( "id" ),
+					panel = header.next(),
+					panelId = panel.attr( "id" );
+				if ( !headerId ) {
+					headerId = accordionId + "-header-" + i;
+					header.attr( "id", headerId );
+				}
+				if ( !panelId ) {
+					panelId = accordionId + "-panel-" + i;
+					panel.attr( "id", panelId );
+				}
+				header.attr( "aria-controls", panelId );
+				panel.attr( "aria-labelledby", headerId );
+			})
+			.next()
+				.attr( "role", "tabpanel" );
+
+		this.headers
+			.not( this.active )
+			.attr({
+				"aria-selected": "false",
+				tabIndex: -1
+			})
+			.next()
+				.attr({
+					"aria-expanded": "false",
+					"aria-hidden": "true"
+				})
+				.hide();
+
+		// make sure at least one header is in the tab order
+		if ( !this.active.length ) {
+			this.headers.eq( 0 ).attr( "tabIndex", 0 );
+		} else {
+			this.active.attr({
+				"aria-selected": "true",
+				tabIndex: 0
+			})
+			.next()
+				.attr({
+					"aria-expanded": "true",
+					"aria-hidden": "false"
+				});
+		}
+
+		this._createIcons();
+
+		this._setupEvents( options.event );
 
 		if ( heightStyle === "fill" ) {
-			// IE 6 treats height like minHeight, so we need to turn off overflow
-			// in order to get a reliable height
-			// we use the minHeight support test because we assume that only
-			// browsers that don't support minHeight will treat height as minHeight
-			if ( !$.support.minHeight ) {
-				overflow = parent.css( "overflow" );
-				parent.css( "overflow", "hidden");
-			}
 			maxHeight = parent.height();
 			this.element.siblings( ":visible" ).each(function() {
@@ -2400,7 +3515,4 @@
 				maxHeight -= elem.outerHeight( true );
 			});
-			if ( overflow ) {
-				parent.css( "overflow", overflow );
-			}
 
 			this.headers.each(function() {
@@ -2447,12 +3559,18 @@
 
 	_setupEvents: function( event ) {
-		var events = {};
-		if ( !event ) {
-			return;
-		}
-		$.each( event.split(" "), function( index, eventName ) {
-			events[ eventName ] = "_eventHandler";
-		});
+		var events = {
+			keydown: "_keydown"
+		};
+		if ( event ) {
+			$.each( event.split(" "), function( index, eventName ) {
+				events[ eventName ] = "_eventHandler";
+			});
+		}
+
+		this._off( this.headers.add( this.headers.next() ) );
 		this._on( this.headers, events );
+		this._on( this.headers.next(), { keydown: "_panelKeyDown" });
+		this._hoverable( this.headers );
+		this._focusable( this.headers );
 	},
 
@@ -2633,191 +3751,3 @@
 });
 
-
-
-// DEPRECATED
-if ( $.uiBackCompat !== false ) {
-	// navigation options
-	(function( $, prototype ) {
-		$.extend( prototype.options, {
-			navigation: false,
-			navigationFilter: function() {
-				return this.href.toLowerCase() === location.href.toLowerCase();
-			}
-		});
-
-		var _create = prototype._create;
-		prototype._create = function() {
-			if ( this.options.navigation ) {
-				var that = this,
-					headers = this.element.find( this.options.header ),
-					content = headers.next(),
-					current = headers.add( content )
-						.find( "a" )
-						.filter( this.options.navigationFilter )
-						[ 0 ];
-				if ( current ) {
-					headers.add( content ).each( function( index ) {
-						if ( $.contains( this, current ) ) {
-							that.options.active = Math.floor( index / 2 );
-							return false;
-						}
-					});
-				}
-			}
-			_create.call( this );
-		};
-	}( jQuery, jQuery.ui.accordion.prototype ) );
-
-	// height options
-	(function( $, prototype ) {
-		$.extend( prototype.options, {
-			heightStyle: null, // remove default so we fall back to old values
-			autoHeight: true, // use heightStyle: "auto"
-			clearStyle: false, // use heightStyle: "content"
-			fillSpace: false // use heightStyle: "fill"
-		});
-
-		var _create = prototype._create,
-			_setOption = prototype._setOption;
-
-		$.extend( prototype, {
-			_create: function() {
-				this.options.heightStyle = this.options.heightStyle ||
-					this._mergeHeightStyle();
-
-				_create.call( this );
-			},
-
-			_setOption: function( key ) {
-				if ( key === "autoHeight" || key === "clearStyle" || key === "fillSpace" ) {
-					this.options.heightStyle = this._mergeHeightStyle();
-				}
-				_setOption.apply( this, arguments );
-			},
-
-			_mergeHeightStyle: function() {
-				var options = this.options;
-
-				if ( options.fillSpace ) {
-					return "fill";
-				}
-
-				if ( options.clearStyle ) {
-					return "content";
-				}
-
-				if ( options.autoHeight ) {
-					return "auto";
-				}
-			}
-		});
-	}( jQuery, jQuery.ui.accordion.prototype ) );
-
-	// icon options
-	(function( $, prototype ) {
-		$.extend( prototype.options.icons, {
-			activeHeader: null, // remove default so we fall back to old values
-			headerSelected: "ui-icon-triangle-1-s"
-		});
-
-		var _createIcons = prototype._createIcons;
-		prototype._createIcons = function() {
-			if ( this.options.icons ) {
-				this.options.icons.activeHeader = this.options.icons.activeHeader ||
-					this.options.icons.headerSelected;
-			}
-			_createIcons.call( this );
-		};
-	}( jQuery, jQuery.ui.accordion.prototype ) );
-
-	// expanded active option, activate method
-	(function( $, prototype ) {
-		prototype.activate = prototype._activate;
-
-		var _findActive = prototype._findActive;
-		prototype._findActive = function( index ) {
-			if ( index === -1 ) {
-				index = false;
-			}
-			if ( index && typeof index !== "number" ) {
-				index = this.headers.index( this.headers.filter( index ) );
-				if ( index === -1 ) {
-					index = false;
-				}
-			}
-			return _findActive.call( this, index );
-		};
-	}( jQuery, jQuery.ui.accordion.prototype ) );
-
-	// resize method
-	jQuery.ui.accordion.prototype.resize = jQuery.ui.accordion.prototype.refresh;
-
-	// change events
-	(function( $, prototype ) {
-		$.extend( prototype.options, {
-			change: null,
-			changestart: null
-		});
-
-		var _trigger = prototype._trigger;
-		prototype._trigger = function( type, event, data ) {
-			var ret = _trigger.apply( this, arguments );
-			if ( !ret ) {
-				return false;
-			}
-
-			if ( type === "beforeActivate" ) {
-				ret = _trigger.call( this, "changestart", event, {
-					oldHeader: data.oldHeader,
-					oldContent: data.oldPanel,
-					newHeader: data.newHeader,
-					newContent: data.newPanel
-				});
-			} else if ( type === "activate" ) {
-				ret = _trigger.call( this, "change", event, {
-					oldHeader: data.oldHeader,
-					oldContent: data.oldPanel,
-					newHeader: data.newHeader,
-					newContent: data.newPanel
-				});
-			}
-			return ret;
-		};
-	}( jQuery, jQuery.ui.accordion.prototype ) );
-
-	// animated option
-	// NOTE: this only provides support for "slide", "bounceslide", and easings
-	// not the full $.ui.accordion.animations API
-	(function( $, prototype ) {
-		$.extend( prototype.options, {
-			animate: null,
-			animated: "slide"
-		});
-
-		var _create = prototype._create;
-		prototype._create = function() {
-			var options = this.options;
-			if ( options.animate === null ) {
-				if ( !options.animated ) {
-					options.animate = false;
-				} else if ( options.animated === "slide" ) {
-					options.animate = 300;
-				} else if ( options.animated === "bounceslide" ) {
-					options.animate = {
-						duration: 200,
-						down: {
-							easing: "easeOutBounce",
-							duration: 1000
-						}
-					};
-				} else {
-					options.animate = options.animated;
-				}
-			}
-
-			_create.call( this );
-		};
-	}( jQuery, jQuery.ui.accordion.prototype ) );
-}
-
 })( jQuery );
Index: admin/js/jquery/jquery.mjs.nestedSortable.js
===================================================================
--- admin/js/jquery/jquery.mjs.nestedSortable.js	(revision 1532)
+++ admin/js/jquery/jquery.mjs.nestedSortable.js	(revision 1532)
@@ -0,0 +1,429 @@
+/*
+ * jQuery UI Nested Sortable
+ * v 1.3.5 / 21 jun 2012
+ * http://mjsarfatti.com/code/nestedSortable
+ *
+ * Depends on:
+ *	 jquery.ui.sortable.js 1.8+
+ *
+ * Copyright (c) 2010-2012 Manuele J Sarfatti
+ * Licensed under the MIT License
+ * http://www.opensource.org/licenses/mit-license.php
+ */
+
+(function($) {
+
+	$.widget("mjs.nestedSortable", $.extend({}, $.ui.sortable.prototype, {
+
+		options: {
+			tabSize: 20,
+			disableNesting: 'mjs-nestedSortable-no-nesting',
+			errorClass: 'mjs-nestedSortable-error',
+			doNotClear: false,
+			listType: 'ol',
+			maxLevels: 0,
+			protectRoot: false,
+			rootID: null,
+			rtl: false,
+			isAllowed: function(item, parent) { return true; }
+		},
+
+		_create: function() {
+			this.element.data('sortable', this.element.data('nestedSortable'));
+
+			if (!this.element.is(this.options.listType))
+				throw new Error('nestedSortable: Please check the listType option is set to your actual list type');
+
+			return $.ui.sortable.prototype._create.apply(this, arguments);
+		},
+
+		destroy: function() {
+			this.element
+				.removeData("nestedSortable")
+				.unbind(".nestedSortable");
+			return $.ui.sortable.prototype.destroy.apply(this, arguments);
+		},
+
+		_mouseDrag: function(event) {
+
+			//Compute the helpers position
+			this.position = this._generatePosition(event);
+			this.positionAbs = this._convertPositionTo("absolute");
+
+			if (!this.lastPositionAbs) {
+				this.lastPositionAbs = this.positionAbs;
+			}
+
+			var o = this.options;
+
+			//Do scrolling
+			if(this.options.scroll) {
+				var scrolled = false;
+				if(this.scrollParent[0] != document && this.scrollParent[0].tagName != 'HTML') {
+
+					if((this.overflowOffset.top + this.scrollParent[0].offsetHeight) - event.pageY < o.scrollSensitivity)
+						this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop + o.scrollSpeed;
+					else if(event.pageY - this.overflowOffset.top < o.scrollSensitivity)
+						this.scrollParent[0].scrollTop = scrolled = this.scrollParent[0].scrollTop - o.scrollSpeed;
+
+					if((this.overflowOffset.left + this.scrollParent[0].offsetWidth) - event.pageX < o.scrollSensitivity)
+						this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft + o.scrollSpeed;
+					else if(event.pageX - this.overflowOffset.left < o.scrollSensitivity)
+						this.scrollParent[0].scrollLeft = scrolled = this.scrollParent[0].scrollLeft - o.scrollSpeed;
+
+				} else {
+
+					if(event.pageY - $(document).scrollTop() < o.scrollSensitivity)
+						scrolled = $(document).scrollTop($(document).scrollTop() - o.scrollSpeed);
+					else if($(window).height() - (event.pageY - $(document).scrollTop()) < o.scrollSensitivity)
+						scrolled = $(document).scrollTop($(document).scrollTop() + o.scrollSpeed);
+
+					if(event.pageX - $(document).scrollLeft() < o.scrollSensitivity)
+						scrolled = $(document).scrollLeft($(document).scrollLeft() - o.scrollSpeed);
+					else if($(window).width() - (event.pageX - $(document).scrollLeft()) < o.scrollSensitivity)
+						scrolled = $(document).scrollLeft($(document).scrollLeft() + o.scrollSpeed);
+
+				}
+
+				if(scrolled !== false && $.ui.ddmanager && !o.dropBehaviour)
+					$.ui.ddmanager.prepareOffsets(this, event);
+			}
+
+			//Regenerate the absolute position used for position checks
+			this.positionAbs = this._convertPositionTo("absolute");
+
+      // Find the top offset before rearrangement,
+      var previousTopOffset = this.placeholder.offset().top;
+
+			//Set the helper position
+			if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px';
+			if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px';
+
+			//Rearrange
+			for (var i = this.items.length - 1; i >= 0; i--) {
+
+				//Cache variables and intersection, continue if no intersection
+				var item = this.items[i], itemElement = item.item[0], intersection = this._intersectsWithPointer(item);
+				if (!intersection) continue;
+
+				if(itemElement != this.currentItem[0] //cannot intersect with itself
+					&&	this.placeholder[intersection == 1 ? "next" : "prev"]()[0] != itemElement //no useless actions that have been done before
+					&&	!$.contains(this.placeholder[0], itemElement) //no action if the item moved is the parent of the item checked
+					&& (this.options.type == 'semi-dynamic' ? !$.contains(this.element[0], itemElement) : true)
+					//&& itemElement.parentNode == this.placeholder[0].parentNode // only rearrange items within the same container
+				) {
+
+					$(itemElement).mouseenter();
+
+					this.direction = intersection == 1 ? "down" : "up";
+
+					if (this.options.tolerance == "pointer" || this._intersectsWithSides(item)) {
+						$(itemElement).mouseleave();
+						this._rearrange(event, item);
+					} else {
+						break;
+					}
+
+					// Clear emtpy ul's/ol's
+					this._clearEmpty(itemElement);
+
+					this._trigger("change", event, this._uiHash());
+					break;
+				}
+			}
+
+			var parentItem = (this.placeholder[0].parentNode.parentNode &&
+							 $(this.placeholder[0].parentNode.parentNode).closest('.ui-sortable').length)
+				       			? $(this.placeholder[0].parentNode.parentNode)
+				       			: null,
+			    level = this._getLevel(this.placeholder),
+			    childLevels = this._getChildLevels(this.helper);
+
+      // To find the previous sibling in the list, keep backtracking until we hit a valid list item.
+			var previousItem = this.placeholder[0].previousSibling ? $(this.placeholder[0].previousSibling) : null;
+			if (previousItem != null) {
+				while (previousItem[0].nodeName.toLowerCase() != 'li' || previousItem[0] == this.currentItem[0] || previousItem[0] == this.helper[0]) {
+					if (previousItem[0].previousSibling) {
+						previousItem = $(previousItem[0].previousSibling);
+					} else {
+						previousItem = null;
+						break;
+					}
+				}
+			}
+
+      // To find the next sibling in the list, keep stepping forward until we hit a valid list item.
+      var nextItem = this.placeholder[0].nextSibling ? $(this.placeholder[0].nextSibling) : null;
+      if (nextItem != null) {
+        while (nextItem[0].nodeName.toLowerCase() != 'li' || nextItem[0] == this.currentItem[0] || nextItem[0] == this.helper[0]) {
+          if (nextItem[0].nextSibling) {
+            nextItem = $(nextItem[0].nextSibling);
+          } else {
+            nextItem = null;
+            break;
+          }
+        }
+      }
+
+			var newList = document.createElement(o.listType);
+
+			this.beyondMaxLevels = 0;
+			
+			// If the item is moved to the left, send it to its parent's level unless there are siblings below it.
+			if (parentItem != null && nextItem == null &&
+					(o.rtl && (this.positionAbs.left + this.helper.outerWidth() > parentItem.offset().left + parentItem.outerWidth()) ||
+					!o.rtl && (this.positionAbs.left < parentItem.offset().left))) {
+				parentItem.after(this.placeholder[0]);
+				this._clearEmpty(parentItem[0]);
+				this._trigger("change", event, this._uiHash());
+			}
+			// If the item is below a sibling and is moved to the right, make it a child of that sibling.
+			else if (previousItem != null &&
+						(o.rtl && (this.positionAbs.left + this.helper.outerWidth() < previousItem.offset().left + previousItem.outerWidth() - o.tabSize) ||
+						!o.rtl && (this.positionAbs.left > previousItem.offset().left + o.tabSize))) {
+				this._isAllowed(previousItem, level, level+childLevels+1);
+				if (!previousItem.children(o.listType).length) {
+					previousItem[0].appendChild(newList);
+				}
+        // If this item is being moved from the top, add it to the top of the list.
+        if (previousTopOffset && (previousTopOffset <= previousItem.offset().top)) {
+          previousItem.children(o.listType).prepend(this.placeholder);
+        }
+        // Otherwise, add it to the bottom of the list.
+        else {
+				  previousItem.children(o.listType)[0].appendChild(this.placeholder[0]);
+        }
+				this._trigger("change", event, this._uiHash());
+			}
+			else {
+				this._isAllowed(parentItem, level, level+childLevels);
+			}
+
+			//Post events to containers
+			this._contactContainers(event);
+
+			//Interconnect with droppables
+			if($.ui.ddmanager) $.ui.ddmanager.drag(this, event);
+
+			//Call callbacks
+			this._trigger('sort', event, this._uiHash());
+
+			this.lastPositionAbs = this.positionAbs;
+			return false;
+
+		},
+
+		_mouseStop: function(event, noPropagation) {
+
+			// If the item is in a position not allowed, send it back
+			if (this.beyondMaxLevels) {
+
+				this.placeholder.removeClass(this.options.errorClass);
+
+				if (this.domPosition.prev) {
+					$(this.domPosition.prev).after(this.placeholder);
+				} else {
+					$(this.domPosition.parent).prepend(this.placeholder);
+				}
+
+				this._trigger("revert", event, this._uiHash());
+
+			}
+
+			// Clean last empty ul/ol
+			for (var i = this.items.length - 1; i >= 0; i--) {
+				var item = this.items[i].item[0];
+				this._clearEmpty(item);
+			}
+
+			$.ui.sortable.prototype._mouseStop.apply(this, arguments);
+
+		},
+
+		serialize: function(options) {
+
+			var o = $.extend({}, this.options, options),
+				items = this._getItemsAsjQuery(o && o.connected),
+			    str = [];
+
+			$(items).each(function() {
+				var res = ($(o.item || this).attr(o.attribute || 'id') || '')
+						.match(o.expression || (/(.+)[-=_](.+)/)),
+				    pid = ($(o.item || this).parent(o.listType)
+						.parent(o.items)
+						.attr(o.attribute || 'id') || '')
+						.match(o.expression || (/(.+)[-=_](.+)/));
+
+				if (res) {
+					str.push(((o.key || res[1]) + '[' + (o.key && o.expression ? res[1] : res[2]) + ']')
+						+ '='
+						+ (pid ? (o.key && o.expression ? pid[1] : pid[2]) : o.rootID));
+				}
+			});
+
+			if(!str.length && o.key) {
+				str.push(o.key + '=');
+			}
+
+			return str.join('&');
+
+		},
+
+		toHierarchy: function(options) {
+
+			var o = $.extend({}, this.options, options),
+				sDepth = o.startDepthCount || 0,
+			    ret = [];
+
+			$(this.element).children(o.items).each(function () {
+				var level = _recursiveItems(this);
+				ret.push(level);
+			});
+
+			return ret;
+
+			function _recursiveItems(item) {
+				var id = ($(item).attr(o.attribute || 'id') || '').match(o.expression || (/(.+)[-=_](.+)/));
+				if (id) {
+					var currentItem = {"id" : id[2]};
+					if ($(item).children(o.listType).children(o.items).length > 0) {
+						currentItem.children = [];
+						$(item).children(o.listType).children(o.items).each(function() {
+							var level = _recursiveItems(this);
+							currentItem.children.push(level);
+						});
+					}
+					return currentItem;
+				}
+			}
+		},
+
+		toArray: function(options) {
+
+			var o = $.extend({}, this.options, options),
+				sDepth = o.startDepthCount || 0,
+			    ret = [],
+			    left = 2;
+
+			ret.push({
+				"item_id": o.rootID,
+				"parent_id": 'none',
+				"depth": sDepth,
+				"left": '1',
+				"right": ($(o.items, this.element).length + 1) * 2
+			});
+
+			$(this.element).children(o.items).each(function () {
+				left = _recursiveArray(this, sDepth + 1, left);
+			});
+
+			ret = ret.sort(function(a,b){ return (a.left - b.left); });
+
+			return ret;
+
+			function _recursiveArray(item, depth, left) {
+
+				var right = left + 1,
+				    id,
+				    pid;
+
+				if ($(item).children(o.listType).children(o.items).length > 0) {
+					depth ++;
+					$(item).children(o.listType).children(o.items).each(function () {
+						right = _recursiveArray($(this), depth, right);
+					});
+					depth --;
+				}
+
+				id = ($(item).attr(o.attribute || 'id')).match(o.expression || (/(.+)[-=_](.+)/));
+
+				if (depth === sDepth + 1) {
+					pid = o.rootID;
+				} else {
+					var parentItem = ($(item).parent(o.listType)
+											 .parent(o.items)
+											 .attr(o.attribute || 'id'))
+											 .match(o.expression || (/(.+)[-=_](.+)/));
+					pid = parentItem[2];
+				}
+
+				if (id) {
+						ret.push({"item_id": id[2], "parent_id": pid, "depth": depth, "left": left, "right": right});
+				}
+
+				left = right + 1;
+				return left;
+			}
+
+		},
+
+		_clearEmpty: function(item) {
+
+			var emptyList = $(item).children(this.options.listType);
+			if (emptyList.length && !emptyList.children().length && !this.options.doNotClear) {
+				emptyList.remove();
+			}
+
+		},
+
+		_getLevel: function(item) {
+
+			var level = 1;
+
+			if (this.options.listType) {
+				var list = item.closest(this.options.listType);
+				while (list && list.length > 0 && 
+                    	!list.is('.ui-sortable')) {
+					level++;
+					list = list.parent().closest(this.options.listType);
+				}
+			}
+
+			return level;
+		},
+
+		_getChildLevels: function(parent, depth) {
+			var self = this,
+			    o = this.options,
+			    result = 0;
+			depth = depth || 0;
+
+			$(parent).children(o.listType).children(o.items).each(function (index, child) {
+					result = Math.max(self._getChildLevels(child, depth + 1), result);
+			});
+
+			return depth ? result + 1 : result;
+		},
+
+		_isAllowed: function(parentItem, level, levels) {
+			var o = this.options,
+				isRoot = $(this.domPosition.parent).hasClass('ui-sortable') ? true : false,
+				maxLevels = this.placeholder.closest('.ui-sortable').nestedSortable('option', 'maxLevels'); // this takes into account the maxLevels set to the recipient list
+
+			// Is the root protected?
+			// Are we trying to nest under a no-nest?
+			// Are we nesting too deep?
+			if (!o.isAllowed(this.currentItem, parentItem) ||
+				parentItem && parentItem.hasClass(o.disableNesting) ||
+				o.protectRoot && (parentItem == null && !isRoot || isRoot && level > 1)) {
+					this.placeholder.addClass(o.errorClass);
+					if (maxLevels < levels && maxLevels != 0) {
+						this.beyondMaxLevels = levels - maxLevels;
+					} else {
+						this.beyondMaxLevels = 1;
+					}
+			} else {
+				if (maxLevels < levels && maxLevels != 0) {
+					this.placeholder.addClass(o.errorClass);
+					this.beyondMaxLevels = levels - maxLevels;
+				} else {
+					this.placeholder.removeClass(o.errorClass);
+					this.beyondMaxLevels = 0;
+				}
+			}
+		}
+
+	}));
+
+	$.mjs.nestedSortable.prototype.options = $.extend({}, $.ui.sortable.prototype.options, $.mjs.nestedSortable.prototype.options);
+})(jQuery);
Index: admin/js/jsToolBar/jsToolBar.wysiwyg.js
===================================================================
--- admin/js/jsToolBar/jsToolBar.wysiwyg.js	(revision 925)
+++ admin/js/jsToolBar/jsToolBar.wysiwyg.js	(revision 1626)
@@ -209,5 +209,5 @@
 		
 		This.setSwitcher();
-		setTimeout(function(){This.focusEditor();},1);
+		try { This.iwin.document.designMode = 'on'; } catch (e) {}; // Firefox needs this
 		
 		return true;
Index: admin/js/jsUpload/jquery.fileupload-process.js
===================================================================
--- admin/js/jsUpload/jquery.fileupload-process.js	(revision 1144)
+++ admin/js/jsUpload/jquery.fileupload-process.js	(revision 1320)
@@ -1,4 +1,4 @@
 /*
- * jQuery File Upload Processing Plugin 1.1
+ * jQuery File Upload Processing Plugin 1.2.2
  * https://github.com/blueimp/jQuery-File-Upload
  *
@@ -99,12 +99,18 @@
             var processQueue = [];
             $.each(options.processQueue, function () {
-                var settings = {};
+                var settings = {},
+                    action = this.action,
+                    prefix = this.prefix === true ? action : this.prefix;
                 $.each(this, function (key, value) {
                     if ($.type(value) === 'string' &&
                             value.charAt(0) === '@') {
-                        settings[key] = options[value.slice(1)];
+                        settings[key] = options[
+                            value.slice(1) || (prefix ? prefix +
+                                key.charAt(0).toUpperCase() + key.slice(1) : key)
+                        ];
                     } else {
                         settings[key] = value;
                     }
+
                 });
                 processQueue.push(settings);
@@ -128,5 +134,5 @@
                     this._trigger('processstart');
                 }
-                $.each(data.files, function (index, file) {
+                $.each(data.files, function (index) {
                     var opts = index ? $.extend({}, options) : options,
                         func = function () {
Index: admin/js/jsUpload/jquery.fileupload-ui.js
===================================================================
--- admin/js/jsUpload/jquery.fileupload-ui.js	(revision 1206)
+++ admin/js/jsUpload/jquery.fileupload-ui.js	(revision 1320)
@@ -1,4 +1,4 @@
 /*
- * jQuery File Upload User Interface Plugin 8.2.1
+ * jQuery File Upload User Interface Plugin 8.7.1
  * https://github.com/blueimp/jQuery-File-Upload
  *
@@ -20,5 +20,7 @@
             'jquery',
             'tmpl',
-            './jquery.fileupload-resize',
+            './jquery.fileupload-image',
+            './jquery.fileupload-audio',
+            './jquery.fileupload-video',
             './jquery.fileupload-validate'
         ], factory);
@@ -104,19 +106,7 @@
                     );
                 });
-
-            /*
-             *  
-             *  Activation du bouton si un fichier trouvé
-             */
-                var fileUploadButtonBar = that.element.find('.fileupload-buttonbar');
-                fileUploadButtonBar.find('.start').prop('disabled', false);
-                fileUploadButtonBar.find('.start').removeClass('disabled');
-             /*
-             *
-             */
             },
             // Callback for the start of each file upload request:
             send: function (e, data) {
-                $(this).find('.start').hide();
                 var that = $(this).data('blueimp-fileupload') ||
                         $(this).data('fileupload');
@@ -140,5 +130,4 @@
             // Callback for successful uploads:
             done: function (e, data) {
-
                 var that = $(this).data('blueimp-fileupload') ||
                         $(this).data('fileupload'),
@@ -151,6 +140,6 @@
                     data.context.each(function (index) {
                         var file = files[index] ||
-                                {error: 'Empty file upload result'},
-                            deferred = that._addFinishedDeferreds();
+                                {error: 'Empty file upload result'};
+                        deferred = that._addFinishedDeferreds();
                         that._transition($(this)).done(
                             function () {
@@ -171,6 +160,7 @@
                     });
                 } else {
-                    template = that._renderDownload(files)
-                        .appendTo(that.options.filesContainer);
+                    template = that._renderDownload(files)[
+                        that.options.prependFiles ? 'prependTo' : 'appendTo'
+                    ](that.options.filesContainer);
                     that._forceReflow(template);
                     deferred = that._addFinishedDeferreds();
@@ -227,6 +217,7 @@
                     });
                 } else if (data.errorThrown !== 'abort') {
-                    data.context = that._renderUpload(data.files)
-                        .appendTo(that.options.filesContainer)
+                    data.context = that._renderUpload(data.files)[
+                        that.options.prependFiles ? 'prependTo' : 'appendTo'
+                    ](that.options.filesContainer)
                         .data('data', data);
                     that._forceReflow(data.context);
@@ -281,12 +272,9 @@
             // Callback for uploads start, equivalent to the global ajaxStart event:
             start: function (e) {
-                $(this).find('.start').hide();
                 var that = $(this).data('blueimp-fileupload') ||
-                $(this).data('fileupload');
+                        $(this).data('fileupload');
                 that._resetFinishedDeferreds();
                 that._transition($(this).find('.fileupload-progress')).done(
-
                     function () {
-
                         that._trigger('started', e);
                     }
@@ -295,5 +283,4 @@
             // Callback for uploads stop, equivalent to the global ajaxStop event:
             stop: function (e) {
-                $(this).find('.start').show();
                 var that = $(this).data('blueimp-fileupload') ||
                         $(this).data('fileupload'),
@@ -312,17 +299,4 @@
                     }
                 );
-            /*
-             *  Recherche des fichers restants à uploader
-             *  Désactivation du bouton si plus rien
-             */
-             var filesList = that.options.filesContainer;
-             if(filesList.find('.start').size() == 0) {
-                var fileUploadButtonBar = that.element.find('.fileupload-buttonbar');
-                fileUploadButtonBar.find('.start').prop('disabled', true);
-                fileUploadButtonBar.find('.start').addClass('disabled');
-             }
-            /*
-             *
-             */
             },
             processstart: function () {
@@ -335,7 +309,6 @@
             destroy: function (e, data) {
                 var that = $(this).data('blueimp-fileupload') ||
-                        $(this).data('fileupload');
-                if (data.url) {
-                    $.ajax(data).done(function () {
+                        $(this).data('fileupload'),
+                    removeNode = function () {
                         that._transition(data.context).done(
                             function () {
@@ -344,5 +317,9 @@
                             }
                         );
-                    });
+                    };
+                if (data.url) {
+                    $.ajax(data).done(removeNode);
+                } else {
+                    removeNode();
                 }
             }
@@ -637,4 +614,7 @@
             this._super();
             this._resetFinishedDeferreds();
+            if (!$.support.fileInput) {
+                this._disableFileInputButton();
+            }
         },
 
Index: admin/js/jsUpload/jquery.fileupload.js
===================================================================
--- admin/js/jsUpload/jquery.fileupload.js	(revision 1144)
+++ admin/js/jsUpload/jquery.fileupload.js	(revision 1320)
@@ -1,4 +1,4 @@
 /*
- * jQuery File Upload Plugin 5.31.1
+ * jQuery File Upload Plugin 5.32.2
  * https://github.com/blueimp/jQuery-File-Upload
  *
@@ -11,5 +11,5 @@
 
 /*jslint nomen: true, unparam: true, regexp: true */
-/*global define, window, document, File, Blob, FormData, location */
+/*global define, window, document, location, File, Blob, FormData */
 
 (function (factory) {
@@ -28,4 +28,16 @@
     'use strict';
 
+    // Detect file input support, based on
+    // http://viljamis.com/blog/2012/file-upload-support-on-mobile/
+    $.support.fileInput = !(new RegExp(
+        // Handle devices which give false positives for the feature detection:
+        '(Android (1\\.[0156]|2\\.[01]))' +
+            '|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)' +
+            '|(w(eb)?OSBrowser)|(webOS)' +
+            '|(Kindle/(1\\.0|2\\.[05]|3\\.0))'
+    ).test(window.navigator.userAgent) ||
+        // Feature detection for all other devices:
+        $('<input type="file">').prop('disabled'));
+
     // The FileReader API is not actually used, but works as feature detection,
     // as e.g. Safari supports XHR file uploads via the FormData API,
@@ -33,4 +45,8 @@
     $.support.xhrFileUpload = !!(window.XMLHttpRequestUpload && window.FileReader);
     $.support.xhrFormDataFileUpload = !!window.FormData;
+
+    // Detect support for Blob slicing (required for chunked uploads):
+    $.support.blobSlice = window.Blob && (Blob.prototype.slice ||
+        Blob.prototype.webkitSlice || Blob.prototype.mozSlice);
 
     // The fileupload widget listens for change events on file input fields defined
@@ -145,11 +161,14 @@
             // widget (via file input selection, drag & drop, paste or add API call).
             // If the singleFileUploads option is enabled, this callback will be
-            // called once for each file in the selection for XHR file uplaods, else
+            // called once for each file in the selection for XHR file uploads, else
             // once for each file selection.
+            //
             // The upload starts when the submit method is invoked on the data parameter.
             // The data object contains a files property holding the added files
-            // and allows to override plugin options as well as define ajax settings.
+            // and allows you to override plugin options as well as define ajax settings.
+            //
             // Listeners for this callback can also be bound the following way:
             // .bind('fileuploadadd', func);
+            //
             // data.submit() returns a Promise object and allows to attach additional
             // handlers using jQuery's Deferred callbacks:
@@ -233,4 +252,9 @@
             'forceIframeTransport'
         ],
+
+        _blobSlice: $.support.blobSlice && function () {
+            var slice = this.slice || this.webkitSlice || this.mozSlice;
+            return slice.apply(this, arguments);
+        },
 
         _BitrateTimer: function () {
@@ -380,7 +404,9 @@
                 options.headers['Content-Range'] = options.contentRange;
             }
-            if (!multipart) {
+            if (!multipart || options.blob || !this._isInstanceOf('File', file)) {
                 options.headers['Content-Disposition'] = 'attachment; filename="' +
                     encodeURI(file.name) + '"';
+            }
+            if (!multipart) {
                 options.contentType = file.type;
                 options.data = options.blob || file;
@@ -415,6 +441,4 @@
                     }
                     if (options.blob) {
-                        options.headers['Content-Disposition'] = 'attachment; filename="' +
-                            encodeURI(file.name) + '"';
                         formData.append(paramName, options.blob, file.name);
                     } else {
@@ -440,4 +464,5 @@
 
         _initIframeSettings: function (options) {
+            var targetHost = $('<a></a>').prop('href', options.url).prop('host');
             // Setting the dataType to iframe enables the iframe transport:
             options.dataType = 'iframe ' + (options.dataType || '');
@@ -445,6 +470,5 @@
             options.formData = this._getFormData(options);
             // Add redirect url to form data on cross-domain uploads:
-            if (options.redirect && $('<a></a>').prop('href', options.url)
-                    .prop('host') !== location.host) {
+            if (options.redirect && targetHost && targetHost !== location.host) {
                 options.formData.push({
                     name: options.redirectParamName || 'redirect',
@@ -628,10 +652,11 @@
         // upload requests:
         _chunkedUpload: function (options, testOnly) {
+            options.uploadedBytes = options.uploadedBytes || 0;
             var that = this,
                 file = options.files[0],
                 fs = file.size,
-                ub = options.uploadedBytes = options.uploadedBytes || 0,
+                ub = options.uploadedBytes,
                 mcs = options.maxChunkSize || fs,
-                slice = file.slice || file.webkitSlice || file.mozSlice,
+                slice = this._blobSlice,
                 dfd = $.Deferred(),
                 promise = dfd.promise(),
@@ -851,5 +876,6 @@
                     pipe = slot.pipe(send);
                 } else {
-                    pipe = (this._sequence = this._sequence.pipe(send, send));
+                    this._sequence = this._sequence.pipe(send, send);
+                    pipe = this._sequence;
                 }
                 // Return the piped Promise object, enhanced with an abort method,
@@ -1101,7 +1127,7 @@
 
         _onDrop: function (e) {
+            e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer;
             var that = this,
-                dataTransfer = e.dataTransfer = e.originalEvent &&
-                    e.originalEvent.dataTransfer,
+                dataTransfer = e.dataTransfer,
                 data = {};
             if (dataTransfer && dataTransfer.files && dataTransfer.files.length) {
@@ -1117,6 +1143,6 @@
 
         _onDragOver: function (e) {
-            var dataTransfer = e.dataTransfer = e.originalEvent &&
-                e.originalEvent.dataTransfer;
+            e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer;
+            var dataTransfer = e.dataTransfer;
             if (dataTransfer) {
                 if (this._trigger('dragover', e) === false) {
@@ -1140,7 +1166,9 @@
                 });
             }
-            this._on(this.options.fileInput, {
-                change: this._onChange
-            });
+            if ($.support.fileInput) {
+                this._on(this.options.fileInput, {
+                    change: this._onChange
+                });
+            }
         },
 
@@ -1276,4 +1304,8 @@
                                 return;
                             }
+                            if (!files.length) {
+                                dfd.reject();
+                                return;
+                            }
                             data.files = files;
                             jqXHR = that._onSend(null, data).then(
Index: admin/js/jsUpload/jquery.iframe-transport.js
===================================================================
--- admin/js/jsUpload/jquery.iframe-transport.js	(revision 1144)
+++ admin/js/jsUpload/jquery.iframe-transport.js	(revision 1320)
@@ -1,4 +1,4 @@
 /*
- * jQuery Iframe Transport Plugin 1.6.2
+ * jQuery Iframe Transport Plugin 1.7
  * https://github.com/blueimp/jQuery-File-Upload
  *
@@ -171,5 +171,13 @@
 
     // The iframe transport returns the iframe content document as response.
-    // The following adds converters from iframe to text, json, html, and script:
+    // The following adds converters from iframe to text, json, html, xml
+    // and script.
+    // Please note that the Content-Type for JSON responses has to be text/plain
+    // or text/html, if the browser doesn't include application/json in the
+    // Accept header, else IE will show a download dialog.
+    // The Content-Type for XML responses on the other hand has to be always
+    // application/xml or text/xml, so IE properly parses the XML response.
+    // See also
+    // https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation
     $.ajaxSetup({
         converters: {
@@ -182,4 +190,10 @@
             'iframe html': function (iframe) {
                 return iframe && $(iframe[0].body).html();
+            },
+            'iframe xml': function (iframe) {
+                var xmlDoc = iframe && iframe[0];
+                return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc :
+                        $.parseXML((xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml) ||
+                            $(xmlDoc.body).html());
             },
             'iframe script': function (iframe) {
Index: admin/js/jsUpload/template-download.js
===================================================================
--- admin/js/jsUpload/template-download.js	(revision 1461)
+++ admin/js/jsUpload/template-download.js	(revision 1461)
@@ -0,0 +1,1 @@
+var template_download = tmpl('{% for (var i=0, file; file=o.files[i]; i++) { %}<li class="template-download fade"><div class="upload-file"><div class="upload-fileinfo"><span class="upload-filename">{%=file.name%}</span><span class="upload-filesize">({%=o.formatFileSize(file.size)%})</span><span class="upload-filemsg{% if (file.error) { %} upload-error{% } %}">{% if (file.error) { %}'+dotclear.jsUpload.msg.error+' {%=file.error%}{% } else { %}'+dotclear.jsUpload.msg.file_successfully_uploaded+'{% } %}</span></div><div class="upload-progress">{% if (!file.error) { %}<div class="bar" style="width:100%;">100%</div>{% } %}</div></li>{% } %}');
Index: admin/js/jsUpload/template-upload.js
===================================================================
--- admin/js/jsUpload/template-upload.js	(revision 1461)
+++ admin/js/jsUpload/template-upload.js	(revision 1461)
@@ -0,0 +1,1 @@
+var template_upload = tmpl('{% for (var i=0, file; file=o.files[i]; i++) { %}<li class="template-upload fade"><div class="upload-file"><div class="upload-fileinfo"><span class="upload-filename">{%=file.name%}</span><span class="upload-filesize">({%=o.formatFileSize(file.size)%})</span><span class="upload-filecancel cancel">'+dotclear.jsUpload.msg.cancel+'</span>{% if (!o.files.error && !i && !o.options.autoUpload) { %}<input type="submit" class="button start"  value="'+dotclear.jsUpload.msg.send+'"/>{% } %}<span class="upload-filemsg"></span></div>{% if (!o.files.error) { %}<div class="upload-progress progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>{% } %}</li>{% } %}');
Index: admin/js/prelude.js
===================================================================
--- admin/js/prelude.js	(revision 447)
+++ admin/js/prelude.js	(revision 1615)
@@ -6,5 +6,7 @@
 			aElts[i].className="hidden";
 			aElts[i].onfocus=function() {
-				this.className="";
+				$('#prelude a').removeClass('hidden');
+				$('#wrapper').css('padding-top', '1em');
+				$('#help-button').css('top', '4em');
 			}
 		}
@@ -19,2 +21,7 @@
 }
 addLoadEvent(aFocus);
+
+// init
+$(function() {
+	$('#wrapper').css('padding-top', '0');
+});
Index: admin/langs.php
===================================================================
--- admin/langs.php	(revision 1179)
+++ admin/langs.php	(revision 1553)
@@ -129,16 +129,18 @@
 -------------------------------------------------------- */
 dcPage::open(__('Languages management'),
-	dcPage::jsLoad('js/_langs.js')
+	dcPage::jsLoad('js/_langs.js'),
+	dcPage::breadcrumb(
+	array(
+		__('System') => '',
+		'<span class="page-title">'.__('Languages management').'</span>' => ''
+	))
 );
 
-echo
-'<h2 class="page-title">'.__('Languages management').'</h2>';
-
 if (!empty($_GET['removed'])) {
-	dcPage::message(__('Language has been successfully deleted.'));
+	dcPage::success(__('Language has been successfully deleted.'));
 }
 
 if (!empty($_GET['added'])) {
-	dcPage::message(($_GET['added'] == 2 ? __('Language has been successfully upgraded') : __('Language has been successfully installed.')));
+	dcPage::success(($_GET['added'] == 2 ? __('Language has been successfully upgraded') : __('Language has been successfully installed.')));
 }
 
@@ -220,16 +222,15 @@
 	
 	echo
-	'<form method="post" action="langs.php" enctype="multipart/form-data">'.
-	'<fieldset>'.
-	'<legend>'.__('Available languages').'</legend>'.
+	'<form method="post" action="langs.php" enctype="multipart/form-data" class="fieldset">'.
+	'<h4>'.__('Available languages').'</h4>'.
 	'<p>'.sprintf(__('You can download and install a additional language directly from Dotclear.net. '.
 	'Proposed languages are based on your version: %s.'),'<strong>'.DC_VERSION.'</strong>').'</p>'.
-	'<p class="field"><label for="pkg_url" class="classic">'.__('Language:').' '.
-	form::combo(array('pkg_url'),$dc_langs_combo).'</label></p>'.
-	'<p class="field"><label for="your_pwd1" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').' '.
-	form::password(array('your_pwd','your_pwd1'),20,255).'</label></p>'.
-	'<input type="submit" value="'.__('Install language').'" />'.
+	'<p class="field"><label for="pkg_url" class="classic">'.__('Language:').'</label> '.
+	form::combo(array('pkg_url'),$dc_langs_combo).'</p>'.
+	'<p class="field"><label for="your_pwd1" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label> '.
+	form::password(array('your_pwd','your_pwd1'),20,255).'</p>'.
+	'<p><input type="submit" value="'.__('Install language').'" />'.
 	$core->formNonce().
-	'</fieldset>'.
+	'</p>'.
 	'</form>';
 }
@@ -239,15 +240,14 @@
 	# 'Upload language pack' form
 	echo
-	'<form method="post" action="langs.php" enctype="multipart/form-data">'.
-	'<fieldset>'.
-	'<legend>'.__('Upload a zip file').'</legend>'.
+	'<form method="post" action="langs.php" enctype="multipart/form-data" class="fieldset">'.
+	'<h4>'.__('Upload a zip file').'</h4>'.
 	'<p>'.__('You can install languages by uploading zip files.').'</p>'.
-	'<p class="field"><label for="pkg_file" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Language zip file:').' '.
-	'<input type="file" id="pkg_file" name="pkg_file" /></label></p>'.
-	'<p class="field"><label for="your_pwd2" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').' '.
-	form::password(array('your_pwd','your_pwd2'),20,255).'</label></p>'.
-	'<input type="submit" name="upload_pkg" value="'.__('Upload language').'" />'.
+	'<p class="field"><label for="pkg_file" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Language zip file:').'</label> '.
+	'<input type="file" id="pkg_file" name="pkg_file" /></p>'.
+	'<p class="field"><label for="your_pwd2" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label> '.
+	form::password(array('your_pwd','your_pwd2'),20,255).'</p>'.
+	'<p><input type="submit" name="upload_pkg" value="'.__('Upload language').'" />'.
 	$core->formNonce().
-	'</fieldset>'.
+	'</p>'.
 	'</form>';
 }
Index: admin/media.php
===================================================================
--- admin/media.php	(revision 1234)
+++ admin/media.php	(revision 1725)
@@ -91,5 +91,5 @@
 	$dir =& $core->media->dir;
 	if  (!$core_media_writable) {
-		throw new Exception('you do not have sufficient permissions to write to this folder: ');
+//		throw new Exception('you do not have sufficient permissions to write to this folder: ');
 	}
 } catch (Exception $e) {
@@ -203,7 +203,12 @@
 if ($dir && !empty($_GET['remove']) && empty($_GET['noconfirm']))
 {
-	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>';
+	call_user_func($open_f,__('Media manager'),'',
+		dcPage::breadcrumb(
+			array(
+				html::escapeHTML($core->blog->name) => '',
+				__('Media manager') => '',
+				'<span class="page-title">'.__('confirm removal').'</span>' => ''
+			),!$popup)
+	);
 	
 	echo
@@ -227,43 +232,60 @@
 $user_ui_enhanceduploader = $core->auth->user_prefs->interface->enhanceduploader;
 
+if (!isset($core->media)) {
+	$breadcrumb = dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			'<span class="page-title">'.__('Media manager').'</span>' => ''
+		),!$popup);
+} else {
+	$breadcrumb_media = $core->media->breadCrumb(html::escapeURL($page_url).'&amp;d=%s','<span class="page-title">%s</span>');
+	if ($breadcrumb_media == '') {
+		$breadcrumb = dcPage::breadcrumb(
+			array(
+				html::escapeHTML($core->blog->name) => '',
+				'<span class="page-title">'.__('Media manager').'</span>' => ''
+			),!$popup);
+	} else {
+		$breadcrumb = dcPage::breadcrumb(
+			array(
+				html::escapeHTML($core->blog->name) => '',
+				__('Media manager') => html::escapeURL($page_url.'&d='),
+				$breadcrumb_media => ''
+			),!$popup);
+	}
+}
+
 call_user_func($open_f,__('Media manager'),
 	dcPage::jsLoad('js/_media.js').
-	($core_media_writable ? dcPage::jsUpload(array('d='.$d)) : '')
+	($core_media_writable ? dcPage::jsUpload(array('d='.$d)) : ''),
+	$breadcrumb
 	);
 
+if (!$core_media_writable) {
+	dcPage::warning(__('You do not have sufficient permissions to write to this folder.'));
+}
+
 if (!empty($_GET['mkdok'])) {
-	dcPage::message(__('Directory has been successfully created.'));
+	dcPage::success(__('Directory has been successfully created.'));
 }
 
 if (!empty($_GET['upok'])) {
-	dcPage::message(__('Files have been successfully uploaded.'));
+	dcPage::success(__('Files have been successfully uploaded.'));
 }
 
 if (!empty($_GET['rmfok'])) {
-	dcPage::message(__('File has been successfully removed.'));
+	dcPage::success(__('File has been successfully removed.'));
 }
 
 if (!empty($_GET['rmdok'])) {
-	dcPage::message(__('Directory has been successfully removed.'));
+	dcPage::success(__('Directory has been successfully removed.'));
 }
 
 if (!empty($_GET['rebuildok'])) {
-	dcPage::message(__('Directory has been successfully rebuilt.'));
+	dcPage::success(__('Directory has been successfully rebuilt.'));
 }
 
 if (!empty($_GET['unzipok'])) {
-	dcPage::message(__('Zip file has been successfully extracted.'));
-}
-
-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>';
-	}
+	dcPage::success(__('Zip file has been successfully extracted.'));
 }
 
@@ -274,11 +296,11 @@
 
 if ($post_id) {
-	echo '<p><strong>'.sprintf(__('Choose a file to attach to entry %s by clicking on %s.'),
+	echo '<p class="form-note info">'.sprintf(__('Choose a file to attach to entry %s by clicking on %s.'),
 		'<a href="'.$core->getPostAdminURL($post_type,$post_id).'">'.html::escapeHTML($post_title).'</a>',
-		'<img src="images/plus.png" alt="'.__('Attach this file to entry').'" />').'</strong></p>';
+		'<img src="images/plus.png" alt="'.__('Attach this file to entry').'" />').'</p>';
 }
 if ($popup) {
-	echo '<p><strong>'.sprintf(__('Choose a file to insert into entry by clicking on %s.'),
-		'<img src="images/plus.png" alt="'.__('Attach this file to entry').'" />').'</strong></p>';
+	echo '<p class="form-note info">'.sprintf(__('Choose a file to insert into entry by clicking on %s.'),
+		'<img src="images/plus.png" alt="'.__('Attach this file to entry').'" />').'</p>';
 }
 
@@ -288,5 +310,5 @@
 if (count($items) == 0)
 {
-	echo '<p><strong>'.__('No file.').'</strong></p>';
+	echo '<p>'.__('No file.').'</p>';
 }
 else
@@ -298,6 +320,6 @@
 	echo
 	'<form action="media.php" method="get">'.
-	'<p><label for="file_sort" class="classic">'.__('Sort files:').' '.
-	form::combo('file_sort',$sort_combo,$file_sort).'</label>'.
+	'<p><label for="file_sort" class="classic">'.__('Sort files:').'</label> '.
+	form::combo('file_sort',$sort_combo,$file_sort).
 	form::hidden(array('popup'),$popup).
 	form::hidden(array('post_id'),$post_id).
@@ -305,5 +327,5 @@
 	'</form>'.
 	
-	'<p>'.__('Page(s)').' : '.$pager->getLinks().'</p>';
+	'<p class="pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>';
 	
 	for ($i=$pager->index_start, $j=0; $i<=$pager->index_end; $i++, $j++)
@@ -313,5 +335,5 @@
 	
 	echo
-	'<p class="clear">'.__('Page(s)').' : '.$pager->getLinks().'</p>';
+	'<p class="clear pagination">'.__('Page(s)').' : '.$pager->getLinks().'</p>';
 }
 if (!isset($pager)) {
@@ -324,35 +346,37 @@
 if ($core_media_writable)
 {
-	echo '<div class="two-cols">';
+	echo 
+	'<h3 class="hidden">'.sprintf(__('In %s:'),($d == '' ? '“'.__('Media manager').'”' : '“'.$d.'”')).'</h3>'.
+	'<div class="media-action-box">';
 	
 	if ($user_ui_enhanceduploader) {
 		echo
-		'<div class="col enhanced_uploader">';
+		'<div class="enhanced_uploader">';
 	} else {
 		echo
-		'<div class="col">';
-	}
-
-	echo
-	'<form id="fileupload" action="'.html::escapeURL($page_url).'" method="POST" enctype="multipart/form-data">'.
-	'<fieldset id="add-file-f"><legend>'.__('Add files').'</legend>'.
+		'<div>';
+	}
+
+	echo
+	'<h4>'.__('Add files').'</h4>'.
 	'<p>'.__('Please take care to publish media that you own and that are not protected by copyright.').'</p>'.
-	form::hidden(array('MAX_FILE_SIZE'),DC_MAX_UPLOAD_SIZE).
-	$core->formNonce().
-	'<div class="fileupload-ctrl"><div class="files"></div></div>';
-
-	echo
-	'<div class="fileupload-buttonbar">';
-
-	echo
-	'<p class="max-sier form-note info">&nbsp;'.__('Maximum file size allowed:').' '.files::size(DC_MAX_UPLOAD_SIZE).'</p>'.
-	'<label for="upfile">'.'<span class="add-label one-file">'.__('Choose file').'</span>'.'</label>'.
+	'<p class="max-sizer form-note info">&nbsp;'.__('Maximum file size allowed:').' '.files::size(DC_MAX_UPLOAD_SIZE).'</p>'.
+	'<form id="fileupload" action="'.html::escapeURL($page_url).'" method="post" enctype="multipart/form-data" aria-disabled="false">'.
+	'<p>'.form::hidden(array('MAX_FILE_SIZE'),DC_MAX_UPLOAD_SIZE).
+	$core->formNonce().'</p>'.
+	'<div class="fileupload-ctrl"><p class="queue-message"></p><ul class="files"></ul></div>';
+
+	echo
+	'<div class="fileupload-buttonbar clear">';
+
+	echo
+	'<p><label for="upfile">'.'<span class="add-label one-file">'.__('Choose file').'</span>'.'</label>'.
 	'<button class="button add">'.__('Choose files').'</button>'.
-	'<input type="file" id="upfile" name="upfile[]"'.($user_ui_enhanceduploader?' multiple="mutiple"':'').' data-url="'.html::escapeURL($page_url).'" />';
-
-	echo
-	'<p class="one-file"><label for="upfiletitle">'.__('Title:').form::field(array('upfiletitle','upfiletitle'),35,255).'</label></p>'.
-	'<p class="one-file"><label for="upfilepriv" class="classic">'.form::checkbox(array('upfilepriv','upfilepriv'),1).' '.
-	__('Private').'</label></p>';
+	'<input type="file" id="upfile" name="upfile[]"'.($user_ui_enhanceduploader?' multiple="mutiple"':'').' data-url="'.html::escapeURL($page_url).'" /></p>';
+
+	echo
+	'<p class="one-file"><label for="upfiletitle">'.__('Title:').'</label>'.form::field(array('upfiletitle','upfiletitle'),35,255).'</p>'.
+	'<p class="one-file"><label for="upfilepriv" class="classic">'.__('Private').'</label> '.
+	form::checkbox(array('upfilepriv','upfilepriv'),1).'</p>';
 
 	if (!$user_ui_enhanceduploader) {
@@ -363,28 +387,49 @@
 
 	echo
-	'<button class="button clean">'.__('Refresh').'</button>'.
+	'<p class="clear"><button class="button clean">'.__('Refresh').'</button>'.
 	'<input class="button cancel one-file" type="reset" value="'.__('Clear all').'"/>'.
-	'<input class="button start" type="submit" value="'.__('Upload').'"/>'.
+	'<input class="button start" type="submit" value="'.__('Upload').'"/></p>'.
 	'</div>';
 
 	echo
-	form::hidden(array('d'),$d).
-	'</fieldset>'.
+	'<p style="clear:both;">'.form::hidden(array('d'),$d).'</p>'.
 	'</form>'.
+	'</div>'.
 	'</div>';
-	
-	echo
-	'<div class="col">'.
-	'<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::hidden(array('d'),html::escapeHTML($d)).'</p>'.
-	'</fieldset>'.
-	'</form></div>';
-	
+}
+
+$core_media_archivable = $core->auth->check('media_admin',$core->blog->id) && 
+	!(count($items) == 0 || (count($items) == 1 && $items[0]->parent));
+
+if ($core_media_writable || $core_media_archivable) {
+
+	echo '<div class="media-action-box">';
+
+	# Create directory
+	if ($core_media_writable)
+	{
+		echo
+		'<form action="'.html::escapeURL($page_url).'" method="post">'.
+		'<div id="new-dir-f">'.
+		'<h4>'.__('Create new directory').'</h4>'.
+		$core->formNonce().
+		'<p><label for="newdir">'.__('Directory Name:').'</label>'.
+		form::field(array('newdir','newdir'),35,255).'</p>'.
+		'<p><input type="submit" value="'.__('Create').'" />'.
+		form::hidden(array('d'),html::escapeHTML($d)).'</p>'.
+		'</div>'.
+		'</form>';
+	}
+
+	# Get zip directory
+	if ($core_media_archivable)
+	{
+		echo
+		'<h4>'.__('Backup content').'</h4>'.
+		'<p>'.__('Compress this directory with its content as a zip file and download it.').'</p>'.
+		'<p><a class="submit" href="'.html::escapeURL($page_url).'&amp;zipdl=1">'.
+		__('Download').'</a></p>';
+	}
+
 	echo '</div>';
 }
@@ -392,18 +437,11 @@
 # Empty remove form (for javascript actions)
 echo
-'<form id="media-remove-hide" action="'.html::escapeURL($page_url).'" method="post"><div class="clear">'.
+'<form id="media-remove-hide" action="'.html::escapeURL($page_url).'" method="post" class="hidden">'.
+'<div>'.
 form::hidden('rmyes',1).form::hidden('d',html::escapeHTML($d)).
 form::hidden('remove','').
 $core->formNonce().
-'</div></form>';
-
-# Get zip directory
-if ($core->auth->check('media_admin',$core->blog->id) && 
-	!(count($items) == 0 || (count($items) == 1 && $items[0]->parent)))
-{
-	echo
-	'<p class="zip-dl"><a href="'.html::escapeURL($page_url).'&amp;zipdl=1">'.
-	__('Download this directory as a zip file').'</a></p>';
-}
+'</div>'.
+'</form>';
 
 call_user_func($close_f);
@@ -428,9 +466,7 @@
 	$class = 'media-item media-col-'.($i%2);
 	
-	$alt = (!$f->d ? sprintf(__('Media details of %s'),$fname) : 
-		sprintf(__('Go to %s folder'),($fname == '..' ? __('parent') : $fname)));
 	$res =
 	'<div class="'.$class.'"><a class="media-icon media-link" href="'.$link.'">'.
-	'<img src="'.$f->media_icon.'" alt="'.$alt.'" /></a>'.
+	'<img src="'.$f->media_icon.'" alt="" /></a>'.
 	'<ul>'.
 	'<li><a class="media-link" href="'.$link.'">'.$fname.'</a></li>';
Index: admin/media_item.php
===================================================================
--- admin/media_item.php	(revision 1179)
+++ admin/media_item.php	(revision 1605)
@@ -175,5 +175,11 @@
 	$starting_scripts.
 	dcPage::jsDatePicker().
-	dcPage::jsPageTabs($tab)
+	dcPage::jsPageTabs($tab),
+	dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			__('Media manager') => html::escapeURL($media_page_url),
+			$core->media->breadCrumb(html::escapeURL($media_page_url).'&amp;d=%s').'<span class="page-title">'.$file->basename.'</span>' => ''
+		),!$popup)
 );
 
@@ -184,13 +190,9 @@
 
 if (!empty($_GET['fupd']) || !empty($_GET['fupl'])) {
-	dcPage::message(__('File has been successfully updated.'));
+	dcPage::success(__('File has been successfully updated.'));
 }
 if (!empty($_GET['thumbupd'])) {
-	dcPage::message(__('Thumbnails have been successfully updated.'));
-}
-
-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>';
+	dcPage::success(__('Thumbnails have been successfully updated.'));
+}
 
 # Insertion popup
@@ -331,5 +333,5 @@
 	echo
 	'<p><a id="media-insert-cancel" class="button" href="#">'.__('Cancel').'</a> - '.
-	'<strong><a id="media-insert-ok" class="button" href="#">'.__('Insert').'</a></strong>'.
+	'<a id="media-insert-ok" class="button" href="#">'.__('Insert').'</a>'.
 	form::hidden(array('type'),html::escapeHTML($media_type)).
 	form::hidden(array('title'),html::escapeHTML($file->media_title)).
@@ -346,5 +348,6 @@
 
 echo
-'<div id="media-details">';
+'<div id="media-details">'.
+'<div class="near-icon">';
 
 if ($file->media_image)
@@ -355,14 +358,4 @@
 		$thumb_size = 's';
 	}
-	
-	echo '<p>'.__('Available sizes:').' ';
-	foreach (array_reverse($file->media_thumb) as $s => $v)
-	{
-		$strong_link = ($s == $thumb_size) ? '<strong>%s</strong>' : '%s';
-		printf($strong_link,'<a href="'.html::escapeURL($page_url).
-		'&amp;id='.$id.'&amp;size='.$s.'&amp;tab=media-details-tab">'.$core->media->thumb_sizes[$s][2].'</a> | ');
-	}
-	echo '<a href="'.html::escapeURL($page_url).'&amp;id='.$id.'&amp;size=o&amp;tab=media-details-tab">'.__('original').'</a>';
-	echo '</p>';
 	
 	if (isset($file->media_thumb[$thumb_size])) {
@@ -374,4 +367,14 @@
 		echo '<p id="media-original-image"'.$class.'><img src="'.$file->file_url.'?'.time()*rand().'" alt="" /></p>';
 	}
+	
+	echo '<p>'.__('Available sizes:').' ';
+	foreach (array_reverse($file->media_thumb) as $s => $v)
+	{
+		$strong_link = ($s == $thumb_size) ? '<strong>%s</strong>' : '%s';
+		printf($strong_link,'<a href="'.html::escapeURL($page_url).
+		'&amp;id='.$id.'&amp;size='.$s.'&amp;tab=media-details-tab">'.$core->media->thumb_sizes[$s][2].'</a> | ');
+	}
+	echo '<a href="'.html::escapeURL($page_url).'&amp;id='.$id.'&amp;size=o&amp;tab=media-details-tab">'.__('original').'</a>';
+	echo '</p>';
 }
 
@@ -398,6 +401,6 @@
 {
 	echo
-	'<p><strong><a href="'.html::escapeHTML($page_url).'&amp;id='.$id.'&amp;find_posts=1&amp;tab=media-details-tab">'.
-	__('Show entries containing this media').'</a></strong></p>';
+	'<p><a class="button" href="'.html::escapeHTML($page_url).'&amp;id='.$id.'&amp;find_posts=1&amp;tab=media-details-tab">'.
+	__('Show entries containing this media').'</a></p>';
 }
 else
@@ -484,4 +487,8 @@
 }
 
+echo '</div>';
+
+echo '<h3>'.__('Updates and modifications').'</h3>';
+
 if ($file->editable && $core_media_writable)
 {
@@ -489,11 +496,11 @@
 	{
 		echo
-		'<form class="clear" action="'.html::escapeURL($page_url).'" method="post">'.
-		'<fieldset><legend>'.__('Update thumbnails').'</legend>'.
+		'<form class="clear fieldset" action="'.html::escapeURL($page_url).'" method="post">'.
+		'<h4>'.__('Update thumbnails').'</h4>'.
 		'<p>'.__('This will create or update thumbnails for this image.').'</p>'.
 		'<p><input type="submit" name="thumbs" value="'.__('Update thumbnails').'" />'.
 		form::hidden(array('id'),$id).
 		$core->formNonce().'</p>'.
-		'</fieldset></form>';
+		'</form>';
 	}
 	
@@ -506,6 +513,6 @@
 		
 		echo
-		'<form class="clear" id="file-unzip" action="'.html::escapeURL($page_url).'" method="post">'.
-		'<fieldset><legend>'.__('Extract archive').'</legend>'.
+		'<form class="clear fieldset" id="file-unzip" action="'.html::escapeURL($page_url).'" method="post">'.
+		'<h4>'.__('Extract archive').'</h4>'.
 		'<ul>'.
 		'<li><strong>'.__('Extract in a new directory').'</strong> : '.
@@ -514,33 +521,33 @@
 		__('This will extract archive in current directory and will overwrite existing files or directory.').'</li>'.
 		'</ul>'.
-		'<p><label for="inflate_mode" class="classic">'.__('Extract mode:').' '.
-		form::combo('inflate_mode',$inflate_combo,'new').'</label> '.
+		'<p><label for="inflate_mode" class="classic">'.__('Extract mode:').'</label> '.
+		form::combo('inflate_mode',$inflate_combo,'new').
 		'<input type="submit" name="unzip" value="'.__('Extract').'" />'.
 		form::hidden(array('id'),$id).
 		$core->formNonce().'</p>'.
-		'</fieldset></form>';
+		'</form>';
 	}
 	
 	echo
-	'<form class="clear" action="'.html::escapeURL($page_url).'" method="post">'.
-	'<fieldset><legend>'.__('Change media properties').'</legend>'.
-	'<p><label for="media_file">'.__('File name:').
-	form::field('media_file',30,255,html::escapeHTML($file->basename)).'</label></p>'.
-	'<p><label for="media_title">'.__('File title:').
-	form::field('media_title',30,255,html::escapeHTML($file->media_title)).'</label></p>'.
-	'<p><label for="media_dt">'.__('File date:').
-	form::field('media_dt',16,16,html::escapeHTML($file->media_dtstr)).'</label></p>'.
+	'<form class="clear fieldset" action="'.html::escapeURL($page_url).'" method="post">'.
+	'<h4>'.__('Change media properties').'</h4>'.
+	'<p><label for="media_file">'.__('File name:').'</label>'.
+	form::field('media_file',30,255,html::escapeHTML($file->basename)).'</p>'.
+	'<p><label for="media_title">'.__('File title:').'</label>'.
+	form::field('media_title',30,255,html::escapeHTML($file->media_title)).'</p>'.
+	'<p><label for="media_dt">'.__('File date:').'</label>'.
+	form::field('media_dt',16,16,html::escapeHTML($file->media_dtstr)).'</p>'.
 	'<p><label for="media_private" class="classic">'.form::checkbox('media_private',1,$file->media_priv).' '.
 	__('Private').'</label></p>'.
-	'<p><label for="media_path">'.__('New directory:').
-	form::combo('media_path',$dirs_combo,dirname($file->relname)).'</label></p>'.
+	'<p><label for="media_path">'.__('New directory:').'</label>'.
+	form::combo('media_path',$dirs_combo,dirname($file->relname)).'</p>'.
 	'<p><input type="submit" accesskey="s" value="'.__('Save').'" />'.
 	form::hidden(array('id'),$id).
 	$core->formNonce().'</p>'.
-	'</fieldset></form>';
+	'</form>';
 	
 	echo
-	'<form class="clear" action="'.html::escapeURL($page_url).'" method="post" enctype="multipart/form-data">'.
-	'<fieldset><legend>'.__('Change file').'</legend>'.
+	'<form class="clear fieldset" action="'.html::escapeURL($page_url).'" method="post" enctype="multipart/form-data">'.
+	'<h4>'.__('Change file').'</h4>'.
 	'<div>'.form::hidden(array('MAX_FILE_SIZE'),DC_MAX_UPLOAD_SIZE).'</div>'.
 	'<p><label for="upfile">'.__('Choose a file:').
@@ -551,5 +558,5 @@
 	form::hidden(array('id'),$id).
 	$core->formNonce().'</p>'.
-	'</fieldset></form>';
+	'</form>';
 
 	if ($file->del) {
Index: admin/plugin.php
===================================================================
--- admin/plugin.php	(revision 1179)
+++ admin/plugin.php	(revision 1358)
@@ -81,7 +81,11 @@
 else
 {
-	call_user_func($open_f,__('Plugin not found'));
-	
-	echo '<h2 class="page-title">'.__('Plugin not found').'</h2>';
+	call_user_func($open_f,__('Plugin not found'),'',
+		dcPage::breadcrumb(
+			array(
+				__('System') => '',
+				'<span class="page-title">'.__('Plugin not found').'</span>' => ''
+			))
+	);
 	
 	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 1271)
+++ admin/plugins.php	(revision 1622)
@@ -191,15 +191,17 @@
 dcPage::open(__('Plugins management'),
 	dcPage::jsLoad('js/_plugins.js').
-	dcPage::jsPageTabs($default_tab)
+	dcPage::jsPageTabs($default_tab),
+	dcPage::breadcrumb(
+		array(
+			__('System') => '',
+			'<span class="page-title">'.__('Plugins management').'</span>' => ''
+		))
 );
 
-echo
-'<h2 class="page-title">'.__('Plugins management').'</h2>';
-
 if (!empty($_GET['removed'])) {
-	dcPage::message(__('Plugin has been successfully deleted.'));
+	dcPage::success(__('Plugin has been successfully deleted.'));
 }
 if (!empty($_GET['added'])) {
-	dcPage::message(($_GET['added'] == 2 ? __('Plugin has been successfully upgraded') : __('Plugin has been successfully installed.')));
+	dcPage::success(($_GET['added'] == 2 ? __('Plugin has been successfully upgraded') : __('Plugin has been successfully installed.')));
 }
 
@@ -233,10 +235,9 @@
 		'<a href="plugin.php?p=daInstaller">'.__('DotAddict.org Installer').'</a>'));
 
-echo '<p>';
 if ($is_writable) {
-	echo __('To install or upgrade a plugin you generally just need to upload it '.
+	echo '<p>'.__('To install or upgrade a plugin you generally just need to upload it '.
 	'in "Install or upgrade a plugin" section.');
 } else {
-	echo __('To install or upgrade a plugin you just need to extract it in your plugins directory.');
+	echo '<p>'.__('To install or upgrade a plugin you just need to extract it in your plugins directory.');
 }
 echo '</p>';
@@ -353,28 +354,25 @@
 	# 'Upload plugin' form
 	echo
-	'<form method="post" action="plugins.php" id="uploadpkg" enctype="multipart/form-data">'.
-	'<fieldset>'.
-	'<legend>'.__('Upload a zip file').'</legend>'.
-	'<p class="field"><label for="pkg_file" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Plugin zip file:').' '.
-	'<input type="file" id="pkg_file" name="pkg_file" /></label></p>'.
-	'<p class="field"><label for="your_pwd1" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').' '.
-	form::password(array('your_pwd','your_pwd1'),20,255).'</label></p>'.
-	'<input type="submit" name="upload_pkg" value="'.__('Upload plugin').'" />'.
+	'<form method="post" action="plugins.php" id="uploadpkg" enctype="multipart/form-data" class="fieldset">'.
+	'<h3>'.__('Upload a zip file').'</h3>'.
+	'<p class="field"><label for="pkg_file" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Plugin zip file:').'</label> '.
+	'<input type="file" id="pkg_file" name="pkg_file" /></p>'.
+	'<p class="field"><label for="your_pwd1" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label> '.
+	form::password(array('your_pwd','your_pwd1'),20,255).'</p>'.
+	'<p><input type="submit" name="upload_pkg" value="'.__('Upload plugin').'" />'.
 	$core->formNonce().
-	'</fieldset>'.
+	'</p>'.
 	'</form>';
 	
 	# 'Fetch plugin' form
 	echo
-	'<form method="post" action="plugins.php" id="fetchpkg">'.
-	'<fieldset>'.
-	'<legend>'.__('Download a zip file').'</legend>'.
-	'<p class="field"><label for="pkg_url" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Plugin zip file URL:').' '.
-	form::field(array('pkg_url','pkg_url'),40,255).'</label></p>'.
-	'<p class="field"><label for="your_pwd2" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').' '.
-	form::password(array('your_pwd','your_pwd2'),20,255).'</label></p>'.
-	'<input type="submit" name="fetch_pkg" value="'.__('Download plugin').'" />'.
-	$core->formNonce().
-	'</fieldset>'.
+	'<form method="post" action="plugins.php" id="fetchpkg" class="fieldset">'.
+	'<h3>'.__('Download a zip file').'</h3>'.
+	'<p class="field"><label for="pkg_url" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Plugin zip file URL:').'</label> '.
+	form::field(array('pkg_url','pkg_url'),40,255).'</p>'.
+	'<p class="field"><label for="your_pwd2" class="classic required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label> '.
+	form::password(array('your_pwd','your_pwd2'),20,255).'</p>'.
+	'<p><input type="submit" name="fetch_pkg" value="'.__('Download plugin').'" />'.
+	$core->formNonce().'</p>'.
 	'</form>';
 }
@@ -388,9 +386,4 @@
 echo '</div>';
 
-if ($core->plugins->moduleExists('daInstaller')) {
-	echo '<p><a href="plugin.php?p=daInstaller" class="multi-part">'.__('DotAddict.org Installer').'</a></p>';
-}
-
-
 # --BEHAVIOR-- pluginsToolsTabs
 $core->callBehavior('pluginsToolsTabs',$core);
Index: admin/popup_link.php
===================================================================
--- admin/popup_link.php	(revision 1179)
+++ admin/popup_link.php	(revision 1719)
@@ -25,26 +25,15 @@
 # Languages combo
 $rs = $core->blog->getLangs(array('order'=>'asc'));
-$all_langs = l10n::getISOcodes(0,1);
-$lang_combo = array('' => '', __('Most used') => array(), __('Available') => l10n::getISOcodes(1,1));
-while ($rs->fetch()) {
-	if (isset($all_langs[$rs->post_lang])) {
-		$lang_combo[__('Most used')][$all_langs[$rs->post_lang]] = $rs->post_lang;
-		unset($lang_combo[__('Available')][$all_langs[$rs->post_lang]]);
-	} else {
-		$lang_combo[__('Most used')][$rs->post_lang] = $rs->post_lang;
-	}
-}
-unset($all_langs);
-unset($rs);
+$lang_combo = dcAdminCombos::getLangsCombo($rs,true);
 
 echo
 '<form id="link-insert-form" action="#" method="get">'.
-'<p><label class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Link URL:').' '.
-form::field('href',35,512,html::escapeHTML($href)).'</label></p>'.
-'<p><label>'.__('Link title:').' '. 
-form::field('title',35,512,html::escapeHTML($title)).'</label></p>'. 
-'<p><label>'.__('Link language:').' '.
+'<p><label class="required" for="href"><abbr title="'.__('Required field').'">*</abbr> '.__('Link URL:').'</label> '.
+form::field('href',35,512,html::escapeHTML($href)).'</p>'.
+'<p><label for="title">'.__('Link title:').'</label> '. 
+form::field('title',35,512,html::escapeHTML($title)).'</p>'. 
+'<p><label for="hreflang">'.__('Link language:').'</label> '.
 form::combo('hreflang',$lang_combo,$hreflang).
-'</label></p>'.
+'</p>'.
 
 '</form>'.
Index: admin/popup_posts.php
===================================================================
--- admin/popup_posts.php	(revision 1179)
+++ admin/popup_posts.php	(revision 1399)
@@ -53,14 +53,14 @@
 
 echo '<form action="popup_posts.php" method="post">'.
-	'<p><label for"type" class="classic">'.__('Entry type:').' '.form::combo('type',$type_combo,$type).'</label></p>'.
-	$core->formNonce().
+	'<p><label for"type" class="classic">'.__('Entry type:').'</label> '.form::combo('type',$type_combo,$type).''.
+	$core->formNonce().'</p>'.
 	'<noscript><div><input type="submit" value="'.__('Ok').'" /></div></noscript>'.
 	'</form>';
 
 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>'.
+	'<p><label for="q" class="classic">'.__('Search entry:').'</label> '.form::field('q',30,255,html::escapeHTML($q)).
+	' <input type="submit" value="'.__('Search').'" />'.
 	form::hidden('type',html::escapeHTML($type)).
-	'</form>';
+	'</p></form>';
 
 try {
Index: admin/post.php
===================================================================
--- admin/post.php	(revision 1537)
+++ admin/post.php	(revision 1719)
@@ -50,29 +50,19 @@
 }
 
-# Status combo
-foreach ($core->blog->getAllPostStatus() as $k => $v) {
-	$status_combo[$v] = (string) $k;
-}
+# Getting categories
+$categories_combo = dcAdminCombos::getCategoriesCombo(
+	$core->blog->getCategories(array('post_type'=>'post'))
+);
+
+$status_combo = dcAdminCombos::getPostStatusesCombo();
+
 $img_status_pattern = '<img class="img_select_option" alt="%1$s" title="%1$s" src="images/%2$s" />';
 
 # Formaters combo
-foreach ($core->getFormaters() as $v) {
-	$formaters_combo[$v] = $v;
-}
+$formaters_combo = dcAdminCombos::getFormatersCombo();
 
 # Languages combo
 $rs = $core->blog->getLangs(array('order'=>'asc'));
-$all_langs = l10n::getISOcodes(0,1);
-$lang_combo = array('' => '', __('Most used') => array(), __('Available') => l10n::getISOcodes(1,1));
-while ($rs->fetch()) {
-	if (isset($all_langs[$rs->post_lang])) {
-		$lang_combo[__('Most used')][$all_langs[$rs->post_lang]] = $rs->post_lang;
-		unset($lang_combo[__('Available')][$all_langs[$rs->post_lang]]);
-	} else {
-		$lang_combo[__('Most used')][$rs->post_lang] = $rs->post_lang;
-	}
-}
-unset($all_langs);
-unset($rs);
+$lang_combo = dcAdminCombos::getLangsCombo($rs,true);
 
 # Validation flag
@@ -82,4 +72,6 @@
 if (!empty($_REQUEST['id']))
 {
+	$page_title = __('Edit entry');
+	
 	$params['post_id'] = $_REQUEST['id'];
 	
@@ -111,6 +103,4 @@
 		$post_open_tb = (boolean) $post->post_open_tb;
 		
-		$page_title = __('Edit entry');
-		
 		$can_edit_post = $post->isEditable();
 		$can_delete= $post->isDeletable();
@@ -121,5 +111,5 @@
 		if ($next_rs !== null) {
 			$next_link = sprintf($post_link,$next_rs->post_id,
-				html::escapeHTML($next_rs->post_title),__('next entry').'&nbsp;&#187;');
+				html::escapeHTML($next_rs->post_title),__('Next entry').'&nbsp;&#187;');
 			$next_headlink = sprintf($post_headlink,'next',
 				html::escapeHTML($next_rs->post_title),$next_rs->post_id);
@@ -128,5 +118,5 @@
 		if ($prev_rs !== null) {
 			$prev_link = sprintf($post_link,$prev_rs->post_id,
-				html::escapeHTML($prev_rs->post_title),'&#171;&nbsp;'.__('previous entry'));
+				html::escapeHTML($prev_rs->post_title),'&#171;&nbsp;'.__('Previous entry'));
 			$prev_headlink = sprintf($post_headlink,'previous',
 				html::escapeHTML($prev_rs->post_title),$prev_rs->post_id);
@@ -293,17 +283,7 @@
 
 # Getting categories
-$categories_combo = array(__('(No cat)') => '');
-try {
-	$categories = $core->blog->getCategories(array('post_type'=>'post'));
-	if (!$categories->isEmpty()) {
-		while ($categories->fetch()) {
-			$catparents_combo[] = $categories_combo[] = new formSelectOption(
-				str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title),
-				$categories->cat_id
-			);
-		}
-	}
-} catch (Exception $e) { }
-
+$categories_combo = dcAdminCombos::getCategoriesCombo(
+	$core->blog->getCategories(array('post_type'=>'post'))
+);
 /* DISPLAY
 -------------------------------------------------------- */
@@ -315,4 +295,28 @@
 	$default_tab = 'comments';
 }
+
+if ($post_id) {
+	switch ($post_status) {
+		case 1:
+			$img_status = sprintf($img_status_pattern,__('Published'),'check-on.png');
+			break;
+		case 0:
+			$img_status = sprintf($img_status_pattern,__('Unpublished'),'check-off.png');
+			break;
+		case -1:
+			$img_status = sprintf($img_status_pattern,__('Scheduled'),'scheduled.png');
+			break;
+		case -2:
+			$img_status = sprintf($img_status_pattern,__('Pending'),'check-wrn.png');
+			break;
+		default:
+			$img_status = '';
+	}
+	$edit_entry_str = __('&ldquo;%s&rdquo;');
+	$page_title_edit = sprintf($edit_entry_str, html::escapeHTML($post_title)).' '.$img_status;
+} else {
+	$img_status = '';
+}
+
 
 dcPage::open($page_title.' - '.__('Entries'),
@@ -326,22 +330,28 @@
 	$core->callBehavior('adminPostHeaders').
 	dcPage::jsPageTabs($default_tab).
-	$next_headlink."\n".$prev_headlink
+	$next_headlink."\n".$prev_headlink,
+	dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			__('Entries') => 'posts.php',
+			'<span class="page-title">'.($post_id ? $page_title_edit : $page_title).'</span>' => ''
+		))
 );
 
 if (!empty($_GET['upd'])) {
-	dcPage::message(__('Entry has been successfully updated.'));
+	dcPage::success(__('Entry has been successfully updated.'));
 }
 elseif (!empty($_GET['crea'])) {
-	dcPage::message(__('Entry has been successfully created.'));
+	dcPage::success(__('Entry has been successfully created.'));
 }
 elseif (!empty($_GET['attached'])) {
-	dcPage::message(__('File has been successfully attached.'));
+	dcPage::success(__('File has been successfully attached.'));
 }
 elseif (!empty($_GET['rmattach'])) {
-	dcPage::message(__('Attachment has been successfully removed.'));
+	dcPage::success(__('Attachment has been successfully removed.'));
 }
 
 if (!empty($_GET['creaco'])) {
-	dcPage::message(__('Comment has been successfully created.'));
+	dcPage::success(__('Comment has been successfully created.'));
 }
 
@@ -356,37 +366,12 @@
 }
 
-echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; '.'<a href="posts.php">'.__('Entries').'</a> &rsaquo; <span class="page-title">';
-if ($post_id) {
-	switch ($post_status) {
-		case 1:
-			$img_status = sprintf($img_status_pattern,__('published'),'check-on.png');
-			break;
-		case 0:
-			$img_status = sprintf($img_status_pattern,__('unpublished'),'check-off.png');
-			break;
-		case -1:
-			$img_status = sprintf($img_status_pattern,__('scheduled'),'scheduled.png');
-			break;
-		case -2:
-			$img_status = sprintf($img_status_pattern,__('pending'),'check-wrn.png');
-			break;
-		default:
-			$img_status = '';
-	}
-	$edit_entry_str = __('Edit entry &ldquo;%s&rdquo;');
-	echo sprintf($edit_entry_str, html::escapeHTML($post_title)).' '.$img_status;
-} else {
-	echo $page_title;
-}
-echo	'</span></h2>';
-
 if ($post_id && $post->post_status == 1) {
-	echo '<p><a href="'.$post->getURL().'" onclick="window.open(this.href);return false;" title="'.$post_title.' ('.__('new window').')'.'">'.__('Go to this entry on the site').' <img src="images/outgoing-blue.png" alt="" /></a></p>';
+	echo '<p><a class="onblog_link" href="'.$post->getURL().'" onclick="window.open(this.href);return false;" title="'.$post_title.' ('.__('new window').')'.'">'.__('Go to this entry on the site').' <img src="images/outgoing-blue.png" alt="" /></a></p>';
 }
 if ($post_id)
 {
-	echo '<p>';
+	echo '<p class="nav_prevnext">';
 	if ($prev_link) { echo $prev_link; }
-	if ($next_link && $prev_link) { echo ' - '; }
+	if ($next_link && $prev_link) { echo ' | '; }
 	if ($next_link) { echo $next_link; }
 	
@@ -403,37 +388,139 @@
 	exit;
 }
-
 /* Post form if we can edit post
 -------------------------------------------------------- */
 if ($can_edit_post)
 {
-	echo '<div class="multi-part" title="'.__('Edit entry').'" id="edit-entry">';
+	$sidebar_items = new ArrayObject(array(
+		'status-box' => array(
+			'title' => __('Status'),
+			'items' => array(
+				'post_status' => 
+					'<p class="entry-status"><label for="post_status" class="ib">'.__('Entry status').' '.$img_status.'</label>'.
+					form::combo('post_status',$status_combo,$post_status,'maximal','',!$can_publish).
+					'</p>',
+				'post_dt' => 
+					'<p><label for="post_dt" class="ib">'.__('Publication date and hour').'</label>'.
+					form::field('post_dt',16,16,$post_dt,($bad_dt ? 'invalid' : '')).
+					'</p>',
+				'post_lang' =>
+					'<p><label for="post_lang" class="ib">'.__('Entry lang').'</label>'.
+					form::combo('post_lang',$lang_combo,$post_lang).
+					'</p>',
+				'post_format' =>
+					'<div>'.
+					'<h5 id="label_format"><label for="post_format" class="ib">'.__('Text formating').'</label></h5>'.
+					'<p>'.form::combo('post_format',$formaters_combo,$post_format,'maximal').
+					'</p>'.
+					'<p>'.($post_id && $post_format != 'xhtml' ? 
+					'<a id="convert-xhtml" class="button maximal" href="post.php?id='.$post_id.'&amp;xconv=1">'.
+					__('Convert to XHTML').'</a>' : '').'</p></div>')),
+		'metas-box' => array(
+			'title' => __('Ordering'),
+			'items' => array(
+				'post_selected' => 
+					'<p><label for="post_selected" class="classic">'.
+					form::checkbox('post_selected',1,$post_selected).' '.
+					__('Selected entry').'</label></p>',
+				'cat_id' =>
+					'<p><label for="cat_id" class="ib">'.__('Category').'</label>'.
+					form::combo('cat_id',$categories_combo,$cat_id,'maximal').
+					'</p>'.
+					($core->auth->check('categories', $core->blog->id) ?
+						'<div>'.
+						'<h5 id="create_cat">'.__('Add a new category').'</h5>'.
+						'<p><label for="new_cat_title">'.__('Title:').' '.
+						form::field('new_cat_title',30,255,'','maximal').'</label></p>'.
+						'<p><label for="new_cat_parent">'.__('Parent:').' '.
+						form::combo('new_cat_parent',$categories_combo,'','maximal').
+						'</label></p>'.
+						'</div>'
+					: ''))),
+		'options-box' => array(
+			'title' => __('Options'),
+			'items' => array(
+				'post_open_comment_tb' =>
+					'<div>'.
+					'<h5 id="label_comment_tb">'.__('Commentaires et rétroliens').'</h5>'.
+					'<p><label for="post_open_comment" class="classic">'.
+					form::checkbox('post_open_comment',1,$post_open_comment).' '.
+					__('Accept comments').'</label></p>'.
+					($core->blog->settings->system->allow_comments ? 
+						(isContributionAllowed($post_id,strtotime($post_dt),true) ? 
+							'' :
+							'<p class="form-note warn">'.
+							__('Warning: Comments are not more accepted for this entry.').'</p>') : 
+						'<p class="form-note warn">'.
+						__('Comments are not accepted on this blog so far.').'</p>').
+					'<p><label for="post_open_tb" class="classic">'.
+					form::checkbox('post_open_tb',1,$post_open_tb).' '.
+					__('Accept trackbacks').'</label></p>'.
+					($core->blog->settings->system->allow_trackbacks ? 
+						(isContributionAllowed($post_id,strtotime($post_dt),false) ? 
+							'' :
+							'<p class="form-note warn">'.
+							__('Warning: Trackbacks are not more accepted for this entry.').'</p>') : 
+						'<p class="form-note warn">'.__('Trackbacks are not accepted on this blog so far.').'</p>').
+					'</div>',
+				'post_password' =>
+					'<p><label for="post_password" class="ib">'.__('Password').'</label>'.
+					form::field('post_password',10,32,html::escapeHTML($post_password),'maximal').
+					'</p>',
+				'post_url' =>
+					'<div class="lockable">'.
+					'<p><label for="post_url" class="ib">'.__('Edit basename').'</label>'.
+					form::field('post_url',10,255,html::escapeHTML($post_url),'maximal').
+					'</p>'.
+					'<p class="form-note warn">'.
+					__('Warning: If you set the URL manually, it may conflict with another entry.').
+					'</p></div>'
+	))));
+
+	$main_items = new ArrayObject(array(
+		"post_title" =>
+			'<p class="col">'.
+			'<label class="required no-margin"><abbr title="'.__('Required field').'">*</abbr> '.__('Title:').'</label>'.
+			form::field('post_title',20,255,html::escapeHTML($post_title),'maximal').
+			'</p>',
+		
+		"post_excerpt" =>
+			'<p class="area" id="excerpt-area"><label for="post_excerpt">'.__('Excerpt:').'<span class="form-note">'.
+			__('Introduction to the post.').'</span></label> '.
+			form::textarea('post_excerpt',50,5,html::escapeHTML($post_excerpt)).
+			'</p>',
+		
+		"post_content" =>
+			'<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>',
+		
+		"post_notes" =>
+			'<p class="area" id="notes-area"><label for="post_notes">'.__('Personal notes:').'<span class="form-note">'.
+			__('Unpublished notes.').'</span></label>'.
+			form::textarea('post_notes',50,5,html::escapeHTML($post_notes)).
+			'</p>'
+		)
+	);
+	
+	# --BEHAVIOR-- adminPostFormItems
+	$core->callBehavior('adminPostFormItems',$main_items,$sidebar_items, isset($post) ? $post : null);
+
+	echo '<div class="multi-part" title="'.($post_id ? __('Edit entry') : __('New 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 '<h3 class="hidden">'.__('Edit post').'</h3>';
+	
+	foreach ($main_items as $id => $item) {
+		echo $item;
+	}
+
+	# --BEHAVIOR-- adminPostForm (may be deprecated)
+	$core->callBehavior('adminPostForm',isset($post) ? $post : null);
 	
 	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>'.
+	'<p class="border-top">'.
 	($post_id ? form::hidden('id',$post_id) : '').
 	'<input type="submit" value="'.__('Save').' (s)" '.
@@ -460,74 +547,16 @@
 	echo '<div id="entry-sidebar">';
 	
-	echo
-	'<p><label for="cat_id">'.__('Category:').
-	form::combo('cat_id',$categories_combo,$cat_id,'maximal').
-	'</label></p>'.
-	
-	($core->auth->check('categories', $core->blog->id) ?
-		'<div>'.
-		'<p id="new_cat">'.__('Add a new category').'</p>'.
-		'<p class="form-note info clear">'.__('This category will be created when you will save your post.').'</p>'.
-		'<p><label for="new_cat_title">'.__('Title:').' '.
-		form::field('new_cat_title',30,255,'','maximal').'</label></p>'.
-		'<p><label for="new_cat_parent">'.__('Parent:').' '.
-		form::combo('new_cat_parent',$categories_combo,'','maximal').
-		'</label></p>'.
-		'</div>'
-	: '').
-	
-	'<p><label for="post_status">'.__('Entry status:').
-	form::combo('post_status',$status_combo,$post_status,'','',!$can_publish).
-	'</label></p>'.
-	
-	'<p><label for="post_dt">'.__('Published on:').
-	form::field('post_dt',16,16,$post_dt,($bad_dt ? 'invalid' : '')).
-	'</label></p>'.
-	
-	'<p><label for="post_format">'.__('Text formating:').
-	form::combo('post_format',$formaters_combo,$post_format).
-	'</label>'.
-	'</p>'.
-	'<p>'.($post_id && $post_format != 'xhtml' ? '<a id="convert-xhtml" class="button" href="post.php?id='.$post_id.'&amp;xconv=1">'.__('Convert to XHTML').'</a>' : '').'</p>'.
-	
-	'<p><label for="post_open_comment" class="classic">'.form::checkbox('post_open_comment',1,$post_open_comment).' '.
-	__('Accept comments').'</label></p>'.
-	($core->blog->settings->system->allow_comments ? 
-		(isContributionAllowed($post_id,strtotime($post_dt),true) ? 
-			'' :
-			'<p class="form-note warn">'.__('Warning: Comments are not more accepted for this entry.').'</p>') : 
-		'<p class="form-note warn">'.__('Warning: Comments are not accepted on this blog.').'</p>').
-
-	'<p><label for="post_open_tb" class="classic">'.form::checkbox('post_open_tb',1,$post_open_tb).' '.
-	__('Accept trackbacks').'</label></p>'.
-	($core->blog->settings->system->allow_trackbacks ? 
-		(isContributionAllowed($post_id,strtotime($post_dt),false) ? 
-			'' :
-			'<p class="form-note warn">'.__('Warning: Trackbacks are not more accepted for this entry.').'</p>') : 
-		'<p class="form-note warn">'.__('Warning: Trackbacks are not accepted on this blog.').'</p>').
-
-	'<p><label for="post_selected" class="classic">'.form::checkbox('post_selected',1,$post_selected).' '.
-	__('Selected entry').'</label></p>'.
-	
-	'<p><label for="post_lang">'.__('Entry lang:').
-	form::combo('post_lang',$lang_combo,$post_lang).
-	'</label></p>'.
-	
-	'<p><label for="post_password">'.__('Entry password:').
-	form::field('post_password',10,32,html::escapeHTML($post_password),'maximal').
-	'</label></p>'.
-	
-	'<div class="lockable">'.
-	'<p><label for="post_url">'.__('Basename:').
-	form::field('post_url',10,255,html::escapeHTML($post_url),'maximal').
-	'</label></p>'.
-	'<p class="form-note warn">'.
-	__('Warning: If you set the URL manually, it may conflict with another entry.').
-	'</p>'.
-	'</div>';
-	
-	# --BEHAVIOR-- adminPostFormSidebar
+	foreach ($sidebar_items as $id => $c) {
+		echo '<div id="'.$id.'" class="box">'.
+			'<h4>'.$c['title'].'</h4>';
+		foreach ($c['items'] as $e_name=>$e_content) {
+			echo $e_content;
+		}
+		echo '</div>';
+	}
+	
+	
+	# --BEHAVIOR-- adminPostFormSidebar (may be deprecated)
 	$core->callBehavior('adminPostFormSidebar',isset($post) ? $post : null);
-	
 	echo '</div>';		// End #entry-sidebar
 
@@ -560,8 +589,8 @@
 	if ($can_edit_post && $core->auth->check('publish,contentadmin',$core->blog->id))
 	{
-		$combo_action[__('publish')] = 'publish';
-		$combo_action[__('unpublish')] = 'unpublish';
-		$combo_action[__('mark as pending')] = 'pending';
-		$combo_action[__('mark as junk')] = 'junk';
+		$combo_action[__('Publish')] = 'publish';
+		$combo_action[__('Unpublish')] = 'unpublish';
+		$combo_action[__('Mark as pending')] = 'pending';
+		$combo_action[__('Mark as junk')] = 'junk';
 	}
 	
@@ -571,11 +600,13 @@
 	}
 	
+	echo
+	'<div id="comments" class="multi-part" title="'.__('Comments').'">';
+		
 	# --BEHAVIOR-- adminCommentsActionsCombo
 	$core->callBehavior('adminCommentsActionsCombo',array(&$combo_action));
 	
 	$has_action = !empty($combo_action) && (!$trackbacks->isEmpty() || !$comments->isEmpty());
-	
-	echo
-	'<div id="comments" class="multi-part" title="'.__('Comments').'">';
+	echo 
+	'<p class="top-add"><a class="button add onblog_link" href="#comment-form">'.__('Add a comment').'</a></p>';
 	
 	if ($has_action) {
@@ -611,29 +642,24 @@
 		'</form>';
 	}
-	
-	echo '</div>';
-}
-
-/* Add a comment
--------------------------------------------------------- */
-if ($post_id)
-{
+	/* Add a comment
+	-------------------------------------------------------- */
+
 	echo
-	'<div class="multi-part" id="add-comment" title="'.__('Add a comment').'">'.
+	'<div class="fieldset clear">'.
 	'<h3>'.__('Add a comment').'</h3>'.
 	
 	'<form action="comment.php" method="post" id="comment-form">'.
 	'<div class="constrained">'.
-	'<p><label for="comment_author" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Name:').
+	'<p><label for="comment_author" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Name:').'</label>'.
 	form::field('comment_author',30,255,html::escapeHTML($core->auth->getInfo('user_cn'))).
-	'</label></p>'.
-	
-	'<p><label for="comment_email">'.__('Email:').
+	'</p>'.
+	
+	'<p><label for="comment_email">'.__('Email:').'</label>'.
 	form::field('comment_email',30,255,html::escapeHTML($core->auth->getInfo('user_email'))).
-	'</label></p>'.
-	
-	'<p><label for="comment_site">'.__('Web site:').
+	'</p>'.
+	
+	'<p><label for="comment_site">'.__('Web site:').'</label>'.
 	form::field('comment_site',30,255,html::escapeHTML($core->auth->getInfo('user_url'))).
-	'</label></p>'.
+	'</p>'.
 	
 	'<p class="area"><label for="comment_content" class="required"><abbr title="'.__('Required field').'">*</abbr> '.
@@ -645,7 +671,9 @@
 	$core->formNonce().
 	'<input type="submit" name="add" value="'.__('Save').'" /></p>'.
-	'</div>'.
+	'</div>'. #constrained
+
 	'</form>'.
-	'</div>';
+	'</div>'. #add comment
+	'</div>'; #comments
 }
 
@@ -677,9 +705,9 @@
 	echo
 	'<table class="comments-list"><tr>'.
-	'<th colspan="2">'.__('Author').'</th>'.
+	'<th colspan="2" class="first">'.__('Author').'</th>'.
 	'<th>'.__('Date').'</th>'.
 	'<th class="nowrap">'.__('IP address').'</th>'.
 	'<th>'.__('Status').'</th>'.
-	'<th>&nbsp;</th>'.
+	'<th>'.__('Edit').'</th>'.
 	'</tr>';
 	
@@ -691,14 +719,14 @@
 		switch ($rs->comment_status) {
 			case 1:
-				$img_status = sprintf($img,__('published'),'check-on.png');
+				$img_status = sprintf($img,__('Published'),'check-on.png');
 				break;
 			case 0:
-				$img_status = sprintf($img,__('unpublished'),'check-off.png');
+				$img_status = sprintf($img,__('Unpublished'),'check-off.png');
 				break;
 			case -1:
-				$img_status = sprintf($img,__('pending'),'check-wrn.png');
+				$img_status = sprintf($img,__('Pending'),'check-wrn.png');
 				break;
 			case -2:
-				$img_status = sprintf($img,__('junk'),'junk.png');
+				$img_status = sprintf($img,__('Junk'),'junk.png');
 				break;
 		}
@@ -715,5 +743,5 @@
 		'<td class="nowrap status">'.$img_status.'</td>'.
 		'<td class="nowrap status"><a href="'.$comment_url.'">'.
-		'<img src="images/edit-mini.png" alt="" title="'.__('Edit this comment').'" /></a></td>'.
+		'<img src="images/edit-mini.png" alt="" title="'.__('Edit this comment').'" /> '.__('Edit').'</a></td>'.
 		
 		'</tr>';
@@ -723,5 +751,5 @@
 }
 
-dcPage::helpBlock('core_post','core_wiki');
+dcPage::helpBlock('core_post','core_trackbacks','core_wiki');
 dcPage::close();
 ?>
Index: admin/posts.php
===================================================================
--- admin/posts.php	(revision 1179)
+++ admin/posts.php	(revision 1719)
@@ -47,48 +47,36 @@
 {
 	# Filter form we'll put in html_block
-	$users_combo = $categories_combo = array();
-	$users_combo['-'] = $categories_combo['-'] = '';
-	while ($users->fetch())
-	{
-		$user_cn = dcUtils::getUserCN($users->user_id,$users->user_name,
-		$users->user_firstname,$users->user_displayname);
-		
-		if ($user_cn != $users->user_id) {
-			$user_cn .= ' ('.$users->user_id.')';
-		}
-		
-		$users_combo[$user_cn] = $users->user_id; 
-	}
-	
-	$categories_combo[__('None')] = 'NULL';
-	while ($categories->fetch()) {
-		$categories_combo[str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').
-			html::escapeHTML($categories->cat_title).
-			' ('.$categories->nb_post.')'] = $categories->cat_id;
-	}
-	
-	$status_combo = array(
-	'-' => ''
-	);
-	foreach ($core->blog->getAllPostStatus() as $k => $v) {
-		$status_combo[$v] = (string) $k;
-	}
+	$users_combo = array_merge(
+		array('-' => ''),
+		dcAdminCombos::getUsersCombo($users)
+	);
+
+	$categories_combo = array_merge(
+		array('-' => ''),
+		dcAdminCombos::getCategoriesCombo($categories)
+	);
+	$categories_combo[__('(No cat)')] = 'NULL';
+	
+	$status_combo = array_merge(
+		array('-' => ''),
+		dcAdminCombos::getPostStatusesCombo()	
+	);
 	
 	$selected_combo = array(
 	'-' => '',
-	__('selected') => '1',
-	__('not selected') => '0'
+	__('Selected') => '1',
+	__('Not selected') => '0'
 	);
 	
 	# 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;
-	}
+	$dt_m_combo = array_merge(
+		array('-' => ''),
+		dcAdminCombos::getDatesCombo($dates)
+	);
+	
+	$lang_combo = array_merge(
+		array('-' => ''),
+		dcAdminCombos::getLangsCombo($langs,false)	
+	);
 	
 	$sortby_combo = array(
@@ -245,51 +233,64 @@
 }
 
-dcPage::open(__('Entries'),$starting_script);
-
+dcPage::open(__('Entries'),$starting_script,
+	dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			'<span class="page-title">'.__('Entries').'</span>' => ''
+		))
+);
+if (!empty($_GET['upd'])) {
+	dcPage::success(__('Selected entries have been successfully updated.'));
+} elseif (!empty($_GET['del'])) {
+	dcPage::success(__('Selected entries have been successfully deleted.'));
+}
 if (!$core->error->flag())
 {
-	echo 
-	'<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Entries').'</span></h2>'.
+	echo
 	'<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>';
+		__('Filter posts list').'</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>'.
+	'<h3 class="hidden">'.__('Filter posts list').'</h3>'.
+
+	'<div class="table">'.
+	'<div class="cell">'.
+	'<h4>'.__('Filters').'</h4>'.
+	'<p><label for="user_id" class="ib">'.__('Author:').'</label> '.
+	form::combo('user_id',$users_combo,$user_id).'</p>'.
+	'<p><label for="cat_id" class="ib">'.__('Category:').'</label> '.
+	form::combo('cat_id',$categories_combo,$cat_id).'</p>'.
+	'<p><label for="status" class="ib">'.__('Status:').'</label> ' .
+	form::combo('status',$status_combo,$status).'</p> '.
+	'</div>'.
+	
+	'<div class="cell filters-sibling-cell">'.
+	'<p><label for="selected" class="ib">'.__('Selected:').'</label> '.
+	form::combo('selected',$selected_combo,$selected).'</p>'.
+	'<p><label for="month" class="ib">'.__('Month:').'</label> '.
+	form::combo('month',$dt_m_combo,$month).'</p>'.
+	'<p><label for="lang" class="ib">'.__('Lang:').'</label> '.
+	form::combo('lang',$lang_combo,$lang).'</p> '.
+	'</div>'.
+	
+	'<div class="cell filters-options">'.
+	'<h4>'.__('Display options').'</h4>'.
+	'<p><label for="sortby" class="ib">'.__('Order by:').'</label> '.
+	form::combo('sortby',$sortby_combo,$sortby).'</p>'.
+	'<p><label for="order" class="ib">'.__('Sort:').'</label> '.
+	form::combo('order',$order_combo,$order).'</p>'.
+	'<p><span class="label ib">'.__('Show').'</span> <label for="nb" class="classic">'.
+	form::field('nb',3,3,$nb_per_page).' '.
+	__('entries per page').'</label></p>'.
+	'</div>'.
+	'</div>'.
+
+	'<p><input type="submit" value="'.__('Apply filters and display options').'" />'.
+	'<br class="clear" /></p>'. //Opera sucks
 	'</form>';
 	
Index: admin/posts_actions.php
===================================================================
--- admin/posts_actions.php	(revision 1421)
+++ admin/posts_actions.php	(revision 1719)
@@ -16,182 +16,325 @@
 
 $params = array();
-$action = '';
+
+/**
+* FieldsList - Compatibility class for hidden fields & entries[] fields
+*
+*/
+class FieldsList {
+	/** @var array list of hidden fields */
+	protected $hidden;
+	/** @var array list of selected entries */
+	protected $entries;
+
+
+   /**
+     * Class constructor
+	*/
+	public function __construct() {
+		$this->hidden=array();
+		$this->entries =array();
+	}
+
+    /**
+     * addHidden - adds a hidden field
+     * 
+     * @param string $name the field name.
+     * @param mixed $value the field value.
+     *
+     * @access public
+	 * @return the FieldsList instance, enabling to chain requests
+     */	
+	 public function addHidden($name,$value) {
+		$this->hidden[] = form::hidden($name,$value);
+		return $this;
+	}
+
+    /**
+     * addEntry - adds a antry field
+     * 
+     * @param string $id the entry id.
+     * @param mixed $title the entry title.
+     *
+     * @access public
+	 * @return the FieldsList instance, enabling to chain requests
+     */	
+	 public function addEntry($id,$title) {
+		$this->entries[$id]=$title;
+		return $this;
+	}
+
+    /**
+     * getHidden - returns the list of hidden fields, html encoded
+     *
+     * @access public
+	 * @return the list of hidden fields, html encoded
+     */
+	 public function getHidden() {
+		return join('',$this->hidden);
+	}
+	
+    /**
+     * getEntries - returns the list of entry fields, html encoded
+     *
+	 * @param boolean $hidden if set to true, returns entries as a list of hidden field
+	 *                if set to false, returns html code displaying the list of entries
+	 *                with a list of checkboxes to enable to select/deselect entries
+     * @access public
+	 * @return the list of entry fields, html encoded
+     */
+	public function getEntries ($hidden=false) {
+		$ret = '';
+		if ($hidden) {
+			foreach ($this->entries as $id=> $e) {
+				$ret .= form::hidden('entries[]',$id);
+			}
+		} else {
+			$ret = 
+				'<table class="posts-list"><tr>'.
+				'<th colspan="2">'.__('Title').'</th>'.
+				'</tr>';
+			foreach ($this->entries as $id=>$title) {
+				$ret .= 
+					'<tr><td>'.
+					form::checkbox(array('entries[]'),$id,true,'','').'</td>'.
+					'<td>'.	$title.'</td></tr>';
+			}
+			$ret .= '</table>';
+		}
+		return $ret;
+	}
+	
+    /**
+     * getEntriesQS - returns the list of entry fields as query string
+     *
+     * @access public
+	 * @return the list of entry fields, html encoded
+     */
+	public function getEntriesQS() {
+		$ret=array();
+		foreach ($this->entries as $id=>$title) {
+			$ret[] = 'entries[]='.$id;
+		}
+		return join('&',$ret);
+	}
+	
+    /**
+     * __toString - magic method. -- DEPRECATED here
+	 *              This method is only used to preserve compatibility with plugins 
+	 *				relying on previous versions of adminPostsActionsContent behavior, 
+	 *
+     * @access public
+	 * @return the list of hidden fields and entries (as hidden fields too), html encoded
+     */
+	public function __toString() {
+		return join('',$this->hidden).$this->getEntries(true);
+	}
+}
+
+$fields = new FieldsList();
+$posts_ids = array();
+
+if (isset($_POST['redir']) && strpos($_POST['redir'],'://') === false)
+{
+	$redir = $_POST['redir'];
+}
+else
+{
+	$redir =
+	'posts.php?user_id='.$_POST['user_id'].
+	'&cat_id='.$_POST['cat_id'].
+	'&status='.$_POST['status'].
+	'&selected='.$_POST['selected'].
+	'&month='.$_POST['month'].
+	'&lang='.$_POST['lang'].
+	'&sortby='.$_POST['sortby'].
+	'&order='.$_POST['order'].
+	'&page='.$_POST['page'].
+	'&nb='.$_POST['nb'];
+}
+$redir_sel = $redir;
+
+if (!empty($_POST['entries']))
+{
+	$entries = $_POST['entries'];
+	
+	foreach ($entries as $k => $v) {
+		$entries[$k] = (integer) $v;
+	}
+	
+	$params['sql'] = 'AND P.post_id IN('.implode(',',$entries).') ';
+	
+	if (!isset($_POST['full_content']) || empty($_POST['full_content'])) {
+		$params['no_content'] = true;
+	}
+	
+	if (isset($_POST['post_type'])) {
+		$params['post_type'] = $_POST['post_type'];
+	}
+	
+	$posts = $core->blog->getPosts($params);
+	while ($posts->fetch())	{
+		$posts_ids[] = $posts->post_id;
+		$fields->addEntry($posts->post_id,$posts->post_title);
+	}
+	// Redirection including selected entries
+	$redir_sel = $redir.'&'.$fields->getEntriesQS();
+
+} else {
+	$posts = $core->con->select("SELECT blog_id FROM ".$core->prefix."blog WHERE false");;
+}
 
 /* Actions
 -------------------------------------------------------- */
-if (!empty($_POST['action']) && !empty($_POST['entries']))
-{
-	$entries = $_POST['entries'];
+if (!empty($_POST['action']))
+{
 	$action = $_POST['action'];
-	
-	if (isset($_POST['redir']) && strpos($_POST['redir'],'://') === false)
-	{
-		$redir = $_POST['redir'];
-	}
-	else
-	{
-		$redir =
-		'posts.php?user_id='.$_POST['user_id'].
-		'&cat_id='.$_POST['cat_id'].
-		'&status='.$_POST['status'].
-		'&selected='.$_POST['selected'].
-		'&month='.$_POST['month'].
-		'&lang='.$_POST['lang'].
-		'&sortby='.$_POST['sortby'].
-		'&order='.$_POST['order'].
-		'&page='.$_POST['page'].
-		'&nb='.$_POST['nb'];
-	}
-	
-	foreach ($entries as $k => $v) {
-		$entries[$k] = (integer) $v;
-	}
-	
-	$params['sql'] = 'AND P.post_id IN('.implode(',',$entries).') ';
-	
-	if (!isset($_POST['full_content']) || empty($_POST['full_content'])) {
-		$params['no_content'] = true;
-	}
-	
-	if (isset($_POST['post_type'])) {
-		$params['post_type'] = $_POST['post_type'];
-	}
-	
-	$posts = $core->blog->getPosts($params);
-	
-	$posts_ids = array();
-	while ($posts->fetch())	{
-		$posts_ids[] = $posts->post_id;
-	}
-	
-	# --BEHAVIOR-- adminPostsActions
-	$core->callBehavior('adminPostsActions',$core,$posts,$action,$redir);
-	
-	if (preg_match('/^(publish|unpublish|schedule|pending)$/',$action))
-	{
-		switch ($action) {
-			case 'unpublish' : $status = 0; break;
-			case 'schedule' : $status = -1; break;
-			case 'pending' : $status = -2; break;
-			default : $status = 1; break;
+} 
+else
+{
+	$core->error->add(__('No action specified.'));
+	dcPage::open(
+		__('Entries'),'',dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			__('Entries') => 'posts.php',
+			'<span class="page-title">'.__('Entries actions').'</span>' => ''
+		))
+	);
+	
+	echo '<p><a class="back" href="'.html::escapeURL($redir_sel).'">'.__('Back to entries list').'</a></p>';
+
+	dcPage::close();
+	exit;
+}
+
+# --BEHAVIOR-- adminPostsActions
+$core->callBehavior('adminPostsActions',$core,$posts,$action,$redir);
+
+if (preg_match('/^(publish|unpublish|schedule|pending)$/',$action))
+{
+	switch ($action) {
+		case 'unpublish' : $status = 0; break;
+		case 'schedule' : $status = -1; break;
+		case 'pending' : $status = -2; break;
+		default : $status = 1; break;
+	}
+	
+	try
+	{
+		$core->blog->updPostsStatus($posts_ids,$status);
+		
+		http::redirect($redir_sel.'&upd=1');
+	}
+	catch (Exception $e)
+	{
+		$core->error->add($e->getMessage());
+	}
+}
+elseif ($action == 'selected' || $action == 'unselected')
+{
+	try
+	{
+		$core->blog->updPostsSelected($posts_ids,$action == 'selected');
+		
+		http::redirect($redir_sel."&upd=1");
+	}
+	catch (Exception $e)
+	{
+		$core->error->add($e->getMessage());
+	}
+}
+elseif ($action == 'delete')
+{
+	try
+	{
+		// Backward compatibility
+		foreach($posts_ids as $post_id)
+		{
+			# --BEHAVIOR-- adminBeforePostDelete
+			$core->callBehavior('adminBeforePostDelete',(integer) $post_id);
 		}
 		
-		try
+		# --BEHAVIOR-- adminBeforePostsDelete
+		$core->callBehavior('adminBeforePostsDelete',$posts_ids);
+		
+		$core->blog->delPosts($posts_ids);
+		
+		http::redirect($redir."&del=1");
+	}
+	catch (Exception $e)
+	{
+		$core->error->add($e->getMessage());
+	}
+	
+}
+elseif ($action == 'category' && isset($_POST['new_cat_id']))
+{
+	$new_cat_id = $_POST['new_cat_id'];
+	
+	try
+	{
+		if (!empty($_POST['new_cat_title']) && $core->auth->check('categories', $core->blog->id))
 		{
-			$core->blog->updPostsStatus($posts_ids,$status);
+			$cur_cat = $core->con->openCursor($core->prefix.'category');
+			$cur_cat->cat_title = $_POST['new_cat_title'];
+			$cur_cat->cat_url = '';
 			
-			http::redirect($redir);
+			$parent_cat = !empty($_POST['new_cat_parent']) ? $_POST['new_cat_parent'] : '';
+			
+			# --BEHAVIOR-- adminBeforeCategoryCreate
+			$core->callBehavior('adminBeforeCategoryCreate', $cur_cat);
+			
+			$new_cat_id = $core->blog->addCategory($cur_cat, (integer) $parent_cat);
+			
+			# --BEHAVIOR-- adminAfterCategoryCreate
+			$core->callBehavior('adminAfterCategoryCreate', $cur_cat, $new_cat_id);
 		}
-		catch (Exception $e)
-		{
-			$core->error->add($e->getMessage());
+		
+		$core->blog->updPostsCategory($posts_ids, $new_cat_id);
+		
+		http::redirect($redir_sel."&upd=1");
+	}
+	catch (Exception $e)
+	{
+		$core->error->add($e->getMessage());
+	}
+}
+elseif ($action == 'author' && isset($_POST['new_auth_id'])
+&& $core->auth->check('admin',$core->blog->id))
+{
+	$new_user_id = $_POST['new_auth_id'];
+	
+	try
+	{
+		if ($core->getUser($new_user_id)->isEmpty()) {
+			throw new Exception(__('This user does not exist'));
 		}
-	}
-	elseif ($action == 'selected' || $action == 'unselected')
-	{
-		try
-		{
-			$core->blog->updPostsSelected($posts_ids,$action == 'selected');
-			
-			http::redirect($redir);
-		}
-		catch (Exception $e)
-		{
-			$core->error->add($e->getMessage());
-		}
-	}
-	elseif ($action == 'delete')
-	{
-		try
-		{
-			// Backward compatibility
-			foreach($posts_ids as $post_id)
-			{
-				# --BEHAVIOR-- adminBeforePostDelete
-				$core->callBehavior('adminBeforePostDelete',(integer) $post_id);
-			}
-			
-			# --BEHAVIOR-- adminBeforePostsDelete
-			$core->callBehavior('adminBeforePostsDelete',$posts_ids);
-			
-			$core->blog->delPosts($posts_ids);
-			
-			http::redirect($redir);
-		}
-		catch (Exception $e)
-		{
-			$core->error->add($e->getMessage());
-		}
-		
-	}
-	elseif ($action == 'category' && isset($_POST['new_cat_id']))
-	{
-		$new_cat_id = $_POST['new_cat_id'];
-		
-		try
-		{
-			if (!empty($_POST['new_cat_title']) && $core->auth->check('categories', $core->blog->id))
-			{
-				$cur_cat = $core->con->openCursor($core->prefix.'category');
-				$cur_cat->cat_title = $_POST['new_cat_title'];
-				$cur_cat->cat_url = '';
-				
-				$parent_cat = !empty($_POST['new_cat_parent']) ? $_POST['new_cat_parent'] : '';
-				
-				# --BEHAVIOR-- adminBeforeCategoryCreate
-				$core->callBehavior('adminBeforeCategoryCreate', $cur_cat);
-				
-				$new_cat_id = $core->blog->addCategory($cur_cat, (integer) $parent_cat);
-				
-				# --BEHAVIOR-- adminAfterCategoryCreate
-				$core->callBehavior('adminAfterCategoryCreate', $cur_cat, $new_cat_id);
-			}
-			
-			$core->blog->updPostsCategory($posts_ids, $new_cat_id);
-			
-			http::redirect($redir);
-		}
-		catch (Exception $e)
-		{
-			$core->error->add($e->getMessage());
-		}
-	}
-	elseif ($action == 'author' && isset($_POST['new_auth_id'])
-	&& $core->auth->check('admin',$core->blog->id))
-	{
-		$new_user_id = $_POST['new_auth_id'];
-		
-		try
-		{
-			if ($core->getUser($new_user_id)->isEmpty()) {
-				throw new Exception(__('This user does not exist'));
-			}
-			
-			$cur = $core->con->openCursor($core->prefix.'post');
-			$cur->user_id = $new_user_id;
-			$cur->update('WHERE post_id '.$core->con->in($posts_ids));
-			
-			http::redirect($redir);
-		}
-		catch (Exception $e)
-		{
-			$core->error->add($e->getMessage());
-		}
-	}
-	elseif ($action == 'lang' && isset($_POST['new_lang']))
-	{
-		$new_lang = $_POST['new_lang'];
-		try
-		{
-			$cur = $core->con->openCursor($core->prefix.'post');
-			$cur->post_lang = $new_lang;
-			$cur->update('WHERE post_id '.$core->con->in($posts_ids));
-			
-			http::redirect($redir);
-		}
-		catch (Exception $e)
-		{
-			$core->error->add($e->getMessages());
-		}
+		
+		$cur = $core->con->openCursor($core->prefix.'post');
+		$cur->user_id = $new_user_id;
+		$cur->update('WHERE post_id '.$core->con->in($posts_ids));
+		
+		http::redirect($redir_sel."&upd=1");
+	}
+	catch (Exception $e)
+	{
+		$core->error->add($e->getMessage());
+	}
+}
+elseif ($action == 'lang' && isset($_POST['new_lang']))
+{
+	$new_lang = $_POST['new_lang'];
+	try
+	{
+		$cur = $core->con->openCursor($core->prefix.'post');
+		$cur->post_lang = $new_lang;
+		$cur->update('WHERE post_id '.$core->con->in($posts_ids));
+		
+		http::redirect($redir_sel."&upd=1");
+	}
+	catch (Exception $e)
+	{
+		$core->error->add($e->getMessages());
 	}
 }
@@ -231,73 +374,68 @@
 }
 
-$hidden_fields = '';
-while ($posts->fetch()) {
-	$hidden_fields .= form::hidden(array('entries[]'),$posts->post_id);
-}
-
 if (isset($_POST['redir']) && strpos($_POST['redir'],'://') === false)
 {
-	$hidden_fields .= form::hidden(array('redir'),html::escapeURL($_POST['redir']));
+	$fields->addHidden(array('redir'),html::escapeURL($_POST['redir']));
 }
 else
 {
-	$hidden_fields .=
-	form::hidden(array('user_id'),$_POST['user_id']).
-	form::hidden(array('cat_id'),$_POST['cat_id']).
-	form::hidden(array('status'),$_POST['status']).
-	form::hidden(array('selected'),$_POST['selected']).
-	form::hidden(array('month'),$_POST['month']).
-	form::hidden(array('lang'),$_POST['lang']).
-	form::hidden(array('sortby'),$_POST['sortby']).
-	form::hidden(array('order'),$_POST['order']).
-	form::hidden(array('page'),$_POST['page']).
-	form::hidden(array('nb'),$_POST['nb']);
+	$fields
+		->addHidden(array('user_id'),$_POST['user_id'])
+		->addHidden(array('cat_id'),$_POST['cat_id'])
+		->addHidden(array('status'),$_POST['status'])
+		->addHidden(array('selected'),$_POST['selected'])
+		->addHidden(array('month'),$_POST['month'])
+		->addHidden(array('lang'),$_POST['lang'])
+		->addHidden(array('sortby'),$_POST['sortby'])
+		->addHidden(array('order'),$_POST['order'])
+		->addHidden(array('page'),$_POST['page'])
+		->addHidden(array('nb'),$_POST['nb'])
+	;
 }
 
 if (isset($_POST['post_type'])) {
-	$hidden_fields .= form::hidden(array('post_type'),$_POST['post_type']);
+	$fields->addHidden(array('post_type'),$_POST['post_type']);
 }
 
 # --BEHAVIOR-- adminPostsActionsContent
-$core->callBehavior('adminPostsActionsContent',$core,$action,$hidden_fields);
+$core->callBehavior('adminPostsActionsContent',$core,$action,$fields);
 
 if ($action == 'category')
 {
-	echo '<h2 class="page-title">'.__('Change category for entries').'</h2>';
-	
+	echo dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			__('Entries') => 'posts.php',
+			'<span class="page-title">'.__('Change category for this selection').'</span>' => ''
+	));
+	
+	echo '<p><a class="back" href="'.html::escapeURL($redir_sel).'">'.__('Back to entries list').'</a></p>';
+
+	# categories list
 	# Getting categories
-	$categories_combo = array(__('(No cat)') => '');
-	try {
-		$categories = $core->blog->getCategories(array('post_type'=>'post'));
-		if (!$categories->isEmpty()) {
-			while ($categories->fetch()) {
-				$catparents_combo[] = $categories_combo[] = new formSelectOption(
-					str_repeat('&nbsp;&nbsp;',$categories->level-1).($categories->level-1 == 0 ? '' : '&bull; ').html::escapeHTML($categories->cat_title),
-					$categories->cat_id
-				);
-			}
-		}
-	} catch (Exception $e) { }
+	$categories_combo = dcAdminCombos::getCategoriesCombo(
+		$core->blog->getCategories(array('post_type'=>'post'))
+	);
 	
 	echo
 	'<form action="posts_actions.php" method="post">'.
-	'<p><label for="new_cat_id" class="classic">'.__('Category:').' '.
-	form::combo('new_cat_id',$categories_combo,'').
-	'</label> ';
+	$fields->getEntries().
+	'<p><label for="new_cat_id" class="classic">'.__('Category:').'</label> '.
+	form::combo('new_cat_id',$categories_combo,'');
 	
 	if ($core->auth->check('categories', $core->blog->id)) {
 		echo 
 		'<div>'.
-		'<p id="new_cat">'.__('Add a new category').'</p>'.
-		'<p><label for="new_cat_title">'.__('Title:').' '.
-		form::field('new_cat_title',30,255,'','maximal').'</label></p>'.
-		'<p><label for="new_cat_parent">'.__('Parent:').' '.
-		form::combo('new_cat_parent',$categories_combo,'','maximal').
-		'</label></p>'.
+		'<p id="new_cat">'.__('Create a new category for the post(s)').'</p>'.
+		'<p><label for="new_cat_title">'.__('Title:').'</label> '.
+		form::field('new_cat_title',30,255,'','').'</p>'.
+		'<p><label for="new_cat_parent">'.__('Parent:').'</label> '.
+		form::combo('new_cat_parent',$categories_combo,'','').
+		'</p>'.
 		'</div>';
 	}
 	
 	echo
-	$hidden_fields.
+	$fields->getHidden().
 	$core->formNonce().
 	form::hidden(array('action'),'category').
@@ -307,30 +445,26 @@
 elseif ($action == 'lang')
 {
-	echo '<h2 class="page-title">'.__('Change language for entries').'</h2>';
-	
+	echo dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			__('Entries') => 'posts.php',
+			'<span class="page-title">'.__('Change language for this selection').'</span>' => ''
+	));
+	echo '<p><a class="back" href="'.html::escapeURL($redir_sel).'">'.__('Back to entries list').'</a></p>';
+
 	# lang list
 	# Languages combo
 	$rs = $core->blog->getLangs(array('order'=>'asc'));
-	$all_langs = l10n::getISOcodes(0,1);
-	$lang_combo = array('' => '', __('Most used') => array(), __('Available') => l10n::getISOcodes(1,1));
-	while ($rs->fetch()) {
-		if (isset($all_langs[$rs->post_lang])) {
-			$lang_combo[__('Most used')][$all_langs[$rs->post_lang]] = $rs->post_lang;
-			unset($lang_combo[__('Available')][$all_langs[$rs->post_lang]]);
-		} else {
-			$lang_combo[__('Most used')][$rs->post_lang] = $rs->post_lang;
-		}
-	}
-	unset($all_langs);
-	unset($rs);
+	$lang_combo = dcAdminCombos::getLangsCombo($rs,true);
 	
 	echo
 	'<form action="posts_actions.php" method="post">'.
-	'<p><label for="new_lang" class="classic">'.__('Entry lang:').' '.
-	form::combo('new_lang',$lang_combo,'').
-	'</label> ';
+	$fields->getEntries().
+	
+	'<p><label for="new_lang" class="classic">'.__('Entry lang:').'</label> '.
+	form::combo('new_lang',$lang_combo,'');
 	
 	echo
-	$hidden_fields.
+	$fields->getHidden().
 	$core->formNonce().
 	form::hidden(array('action'),'lang').
@@ -341,14 +475,20 @@
 elseif ($action == 'author' && $core->auth->check('admin',$core->blog->id))
 {
-	echo '<h2 class="page-title">'.__('Change author for entries').'</h2>';
-	
+	echo dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			__('Entries') => 'posts.php',
+			'<span class="page-title">'.__('Change author for this selection').'</span>' => ''
+	));
+	echo '<p><a class="back" href="'.html::escapeURL($redir_sel).'">'.__('Back to entries list').'</a></p>';
+
 	echo
 	'<form action="posts_actions.php" method="post">'.
-	'<p><label for="new_auth_id" class="classic">'.__('Author ID:').' '.
-	form::field('new_auth_id',20,255).
-	'</label> ';
+	$fields->getEntries().
+	'<p><label for="new_auth_id" class="classic">'.__('New author (author ID):').'</label> '.
+	form::field('new_auth_id',20,255);
 	
 	echo
-	$hidden_fields.
+	$fields->getHidden().
 	$core->formNonce().
 	form::hidden(array('action'),'author').
@@ -357,6 +497,4 @@
 }
 
-echo '<p><a class="back" href="'.html::escapeURL($redir).'">'.__('back').'</a></p>';
-
 dcPage::close();
 ?>
Index: admin/preferences.php
===================================================================
--- admin/preferences.php	(revision 1375)
+++ admin/preferences.php	(revision 1726)
@@ -56,11 +56,8 @@
 }
 
-foreach ($core->getFormaters() as $v) {
-	$formaters_combo[$v] = $v;
-}
-
-foreach ($core->blog->getAllPostStatus() as $k => $v) {
-	$status_combo[$v] = $k;
-}
+# Formaters combo
+$formaters_combo = dcAdminCombos::getFormatersCombo();
+
+$status_combo = dcAdminCombos::getPostStatusescombo();
 
 $iconsets_combo = array(__('Default') => '');
@@ -77,9 +74,5 @@
 
 # Language codes
-$langs = l10n::getISOcodes(1,1);
-foreach ($langs as $k => $v) {
-	$lang_avail = $v == 'en' || is_dir(DC_L10N_ROOT.'/'.$v);
-	$lang_combo[] = new formSelectOption($k,$v,$lang_avail ? 'avail10n' : '');
-}
+$lang_combo = dcAdminCombos::getAdminLangsCombo();
 
 # Add or update user
@@ -361,27 +354,31 @@
 	
 	# --BEHAVIOR-- adminPreferencesHeaders
-	$core->callBehavior('adminPreferencesHeaders')
+	$core->callBehavior('adminPreferencesHeaders'),
+
+	dcPage::breadcrumb(
+	array(
+		html::escapeHTML($core->auth->userID()) => '',
+		'<span class="page-title">'.$page_title.'</span>' => ''
+	))
 );
 
 if (!empty($_GET['upd'])) {
-	dcPage::message(__('Personal information has been successfully updated.'));
+	dcPage::success(__('Personal information has been successfully updated.'));
 }
 if (!empty($_GET['updated'])) {
-	dcPage::message(__('Personal options has been successfully updated.'));
+	dcPage::success(__('Personal options has been successfully updated.'));
 }
 if (!empty($_GET['append'])) {
-	dcPage::message(__('Favorites have been successfully added.'));
+	dcPage::success(__('Favorites have been successfully added.'));
 }
 if (!empty($_GET['neworder'])) {
-	dcPage::message(__('Favorites have been successfully updated.'));
+	dcPage::success(__('Favorites have been successfully updated.'));
 }
 if (!empty($_GET['removed'])) {
-	dcPage::message(__('Favorites have been successfully removed.'));
+	dcPage::success(__('Favorites have been successfully removed.'));
 }
 if (!empty($_GET['replaced'])) {
-	dcPage::message(__('Default favorites have been successfully updated.'));
-}
-
-echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.$page_title.'</span></h2>';
+	dcPage::success(__('Default favorites have been successfully updated.'));
+}
 
 # User profile
@@ -389,69 +386,60 @@
 
 echo
+'<h3 class="hidden-if-js">'.__('My profile').'</h3>'.
 '<form action="preferences.php" method="post" id="user-form">'.
-'<fieldset><legend>'.__('My profile').'</legend>'.
-'<div class="two-cols">'.
-'<div class="col">'.
-'<p><label for="user_name">'.__('Last Name:').
-form::field('user_name',20,255,html::escapeHTML($user_name)).'</label></p>'.
-
-'<p><label for="user_firstname">'.__('First Name:').
-form::field('user_firstname',20,255,html::escapeHTML($user_firstname)).'</label></p>'.
-
-'<p><label for="user_displayname">'.__('Display name:').
-form::field('user_displayname',20,255,html::escapeHTML($user_displayname)).'</label></p>'.
-
-'<p><label for="user_email">'.__('Email:').
-form::field('user_email',20,255,html::escapeHTML($user_email)).'</label></p>'.
-
-'<p><label for="user_url">'.__('URL:').
-form::field('user_url',30,255,html::escapeHTML($user_url)).'</label></p>'.
-
-'</div>'.
-
-'<div class="col">'.
-
-'<p><label for="user_lang">'.__('User language:').
-form::combo('user_lang',$lang_combo,$user_lang,'l10n').'</label></p>'.
-
-'<p><label for="user_tz">'.__('User timezone:').
-form::combo('user_tz',dt::getZones(true,true),$user_tz).'</label></p>'.
-
-'</div>'.
-'</div>'.
-'<br class="clear" />'. //Opera sucks
-'</fieldset>';
+
+'<p><label for="user_name">'.__('Last Name:').'</label>'.
+form::field('user_name',20,255,html::escapeHTML($user_name)).'</p>'.
+
+'<p><label for="user_firstname">'.__('First Name:').'</label>'.
+form::field('user_firstname',20,255,html::escapeHTML($user_firstname)).'</p>'.
+
+'<p><label for="user_displayname">'.__('Display name:').'</label>'.
+form::field('user_displayname',20,255,html::escapeHTML($user_displayname)).'</p>'.
+
+'<p><label for="user_email">'.__('Email:').'</label>'.
+form::field('user_email',20,255,html::escapeHTML($user_email)).'</p>'.
+
+'<p><label for="user_url">'.__('URL:').'</label>'.
+form::field('user_url',30,255,html::escapeHTML($user_url)).'</p>'.
+
+'<p><label for="user_lang">'.__('Language for my interface:').'</label>'.
+form::combo('user_lang',$lang_combo,$user_lang,'l10n').'</p>'.
+
+'<p><label for="user_tz">'.__('My timezone:').'</label>'.
+form::combo('user_tz',dt::getZones(true,true),$user_tz).'</p>';
+
 
 if ($core->auth->allowPassChange())
 {
 	echo
-	'<fieldset>'.
-	'<legend>'.__('Change your password').'</legend>'.
+	'<h4 class="vertical-separator">'.__('Change my password').'</h4>'.
 	
 	'<div class="pw-table">'.
 	'<p class="pw-cell"><label for="new_pwd">'.__('New password:').'</label>'.
 	form::password('new_pwd',20,255,'','','',false,' data-indicator="pwindicator" ').'</p>'.
-    '<div id="pwindicator">'.
-    '    <div class="bar"></div>'.
-    '    <p class="label no-margin"></p>'.
-    '</div>'.
-    '</div>'.
+	'<div id="pwindicator">'.
+	'    <div class="bar"></div>'.
+	'    <p class="label no-margin"></p>'.
+	'</div>'.
+	'</div>'.
 	
-	'<p><label for="new_pwd_c">'.__('Confirm password:').'</label>'.
+	'<p><label for="new_pwd_c">'.__('Confirm new password:').'</label>'.
 	form::password('new_pwd_c',20,255).'</p>'.
-	'</fieldset>'.
 	
-	'<p>'.__('If you have changed this user email or password you must provide your current password to save these modifications.').'</p>'.
-	'<p><label for="cur_pwd">'.__('Your password:').'</label>'.
-	form::password('cur_pwd',20,255).'</p>';
-}
-
-echo
-'<p class="clear">'.
+	'<p><label for="cur_pwd">'.__('Your current password:').'</label>'.
+	form::password('cur_pwd',20,255).'</p>'.
+	'<p class="form-note warn">'.
+	__('If you have changed your email or password you must provide your current password to save these modifications.').
+	'</p>';
+}
+
+echo
+'<p class="clear vertical-separator">'.
 $core->formNonce().
-'<input type="submit" accesskey="s" value="'.__('Save').'" /></p>'.
-'</form>';
-
-echo '</div>';
+'<input type="submit" accesskey="s" value="'.__('Update my profile').'" /></p>'.
+'</form>'.
+
+'</div>';
 
 # User options : some from actual user profile, dashboard modules, ...
@@ -460,34 +448,15 @@
 echo
 '<form action="preferences.php" method="post" id="opts-forms">'.
-'<fieldset><legend>'.__('My options').'</legend>'.
-
-'<p><label for="user_post_format">'.__('Preferred format:').
-form::combo('user_post_format',$formaters_combo,$user_options['post_format']).'</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_wysiwyg" class="classic">'.
-form::checkbox('user_wysiwyg',1,$user_options['enable_wysiwyg']).' '.
-__('Enable WYSIWYG mode').'</label></p>'.
+'<h3 class="hidden-if-js">'.__('My options').'</h3>';
+
+echo
+'<div class="two-cols">'.
+
+'<div class="col">'.
+'<h4>'.__('Interface').'</h4>'.
 
 '<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>'.
-
-'<p><label for="user_ui_nofavmenu" class="classic">'.
-form::checkbox('user_ui_nofavmenu',1,$user_ui_nofavmenu).' '.
-__('Hide My favorites menu').'</label></p>';
-
-if (count($iconsets_combo) > 1) {
-	echo 
-		'<p><label for="user_ui_iconset">'.__('Iconset:').
-		form::combo('user_ui_iconset',$iconsets_combo,$user_ui_iconset).'</label></p>';
-} else {
-	form::hidden('user_ui_iconset','');
-}
+__('Activate enhanced uploader in media manager').'</label></p>';
 
 if ($core->auth->isSuperAdmin()) {
@@ -496,13 +465,10 @@
 	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>';
-
-echo
-'<fieldset><legend>'.__('Accessibility options').'</legend>'.
+	'<p class="clear form-note warn">'.__('This will be applied for all users').'.'.
+	'</p>';//Opera sucks;
+}
+
+echo
+'<h5>'.__('Accessibility').'</h5>'.
 
 '<p><label for="user_acc_nodragdrop" class="classic">'.
@@ -510,9 +476,48 @@
 __('Disable javascript powered drag and drop for ordering items').'</label></p>'.
 
-'<p class="clear form-note info">'.__('Numeric fields will allow to type the elements\' ordering number.').'</p>'.
-'</fieldset>';
-
-echo
-'<fieldset><legend>'.__('Dashboard modules').'</legend>'.
+'<p class="clear form-note">'.__('If checked, numeric fields will allow to type the elements\' ordering number.').'</p>';
+
+echo
+'<h4 class="border-top">'.__('Edition').'</h4>'.
+
+'<p><label for="user_post_format">'.__('Preferred format:').'</label>'.
+form::combo('user_post_format',$formaters_combo,$user_options['post_format']).'</p>'.
+
+'<p><label for="user_post_status">'.__('Default entry status:').'</label>'.
+form::combo('user_post_status',$status_combo,$user_post_status).'</p>'.
+
+'<p><label for="user_edit_size">'.__('Entry edit field height:').'</label>'.
+form::field('user_edit_size',5,4,(integer) $user_options['edit_size']).'</p>'.
+
+'<p><label for="user_wysiwyg" class="classic">'.
+form::checkbox('user_wysiwyg',1,$user_options['enable_wysiwyg']).' '.
+__('Enable WYSIWYG mode').'</label></p>';
+
+echo
+'<h4 class="border-top">'.__('Other options').'</h4>';
+
+# --BEHAVIOR-- adminPreferencesForm
+$core->callBehavior('adminPreferencesForm',$core);
+
+echo
+'</div>'.
+
+'<div class="col">'.
+'<h4>'.__('Dashboard and menu').'</h4>'.
+
+'<p><label for="user_ui_nofavmenu" class="classic">'.
+form::checkbox('user_ui_nofavmenu',1,$user_ui_nofavmenu).' '.
+__('Hide My favorites menu').'</label></p>';
+
+if (count($iconsets_combo) > 1) {
+	echo 
+		'<p><label for="user_ui_iconset" class="classic">'.__('Iconset:').'</label> '.
+		form::combo('user_ui_iconset',$iconsets_combo,$user_ui_iconset).'</p>';
+} else {
+	form::hidden('user_ui_iconset','');
+}
+
+echo
+'<h5>'.('Dashboard modules').'</h5>'.
 
 '<p><label for="user_dm_doclinks" class="classic">'.
@@ -526,16 +531,15 @@
 '<p><label for="user_dm_quickentry" class="classic">'.
 form::checkbox('user_dm_quickentry',1,$user_dm_quickentry).' '.
-__('Display quick entry form').'</label></p>'.
-
-'<br class="clear" />'. //Opera sucks
-'</fieldset>';
-
-# --BEHAVIOR-- adminPreferencesForm
-$core->callBehavior('adminPreferencesForm',$core);
-
-echo
-'<p class="clear">'.
+__('Display quick entry form').'</label><br class="clear" />'. //Opera sucks
+'</p>';
+
+echo
+'</div>'.
+'</div>';
+
+echo
+'<p class="clear border-top">'.
 $core->formNonce().
-'<input type="submit" accesskey="s" value="'.__('Save').'" /></p>'.
+'<input type="submit" accesskey="s" value="'.__('Save my options').'" /></p>'.
 '</form>';
 
@@ -547,6 +551,7 @@
 echo '<form action="preferences.php" method="post" id="favs-form">';
 echo '<div class="two-cols">';
+
 echo '<div class="col70">';
-echo '<fieldset id="my-favs"><legend>'.__('My favorites').'</legend>';
+echo '<div id="my-favs" class="fieldset"><h3>'.__('My favorites').'</h3>';
 
 $count = 0;
@@ -592,8 +597,8 @@
 }
 
-echo '</fieldset>';
+echo '</div>';
 
 echo '<div id="default-favs"><h3>'.__('Default favorites').'</h3>';
-echo '<p class="form-note info clear">'.__('Those favorites are displayed when My Favorites list is empty.').'</p>';
+echo '<p>'.__('Those favorites are displayed when My Favorites list is empty.').'</p>';
 $count = 0;
 foreach ($ws->dumpPrefs() as $k => $v) {
@@ -612,7 +617,9 @@
 echo '</div>';
 echo '</div>';
-echo '<div class="col30" id="available-favs">';
+
+
+echo '<div class="col30 fieldset" id="available-favs">';
 # Available favorites
-echo '<fieldset><legend>'.__('Available favorites').'</legend>';
+echo '<h3>'.__('Available favorites').'</h3>';
 $count = 0;
 $array = $_fav;
@@ -640,6 +647,7 @@
 $core->formNonce().
 '<input type="submit" name="appendaction" value="'.__('Add to my favorites').'" /></p>';
-echo '</fieldset>';
 echo '</div>';
+
+
 echo '</div>'; # Two-cols
 echo '</form>';
Index: admin/search.php
===================================================================
--- admin/search.php	(revision 1276)
+++ admin/search.php	(revision 1589)
@@ -15,5 +15,5 @@
 dcPage::check('usage,contentadmin');
 
-$q = !empty($_GET['q']) ? $_GET['q'] : null;
+$q = !empty($_GET['q']) ? $_GET['q'] : (!empty($_GET['qx']) ? $_GET['qx'] : null);
 $qtype = !empty($_GET['qtype']) ? $_GET['qtype'] : 'p';
 if ($qtype != 'c' && $qtype != 'p') {
@@ -70,13 +70,18 @@
 
 
-dcPage::open(__('Search'),$starting_scripts);
+dcPage::open(__('Search'),$starting_scripts,
+	dcPage::breadcrumb(
+		array(
+			html::escapeHTML($core->blog->name) => '',
+			'<span class="page-title">'.__('Search').'</span>' => ''
+		))
+);
 
 echo
-'<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.__('Search').'</span></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><label for="qtype1" class="classic">'.form::radio(array('qtype','qtype1'),'p',$qtype == 'p').' '.__('Search in entries').'</label> '.
+'<label for="qtype2" class="classic">'.form::radio(array('qtype','qtype2'),'c',$qtype == 'c').' '.__('Search in comments').'</label></p>'.
 '<p><input type="submit" value="'.__('Search').'" /></p>'.
 '</div>'.
Index: admin/services.php
===================================================================
--- admin/services.php	(revision 1538)
+++ admin/services.php	(revision 1699)
@@ -26,4 +26,5 @@
 $core->rest->addFunction('setPostMeta',array('dcRestMethods','setPostMeta'));
 $core->rest->addFunction('searchMeta',array('dcRestMethods','searchMeta'));
+$core->rest->addFunction('setSectionFold',array('dcRestMethods','setSectionFold'));
 
 $core->rest->serve();
@@ -412,4 +413,35 @@
 		return $rsp;
 	}
+	
+	public static function setSectionFold($core,$get,$post)
+	{
+		if (empty($post['section'])) {
+			throw new Exception('No section name');
+		}
+		if ($core->auth->user_prefs->toggles === null) {
+			$core->auth->user_prefs->addWorkspace('toggles');
+		}
+		$section = $post['section'];
+		$status = isset($post['value']) && ($post['value'] != 0);
+		if ($core->auth->user_prefs->toggles->prefExists('unfolded_sections')) {
+			$toggles = explode(',',trim($core->auth->user_prefs->toggles->unfolded_sections));
+		} else {
+			$toggles = array();
+		}
+		$k = array_search($section,$toggles);
+		if ($status) { // true == Fold section ==> remove it from unfolded list
+			if ($k !== false) {
+				unset($toggles[$k]);
+			} 
+		} else { // false == unfold section ==> add it to unfolded list
+			if ($k === false) {
+				$toggles[]=$section;
+			}; 
+		}
+		$core->auth->user_prefs->toggles->put('unfolded_sections',join(',',$toggles));
+		return true;
+	}
+		
+	
 }
 ?>
Index: admin/style/date-picker.css
===================================================================
--- admin/style/date-picker.css	(revision 0)
+++ admin/style/date-picker.css	(revision 1330)
@@ -1,35 +1,35 @@
 .date-picker {
-	border-collapse : collapse;
-	background : #fff;
-	color : #fff;
+	border-collapse: collapse;
+	background: #fff;
+	color: #fff;
 	border: 1px solid #666;
-	border-width : 1px 2px 2px 1px;
+	border-width: 1px 2px 2px 1px;
 }
 .date-picker th {
-	border : none;
-	color : #000;
-	text-align : center;
+	border: none;
+	color: #000;
+	text-align: center;
 }
 .date-picker td {
-	border : 1px solid #666;
-	text-align : center;
+	border: 1px solid #666;
+	text-align: center;
 	padding : 4px 6px;
 }
 th.date-picker-month {
-	text-align : left;
+	text-align: left;
 }
 th.date-picker-year {
-	text-align : right;
+	text-align: right;
 }
 .date-picker-control, th.date-picker-control {
-	color : #06c;
-	cursor : pointer;
+	color: #06c;
+	cursor: pointer;
 }
 .date-picker-day, .date-picker-today {
-	color : #000;
-	background : #eee;
-	cursor : pointer;
+	color: #000;
+	background: #eee;
+	cursor: pointer;
 }
 .date-picker-today {
-	background : #ccc;
+	background: #ccc;
 }
Index: admin/style/default.css
===================================================================
--- admin/style/default.css	(revision 1375)
+++ admin/style/default.css	(revision 1727)
@@ -13,13 +13,16 @@
 
 /* ------------------------------------------------------------------ html */
+html {
+	font-size: 62.5%;
+}
 body {
-	font: 75%/1.5em Helvetica,Arial,sans-serif;
+	font-size: 12px; /* ie < 9 sucks */
+	font-size: 1.2rem;
+	line-height: 1.5;
+	font-family: Arial,Helvetica,sans-serif;
 	color: #333;
-	background: #f5f5f5;
+	background: #fff;
 	margin: 0;
 	padding: 0;
-}
-body.auth {
-	background: #fff;
 }
 
@@ -27,28 +30,63 @@
 	color: #2373A8;
 	text-decoration: none;
-	border-bottom: 1px dotted #f90;
+	border-bottom: 1px dotted #999;
 }
 a:hover, a:active, a:focus {
 	text-decoration: underline;
 }
-a img, a:link img, a:visited img { 
+a img, a:link img, a:visited img {
 	border:none;
 }
-
-h1, h2, h3, h4, h5, h6, p {
+h1, h2, h3, .as_h3, h4, h5, h6, p {
 	margin-top: 0;
-	margin-bottom: 0.6em;
+	margin-bottom: 1em;
 }
 h2 {
 	color: #666;
-	font-size: 1.4em;
-	padding: 4px 0;
+	font-size: 18px; /* ie < 9 sucks */
+	font-size: 1.8rem;
+	padding: 0 0 1.5em;
+	font-weight: normal;
+}
+h2 a:link, h2 a:visited {
+	color: #666;
+	border-color: #000;
 }
 .page-title {
 	color: #d30e60;
 }
-h3 {
+.page-title img {
+	padding-left: .5em;
+	vertical-align: middle;
+}
+#content > h2 {
+	padding: 0 18px 6px; /* ie < 9 sucks */
+	padding: 0 1.8rem .6rem;
+	margin: 0 -18px .5em; /* ie < 9 sucks */
+	margin: 0 -1.8rem 1rem;
+	background: #fff url(bg_h2.png) repeat-x center bottom;
+}
+h3, .as_h3 {
+	color: #575859;
+	font-size: 16px; /* ie < 9 sucks */
+	font-size: 1.6rem;
+}
+h4 {
+	font-size: 14px; /* ie < 9 sucks */
+	font-size: 1.4rem;
+	color: #575859;
+}
+h5 {
+	font-size: 12px; /* ie < 9 sucks */
+	font-size: 1.2rem;
+	color: #575859;
+}
+#entry-sidebar h5 {
+	font-weight: normal;
 	color: #333;
-	font-size: 1.2em;
+}
+.entry-status img.img_select_option {
+	padding-left: 4px;
+	vertical-align: text-top;
 }
 p, div.p {
@@ -57,5 +95,5 @@
 hr {
 	height: 1px;
-	border-width: 1px 0 0 0;
+	border-width: 1px 0 0;
 	border-color: #999;
 	border-style: solid;
@@ -83,29 +121,36 @@
 #header {
 	background: #575859;
-	height: 3em;
 	position: relative;
+	border-bottom: 4px solid #A2CBE9;
+	width: 100%;
 }
 #prelude {
-	background: #575859;
-	line-height: 1.5em;
-	margin: 0;
-	padding: 0 1.7em 0 1em;
+	line-height: 1.5;
+	margin: 0;
+	padding: 0;
 	overflow: hidden;
 	position: absolute;
-	top: 1.2em;
+	top: 3em;
 	left: 0;
+	background: #A2CBE9;
+	width: 100%;
 	}
 #prelude li {
 	list-style-type: none;
-	margin: 0 1em 0 0;
+	margin: 0;
 	background:transparent;
-	}
+	display: inline;
+}
 #prelude li a {
-	color:#fff;
-	}
+	padding: 3px 16px 3px 8px; /* ie < 9 sucks */
+	padding: 3px 1.6rem 3px .8rem;
+	background: #A2CBE9;
+	color: #000;
+	border-bottom-color: #A2CBE9;
+}
 #top {
 	margin: 0;
 	padding: 0;
-	width: 13em;
+	width: 14.5em;
 	float: left;
 }
@@ -113,38 +158,41 @@
 	padding: 0;
 	margin: 0;
-	height: 3em;
+	height: 36px;
 	text-indent: -1000px;
-	background: transparent url(dc_logo.png) no-repeat 0 50%;
 }
 #top h1 a {
 	position: absolute;
-	top: 3px;
+	top: 0;
 	left: 0;
-	width: 130px;
-	height: 60px;
+	width: 174px; /* ie < 9 sucks */
+	width: 17.4rem;
+	height: 36px; /* ie < 9 sucks */
+	height: 3.6rem;
 	border: none;
-	outline: none;
 	color: #fff;
 }
+#top h1 a:link {
+	background: transparent url(dc_logos/b-dotclear120.png) no-repeat 0 6px;
+}
+#top h1 a:hover, #top h1 a:focus {
+	background: transparent url(dc_logos/b-dotclear120.png) no-repeat 0 -94px;
+}
 #info-boxes {
-	background: #575859;
-	font-size: .95em;
-	height: 3em;
+	font-size: 12px; /* ie < 9 sucks */
+	font-size: 1.2rem;
+	line-height: 3em;
 }
 #info-box1 {
 	margin: 0;
-	padding: .5em 3px 4px 0;
+	padding: 0 3px 0 18px;
 	color: #fff;
-	float: left;
-	background: #575859;
+	display: inline-block;
 }
 #info-box2 {
-	margin: .1em 0 0 0;
-	padding: .5em 1.3em 4px 0;
+	margin: 0;
+	padding: 0 18px 0 0;
 	color: #fff;
 	float: right;
 	text-align: right;
-	background: #575859;
-	height: 2em;
 }
 #info-box1 p {
@@ -153,5 +201,6 @@
 }
 #info-box1 select {
-	width: 15em;
+	width: 145px; /* ie < 9 sucks */
+	width: 14.5em;
 }
 #info-box1 a img, #info-box2 a img {
@@ -159,6 +208,5 @@
 	padding-left: .3em;
 	}
-#info-box1 a, #info-box2 a {
-	background: #575859;
+#info-boxes a {
 	font-weight: bold;
 	color: #fff;
@@ -169,34 +217,38 @@
 	font-weight: normal;
 }
+#info-boxes .logout {
+	margin-right: 0;
+}
 #info-box1 a {
 	margin-left: 1.33em;
 }
 #info-box2 a.active {
-	border-bottom-color: #f5f5f5;
+	border-bottom-color: #fff;
 	margin: 0;
 	padding: 1.2em .5em;
-	background-color: #f5f5f5;
+	background-color: #fff;
 	color: #333;
 	font-weight: bold;
 }
 #info-box2 span {
-	color: #575859;
-}
-/* prelude */
+	color: #999;
+}
+/* main blocks */
 #wrapper {
 	width: 100%;
+	padding-top: 1em;
 }
 #main {
 	width: 100%;
 	float: right;
-	margin-left: -13em;
+	margin-left: -14.5em;
 	margin-top: 0;
+	background: #fff url(bg_menu.png);
 }
 #content {
-	margin: 1.5em 1.5em .5em 13em;
-	padding: 1em;
+	margin: 0 0 0 14.5em;
+	padding: 9px 18px 18px; /* ie < 9 sucks */
+	padding: .9rem 1.8rem 1.8rem;
 	background: #fff;
-	border-radius: .5em;
-	border: 1px solid #ddd;
 }
 	/* Micro clearfix thx to Nicolas Gallagher */
@@ -219,26 +271,32 @@
 }
 .two-cols .col {
-	width: 49%;
+	width: 48%;
 	margin-left: 2%;
 	float: left;
 }
-.two-cols .col:first-child {
-	width: 49%;
-	margin-left: 0;
-}
 .two-cols .col70{
-	width: 69%;
+	width: 68%;
 	margin-left: 0;
 	float: left;
 }
-.two-cols .col30 {
+.col30 {
 	width: 28%;
 	margin-left: 2%;
 	float: left;
 }
+.two-cols .col:first-child,
+.two-cols .col30.first-col {
+	margin-left: 0;
+	margin-right: 2%;
+}
+.two-cols .col:last-child,
+.two-cols .col70.last-col {
+	margin-left: 2%;
+	margin-right: 0;
+}
 /* -------------------------------------------------------------- layout - onglets */
 .part-tabs ul {
-	padding: .3em 0 1px 1em;
-	border-bottom: 1px solid #999;
+	padding: .5em 0 .3em 1em;
+	border-bottom: 1px solid #ddd;
 }
 .part-tabs li {
@@ -248,16 +306,11 @@
 }
 .part-tabs li a {
-	padding: .3em 0.5em;
-	margin-right: .5em;
-	border: 1px solid #999;
+	padding: .5em 2em;
+	margin-right: -1px;
+	border: 1px solid #aaa;
 	border-bottom: none;
-	background: #dfdfdf;
 	text-decoration: none;
-	border-top-left-radius: .3em;
-	border-top-right-radius: .3em;
-	color: #000;
-}
-.part-tabs li.part-tabs-link a {
-	background: #ffe;
+	color: #333;
+	background-color:#E4E0EC;
 }
 .part-tabs li a:hover, .part-tabs li a:focus {
@@ -268,25 +321,30 @@
 .part-tabs li.part-tabs-active a {
 	background: #fff;
-	border-bottom: 1px solid #fff;
-	color: #000;
 	font-weight: bold;
+	border-bottom-color: #fff;
+	padding-bottom: 7px; /* ie < 9 sucks */
+	padding-bottom: .7rem;
 }
 /* ------------------------------------------------------------------ main-menu */
 #main-menu {
-	width: 13em;
+	width: 14.5em;
 	float: left;
-	margin-top: 1.2em;
-	margin-bottom: .5em;
+	margin:0;
+	padding-top: .5em;
+	padding-bottom: 1em;
+	background: #f7f7f7;
 }
 #main-menu h3 {
-	margin: 0 0 0.5em;
-	padding: .5em 0 0 .5em;
-	text-transform: uppercase;
+	margin: 0;
+	padding: 10px 0 10px 8px;
 	color: #666;
-	font-size: 1.1em;
+	font-size: 14px; /* ie < 9 sucks */
+	font-size: 1.4rem;
+}
+#main-menu h3 img[alt="cacher"] {
+	vertical-align: top;
 }
 #main-menu ul {
-	font-size: .95em;
-	margin: 0 0 1em 0;
+	margin: 0 0 1.5em 0;
 	padding: 0;
 	list-style: none;
@@ -295,57 +353,102 @@
 	display: block;
 	margin: 0.5em 0 0;
-	padding: .2em 0 0 32px;
+	padding: 4px 0 1px 32px;
 	background-repeat: no-repeat;
-	background-position: 12px .4em;
+	background-position: 8px .3em;
+}
+#main-menu ul li:first-child {
+	margin-top: 0;
+}
+#main-menu li.active {
+background-color: #fff;
 }
 #main-menu a {
-	font-weight: bold;
+	color: #333;
+	border-bottom-color: #ccc;
 }
 #main-menu .active a {
 	border-bottom: none;
-	color: #333;
+	color: #2373A8;
+	color: #d30e60;
 }
 #main-menu .active {
-	background-color: #fff;
-	padding: .4em 0 .1em 32px;
-	background-position: 12px .4em;
-	border-top: 1px solid #ddd;
-	border-bottom: 1px solid #ddd;
-	margin-right: -1px;
-}
-#favorites-menu {
-	margin: 0 0 2em;
+	font-weight: bold;
+}
+#search-menu {
+	padding: 4px 5px 0;
+	font-size: 100%
+}
+#search-menu * {
+	height: 22px; /* ie < 9 sucks */
+	height: 2.2rem;
+	display: inline-block;
+	vertical-align: top;
+	line-height: 22px;
+}
+#search-menu p {
+	border: 1px solid #999;
+	border-radius: .3em;
+	position: relative;
+	overflow: hidden;
+}
+#qx {
+	width: 124px; /* ie < 9 sucks */
+	width: 12.4rem;
+	border-bottom-left-radius: .3em;
+	border-top-left-radius: .3em;
+	background: transparent url(search.png) no-repeat 4px center;
+	text-indent: 18px;
+	padding: 0;
+	border: none;
+	height: 22px;
+	height: 2.2rem;
+}
+#qx:focus {
+	border-color: #bee74b;
+}
+#search-menu input[type="submit"] {
+	padding: 0 3px;
+	padding: 0 .3rem;
+	margin-left: -4px;
+	background: #dfdfdf;
+	border-color: #999;
+	color: #444;
+	border-bottom-right-radius: .3em;
+	border-top-right-radius: .3em;
+	border-top-left-radius: 0;
+	border-bottom-left-radius: 0;
+	text-shadow: none;
+	border: none;
+	border-left: 1px solid #aaa;
+	font-size: 10px; /* ie < 9 sucks */
+	font-size: 1rem;
+}
+#search-menu input[type="submit"]:hover,
+#search-menu input[type="submit"]:focus {
+	background: #575859;
+	color: #fff;
+}
+#favorites-menu, #blog-menu, #system-menu, #plugins-menu {
+	border-bottom: 1px dashed #A2CBE9;
 }
 #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;
+	color: #000;
+	font-variant: small-caps;
+	padding-top: .2em;
 }
 /* ------------------------------------------------------------------ footer */
 #footer {
 	clear: both;
-	padding: .75em .75em 0 0;
+	padding: .5em 1em .5em 0;
 	text-align: right;
+	border-top: 1px solid #ccc;
 }
 #footer p {
 	margin: 0;
 	padding: 0 1em;
-	text-align: center;
-	font-size: 1.1em;
-}
-#footer a {
+	font-size: 1em;
 }
 #footer p span.credit {
-	font-size: .85em;
+	font-size: 1em;
 	font-weight: normal;
 }
@@ -353,41 +456,41 @@
 #login-screen {
 	display: block;
-	width: 18em;
+	width: 20em;
 	margin: 1.5em auto 0;
-	font-size: 1.1em;
+	font-size: 14px; /* ie < 9 sucks */
+	font-size: 1.4rem;
 }
 #login-screen h1 {
 	text-indent: -2000px;
-	background: transparent url(dotclear-logo2.png) no-repeat top left;
-	height: 50px;
+	background: transparent url(dc_logos/w-dotclear240.png) no-repeat top left;
+	height: 66px;
 	margin-bottom: .5em;
-	margin-left: .5em;
-}
-#login-screen fieldset, #login-screen .fieldset {
-	border: 1px solid #999;
+	margin-left: 0;
+}
+#login-screen .fieldset {
+	border: 1px solid #A8DC26;
 	padding: 1em 1em 0 1em;
-	border-radius: 4px;
+	border-radius: 3px;
+	background: #fff;
 }
 #login-screen input[type=text], #login-screen input[type=password], #login-screen input[type=submit] {
 	width: 100%;
 }
+#login-screen input.login {
+	padding-top: 6px;
+	padding-bottom: 6px;
+	font-size: 1em;
+}
 #login-screen #issue {
-	margin-left: 1em;
-	font-size: 1em;
-}
-#login-screen #issue strong {font-weight: normal;}
-
-
+	margin-left: 1.33em;
+	font-size: 12px; /* ie < 9 sucks */
+	font-size: 1.2rem;
+}
+#login-screen #issue strong {
+	font-weight: normal;
+}
 /* ------------------------------------------------------------------ dashboard */
 #dashboard-main {
-	float: left;
-	overflow: hidden;
-	padding: 1em 2% 1em 0;
-	width: 70%;
-}
-#dashboard-main.fullwidth {
-	width: 100%;
 	padding: 1em 0;
-	float: none;
 }
 #icons {
@@ -399,6 +502,8 @@
 	width: 210px;
 	text-align: center;
-	margin: 2em 0 0 0;
+	margin: 1em 0 2em;
+	padding: 1em 0;
 	display:inline-block;
+	vertical-align: top;
 }
 #icons a,
@@ -412,4 +517,23 @@
 #icons a span {
 	border-bottom: 1px dotted #f90;
+	color: #333;
+}
+#icons a img {
+	padding: 2em;
+	-moz-box-shadow: 0px 1px 0px 0px #ffffff;
+	-webkit-box-shadow: 0px 1px 0px 0px #ffffff;
+	box-shadow: 0px 1px 0px 0px #ffffff;
+	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #f9f9f9), color-stop(1, #e9e9e9) );
+	background:-moz-linear-gradient( center top, #f9f9f9 5%, #e9e9e9 100% );
+	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f9f9f9', endColorstr='#e9e9e9');
+	background-color:#f9f9f9;
+	-moz-border-radius:1em;
+	-webkit-border-radius:1em;
+	border-radius:1em;
+	border:1px solid #dcdcdc;
+	display:inline-block;
+}
+#icons a:focus img, #icons a:hover img {
+	background: #bee74b;
 }
 #icons a:focus span, #icons a:hover span {
@@ -417,5 +541,4 @@
 }
 #quick {
-	clear: left;
 	margin-top: 2em;
 }
@@ -426,25 +549,60 @@
 #quick p.qinfo {
 	margin: -.7em -1em 1em;
-	background: #eef url(info.png) no-repeat .2em .2em;
+	background: #f3f3ff url(info.png) no-repeat .2em .2em;
 	border: 1px solid #99f;
 	padding: .2em 1em .1em 24px;
 	color: #666;
 }
-#dashboard-items {
-	float: left;
-	width: 27%;
-	overflow: hidden;
-	padding-bottom: 1em;
-	padding-top: 3em;
-}
-#dashboard-items img {
+#quick #new_cat, .q-cat, .q-cat label {
+	display: inline-block;
+	vertical-align: top;
+	margin-right: 1em;
+	margin-top: 0;
+}
+.q-cat label {
+	margin-right: .3em;
+}
+#quick #new_cat {
+	margin-bottom: 2em;
+}
+#dashboard-widgets {
+	margin: 2em auto;
+}
+.db-items.two-db {
+	width: 47%;
+	margin-left: 3%;
+	display: inline-block;
+	vertical-align: top;
+}
+.db-contents.two-db {
+	width: 47%;
+	margin-right: 3%;
+	display: inline-block;
+	vertical-align: top;
+}
+.one-db .db-box {
+	display: inline-block;
+	vertical-align: top;
+	padding-right: 3%; 
+}
+.db-box {
+	margin-bottom: 2em;
+}
+.db-box h3 {
+	font-weight: bold;
+	font-size: 1em;
+	text-transform: uppercase;
+	color: #333;
+	text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
+}
+.db-items img {
 	vertical-align: middle;
 }
-#dashboard-items ul {
+.db-box ul {
 	display: block;
 	padding-left: 1.5em;
 	list-style: square;
 }
-#dashboard-items li {
+.db-box li {
 	margin: 0.25em 0 0 0;
 	color: #666;
@@ -464,5 +622,5 @@
 }
 #upg-notify ul {
-	padding-left: 15px;
+	padding-left: 1.5em;
 }
 #upg-notify li {
@@ -476,5 +634,14 @@
 }
 #entry-content {
-	margin-right: 18em;
+	margin-right: 19em;
+	margin-left: 0;
+}
+.multi-part {
+	padding-left: 1em;
+}
+#entry-content label {
+	text-transform: uppercase;
+	font-weight: bold;
+	margin-top: 2em;
 }
 #entry-sidebar {
@@ -482,10 +649,23 @@
 	float: right;
 }
+#entry-sidebar select {
+	width: 100%;
+}
+#entry-sidebar input#post_position {
+	width: 4em;
+}
+.box {
+	border-bottom: 1px solid #ddd;
+	margin-bottom: 1em;
+}
 #comments {
 	clear: both;
 }
+#trackback-form textarea {
+	width: 98%;
+}
 /* ------------------------------------------------------------------ categories */
 #categories {
-	margin: 1em 0 2em;
+	margin: 1em 0;
 }
 #categories ul {
@@ -496,11 +676,17 @@
 #categories li {
 	margin: .5em 0;
-	padding: .3em 1.5em;
+	padding: .5em 1.2em;
 	border: 1px solid #ccc;
-	border-left: 1em solid #E5E3DA;
-	border-radius: .3em;
+	border-left: 8px solid #E5E3DA;
+	border-radius: 3px;
+}
+#categories input[type="checkbox"] {
+	margin-right: .8em;
 }
 #categories h4 {
 	margin: 0;
+}
+#categories label a {
+	font-weight: bold;
 }
 #categories h4 span {
@@ -509,7 +695,37 @@
 #categories li p {
 	margin: 0;
+	display: inline-block;
+}
+.cat-url {
+	padding-left: 1em;
+}
+.cat-actions {
+	line-height: 2;
 }
 select#del_cat {
 	width: 100%;
+}
+#new_cat {
+	font-weight: bold;
+	margin-top: 2em;
+}
+#categories .placeholder {
+        outline: 1px dashed #4183C4;
+        min-height: 2.5em;
+}
+#categories input.cat-rank {
+  float: right;
+  margin-left: 30px;
+}
+#save-set-order.disabled {
+        text-shadow: none;
+        color: #666;
+        background: #F5F5F5;
+        border: 1px solid #CCCCCC;
+}
+#save-set-order.disabled:hover {
+        color: #666;
+        background: #DFDFDF;
+        border: 1px solid #CCCCCC;
 }
 /* ------------------------------------------------------------------ media */
@@ -518,5 +734,8 @@
 }
 #media-details {
+}
+.near-icon {
 	margin-left: 70px;
+	margin-bottom: 3em;
 }
 #media-details ul {
@@ -549,32 +768,4 @@
 	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;
@@ -593,5 +784,47 @@
 	border: none;
 }
+.media-item {
+	position: relative;
+	border: 1px solid #ccc;
+	margin: 1em;
+	padding: 1em;
+	width: 300px;
+	display: inline-block;
+	vertical-align: top;
+	min-height: 120px
+}
+.media-action-box {
+	position: relative;
+	margin: 1em 3em 1em 1em;
+	display: inline-block;
+	vertical-align: top;
+	min-height: 120px
+}
+.media-action-box h4 {
+	font-size: 1em;
+	text-transform: uppercase;
+	font-weight: bold;
+	color: #333;
+	margin-top: 2em;
+}
+a.media-icon {
+	display: block;
+	border-bottom: none;
+	margin: 0 auto; 
+}
+.media-icon img {
+	display: block;
+}
+.media-item ul {
+	display: block;
+	list-style: none;
+	margin: 0;
+	padding: 0;
+}
 /* ------------------------------------------------------------------ preferences */
+#my-favs {
+	border: 1px solid #A8DC26;
+	padding: 1em 2em
+}
 #my-favs ul {
 	list-style-type: none;
@@ -646,33 +879,93 @@
 	bottom: 0;
 	left: 10em;
-	background-color: #f5f5f5;
+	background-color: #f7f7f7;
 	border: 1px solid #ddd;
 	padding: .2em;
 	border-radius: .5em;
 }
+#user-options label.ib {
+	display: inline-block;
+	width: 14em;
+	padding-right: 1em;
+}
+.blog-perm {
+	margin-top: 2em;
+	font-weight: bold;
+}
+.ul-perm {
+	list-style-type: square;
+	margin-left: 0;
+	padding-left: 3.5em;
+	margin-bottom: 0
+}
+.add-perm {
+	padding-top: .5em;
+	padding-left: 2.5em;
+	margin-left: 0;
+}
+/* in blog_pref */
+.user-perm {
+	margin: 2em 0px;
+	background: transparent url(user.png) no-repeat left top;
+	width: 320px;
+	display: inline-block;
+	vertical-align: top;
+}
+.user-perm h4, .user-perm h5, .user-perm p, .user-perm ul, .user-perm li {
+	margin: .5em 0 .33em;
+	padding: 0;
+}
+.user-perm h4 {
+	padding-left: 28px;
+}
+.user-perm ul {
+	list-style-type: inside;
+}
+.user-perm li {
+	margin-left: 1em;
+	padding-left: 0;
+}
+.user-perm h5 {
+	margin:	1em 0 0 0;
+}
+li.user_super, li.user_admin {
+	margin-left: 0;
+	padding-left: 1em;
+	list-style: none;
+	background: transparent url(../images/superadmin.png) no-repeat -2px 2px;
+}
+li.user_admin {
+	background-image: url(../images/admin.png);
+}
+
 /* -------------------------------------------------------------------- Themes */
 #themes {
-	border-bottom: 1px solid #ccc;
-	margin: 1em 0;
+	margin: 0;
+	width: 100%;
+	padding: 0;
+}
+#themes h3 {
 }
 #themes div.theme-details {
-	clear: left;
 	border-top: 1px solid #ccc;
-	padding: 1em 0;
+	padding: 12px;
+	display: inline-block;
+	vertical-align: top;
+	width: 284px;
+}
+.current-theme {
+	background: #eef;
 }
 #themes div.theme-details:hover {
-	background: #eee;
+	background: #f3f3f3;
 }
 #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;
+	margin-bottom: 1.5em;
 }
 #themes div.theme-details div.theme-info {
-	margin-left: 67px;
 }
 #themes div.theme-details div.theme-info span.theme-desc {
@@ -683,33 +976,45 @@
 }
 #themes div.theme-details div.theme-actions {
-	margin-left: 67px;
+}
+#themes-actions {
+	border-bottom: 1px solid #999;
+	margin-bottom: 3em;
+}
+.theme-css {
+	display: block;
 }
 /* Themes list, JS version */
 #themes-wrapper {
+	display: table;
+}
+#themes-wrapper #themes {
+	display: table-cell;
+	vertical-align: top;
+	padding-left: 1em;
 }
 #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;
+	display: table-cell;
+	vertical-align: top;
+	padding: 0;
+	width: 312px;
+	border: 1px solid #ccc;
+	border-radius: 3px;
+}
+#theme-box .theme-shot,
+#theme-box .theme-info,
+#theme-box .theme-actions {
+	background: #eef;
+	padding: 1em 16px;
+	margin: 0;
+}
+#theme-box .theme-shot img {
+	display: block;
 	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 h4 {
+	color: #000;
+	background: #eef;
 }
 #theme-box span.theme-version {
@@ -723,43 +1028,34 @@
 	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 {
+#theme-box .theme-actions {
+	border-bottom: 1px solid #ccc;
+}
+#themes .theme-details-js {
 	float: left;
 	width: 120px;
 	height: 150px;
-	margin: 0 10px 20px;
-	padding: 10px 10px 0;
+	margin: 0 12px 24px;
+	padding: 12px 12px 0;
 	text-align: center;
 	background: #f3f3f3;
-	border: 1px solid #f3f3f3;
+	border: 1px solid #ddd;
 	cursor: pointer;
 	border-radius: 4px;
 }
-#themes div.theme-details-js label {
+#themes .theme-details-js label {
 	cursor: pointer;
 }
-#themes div.theme-details-js.theme-selected {
-	background: #E5E3DA;
+#themes .theme-details-js.theme-selected {
+	background: #e7e7e7;
 	border: 1px solid #999;
 }
-#themes div.theme-details-js div.theme-shot img {
+#themes .theme-details-js .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;
+#themes a:focus div, #themes a:hover div,
+#themes a:focus div.current-theme, #themes a:hover div.current-theme {
+	background: #bee74b;
 }
 /* ----------------------------------------------------------  Plugins list */
@@ -767,5 +1063,4 @@
 	vertical-align: middle;
 }
-
 select.l10n option {
 	padding-left: 16px;
@@ -776,22 +1071,25 @@
 /* ------------------------------------------------------------------ contextual help */
 #help {
-	margin-top: 2em;
+	margin-top: 4em;
 	background: #f5f5f5;
 	z-index: 100;
+	clear: both;
+	padding: 0 1em;
 }
 #help-button {
-	position: fixed;
-	top: 3.2em;
+	background: transparent url(../images/page_help.png) no-repeat 6px center;
+	position: absolute;
+	top: 36px; /* ie < 9 sucks */
+	top: 3.6rem;
 	right: 0px;
+	padding: 0 1.5em 0 30px;
 	cursor: pointer;
-	background: #fc3;
-	border: 1px solid #dde;
-	border-right: none;
-	font-size: 1.1em;
-	font-weight: bold;
-	text-transform: capitalize;
-	padding: .33em .75em .33em 1em;
-	border-radius: 1em 0 0 1em;
-	color: #444;
+	color: #2373A8;
+	line-height: 42px; /* ie < 9 sucks */
+	line-height: 4.2rem;
+}
+#help-button span {
+	padding: .5em 0 .1em 0;
+	border-bottom: 1px solid #2373A8;
 }
 .help-box {
@@ -803,19 +1101,30 @@
 }
 #content.with-help #help-button {
-	right: 282px;
+	right: 282px; /* ie < 9 sucks */
+	right: 28.2rem;
+	background-color: #f5f5f5;
+	position: fixed;
+	border-top: 2px solid #FFD478;
+	border-left: 2px solid #FFD478;
+	border-bottom: 2px solid #FFD478;
+	border-bottom-left-radius: 1em;
+	border-top-left-radius: 1em;
 }
 #content.with-help #help {
 	display: block;
 	position: absolute;
-	top: 40px;
+	top: 36px; /* ie < 9 sucks */
+	top: 3.6rem;
 	right: 0;
-	width: 280px;
-	border-left: 2px solid #fc3;
+	width: 280px; /* ie < 9 sucks */
+	width: 28rem;
+	border-left: 2px solid #FFD478;
+	border-top: 2px solid #FFD478;
 	margin-top: 0;
-	padding: 10px 0 0 0;
+	padding: .5em 0 0 0;
 	overflow: auto;
 }
 #content.with-help .help-content {
-	padding: 0 5px 1em 5px;
+	padding: 0 .5em 1em;
 }
 .help-content dt {
@@ -829,49 +1138,110 @@
 /* ------------------------------------------------------------------ popups */
 body.popup #wrapper, body.popup #top {
-	margin-top: -1.5em;
+	width: 100%;
+	padding: 0;
+}
+body.popup #wrapper {
 	float: none;
-}
-body.popup #top h1 {
-	background: transparent;
+	margin:0;
+	display: block;
+}
+body.popup h1, body.popup #top {
+	margin: 0;
+	border-bottom: 1px solid;
+	font-weight: normal;
+	color: #fff;
+	background: #575859;
+	font-size: 1.5em;
+	text-indent: .5em;
+	line-height: 1.3em;
 }
 body.popup #main {
-	margin-left: -35px;
-	margin-bottom: 1em;
+	margin-bottom: 1em 0;
 }
 body.popup #content {
-	margin-left: 35px;
-	margin-left: 2em;  /* 3.2 */
-}
-body.popup #footer {
-	display: none; /* 3.2 */
+	margin: 0;
+	padding: .5em 0;
+}
+body.popup #content h2 {
+	margin: 0 0 1em;
 }
 body.popup #footer p {
-	margin-left: 35px;
 	border: none;
 }
 /* ------------------------------------------------------------------ messages */
-div.error, p.error, 
-div.message, p.message, 
-div.static-msg, p.static-msg {
-	padding: 0.5em 0.5em 0.5em 48px;
+.error, .message, .static-msg, .success, .warning-msg {
+	padding: 1em 0.5em 0.5em 48px;
 	margin-bottom: 1em;
 	border-radius: 8px;
 }
-p.error, p.message, p.static-msg {
+p.error, p.message, p.static-msg, p.success, p.warning-msg {
 	padding-top: 1em;
 	padding-bottom: 1em;
 }
-div.error, p.error {
-	background: #ffdec8 url(msg-error.png) no-repeat .7em .7em;
+.error {
+	background: #FFBABA url(msg-error.png) no-repeat .7em .7em;
 	color: #000;
 }
-div.message, p.message, 
-div.static-msg, p.static-msg {
+.message, .static-msg {
 	background: #666 url(msg-std.png) no-repeat .7em .7em;
 	color: #fff;
 }
-div.message a, p.message a, 
-div.static-msg a, p.static-msg a {
+.success {
+	background: #bee74b url(msg-success.png) no-repeat .7em .7em;
+	color: #000;
+}
+.warning-msg {
+	background: #ffd url(msg-warning.png) no-repeat .7em .7em;
+	color: #666;
+	border: 1px solid #f0c020;
+}
+.message a, .static-msg a {
 	color: #fff;
+}
+.success a, .warning-msg a {
+	color: #666;
+}
+.dc-update {
+	padding: 1em 48px 0.5em 48px;
+	margin-bottom: 1em;
+	border-radius: 8px;
+	background: #A2CBE9 url(msg-success.png) no-repeat .7em .7em;
+}
+.dc-update a {
+	color: #000;
+	border-color: #000;
+	margin-right: 1em;
+}
+a.info {
+	margin-left: 2em;
+	font-weight: bold;
+}
+/* ------------------------------------------------------------------ navigation */
+.anchor-nav {
+	background: #575859;
+	color: #fff;
+	padding: 4px 1em;
+	float: right;
+}
+.nav_prevnext {
+	margin-bottom: 2em;
+	color: #fff;
+}
+.nav_prevnext a, a.back {
+	border: 1px solid #ddd;
+	padding: 2px 1.5em;
+	border-radius: .75em;
+	background-color: #f0f0f0;
+}
+a.back:before {
+	content: "\ab\a0";
+}
+a.onblog_link {
+	color: #333;
+	float: right;
+	border: 1px solid #eee;
+	padding: 2px 1.5em;
+	border-radius: .75em;
+	background-color: #ffe;
 }
 /* ------------------------------------------------------------------ debug */
@@ -897,7 +1267,33 @@
 }
 /* -------------------------------------------------------------------- CLASSES COMMUNES */
-
-.no-margin {
-	margin: 0;
+.no-margin, #entry-content label.no-margin {
+	margin: 0;
+}
+.vertical-separator {
+	margin-top: 2em;
+}
+p.clear.vertical-separator {
+	padding-top: 2em;
+}
+.border-top {
+	border-top: 1px solid #999;
+	padding-top: 1em;
+	margin-top:	1em;
+}
+.fieldset {
+	background: #fff;
+	border: 1px solid #bbb;
+	border-radius: 3px;
+	padding: 1em .7em .5em;
+	margin-bottom: 1em;
+}
+.fieldset h3 {
+	color: #333;
+}
+.table {
+	display: table;
+}
+.cell {
+	display: table-cell;
 }
 /* paragraphe pour bouton Nouveau bidule */
@@ -914,5 +1310,618 @@
 	vertical-align: middle;
 }
-/* Si quelque chose a besoin d'être caché sauf pour les revues d'écran */
+
+.clear {
+	clear: both;
+}
+.lclear {
+	clear: left;
+}
+div.clearer {
+	height: 1px;
+	font-size: 1px;
+}
+.right {
+	text-align: right;
+}
+.txt-center {
+	text-align: center;
+}
+.frame-shrink {
+	border: 1px solid #666;
+	padding: 0.5em;
+	margin-bottom: 1em;
+	height: 120px;
+	overflow: auto;
+}
+.grid {
+	background: transparent repeat url('grid.png') 0 0;
+}
+.line p {
+	margin: 0;
+}
+.offline {
+	color: #666;
+}
+ul.nice {
+	margin: 1em 0;
+	padding: 0 0 0 2em;
+	list-style: square;
+}
+ul.nice li {
+	margin:0;
+	padding: 0;
+}
+.zip-dl {
+	background: transparent url(package.png) no-repeat 0 50%;
+	padding: 5px 0 5px 20px;
+}
+.distrib img {
+	display: block;
+	float: right;
+	margin-top: -1em;
+}
+
+/* TABLES
+-------------------------------------------------------- */
+table {
+	font-size: 12px; /* ie < 9 sucks */
+	font-size: 1.2rem;
+	border-collapse: collapse;
+	margin: 0 0 1em 0;
+}
+table.posts-list {
+	min-width: 50%;
+}
+tr.line:hover {
+	background: #f3f3f3;
+}
+caption {
+	color: #333;
+	font-weight: bold;
+	text-align: left;
+	margin-bottom: .5em;
+}
+
+td {
+	border-width: 0 0 1px 0;
+	border-style: solid;
+	border-color: #e3e3e3;
+	padding: .4em 1em .4em .5em;
+	vertical-align: top;
+}
+th {
+	border-width: 1px 0 1px 0;
+	border-style: solid;
+	border-color: #ddd;
+	background: #f3f3ff;
+	padding: .4em 1em .4em .5em;
+	vertical-align: top;
+	text-align: left;
+	text-transform: uppercase;
+	font-size: 10px;
+	font-size: 1rem;
+}
+th.first img {
+	padding-right: 24px;
+}
+.noborder td, td.noborder, .noborder th, th.noborder {
+	border-width: 0 0 1px 0;
+	border-color: #ddd;
+	line-height: 2em;
+	padding-bottom: 0;
+}
+.noborder p {
+	margin-bottom: 0;
+}
+table .maximal, table.maximal {
+	width: 100%;
+}
+table .minimal {
+	width: 1px;
+}
+table .nowrap {
+	white-space: nowrap;
+	vertical-align: top;
+}
+table .count {
+	text-align: right;
+	padding-right: 1.5em;
+}
+table.settings, table.prefs {
+	width: 80%;
+	border: 1px solid #ccc;
+	margin-bottom: 3em;
+}
+table.settings th, table.prefs th {
+	background: #f3f3ff;
+}
+table.settings th:first-child, table.prefs th:first-child {
+	width: 20%;
+}
+table.settings th + th, table.prefs th + th {
+	width: 30%;
+}
+table.settings th + th + th, table.prefs th + th + th {
+	width: 10%;
+}
+table.settings th:last-child, table.prefs th:last-child {
+	width: 40%;
+}
+td.status {
+	vertical-align: middle;
+}
+td.status img {
+	margin-bottom: -2px;
+}
+td.status a {
+	border: none;
+}
+tr.line img.expand, th img.expand {
+	margin-right: 6px;
+	margin-bottom: -2px;
+}
+tr.line input {
+	vertical-align: middle;
+}
+tr.expand td {
+	border-bottom: none;
+}
+td.expand {
+	padding: 1em;
+}
+
+.dragable {
+	border-collapse: separate;
+}
+.dragable tbody td {
+
+}
+.handle {
+	padding: 0;
+}
+.handler {
+	cursor: move;
+	background: transparent url(drag.png) no-repeat 0 50%;
+	padding-left: 15px;
+}
+/* ----------------------------------------------------------------- FORMS */
+form {
+	display: block;
+	margin: 0;
+	padding: 0;
+}
+fieldset {
+	display: block;
+	margin: 0 0 1em 0;
+	padding: 1em 0.5em;
+	border-width: 1px 0;
+	border-style: solid;
+	border-color: #ccc;
+	background: #f7f7f7;
+}
+legend {
+	font-weight: bold;
+	padding: 0.2em 0.6em;
+	border-width: 1px;
+	border-style: solid;
+	border-color: #333;
+	background: #fff;
+	margin-bottom: 0.5em;
+	border-radius: 3px;
+}
+optgroup {
+	font-weight: bold;
+	font-style: normal;
+}
+option {
+	font-weight: normal;
+}
+input[type=text], input[type=password], textarea, select {
+	background: #fbfbfb;
+	color: #000;
+	border-width: 1px;
+	border-style: solid;
+	border-color: #ddd;
+	border-radius: 3px;
+	box-shadow: 1px 1px 2px #F1F1F1 inset;
+	padding: 3px; 
+}
+select {
+	padding: 1px 0;
+	height: 1.66em; 
+}
+input.invalid, textarea.invalid, select.invalid {
+	border: 1px solid red;
+	background: #eff;
+	color: red;
+	box-shadow: 0 0 0 1px rgba(218, 62, 90, 0.3)
+}
+input, textarea, select, option {
+	font: 100% "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;
+}
+input[type=text], input[type=password], textarea {
+	margin-right: .3em;
+}
+textarea {
+	padding: 2px 0;
+}
+input[type=checkbox], input[type=radio], input[type=file] {
+	border: none;
+	margin: 0;
+	padding: 0;
+	background: transparent;
+}
+input[type=file] {
+	margin-top: .3em;
+	margin-bottom: .3em;
+}
+label {
+	display: block;
+}
+label input, label select, label span {
+	display: block;
+}
+p.form-note {
+	font-style:italic;
+	margin-top: -.7em;
+	color: #666;
+}
+span.form-note {
+	font-style:italic;
+	font-weight: normal;
+	text-transform: none;
+	color: #666;
+}
+p.form-note.warn, p.form-note.info, p.warning {
+	font-style: normal;
+	padding: .2em .66em .2em;
+	text-indent: 24px;
+	color: #333;
+	display: inline-block;
+	line-height: 1.5em;
+}
+p.form-note.warn, p.warning {
+	background: #ffd url(msg-warning.png) no-repeat .3em .3em;
+	border: 1px solid #f0c020;
+}
+p.form-note.info {
+	background: #eef url(msg-info.png) no-repeat .3em .3em;
+	border: 1px solid #c484ff;
+}
+.form-note a {border-bottom: 1px solid #ddbaff;}
+
+label.ib {
+	display: inline-block;
+}
+label.classic {
+	display: inline;
+}
+label.classic input, label span input, label.classic select, label span select {
+	display: inline;
+}
+
+label.area, p.area {
+	width: inherit !important;
+}
+.area textarea {
+	display: block;
+	width: 100%;
+	resize: vertical;
+}
+label.required {
+	font-weight: bold;
+}
+label.required abbr {
+	color: #dd0000;
+	font-size: 1.3em;
+}
+label.inline {
+	display: inline;
+}
+p.field {
+	position: relative;
+
+}
+p.field label {
+	display: block;
+	width: 14em;
+}
+p.field input, p.field select {
+	display: inline;
+	position: absolute;
+	left: 14.5em;
+	top: 0;
+}
+label .maximal, textarea.maximal, input.maximal {
+	width: 100%;
+}
+textarea.maximal {
+	resize: vertical;
+}
+
+a.form-control {
+	display: none;
+	background: url(../images/expand.png) no-repeat 4px center;
+	padding-left: 20px;
+	color: #000;
+}
+.constrained {
+	margin: 0;
+	padding: 0;
+	border: none;
+	background: transparent;
+}
+input:focus, textarea:focus, select:focus {
+	-webkit-box-sizing: border-box;
+	-moz-box-sizing: border-box;
+	box-sizing: border-box;
+	border-color: #bee74b;
+}
+/* --------------------------------------------------------------- buttons */
+/* commun */
+input[type=submit],
+input[type=reset],
+input[type=button],
+a.button,
+a.submit {
+	display: inline-block;
+	cursor: pointer;
+	text-align: center;
+	text-decoration: none;
+	padding: .1em .5em;
+	border-radius: .2em;
+	margin-bottom: .1em;
+	font-size: 12px; /* ie < 9 sucks */
+	font-size: 1.2rem;
+ }
+h4 a.button {font-weight: normal;}
+
+/* validation */
+input[type=submit],
+input[type=button],
+a.submit {
+	color: #fff;
+	text-shadow: 0 -1px 1px #1A87B9;
+	background:#25A6E1;
+	background:-moz-linear-gradient(top,#25A6E1 0%,#188BC0 100%);
+	background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#25A6E1),color-stop(100%,#188BC0));
+	background:linear-gradient(top,#25A6E1 0%,#188BC0 100%);
+	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#25A6E1',endColorstr='#188BC0',GradientType=0);
+	border:1px solid #2C8FD1;
+
+}
+input[type=submit]:hover,
+input[type=button]:hover,
+a.submit:hover,
+input[type=submit]:focus,
+input[type=button]:focus,
+a.submit:focus {
+	background:#188BC0;
+	background:-moz-linear-gradient(top,#188BC0 0%,#25A6E1 100%);
+	background:-webkit-gradient(linear,left top,left bottom,color-stop(0%,#188BC0),color-stop(100%,#25A6E1));
+	background:linear-gradient(top,#188BC0 0%,#25A6E1 100%);
+	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#25A6E1',endColorstr='#25A6E1',GradientType=0);
+}
+/* suppression et reset */
+a.button,
+input[type=submit].reset, input.reset,
+input[type=submit].delete, input.delete {
+	border: 1px solid #ccc;
+	background: #f5f5f5;
+	color: #000;
+	background: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#dfdfdf));
+	background: -moz-linear-gradient(top,  #f5f5f5,  #dfdfdf);
+	text-shadow:1px 1px 0px #fff;
+	}
+a.button:hover,
+input[type=reset]:hover,
+input[type=submit].reset:hover,
+input.reset:hover,
+input[type=submit].delete:hover,
+input.delete:hover,
+a.button:focus,
+input[type=reset]:focus,
+input[type=submit].reset:focus,
+input[type=submit].delete:focus {
+	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #e9e9e9), color-stop(1, #f9f9f9) );
+	background:-moz-linear-gradient( center top, #e9e9e9 5%, #f9f9f9 100% );
+	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#e9e9e9', endColorstr='#f9f9f9');
+	background-color:#e9e9e9;
+	}
+a.delete,
+input.delete,
+input[type=submit].delete {
+	color: #c00;
+	padding-bottom: 2px;
+}
+#entry-content .delete {
+	margin-left: 1em;
+}
+a.delete:hover,
+input.delete:hover,
+input[type=submit].delete:hover,
+a.delete:focus,
+input.delete:focus,
+input[type=submit].delete:focus {
+	border-color: #c00;
+}
+/* finasseries */
+input[type=button] {
+	padding: .1em;
+}
+#info-box a.button {
+	padding: 0 .5em;
+	margin-left: 2em;
+}
+.button.add {
+	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #bee74b), color-stop(1, #9BCA1C) );
+	background:-moz-linear-gradient( center top, #bee74b 5%, #9BCA1C 100% );
+	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#bee74b', endColorstr='#9BCA1C');
+	background-color:#bee74b;
+	border:1px solid #B2D742;
+	padding:.5em 1.5em;
+	color: #000;
+	text-shadow:1px 1px 0px #98cf40;
+	font-weight: normal;
+	font-size: 14px; /* ie < 9 sucks */
+	font-size: 1.4rem;
+}
+.button.add:hover, .button.add:active, .button.add:focus {
+	background:-webkit-gradient( linear, left top, left bottom, color-stop(0.05, #9BCA1C), color-stop(1, #bee74b) );
+	background:-moz-linear-gradient( center top, #9BCA1C 5%, #bee74b 100% );
+	filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#9BCA1C', endColorstr='#bee74b');
+	background-color:#9BCA1C;
+}
+.button-add:focus {
+	outline: dotted 1px;
+}
+
+/* jQuery Autocomplete plugin */
+.ac_results {
+	padding: 0px;
+	border: 1px dotted #f90;
+	background-color: white;
+	overflow: hidden;
+	z-index: 99999;
+}
+.ac_results ul {
+	width: 100%;
+	list-style-position: outside;
+	list-style: none;
+	padding: 0;
+	margin: 0;
+}
+.ac_results li {
+	margin: 0px;
+	padding: 2px 5px;
+	cursor: default;
+	display: block;
+	font: menu;
+	font-size: 1em;
+	line-height: 16px;
+	overflow: hidden;
+}
+.ac_loading {
+	background: transparent url('loader.gif') right center no-repeat;
+}
+.ac_over {
+	background-color: #06c;
+	color: white;
+}
+
+/* ------------------------------------------------------- Filters */
+#filters-form {
+	border: 1px dashed #999;
+	border-radius: .5em;
+	margin-bottom: 2em;
+	padding: .5em 1em 0;
+}
+#filters-form .table {
+	display: table;
+	width: 100%;
+	padding: 0;
+	margin-bottom: 1em;
+	margin-top: .5em;
+}
+#filters-form .cell {
+	padding: 0 2em 0 0;
+	display: table-cell;
+	vertical-align: top;
+}
+#filters-form .filters-sibling-cell {
+	padding-top: 3.8em;
+}
+#filters-form .filters-options {
+	padding-left: 2em;
+	border-left: 1px solid #ccc;
+}
+#filters-form label.ib, span.ib {
+	width:7em;
+	display: inline-block;
+}
+#filters-form label.ibw, span.ibw {
+	width: 9em;
+	display: inline-block;
+}
+#filters-form select {
+	width: 14em;
+}
+#filters-form h4 {
+	margin-top: 0;
+	margin-bottom: 2em;
+}
+
+/* ---------------------------------------------------- Pagination */
+.pagination {
+	height: 22px;
+	margin-top: 1em;
+	line-height: 22px;
+	padding: 0 .75em;
+	border: 1px solid #e7e7e7;
+	overflow: hidden;
+	background: #f3f3f3;
+	-moz-border-radius: 3px;
+	-webkit-border-radius: 3px;
+	border-radius: 3px;
+	clear: left;
+}
+.pagination a, .pagination strong {
+	height: 20px;
+	border: none;
+	padding: 2px 6px;
+	background-color : transparent;
+	background-position : 50% 50%;
+	background-repeat: no-repeat;
+}
+.pagination a:hover, .pagination strong {
+	border-color : #ccc;
+	background-color: #fff;
+}
+
+/* --------------------------------------------------------------- password indcator */
+.pw-table {
+	display: table;
+	margin-bottom: 1em;
+}
+.pw-cell {
+	display: table-cell;
+	margin-bottom: 1em;
+}
+#pwindicator {
+	display: table-cell;
+	vertical-align: bottom;
+	padding-left: 1.5em;
+	height: 3.8em;
+}
+#pwindicator .bar {
+	height: 6px;
+	margin-bottom: 4px;
+}
+.pw-very-weak .bar {
+	background: #900;
+	width: 30px;
+}
+.pw-weak .bar {
+	background: #c00;
+	width: 60px;
+}
+.pw-mediocre .bar {
+	background: #f60;
+	width: 90px;
+}
+.pw-strong .bar {
+	background: #060;
+	width: 120px;
+}
+.pw-very-strong .bar {
+	background: #0c0;
+	width: 150px;
+}
+/* ------------------------------------------------------------- cachotteries */
+/* caché pour tout le monde */
+.hide {
+	display: none;
+}
+/* Caché sauf pour les revues d'écran */
 .hidden {
     position: absolute !important;
@@ -925,500 +1934,70 @@
     overflow: hidden;
     }
-.clear {
-	clear: both;
-}
-.lclear {
-	clear: left;
-}
-div.clearer {
-	height: 1px;
-	font-size: 1px;
-}
-.hide {
-	display: none;
-}
-.right {
-	text-align: right;
-}
-.frame-shrink {
-	border: 1px solid #666;
-	padding: 0.5em;
-	margin-bottom: 1em;
-	height: 120px;
-	overflow: auto;
-}
-.grid {
-	background: transparent repeat url('grid.png') 0 0;
-}
-.line p {
-	margin: 0;
-}
-.offline {
-	color: #666;
-}
-ul.nice {
-	margin: 1em 0;
-	padding: 0 0 0 2em;
-	list-style: square;
-}
-ul.nice li {
-	margin:0;
-	padding: 0;
-}
-.zip-dl {
-	background: transparent url(package.png) no-repeat 0 50%;
-	padding: 5px 0 5px 20px;
-}
-/* pas trouvé dans le code */
-.comment {
-	border-top: 2px solid #ccc;
-	margin-bottom: 1em;
-	padding: 2em 0 1em 0;
-	position: relative;
-}
-.comment form p {
-	margin: 0;
-	position: absolute;
-	top: 2px;
-	right: 0;
-}
-.distrib img {
-	display: block;
-	float: right;
-	margin-top: -1em;
-}
-/* TABLES
--------------------------------------------------------- */
-table {
-	font-size: 1em;
-	border-collapse: collapse;
-	margin: 0 0 1em 0;
-}
-tr.line:hover {
-	background: #ddd;
-}
-caption {
-	color: #333;
-	font-size: 1.2em;
-	font-weight: bold;
-	text-align: left;
-	margin-bottom: .5em;
+/* caché si js est inactif */
+.no-js .hidden-if-no-js {
+        display: none;
+}
+/* montré si js est inactif */
+.no-js .hidden-if-js {
+	display: block;
+}
+/* caché si js est actif */
+.hidden-if-js {
+        display: none;
 }
 
-th, td {
-	border-width: 0 0 1px 0;
-	border-style: solid;
-	border-color: #ccc;
-	padding: 3px 5px;
-	vertical-align: top;
-}
-th {
-	text-align: left;
-	border-bottom-color: #666;
-}
-.noborder td, td.noborder, .noborder th, th.noborder {
-	border-width: 0;
-}
-table .maximal, table.maximal {
-	width: 100%;
-}
-table .minimal {
-	width: 1px;
-}
-table .nowrap {
-	white-space: nowrap;
-	vertical-align: top;
-}
-table.settings, table.prefs {
-	width: 80%;
-}
-table.settings th:first-child, table.prefs th:first-child {
-	width: 20%;
-}
-table.settings th + th, table.prefs th + th {
-	width: 30%;
-}
-table.settings th + th + th, table.prefs th + th + th {
-	width: 10%;
-}
-table.settings th:last-child, table.prefs th:last-child {
-	width: 40%;
-}
-
-td.status {
-	vertical-align: middle;
-}
-td.status img {
-	margin-bottom: -2px;
-}
-td.status a {
-	border: none;
-}
-
-tr.line img.expand {
-	margin-right: 10px;
-	margin-bottom: -2px;
-}
-tr.line input {
-	vertical-align: middle;
-}
-tr.expand td {
-	border-bottom: none;
-}
-td.expand {
-	padding: 1em;
-}
-
-.dragable {
-	border-collapse: separate;
-}
-.dragable tbody td {
-
-}
-.handle {
-	padding: 0;
-}
-.handler {
-	cursor: move;
-	background: transparent url(drag.png) no-repeat 0 50%;
-	padding-left: 15px;
-}
-
-/* ----------------------------------------------------------------- FORMS */
-form {
-	display: block;
-	margin: 0;
-	padding: 0;
-}
-fieldset, .fieldset {
-	display: block;
-	margin: 0 0 1em 0;
-	padding: 1em 0.5em;
-	border-width: 1px 0;
-	border-style: solid;
-	border-color: #ccc;
-	background: #f5f5f5;
-}
-legend {
-	font-weight: bold;
-	padding: 0.2em 0.6em;
-	border-width: 1px;
-	border-style: solid;
-	border-color: #ccc;
-	background: #f5f5f5;
-	margin-bottom: 0.5em;
-}
-optgroup {
-	font-weight: bold;
-	font-style: normal;
-}
-option {
-	font-weight: normal;
-}
-input, textarea, select {
-	background: #f9f9f9;
-	color: #000;
-	border-width: 1px;
-	border-style: solid;
-	border-color: #000 #ccc #ccc #000;
-}
-input.invalid, textarea.invalid, select.invalid {
-	border: 1px solid red;
-	background: #fff; 
-	color: red;
-	box-shadow: 0 0 0 1px rgba(218, 62, 90, 0.3)
-}
-input, textarea, select, option {
-	font: 1em "DejaVu Sans","Lucida Grande","Lucida Sans Unicode",Arial,sans-serif;
-}
-input[type=text], input[type=password], textarea {
-	padding: 2px 0;
-	margin-right: .3em;
-}
-input[type=checkbox], input[type=radio] {
-	border: none;
-}
-textarea {
-	padding: 2px 0;
-}
-
-input[type=checkbox], input[type=radio] {
-	margin: 0;
-	padding: 0;
-	background: transparent;
-}
-label {
-	display: block;
-}
-label input, label select, label span {
-	display: block;
-}
-p.form-note {
-	font-style:italic;
-	margin-top: -.7em;
-	color: #666;
-}
-span.form-note {
-	font-style:italic;
-	font-weight: normal;
-	color: #666;
-}
-p.form-note.warn, p.form-note.info, p.warning {
-	font-style: normal;
-	padding: .2em 1em .1em 24px;
-}
-p.form-note.warn, p.warning {
-	background: #ffd url(warning.png) no-repeat .3em .3em;
-	border: 1px solid #f0c020;
-}
-p.form-note.info {
-	background: #eef url(info.png) no-repeat .3em .2em;
-	border: 1px solid #99f;
-}
-.form-note a {border-bottom: 1px solid #99f;}
-
-label.classic {
-	display: inline;
-}
-label.classic input, label span input, label.classic select, label span select {
-	display: inline;
-}
-
-label.area, p.area {
-	width: inherit !important;
-}
-.area textarea {
-	display: block;
-	width: 100%;
-	resize: vertical;
-}
-label.required {
-	font-weight: bold;
-}
-label.required abbr {
-	color: #dd0000;
-	font-size: 1.3em;
-}
-label.inline {
-	display: inline;
-}
-p.field {
-	position: relative;
-	
-}
-p.field label {
-	display: block;
-	width: 14em;
-}
-p.field input, p.field select {
-	display: inline;
-	position: absolute;
-	left: 15em;
-	top: 0;
-}
-label .maximal, textarea.maximal, input.maximal {
-	width: 100%;
-}
-textarea.maximal {
-	resize: vertical;
-}
-
-a.form-control {
-	display: none;
-	font-weight: bold;
-	background: url(magnifier.png) no-repeat 0 0;
-	color: green;
-	padding-left: 20px;
-}
-.constrained {
-	margin: 0;
-	padding: 0;
-	border: none;
-	background: transparent;
-}
-
-/* --------------------------------------------------------------- buttons */
-h2 a.button {
-	color: #333;
-	font-weight: normal;
-	font-size: .75em;
-	vertical-align: middle;
-}
-/* commun */
-input[type=submit],
-input[type=reset],
-input[type=button],
-a.button,
-a.back,
-a.submit {
-	display: inline-block;
-	outline: none;
-	cursor: pointer;
-	text-align: center;
-	text-decoration: none;
-	padding: .1em .5em 0 .5em;
-	text-shadow: 0 1px 1px rgba(0,0,0,.3);
-	border-radius: .2em;
-	margin-bottom: .1em;
-}
-/* validation */
-input[type=submit],
-input[type=button],
-a.submit {
-	color: #fff;
-	border: 1px solid #2373A8;
-	background: #2373A8;
-	background: -webkit-gradient(linear, left top, left bottom, from(#2C8FD1), to(#2373A8));
-	background: -moz-linear-gradient(top,  #2C8FD1,  #2373A8);
-}
-input[type=submit]:hover,
-input[type=button]:hover,
-a.submit:hover,
-input[type=submit]:focus,
-input[type=button]:focus,
-a.submit:focus {
-	background: #2373A8;
-	background: -webkit-gradient(linear, left top, left bottom, from(#2373A8), to(#2C8FD1));
-	background: -moz-linear-gradient(top,  #2373A8,  #2C8FD1);
-	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#2373A8', endColorstr='#2C8FD1');
-	border: 1px solid #2C8FD1;
-}
-/* suppression et reset */
-a.button,
-a.back,
-input[type=submit].reset,
-input[type=submit].delete {
-	border: 1px solid #ccc;
-	background: #f5f5f5;
-	color: #000;
-	background: -webkit-gradient(linear, left top, left bottom, from(#f5f5f5), to(#dfdfdf));
-	background: -moz-linear-gradient(top,  #f5f5f5,  #dfdfdf);
-	text-shadow: none;
+/* ---------------------------------------------------------------------------
+	Media queries vite fait en attendant la reprise complète du layout
+---------------------------------------------------------------------------- */
+@media screen and (max-width: 920px) {
+	#top, #top h1 a {width: 42px !important; height:100%; overflow: hidden;
+}
+	#top h1 a:link {
+		background: transparent url(dc_logos/b-dotclear120.png) no-repeat -180px 6px;
+		border-right: 1px solid #ccc;
 	}
-a.button:hover,
-a.back:hover,
-input[type=reset]:hover,
-input[type=submit].reset:hover,
-input[type=submit].delete:hover,
-a.button:focus,
-a.back:focus,
-input[type=reset]:focus,
-input[type=submit].reset:focus,
-input[type=submit].delete:focus {
-	background: #dfdfdf;
-	background: -webkit-gradient(linear, left top, left bottom, from(#dfdfdf), to(#f5f5f5));
-	background: -moz-linear-gradient(top,  #dfdfdf,  #f5f5f5);
-	filter:  progid:DXImageTransform.Microsoft.gradient(startColorstr='#e5e5e5', endColorstr='#f5f5f5');
+	#top h1 a:hover, #top h1 a:focus {
+		background: url(dc_logos/b-dotclear120.png) no-repeat -180px -94px;
+		border-right: 1px solid #A2CBE9;
 	}
-a.delete,
-input.delete,
-input[type=submit].delete {
-	color: #c00;
-	padding-bottom: .1em;
-}
-#entry-content .delete {
-	margin-left: 1em;
-}
-a.delete:hover,
-input.delete:hover,
-input[type=submit].delete:hover,
-a.delete:focus,
-input.delete:focus,
-input[type=submit].delete:focus {
-	border-color: #c00;
-}
-/* finasseries */
-input[type=button] {
-	padding: .1em;
-}
-#info-box a.button {
-	padding: 0 .5em;
-	margin-left: 2em;
-}
-a.back:before {
-	content: "\ab\a0";
-}
-a.button.add {
-	border-radius: .5em;
-	margin-bottom: .1em;	
-	background: #2C8FD1 url(../images/add.png) no-repeat 6px center;
-	color: #fff;
-	padding: .2em 16px .2em 30px;
-	border: 1px solid #2373A8;
-}
-a.button.add:hover, a.button.add:focus {
-	background-color: #2373A8;
-}
-
-/* jQuery Autocomplete plugin */
-.ac_results {
-	padding: 0px;
-	border: 1px dotted #f90;
-	background-color: white;
-	overflow: hidden;
-	z-index: 99999;
-}
-.ac_results ul {
-	width: 100%;
-	list-style-position: outside;
-	list-style: none;
-	padding: 0;
-	margin: 0;
-}
-.ac_results li {
-	margin: 0px;
-	padding: 2px 5px;
-	cursor: default;
-	display: block;
-	font: menu;
-	font-size: 1em;
-	line-height: 16px;
-	overflow: hidden;
-}
-.ac_loading {
-	background: transparent url('loader.gif') right center no-repeat;
-}
-.ac_over {
-	background-color: #06c;
-	color: white;
-}
-
-/* --------------------------------------------------------------- password indcator */
-.pw-table {
-	display: table;
-	margin-bottom: 1em;
-}
-.pw-cell {
-	display: table-cell;
-	margin-bottom: 1em;
-}
-#pwindicator {
-	display: table-cell;
-	vertical-align: bottom;
-	padding-left: 1.5em;
-	height: 3.8em;
-}
-#pwindicator .bar {
-	height: 6px;
-	margin-bottom: 4px;
-}
-.pw-very-weak .bar {
-	background: #900;
-	width: 30px;
-}
-.pw-weak .bar {
-	background: #c00;
-	width: 60px;
-}
-.pw-mediocre .bar {
-	background: #f60;
-	width: 90px;
-}
-.pw-strong .bar {
-	background: #060;
-	width: 120px;
-}
-.pw-very-strong .bar {
-	background: #0c0;
-	width: 150px;
-}
+}
+@media screen and (max-width: 800px) {
+	#top, #info-boxes, #info-box1, #info-box2 {
+		display:inline-block;
+		vertical-align:middle;
+		margin:0;
+		padding:0;
+		line-height: 32px; /* ie < 9 sucks */
+		line-height: 3.2rem;
+	}
+	#info-box1 {margin-left: .75em;}
+	#info-box1 select {width: 140px; width: 14rem;}
+	#main-menu, #main, #content, #content h2, #entry-wrapper, #entry-sidebar, #entry-content, .two-cols .col, .two-cols .col:first-child {
+    	display:block;
+    	width: 98%;
+    	margin:0 auto;
+    	padding:0;
+    	float:none;
+    	text-align: left;
+    	clear: both;
+  	}
+  	#content {
+  		width: 100%;
+  		padding-top: .5em;
+  	}
+}
+@media screen and (max-width: 720px) {
+	.smallscreen {display: none;}
+	#help-button {width:20px; overflow: hidden;}
+	#info-box2 {float:none;}
+	#dashboard-items div {display: block;margin-bottom: 1em; padding: 0 1em;}
+	#help-button {height:26px; width:26px; background-color: #A2CBE9; padding: 0; margin:0;font-size:10px; font-size: 1rem;line-height: 68px}
+}
+@media screen and (max-width: 492px) {
+	#header {height: 36px; height: 3.6rem;}
+	#wrapper {font-size: 16px; font-size: 1.6rem;}
+	.page-title, #info-boxes, .media-item {display: inline-block;}
+	div.media-list .media-item {width: 90%; float: none}
+	#info-box1 select {width: 120px; width: 12rem; margin-right: .6rem;}
+	#info-box1 p.nomobile, label.nomobile {display: none;}
+}
Index: admin/style/install.css
===================================================================
--- admin/style/install.css	(revision 1583)
+++ admin/style/install.css	(revision 1620)
@@ -6,9 +6,13 @@
 	Please see http://dotclear.net/ for more details.
 */
+html {
+	font-size: 62.5%;
+}
 body.install {
-	font: 0.875em Helvetica,Arial,sans-serif;
-	color: #000;
-	background-color: #fff;
-	line-height: 1.5em;
+	font: 1.2rem/1.5 Arial,Helvetica,sans-serif;
+	color: #333;
+	background: #fff;
+	margin: 0;
+	padding: 0;
 }
 body.install #content {
@@ -22,5 +26,5 @@
 }
 body.install h1,h2 {
-	font-family: Helvetica,arial,sans-serif;
+	font-family: arial,Helvetica,sans-serif;
 }
 body.install h1 {
Index: admin/style/jsToolBar/jsToolBar.css
===================================================================
--- admin/style/jsToolBar/jsToolBar.css	(revision 1065)
+++ admin/style/jsToolBar/jsToolBar.css	(revision 1727)
@@ -2,13 +2,16 @@
 	border-width : 0 1px 1px 1px;
 	border-style : solid;
-	border-color : #000 #ccc #ccc #000;
-	padding-left: 5px;
-	background : #f9f9f9;
+	border-color : #ddd;
+	background : #f7f7f7;
 }
 .jstEditor textarea, .jstEditor iframe {
-  margin: 0;
-  border: 0;
+	-webkit-box-sizing: border-box;
+	-moz-box-sizing: border-box;
+	box-sizing: border-box;	
+	margin: 0;
+	border: 1px solid #fbfbfb;
+  	width: 100%;
+  	padding: .5em 0 0 0;
 }
-
 .jstHandle {
 	height: 8px;
@@ -20,11 +23,16 @@
 	border-style: solid;
 }
-
+.jstEditor textarea:focus, .jstEditor iframe:focus {
+	border-color: #bee74b;
+}
 .jstElements {
-	padding: 3px 3px;
-	border-width: 1px 1px 0 1px;
-	border-style: solid;
-	border-color: #000 #ccc #ccc #000;
-	background: #dfdfdf;
+	height: 28px;
+	padding: 0 1rem; 
+	border: 1px solid #dfdfdf;
+	overflow: hidden; 
+	background: #f5f5f5; 
+	-moz-border-radius: 4px 4px 0 0; 
+	-webkit-border-radius: 4px 4px 0 0; 
+	border-radius: 4px 4px 0 0; 
 }
 
@@ -34,19 +42,19 @@
 .jstElements select {
 	width: 12em;
+	margin-right: .6rem;
+	border: 1px solid #ddd; 
 }
 .jstElements button {
-	margin-right : 2px;
-	width : 20px;
-	height: 20px;
-	padding: 0;
+	width : 30px;
+	height: 28px;
 	border-style: solid;
-	border-width: 1px;
-	border-color: #dfdfdf;
-	background-color : transparent;
+	border-width:  0 1px 0 0;
+	border-color: #e7e7e7;
+	background-color : #f7f7f7;
 	background-position : 50% 50%;
 	background-repeat: no-repeat;
 }
 .jstElements button:hover {
-	border-color : #ccc;
+	border-color : #ddd;
 	background-color: #fff;
 }
@@ -55,11 +63,12 @@
 }
 .jstElements span {
-	display : inline;
+	display : inline-block;
+	vertical-align: top;
+	background: #e5e5e5;
 }
-
-.jstSpacer {
-	width : 0px;
-	font-size: 1px;
-	margin-right: 4px;
+span.jstSpacer {
+	width : 6px;
+	height: 28px;
+	margin-right: 0;
 }
 
@@ -67,19 +76,17 @@
 	display: block;
 	list-style: none;
-	margin: 0 0 0 -5px;
+	margin: 0;
 	padding: 0 0 5px 0;
 	background: #dfdfdf;
 	border-top: 1px solid #999;
-	font-size: 90%;
-	font-weight: bold;
 }
 .jstSwitcher li {
 	display: inline;
 	margin: 0 0 0 5px;
-	padding: 2px 4px;
+	padding: 2px 8px;
 }
 .jstSwitcher li.jstSwitcherCurrent {
 	color: #fff;
-	background: #999;
+	background: #575859;
 	border-radius: 0 0 2px 2px;
 }
@@ -143,5 +150,4 @@
 }
 
-
 /* WYSIWYG Iframe */
 .wysiwygIframe {
Index: admin/style/jsUpload/style.css
===================================================================
--- admin/style/jsUpload/style.css	(revision 1209)
+++ admin/style/jsUpload/style.css	(revision 1588)
@@ -20,5 +20,4 @@
 	float: left;
 }
-
 .enhanced_uploader .button:hover {
 	background: #2373A8;
@@ -27,6 +26,6 @@
 	border: 1px solid #2C8FD1;
 }
-
-.enhanced_uploader .add, .enhanced_uploader .clean, .enhanced_uploader .cancel, .enhanced_uploader .disabled {
+.enhanced_uploader .add, .enhanced_uploader .clean, 
+.enhanced_uploader .cancel, .enhanced_uploader .disabled {
 	text-shadow: none;
 	color: #000;
@@ -36,6 +35,6 @@
 	border: 1px solid #CCCCCC;
 }
-
-.enhanced_uploader .button.add:hover, .enhanced_uploader .button.clean:hover, .enhanced_uploader .button.cancel:hover, .enhanced_uploader .disabled:hover {
+.enhanced_uploader .button.add:hover, .enhanced_uploader .button.clean:hover, 
+.enhanced_uploader .button.cancel:hover, .enhanced_uploader .disabled:hover {
 	background: #DFDFDF;
 	background: -webkit-gradient(linear, left top, left bottom, from(#DFDFDF), to(#F5F5F5));
@@ -49,21 +48,14 @@
 	border: 1px solid #CCCCCC;
 }
-
-.enhanced_uploader .fileupload-buttonbar {
+/*.enhanced_uploader .fileupload-buttonbar {
 	margin-top: 2em;
-}
-
+}*/
 .enhanced_uploader .upload-filecancel {
 	border: none;
 }
-
-.enhanced_uploader .add {
-	margin-right: 4em;
+.enhanced_uploader .add, .enhanced_uploader .cancel, 
+.enhanced_uploader .clean, .enhanced_uploader .start {
+	margin-right: .4em;
 }
-
-.enhanced_uploader .cancel, .enhanced_uploader .clean, .enhanced_uploader .start {
-	margin-left: .5em;
-}
-
 .enhanced_uploader #upfile {
 	visibility: hidden;
@@ -75,61 +67,62 @@
 	cursor: pointer;
 }
-
-.button.clean, .button.cancel, .button.add, .enhanced_uploader .fileupload-buttonbar .button.start {
+.button.clean, .button.cancel, .button.add {
 	display: none;
 }
-
 .enhanced_uploader .button.add {
 	display: inline-block;
 }
-
 .enhanced_uploader .max-size {
 	display: block;
 }
-
 .enhanced_uploader .one-file {
 	display: none;
 }
-
 label span.one-file {
 	display: inline;
 }
-
 .enhanced_uploader p.clear {
-	margin-top: 3em;
-	margin-bottom: 0;
+	padding-top: 1em;
+	margin-bottom: 1em;
 }
-
 #add-file-f p.clear {
 	margin-top: 1em;
 	margin-bottom: 0;
+	clear: both;
 }
-
 /* files */
+.files {
+	list-style-type: none;
+	margin-left: 0;
+	padding-left: 0;
+}
+.files li {
+	margin-left: 0;
+	padding-left: 0;
+}
 .upload-msg {
 	font-weight: bold;
 }
-
 .upload-msg.upload-error {
 	color: #c00;
 }
-
 .upload-files {
 	padding: 0 0.5em;
 	margin: 10px 0;
 }
-
 .upload-file {
 	margin: 0 0 8px 0;
 	position: relative;
 }
-
 .upload-fileinfo {
-	margin-left: 16px;
+	margin-left: 8px;
 	margin-bottom: .4em;
 }
-
+.upload-fileinfo span {
+	padding-right: 8px;
+}
 .upload-fileinfo .upload-filecancel {
 	display: block;
+	padding-right: 0;
 	margin-top: 3px;
 	width: 20px;
@@ -140,18 +133,14 @@
 	float: left;
 }
-
 .upload-filemsg {
 	font-weight: bold;
 	color: green;
 }
-
 .upload-filemsg.upload-error {
 	color: #c00;
 }
-
 .upload-progress {
-	padding: 0 1em;
+	padding: 0 8px;
 }
-
 .upload-progress div {
 	width: 0;
@@ -166,6 +155,9 @@
 	border-radius: 2px;
 }
-
 div.template-upload {
 	clear: both;
 }
+.queue-message {
+	font-weight: bold;
+	margin: 0 0 1em 0;
+}
Index: admin/trackbacks.php
===================================================================
--- admin/trackbacks.php	(revision 1179)
+++ admin/trackbacks.php	(revision 1614)
@@ -83,5 +83,15 @@
 /* DISPLAY
 -------------------------------------------------------- */
-dcPage::open($page_title,dcPage::jsLoad('js/_trackbacks.js'));
+if ($can_view_page) {
+	$breadcrumb = dcPage::breadcrumb(
+	array(
+		html::escapeHTML($core->blog->name) => '',
+		html::escapeHTML($post->post_title) => $core->getPostAdminURL($post->post_type,$id),
+		'<span class="page-title">'.$page_title.'</span>' => ''
+	));
+} else {
+	$breadcrumb = '';
+}
+dcPage::open($page_title,dcPage::jsLoad('js/_trackbacks.js'),$breadcrumb);
 
 # Exit if we cannot view page
@@ -94,6 +104,4 @@
 	dcPage::message(__('All pings sent.'));
 }
-
-echo '<h2>'.html::escapeHTML($core->blog->name).' &rsaquo; <span class="page-title">'.$page_title.'</span></h2>';
 
 echo '<p><a class="back" href="'.$core->getPostAdminURL($post->post_type,$id).'">'.
@@ -112,6 +120,6 @@
 	$tb_urls = implode("\n",$TB->discover($post->post_excerpt_xhtml.' '.$post->post_content_xhtml));
 } else {
-	$auto_link = '<strong><a class="button" href="trackbacks.php?id='.$id.'&amp;auto=1">'.
-	__('Auto discover ping URLs').'</a></strong>';
+	$auto_link = '<a class="button" href="trackbacks.php?id='.$id.'&amp;auto=1">'.
+	__('Auto discover ping URLs').'</a>';
 }
 
@@ -119,10 +127,10 @@
 '<h3>'.__('Ping blogs').'</h3>'.
 '<form action="trackbacks.php" id="trackback-form" method="post">'.
-'<p><label for="tb_urls" class="area">'.__('URLs to ping:').
+'<p><label for="tb_urls" class="area">'.__('URLs to ping:').'</label>'.
 form::textarea('tb_urls',60,5,$tb_urls).
-'</label></p>'.
+'</p>'.
 
-'<p><label for="tb_excerpt" class="area">'.__('Send excerpt:').
-form::textarea('tb_excerpt',60,3,$tb_excerpt).'</label></p>'.
+'<p><label for="tb_excerpt" class="area">'.__('Send excerpt:').'</label>'.
+form::textarea('tb_excerpt',60,5,$tb_excerpt).'</p>'.
 
 '<p>'.form::hidden('id',$id).
@@ -147,4 +155,5 @@
 }
 
+dcPage::helpBlock('core_trackbacks');
 dcPage::close();
 ?>
Index: admin/update.php
===================================================================
--- admin/update.php	(revision 1591)
+++ admin/update.php	(revision 1620)
@@ -174,12 +174,15 @@
 		dcPage::jsPageTabs($default_tab).
 		dcPage::jsLoad('js/_update.js')
-	: '')
+		: ''),
+	dcPage::breadcrumb(
+		array(
+			__('System') => '',
+			'<span class="page-title">'.__('Dotclear update').'</span>' => ''
+		))
 );
 
 if (!$core->error->flag()) {
-	echo '<h2>'.__('Dotclear update').'</h2>';
-	
 	if (!empty($_GET['nocache'])) {
-		dcPage::message(__('Manual checking of update done successfully.'));
+		dcPage::success(__('Manual checking of update done successfully.'));
 	}
 }
@@ -200,5 +203,5 @@
 		echo
 			'<p class="static-msg">'.sprintf(__('Dotclear %s is available.'),$new_v).
-				($version_info ? ' ('.sprintf(__('<a href=\"%s\">Information about this version</a>.'),$version_info).')' : '').
+				($version_info ? ' <a href="'.$version_info.'">('.__('Information about this version').')</a>' : '').
 				'</p>'.
 		
Index: admin/user.php
===================================================================
--- admin/user.php	(revision 1583)
+++ admin/user.php	(revision 1719)
@@ -15,5 +15,5 @@
 dcPage::checkSuper();
 
-$page_title = __('new user');
+$page_title = __('New user');
 
 $user_id = '';
@@ -32,18 +32,11 @@
 $user_options = $core->userDefaults();
 
-foreach ($core->getFormaters() as $v) {
-	$formaters_combo[$v] = $v;
-}
-
-foreach ($core->blog->getAllPostStatus() as $k => $v) {
-	$status_combo[$v] = $k;
-}
+# Formaters combo
+$formaters_combo = dcAdminCombos::getFormatersCombo();
+
+$status_combo = dcAdminCombos::getPostStatusesCombo();
 
 # Language codes
-$langs = l10n::getISOcodes(1,1);
-foreach ($langs as $k => $v) {
-	$lang_avail = $v == 'en' || is_dir(DC_L10N_ROOT.'/'.$v);
-	$lang_combo[] = new formSelectOption($k,$v,$lang_avail ? 'avail10n' : '');
-}
+$lang_combo = dcAdminCombos::getAdminLangsCombo();
 
 # Get user if we have an ID
@@ -187,16 +180,33 @@
 	
 	# --BEHAVIOR-- adminUserHeaders
-	$core->callBehavior('adminUserHeaders')
+	$core->callBehavior('adminUserHeaders'),
+
+	dcPage::breadcrumb(
+		array(
+			__('System') => '',
+			__('Users') => 'users.php',
+			'<span class="page-title">'.$page_title.'</span>' => ''
+		))
 );
 
 if (!empty($_GET['upd'])) {
-	dcPage::message(__('User has been successfully updated.'));
+	dcPage::success(__('User has been successfully updated.'));
 }
 
 if (!empty($_GET['add'])) {
-	dcPage::message(__('User has been successfully created.'));
-}
-
-echo '<h2><a href="users.php">'.__('Users').'</a> &rsaquo; <span class="page-title">'.$page_title.'</span></h2>';
+	dcPage::success(__('User has been successfully created.'));
+}
+
+echo
+'<form action="user.php" method="post" id="user-form">'.
+'<div class="two-cols">'.
+
+'<div class="col">'.
+'<h3>'.__('User profile').'</h3>'.
+
+'<p><label for="user_id" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('User ID:').'</label> '.
+form::field('user_id',20,255,html::escapeHTML($user_id)).
+'</p>'.
+'<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p>';
 
 if ($user_id == $core->auth->userID()) {
@@ -207,13 +217,4 @@
 
 echo
-'<form action="user.php" method="post" id="user-form">'.
-'<fieldset><legend>'.__('User information').'</legend>'.
-'<div class="two-cols">'.
-'<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)).
-'</label></p>'.
-'<p class="form-note">'.__('At least 2 characters using letters, numbers or symbols.').'</p>'.
-
 '<div class="pw-table">'.
 	'<p class="pw-cell">'.
@@ -231,49 +232,7 @@
 
 '<p><label for="new_pwd_c" '.($user_id != '' ? '' : 'class="required"').'>'.
-($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> ').__('Confirm password:').' '.
+($user_id != '' ? '' : '<abbr title="'.__('Required field').'">*</abbr> ').__('Confirm password:').'</label> '.
 form::password('new_pwd_c',20,255).
-'</label></p>'.
-
-'<p><label for="user_name">'.__('Last Name:').' '.
-form::field('user_name',20,255,html::escapeHTML($user_name)).
-'</label></p>'.
-
-'<p><label for="user_firstname">'.__('First Name:').' '.
-form::field('user_firstname',20,255,html::escapeHTML($user_firstname)).
-'</label></p>'.
-
-'<p><label for="user_displayname">'.__('Display name:').' '.
-form::field('user_displayname',20,255,html::escapeHTML($user_displayname)).
-'</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>'.
-'</div>'.
-
-'<div class="col">'.
-'<p><label for="user_url">'.__('URL:').' '.
-form::field('user_url',30,255,html::escapeHTML($user_url)).
-'</label></p>'.
-'<p><label for="user_post_format">'.__('Preferred format:').' '.
-form::combo('user_post_format',$formaters_combo,$user_options['post_format']).
-'</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').
-'</label></p>'.
-
-'<p><label for="user_tz">'.__('User timezone:').' '.
-form::combo('user_tz',dt::getZones(true,true),$user_tz).
-'</label></p>';
+'</p>';
 
 if ($core->auth->allowPassChange()) {
@@ -285,19 +244,66 @@
 
 $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).' '.
 __('Super administrator').'</label></p>'.
+
+'<p><label for="user_name">'.__('Last Name:').'</label> '.
+form::field('user_name',20,255,html::escapeHTML($user_name)).
+'</p>'.
+
+'<p><label for="user_firstname">'.__('First Name:').'</label> '.
+form::field('user_firstname',20,255,html::escapeHTML($user_firstname)).
+'</p>'.
+
+'<p><label for="user_displayname">'.__('Display name:').'</label> '.
+form::field('user_displayname',20,255,html::escapeHTML($user_displayname)).
+'</p>'.
+
+'<p><label for="user_email">'.__('Email:').'</label> '.
+form::field('user_email',20,255,html::escapeHTML($user_email)).
+'</p>'.
+'<p class="form-note">'.__('Mandatory for password recovering procedure.').'</p>'.
+
+'<p><label for="user_url">'.__('URL:').'</label> '.
+form::field('user_url',30,255,html::escapeHTML($user_url)).
+'</p>'.
 '</div>'.
-'</div>'.
-'</fieldset>';
+
+'<div class="col">'.
+'<h3>'.__('Options').'</h3>'.
+'<h4>'.__('Interface').'</h4>'.
+'<p><label for="user_lang">'.__('Language:').'</label> '.
+form::combo('user_lang',$lang_combo,$user_lang,'l10n').
+'</p>'.
+
+'<p><label for="user_tz">'.__('Timezone:').'</label> '.
+form::combo('user_tz',dt::getZones(true,true),$user_tz).
+'</p>'.
+
+'<h4>'.__('Edition').'</h4>'.
+'<p><label for="user_post_format">'.__('Preferred format:').'</label> '.
+form::combo('user_post_format',$formaters_combo,$user_options['post_format']).
+'</p>'.
+
+'<p><label for="user_post_status">'.__('Default entry status:').'</label> '.
+form::combo('user_post_status',$status_combo,$user_post_status).
+'</p>'.
+
+'<p><label for="user_edit_size">'.__('Entry edit field height:').'</label> '.
+form::field('user_edit_size',5,4,(integer) $user_options['edit_size']).
+'</p>';
 
 # --BEHAVIOR-- adminUserForm
 $core->callBehavior('adminUserForm',isset($rs) ? $rs : null);
 
+echo 
+'</div>'.
+'</div>';
+
+
 echo
-'<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 vertical-separator"><label for="your_pwd" class="required">'.
+'<abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').'</label>'.
+form::password('your_pwd',20,255).'</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').'" />').
@@ -310,51 +316,61 @@
 if ($user_id)
 {
-	echo '<div class="clear fieldset"><h3>'.__('Permissions').'</h3>'.
-	'<form action="users_actions.php" method="post">'.
-	'<p><input type="submit" value="'.__('Add new permissions').'" />'.
-	form::hidden(array('redir'),'user.php?id='.$user_id).
-	form::hidden(array('action'),'blogs').
-	form::hidden(array('users[]'),$user_id).
-	$core->formNonce().
-	'</p>'.
-	'</form>';
-	
-	$permissions = $core->getUserPermissions($user_id);
-	$perm_types = $core->auth->getPermissionsTypes();
-	
-	if (count($permissions) == 0)
+	echo '<div class="clear fieldset">'.
+	'<h3>'.__('Permissions').'</h3>';
+
+	if (!$user_super)
 	{
-		echo '<p>'.__('No permissions.').'</p>';
-	}
-	else
-	{
-		foreach ($permissions as $k => $v)
+		echo
+		'<form action="users_actions.php" method="post">'.
+		'<p><input type="submit" value="'.__('Add new permissions').'" />'.
+		form::hidden(array('redir'),'user.php?id='.$user_id).
+		form::hidden(array('action'),'blogs').
+		form::hidden(array('users[]'),$user_id).
+		$core->formNonce().
+		'</p>'.
+		'</form>';
+		
+		$permissions = $core->getUserPermissions($user_id);
+		$perm_types = $core->auth->getPermissionsTypes();
+		
+		if (count($permissions) == 0)
 		{
-			if (count($v['p']) > 0)
+			echo '<p>'.__('No permissions so far.').'</p>';
+		}
+		else
+		{
+			foreach ($permissions as $k => $v)
 			{
-				echo 
-				'<form action="users_actions.php" method="post">'.
-				'<h4><a href="blog.php?id='.html::escapeHTML($k).'">'.
-				html::escapeHTML($v['name']).'</a> ('.html::escapeHTML($k).')</h4>';
-				
-				echo '<ul>';
-				foreach ($v['p'] as $p => $V) {
-					if (isset($perm_types[$p])) {
-						echo '<li>'.__($perm_types[$p]).'</li>';
+				if (count($v['p']) > 0)
+				{
+					echo 
+					'<form action="users_actions.php" method="post">'.
+					'<p class="blog-perm">'.__('Blog:').' <a href="blog.php?id='.html::escapeHTML($k).'">'.
+					html::escapeHTML($v['name']).'</a> ('.html::escapeHTML($k).')</p>';
+					
+					echo '<ul class="ul-perm">';
+					foreach ($v['p'] as $p => $V) {
+						if (isset($perm_types[$p])) {
+							echo '<li>'.__($perm_types[$p]).'</li>';
+						}
 					}
+					echo
+					'</ul>'.
+					'<p class="add-perm"><input type="submit" class="reset" value="'.__('Change permissions').'" />'.
+					form::hidden(array('redir'),'user.php?id='.$user_id).
+					form::hidden(array('action'),'perms').
+					form::hidden(array('users[]'),$user_id).
+					form::hidden(array('blogs[]'),$k).
+					$core->formNonce().
+					'</p>'.
+					'</form>';
 				}
-				echo '</ul>'.
-				'<p><input type="submit" value="'.__('Change permissions').'" />'.
-				form::hidden(array('redir'),'user.php?id='.$user_id).
-				form::hidden(array('action'),'perms').
-				form::hidden(array('users[]'),$user_id).
-				form::hidden(array('blogs[]'),$k).
-				$core->formNonce().
-				'</p>'.
-				'</form>';
-			}
-		}
-	}
-	
+			}
+		}	
+
+	} 
+	else {
+		echo '<p>'.sprintf(__('%s is super admin (all rights on all blogs).'),'<strong>'.$user_id.'</strong>').'</p>';
+	}	
 	echo '</div>';
 }
Index: admin/users.php
===================================================================
--- admin/users.php	(revision 1237)
+++ admin/users.php	(revision 1609)
@@ -39,5 +39,5 @@
 
 
-# Get users
+#?Get users
 $page = !empty($_GET['page']) ? $_GET['page'] : 1;
 $nb_per_page =  30;
@@ -94,5 +94,11 @@
 }
 
-dcPage::open(__('Users'),$starting_script);
+dcPage::open(__('Users'),$starting_script,
+	dcPage::breadcrumb(
+		array(
+			__('System') => '',
+			'<span class="page-title">'.__('Users').'</span>' => ''
+		))
+);
 
 if (!$core->error->flag())
@@ -105,36 +111,35 @@
 	}
 	
-	echo 
-	'<h2 class="page-title">'.__('Users').'</h2>'.
-	'<p class="top-add"><strong><a class="button add" href="user.php">'.__('Create a new user').'</a></strong></p>';
+	echo
+	'<p class="top-add"><strong><a class="button add" href="user.php">'.__('New user').'</a></strong></p>';
 	
 	if (!$show_filters) {
-		echo '<p><a id="filter-control" class="form-control" href="#">'.__('Filters').'</a></p>';
+		echo '<p><a id="filter-control" class="form-control" href="#">'.__('Filter users list').'</a></p>';
 	}
 	
 	echo
 	'<form action="users.php" method="get" id="filters-form">'.
-	'<fieldset class="two-cols"><legend>'.__('Filters').'</legend>'.
+	'<h3 class="hidden">'.__('Filter users list').'</h3>'.
 	
-	'<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>'.
+	'<div class="table">'.
+	'<div class="cell">'.
+	'<h4>'.__('Filters').'</h4>'.
+	'<p><label for="q" class="ib">'.__('Search:').'</label> '.
+	form::field('q',20,255,html::escapeHTML($q)).'</p>'.
 	'</div>'.
-	
-	'<div class="col">'.
-	'<p><label for="q">'.__('Search:').' '.
-	form::field('q',20,255,html::escapeHTML($q)).
-	'</label></p>'.
-	'<p><label for="nb" class="classic">'.	form::field('nb',3,3,$nb_per_page).' '.
-	__('Users per page').'</label> '.
-	'<input type="submit" value="'.__('Apply filters').'" /></p>'.
+
+	'<div class="cell filters-options">'.
+	'<h4>'.__('Display options').'</h4>'.
+	'<p><label for="sortby" class="ib">'.__('Order by:').'</label> '.
+	form::combo('sortby',$sortby_combo,$sortby).'</p> '.
+	'<p><label for="order" class="ib">'.__('Sort:').'</label> '.
+	form::combo('order',$order_combo,$order).'</p>'.
+	'<p><span class="label ib">'.__('Show').'</span> <label for="nb" class="classic">'.	
+	form::field('nb',3,3,$nb_per_page).' '.__('users per page').'</label></p> '.
 	'</div>'.
-	
-	'<br class="clear" />'. //Opera sucks
-	'</fieldset>'.
+	'</div>'.
+
+	'<p><input type="submit" value="'.__('Apply filters and display options').'" />'.	
+	'<br class="clear" /></p>'. //Opera sucks
 	'</form>';
 	
Index: admin/users_actions.php
===================================================================
--- admin/users_actions.php	(revision 1555)
+++ admin/users_actions.php	(revision 1620)
@@ -131,9 +131,26 @@
 /* DISPLAY
 -------------------------------------------------------- */
+if (!empty($users) && empty($blogs) && $action == 'blogs') {
+	$breadcrumb = dcPage::breadcrumb(
+		array(
+			__('System') => '',
+			__('Users') => 'users.php',
+			'<span class="page-title">'.__('Permissions').'</span>' => ''
+		));
+} else {
+	$breadcrumb = dcPage::breadcrumb(
+		array(
+			__('System') => '',
+			__('Users') => 'users.php',
+			'<span class="page-title">'.__('Actions').'</span>' => ''
+		));
+}
+
 dcPage::open(
 	__('Users'),
 	dcPage::jsLoad('js/_users_actions.js').
 	# --BEHAVIOR-- adminUsersActionsHeaders
-	$core->callBehavior('adminUsersActionsHeaders')
+	$core->callBehavior('adminUsersActionsHeaders'),
+	$breadcrumb
 );
 
@@ -162,4 +179,6 @@
 }
 
+echo '<p><a class="back" href="'.html::escapeURL($redir).'">'.__('Back to user profile').'</a></p>';
+
 # --BEHAVIOR-- adminUsersActionsContent
 $core->callBehavior('adminUsersActionsContent',$core,$action,$hidden_fields);
@@ -177,6 +196,5 @@
 	}
 	
-	echo 
-	'<h2><a href="users.php">'.__('Users').'</a> &rsaquo; <span class="page-title">'.__('Permissions').'</span></h2>'.
+	echo
 	'<p>'.sprintf(
 		__('Choose one or more blogs to which you want to give permissions to users %s.'),
@@ -239,5 +257,4 @@
 	
 	echo 
-	'<h2><a href="users.php">'.__('Users').'</a> &rsaquo; <span class="page-title">'.__('Permissions').'</span></h2>'.
 	'<p>'.sprintf(
 		__('You are about to change permissions on the following blogs for users %s.'),
@@ -248,5 +265,5 @@
 	foreach ($blogs as $b)
 	{
-		echo '<h3><a href="blog.php?id='.html::escapeHTML($b).'">'.html::escapeHTML($b).'</a>'.
+		echo '<h3>'.('Blog:').' <a href="blog.php?id='.html::escapeHTML($b).'">'.html::escapeHTML($b).'</a>'.
 		form::hidden(array('blogs[]'),$b).'</h3>';
 		
@@ -268,16 +285,15 @@
 	
 	echo
-	'<fieldset><legend>'.__('Validate permissions').'</legend>'.
-	'<p><label for="your_pwd" class="required"><abbr title="'.__('Required field').'">*</abbr> '.__('Your password:').
-	form::password('your_pwd',20,255).'</label></p>'.
-	'</fieldset>'.
+	'<div class="fieldset">'.
+	'<h3>'.__('Validate permissions').'</h3>'.
+	'<p><label for="your_pwd">'.__('Your password:').'</label>'.
+	form::password('your_pwd',20,255).'</p>'.
 	'<p><input type="submit" accesskey="s" value="'.__('Save').'" />'.
 	$hidden_fields.
 	form::hidden(array('action'),'updateperm').
 	$core->formNonce().'</p>'.
+	'</div>'.
 	'</form>';
 }
-
-echo '<p><a class="back" href="'.html::escapeURL($redir).'">'.__('back').'</a></p>';
 
 dcPage::close();
