changeset 1622:d58e514c0a39 beta

Merge with upstream
author Liad Shani <liadff@gmail.com>
date Sat, 29 Oct 2011 19:26:43 +0200
parents cbc2b1913cdf (current diff) 2755c11c90d8 (diff)
children b7094c69979e
files rhodecode/config/deployment.ini_tmpl rhodecode/lib/base.py rhodecode/public/images/button_highlight_selected.png rhodecode/public/images/header_inner.png rhodecode/public/images/title.png rhodecode/public/images/title_link.png
diffstat 28 files changed, 4139 insertions(+), 3130 deletions(-) [+]
line wrap: on
line diff
--- a/development.ini	Sat Oct 29 17:03:33 2011 +0200
+++ b/development.ini	Sat Oct 29 19:26:43 2011 +0200
@@ -91,21 +91,27 @@
 
 beaker.cache.super_short_term.type=memory
 beaker.cache.super_short_term.expire=10
+beaker.cache.super_short_term.key_length = 256
 
 beaker.cache.short_term.type=memory
 beaker.cache.short_term.expire=60
+beaker.cache.short_term.key_length = 256
 
 beaker.cache.long_term.type=memory
 beaker.cache.long_term.expire=36000
+beaker.cache.long_term.key_length = 256
 
 beaker.cache.sql_cache_short.type=memory
 beaker.cache.sql_cache_short.expire=10
+beaker.cache.sql_cache_short.key_length = 256
 
 beaker.cache.sql_cache_med.type=memory
 beaker.cache.sql_cache_med.expire=360
+beaker.cache.sql_cache_med.key_length = 256
 
 beaker.cache.sql_cache_long.type=file
 beaker.cache.sql_cache_long.expire=3600
+beaker.cache.sql_cache_long.key_length = 256
 
 ####################################
 ###       BEAKER SESSION        ####
--- a/production.ini	Sat Oct 29 17:03:33 2011 +0200
+++ b/production.ini	Sat Oct 29 19:26:43 2011 +0200
@@ -91,21 +91,27 @@
 
 beaker.cache.super_short_term.type=memory
 beaker.cache.super_short_term.expire=10
+beaker.cache.super_short_term.key_length = 256
 
 beaker.cache.short_term.type=memory
 beaker.cache.short_term.expire=60
+beaker.cache.short_term.key_length = 256
 
 beaker.cache.long_term.type=memory
 beaker.cache.long_term.expire=36000
+beaker.cache.long_term.key_length = 256
 
 beaker.cache.sql_cache_short.type=memory
 beaker.cache.sql_cache_short.expire=10
+beaker.cache.sql_cache_short.key_length = 256
 
 beaker.cache.sql_cache_med.type=memory
 beaker.cache.sql_cache_med.expire=360
+beaker.cache.sql_cache_med.key_length = 256
 
 beaker.cache.sql_cache_long.type=file
 beaker.cache.sql_cache_long.expire=3600
+beaker.cache.sql_cache_long.key_length = 256
 
 ####################################
 ###       BEAKER SESSION        ####
--- a/rhodecode/config/deployment.ini_tmpl	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/config/deployment.ini_tmpl	Sat Oct 29 19:26:43 2011 +0200
@@ -93,21 +93,27 @@
 
 beaker.cache.super_short_term.type=memory
 beaker.cache.super_short_term.expire=10
+beaker.cache.super_short_term.key_length = 256
 
 beaker.cache.short_term.type=memory
 beaker.cache.short_term.expire=60
+beaker.cache.short_term.key_length = 256
 
 beaker.cache.long_term.type=memory
 beaker.cache.long_term.expire=36000
+beaker.cache.long_term.key_length = 256
 
 beaker.cache.sql_cache_short.type=memory
 beaker.cache.sql_cache_short.expire=10
+beaker.cache.sql_cache_short.key_length = 256
 
 beaker.cache.sql_cache_med.type=memory
 beaker.cache.sql_cache_med.expire=360
+beaker.cache.sql_cache_med.key_length = 256
 
 beaker.cache.sql_cache_long.type=file
 beaker.cache.sql_cache_long.expire=3600
+beaker.cache.sql_cache_long.key_length = 256
 
 ####################################
 ###       BEAKER SESSION        ####
@@ -156,6 +162,7 @@
 # MySQL
 # sqlalchemy.db1.url = mysql://user:pass@localhost/rhodecode
 
+# see sqlalchemy docs for others
 
 sqlalchemy.db1.echo = false
 sqlalchemy.db1.pool_recycle = 3600
--- a/rhodecode/config/routing.py	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/config/routing.py	Sat Oct 29 19:26:43 2011 +0200
@@ -62,6 +62,8 @@
     rmap.connect('home', '/', controller='home', action='index')
     rmap.connect('repo_switcher', '/repos', controller='home',
                  action='repo_switcher')
+    rmap.connect('branch_tag_switcher', '/branches-tags/{repo_name:.*}', 
+                 controller='home',action='branch_tag_switcher')    
     rmap.connect('bugtracker',
                  "http://bitbucket.org/marcinkuzminski/rhodecode/issues",
                  _static=True)
--- a/rhodecode/controllers/home.py	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/controllers/home.py	Sat Oct 29 19:26:43 2011 +0200
@@ -24,7 +24,6 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
 import logging
-from operator import itemgetter
 
 from pylons import tmpl_context as c, request
 from paste.httpexceptions import HTTPBadRequest
@@ -58,3 +57,12 @@
             return render('/repo_switcher_list.html')
         else:
             return HTTPBadRequest()
+
+    def branch_tag_switcher(self, repo_name):
+        if request.is_xhr:
+            c.rhodecode_db_repo = Repository.get_by_repo_name(c.repo_name)
+            c.rhodecode_repo = c.rhodecode_db_repo.scm_instance
+            return render('/switch_to_list.html')
+        else:
+            return HTTPBadRequest()
+
--- a/rhodecode/controllers/summary.py	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/controllers/summary.py	Sat Oct 29 19:26:43 2011 +0200
@@ -23,23 +23,27 @@
 # You should have received a copy of the GNU General Public License
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
+import traceback
 import calendar
 import logging
 from time import mktime
-from datetime import datetime, timedelta, date
+from datetime import timedelta, date
+from itertools import product
 
-from vcs.exceptions import ChangesetError
+from vcs.exceptions import ChangesetError, EmptyRepositoryError, \
+    NodeDoesNotExistError
 
 from pylons import tmpl_context as c, request, url
 from pylons.i18n.translation import _
 
-from rhodecode.model.db import Statistics, Repository
-from rhodecode.model.repo import RepoModel
+from beaker.cache import cache_region, region_invalidate
 
+from rhodecode.model.db import Statistics, CacheInvalidation
+from rhodecode.lib import ALL_READMES, ALL_EXTS
 from rhodecode.lib.auth import LoginRequired, HasRepoPermissionAnyDecorator
 from rhodecode.lib.base import BaseRepoController, render
 from rhodecode.lib.utils import EmptyChangeset
-
+from rhodecode.lib.markup_renderer import MarkupRenderer
 from rhodecode.lib.celerylib import run_task
 from rhodecode.lib.celerylib.tasks import get_commits_stats, \
     LANGUAGES_EXTENSIONS_MAP
@@ -48,6 +52,9 @@
 
 log = logging.getLogger(__name__)
 
+README_FILES = [''.join([x[0][0], x[1][0]]) for x in
+                    sorted(list(product(ALL_READMES, ALL_EXTS)),
+                           key=lambda y:y[0][1] + y[1][1])]
 
 class SummaryController(BaseRepoController):
 
@@ -161,8 +168,44 @@
         if c.enable_downloads:
             c.download_options = self._get_download_links(c.rhodecode_repo)
 
+        c.readme_data, c.readme_file = self.__get_readme_data(c.rhodecode_repo)
         return render('summary/summary.html')
 
+    def __get_readme_data(self, repo):
+
+        @cache_region('long_term')
+        def _get_readme_from_cache(key):
+            readme_data = None
+            readme_file = None
+            log.debug('Fetching readme file')
+            try:
+                cs = repo.get_changeset('tip')
+                renderer = MarkupRenderer()
+                for f in README_FILES:
+                    try:
+                        readme = cs.get_node(f)
+                        readme_file = f
+                        readme_data = renderer.render(readme.content, f)
+                        log.debug('Found readme %s' % readme_file)
+                        break
+                    except NodeDoesNotExistError:
+                        continue
+            except ChangesetError:
+                pass
+            except EmptyRepositoryError:
+                pass
+            except Exception:
+                log.error(traceback.format_exc())
+
+            return readme_data, readme_file
+
+        key = repo.name + '_README'
+        inv = CacheInvalidation.invalidate(key)
+        if inv is not None:
+            region_invalidate(_get_readme_from_cache, None, key)
+            CacheInvalidation.set_valid(inv.cache_key)
+        return _get_readme_from_cache(key)
+
     def _get_download_links(self, repo):
 
         download_l = []
@@ -181,3 +224,4 @@
         download_l.append(tags_group)
 
         return download_l
+
--- a/rhodecode/lib/__init__.py	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/lib/__init__.py	Sat Oct 29 19:26:43 2011 +0200
@@ -66,6 +66,34 @@
 
 LANGUAGES_EXTENSIONS_MAP.update(ADDITIONAL_MAPPINGS)
 
+# list of readme files to search in file tree and display in summary
+# attached weights defines the search  order lower is first
+ALL_READMES = [
+    ('readme', 0), ('README', 0), ('Readme', 0),
+    ('doc/readme', 1), ('doc/README', 1), ('doc/Readme', 1),
+    ('Docs/readme', 2), ('Docs/README', 2), ('Docs/Readme', 2),
+    ('DOCS/readme', 2), ('DOCS/README', 2), ('DOCS/Readme', 2),
+    ('docs/readme', 2), ('docs/README', 2), ('docs/Readme', 2),
+]
+
+# extension together with weights to search lower is first
+RST_EXTS = [
+    ('', 0), ('.rst', 1),('.rest', 1),
+    ('.RST', 2) ,('.REST', 2), 
+    ('.txt', 3), ('.TXT', 3) 
+]
+
+MARKDOWN_EXTS = [
+    ('.md', 1), ('.MD', 1),
+    ('.mkdn', 2), ('.MKDN', 2),
+    ('.mdown', 3), ('.MDOWN', 3),
+    ('.markdown', 4), ('.MARKDOWN', 4)
+]
+
+PLAIN_EXTS = [('.text', 2),('.TEXT', 2)]
+
+ALL_EXTS = MARKDOWN_EXTS + RST_EXTS + PLAIN_EXTS
+
 
 def str2bool(_str):
     """
@@ -195,6 +223,9 @@
     :rtype: str
     :returns: str object
     """
+    
+    if not isinstance(unicode_, basestring):
+        return str(unicode_)
 
     if isinstance(unicode_, str):
         return unicode_
--- a/rhodecode/lib/base.py	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/lib/base.py	Sat Oct 29 19:26:43 2011 +0200
@@ -3,7 +3,7 @@
 Provides the BaseController class for subclassing.
 """
 import logging
-
+import time
 from pylons import config, tmpl_context as c, request, session, url
 from pylons.controllers import WSGIController
 from pylons.controllers.util import redirect
@@ -40,6 +40,7 @@
         # WSGIController.__call__ dispatches to the Controller method
         # the request is routed to. This routing information is
         # available in environ['pylons.routes_dict']
+        start = time.time()
         try:
             # putting this here makes sure that we update permissions each time
             api_key = request.GET.get('api_key')
@@ -59,6 +60,7 @@
             session.save()
             return WSGIController.__call__(self, environ, start_response)
         finally:
+            log.debug('Request time: %.3fs' % (time.time()-start))
             meta.Session.remove()
 
 
--- a/rhodecode/lib/celerylib/__init__.py	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/lib/celerylib/__init__.py	Sat Oct 29 19:26:43 2011 +0200
@@ -36,7 +36,7 @@
 
 from vcs.utils.lazy import LazyProperty
 
-from rhodecode.lib import str2bool
+from rhodecode.lib import str2bool, safe_str
 from rhodecode.lib.pidlock import DaemonLock, LockHeld
 
 from celery.messaging import establish_connection
@@ -87,7 +87,7 @@
     func_name = str(func.__name__) if hasattr(func, '__name__') else str(func)
 
     lockkey = 'task_%s.lock' % \
-        md5(func_name + '-' + '-'.join(map(str, params))).hexdigest()
+        md5(func_name + '-' + '-'.join(map(safe_str, params))).hexdigest()
     return lockkey
 
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rhodecode/lib/markup_renderer.py	Sat Oct 29 19:26:43 2011 +0200
@@ -0,0 +1,129 @@
+# -*- coding: utf-8 -*-
+"""
+    rhodecode.lib.markup_renderer
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    
+    Renderer for markup languages with ability to parse using rst or markdown
+    
+    :created_on: Oct 27, 2011
+    :author: marcink
+    :copyright: (C) 2009-2011 Marcin Kuzminski <marcin@python-works.com>
+    :license: GPLv3, see COPYING for more details.
+"""
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+import re
+import logging
+
+from rhodecode.lib import safe_unicode
+
+log = logging.getLogger(__name__)
+
+class MarkupRenderer(object):
+    RESTRUCTUREDTEXT_DISALLOWED_DIRECTIVES = ['include', 'meta', 'raw']
+    
+    MARKDOWN_PAT = re.compile(r'md|mkdn?|mdown|markdown',re.IGNORECASE)
+    RST_PAT = re.compile(r're?st',re.IGNORECASE)
+    PLAIN_PAT = re.compile(r'readme',re.IGNORECASE)
+    
+    def __detect_renderer(self, source, filename=None):
+        """
+        runs detection of what renderer should be used for generating html
+        from a markup language
+        
+        filename can be also explicitly a renderer name
+        
+        :param source:
+        :param filename:
+        """
+
+        if MarkupRenderer.MARKDOWN_PAT.findall(filename):
+            detected_renderer = 'markdown'
+        elif MarkupRenderer.RST_PAT.findall(filename):
+            detected_renderer = 'rst'
+        elif MarkupRenderer.PLAIN_PAT.findall(filename):
+            detected_renderer = 'rst'
+        else:
+            detected_renderer = 'plain'
+
+        return getattr(MarkupRenderer, detected_renderer)
+
+
+    def render(self, source, filename=None):
+        """
+        Renders a given filename using detected renderer
+        it detects renderers based on file extension or mimetype.
+        At last it will just do a simple html replacing new lines with <br/>
+        
+        :param file_name:
+        :param source:
+        """
+
+        renderer = self.__detect_renderer(source, filename)
+        readme_data = renderer(source)
+        return readme_data
+
+    @classmethod
+    def plain(cls, source):
+        source = safe_unicode(source)
+        def urlify_text(text):
+            url_pat = re.compile(r'(http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]'
+                                 '|[!*\(\),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+)')
+
+            def url_func(match_obj):
+                url_full = match_obj.groups()[0]
+                return '<a href="%(url)s">%(url)s</a>' % ({'url':url_full})
+
+            return url_pat.sub(url_func, text)
+
+        source = urlify_text(source)
+        return '<br />' + source.replace("\n", '<br />')
+
+
+    @classmethod
+    def markdown(cls, source):
+        source = safe_unicode(source)
+        try:
+            import markdown as __markdown
+            return __markdown.markdown(source)
+        except ImportError:
+            log.warning('Install markdown to use this function')
+            return cls.plain(source)
+
+
+    @classmethod
+    def rst(cls, source):
+        source = safe_unicode(source)
+        try:
+            from docutils.core import publish_parts
+            from docutils.parsers.rst import directives
+            docutils_settings = dict([(alias, None) for alias in
+                                cls.RESTRUCTUREDTEXT_DISALLOWED_DIRECTIVES])
+
+            docutils_settings.update({'input_encoding': 'unicode',
+                                      'report_level':4})
+
+            for k, v in docutils_settings.iteritems():
+                directives.register_directive(k, v)
+
+            parts = publish_parts(source=source,
+                                  writer_name="html4css1",
+                                  settings_overrides=docutils_settings)
+
+            return parts['html_title'] + parts["fragment"]
+        except ImportError:
+            log.warning('Install docutils to use this function')
+            return cls.plain(source)
+
--- a/rhodecode/model/db.py	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/model/db.py	Sat Oct 29 19:26:43 2011 +0200
@@ -663,29 +663,13 @@
 
     @property
     def invalidate(self):
-        """
-        Returns Invalidation object if this repo should be invalidated
-        None otherwise. `cache_active = False` means that this cache
-        state is not valid and needs to be invalidated
-        """
-        return CacheInvalidation.query()\
-            .filter(CacheInvalidation.cache_key == self.repo_name)\
-            .filter(CacheInvalidation.cache_active == False)\
-            .scalar()
+        return CacheInvalidation.invalidate(self.repo_name)
 
     def set_invalidate(self):
         """
         set a cache for invalidation for this instance
         """
-        inv = CacheInvalidation.query()\
-            .filter(CacheInvalidation.cache_key == self.repo_name)\
-            .scalar()
-
-        if inv is None:
-            inv = CacheInvalidation(self.repo_name)
-        inv.cache_active = True
-        Session.add(inv)
-        Session.commit()
+        CacheInvalidation.set_invalidate(self.repo_name)
 
     @LazyProperty
     def scm_instance(self):
@@ -696,19 +680,13 @@
         @cache_region('long_term')
         def _c(repo_name):
             return self.__get_instance()
-
-        # TODO: remove this trick when beaker 1.6 is released
-        # and have fixed this issue with not supporting unicode keys
-        rn = safe_str(self.repo_name)
+        rn = self.repo_name
 
         inv = self.invalidate
         if inv is not None:
             region_invalidate(_c, None, rn)
             # update our cache
-            inv.cache_active = True
-            Session.add(inv)
-            Session.commit()
-
+            CacheInvalidation.set_valid(inv.cache_key)
         return _c(rn)
 
     def __get_instance(self):
@@ -730,7 +708,7 @@
 
             repo = backend(safe_str(repo_full_path), create=False,
                            baseui=self._ui)
-            #skip hidden web repository
+            # skip hidden web repository
             if repo._get_hidden():
                 return
         else:
@@ -855,7 +833,7 @@
 
         :param group_name:
         """
-        path_prefix = (self.parent_group.full_path_splitted if 
+        path_prefix = (self.parent_group.full_path_splitted if
                        self.parent_group else [])
         return Group.url_sep().join(path_prefix + [group_name])
 
@@ -1060,6 +1038,57 @@
         return "<%s('%s:%s')>" % (self.__class__.__name__,
                                   self.cache_id, self.cache_key)
 
+    @classmethod
+    def invalidate(cls, key):
+        """
+        Returns Invalidation object if this given key should be invalidated
+        None otherwise. `cache_active = False` means that this cache
+        state is not valid and needs to be invalidated
+        
+        :param key:
+        """
+        return cls.query()\
+                .filter(CacheInvalidation.cache_key == key)\
+                .filter(CacheInvalidation.cache_active == False)\
+                .scalar()
+
+    @classmethod
+    def set_invalidate(cls, key):
+        """
+        Mark this Cache key for invalidation
+        
+        :param key:
+        """
+
+        log.debug('marking %s for invalidation' % key)
+        inv_obj = Session().query(cls)\
+            .filter(cls.cache_key == key).scalar()
+        if inv_obj:
+            inv_obj.cache_active = False
+        else:
+            log.debug('cache key not found in invalidation db -> creating one')
+            inv_obj = CacheInvalidation(key)
+
+        try:
+            Session.add(inv_obj)
+            Session.commit()
+        except Exception:
+            log.error(traceback.format_exc())
+            Session.rollback()
+
+    @classmethod
+    def set_valid(cls, key):
+        """
+        Mark this cache key as active and currently cached
+        
+        :param key:
+        """
+        inv_obj = Session().query(CacheInvalidation)\
+            .filter(CacheInvalidation.cache_key == key).scalar()
+        inv_obj.cache_active = True
+        Session.add(inv_obj)
+        Session.commit()
+
 class DbMigrateVersion(Base, BaseModel):
     __tablename__ = 'db_migrate_version'
     __table_args__ = {'extend_existing':True}
--- a/rhodecode/model/scm.py	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/model/scm.py	Sat Oct 29 19:26:43 2011 +0200
@@ -197,24 +197,8 @@
 
         :param repo_name: this repo that should invalidation take place
         """
-
-        log.debug('marking %s for invalidation', repo_name)
-        cache = self.sa.query(CacheInvalidation)\
-            .filter(CacheInvalidation.cache_key == repo_name).scalar()
-
-        if cache:
-            # mark this cache as inactive
-            cache.cache_active = False
-        else:
-            log.debug('cache key not found in invalidation db -> creating one')
-            cache = CacheInvalidation(repo_name)
-
-        try:
-            self.sa.add(cache)
-            self.sa.commit()
-        except (DatabaseError,):
-            log.error(traceback.format_exc())
-            self.sa.rollback()
+        CacheInvalidation.set_invalidate(repo_name)
+        CacheInvalidation.set_invalidate(repo_name+"_README")
 
     def toggle_following_repo(self, follow_repo_id, user_id):
 
@@ -395,20 +379,5 @@
 
         self.mark_for_invalidation(repo_name)
 
-
     def get_unread_journal(self):
         return self.sa.query(UserLog).count()
-
-    def _should_invalidate(self, repo_name):
-        """Looks up database for invalidation signals for this repo_name
-
-        :param repo_name:
-        """
-
-        ret = self.sa.query(CacheInvalidation)\
-            .filter(CacheInvalidation.cache_key == repo_name)\
-            .filter(CacheInvalidation.cache_active == False)\
-            .scalar()
-
-        return ret
-
--- a/rhodecode/public/css/style.css	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/public/css/style.css	Sat Oct 29 19:26:43 2011 +0200
@@ -1,2756 +1,3112 @@
-html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td {
-border:0;
-outline:0;
-font-size:100%;
-vertical-align:baseline;
-background:transparent;
-margin:0;
-padding:0;
+html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,font,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td
+	{
+	border: 0;
+	outline: 0;
+	font-size: 100%;
+	vertical-align: baseline;
+	background: transparent;
+	margin: 0;
+	padding: 0;
 }
 
 body {
-line-height:1;
-height:100%;
-background:url("../images/background.png") repeat scroll 0 0 #B0B0B0;
-font-family:Lucida Grande, Verdana, Lucida Sans Regular, Lucida Sans Unicode, Arial, sans-serif;
-font-size:12px;
-color:#000;
-margin:0;
-padding:0;
+	line-height: 1;
+	height: 100%;
+	background: url("../images/background.png") repeat scroll 0 0 #B0B0B0;
+	font-family: Lucida Grande, Verdana, Lucida Sans Regular,
+		Lucida Sans Unicode, Arial, sans-serif; font-size : 12px;
+	color: #000;
+	margin: 0;
+	padding: 0;
+	font-size: 12px;
 }
 
 ol,ul {
-list-style:none;
+	list-style: none;
 }
 
 blockquote,q {
-quotes:none;
+	quotes: none;
 }
 
 blockquote:before,blockquote:after,q:before,q:after {
-content:none;
+	content: none;
 }
 
 :focus {
-outline:0;
+	outline: 0;
 }
 
 del {
-text-decoration:line-through;
+	text-decoration: line-through;
 }
 
 table {
-border-collapse:collapse;
-border-spacing:0;
+	border-collapse: collapse;
+	border-spacing: 0;
 }
 
 html {
-height:100%;
+	height: 100%;
 }
 
 a {
-color:#003367;
-text-decoration:none;
-cursor:pointer;
+	color: #003367;
+	text-decoration: none;
+	cursor: pointer;
 }
 
 a:hover {
-color:#316293;
-text-decoration:underline;
+	color: #316293;
+	text-decoration: underline;
 }
 
 h1,h2,h3,h4,h5,h6 {
-color:#292929;
-font-weight:700;
+	color: #292929;
+	font-weight: 700;
 }
 
 h1 {
-font-size:22px;
+	font-size: 22px;
 }
 
 h2 {
-font-size:20px;
+	font-size: 20px;
 }
 
 h3 {
-font-size:18px;
+	font-size: 18px;
 }
 
 h4 {
-font-size:16px;
+	font-size: 16px;
 }
 
 h5 {
-font-size:14px;
+	font-size: 14px;
 }
 
 h6 {
-font-size:11px;
+	font-size: 11px;
 }
 
 ul.circle {
-list-style-type:circle;
+	list-style-type: circle;
 }
 
 ul.disc {
-list-style-type:disc;
+	list-style-type: disc;
 }
 
 ul.square {
-list-style-type:square;
+	list-style-type: square;
 }
 
 ol.lower-roman {
-list-style-type:lower-roman;
+	list-style-type: lower-roman;
 }
 
 ol.upper-roman {
-list-style-type:upper-roman;
+	list-style-type: upper-roman;
 }
 
 ol.lower-alpha {
-list-style-type:lower-alpha;
+	list-style-type: lower-alpha;
 }
 
 ol.upper-alpha {
-list-style-type:upper-alpha;
+	list-style-type: upper-alpha;
 }
 
 ol.decimal {
-list-style-type:decimal;
+	list-style-type: decimal;
 }
 
 div.color {
-clear:both;
-overflow:hidden;
-position:absolute;
-background:#FFF;
-margin:7px 0 0 60px;
-padding:1px 1px 1px 0;
+	clear: both;
+	overflow: hidden;
+	position: absolute;
+	background: #FFF;
+	margin: 7px 0 0 60px;
+	padding: 1px 1px 1px 0;
 }
 
 div.color a {
-width:15px;
-height:15px;
-display:block;
-float:left;
-margin:0 0 0 1px;
-padding:0;
+	width: 15px;
+	height: 15px;
+	display: block;
+	float: left;
+	margin: 0 0 0 1px;
+	padding: 0;
 }
 
 div.options {
-clear:both;
-overflow:hidden;
-position:absolute;
-background:#FFF;
-margin:7px 0 0 162px;
-padding:0;
+	clear: both;
+	overflow: hidden;
+	position: absolute;
+	background: #FFF;
+	margin: 7px 0 0 162px;
+	padding: 0;
 }
 
 div.options a {
-height:1%;
-display:block;
-text-decoration:none;
-margin:0;
-padding:3px 8px;
+	height: 1%;
+	display: block;
+	text-decoration: none;
+	margin: 0;
+	padding: 3px 8px;
 }
 
 .top-left-rounded-corner {
--webkit-border-top-left-radius: 8px;
--khtml-border-radius-topleft: 8px; 
--moz-border-radius-topleft: 8px;
-border-top-left-radius: 8px;
+	-webkit-border-top-left-radius: 8px;
+	-khtml-border-radius-topleft: 8px;
+	-moz-border-radius-topleft: 8px;
+	border-top-left-radius: 8px;
 }
 
 .top-right-rounded-corner {
--webkit-border-top-right-radius: 8px;
--khtml-border-radius-topright: 8px;    
--moz-border-radius-topright: 8px;
-border-top-right-radius: 8px;
+	-webkit-border-top-right-radius: 8px;
+	-khtml-border-radius-topright: 8px;
+	-moz-border-radius-topright: 8px;
+	border-top-right-radius: 8px;
 }
 
 .bottom-left-rounded-corner {
--webkit-border-bottom-left-radius: 8px;
--khtml-border-radius-bottomleft: 8px;  
--moz-border-radius-bottomleft: 8px;
-border-bottom-left-radius: 8px;
+	-webkit-border-bottom-left-radius: 8px;
+	-khtml-border-radius-bottomleft: 8px;
+	-moz-border-radius-bottomleft: 8px;
+	border-bottom-left-radius: 8px;
 }
 
 .bottom-right-rounded-corner {
--webkit-border-bottom-right-radius: 8px;
--khtml-border-radius-bottomright: 8px; 
--moz-border-radius-bottomright: 8px;
-border-bottom-right-radius: 8px;
-}
-
+	-webkit-border-bottom-right-radius: 8px;
+	-khtml-border-radius-bottomright: 8px;
+	-moz-border-radius-bottomright: 8px;
+	border-bottom-right-radius: 8px;
+}
 
 #header {
-margin:0;
-padding:0 10px;
-}
-
-
-#header ul#logged-user{
-margin-bottom:5px !important;
--webkit-border-radius: 0px 0px 8px 8px;
--khtml-border-radius: 0px 0px 8px 8px; 
--moz-border-radius: 0px 0px 8px 8px;
-border-radius: 0px 0px 8px 8px;
-height:37px;
-background:url("../images/header_inner.png") repeat-x scroll 0 0 #003367;
-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
+	margin: 0;
+	padding: 0 10px;
+}
+
+#header ul#logged-user {
+	margin-bottom: 5px !important;
+	-webkit-border-radius: 0px 0px 8px 8px;
+	-khtml-border-radius: 0px 0px 8px 8px;
+	-moz-border-radius: 0px 0px 8px 8px;
+	border-radius: 0px 0px 8px 8px;
+	height: 37px;
+    background-color: #eedc94;
+    background-repeat: repeat-x;
+    background-image: -khtml-gradient(linear, left top, left bottom, from(#fceec1),
+        to(#eedc94) );
+    background-image: -moz-linear-gradient(top, #003b76, #00376e);
+    background-image: -ms-linear-gradient(top, #003b76, #00376e);
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #003b76),
+        color-stop(100%, #00376e) );
+    background-image: -webkit-linear-gradient(top, #003b76, #00376e) );
+    background-image: -o-linear-gradient(top, #003b76, #00376e) );
+    background-image: linear-gradient(top, #003b76, #00376e);
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#003b76',
+        endColorstr='#00376e', GradientType=0 );
+	box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
 }
 
 #header ul#logged-user li {
-list-style:none;
-float:left;
-margin:8px 0 0;
-padding:4px 12px;
-border-left: 1px solid #316293;
+	list-style: none;
+	float: left;
+	margin: 8px 0 0;
+	padding: 4px 12px;
+	border-left: 1px solid #316293;
 }
 
 #header ul#logged-user li.first {
-border-left:none;
-margin:4px;
+	border-left: none;
+	margin: 4px;
 }
 
 #header ul#logged-user li.first div.gravatar {
-margin-top:-2px;
+	margin-top: -2px;
 }
 
 #header ul#logged-user li.first div.account {
-padding-top:4px;
-float:left;
+	padding-top: 4px;
+	float: left;
 }
 
 #header ul#logged-user li.last {
-border-right:none;
+	border-right: none;
 }
 
 #header ul#logged-user li a {
-color:#fff;
-font-weight:700;
-text-decoration:none;
+	color: #fff;
+	font-weight: 700;
+	text-decoration: none;
 }
 
 #header ul#logged-user li a:hover {
-text-decoration:underline;
+	text-decoration: underline;
 }
 
 #header ul#logged-user li.highlight a {
-color:#fff;
+	color: #fff;
 }
 
 #header ul#logged-user li.highlight a:hover {
-color:#FFF;
+	color: #FFF;
 }
 
 #header #header-inner {
-min-height:40px;
-clear:both;
-position:relative;
-background:#003367 url("../images/header_inner.png") repeat-x;
-margin:0;
-padding:0;
-display:block;
-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
--webkit-border-radius: 4px 4px 4px 4px;
--khtml-border-radius: 4px 4px 4px 4px; 
--moz-border-radius: 4px 4px 4px 4px;
-border-radius: 4px 4px 4px 4px;
-}
-
+	min-height: 40px;
+	clear: both;
+	position: relative;
+    background-color: #eedc94;
+    background-repeat: repeat-x;
+    background-image: -khtml-gradient(linear, left top, left bottom, from(#fceec1),
+        to(#eedc94) );
+    background-image: -moz-linear-gradient(top, #003b76, #00376e);
+    background-image: -ms-linear-gradient(top, #003b76, #00376e);
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #003b76),
+        color-stop(100%, #00376e) );
+    background-image: -webkit-linear-gradient(top, #003b76, #00376e) );
+    background-image: -o-linear-gradient(top, #003b76, #00376e) );
+    background-image: linear-gradient(top, #003b76, #00376e);
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#003b76',
+        endColorstr='#00376e', GradientType=0 );
+	margin: 0;
+	padding: 0;
+	display: block;
+	box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
+	-webkit-border-radius: 4px 4px 4px 4px;
+	-khtml-border-radius: 4px 4px 4px 4px;
+	-moz-border-radius: 4px 4px 4px 4px;
+	border-radius: 4px 4px 4px 4px;
+}
+#header #header-inner.hover{
+	position: fixed !important;
+	width: 100% !important;
+	margin-left: -10px !important;
+	z-index: 10000;
+	border-radius: 0px 0px 4px 4px;
+}
 #header #header-inner #home a {
-height:40px;
-width:46px;
-display:block;
-background:url("../images/button_home.png");
-background-position:0 0;
-margin:0;
-padding:0;
+	height: 40px;
+	width: 46px;
+	display: block;
+	background: url("../images/button_home.png");
+	background-position: 0 0;
+	margin: 0;
+	padding: 0;
 }
 
 #header #header-inner #home a:hover {
-background-position:0 -40px;
-}
+	background-position: 0 -40px;
+}
+
 #header #header-inner #logo {
-    float: left;
-    position: absolute;	
-}
+	float: left;
+	position: absolute;
+}
+
 #header #header-inner #logo h1 {
-color:#FFF;
-font-size:18px;
-margin:10px 0 0 13px;
-padding:0;
+	color: #FFF;
+	font-size: 18px;
+	margin: 10px 0 0 13px;
+	padding: 0;
 }
 
 #header #header-inner #logo a {
-color:#fff;
-text-decoration:none;
+	color: #fff;
+	text-decoration: none;
 }
 
 #header #header-inner #logo a:hover {
-color:#bfe3ff;
+	color: #bfe3ff;
 }
 
 #header #header-inner #quick,#header #header-inner #quick ul {
-position:relative;
-float:right;
-list-style-type:none;
-list-style-position:outside;
-margin:6px 5px 0 0;
-padding:0;
+	position: relative;
+	float: right;
+	list-style-type: none;
+	list-style-position: outside;
+	margin: 6px 5px 0 0;
+	padding: 0;
 }
 
 #header #header-inner #quick li {
-position:relative;
-float:left;
-margin:0 5px 0 0;
-padding:0;
+	position: relative;
+	float: left;
+	margin: 0 5px 0 0;
+	padding: 0;
 }
 
 #header #header-inner #quick li a {
-top:0;
-left:0;
-height:1%;
-display:block;
-clear:both;
-overflow:hidden;
-color:#FFF;
-font-weight:700;
-text-decoration:none;
-background:#369;
-padding:0;
--webkit-border-radius: 4px 4px 4px 4px;
--khtml-border-radius: 4px 4px 4px 4px; 
--moz-border-radius: 4px 4px 4px 4px;
-border-radius: 4px 4px 4px 4px;
+	top: 0;
+	left: 0;
+	height: 1%;
+	display: block;
+	clear: both;
+	overflow: hidden;
+	color: #FFF;
+	font-weight: 700;
+	text-decoration: none;
+	background: #369;
+	padding: 0;
+	-webkit-border-radius: 4px 4px 4px 4px;
+	-khtml-border-radius: 4px 4px 4px 4px;
+	-moz-border-radius: 4px 4px 4px 4px;
+	border-radius: 4px 4px 4px 4px;
 }
 
 #header #header-inner #quick li span.short {
-padding:9px 6px 8px 6px;
+	padding: 9px 6px 8px 6px;
 }
 
 #header #header-inner #quick li span {
-top:0;
-right:0;
-height:1%;
-display:block;
-float:left;
-border-left:1px solid #3f6f9f;
-margin:0;
-padding:10px 12px 8px 10px;
+	top: 0;
+	right: 0;
+	height: 1%;
+	display: block;
+	float: left;
+	border-left: 1px solid #3f6f9f;
+	margin: 0;
+	padding: 10px 12px 8px 10px;
 }
 
 #header #header-inner #quick li span.normal {
-border:none;
-padding:10px 12px 8px;
+	border: none;
+	padding: 10px 12px 8px;
 }
 
 #header #header-inner #quick li span.icon {
-top:0;
-left:0;
-border-left:none;
-border-right:1px solid #2e5c89;
-padding:8px 6px 4px;
+	top: 0;
+	left: 0;
+	border-left: none;
+	border-right: 1px solid #2e5c89;
+	padding: 8px 6px 4px;
 }
 
 #header #header-inner #quick li span.icon_short {
-top:0;
-left:0;
-border-left:none;
-border-right:1px solid #2e5c89;
-padding:8px 6px 4px;
-}
-#header #header-inner #quick li span.icon img, #header #header-inner #quick li span.icon_short img {
+	top: 0;
+	left: 0;
+	border-left: none;
+	border-right: 1px solid #2e5c89;
+	padding: 8px 6px 4px;
+}
+
+#header #header-inner #quick li span.icon img,#header #header-inner #quick li span.icon_short img
+	{
 	margin: 0px -2px 0px 0px;
 }
 
 #header #header-inner #quick li a:hover {
-background:#4e4e4e  no-repeat top left;
+	background: #4e4e4e no-repeat top left;
 }
 
 #header #header-inner #quick li a:hover span {
-border-left:1px solid #545454;
-}
-
-#header #header-inner #quick li a:hover span.icon,#header #header-inner #quick li a:hover span.icon_short {
-border-left:none;
-border-right:1px solid #464646;
+	border-left: 1px solid #545454;
+}
+
+#header #header-inner #quick li a:hover span.icon,#header #header-inner #quick li a:hover span.icon_short
+	{
+	border-left: none;
+	border-right: 1px solid #464646;
 }
 
 #header #header-inner #quick ul {
-top:29px;
-right:0;
-min-width:200px;
-display:none;
-position:absolute;
-background:#FFF;
-border:1px solid #666;
-border-top:1px solid #003367;
-z-index:100;
-margin:0;
-padding:0;
+	top: 29px;
+	right: 0;
+	min-width: 200px;
+	display: none;
+	position: absolute;
+	background: #FFF;
+	border: 1px solid #666;
+	border-top: 1px solid #003367;
+	z-index: 100;
+	margin: 0;
+	padding: 0;
 }
 
 #header #header-inner #quick ul.repo_switcher {
-max-height:275px;
-overflow-x:hidden;
-overflow-y:auto;
-}
+	max-height: 275px;
+	overflow-x: hidden;
+	overflow-y: auto;
+}
+
 #header #header-inner #quick ul.repo_switcher li.qfilter_rs {
-float:none;
-margin:0;
-border-bottom:2px solid #003367;
-}
-
-
-#header #header-inner #quick .repo_switcher_type{
-position:absolute;
-left:0;
-top:9px; 
-
-}
+	float: none;
+	margin: 0;
+	border-bottom: 2px solid #003367;
+}
+
+#header #header-inner #quick .repo_switcher_type {
+	position: absolute;
+	left: 0;
+	top: 9px;
+}
+
 #header #header-inner #quick li ul li {
-border-bottom:1px solid #ddd;
+	border-bottom: 1px solid #ddd;
 }
 
 #header #header-inner #quick li ul li a {
-width:182px;
-height:auto;
-display:block;
-float:left;
-background:#FFF;
-color:#003367;
-font-weight:400;
-margin:0;
-padding:7px 9px;
+	width: 182px;
+	height: auto;
+	display: block;
+	float: left;
+	background: #FFF;
+	color: #003367;
+	font-weight: 400;
+	margin: 0;
+	padding: 7px 9px;
 }
 
 #header #header-inner #quick li ul li a:hover {
-color:#000;
-background:#FFF;
+	color: #000;
+	background: #FFF;
 }
 
 #header #header-inner #quick ul ul {
-top:auto;
+	top: auto;
 }
 
 #header #header-inner #quick li ul ul {
-right:200px;
-max-height:275px;
-overflow:auto;
-overflow-x:hidden;
-white-space:normal;
-}
-
-#header #header-inner #quick li ul li a.journal,#header #header-inner #quick li ul li a.journal:hover {
-background:url("../images/icons/book.png") no-repeat scroll 4px 9px #FFF;
-width:167px;
-margin:0;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.private_repo,#header #header-inner #quick li ul li a.private_repo:hover {
-background:url("../images/icons/lock.png") no-repeat scroll 4px 9px #FFF;
-min-width:167px;
-margin:0;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.public_repo,#header #header-inner #quick li ul li a.public_repo:hover {
-background:url("../images/icons/lock_open.png") no-repeat scroll 4px 9px #FFF;
-min-width:167px;
-margin:0;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.hg,#header #header-inner #quick li ul li a.hg:hover {
-background:url("../images/icons/hgicon.png") no-repeat scroll 4px 9px #FFF;
-min-width:167px;
-margin:0 0 0 14px;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.git,#header #header-inner #quick li ul li a.git:hover {
-background:url("../images/icons/giticon.png") no-repeat scroll 4px 9px #FFF;
-min-width:167px;
-margin:0 0 0 14px;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.repos,#header #header-inner #quick li ul li a.repos:hover {
-background:url("../images/icons/database_edit.png") no-repeat scroll 4px 9px #FFF;
-width:167px;
-margin:0;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.repos_groups,#header #header-inner #quick li ul li a.repos_groups:hover {
-background:url("../images/icons/database_link.png") no-repeat scroll 4px 9px #FFF;
-width:167px;
-margin:0;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.users,#header #header-inner #quick li ul li a.users:hover {
-background:#FFF url("../images/icons/user_edit.png") no-repeat 4px 9px;
-width:167px;
-margin:0;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.groups,#header #header-inner #quick li ul li a.groups:hover {
-background:#FFF url("../images/icons/group_edit.png") no-repeat 4px 9px;
-width:167px;
-margin:0;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.settings,#header #header-inner #quick li ul li a.settings:hover {
-background:#FFF url("../images/icons/cog.png") no-repeat 4px 9px;
-width:167px;
-margin:0;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.permissions,#header #header-inner #quick li ul li a.permissions:hover {
-background:#FFF url("../images/icons/key.png") no-repeat 4px 9px;
-width:167px;
-margin:0;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.ldap,#header #header-inner #quick li ul li a.ldap:hover {
-background:#FFF url("../images/icons/server_key.png") no-repeat 4px 9px;
-width:167px;
-margin:0;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.fork,#header #header-inner #quick li ul li a.fork:hover {
-background:#FFF url("../images/icons/arrow_divide.png") no-repeat 4px 9px;
-width:167px;
-margin:0;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.search,#header #header-inner #quick li ul li a.search:hover {
-background:#FFF url("../images/icons/search_16.png") no-repeat 4px 9px;
-width:167px;
-margin:0;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.delete,#header #header-inner #quick li ul li a.delete:hover {
-background:#FFF url("../images/icons/delete.png") no-repeat 4px 9px;
-width:167px;
-margin:0;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.branches,#header #header-inner #quick li ul li a.branches:hover {
-background:#FFF url("../images/icons/arrow_branch.png") no-repeat 4px 9px;
-width:167px;
-margin:0;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.tags,#header #header-inner #quick li ul li a.tags:hover {
-background:#FFF url("../images/icons/tag_blue.png") no-repeat 4px 9px;
-width:167px;
-margin:0;
-padding:12px 9px 7px 24px;
-}
-
-#header #header-inner #quick li ul li a.admin,#header #header-inner #quick li ul li a.admin:hover {
-background:#FFF url("../images/icons/cog_edit.png") no-repeat 4px 9px;
-width:167px;
-margin:0;
-padding:12px 9px 7px 24px;
-}
-
+	right: 200px;
+	max-height: 275px;
+	overflow: auto;
+	overflow-x: hidden;
+	white-space: normal;
+}
+
+#header #header-inner #quick li ul li a.journal,#header #header-inner #quick li ul li a.journal:hover
+	{
+	background: url("../images/icons/book.png") no-repeat scroll 4px 9px
+		#FFF;
+	width: 167px;
+	margin: 0;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.private_repo,#header #header-inner #quick li ul li a.private_repo:hover
+	{
+	background: url("../images/icons/lock.png") no-repeat scroll 4px 9px
+		#FFF;
+	min-width: 167px;
+	margin: 0;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.public_repo,#header #header-inner #quick li ul li a.public_repo:hover
+	{
+	background: url("../images/icons/lock_open.png") no-repeat scroll 4px
+		9px #FFF;
+	min-width: 167px;
+	margin: 0;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.hg,#header #header-inner #quick li ul li a.hg:hover
+	{
+	background: url("../images/icons/hgicon.png") no-repeat scroll 4px 9px
+		#FFF;
+	min-width: 167px;
+	margin: 0 0 0 14px;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.git,#header #header-inner #quick li ul li a.git:hover
+	{
+	background: url("../images/icons/giticon.png") no-repeat scroll 4px 9px
+		#FFF;
+	min-width: 167px;
+	margin: 0 0 0 14px;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.repos,#header #header-inner #quick li ul li a.repos:hover
+	{
+	background: url("../images/icons/database_edit.png") no-repeat scroll
+		4px 9px #FFF;
+	width: 167px;
+	margin: 0;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.repos_groups,#header #header-inner #quick li ul li a.repos_groups:hover
+	{
+	background: url("../images/icons/database_link.png") no-repeat scroll
+		4px 9px #FFF;
+	width: 167px;
+	margin: 0;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.users,#header #header-inner #quick li ul li a.users:hover
+	{
+	background: #FFF url("../images/icons/user_edit.png") no-repeat 4px 9px;
+	width: 167px;
+	margin: 0;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.groups,#header #header-inner #quick li ul li a.groups:hover
+	{
+	background: #FFF url("../images/icons/group_edit.png") no-repeat 4px 9px;
+	width: 167px;
+	margin: 0;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.settings,#header #header-inner #quick li ul li a.settings:hover
+	{
+	background: #FFF url("../images/icons/cog.png") no-repeat 4px 9px;
+	width: 167px;
+	margin: 0;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.permissions,#header #header-inner #quick li ul li a.permissions:hover
+	{
+	background: #FFF url("../images/icons/key.png") no-repeat 4px 9px;
+	width: 167px;
+	margin: 0;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.ldap,#header #header-inner #quick li ul li a.ldap:hover
+	{
+	background: #FFF url("../images/icons/server_key.png") no-repeat 4px 9px;
+	width: 167px;
+	margin: 0;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.fork,#header #header-inner #quick li ul li a.fork:hover
+	{
+	background: #FFF url("../images/icons/arrow_divide.png") no-repeat 4px
+		9px;
+	width: 167px;
+	margin: 0;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.search,#header #header-inner #quick li ul li a.search:hover
+	{
+	background: #FFF url("../images/icons/search_16.png") no-repeat 4px 9px;
+	width: 167px;
+	margin: 0;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.delete,#header #header-inner #quick li ul li a.delete:hover
+	{
+	background: #FFF url("../images/icons/delete.png") no-repeat 4px 9px;
+	width: 167px;
+	margin: 0;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.branches,#header #header-inner #quick li ul li a.branches:hover
+	{
+	background: #FFF url("../images/icons/arrow_branch.png") no-repeat 4px
+		9px;
+	width: 167px;
+	margin: 0;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.tags,#header #header-inner #quick li ul li a.tags:hover
+	{
+	background: #FFF url("../images/icons/tag_blue.png") no-repeat 4px 9px;
+	width: 167px;
+	margin: 0;
+	padding: 12px 9px 7px 24px;
+}
+
+#header #header-inner #quick li ul li a.admin,#header #header-inner #quick li ul li a.admin:hover
+	{
+	background: #FFF url("../images/icons/cog_edit.png") no-repeat 4px 9px;
+	width: 167px;
+	margin: 0;
+	padding: 12px 9px 7px 24px;
+}
 
 .groups_breadcrumbs a {
 	color: #fff;
 }
+
 .groups_breadcrumbs a:hover {
-    color: #bfe3ff;
-    text-decoration: none;
-}
-
-.quick_repo_menu{
-	background: #FFF url("../images/vertical-indicator.png") 8px 50% no-repeat !important;
+	color: #bfe3ff;
+	text-decoration: none;
+}
+
+.quick_repo_menu {
+	background: #FFF url("../images/vertical-indicator.png") 8px 50%
+		no-repeat !important;
 	cursor: pointer;
 	width: 8px;
 }
-.quick_repo_menu.active{
-    background: #FFF url("../images/horizontal-indicator.png") 4px 50% no-repeat !important;
-    cursor: pointer;
-}
-.quick_repo_menu .menu_items{
-	margin-top:6px;
-	width:150px;
+
+.quick_repo_menu.active {
+	background: #FFF url("../images/horizontal-indicator.png") 4px 50%
+		no-repeat !important;
+	cursor: pointer;
+}
+
+.quick_repo_menu .menu_items {
+	margin-top: 6px;
+	width: 150px;
 	position: absolute;
-	background-color:#FFF;
-    background: none repeat scroll 0 0 #FFFFFF;
-    border-color: #003367 #666666 #666666;
-    border-right: 1px solid #666666;
-    border-style: solid;
-    border-width: 1px;
-    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
-}
-.quick_repo_menu .menu_items li{
-    padding:0 !important;
-}
-.quick_repo_menu .menu_items a{
+	background-color: #FFF;
+	background: none repeat scroll 0 0 #FFFFFF;
+	border-color: #003367 #666666 #666666;
+	border-right: 1px solid #666666;
+	border-style: solid;
+	border-width: 1px;
+	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
+}
+
+.quick_repo_menu .menu_items li {
+	padding: 0 !important;
+}
+
+.quick_repo_menu .menu_items a {
 	display: block;
 	padding: 4px 12px 4px 8px;
 }
-.quick_repo_menu .menu_items a:hover{
-    background-color: #EEE;
-    text-decoration: none;
-    
-}
-.quick_repo_menu .menu_items .icon img{
-	margin-bottom:-2px;
-}
-.quick_repo_menu .menu_items.hidden{
+
+.quick_repo_menu .menu_items a:hover {
+	background-color: #EEE;
+	text-decoration: none;
+}
+
+.quick_repo_menu .menu_items .icon img {
+	margin-bottom: -2px;
+}
+
+.quick_repo_menu .menu_items.hidden {
 	display: none;
 }
 
 #content #left {
-left:0;
-width:280px;
-position:absolute;
+	left: 0;
+	width: 280px;
+	position: absolute;
 }
 
 #content #right {
-margin:0 60px 10px 290px;
+	margin: 0 60px 10px 290px;
 }
 
 #content div.box {
-clear:both;
-overflow:hidden;
-background:#fff;
-margin:0 0 10px;
-padding:0 0 10px;
--webkit-border-radius: 4px 4px 4px 4px;
--khtml-border-radius: 4px 4px 4px 4px; 
--moz-border-radius: 4px 4px 4px 4px;
-border-radius: 4px 4px 4px 4px;
-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
-
+	clear: both;
+	overflow: hidden;
+	background: #fff;
+	margin: 0 0 10px;
+	padding: 0 0 10px;
+	-webkit-border-radius: 4px 4px 4px 4px;
+	-khtml-border-radius: 4px 4px 4px 4px;
+	-moz-border-radius: 4px 4px 4px 4px;
+	border-radius: 4px 4px 4px 4px;
+	box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
 }
 
 #content div.box-left {
-width:49%;
-clear:none;
-float:left;
-margin:0 0 10px;
+	width: 49%;
+	clear: none;
+	float: left;
+	margin: 0 0 10px;
 }
 
 #content div.box-right {
-width:49%;
-clear:none;
-float:right;
-margin:0 0 10px;
+	width: 49%;
+	clear: none;
+	float: right;
+	margin: 0 0 10px;
 }
 
 #content div.box div.title {
-clear:both;
-overflow:hidden;
-background:#369 url("../images/header_inner.png") repeat-x;
-margin:0 0 20px;
-padding:0;
+	clear: both;
+	overflow: hidden;
+	background-color: #eedc94;
+	background-repeat: repeat-x;
+	background-image: -khtml-gradient(linear, left top, left bottom, from(#fceec1),
+		to(#eedc94) );
+	background-image: -moz-linear-gradient(top, #003b76, #00376e);
+	background-image: -ms-linear-gradient(top, #003b76, #00376e);
+	background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #003b76),
+		color-stop(100%, #00376e) );
+	background-image: -webkit-linear-gradient(top, #003b76, #00376e) );
+	background-image: -o-linear-gradient(top, #003b76, #00376e) );
+	background-image: linear-gradient(top, #003b76, #00376e);
+	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#003b76',
+		endColorstr='#00376e', GradientType=0 );
+	margin: 0 0 20px;
+	padding: 0;
 }
 
 #content div.box div.title h5 {
-float:left;
-border:none;
-color:#fff;
-text-transform:uppercase;
-margin:0;
-padding:11px 0 11px 10px;
+	float: left;
+	border: none;
+	color: #fff;
+	text-transform: uppercase;
+	margin: 0;
+	padding: 11px 0 11px 10px;
 }
 
 #content div.box div.title ul.links li {
-list-style:none;
-float:left;
-margin:0;
-padding:0;
+	list-style: none;
+	float: left;
+	margin: 0;
+	padding: 0;
 }
 
 #content div.box div.title ul.links li a {
-    border-left: 1px solid #316293;
-    color: #FFFFFF;
-    display: block;
-    float: left;
-    font-size: 13px;
-    font-weight: 700;
-    height: 1%;
-    margin: 0;
-    padding: 11px 22px 12px;
-    text-decoration: none;
-}
-
-#content div.box h1,#content div.box h2,#content div.box h3,#content div.box h4,#content div.box h5,#content div.box h6 {
-clear:both;
-overflow:hidden;
-border-bottom:1px solid #DDD;
-margin:10px 20px;
-padding:0 0 15px;
+	border-left: 1px solid #316293;
+	color: #FFFFFF;
+	display: block;
+	float: left;
+	font-size: 13px;
+	font-weight: 700;
+	height: 1%;
+	margin: 0;
+	padding: 11px 22px 12px;
+	text-decoration: none;
+}
+
+#content div.box h1,#content div.box h2,#content div.box h3,#content div.box h4,#content div.box h5,#content div.box h6
+	{
+	clear: both;
+	overflow: hidden;
+	border-bottom: 1px solid #DDD;
+	margin: 10px 20px;
+	padding: 0 0 15px;
 }
 
 #content div.box p {
-color:#5f5f5f;
-font-size:12px;
-line-height:150%;
-margin:0 24px 10px;
-padding:0;
+	color: #5f5f5f;
+	font-size: 12px;
+	line-height: 150%;
+	margin: 0 24px 10px;
+	padding: 0;
 }
 
 #content div.box blockquote {
-border-left:4px solid #DDD;
-color:#5f5f5f;
-font-size:11px;
-line-height:150%;
-margin:0 34px;
-padding:0 0 0 14px;
+	border-left: 4px solid #DDD;
+	color: #5f5f5f;
+	font-size: 11px;
+	line-height: 150%;
+	margin: 0 34px;
+	padding: 0 0 0 14px;
 }
 
 #content div.box blockquote p {
-margin:10px 0;
-padding:0;
+	margin: 10px 0;
+	padding: 0;
 }
 
 #content div.box dl {
-margin:10px 24px;
+	margin: 10px 24px;
 }
 
 #content div.box dt {
-font-size:12px;
-margin:0;
+	font-size: 12px;
+	margin: 0;
 }
 
 #content div.box dd {
-font-size:12px;
-margin:0;
-padding:8px 0 8px 15px;
+	font-size: 12px;
+	margin: 0;
+	padding: 8px 0 8px 15px;
 }
 
 #content div.box li {
-font-size:12px;
-padding:4px 0;
+	font-size: 12px;
+	padding: 4px 0;
 }
 
 #content div.box ul.disc,#content div.box ul.circle {
-margin:10px 24px 10px 38px;
+	margin: 10px 24px 10px 38px;
 }
 
 #content div.box ul.square {
-margin:10px 24px 10px 40px;
+	margin: 10px 24px 10px 40px;
 }
 
 #content div.box img.left {
-border:none;
-float:left;
-margin:10px 10px 10px 0;
+	border: none;
+	float: left;
+	margin: 10px 10px 10px 0;
 }
 
 #content div.box img.right {
-border:none;
-float:right;
-margin:10px 0 10px 10px;
+	border: none;
+	float: right;
+	margin: 10px 0 10px 10px;
 }
 
 #content div.box div.messages {
-clear:both;
-overflow:hidden;
-margin:0 20px;
-padding:0;
+	clear: both;
+	overflow: hidden;
+	margin: 0 20px;
+	padding: 0;
 }
 
 #content div.box div.message {
-clear:both;
-overflow:hidden;
-margin:0;
-padding:10px 0;
+	clear: both;
+	overflow: hidden;
+	margin: 0;
+	padding: 10px 0;
 }
 
 #content div.box div.message a {
-font-weight:400 !important;
+	font-weight: 400 !important;
 }
 
 #content div.box div.message div.image {
-float:left;
-margin:9px 0 0 5px;
-padding:6px;
+	float: left;
+	margin: 9px 0 0 5px;
+	padding: 6px;
 }
 
 #content div.box div.message div.image img {
-vertical-align:middle;
-margin:0;
+	vertical-align: middle;
+	margin: 0;
 }
 
 #content div.box div.message div.text {
-float:left;
-margin:0;
-padding:9px 6px;
+	float: left;
+	margin: 0;
+	padding: 9px 6px;
 }
 
 #content div.box div.message div.dismiss a {
-height:16px;
-width:16px;
-display:block;
-background:url("../images/icons/cross.png") no-repeat;
-margin:15px 14px 0 0;
-padding:0;
-}
-
-#content div.box div.message div.text h1,#content div.box div.message div.text h2,#content div.box div.message div.text h3,#content div.box div.message div.text h4,#content div.box div.message div.text h5,#content div.box div.message div.text h6 {
-border:none;
-margin:0;
-padding:0;
+	height: 16px;
+	width: 16px;
+	display: block;
+	background: url("../images/icons/cross.png") no-repeat;
+	margin: 15px 14px 0 0;
+	padding: 0;
+}
+
+#content div.box div.message div.text h1,#content div.box div.message div.text h2,#content div.box div.message div.text h3,#content div.box div.message div.text h4,#content div.box div.message div.text h5,#content div.box div.message div.text h6
+	{
+	border: none;
+	margin: 0;
+	padding: 0;
 }
 
 #content div.box div.message div.text span {
-height:1%;
-display:block;
-margin:0;
-padding:5px 0 0;
+	height: 1%;
+	display: block;
+	margin: 0;
+	padding: 5px 0 0;
 }
 
 #content div.box div.message-error {
-height:1%;
-clear:both;
-overflow:hidden;
-background:#FBE3E4;
-border:1px solid #FBC2C4;
-color:#860006;
+	height: 1%;
+	clear: both;
+	overflow: hidden;
+	background: #FBE3E4;
+	border: 1px solid #FBC2C4;
+	color: #860006;
 }
 
 #content div.box div.message-error h6 {
-color:#860006;
+	color: #860006;
 }
 
 #content div.box div.message-warning {
-height:1%;
-clear:both;
-overflow:hidden;
-background:#FFF6BF;
-border:1px solid #FFD324;
-color:#5f5200;
+	height: 1%;
+	clear: both;
+	overflow: hidden;
+	background: #FFF6BF;
+	border: 1px solid #FFD324;
+	color: #5f5200;
 }
 
 #content div.box div.message-warning h6 {
-color:#5f5200;
+	color: #5f5200;
 }
 
 #content div.box div.message-notice {
-height:1%;
-clear:both;
-overflow:hidden;
-background:#8FBDE0;
-border:1px solid #6BACDE;
-color:#003863;
+	height: 1%;
+	clear: both;
+	overflow: hidden;
+	background: #8FBDE0;
+	border: 1px solid #6BACDE;
+	color: #003863;
 }
 
 #content div.box div.message-notice h6 {
-color:#003863;
+	color: #003863;
 }
 
 #content div.box div.message-success {
-height:1%;
-clear:both;
-overflow:hidden;
-background:#E6EFC2;
-border:1px solid #C6D880;
-color:#4e6100;
+	height: 1%;
+	clear: both;
+	overflow: hidden;
+	background: #E6EFC2;
+	border: 1px solid #C6D880;
+	color: #4e6100;
 }
 
 #content div.box div.message-success h6 {
-color:#4e6100;
+	color: #4e6100;
 }
 
 #content div.box div.form div.fields div.field {
-height:1%;
-border-bottom:1px solid #DDD;
-clear:both;
-margin:0;
-padding:10px 0;
+	height: 1%;
+	border-bottom: 1px solid #DDD;
+	clear: both;
+	margin: 0;
+	padding: 10px 0;
 }
 
 #content div.box div.form div.fields div.field-first {
-padding:0 0 10px;
+	padding: 0 0 10px;
 }
 
 #content div.box div.form div.fields div.field-noborder {
-border-bottom:0 !important;
+	border-bottom: 0 !important;
 }
 
 #content div.box div.form div.fields div.field span.error-message {
-height:1%;
-display:inline-block;
-color:red;
-margin:8px 0 0 4px;
-padding:0;
+	height: 1%;
+	display: inline-block;
+	color: red;
+	margin: 8px 0 0 4px;
+	padding: 0;
 }
 
 #content div.box div.form div.fields div.field span.success {
-height:1%;
-display:block;
-color:#316309;
-margin:8px 0 0;
-padding:0;
+	height: 1%;
+	display: block;
+	color: #316309;
+	margin: 8px 0 0;
+	padding: 0;
 }
 
 #content div.box div.form div.fields div.field div.label {
-left:70px;
-width:155px;
-position:absolute;
-margin:0;
-padding:8px 0 0 5px;
-}
-
-#content div.box-left div.form div.fields div.field div.label,#content div.box-right div.form div.fields div.field div.label {
-clear:both;
-overflow:hidden;
-left:0;
-width:auto;
-position:relative;
-margin:0;
-padding:0 0 8px;
+	left: 70px;
+	width: 155px;
+	position: absolute;
+	margin: 0;
+	padding: 8px 0 0 5px;
+}
+
+#content div.box-left div.form div.fields div.field div.label,#content div.box-right div.form div.fields div.field div.label
+	{
+	clear: both;
+	overflow: hidden;
+	left: 0;
+	width: auto;
+	position: relative;
+	margin: 0;
+	padding: 0 0 8px;
 }
 
 #content div.box div.form div.fields div.field div.label-select {
-padding:5px 0 0 5px;
-}
-
-#content div.box-left div.form div.fields div.field div.label-select,#content div.box-right div.form div.fields div.field div.label-select {
-padding:0 0 8px;
-}
-
-#content div.box-left div.form div.fields div.field div.label-textarea,#content div.box-right div.form div.fields div.field div.label-textarea {
-padding:0 0 8px !important;
-}
-
-#content div.box div.form div.fields div.field div.label label, div.label label{
-color:#393939;
-font-weight:700;
+	padding: 5px 0 0 5px;
+}
+
+#content div.box-left div.form div.fields div.field div.label-select,#content div.box-right div.form div.fields div.field div.label-select
+	{
+	padding: 0 0 8px;
+}
+
+#content div.box-left div.form div.fields div.field div.label-textarea,#content div.box-right div.form div.fields div.field div.label-textarea
+	{
+	padding: 0 0 8px !important;
+}
+
+#content div.box div.form div.fields div.field div.label label,div.label label
+	{
+	color: #393939;
+	font-weight: 700;
 }
 
 #content div.box div.form div.fields div.field div.input {
-margin:0 0 0 200px;
-}
+	margin: 0 0 0 200px;
+}
+
 #content div.box div.form div.fields div.field div.file {
-margin:0 0 0 200px;
-}
-#content div.box-left div.form div.fields div.field div.input,#content div.box-right div.form div.fields div.field div.input {
-margin:0 0 0 0px;
+	margin: 0 0 0 200px;
+}
+
+#content div.box-left div.form div.fields div.field div.input,#content div.box-right div.form div.fields div.field div.input
+	{
+	margin: 0 0 0 0px;
 }
 
 #content div.box div.form div.fields div.field div.input input {
-background:#FFF;
-border-top:1px solid #b3b3b3;
-border-left:1px solid #b3b3b3;
-border-right:1px solid #eaeaea;
-border-bottom:1px solid #eaeaea;
-color:#000;
-font-family:Lucida Grande, Verdana, Lucida Sans Regular, Lucida Sans Unicode, Arial, sans-serif;
-font-size:11px;
-margin:0;
-padding:7px 7px 6px;
+	background: #FFF;
+	border-top: 1px solid #b3b3b3;
+	border-left: 1px solid #b3b3b3;
+	border-right: 1px solid #eaeaea;
+	border-bottom: 1px solid #eaeaea;
+	color: #000;
+	font-size: 11px;
+	margin: 0;
+	padding: 7px 7px 6px;
 }
 
 #content div.box div.form div.fields div.field div.file input {
-    background: none repeat scroll 0 0 #FFFFFF;
-    border-color: #B3B3B3 #EAEAEA #EAEAEA #B3B3B3;
-    border-style: solid;
-    border-width: 1px;
-    color: #000000;
-    font-family: Lucida Grande,Verdana,Lucida Sans Regular,Lucida Sans Unicode,Arial,sans-serif;
-    font-size: 11px;
-    margin: 0;
-    padding: 7px 7px 6px;
-}
-
+	background: none repeat scroll 0 0 #FFFFFF;
+	border-color: #B3B3B3 #EAEAEA #EAEAEA #B3B3B3;
+	border-style: solid;
+	border-width: 1px;
+	color: #000000;
+	font-size: 11px;
+	margin: 0;
+	padding: 7px 7px 6px;
+}
 
 #content div.box div.form div.fields div.field div.input input.small {
-width:30%;
+	width: 30%;
 }
 
 #content div.box div.form div.fields div.field div.input input.medium {
-width:55%;
+	width: 55%;
 }
 
 #content div.box div.form div.fields div.field div.input input.large {
-width:85%;
+	width: 85%;
 }
 
 #content div.box div.form div.fields div.field div.input input.date {
-width:177px;
+	width: 177px;
 }
 
 #content div.box div.form div.fields div.field div.input input.button {
-background:#D4D0C8;
-border-top:1px solid #FFF;
-border-left:1px solid #FFF;
-border-right:1px solid #404040;
-border-bottom:1px solid #404040;
-color:#000;
-margin:0;
-padding:4px 8px;
+	background: #D4D0C8;
+	border-top: 1px solid #FFF;
+	border-left: 1px solid #FFF;
+	border-right: 1px solid #404040;
+	border-bottom: 1px solid #404040;
+	color: #000;
+	margin: 0;
+	padding: 4px 8px;
 }
 
 #content div.box div.form div.fields div.field div.textarea {
-border-top:1px solid #b3b3b3;
-border-left:1px solid #b3b3b3;
-border-right:1px solid #eaeaea;
-border-bottom:1px solid #eaeaea;
-margin:0 0 0 200px;
-padding:10px;
+	border-top: 1px solid #b3b3b3;
+	border-left: 1px solid #b3b3b3;
+	border-right: 1px solid #eaeaea;
+	border-bottom: 1px solid #eaeaea;
+	margin: 0 0 0 200px;
+	padding: 10px;
 }
 
 #content div.box div.form div.fields div.field div.textarea-editor {
-border:1px solid #ddd;
-padding:0;
+	border: 1px solid #ddd;
+	padding: 0;
 }
 
 #content div.box div.form div.fields div.field div.textarea textarea {
-width:100%;
-height:220px;
-overflow:hidden;
-background:#FFF;
-color:#000;
-font-family:Lucida Grande, Verdana, Lucida Sans Regular, Lucida Sans Unicode, Arial, sans-serif;
-font-size:11px;
-outline:none;
-border-width:0;
-margin:0;
-padding:0;
-}
-
-#content div.box-left div.form div.fields div.field div.textarea textarea,#content div.box-right div.form div.fields div.field div.textarea textarea {
-width:100%;
-height:100px;
+	width: 100%;
+	height: 220px;
+	overflow: hidden;
+	background: #FFF;
+	color: #000;
+	font-size: 11px;
+	outline: none;
+	border-width: 0;
+	margin: 0;
+	padding: 0;
+}
+
+#content div.box-left div.form div.fields div.field div.textarea textarea,#content div.box-right div.form div.fields div.field div.textarea textarea
+	{
+	width: 100%;
+	height: 100px;
 }
 
 #content div.box div.form div.fields div.field div.textarea table {
-width:100%;
-border:none;
-margin:0;
-padding:0;
+	width: 100%;
+	border: none;
+	margin: 0;
+	padding: 0;
 }
 
 #content div.box div.form div.fields div.field div.textarea table td {
-background:#DDD;
-border:none;
-padding:0;
-}
-
-#content div.box div.form div.fields div.field div.textarea table td table {
-width:auto;
-border:none;
-margin:0;
-padding:0;
-}
-
-#content div.box div.form div.fields div.field div.textarea table td table td {
-font-family:Lucida Grande, Verdana, Lucida Sans Regular, Lucida Sans Unicode, Arial, sans-serif;
-font-size:11px;
-padding:5px 5px 5px 0;
-}
-
-#content div.box div.form div.fields div.field input[type=text]:focus,#content div.box div.form div.fields div.field input[type=password]:focus,#content div.box div.form div.fields div.field input[type=file]:focus,#content div.box div.form div.fields div.field textarea:focus,#content div.box div.form div.fields div.field select:focus {
-background:#f6f6f6;
-border-color:#666;
+	background: #DDD;
+	border: none;
+	padding: 0;
+}
+
+#content div.box div.form div.fields div.field div.textarea table td table
+	{
+	width: auto;
+	border: none;
+	margin: 0;
+	padding: 0;
+}
+
+#content div.box div.form div.fields div.field div.textarea table td table td
+	{
+	font-size: 11px;
+	padding: 5px 5px 5px 0;
+}
+
+#content div.box div.form div.fields div.field input[type=text]:focus,#content div.box div.form div.fields div.field input[type=password]:focus,#content div.box div.form div.fields div.field input[type=file]:focus,#content div.box div.form div.fields div.field textarea:focus,#content div.box div.form div.fields div.field select:focus
+	{
+	background: #f6f6f6;
+	border-color: #666;
 }
 
 div.form div.fields div.field div.button {
-margin:0;
-padding:0 0 0 8px;
-}
-
+	margin: 0;
+	padding: 0 0 0 8px;
+}
+#content div.box table.noborder {
+	border: 1px solid transparent;
+}
 
 #content div.box table {
-width:100%;
-border-collapse:collapse;
-margin:0;
-padding:0;
-border: 1px solid #eee;
+	width: 100%;
+	border-collapse: separate;
+	margin: 0;
+	padding: 0;
+	border: 1px solid #eee;
+    -webkit-border-radius: 4px;
+    -moz-border-radius: 4px;
+    border-radius: 4px;	
 }
 
 #content div.box table th {
-background:#eee;
-border-bottom:1px solid #ddd;
-padding:5px 0px 5px 5px;
+	background: #eee;
+	border-bottom: 1px solid #ddd;
+	padding: 5px 0px 5px 5px;
 }
 
 #content div.box table th.left {
-text-align:left;
+	text-align: left;
 }
 
 #content div.box table th.right {
-text-align:right;
+	text-align: right;
 }
 
 #content div.box table th.center {
-text-align:center;
+	text-align: center;
 }
 
 #content div.box table th.selected {
-vertical-align:middle;
-padding:0;
+	vertical-align: middle;
+	padding: 0;
 }
 
 #content div.box table td {
-background:#fff;
-border-bottom:1px solid #cdcdcd;
-vertical-align:middle;
-padding:5px;
+	background: #fff;
+	border-bottom: 1px solid #cdcdcd;
+	vertical-align: middle;
+	padding: 5px;
 }
 
 #content div.box table tr.selected td {
-background:#FFC;
+	background: #FFC;
 }
 
 #content div.box table td.selected {
-width:3%;
-text-align:center;
-vertical-align:middle;
-padding:0;
+	width: 3%;
+	text-align: center;
+	vertical-align: middle;
+	padding: 0;
 }
 
 #content div.box table td.action {
-width:45%;
-text-align:left;
+	width: 45%;
+	text-align: left;
 }
 
 #content div.box table td.date {
-width:33%;
-text-align:center;
+	width: 33%;
+	text-align: center;
 }
 
 #content div.box div.action {
-float:right;
-background:#FFF;
-text-align:right;
-margin:10px 0 0;
-padding:0;
+	float: right;
+	background: #FFF;
+	text-align: right;
+	margin: 10px 0 0;
+	padding: 0;
 }
 
 #content div.box div.action select {
-font-family:Lucida Grande, Verdana, Lucida Sans Regular, Lucida Sans Unicode, Arial, sans-serif;
-font-size:11px;
-margin:0;
+	font-size: 11px;
+	margin: 0;
 }
 
 #content div.box div.action .ui-selectmenu {
-margin:0;
-padding:0;
+	margin: 0;
+	padding: 0;
 }
 
 #content div.box div.pagination {
-height:1%;
-clear:both;
-overflow:hidden;
-margin:10px 0 0;
-padding:0;
+	height: 1%;
+	clear: both;
+	overflow: hidden;
+	margin: 10px 0 0;
+	padding: 0;
 }
 
 #content div.box div.pagination ul.pager {
-float:right;
-text-align:right;
-margin:0;
-padding:0;
+	float: right;
+	text-align: right;
+	margin: 0;
+	padding: 0;
 }
 
 #content div.box div.pagination ul.pager li {
-height:1%;
-float:left;
-list-style:none;
-background:#ebebeb url("../images/pager.png") repeat-x;
-border-top:1px solid #dedede;
-border-left:1px solid #cfcfcf;
-border-right:1px solid #c4c4c4;
-border-bottom:1px solid #c4c4c4;
-color:#4A4A4A;
-font-weight:700;
-margin:0 0 0 4px;
-padding:0;
+	height: 1%;
+	float: left;
+	list-style: none;
+	background: #ebebeb url("../images/pager.png") repeat-x;
+	border-top: 1px solid #dedede;
+	border-left: 1px solid #cfcfcf;
+	border-right: 1px solid #c4c4c4;
+	border-bottom: 1px solid #c4c4c4;
+	color: #4A4A4A;
+	font-weight: 700;
+	margin: 0 0 0 4px;
+	padding: 0;
 }
 
 #content div.box div.pagination ul.pager li.separator {
-padding:6px;
+	padding: 6px;
 }
 
 #content div.box div.pagination ul.pager li.current {
-background:#b4b4b4 url("../images/pager_selected.png") repeat-x;
-border-top:1px solid #ccc;
-border-left:1px solid #bebebe;
-border-right:1px solid #b1b1b1;
-border-bottom:1px solid #afafaf;
-color:#515151;
-padding:6px;
+	background: #b4b4b4 url("../images/pager_selected.png") repeat-x;
+	border-top: 1px solid #ccc;
+	border-left: 1px solid #bebebe;
+	border-right: 1px solid #b1b1b1;
+	border-bottom: 1px solid #afafaf;
+	color: #515151;
+	padding: 6px;
 }
 
 #content div.box div.pagination ul.pager li a {
-height:1%;
-display:block;
-float:left;
-color:#515151;
-text-decoration:none;
-margin:0;
-padding:6px;
-}
-
-#content div.box div.pagination ul.pager li a:hover,#content div.box div.pagination ul.pager li a:active {
-background:#b4b4b4 url("../images/pager_selected.png") repeat-x;
-border-top:1px solid #ccc;
-border-left:1px solid #bebebe;
-border-right:1px solid #b1b1b1;
-border-bottom:1px solid #afafaf;
-margin:-1px;
+	height: 1%;
+	display: block;
+	float: left;
+	color: #515151;
+	text-decoration: none;
+	margin: 0;
+	padding: 6px;
+}
+
+#content div.box div.pagination ul.pager li a:hover,#content div.box div.pagination ul.pager li a:active
+	{
+	background: #b4b4b4 url("../images/pager_selected.png") repeat-x;
+	border-top: 1px solid #ccc;
+	border-left: 1px solid #bebebe;
+	border-right: 1px solid #b1b1b1;
+	border-bottom: 1px solid #afafaf;
+	margin: -1px;
 }
 
 #content div.box div.pagination-wh {
-height:1%;
-clear:both;
-overflow:hidden;
-text-align:right;
-margin:10px 0 0;
-padding:0;
+	height: 1%;
+	clear: both;
+	overflow: hidden;
+	text-align: right;
+	margin: 10px 0 0;
+	padding: 0;
 }
 
 #content div.box div.pagination-right {
-float:right;
-}
-
-#content div.box div.pagination-wh a,#content div.box div.pagination-wh span.pager_dotdot {
-height:1%;
-float:left;
-background:#ebebeb url("../images/pager.png") repeat-x;
-border-top:1px solid #dedede;
-border-left:1px solid #cfcfcf;
-border-right:1px solid #c4c4c4;
-border-bottom:1px solid #c4c4c4;
-color:#4A4A4A;
-font-weight:700;
-margin:0 0 0 4px;
-padding:6px;
+	float: right;
+}
+
+#content div.box div.pagination-wh a,#content div.box div.pagination-wh span.pager_dotdot
+	{
+	height: 1%;
+	float: left;
+	background: #ebebeb url("../images/pager.png") repeat-x;
+	border-top: 1px solid #dedede;
+	border-left: 1px solid #cfcfcf;
+	border-right: 1px solid #c4c4c4;
+	border-bottom: 1px solid #c4c4c4;
+	color: #4A4A4A;
+	font-weight: 700;
+	margin: 0 0 0 4px;
+	padding: 6px;
 }
 
 #content div.box div.pagination-wh span.pager_curpage {
-height:1%;
-float:left;
-background:#b4b4b4 url("../images/pager_selected.png") repeat-x;
-border-top:1px solid #ccc;
-border-left:1px solid #bebebe;
-border-right:1px solid #b1b1b1;
-border-bottom:1px solid #afafaf;
-color:#515151;
-font-weight:700;
-margin:0 0 0 4px;
-padding:6px;
-}
-
-#content div.box div.pagination-wh a:hover,#content div.box div.pagination-wh a:active {
-background:#b4b4b4 url("../images/pager_selected.png") repeat-x;
-border-top:1px solid #ccc;
-border-left:1px solid #bebebe;
-border-right:1px solid #b1b1b1;
-border-bottom:1px solid #afafaf;
-text-decoration:none;
+	height: 1%;
+	float: left;
+	background: #b4b4b4 url("../images/pager_selected.png") repeat-x;
+	border-top: 1px solid #ccc;
+	border-left: 1px solid #bebebe;
+	border-right: 1px solid #b1b1b1;
+	border-bottom: 1px solid #afafaf;
+	color: #515151;
+	font-weight: 700;
+	margin: 0 0 0 4px;
+	padding: 6px;
+}
+
+#content div.box div.pagination-wh a:hover,#content div.box div.pagination-wh a:active
+	{
+	background: #b4b4b4 url("../images/pager_selected.png") repeat-x;
+	border-top: 1px solid #ccc;
+	border-left: 1px solid #bebebe;
+	border-right: 1px solid #b1b1b1;
+	border-bottom: 1px solid #afafaf;
+	text-decoration: none;
 }
 
 #content div.box div.traffic div.legend {
-clear:both;
-overflow:hidden;
-border-bottom:1px solid #ddd;
-margin:0 0 10px;
-padding:0 0 10px;
+	clear: both;
+	overflow: hidden;
+	border-bottom: 1px solid #ddd;
+	margin: 0 0 10px;
+	padding: 0 0 10px;
 }
 
 #content div.box div.traffic div.legend h6 {
-float:left;
-border:none;
-margin:0;
-padding:0;
+	float: left;
+	border: none;
+	margin: 0;
+	padding: 0;
 }
 
 #content div.box div.traffic div.legend li {
-list-style:none;
-float:left;
-font-size:11px;
-margin:0;
-padding:0 8px 0 4px;
+	list-style: none;
+	float: left;
+	font-size: 11px;
+	margin: 0;
+	padding: 0 8px 0 4px;
 }
 
 #content div.box div.traffic div.legend li.visits {
-border-left:12px solid #edc240;
+	border-left: 12px solid #edc240;
 }
 
 #content div.box div.traffic div.legend li.pageviews {
-border-left:12px solid #afd8f8;
+	border-left: 12px solid #afd8f8;
 }
 
 #content div.box div.traffic table {
-width:auto;
+	width: auto;
 }
 
 #content div.box div.traffic table td {
-background:transparent;
-border:none;
-padding:2px 3px 3px;
+	background: transparent;
+	border: none;
+	padding: 2px 3px 3px;
 }
 
 #content div.box div.traffic table td.legendLabel {
-padding:0 3px 2px;
-}
-
-#summary{
-
-}
-
-#summary .desc{
-white-space: pre;
-width: 100%;
-}
-
-#summary .repo_name{
-font-size: 1.6em;
-font-weight: bold;
-vertical-align: baseline;
-clear:right
-}
-
+	padding: 0 3px 2px;
+}
+
+#summary {
+	
+}
+
+#summary .desc {
+	white-space: pre;
+	width: 100%;
+}
+
+#summary .repo_name {
+	font-size: 1.6em;
+	font-weight: bold;
+	vertical-align: baseline;
+	clear: right
+}
 
 #footer {
-clear:both;
-overflow:hidden;
-text-align:right;
-margin:0;
-padding:0 10px 4px;
-margin:-10px 0 0;
+	clear: both;
+	overflow: hidden;
+	text-align: right;
+	margin: 0;
+	padding: 0 10px 4px;
+	margin: -10px 0 0;
 }
 
 #footer div#footer-inner {
-background:url("../images/header_inner.png") repeat-x scroll 0 0 #003367;
-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
--webkit-border-radius: 4px 4px 4px 4px;
--khtml-border-radius: 4px 4px 4px 4px; 
--moz-border-radius: 4px 4px 4px 4px;
-border-radius: 4px 4px 4px 4px;
+	background-color: #eedc94; background-repeat : repeat-x;
+	background-image : -khtml-gradient( linear, left top, left bottom,
+	from( #fceec1), to( #eedc94)); background-image : -moz-linear-gradient(
+	top, #003b76, #00376e); background-image : -ms-linear-gradient( top,
+	#003b76, #00376e); background-image : -webkit-gradient( linear, left
+	top, left bottom, color-stop( 0%, #003b76), color-stop( 100%, #00376e));
+	background-image : -webkit-linear-gradient( top, #003b76, #00376e));
+	background-image : -o-linear-gradient( top, #003b76, #00376e));
+	background-image : linear-gradient( top, #003b76, #00376e); filter :
+	progid : DXImageTransform.Microsoft.gradient ( startColorstr =
+	'#003b76', endColorstr = '#00376e', GradientType = 0);
+	box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
+	-webkit-border-radius: 4px 4px 4px 4px;
+	-khtml-border-radius: 4px 4px 4px 4px;
+	-moz-border-radius: 4px 4px 4px 4px;
+	border-radius: 4px 4px 4px 4px;
+	background-repeat: repeat-x;
+	background-image: -khtml-gradient(linear, left top, left bottom, from(#fceec1),
+		to(#eedc94) );
+	background-image: -moz-linear-gradient(top, #003b76, #00376e);
+	background-image: -ms-linear-gradient(top, #003b76, #00376e);
+	background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #003b76),
+		color-stop(100%, #00376e) );
+	background-image: -webkit-linear-gradient(top, #003b76, #00376e) );
+	background-image: -o-linear-gradient(top, #003b76, #00376e) );
+	background-image: linear-gradient(top, #003b76, #00376e);
+	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#003b76',
+		endColorstr='#00376e', GradientType=0 );
 }
 
 #footer div#footer-inner p {
-padding:15px 25px 15px 0;
-color:#FFF;
-font-weight:700;
-}
+	padding: 15px 25px 15px 0;
+	color: #FFF;
+	font-weight: 700;
+}
+
 #footer div#footer-inner .footer-link {
-float:left;
-padding-left:10px;
-}
-#footer div#footer-inner .footer-link a,#footer div#footer-inner .footer-link-right a {
-color:#FFF; 
+	float: left;
+	padding-left: 10px;
+}
+
+#footer div#footer-inner .footer-link a,#footer div#footer-inner .footer-link-right a
+	{
+	color: #FFF;
 }
 
 #login div.title {
-width:420px;
-clear:both;
-overflow:hidden;
-position:relative;
-background:#003367 url("../images/header_inner.png") repeat-x;
-margin:0 auto;
-padding:0;
+	width: 420px;
+	clear: both;
+	overflow: hidden;
+	position: relative;
+	background-color: #eedc94; background-repeat : repeat-x;
+	background-image : -khtml-gradient( linear, left top, left bottom,
+	from( #fceec1), to( #eedc94)); background-image : -moz-linear-gradient(
+	top, #003b76, #00376e); background-image : -ms-linear-gradient( top,
+	#003b76, #00376e); background-image : -webkit-gradient( linear, left
+	top, left bottom, color-stop( 0%, #003b76), color-stop( 100%, #00376e));
+	background-image : -webkit-linear-gradient( top, #003b76, #00376e));
+	background-image : -o-linear-gradient( top, #003b76, #00376e));
+	background-image : linear-gradient( top, #003b76, #00376e); filter :
+	progid : DXImageTransform.Microsoft.gradient ( startColorstr =
+	'#003b76', endColorstr = '#00376e', GradientType = 0);
+	margin: 0 auto;
+	padding: 0;
+	background-repeat: repeat-x;
+	background-image: -khtml-gradient(linear, left top, left bottom, from(#fceec1),
+		to(#eedc94) );
+	background-image: -moz-linear-gradient(top, #003b76, #00376e);
+	background-image: -ms-linear-gradient(top, #003b76, #00376e);
+	background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #003b76),
+		color-stop(100%, #00376e) );
+	background-image: -webkit-linear-gradient(top, #003b76, #00376e) );
+	background-image: -o-linear-gradient(top, #003b76, #00376e) );
+	background-image: linear-gradient(top, #003b76, #00376e);
+	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#003b76',
+		endColorstr='#00376e', GradientType=0 );
 }
 
 #login div.inner {
-width:380px;
-background:#FFF url("../images/login.png") no-repeat top left;
-border-top:none;
-border-bottom:none;
-margin:0 auto;
-padding:20px;
+	width: 380px;
+	background: #FFF url("../images/login.png") no-repeat top left;
+	border-top: none;
+	border-bottom: none;
+	margin: 0 auto;
+	padding: 20px;
 }
 
 #login div.form div.fields div.field div.label {
-width:173px;
-float:left;
-text-align:right;
-margin:2px 10px 0 0;
-padding:5px 0 0 5px;
+	width: 173px;
+	float: left;
+	text-align: right;
+	margin: 2px 10px 0 0;
+	padding: 5px 0 0 5px;
 }
 
 #login div.form div.fields div.field div.input input {
-width:176px;
-background:#FFF;
-border-top:1px solid #b3b3b3;
-border-left:1px solid #b3b3b3;
-border-right:1px solid #eaeaea;
-border-bottom:1px solid #eaeaea;
-color:#000;
-font-family:Lucida Grande, Verdana, Lucida Sans Regular, Lucida Sans Unicode, Arial, sans-serif;
-font-size:11px;
-margin:0;
-padding:7px 7px 6px;
+	width: 176px;
+	background: #FFF;
+	border-top: 1px solid #b3b3b3;
+	border-left: 1px solid #b3b3b3;
+	border-right: 1px solid #eaeaea;
+	border-bottom: 1px solid #eaeaea;
+	color: #000;
+	font-size: 11px;
+	margin: 0;
+	padding: 7px 7px 6px;
 }
 
 #login div.form div.fields div.buttons {
-clear:both;
-overflow:hidden;
-border-top:1px solid #DDD;
-text-align:right;
-margin:0;
-padding:10px 0 0;
+	clear: both;
+	overflow: hidden;
+	border-top: 1px solid #DDD;
+	text-align: right;
+	margin: 0;
+	padding: 10px 0 0;
 }
 
 #login div.form div.links {
-clear:both;
-overflow:hidden;
-margin:10px 0 0;
-padding:0 0 2px;
-}
-
-#quick_login{
-top: 31px;
-background-color: rgb(0, 51, 103);
-z-index: 999; 
-height: 150px;
-position: absolute;
-margin-left: -16px;
-width: 281px;
--webkit-border-radius: 0px 0px 4px 4px;
--khtml-border-radius: 0px 0px 4px 4px; 
--moz-border-radius: 0px 0px 4px 4px;
-border-radius: 0px 0px 4px 4px;
-
-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
-}
-
-#quick_login .password_forgoten{
-padding-right:10px;
-padding-top:0px;
-float:left;
-}
-#quick_login .password_forgoten a{
+	clear: both;
+	overflow: hidden;
+	margin: 10px 0 0;
+	padding: 0 0 2px;
+}
+
+#quick_login {
+	top: 31px;
+	background-color: rgb(0, 51, 103);
+	z-index: 999;
+	height: 150px;
+	position: absolute;
+	margin-left: -16px;
+	width: 281px;
+	-webkit-border-radius: 0px 0px 4px 4px;
+	-khtml-border-radius: 0px 0px 4px 4px;
+	-moz-border-radius: 0px 0px 4px 4px;
+	border-radius: 0px 0px 4px 4px;
+	box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
+}
+
+#quick_login .password_forgoten {
+	padding-right: 10px;
+	padding-top: 0px;
+	float: left;
+}
+
+#quick_login .password_forgoten a {
 	font-size: 10px
 }
 
-#quick_login .register{
-padding-right:10px;
-padding-top:5px;
-float:left;
-}
-
-#quick_login .register a{
+#quick_login .register {
+	padding-right: 10px;
+	padding-top: 5px;
+	float: left;
+}
+
+#quick_login .register a {
 	font-size: 10px
 }
-#quick_login div.form div.fields{
-padding-top: 2px;
-padding-left:10px;
-}
-
-#quick_login div.form div.fields div.field{
- padding: 5px;
-}
-
-#quick_login div.form div.fields div.field div.label label{
-color:#fff;
-padding-bottom: 3px;
+
+#quick_login div.form div.fields {
+	padding-top: 2px;
+	padding-left: 10px;
+}
+
+#quick_login div.form div.fields div.field {
+	padding: 5px;
+}
+
+#quick_login div.form div.fields div.field div.label label {
+	color: #fff;
+	padding-bottom: 3px;
 }
 
 #quick_login div.form div.fields div.field div.input input {
-width:236px;
-background:#FFF;
-border-top:1px solid #b3b3b3;
-border-left:1px solid #b3b3b3;
-border-right:1px solid #eaeaea;
-border-bottom:1px solid #eaeaea;
-color:#000;
-font-family:Lucida Grande, Verdana, Lucida Sans Regular, Lucida Sans Unicode, Arial, sans-serif;
-font-size:11px;
-margin:0;
-padding:5px 7px 4px;
+	width: 236px;
+	background: #FFF;
+	border-top: 1px solid #b3b3b3;
+	border-left: 1px solid #b3b3b3;
+	border-right: 1px solid #eaeaea;
+	border-bottom: 1px solid #eaeaea;
+	color: #000;
+	font-size: 11px;
+	margin: 0;
+	padding: 5px 7px 4px;
 }
 
 #quick_login div.form div.fields div.buttons {
-clear:both;
-overflow:hidden;
-text-align:right;
-margin:0;
-padding:10px 14px 0px 5px;
+	clear: both;
+	overflow: hidden;
+	text-align: right;
+	margin: 0;
+	padding: 10px 14px 0px 5px;
 }
 
 #quick_login div.form div.links {
-clear:both;
-overflow:hidden;
-margin:10px 0 0;
-padding:0 0 2px;
+	clear: both;
+	overflow: hidden;
+	margin: 10px 0 0;
+	padding: 0 0 2px;
 }
 
 #register div.title {
-clear:both;
-overflow:hidden;
-position:relative;
-background:#003367 url("../images/header_inner.png") repeat-x;
-margin:0 auto;
-padding:0;
+	clear: both;
+	overflow: hidden;
+	position: relative;
+    background-color: #eedc94;
+    background-repeat: repeat-x;
+    background-image: -khtml-gradient(linear, left top, left bottom, from(#fceec1),
+        to(#eedc94) );
+    background-image: -moz-linear-gradient(top, #003b76, #00376e);
+    background-image: -ms-linear-gradient(top, #003b76, #00376e);
+    background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #003b76),
+        color-stop(100%, #00376e) );
+    background-image: -webkit-linear-gradient(top, #003b76, #00376e) );
+    background-image: -o-linear-gradient(top, #003b76, #00376e) );
+    background-image: linear-gradient(top, #003b76, #00376e);
+    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#003b76',
+        endColorstr='#00376e', GradientType=0 );
+	margin: 0 auto;
+	padding: 0;
 }
 
 #register div.inner {
-background:#FFF;
-border-top:none;
-border-bottom:none;
-margin:0 auto;
-padding:20px;
+	background: #FFF;
+	border-top: none;
+	border-bottom: none;
+	margin: 0 auto;
+	padding: 20px;
 }
 
 #register div.form div.fields div.field div.label {
-width:135px;
-float:left;
-text-align:right;
-margin:2px 10px 0 0;
-padding:5px 0 0 5px;
+	width: 135px;
+	float: left;
+	text-align: right;
+	margin: 2px 10px 0 0;
+	padding: 5px 0 0 5px;
 }
 
 #register div.form div.fields div.field div.input input {
-width:300px;
-background:#FFF;
-border-top:1px solid #b3b3b3;
-border-left:1px solid #b3b3b3;
-border-right:1px solid #eaeaea;
-border-bottom:1px solid #eaeaea;
-color:#000;
-font-family:Lucida Grande, Verdana, Lucida Sans Regular, Lucida Sans Unicode, Arial, sans-serif;
-font-size:11px;
-margin:0;
-padding:7px 7px 6px;
+	width: 300px;
+	background: #FFF;
+	border-top: 1px solid #b3b3b3;
+	border-left: 1px solid #b3b3b3;
+	border-right: 1px solid #eaeaea;
+	border-bottom: 1px solid #eaeaea;
+	color: #000;
+	font-size: 11px;
+	margin: 0;
+	padding: 7px 7px 6px;
 }
 
 #register div.form div.fields div.buttons {
-clear:both;
-overflow:hidden;
-border-top:1px solid #DDD;
-text-align:left;
-margin:0;
-padding:10px 0 0 150px;
-}
-
+	clear: both;
+	overflow: hidden;
+	border-top: 1px solid #DDD;
+	text-align: left;
+	margin: 0;
+	padding: 10px 0 0 150px;
+}
 
 #register div.form div.activation_msg {
-padding-top:4px;
-padding-bottom:4px;
-}
-
-#journal .journal_day{
-font-size:20px;
-padding:10px 0px;
-border-bottom:2px solid #DDD;
-margin-left:10px;
-margin-right:10px;
-}
-
-#journal .journal_container{
-padding:5px;
-clear:both;
-margin:0px 5px 0px 10px;
-}
-
-#journal .journal_action_container{
-padding-left:38px;
-}
-
-#journal .journal_user{
-color: #747474;
-font-size: 14px;
-font-weight: bold;
-height: 30px;
-}
-#journal .journal_icon{
-clear: both;
-float: left;
-padding-right: 4px;
-padding-top: 3px;
-}
-#journal .journal_action{
-padding-top:4px;
-min-height:2px;
-float:left
-}
-#journal .journal_action_params{
-clear: left;
-padding-left: 22px;
-}
-#journal .journal_repo{
-float: left;
-margin-left: 6px;
-padding-top: 3px;
-}
-#journal .date{
-clear: both;
-color: #777777;
-font-size: 11px;
-padding-left: 22px;
-}
-#journal .journal_repo .journal_repo_name{
-font-weight: bold;
-font-size: 1.1em;
-}
-#journal .compare_view{
-padding: 5px 0px 5px 0px;
-width: 95px;
-}
-.journal_highlight{
-font-weight: bold;
-padding: 0 2px;
-vertical-align: bottom;
-}
+	padding-top: 4px;
+	padding-bottom: 4px;
+}
+
+#journal .journal_day {
+	font-size: 20px;
+	padding: 10px 0px;
+	border-bottom: 2px solid #DDD;
+	margin-left: 10px;
+	margin-right: 10px;
+}
+
+#journal .journal_container {
+	padding: 5px;
+	clear: both;
+	margin: 0px 5px 0px 10px;
+}
+
+#journal .journal_action_container {
+	padding-left: 38px;
+}
+
+#journal .journal_user {
+	color: #747474;
+	font-size: 14px;
+	font-weight: bold;
+	height: 30px;
+}
+
+#journal .journal_icon {
+	clear: both;
+	float: left;
+	padding-right: 4px;
+	padding-top: 3px;
+}
+
+#journal .journal_action {
+	padding-top: 4px;
+	min-height: 2px;
+	float: left
+}
+
+#journal .journal_action_params {
+	clear: left;
+	padding-left: 22px;
+}
+
+#journal .journal_repo {
+	float: left;
+	margin-left: 6px;
+	padding-top: 3px;
+}
+
+#journal .date {
+	clear: both;
+	color: #777777;
+	font-size: 11px;
+	padding-left: 22px;
+}
+
+#journal .journal_repo .journal_repo_name {
+	font-weight: bold;
+	font-size: 1.1em;
+}
+
+#journal .compare_view {
+	padding: 5px 0px 5px 0px;
+	width: 95px;
+}
+
+.journal_highlight {
+	font-weight: bold;
+	padding: 0 2px;
+	vertical-align: bottom;
+}
+
 .trending_language_tbl,.trending_language_tbl td {
-border:0 !important;
-margin:0 !important;
-padding:0 !important;
+	border: 0 !important;
+	margin: 0 !important;
+	padding: 0 !important;
 }
 
 .trending_language {
-background-color:#003367;
-color:#FFF;
-display:block;
-min-width:20px;
-text-decoration:none;
-height:12px;
-margin-bottom:4px;
-margin-left:5px;
-white-space:pre;
-padding:3px;
+	background-color: #003367;
+	color: #FFF;
+	display: block;
+	min-width: 20px;
+	text-decoration: none;
+	height: 12px;
+	margin-bottom: 4px;
+	margin-left: 5px;
+	white-space: pre;
+	padding: 3px;
 }
 
 h3.files_location {
-font-size:1.8em;
-font-weight:700;
-border-bottom:none !important;
-margin:10px 0 !important;
+	font-size: 1.8em;
+	font-weight: 700;
+	border-bottom: none !important;
+	margin: 10px 0 !important;
 }
 
 #files_data dl dt {
-float:left;
-width:115px;
-margin:0 !important;
-padding:5px;
+	float: left;
+	width: 115px;
+	margin: 0 !important;
+	padding: 5px;
 }
 
 #files_data dl dd {
-margin:0 !important;
-padding:5px !important;
+	margin: 0 !important;
+	padding: 5px !important;
 }
 
 #changeset_content {
-border:1px solid #CCC;
-padding:5px;
-}
-#changeset_compare_view_content{
-border:1px solid #CCC;
-padding:5px;
+	border: 1px solid #CCC;
+	padding: 5px;
+}
+
+#changeset_compare_view_content {
+	border: 1px solid #CCC;
+	padding: 5px;
 }
 
 #changeset_content .container {
-min-height:120px;
-font-size:1.2em;
-overflow:hidden;
-}
-
-#changeset_compare_view_content .compare_view_commits{
-width: auto !important;
-}
-
-#changeset_compare_view_content .compare_view_commits td{
-padding:0px 0px 0px 12px !important;
+	min-height: 120px;
+	font-size: 1.2em;
+	overflow: hidden;
+}
+
+#changeset_compare_view_content .compare_view_commits {
+	width: auto !important;
+}
+
+#changeset_compare_view_content .compare_view_commits td {
+	padding: 0px 0px 0px 12px !important;
 }
 
 #changeset_content .container .right {
-float:right;
-width:25%;
-text-align:right;
+	float: right;
+	width: 25%;
+	text-align: right;
 }
 
 #changeset_content .container .left .message {
-font-style:italic;
-color:#556CB5;
-white-space:pre-wrap;
-}
-
-.cs_files .cur_cs{
-margin:10px 2px;
-font-weight: bold;
-}
-
-.cs_files .node{
-float: left;
-}
-.cs_files .changes{
-float: right;
-}
-.cs_files .changes .added{
-background-color: #BBFFBB;
-float: left;
-text-align: center;
-font-size: 90%; 
-}
-.cs_files .changes .deleted{
-background-color: #FF8888;
-float: left;
-text-align: center;
-font-size: 90%;
-}
+	font-style: italic;
+	color: #556CB5;
+	white-space: pre-wrap;
+}
+
+.cs_files .cur_cs {
+	margin: 10px 2px;
+	font-weight: bold;
+}
+
+.cs_files .node {
+	float: left;
+}
+
+.cs_files .changes {
+	float: right;
+}
+
+.cs_files .changes .added {
+	background-color: #BBFFBB;
+	float: left;
+	text-align: center;
+	font-size: 90%;
+}
+
+.cs_files .changes .deleted {
+	background-color: #FF8888;
+	float: left;
+	text-align: center;
+	font-size: 90%;
+}
+
 .cs_files .cs_added {
-background:url("../images/icons/page_white_add.png") no-repeat scroll 3px;
-height:16px;
-padding-left:20px;
-margin-top:7px;
-text-align:left;
+	background: url("../images/icons/page_white_add.png") no-repeat scroll
+		3px;
+	height: 16px;
+	padding-left: 20px;
+	margin-top: 7px;
+	text-align: left;
 }
 
 .cs_files .cs_changed {
-background:url("../images/icons/page_white_edit.png") no-repeat scroll 3px;
-height:16px;
-padding-left:20px;
-margin-top:7px;
-text-align:left;
+	background: url("../images/icons/page_white_edit.png") no-repeat scroll
+		3px;
+	height: 16px;
+	padding-left: 20px;
+	margin-top: 7px;
+	text-align: left;
 }
 
 .cs_files .cs_removed {
-background:url("../images/icons/page_white_delete.png") no-repeat scroll 3px;
-height:16px;
-padding-left:20px;
-margin-top:7px;
-text-align:left;
+	background: url("../images/icons/page_white_delete.png") no-repeat
+		scroll 3px;
+	height: 16px;
+	padding-left: 20px;
+	margin-top: 7px;
+	text-align: left;
 }
 
 #graph {
-overflow:hidden;
+	overflow: hidden;
 }
 
 #graph_nodes {
-float: left;
-margin-right: -6px;
-margin-top: -4px;
+	float: left;
+	margin-right: -6px;
+	margin-top: -4px;
 }
 
 #graph_content {
-width:800px;
-float:left;
-
+	width: 800px;
+	float: left;
 }
 
 #graph_content .container_header {
-border:1px solid #CCC;
-padding:10px;
-}
-#graph_content #rev_range_container{
-padding:10px 0px;
-}
+	border: 1px solid #CCC;
+	padding: 10px;
+}
+
+#graph_content #rev_range_container {
+	padding: 10px 0px;
+}
+
 #graph_content .container {
-border-bottom:1px solid #CCC;
-border-left:1px solid #CCC;
-border-right:1px solid #CCC;
-min-height:70px;
-overflow:hidden;
-font-size:1.2em;
+	border-bottom: 1px solid #CCC;
+	border-left: 1px solid #CCC;
+	border-right: 1px solid #CCC;
+	min-height: 70px;
+	overflow: hidden;
+	font-size: 1.2em;
 }
 
 #graph_content .container .right {
-float:right;
-width:28%;
-text-align:right;
-padding-bottom:5px;
+	float: right;
+	width: 28%;
+	text-align: right;
+	padding-bottom: 5px;
 }
 
 #graph_content .container .left .date {
-font-weight:700;
-padding-bottom:5px;
-}
-#graph_content .container .left .date span{
-vertical-align: text-top;    
-}
-
-#graph_content .container .left .author{
-    height: 22px;
-}
-#graph_content .container .left .author .user{
-color: #444444;
-float: left;
-font-size: 12px;
-margin-left: -4px;
-margin-top: 4px;
+	font-weight: 700;
+	padding-bottom: 5px;
+}
+
+#graph_content .container .left .date span {
+	vertical-align: text-top;
+}
+
+#graph_content .container .left .author {
+	height: 22px;
+}
+
+#graph_content .container .left .author .user {
+	color: #444444;
+	float: left;
+	font-size: 12px;
+	margin-left: -4px;
+	margin-top: 4px;
 }
 
 #graph_content .container .left .message {
-font-size:100%;
-padding-top:3px;
-white-space:pre-wrap;
+	font-size: 100%;
+	padding-top: 3px;
+	white-space: pre-wrap;
+}
+
+#graph_content .container .left .message a:hover{
+	text-decoration: none;
 }
 
 .right div {
-clear:both;
-}
-
-.right .changes .changed_total{
-border:1px solid #DDD;
-display:block;
-float:right;
-text-align:center;
-min-width:45px;
-cursor: pointer;
-background:#FD8;
-font-weight: bold;
-}
+	clear: both;
+}
+
+.right .changes .changed_total {
+	border: 1px solid #DDD;
+	display: block;
+	float: right;
+	text-align: center;
+	min-width: 45px;
+	cursor: pointer;
+	background: #FD8;
+	font-weight: bold;
+}
+
 .right .changes .added,.changed,.removed {
-border:1px solid #DDD;
-display:block;
-float:right;
-text-align:center;
-min-width:15px;
-cursor: help;
-}
+	border: 1px solid #DDD;
+	display: block;
+	float: right;
+	text-align: center;
+	min-width: 15px;
+	cursor: help;
+}
+
 .right .changes .large {
-border:1px solid #DDD;
-display:block;
-float:right;
-text-align:center;
-min-width:45px;
-cursor: help;
-background: #54A9F7;
+	border: 1px solid #DDD;
+	display: block;
+	float: right;
+	text-align: center;
+	min-width: 45px;
+	cursor: help;
+	background: #54A9F7;
 }
 
 .right .changes .added {
-background:#BFB;
+	background: #BFB;
 }
 
 .right .changes .changed {
-background:#FD8;
+	background: #FD8;
 }
 
 .right .changes .removed {
-background:#F88;
+	background: #F88;
 }
 
 .right .merge {
-vertical-align:top;
-font-size:0.75em;
-font-weight:700;
+	vertical-align: top;
+	font-size: 0.75em;
+	font-weight: 700;
 }
 
 .right .parent {
-font-size:90%;
-font-family:monospace;
+	font-size: 90%;
+	font-family: monospace;
 }
 
 .right .logtags .branchtag {
-background:#FFF url("../images/icons/arrow_branch.png") no-repeat right 6px;
-display:block;
-font-size:0.8em;
-padding:11px 16px 0 0;
+	background: #FFF url("../images/icons/arrow_branch.png") no-repeat right
+		6px;
+	display: block;
+	font-size: 0.8em;
+	padding: 11px 16px 0 0;
 }
 
 .right .logtags .tagtag {
-background:#FFF url("../images/icons/tag_blue.png") no-repeat right 6px;
-display:block;
-font-size:0.8em;
-padding:11px 16px 0 0;
+	background: #FFF url("../images/icons/tag_blue.png") no-repeat right 6px;
+	display: block;
+	font-size: 0.8em;
+	padding: 11px 16px 0 0;
 }
 
 div.browserblock {
-overflow:hidden;
-border:1px solid #ccc;
-background:#f8f8f8;
-font-size:100%;
-line-height:125%;
-padding:0;
+	overflow: hidden;
+	border: 1px solid #ccc;
+	background: #f8f8f8;
+	font-size: 100%;
+	line-height: 125%;
+	padding: 0;
 }
 
 div.browserblock .browser-header {
-background:#FFF;
-padding:10px 0px 15px 0px;
-width: 100%;
-}
+	background: #FFF;
+	padding: 10px 0px 15px 0px;
+	width: 100%;
+}
+
 div.browserblock .browser-nav {
-float:left
+	float: left
 }
 
 div.browserblock .browser-branch {
-float:left;
+	float: left;
 }
 
 div.browserblock .browser-branch label {
-color:#4A4A4A;
-vertical-align:text-top;
+	color: #4A4A4A;
+	vertical-align: text-top;
 }
 
 div.browserblock .browser-header span {
-margin-left:5px;
-font-weight:700;
-}
-
-div.browserblock .browser-search{
-	clear:both;
-	padding:8px 8px 0px 5px;
+	margin-left: 5px;
+	font-weight: 700;
+}
+
+div.browserblock .browser-search {
+	clear: both;
+	padding: 8px 8px 0px 5px;
 	height: 20px;
 }
+
 div.browserblock #node_filter_box {
-}
-
-div.browserblock .search_activate{
-    float: left
-}
-
-div.browserblock .add_node{
-    float: left;
-    padding-left: 5px;
-}
-
-div.browserblock .search_activate a:hover,div.browserblock .add_node a:hover{
-    text-decoration: none !important;    
+	
+}
+
+div.browserblock .search_activate {
+	float: left
+}
+
+div.browserblock .add_node {
+	float: left;
+	padding-left: 5px;
+}
+
+div.browserblock .search_activate a:hover,div.browserblock .add_node a:hover
+	{
+	text-decoration: none !important;
 }
 
 div.browserblock .browser-body {
-background:#EEE;
-border-top:1px solid #CCC;
+	background: #EEE;
+	border-top: 1px solid #CCC;
 }
 
 table.code-browser {
-border-collapse:collapse;
-width:100%;
+	border-collapse: collapse;
+	width: 100%;
 }
 
 table.code-browser tr {
-margin:3px;
+	margin: 3px;
 }
 
 table.code-browser thead th {
-background-color:#EEE;
-height:20px;
-font-size:1.1em;
-font-weight:700;
-text-align:left;
-padding-left:10px;
+	background-color: #EEE;
+	height: 20px;
+	font-size: 1.1em;
+	font-weight: 700;
+	text-align: left;
+	padding-left: 10px;
 }
 
 table.code-browser tbody td {
-padding-left:10px;
-height:20px;
+	padding-left: 10px;
+	height: 20px;
 }
 
 table.code-browser .browser-file {
-background:url("../images/icons/document_16.png") no-repeat scroll 3px;
-height:16px;
-padding-left:20px;
-text-align:left;
-}
-.diffblock .changeset_file{
-background:url("../images/icons/file.png") no-repeat scroll 3px;
-height:16px;
-padding-left:22px;
-text-align:left;
-font-size: 14px;
-}
-
-.diffblock .changeset_header{
-margin-left: 6px !important;
+	background: url("../images/icons/document_16.png") no-repeat scroll 3px;
+	height: 16px;
+	padding-left: 20px;
+	text-align: left;
+}
+
+.diffblock .changeset_file {
+	background: url("../images/icons/file.png") no-repeat scroll 3px;
+	height: 16px;
+	padding-left: 22px;
+	text-align: left;
+	font-size: 14px;
+}
+
+.diffblock .changeset_header {
+	margin-left: 6px !important;
 }
 
 table.code-browser .browser-dir {
-background:url("../images/icons/folder_16.png") no-repeat scroll 3px;
-height:16px;
-padding-left:20px;
-text-align:left;
+	background: url("../images/icons/folder_16.png") no-repeat scroll 3px;
+	height: 16px;
+	padding-left: 20px;
+	text-align: left;
 }
 
 .box .search {
+	clear: both;
+	overflow: hidden;
+	margin: 0;
+	padding: 0 20px 10px;
+}
+
+.box .search div.search_path {
+	background: none repeat scroll 0 0 #EEE;
+	border: 1px solid #CCC;
+	color: blue;
+	margin-bottom: 10px;
+	padding: 10px 0;
+}
+
+.box .search div.search_path div.link {
+	font-weight: 700;
+	margin-left: 25px;
+}
+
+.box .search div.search_path div.link a {
+	color: #003367;
+	cursor: pointer;
+	text-decoration: none;
+}
+
+#path_unlock {
+	color: red;
+	font-size: 1.2em;
+	padding-left: 4px;
+}
+
+.info_box span {
+	margin-left: 3px;
+	margin-right: 3px;
+}
+
+.info_box .rev {
+	color: #003367;
+	font-size: 1.6em;
+	font-weight: bold;
+	vertical-align: sub;
+}
+
+.info_box input#at_rev,.info_box input#size {
+	background: #FFF;
+	border-top: 1px solid #b3b3b3;
+	border-left: 1px solid #b3b3b3;
+	border-right: 1px solid #eaeaea;
+	border-bottom: 1px solid #eaeaea;
+	color: #000;
+	font-size: 12px;
+	margin: 0;
+	padding: 1px 5px 1px;
+}
+
+.info_box input#view {
+	text-align: center;
+	padding: 4px 3px 2px 2px;
+}
+
+.yui-overlay,.yui-panel-container {
+	visibility: hidden;
+	position: absolute;
+	z-index: 2;
+}
+
+.yui-tt {
+	visibility: hidden;
+	position: absolute;
+	color: #666;
+	background-color: #FFF;
+	border: 2px solid #003367;
+	font: 100% sans-serif;
+	width: auto;
+	opacity: 1px;
+	padding: 8px;
+	white-space: pre-wrap;
+	-webkit-border-radius: 8px 8px 8px 8px;
+	-khtml-border-radius: 8px 8px 8px 8px;
+	-moz-border-radius: 8px 8px 8px 8px;
+	border-radius: 8px 8px 8px 8px;
+	box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
+}
+
+.ac {
+	vertical-align: top;
+}
+
+.ac .yui-ac {
+	position: relative;
+	font-size: 100%;
+}
+
+.ac .perm_ac {
+	width: 15em;
+}
+
+.ac .yui-ac-input {
+	width: 100%;
+}
+
+.ac .yui-ac-container {
+	position: absolute;
+	top: 1.6em;
+	width: 100%;
+}
+
+.ac .yui-ac-content {
+	position: absolute;
+	width: 100%;
+	border: 1px solid gray;
+	background: #fff;
+	overflow: hidden;
+	z-index: 9050;
+}
+
+.ac .yui-ac-shadow {
+	position: absolute;
+	width: 100%;
+	background: #000;
+	-moz-opacity: 0.1px;
+	opacity: .10;
+	filter: alpha(opacity =     10);
+	z-index: 9049;
+	margin: .3em;
+}
+
+.ac .yui-ac-content ul {
+	width: 100%;
+	margin: 0;
+	padding: 0;
+}
+
+.ac .yui-ac-content li {
+	cursor: default;
+	white-space: nowrap;
+	margin: 0;
+	padding: 2px 5px;
+}
+
+.ac .yui-ac-content li.yui-ac-prehighlight {
+	background: #B3D4FF;
+}
+
+.ac .yui-ac-content li.yui-ac-highlight {
+	background: #556CB5;
+	color: #FFF;
+}
+
+.follow {
+	background: url("../images/icons/heart_add.png") no-repeat scroll 3px;
+	height: 16px;
+	width: 20px;
+	cursor: pointer;
+	display: block;
+	float: right;
+	margin-top: 2px;
+}
+
+.following {
+	background: url("../images/icons/heart_delete.png") no-repeat scroll 3px;
+	height: 16px;
+	width: 20px;
+	cursor: pointer;
+	display: block;
+	float: right;
+	margin-top: 2px;
+}
+
+.currently_following {
+	padding-left: 10px;
+	padding-bottom: 5px;
+}
+
+.add_icon {
+	background: url("../images/icons/add.png") no-repeat scroll 3px;
+	padding-left: 20px;
+	padding-top: 0px;
+	text-align: left;
+}
+
+.edit_icon {
+	background: url("../images/icons/folder_edit.png") no-repeat scroll 3px;
+	padding-left: 20px;
+	padding-top: 0px;
+	text-align: left;
+}
+
+.delete_icon {
+	background: url("../images/icons/delete.png") no-repeat scroll 3px;
+	padding-left: 20px;
+	padding-top: 0px;
+	text-align: left;
+}
+
+.refresh_icon {
+	background: url("../images/icons/arrow_refresh.png") no-repeat scroll
+		3px;
+	padding-left: 20px;
+	padding-top: 0px;
+	text-align: left;
+}
+
+.pull_icon {
+	background: url("../images/icons/connect.png") no-repeat scroll 3px;
+	padding-left: 20px;
+	padding-top: 0px;
+	text-align: left;
+}
+
+.rss_icon {
+	background: url("../images/icons/rss_16.png") no-repeat scroll 3px;
+	padding-left: 20px;
+	padding-top: 0px;
+	text-align: left;
+}
+
+.atom_icon {
+	background: url("../images/icons/atom.png") no-repeat scroll 3px;
+	padding-left: 20px;
+	padding-top: 0px;
+	text-align: left;
+}
+
+.archive_icon {
+	background: url("../images/icons/compress.png") no-repeat scroll 3px;
+	padding-left: 20px;
+	text-align: left;
+	padding-top: 1px;
+}
+
+.start_following_icon {
+	background: url("../images/icons/heart_add.png") no-repeat scroll 3px;
+	padding-left: 20px;
+	text-align: left;
+	padding-top: 0px;
+}
+
+.stop_following_icon {
+	background: url("../images/icons/heart_delete.png") no-repeat scroll 3px;
+	padding-left: 20px;
+	text-align: left;
+	padding-top: 0px;
+}
+
+.action_button {
+	border: 0;
+	display: inline;
+}
+
+.action_button:hover {
+	border: 0;
+	text-decoration: underline;
+	cursor: pointer;
+}
+
+#switch_repos {
+	position: absolute;
+	height: 25px;
+	z-index: 1;
+}
+
+#switch_repos select {
+	min-width: 150px;
+	max-height: 250px;
+	z-index: 1;
+}
+
+.breadcrumbs {
+	border: medium none;
+	color: #FFF;
+	float: left;
+	text-transform: uppercase;
+	font-weight: 700;
+	font-size: 14px;
+	margin: 0;
+	padding: 11px 0 11px 10px;
+}
+
+.breadcrumbs a {
+	color: #FFF;
+}
+
+.flash_msg {
+	
+}
+
+.flash_msg ul {
+	
+}
+
+.error_msg {
+	background-color: #c43c35;
+	background-repeat: repeat-x;
+	background-image: -khtml-gradient(linear, left top, left bottom, from(#ee5f5b),
+		to(#c43c35) );
+	background-image: -moz-linear-gradient(top, #ee5f5b, #c43c35);
+	background-image: -ms-linear-gradient(top, #ee5f5b, #c43c35);
+	background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #ee5f5b),
+		color-stop(100%, #c43c35) );
+	background-image: -webkit-linear-gradient(top, #ee5f5b, #c43c35);
+	background-image: -o-linear-gradient(top, #ee5f5b, #c43c35);
+	background-image: linear-gradient(top, #ee5f5b, #c43c35);
+	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ee5f5b',
+		endColorstr='#c43c35', GradientType=0 );
+	border-color: #c43c35 #c43c35 #882a25;
+}
+
+.warning_msg {
+	color: #404040 !important;
+	background-color: #eedc94;
+	background-repeat: repeat-x;
+	background-image: -khtml-gradient(linear, left top, left bottom, from(#fceec1),
+		to(#eedc94) );
+	background-image: -moz-linear-gradient(top, #fceec1, #eedc94);
+	background-image: -ms-linear-gradient(top, #fceec1, #eedc94);
+	background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #fceec1),
+		color-stop(100%, #eedc94) );
+	background-image: -webkit-linear-gradient(top, #fceec1, #eedc94);
+	background-image: -o-linear-gradient(top, #fceec1, #eedc94);
+	background-image: linear-gradient(top, #fceec1, #eedc94);
+	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#fceec1',
+		endColorstr='#eedc94', GradientType=0 );
+	border-color: #eedc94 #eedc94 #e4c652;
+}
+
+.success_msg {
+	background-color: #57a957;
+	background-repeat: repeat-x !important;
+	background-image: -khtml-gradient(linear, left top, left bottom, from(#62c462),
+		to(#57a957) );
+	background-image: -moz-linear-gradient(top, #62c462, #57a957);
+	background-image: -ms-linear-gradient(top, #62c462, #57a957);
+	background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #62c462),
+		color-stop(100%, #57a957) );
+	background-image: -webkit-linear-gradient(top, #62c462, #57a957);
+	background-image: -o-linear-gradient(top, #62c462, #57a957);
+	background-image: linear-gradient(top, #62c462, #57a957);
+	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#62c462',
+		endColorstr='#57a957', GradientType=0 );
+	border-color: #57a957 #57a957 #3d773d;
+}
+
+.notice_msg {
+	background-color: #339bb9;
+	background-repeat: repeat-x;
+	background-image: -khtml-gradient(linear, left top, left bottom, from(#5bc0de),
+		to(#339bb9) );
+	background-image: -moz-linear-gradient(top, #5bc0de, #339bb9);
+	background-image: -ms-linear-gradient(top, #5bc0de, #339bb9);
+	background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #5bc0de),
+		color-stop(100%, #339bb9) );
+	background-image: -webkit-linear-gradient(top, #5bc0de, #339bb9);
+	background-image: -o-linear-gradient(top, #5bc0de, #339bb9);
+	background-image: linear-gradient(top, #5bc0de, #339bb9);
+	filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#5bc0de',
+		endColorstr='#339bb9', GradientType=0 );
+	border-color: #339bb9 #339bb9 #22697d;
+}
+
+.success_msg,.error_msg,.notice_msg,.warning_msg {
+	font-size: 12px;
+	font-weight: 700;
+	min-height: 14px;
+	line-height: 14px;
+	margin-bottom: 10px;
+	margin-top: 0;
+	display: block;
+	overflow: auto;
+	padding: 6px 10px 6px 10px;
+	border-color: rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.1) rgba(0, 0, 0, 0.25);
+	position: relative;
+	color: #FFF;
+	border-width: 1px;
+	border-style: solid;
+	-webkit-border-radius: 4px;
+	-moz-border-radius: 4px;
+	border-radius: 4px;
+	-webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+	-moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.25);
+}
+
+#msg_close {
+	background: transparent url("../icons/cross_grey_small.png") no-repeat
+		scroll 0 0;
+	cursor: pointer;
+	height: 16px;
+	position: absolute;
+	right: 5px;
+	top: 5px;
+	width: 16px;
+}
+
+div#legend_container table,div#legend_choices table {
+	width: auto !important;
+}
+
+table#permissions_manage {
+	width: 0 !important;
+}
+
+table#permissions_manage span.private_repo_msg {
+	font-size: 0.8em;
+	opacity: 0.6px;
+}
+
+table#permissions_manage td.private_repo_msg {
+	font-size: 0.8em;
+}
+
+table#permissions_manage tr#add_perm_input td {
+	vertical-align: middle;
+}
+
+div.gravatar {
+	background-color: #FFF;
+	border: 1px solid #D0D0D0;
+	float: left;
+	margin-right: 0.7em;
+	padding: 2px 2px 0;
+	-webkit-border-radius: 6px;
+	-khtml-border-radius: 6px;
+	-moz-border-radius: 6px;
+	border-radius: 6px;
+}
+
+div.gravatar img {
+	-webkit-border-radius: 4px;
+	-khtml-border-radius: 4px;
+	-moz-border-radius: 4px;
+	border-radius: 4px;
+}
+
+#header,#content,#footer {
+	min-width: 978px;
+}
+
+#content {
+	clear: both;
+	overflow: hidden;
+	padding: 14px 10px;
+}
+
+#content div.box div.title div.search {
+	
+	border-left: 1px solid #316293;
+}
+
+#content div.box div.title div.search div.input input {
+	border: 1px solid #316293;
+}
+
+.ui-button-small a:hover {
+	
+}
+
+input.ui-button-small,.ui-button-small {
+	background: #e5e3e3 url("../images/button.png") repeat-x !important;
+	border-top: 1px solid #DDD !important;
+	border-left: 1px solid #c6c6c6 !important;
+	border-right: 1px solid #DDD !important;
+	border-bottom: 1px solid #c6c6c6 !important;
+	color: #515151 !important;
+	outline: none !important;
+	margin: 0 !important;
+	-webkit-border-radius: 4px 4px 4px 4px !important;
+	-khtml-border-radius: 4px 4px 4px 4px !important;
+	-moz-border-radius: 4px 4px 4px 4px !important;
+	border-radius: 4px 4px 4px 4px !important;
+	box-shadow: 0 1px 0 #ececec !important;
+	cursor: pointer !important;
+	padding: 0px 2px 1px 2px;
+}
+
+input.ui-button-small:hover,.ui-button-small:hover {
+	background: #b4b4b4 url("../images/button_selected.png") repeat-x
+		!important;
+	border-top: 1px solid #ccc !important;
+	border-left: 1px solid #bebebe !important;
+	border-right: 1px solid #b1b1b1 !important;
+	border-bottom: 1px solid #afafaf !important;
+	text-decoration: none;
+}
+
+input.ui-button-small-blue,.ui-button-small-blue {
+	background: #4e85bb url("../images/button_highlight.png") repeat-x;
+	border-top: 1px solid #5c91a4;
+	border-left: 1px solid #2a6f89;
+	border-right: 1px solid #2b7089;
+	border-bottom: 1px solid #1a6480;
+	color: #fff;
+	-webkit-border-radius: 4px 4px 4px 4px;
+	-khtml-border-radius: 4px 4px 4px 4px;
+	-moz-border-radius: 4px 4px 4px 4px;
+	border-radius: 4px 4px 4px 4px;
+	box-shadow: 0 1px 0 #ececec;
+	cursor: pointer;
+	padding: 0px 2px 1px 2px;
+}
+
+input.ui-button-small-blue:hover {
+	
+}
+
+ins,div.options a:hover {
+	text-decoration: none;
+}
+
+img,#header #header-inner #quick li a:hover span.normal,#header #header-inner #quick li ul li.last,#content div.box div.form div.fields div.field div.textarea table td table td a,#clone_url
+	{
+	border: none;
+}
+
+img.icon,.right .merge img {
+	vertical-align: bottom;
+}
+
+#header ul#logged-user,#content div.box div.title ul.links,#content div.box div.message div.dismiss,#content div.box div.traffic div.legend ul
+	{
+	float: right;
+	margin: 0;
+	padding: 0;
+}
+
+#header #header-inner #home,#header #header-inner #logo,#content div.box ul.left,#content div.box ol.left,#content div.box div.pagination-left,div#commit_history,div#legend_data,div#legend_container,div#legend_choices
+	{
+	float: left;
+}
+
+#header #header-inner #quick li:hover ul ul,#header #header-inner #quick li:hover ul ul ul,#header #header-inner #quick li:hover ul ul ul ul,#content #left #menu ul.closed,#content #left #menu li ul.collapsed,.yui-tt-shadow
+	{
+	display: none;
+}
+
+#header #header-inner #quick li:hover ul,#header #header-inner #quick li li:hover ul,#header #header-inner #quick li li li:hover ul,#header #header-inner #quick li li li li:hover ul,#content #left #menu ul.opened,#content #left #menu li ul.expanded
+	{
+	display: block;
+}
+
+#content div.graph {
+	padding: 0 10px 10px;
+}
+
+#content div.box div.title ul.links li a:hover,#content div.box div.title ul.links li.ui-tabs-selected a
+	{
+	color: #bfe3ff;
+}
+
+#content div.box ol.lower-roman,#content div.box ol.upper-roman,#content div.box ol.lower-alpha,#content div.box ol.upper-alpha,#content div.box ol.decimal
+	{
+	margin: 10px 24px 10px 44px;
+}
+
+#content div.box div.form,#content div.box div.table,#content div.box div.traffic
+	{
+	clear: both;
+	overflow: hidden;
+	margin: 0;
+	padding: 0 20px 10px;
+}
+
+#content div.box div.form div.fields,#login div.form,#login div.form div.fields,#register div.form,#register div.form div.fields
+	{
+	clear: both;
+	overflow: hidden;
+	margin: 0;
+	padding: 0;
+}
+
+#content div.box div.form div.fields div.field div.label span,#login div.form div.fields div.field div.label span,#register div.form div.fields div.field div.label span
+	{
+	height: 1%;
+	display: block;
+	color: #363636;
+	margin: 0;
+	padding: 2px 0 0;
+}
+
+#content div.box div.form div.fields div.field div.input input.error,#login div.form div.fields div.field div.input input.error,#register div.form div.fields div.field div.input input.error
+	{
+	background: #FBE3E4;
+	border-top: 1px solid #e1b2b3;
+	border-left: 1px solid #e1b2b3;
+	border-right: 1px solid #FBC2C4;
+	border-bottom: 1px solid #FBC2C4;
+}
+
+#content div.box div.form div.fields div.field div.input input.success,#login div.form div.fields div.field div.input input.success,#register div.form div.fields div.field div.input input.success
+	{
+	background: #E6EFC2;
+	border-top: 1px solid #cebb98;
+	border-left: 1px solid #cebb98;
+	border-right: 1px solid #c6d880;
+	border-bottom: 1px solid #c6d880;
+}
+
+#content div.box-left div.form div.fields div.field div.textarea,#content div.box-right div.form div.fields div.field div.textarea,#content div.box div.form div.fields div.field div.select select,#content div.box table th.selected input,#content div.box table td.selected input
+	{
+	margin: 0;
+}
+
+#content div.box-left div.form div.fields div.field div.select,#content div.box-left div.form div.fields div.field div.checkboxes,#content div.box-left div.form div.fields div.field div.radios,#content div.box-right div.form div.fields div.field div.select,#content div.box-right div.form div.fields div.field div.checkboxes,#content div.box-right div.form div.fields div.field div.radios
+	{
+	margin: 0 0 0 0px !important;
+	padding: 0;
+}
+
+#content div.box div.form div.fields div.field div.select,#content div.box div.form div.fields div.field div.checkboxes,#content div.box div.form div.fields div.field div.radios
+	{
+	margin: 0 0 0 200px;
+	padding: 0;
+}
+
+#content div.box div.form div.fields div.field div.select a:hover,#content div.box div.form div.fields div.field div.select a.ui-selectmenu:hover,#content div.box div.action a:hover
+	{
+	color: #000;
+	text-decoration: none;
+}
+
+#content div.box div.form div.fields div.field div.select a.ui-selectmenu-focus,#content div.box div.action a.ui-selectmenu-focus
+	{
+	border: 1px solid #666;
+}
+
+#content div.box div.form div.fields div.field div.checkboxes div.checkbox,#content div.box div.form div.fields div.field div.radios div.radio
+	{
+	clear: both;
+	overflow: hidden;
+	margin: 0;
+	padding: 8px 0 2px;
+}
+
+#content div.box div.form div.fields div.field div.checkboxes div.checkbox input,#content div.box div.form div.fields div.field div.radios div.radio input
+	{
+	float: left;
+	margin: 0;
+}
+
+#content div.box div.form div.fields div.field div.checkboxes div.checkbox label,#content div.box div.form div.fields div.field div.radios div.radio label
+	{
+	height: 1%;
+	display: block;
+	float: left;
+	margin: 2px 0 0 4px;
+}
+
+div.form div.fields div.field div.button input,#content div.box div.form div.fields div.buttons input,div.form div.fields div.buttons input,#content div.box div.action div.button input
+	{
+	color: #000;
+	font-size: 11px;
+	font-weight: 700;
+	margin: 0;
+}
+
+input.ui-button {
+	background: #e5e3e3 url("../images/button.png") repeat-x;
+	border-top: 1px solid #DDD;
+	border-left: 1px solid #c6c6c6;
+	border-right: 1px solid #DDD;
+	border-bottom: 1px solid #c6c6c6;
+	color: #515151 !important;
+	outline: none;
+	margin: 0;
+	padding: 6px 12px;
+	-webkit-border-radius: 4px 4px 4px 4px;
+	-khtml-border-radius: 4px 4px 4px 4px;
+	-moz-border-radius: 4px 4px 4px 4px;
+	border-radius: 4px 4px 4px 4px;
+	box-shadow: 0 1px 0 #ececec;
+	cursor: pointer;
+}
+
+input.ui-button:hover {
+	background: #b4b4b4 url("../images/button_selected.png") repeat-x;
+	border-top: 1px solid #ccc;
+	border-left: 1px solid #bebebe;
+	border-right: 1px solid #b1b1b1;
+	border-bottom: 1px solid #afafaf;
+}
+
+div.form div.fields div.field div.highlight,#content div.box div.form div.fields div.buttons div.highlight
+	{
+	display: inline;
+}
+
+#content div.box div.form div.fields div.buttons,div.form div.fields div.buttons
+	{
+	margin: 10px 0 0 200px;
+	padding: 0;
+}
+
+#content div.box-left div.form div.fields div.buttons,#content div.box-right div.form div.fields div.buttons,div.box-left div.form div.fields div.buttons,div.box-right div.form div.fields div.buttons
+	{
+	margin: 10px 0 0;
+}
+
+#content div.box table td.user,#content div.box table td.address {
+	width: 10%;
+	text-align: center;
+}
+
+#content div.box div.action div.button,#login div.form div.fields div.field div.input div.link,#register div.form div.fields div.field div.input div.link
+	{
+	text-align: right;
+	margin: 6px 0 0;
+	padding: 0;
+}
+
+#content div.box div.action div.button input.ui-state-hover,#login div.form div.fields div.buttons input.ui-state-hover,#register div.form div.fields div.buttons input.ui-state-hover
+	{
+	background: #b4b4b4 url("../images/button_selected.png") repeat-x;
+	border-top: 1px solid #ccc;
+	border-left: 1px solid #bebebe;
+	border-right: 1px solid #b1b1b1;
+	border-bottom: 1px solid #afafaf;
+	color: #515151;
+	margin: 0;
+	padding: 6px 12px;
+}
+
+#content div.box div.pagination div.results,#content div.box div.pagination-wh div.results
+	{
+	text-align: left;
+	float: left;
+	margin: 0;
+	padding: 0;
+}
+
+#content div.box div.pagination div.results span,#content div.box div.pagination-wh div.results span
+	{
+	height: 1%;
+	display: block;
+	float: left;
+	background: #ebebeb url("../images/pager.png") repeat-x;
+	border-top: 1px solid #dedede;
+	border-left: 1px solid #cfcfcf;
+	border-right: 1px solid #c4c4c4;
+	border-bottom: 1px solid #c4c4c4;
+	color: #4A4A4A;
+	font-weight: 700;
+	margin: 0;
+	padding: 6px 8px;
+}
+
+#content div.box div.pagination ul.pager li.disabled,#content div.box div.pagination-wh a.disabled
+	{
+	color: #B4B4B4;
+	padding: 6px;
+}
+
+#login,#register {
+	width: 520px;
+	margin: 10% auto 0;
+	padding: 0;
+}
+
+#login div.color,#register div.color {
+	clear: both;
+	overflow: hidden;
+	background: #FFF;
+	margin: 10px auto 0;
+	padding: 3px 3px 3px 0;
+}
+
+#login div.color a,#register div.color a {
+	width: 20px;
+	height: 20px;
+	display: block;
+	float: left;
+	margin: 0 0 0 3px;
+	padding: 0;
+}
+
+#login div.title h5,#register div.title h5 {
+	color: #fff;
+	margin: 10px;
+	padding: 0;
+}
+
+#login div.form div.fields div.field,#register div.form div.fields div.field
+	{
+	clear: both;
+	overflow: hidden;
+	margin: 0;
+	padding: 0 0 10px;
+}
+
+#login div.form div.fields div.field span.error-message,#register div.form div.fields div.field span.error-message
+	{
+	height: 1%;
+	display: block;
+	color: red;
+	margin: 8px 0 0;
+	padding: 0;
+	max-width: 320px;
+}
+
+#login div.form div.fields div.field div.label label,#register div.form div.fields div.field div.label label
+	{
+	color: #000;
+	font-weight: 700;
+}
+
+#login div.form div.fields div.field div.input,#register div.form div.fields div.field div.input
+	{
+	float: left;
+	margin: 0;
+	padding: 0;
+}
+
+#login div.form div.fields div.field div.checkbox,#register div.form div.fields div.field div.checkbox
+	{
+	margin: 0 0 0 184px;
+	padding: 0;
+}
+
+#login div.form div.fields div.field div.checkbox label,#register div.form div.fields div.field div.checkbox label
+	{
+	color: #565656;
+	font-weight: 700;
+}
+
+#login div.form div.fields div.buttons input,#register div.form div.fields div.buttons input
+	{
+	color: #000;
+	font-size: 1em;
+	font-weight: 700;
+	margin: 0;
+}
+
+#changeset_content .container .wrapper,#graph_content .container .wrapper
+	{
+	width: 600px;
+}
+
+#changeset_content .container .left,#graph_content .container .left {
+	float: left;
+	width: 70%;
+	padding-left: 5px;
+}
+
+#changeset_content .container .left .date,.ac .match {
+	font-weight: 700;
+	padding-top: 5px;
+	padding-bottom: 5px;
+}
+
+div#legend_container table td,div#legend_choices table td {
+	border: none !important;
+	height: 20px !important;
+	padding: 0 !important;
+}
+
+#q_filter {
+	border: 0 none;
+	color: #AAAAAA;
+	margin-bottom: -4px;
+	margin-top: -4px;
+	padding-left: 3px;
+}
+
+#node_filter {
+	border: 0px solid #545454;
+	color: #AAAAAA;
+	padding-left: 3px;
+}
+
+/*README STYLE*/
+
+div.readme {
+	padding:0px;
+}
+
+div.readme h2 {
+    font-weight: normal;
+}
+
+div.readme .readme_box {
+    background-color: #fafafa;
+}
+
+div.readme .readme_box {
 clear:both;
 overflow:hidden;
 margin:0;
 padding:0 20px 10px;
 }
 
-.box .search div.search_path {
-background:none repeat scroll 0 0 #EEE;
-border:1px solid #CCC;
-color:blue;
-margin-bottom:10px;
-padding:10px 0;
-}
-
-.box .search div.search_path div.link {
-font-weight:700;
-margin-left:25px;
-}
-
-.box .search div.search_path div.link a {
-color:#003367;
-cursor:pointer;
-text-decoration:none;
-}
-
-#path_unlock {
-color:red;
-font-size:1.2em;
-padding-left:4px;
-}
-
-.info_box span {
-margin-left:3px;
-margin-right:3px;
-}
-
-.info_box .rev {
-color: #003367;
-font-size: 1.6em;
-font-weight: bold;
-vertical-align: sub;
-}
-
-
-.info_box input#at_rev,.info_box input#size {
-background:#FFF;
-border-top:1px solid #b3b3b3;
-border-left:1px solid #b3b3b3;
-border-right:1px solid #eaeaea;
-border-bottom:1px solid #eaeaea;
-color:#000;
-font-family:Lucida Grande, Verdana, Lucida Sans Regular, Lucida Sans Unicode, Arial, sans-serif;
-font-size:12px;
-margin:0;
-padding:1px 5px 1px;
-}
-
-.info_box input#view {
-text-align:center;
-padding:4px 3px 2px 2px;
-}
-
-.yui-overlay,.yui-panel-container {
-visibility:hidden;
-position:absolute;
-z-index:2;
-}
-
-.yui-tt {
-visibility:hidden;
-position:absolute;
-color:#666;
-background-color:#FFF;
-font-family:arial, helvetica, verdana, sans-serif;
-border:2px solid #003367;
-font:100% sans-serif;
-width:auto;
-opacity:1px;
-padding:8px;
-white-space: pre-wrap;
--webkit-border-radius: 8px 8px 8px 8px;
--khtml-border-radius: 8px 8px 8px 8px; 
--moz-border-radius: 8px 8px 8px 8px;
-border-radius: 8px 8px 8px 8px;
-box-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
-}
-
-.ac {
-vertical-align:top;
-}
-
-.ac .yui-ac {
-position:relative;
-font-family:arial;
-font-size:100%;
-}
-
-.ac .perm_ac {
-width:15em;
-}
-
-.ac .yui-ac-input {
-width:100%;
-}
-
-.ac .yui-ac-container {
-position:absolute;
-top:1.6em;
-width:100%;
-}
-
-.ac .yui-ac-content {
-position:absolute;
-width:100%;
-border:1px solid gray;
-background:#fff;
-overflow:hidden;
-z-index:9050;
-}
-
-.ac .yui-ac-shadow {
-position:absolute;
-width:100%;
-background:#000;
--moz-opacity:0.1px;
-opacity:.10;
-filter:alpha(opacity =   10);
-z-index:9049;
-margin:.3em;
-}
-
-.ac .yui-ac-content ul {
-width:100%;
-margin:0;
-padding:0;
-}
-
-.ac .yui-ac-content li {
-cursor:default;
-white-space:nowrap;
-margin:0;
-padding:2px 5px;
-}
-
-.ac .yui-ac-content li.yui-ac-prehighlight {
-background:#B3D4FF;
-}
-
-.ac .yui-ac-content li.yui-ac-highlight {
-background:#556CB5;
-color:#FFF;
-}
-
-
-.follow{
-background:url("../images/icons/heart_add.png") no-repeat scroll 3px;
-height: 16px;
-width: 20px;
-cursor: pointer;
-display: block;
-float: right;
-margin-top: 2px;
-}
-
-.following{
-background:url("../images/icons/heart_delete.png") no-repeat scroll 3px;
-height: 16px;
-width: 20px;
-cursor: pointer;
-display: block;
-float: right;
-margin-top: 2px;
-}
-
-.currently_following{
-padding-left: 10px;
-padding-bottom:5px;
-}
-
-.add_icon {
-background:url("../images/icons/add.png") no-repeat scroll 3px;
-padding-left:20px;
-padding-top:0px;
-text-align:left;
-}
-
-.edit_icon {
-background:url("../images/icons/folder_edit.png") no-repeat scroll 3px;
-padding-left:20px;
-padding-top:0px;
-text-align:left;
-}
-
-.delete_icon {
-background:url("../images/icons/delete.png") no-repeat scroll 3px;
-padding-left:20px;
-padding-top:0px;
-text-align:left;
-}
-
-.refresh_icon {
-background:url("../images/icons/arrow_refresh.png") no-repeat scroll 3px;
-padding-left:20px;
-padding-top:0px;
-text-align:left;
-}
-
-.pull_icon {
-background:url("../images/icons/connect.png") no-repeat scroll 3px;
-padding-left:20px;
-padding-top:0px;
-text-align:left;
-}
-
-.rss_icon {
-background:url("../images/icons/rss_16.png") no-repeat scroll 3px;
-padding-left:20px;
-padding-top:0px;
-text-align:left;
-}
-
-.atom_icon {
-background:url("../images/icons/atom.png") no-repeat scroll 3px;
-padding-left:20px;
-padding-top:0px;
-text-align:left;
-}
-
-.archive_icon {
-background:url("../images/icons/compress.png") no-repeat scroll 3px;
-padding-left:20px;
-text-align:left;
-padding-top:1px;
-}
-
-.start_following_icon {
-background:url("../images/icons/heart_add.png") no-repeat scroll 3px;
-padding-left:20px;
-text-align:left;
-padding-top:0px;
-}
-
-.stop_following_icon {
-background:url("../images/icons/heart_delete.png") no-repeat scroll 3px;
-padding-left:20px;
-text-align:left;
-padding-top:0px;
-}
-
-.action_button {
-border:0;
-display:inline;
-}
-
-.action_button:hover {
-border:0;
-text-decoration:underline;
-cursor:pointer;
-}
-
-#switch_repos {
-position:absolute;
-height:25px;
-z-index:1;
-}
-
-#switch_repos select {
-min-width:150px;
-max-height:250px;
-z-index:1;
-}
-
-.breadcrumbs {
-border:medium none;
-color:#FFF;
-float:left;
-text-transform:uppercase;
-font-weight:700;
-font-size:14px;
-margin:0;
-padding:11px 0 11px 10px;
-}
-
-.breadcrumbs a {
-color:#FFF;
-}
-
-.flash_msg ul {
-margin:0;
-padding:0 0 10px;
-}
-
-.error_msg {
-background-color:#FFCFCF;
-background-image:url("../images/icons/error_msg.png");
-border:1px solid #FF9595;
-color:#C30;
-}
-
-.warning_msg {
-background-color:#FFFBCC;
-background-image:url("../images/icons/warning_msg.png");
-border:1px solid #FFF35E;
-color:#C69E00;
-}
-
-.success_msg {
-background-color:#D5FFCF;
-background-image:url("../images/icons/success_msg.png");
-border:1px solid #97FF88;
-color:#090;
-}
-
-.notice_msg {
-background-color:#DCE3FF;
-background-image:url("../images/icons/notice_msg.png");
-border:1px solid #93A8FF;
-color:#556CB5;
-}
-
-.success_msg,.error_msg,.notice_msg,.warning_msg {
-background-position:10px center;
-background-repeat:no-repeat;
-font-size:12px;
-font-weight:700;
-min-height:14px;
-line-height:14px;
-margin-bottom:0;
-margin-top:0;
-display:block;
-overflow:auto;
-padding:6px 10px 6px 40px;
-}
-
-#msg_close {
-background:transparent url("../icons/cross_grey_small.png") no-repeat scroll 0 0;
-cursor:pointer;
-height:16px;
-position:absolute;
-right:5px;
-top:5px;
-width:16px;
-}
-
-div#legend_container table,div#legend_choices table {
-width:auto !important;
-}
-
-table#permissions_manage {
-width:0 !important;
-}
-
-table#permissions_manage span.private_repo_msg {
-font-size:0.8em;
-opacity:0.6px;
-}
-
-table#permissions_manage td.private_repo_msg {
-font-size:0.8em;
-}
-
-table#permissions_manage tr#add_perm_input td {
-vertical-align:middle;
-}
-
-div.gravatar {
-background-color:#FFF;
-border:1px solid #D0D0D0;
-float:left;
-margin-right:0.7em;
-padding:2px 2px 0;
-
--webkit-border-radius: 6px;
--khtml-border-radius: 6px; 
--moz-border-radius: 6px;
-border-radius: 6px;
-
-}
-
-div.gravatar img {
--webkit-border-radius: 4px;
--khtml-border-radius: 4px; 
--moz-border-radius: 4px;
-border-radius: 4px;	
-}
-
-#header,#content,#footer {
-min-width:978px;
-}
-
-#content {
-clear:both;
-overflow:hidden;
-padding:14px 10px;
-}
-
-#content div.box div.title div.search {
-background:url("../images/title_link.png") no-repeat top left;
-border-left:1px solid #316293;
-}
-
-#content div.box div.title div.search div.input input {
-border:1px solid #316293;
-}
-
-.ui-button-small a:hover {
-	
-}
-input.ui-button-small,.ui-button-small {
-background:#e5e3e3 url("../images/button.png") repeat-x !important;
-border-top:1px solid #DDD !important;
-border-left:1px solid #c6c6c6 !important;
-border-right:1px solid #DDD !important;
-border-bottom:1px solid #c6c6c6 !important;
-color:#515151 !important;
-outline:none !important;
-margin:0 !important;
--webkit-border-radius: 4px 4px 4px 4px !important;
--khtml-border-radius: 4px 4px 4px 4px !important; 
--moz-border-radius: 4px 4px 4px 4px !important;
-border-radius: 4px 4px 4px 4px !important;
-box-shadow: 0 1px 0 #ececec !important;
-cursor: pointer !important;
-padding:0px 2px 1px 2px;
-}
-
-input.ui-button-small:hover,.ui-button-small:hover {
-background:#b4b4b4 url("../images/button_selected.png") repeat-x !important;
-border-top:1px solid #ccc !important;
-border-left:1px solid #bebebe !important;
-border-right:1px solid #b1b1b1 !important;
-border-bottom:1px solid #afafaf !important;
-text-decoration: none;
-}
-
-input.ui-button-small-blue,.ui-button-small-blue {
-background:#4e85bb url("../images/button_highlight.png") repeat-x;
-border-top:1px solid #5c91a4;
-border-left:1px solid #2a6f89;
-border-right:1px solid #2b7089;
-border-bottom:1px solid #1a6480;
-color:#fff;
--webkit-border-radius: 4px 4px 4px 4px;
--khtml-border-radius: 4px 4px 4px 4px; 
--moz-border-radius: 4px 4px 4px 4px;
-border-radius: 4px 4px 4px 4px;
-box-shadow: 0 1px 0 #ececec;
-cursor: pointer;
-padding:0px 2px 1px 2px;
-}
-
-input.ui-button-small-blue:hover {
-	
-}
-
-
-ins,div.options a:hover {
-text-decoration:none;
-}
-
-img,#header #header-inner #quick li a:hover span.normal,#header #header-inner #quick li ul li.last,#content div.box div.form div.fields div.field div.textarea table td table td a,#clone_url {
-border:none;
-}
-
-img.icon,.right .merge img {
-vertical-align:bottom;
-}
-
-#header ul#logged-user,#content div.box div.title ul.links,#content div.box div.message div.dismiss,#content div.box div.traffic div.legend ul {
-float:right;
-margin:0;
-padding:0;
-}
-
-
-#header #header-inner #home,#header #header-inner #logo,#content div.box ul.left,#content div.box ol.left,#content div.box div.pagination-left,div#commit_history,div#legend_data,div#legend_container,div#legend_choices {
-float:left;
-}
-
-#header #header-inner #quick li:hover ul ul,#header #header-inner #quick li:hover ul ul ul,#header #header-inner #quick li:hover ul ul ul ul,#content #left #menu ul.closed,#content #left #menu li ul.collapsed,.yui-tt-shadow {
-display:none;
-}
-
-#header #header-inner #quick li:hover ul,#header #header-inner #quick li li:hover ul,#header #header-inner #quick li li li:hover ul,#header #header-inner #quick li li li li:hover ul,#content #left #menu ul.opened,#content #left #menu li ul.expanded {
-display:block;
-}
-
-#content div.graph{
-padding:0 10px 10px;
-}
-
-#content div.box div.title ul.links li a:hover,#content div.box div.title ul.links li.ui-tabs-selected a {
-color:#bfe3ff;
-}
-
-#content div.box ol.lower-roman,#content div.box ol.upper-roman,#content div.box ol.lower-alpha,#content div.box ol.upper-alpha,#content div.box ol.decimal {
-margin:10px 24px 10px 44px;
-}
-
-#content div.box div.form,#content div.box div.table,#content div.box div.traffic {
-clear:both;
-overflow:hidden;
-margin:0;
-padding:0 20px 10px;
-}
-
-#content div.box div.form div.fields,#login div.form,#login div.form div.fields,#register div.form,#register div.form div.fields {
-clear:both;
-overflow:hidden;
-margin:0;
-padding:0;
-}
-
-#content div.box div.form div.fields div.field div.label span,#login div.form div.fields div.field div.label span,#register div.form div.fields div.field div.label span {
-height:1%;
-display:block;
-color:#363636;
-margin:0;
-padding:2px 0 0;
-}
-
-#content div.box div.form div.fields div.field div.input input.error,#login div.form div.fields div.field div.input input.error,#register div.form div.fields div.field div.input input.error {
-background:#FBE3E4;
-border-top:1px solid #e1b2b3;
-border-left:1px solid #e1b2b3;
-border-right:1px solid #FBC2C4;
-border-bottom:1px solid #FBC2C4;
-}
-
-#content div.box div.form div.fields div.field div.input input.success,#login div.form div.fields div.field div.input input.success,#register div.form div.fields div.field div.input input.success {
-background:#E6EFC2;
-border-top:1px solid #cebb98;
-border-left:1px solid #cebb98;
-border-right:1px solid #c6d880;
-border-bottom:1px solid #c6d880;
-}
-
-#content div.box-left div.form div.fields div.field div.textarea,#content div.box-right div.form div.fields div.field div.textarea,#content div.box div.form div.fields div.field div.select select,#content div.box table th.selected input,#content div.box table td.selected input {
-margin:0;
-}
-
-#content div.box-left div.form div.fields div.field div.select,#content div.box-left div.form div.fields div.field div.checkboxes,#content div.box-left div.form div.fields div.field div.radios,#content div.box-right div.form div.fields div.field div.select,#content div.box-right div.form div.fields div.field div.checkboxes,#content div.box-right div.form div.fields div.field div.radios{
-margin:0 0 0 0px !important;
-padding:0;
-}
-
-#content div.box div.form div.fields div.field div.select,#content div.box div.form div.fields div.field div.checkboxes,#content div.box div.form div.fields div.field div.radios {
-margin:0 0 0 200px;
-padding:0;
-}
-
-
-#content div.box div.form div.fields div.field div.select a:hover,#content div.box div.form div.fields div.field div.select a.ui-selectmenu:hover,#content div.box div.action a:hover {
-color:#000;
-text-decoration:none;
-}
-
-#content div.box div.form div.fields div.field div.select a.ui-selectmenu-focus,#content div.box div.action a.ui-selectmenu-focus {
-border:1px solid #666;
-}
-
-#content div.box div.form div.fields div.field div.checkboxes div.checkbox,#content div.box div.form div.fields div.field div.radios div.radio {
-clear:both;
-overflow:hidden;
-margin:0;
-padding:8px 0 2px;
-}
-
-#content div.box div.form div.fields div.field div.checkboxes div.checkbox input,#content div.box div.form div.fields div.field div.radios div.radio input {
-float:left;
-margin:0;
-}
-
-#content div.box div.form div.fields div.field div.checkboxes div.checkbox label,#content div.box div.form div.fields div.field div.radios div.radio label {
-height:1%;
-display:block;
-float:left;
-margin:2px 0 0 4px;
-}
-
-div.form div.fields div.field div.button input,#content div.box div.form div.fields div.buttons input,div.form div.fields div.buttons input,#content div.box div.action div.button input {
-color:#000;
-font-family:Lucida Grande, Verdana, Lucida Sans Regular, Lucida Sans Unicode, Arial, sans-serif;
-font-size:11px;
-font-weight:700;
-margin:0;
-}
-
-input.ui-button {
-background:#e5e3e3 url("../images/button.png") repeat-x;
-border-top:1px solid #DDD;
-border-left:1px solid #c6c6c6;
-border-right:1px solid #DDD;
-border-bottom:1px solid #c6c6c6;
-color:#515151 !important;
-outline:none;
-margin:0;
-padding:6px 12px;
--webkit-border-radius: 4px 4px 4px 4px;
--khtml-border-radius: 4px 4px 4px 4px; 
--moz-border-radius: 4px 4px 4px 4px;
-border-radius: 4px 4px 4px 4px;
-box-shadow: 0 1px 0 #ececec;
-cursor: pointer;
-}
-
-input.ui-button:hover {
-background:#b4b4b4 url("../images/button_selected.png") repeat-x;
-border-top:1px solid #ccc;
-border-left:1px solid #bebebe;
-border-right:1px solid #b1b1b1;
-border-bottom:1px solid #afafaf;
-}
-
-div.form div.fields div.field div.highlight,#content div.box div.form div.fields div.buttons div.highlight {
-display:inline;
-}
-
-#content div.box div.form div.fields div.buttons,div.form div.fields div.buttons {
-margin:10px 0 0 200px;
-padding:0;
-}
-
-#content div.box-left div.form div.fields div.buttons,#content div.box-right div.form div.fields div.buttons,div.box-left div.form div.fields div.buttons,div.box-right div.form div.fields div.buttons {
-margin:10px 0 0;
-}
-
-#content div.box table td.user,#content div.box table td.address {
-width:10%;
-text-align:center;
-}
-
-#content div.box div.action div.button,#login div.form div.fields div.field div.input div.link,#register div.form div.fields div.field div.input div.link {
-text-align:right;
-margin:6px 0 0;
-padding:0;
-}
-
-
-#content div.box div.action div.button input.ui-state-hover,#login div.form div.fields div.buttons input.ui-state-hover,#register div.form div.fields div.buttons input.ui-state-hover {
-background:#b4b4b4 url("../images/button_selected.png") repeat-x;
-border-top:1px solid #ccc;
-border-left:1px solid #bebebe;
-border-right:1px solid #b1b1b1;
-border-bottom:1px solid #afafaf;
-color:#515151;
-margin:0;
-padding:6px 12px;
-}
-
-#content div.box div.pagination div.results,#content div.box div.pagination-wh div.results {
-text-align:left;
-float:left;
-margin:0;
-padding:0;
-}
-
-#content div.box div.pagination div.results span,#content div.box div.pagination-wh div.results span {
-height:1%;
-display:block;
-float:left;
-background:#ebebeb url("../images/pager.png") repeat-x;
-border-top:1px solid #dedede;
-border-left:1px solid #cfcfcf;
-border-right:1px solid #c4c4c4;
-border-bottom:1px solid #c4c4c4;
-color:#4A4A4A;
-font-weight:700;
-margin:0;
-padding:6px 8px;
-}
-
-#content div.box div.pagination ul.pager li.disabled,#content div.box div.pagination-wh a.disabled {
-color:#B4B4B4;
-padding:6px;
-}
-
-#login,#register {
-width:520px;
-margin:10% auto 0;
-padding:0;
-}
-
-#login div.color,#register div.color {
-clear:both;
-overflow:hidden;
-background:#FFF;
-margin:10px auto 0;
-padding:3px 3px 3px 0;
-}
-
-#login div.color a,#register div.color a {
-width:20px;
-height:20px;
-display:block;
-float:left;
-margin:0 0 0 3px;
-padding:0;
-}
-
-#login div.title h5,#register div.title h5 {
-color:#fff;
-margin:10px;
-padding:0;
-}
-
-#login div.form div.fields div.field,#register div.form div.fields div.field {
-clear:both;
-overflow:hidden;
-margin:0;
-padding:0 0 10px;
-}
-
-#login div.form div.fields div.field span.error-message,#register div.form div.fields div.field span.error-message {
-height:1%;
-display:block;
-color:red;
-margin:8px 0 0;
-padding:0;
-max-width: 320px;
-}
-
-#login div.form div.fields div.field div.label label,#register div.form div.fields div.field div.label label {
-color:#000;
-font-weight:700;
-}
-
-#login div.form div.fields div.field div.input,#register div.form div.fields div.field div.input {
-float:left;
-margin:0;
-padding:0;
-}
-
-#login div.form div.fields div.field div.checkbox,#register div.form div.fields div.field div.checkbox {
-margin:0 0 0 184px;
-padding:0;
-}
-
-#login div.form div.fields div.field div.checkbox label,#register div.form div.fields div.field div.checkbox label {
-color:#565656;
-font-weight:700;
-}
-
-#login div.form div.fields div.buttons input,#register div.form div.fields div.buttons input {
-color:#000;
-font-size:1em;
-font-weight:700;
-font-family:Verdana, Helvetica, Sans-Serif;
-margin:0;
-}
-
-#changeset_content .container .wrapper,#graph_content .container .wrapper {
-width:600px;
-}
-
-#changeset_content .container .left,#graph_content .container .left {
-float:left;
-width:70%;
-padding-left:5px;
-}
-
-#changeset_content .container .left .date,.ac .match {
-font-weight:700;
-padding-top: 5px;
-padding-bottom:5px;
-}
-
-div#legend_container table td,div#legend_choices table td {
-border:none !important;
-height:20px !important;
-padding:0 !important;
-}
-
-#q_filter{
-border:0 none;
-color:#AAAAAA;
-margin-bottom:-4px;
-margin-top:-4px;
-padding-left:3px;
-}
-
-#node_filter{
-border:0px solid #545454;
-color:#AAAAAA;
-padding-left:3px;
-}
+div.readme .readme_box h1, div.readme .readme_box h2, div.readme .readme_box h3, div.readme .readme_box h4, div.readme .readme_box h5, div.readme .readme_box h6 {
+border-bottom: 0 !important;
+margin: 0 !important;
+padding: 0 !important;
+line-height: 1.5em !important;
+}
+
+
+div.readme .readme_box h1:first-child {
+padding-top: .25em !important;
+}
+
+div.readme .readme_box h2, div.readme .readme_box h3 {
+margin: 1em 0 !important;
+}
+
+div.readme .readme_box h2 {
+margin-top: 1.5em !important;
+border-top: 4px solid #e0e0e0 !important;
+padding-top: .5em !important;
+}
+
+div.readme .readme_box p {
+color: black !important;
+margin: 1em 0 !important;
+line-height: 1.5em !important;
+}
+
+div.readme .readme_box ul {
+list-style: disc !important;
+margin: 1em 0 1em 2em !important;
+}
+
+div.readme .readme_box ol {
+list-style: decimal;
+margin: 1em 0 1em 2em !important;
+}
+
+div.readme .readme_box pre, code {
+font: 12px "Bitstream Vera Sans Mono","Courier",monospace;
+}
+
+div.readme .readme_box code {
+    font-size: 12px !important;
+    background-color: ghostWhite !important;
+    color: #444 !important;
+    padding: 0 .2em !important;
+    border: 1px solid #dedede !important;
+}
+
+div.readme .readme_box pre code {
+padding: 0 !important;
+font-size: 12px !important;
+background-color: #eee !important;
+border: none !important;
+}
+
+div.readme .readme_box pre {
+margin: 1em 0;
+font-size: 12px;
+background-color: #eee;
+border: 1px solid #ddd;
+padding: 5px;
+color: #444;
+overflow: auto;
+-webkit-box-shadow: rgba(0,0,0,0.07) 0 1px 2px inset;
+-webkit-border-radius: 3px;
+-moz-border-radius: 3px;
+border-radius: 3px;
+}
Binary file rhodecode/public/images/button_highlight_selected.png has changed
Binary file rhodecode/public/images/header_inner.png has changed
Binary file rhodecode/public/images/title.png has changed
Binary file rhodecode/public/images/title_link.png has changed
--- a/rhodecode/public/js/codemirror.js	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/public/js/codemirror.js	Sat Oct 29 19:26:43 2011 +0200
@@ -13,32 +13,45 @@
       if (defaults.hasOwnProperty(opt))
         options[opt] = (givenOptions && givenOptions.hasOwnProperty(opt) ? givenOptions : defaults)[opt];
 
-    // The element in which the editor lives. Takes care of scrolling
-    // (if enabled).
-    var wrapper = document.createElement("div");
+    var targetDocument = options["document"];
+    // The element in which the editor lives.
+    var wrapper = targetDocument.createElement("div");
     wrapper.className = "CodeMirror";
     // This mess creates the base DOM structure for the editor.
     wrapper.innerHTML =
-      '<div style="position: relative">' + // Set to the height of the text, causes scrolling
-        '<pre style="position: relative; height: 0; visibility: hidden; overflow: hidden;">' + // To measure line/char size
-           '<span>xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx</span></pre>' +
-        '<div style="position: relative">' + // Moved around its parent to cover visible view
-          '<div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div>' +
-          '<div style="overflow: hidden; position: absolute; width: 0; left: 0">' + // Wraps and hides input textarea
-            '<textarea style="height: 1px; position: absolute; width: 1px;" wrap="off"></textarea></div>' +
-          // Provides positioning relative to (visible) text origin
-          '<div class="CodeMirror-lines"><div style="position: relative">' +
-            '<pre class="CodeMirror-cursor">&#160;</pre>' + // Absolutely positioned blinky cursor
-            '<div></div></div></div></div></div>'; // This DIV contains the actual code
+      '<div style="overflow: hidden; position: relative; width: 1px; height: 0px;">' + // Wraps and hides input textarea
+        '<textarea style="position: absolute; width: 10000px;" wrap="off" ' +
+          'autocorrect="off" autocapitalize="off"></textarea></div>' +
+      '<div class="CodeMirror-scroll cm-s-' + options.theme + '">' +
+        '<div style="position: relative">' + // Set to the height of the text, causes scrolling
+          '<div style="position: absolute; height: 0; width: 0; overflow: hidden;"></div>' +
+          '<div style="position: relative">' + // Moved around its parent to cover visible view
+            '<div class="CodeMirror-gutter"><div class="CodeMirror-gutter-text"></div></div>' +
+            // Provides positioning relative to (visible) text origin
+            '<div class="CodeMirror-lines"><div style="position: relative" draggable="true">' +
+              '<pre class="CodeMirror-cursor">&#160;</pre>' + // Absolutely positioned blinky cursor
+              '<div></div>' + // This DIV contains the actual code
+            '</div></div></div></div></div>';
     if (place.appendChild) place.appendChild(wrapper); else place(wrapper);
     // I've never seen more elegant code in my life.
-    var code = wrapper.firstChild, measure = code.firstChild, mover = measure.nextSibling,
+    var inputDiv = wrapper.firstChild, input = inputDiv.firstChild,
+        scroller = wrapper.lastChild, code = scroller.firstChild,
+        measure = code.firstChild, mover = measure.nextSibling,
         gutter = mover.firstChild, gutterText = gutter.firstChild,
-        inputDiv = gutter.nextSibling, input = inputDiv.firstChild,
-        lineSpace = inputDiv.nextSibling.firstChild, cursor = lineSpace.firstChild, lineDiv = cursor.nextSibling;
+        lineSpace = gutter.nextSibling.firstChild,
+        cursor = lineSpace.firstChild, lineDiv = cursor.nextSibling;
     if (options.tabindex != null) input.tabindex = options.tabindex;
     if (!options.gutter && !options.lineNumbers) gutter.style.display = "none";
 
+    // Check for problem with IE innerHTML not working when we have a
+    // P (or similar) parent node.
+    try { stringWidth("x"); }
+    catch (e) {
+      if (e.message.match(/unknown runtime/i))
+        e = new Error("A CodeMirror inside a P-style element does not work in Internet Explorer. (innerHTML bug)");
+      throw e;
+    }
+
     // Delayed object wrap timeouts, making sure only one is active. blinker holds an interval.
     var poll = new Delayed(), highlight = new Delayed(), blinker;
 
@@ -46,7 +59,7 @@
     // (see Line constructor), work an array of lines that should be
     // parsed, and history the undo history (instance of History
     // constructor).
-    var mode, lines = [new Line("")], work, history = new History(), focused;
+    var mode, lines = [new Line("")], work, focused;
     loadMode();
     // The selection. These are always maintained to point at valid
     // positions. Inverted is used to remember that the user is
@@ -56,10 +69,10 @@
     // whether the user is holding shift. reducedSelection is a hack
     // to get around the fact that we can't create inverted
     // selections. See below.
-    var shiftSelecting, reducedSelection;
+    var shiftSelecting, reducedSelection, lastClick, lastDoubleClick, draggingText;
     // Variables used by startOperation/endOperation to track what
     // happened during the operation.
-    var updateInput, changes, textChanged, selectionChanged, leaveInputAlone;
+    var updateInput, changes, textChanged, selectionChanged, leaveInputAlone, gutterDirty;
     // Current visible range (may be bigger than the view window).
     var showingFrom = 0, showingTo = 0, lastHeight = 0, curKeyId = null;
     // editing will hold an object describing the things we put in the
@@ -67,35 +80,46 @@
     // bracketHighlighted is used to remember that a backet has been
     // marked.
     var editing, bracketHighlighted;
+    // Tracks the maximum line length so that the horizontal scrollbar
+    // can be kept static when scrolling.
+    var maxLine = "", maxWidth;
 
-    // Initialize the content. Somewhat hacky (delayed prepareInput)
-    // to work around browser issues.
+    // Initialize the content.
     operation(function(){setValue(options.value || ""); updateInput = false;})();
-    setTimeout(prepareInput, 20);
+    var history = new History();
 
     // Register our event handlers.
-    connect(wrapper, "mousedown", operation(onMouseDown));
+    connect(scroller, "mousedown", operation(onMouseDown));
+    connect(scroller, "dblclick", operation(onDoubleClick));
+    connect(lineSpace, "dragstart", onDragStart);
     // Gecko browsers fire contextmenu *after* opening the menu, at
     // which point we can't mess with it anymore. Context menu is
     // handled in onMouseDown for Gecko.
-    if (!gecko) connect(wrapper, "contextmenu", operation(onContextMenu));
-    connect(code, "dblclick", operation(onDblClick));
-    connect(wrapper, "scroll", function() {updateDisplay([]); if (options.onScroll) options.onScroll(instance);});
+    if (!gecko) connect(scroller, "contextmenu", onContextMenu);
+    connect(scroller, "scroll", function() {
+      updateDisplay([]);
+      if (options.fixedGutter) gutter.style.left = scroller.scrollLeft + "px";
+      if (options.onScroll) options.onScroll(instance);
+    });
     connect(window, "resize", function() {updateDisplay(true);});
     connect(input, "keyup", operation(onKeyUp));
+    connect(input, "input", function() {fastPoll(curKeyId);});
     connect(input, "keydown", operation(onKeyDown));
     connect(input, "keypress", operation(onKeyPress));
     connect(input, "focus", onFocus);
     connect(input, "blur", onBlur);
 
-    connect(wrapper, "dragenter", function(e){e.stop();});
-    connect(wrapper, "dragover", function(e){e.stop();});
-    connect(wrapper, "drop", operation(onDrop));
-    connect(wrapper, "paste", function(){input.focus(); fastPoll();});
+    connect(scroller, "dragenter", e_stop);
+    connect(scroller, "dragover", e_stop);
+    connect(scroller, "drop", operation(onDrop));
+    connect(scroller, "paste", function(){focusInput(); fastPoll();});
     connect(input, "paste", function(){fastPoll();});
     connect(input, "cut", function(){fastPoll();});
 
-    if (document.activeElement == input) onFocus();
+    // IE throws unspecified error in certain cases, when
+    // trying to access activeElement before onload
+    var hasFocus; try { hasFocus = (targetDocument.activeElement == input); } catch(e) { }
+    if (hasFocus) setTimeout(onFocus, 20);
     else onBlur();
 
     function isLine(l) {return l >= 0 && l < lines.length;}
@@ -104,27 +128,37 @@
     // range checking and/or clipping. operation is used to wrap the
     // call so that changes it makes are tracked, and the display is
     // updated afterwards.
-    var instance = {
+    var instance = wrapper.CodeMirror = {
       getValue: getValue,
       setValue: operation(setValue),
       getSelection: getSelection,
       replaceSelection: operation(replaceSelection),
-      focus: function(){input.focus(); onFocus(); fastPoll();},
+      focus: function(){focusInput(); onFocus(); fastPoll();},
       setOption: function(option, value) {
         options[option] = value;
-        if (option == "lineNumbers" || option == "gutter") gutterChanged();
+        if (option == "lineNumbers" || option == "gutter" || option == "firstLineNumber")
+          operation(gutterChanged)();
         else if (option == "mode" || option == "indentUnit") loadMode();
+        else if (option == "readOnly" && value == "nocursor") input.blur();
+        else if (option == "theme") scroller.className = scroller.className.replace(/cm-s-\w+/, "cm-s-" + value);
       },
       getOption: function(option) {return options[option];},
       undo: operation(undo),
       redo: operation(redo),
-      indentLine: operation(function(n) {if (isLine(n)) indentLine(n, "smart");}),
+      indentLine: operation(function(n, dir) {
+        if (isLine(n)) indentLine(n, dir == null ? "smart" : dir ? "add" : "subtract");
+      }),
       historySize: function() {return {undo: history.done.length, redo: history.undone.length};},
+      clearHistory: function() {history = new History();},
       matchBrackets: operation(function(){matchBrackets(true);}),
       getTokenAt: function(pos) {
         pos = clipPos(pos);
         return lines[pos.line].getTokenAt(mode, getStateBefore(pos.line), pos.ch);
       },
+      getStateAfter: function(line) {
+        line = clipLine(line == null ? lines.length - 1: line);
+        return getStateBefore(line + 1);
+      },
       cursorCoords: function(start){
         if (start == null) start = sel.inverted;
         return pageCoords(start ? sel.from : sel.to);
@@ -132,22 +166,41 @@
       charCoords: function(pos){return pageCoords(clipPos(pos));},
       coordsChar: function(coords) {
         var off = eltOffset(lineSpace);
-        var line = Math.min(showingTo - 1, showingFrom + Math.floor(coords.y / lineHeight()));
-        return clipPos({line: line, ch: charFromX(clipLine(line), coords.x)});
+        var line = clipLine(Math.min(lines.length - 1, showingFrom + Math.floor((coords.y - off.top) / lineHeight())));
+        return clipPos({line: line, ch: charFromX(clipLine(line), coords.x - off.left)});
       },
       getSearchCursor: function(query, pos, caseFold) {return new SearchCursor(query, pos, caseFold);},
-      markText: operation(function(a, b, c){return operation(markText(a, b, c));}),
-      setMarker: addGutterMarker,
-      clearMarker: removeGutterMarker,
+      markText: operation(markText),
+      setMarker: operation(addGutterMarker),
+      clearMarker: operation(removeGutterMarker),
       setLineClass: operation(setLineClass),
       lineInfo: lineInfo,
-      addWidget: function(pos, node, scroll) {
-        var pos = localCoords(clipPos(pos), true);
-        node.style.top = (showingFrom * lineHeight() + pos.yBot + paddingTop()) + "px";
-        node.style.left = (pos.x + paddingLeft()) + "px";
+      addWidget: function(pos, node, scroll, vert, horiz) {
+        pos = localCoords(clipPos(pos));
+        var top = pos.yBot, left = pos.x;
+        node.style.position = "absolute";
         code.appendChild(node);
+        if (vert == "over") top = pos.y;
+        else if (vert == "near") {
+          var vspace = Math.max(scroller.offsetHeight, lines.length * lineHeight()),
+              hspace = Math.max(code.clientWidth, lineSpace.clientWidth) - paddingLeft();
+          if (pos.yBot + node.offsetHeight > vspace && pos.y > node.offsetHeight)
+            top = pos.y - node.offsetHeight;
+          if (left + node.offsetWidth > hspace)
+            left = hspace - node.offsetWidth;
+        }
+        node.style.top = (top + paddingTop()) + "px";
+        node.style.left = node.style.right = "";
+        if (horiz == "right") {
+          left = code.clientWidth - node.offsetWidth;
+          node.style.right = "0px";
+        } else {
+          if (horiz == "left") left = 0;
+          else if (horiz == "middle") left = (code.clientWidth - node.offsetWidth) / 2;
+          node.style.left = (left + paddingLeft()) + "px";
+        }
         if (scroll)
-          scrollIntoView(pos.x, pos.yBot, pos.x + node.offsetWidth, pos.yBot + node.offsetHeight);
+          scrollIntoView(left, top, left + node.offsetWidth, top + node.offsetHeight);
       },
 
       lineCount: function() {return lines.length;},
@@ -171,18 +224,30 @@
       replaceRange: operation(replaceRange),
       getRange: function(from, to) {return getRange(clipPos(from), clipPos(to));},
 
+      coordsFromIndex: function(index) {        
+        var total = lines.length, pos = 0, line, ch, len;
+        
+        for (line = 0; line < total; line++) {
+          len = lines[line].text.length + 1;
+          if (pos + len > index) { ch = index - pos; break; }
+          pos += len;
+        }
+        return clipPos({line: line, ch: ch});
+      },
+
       operation: function(f){return operation(f)();},
       refresh: function(){updateDisplay(true);},
       getInputField: function(){return input;},
-      getWrapperElement: function(){return wrapper;}
+      getWrapperElement: function(){return wrapper;},
+      getScrollerElement: function(){return scroller;},
+      getGutterElement: function(){return gutter;}
     };
 
     function setValue(code) {
-      history = null;
       var top = {line: 0, ch: 0};
       updateLines(top, {line: lines.length - 1, ch: lines[lines.length-1].text.length},
                   splitLines(code), top, top);
-      history = new History();
+      updateInput = true;
     }
     function getValue(code) {
       var text = [];
@@ -192,38 +257,70 @@
     }
 
     function onMouseDown(e) {
+      // Check whether this is a click in a widget
+      for (var n = e_target(e); n != wrapper; n = n.parentNode)
+        if (n.parentNode == code && n != mover) return;
+
       // First, see if this is a click in the gutter
-      for (var n = e.target(); n != wrapper; n = n.parentNode)
+      for (var n = e_target(e); n != wrapper; n = n.parentNode)
         if (n.parentNode == gutterText) {
           if (options.onGutterClick)
-            options.onGutterClick(instance, indexOf(gutterText.childNodes, n) + showingFrom);
-          return e.stop();
+            options.onGutterClick(instance, indexOf(gutterText.childNodes, n) + showingFrom, e);
+          return e_preventDefault(e);
         }
 
-      if (gecko && e.button() == 3) onContextMenu(e);
-      if (e.button() != 1) return;
+      var start = posFromMouse(e);
+
+      switch (e_button(e)) {
+      case 3:
+        if (gecko && !mac) onContextMenu(e);
+        return;
+      case 2:
+        if (start) setCursor(start.line, start.ch, true);
+        return;
+      }
       // For button 1, if it was clicked inside the editor
       // (posFromMouse returning non-null), we have to adjust the
       // selection.
-      var start = posFromMouse(e), last = start, going;
-      if (!start) {if (e.target() == wrapper) e.stop(); return;}
-      setCursor(start.line, start.ch, false);
+      if (!start) {if (e_target(e) == scroller) e_preventDefault(e); return;}
 
       if (!focused) onFocus();
-      e.stop();
-      // And then we have to see if it's a drag event, in which case
-      // the dragged-over text must be selected.
-      function end() {
-        input.focus();
-        updateInput = true;
-        move(); up();
+
+      var now = +new Date;
+      if (lastDoubleClick > now - 400) {
+        e_preventDefault(e);
+        return selectLine(start.line);
+      } else if (lastClick > now - 400) {
+        lastDoubleClick = now;
+        e_preventDefault(e);
+        return selectWordAt(start);
+      } else { lastClick = now; }
+
+      var last = start, going;
+      if (dragAndDrop && !posEq(sel.from, sel.to) &&
+          !posLess(start, sel.from) && !posLess(sel.to, start)) {
+        // Let the drag handler handle this.
+        var up = connect(targetDocument, "mouseup", operation(function(e2) {
+          draggingText = false;
+          up();
+          if (Math.abs(e.clientX - e2.clientX) + Math.abs(e.clientY - e2.clientY) < 10) {
+            e_preventDefault(e2);
+            setCursor(start.line, start.ch, true);
+            focusInput();
+          }
+        }), true);
+        draggingText = true;
+        return;
       }
+      e_preventDefault(e);
+      setCursor(start.line, start.ch, true);
+
       function extend(e) {
         var cur = posFromMouse(e, true);
         if (cur && !posEq(cur, last)) {
           if (!focused) onFocus();
           last = cur;
-          setSelection(start, cur);
+          setSelectionUser(start, cur);
           updateInput = false;
           var visible = visibleLines();
           if (cur.line >= visible.to || cur.line < visible.from)
@@ -231,68 +328,95 @@
         }
       }
 
-      var move = connect(document, "mousemove", operation(function(e) {
+      var move = connect(targetDocument, "mousemove", operation(function(e) {
         clearTimeout(going);
-        e.stop();
+        e_preventDefault(e);
         extend(e);
       }), true);
-      var up = connect(document, "mouseup", operation(function(e) {
+      var up = connect(targetDocument, "mouseup", operation(function(e) {
         clearTimeout(going);
         var cur = posFromMouse(e);
-        if (cur) setSelection(start, cur);
-        e.stop();
-        end();
+        if (cur) setSelectionUser(start, cur);
+        e_preventDefault(e);
+        focusInput();
+        updateInput = true;
+        move(); up();
       }), true);
     }
-    function onDblClick(e) {
-      var pos = posFromMouse(e);
-      if (!pos) return;
-      selectWordAt(pos);
-      e.stop();
+    function onDoubleClick(e) {
+      var start = posFromMouse(e);
+      if (!start) return;
+      lastDoubleClick = +new Date;
+      e_preventDefault(e);
+      selectWordAt(start);
     }
     function onDrop(e) {
-      var pos = posFromMouse(e, true), files = e.e.dataTransfer.files;
+      e.preventDefault();
+      var pos = posFromMouse(e, true), files = e.dataTransfer.files;
       if (!pos || options.readOnly) return;
       if (files && files.length && window.FileReader && window.File) {
-        var n = files.length, text = Array(n), read = 0;
-        for (var i = 0; i < n; ++i) loadFile(files[i], i);
         function loadFile(file, i) {
           var reader = new FileReader;
           reader.onload = function() {
             text[i] = reader.result;
-            if (++read == n) replaceRange(text.join(""), clipPos(pos), clipPos(pos));
+            if (++read == n) {
+	      pos = clipPos(pos);
+	      var end = replaceRange(text.join(""), pos, pos);
+	      setSelectionUser(pos, end);
+	    }
           };
           reader.readAsText(file);
         }
+        var n = files.length, text = Array(n), read = 0;
+        for (var i = 0; i < n; ++i) loadFile(files[i], i);
       }
       else {
         try {
-          var text = e.e.dataTransfer.getData("Text");
-          if (text) replaceRange(text, pos, pos);
+          var text = e.dataTransfer.getData("Text");
+          if (text) {
+	    var end = replaceRange(text, pos, pos);
+	    var curFrom = sel.from, curTo = sel.to;
+	    setSelectionUser(pos, end);
+            if (draggingText) replaceRange("", curFrom, curTo);
+	    focusInput();
+	  }
         }
         catch(e){}
       }
     }
+    function onDragStart(e) {
+      var txt = getSelection();
+      // This will reset escapeElement
+      htmlEscape(txt);
+      e.dataTransfer.setDragImage(escapeElement, 0, 0);
+      e.dataTransfer.setData("Text", txt);
+    }
     function onKeyDown(e) {
       if (!focused) onFocus();
 
-      var code = e.e.keyCode;
+      var code = e.keyCode;
+      // IE does strange things with escape.
+      if (ie && code == 27) { e.returnValue = false; }
       // Tries to detect ctrl on non-mac, cmd on mac.
-      var mod = (mac ? e.e.metaKey : e.e.ctrlKey) && !e.e.altKey, anyMod = e.e.ctrlKey || e.e.altKey || e.e.metaKey;
-      if (code == 16 || e.e.shiftKey) shiftSelecting = shiftSelecting || (sel.inverted ? sel.to : sel.from);
+      var mod = (mac ? e.metaKey : e.ctrlKey) && !e.altKey, anyMod = e.ctrlKey || e.altKey || e.metaKey;
+      if (code == 16 || e.shiftKey) shiftSelecting = shiftSelecting || (sel.inverted ? sel.to : sel.from);
       else shiftSelecting = null;
       // First give onKeyEvent option a chance to handle this.
-      if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e.e))) return;
+      if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return;
 
-      if (code == 33 || code == 34) {scrollPage(code == 34); return e.stop();} // page up/down
-      if (mod && (code == 36 || code == 35)) {scrollEnd(code == 36); return e.stop();} // ctrl-home/end
-      if (mod && code == 65) {selectAll(); return e.stop();} // ctrl-a
+      if (code == 33 || code == 34) {scrollPage(code == 34); return e_preventDefault(e);} // page up/down
+      if (mod && ((code == 36 || code == 35) || // ctrl-home/end
+                  mac && (code == 38 || code == 40))) { // cmd-up/down
+        scrollEnd(code == 36 || code == 38); return e_preventDefault(e);
+      }
+      if (mod && code == 65) {selectAll(); return e_preventDefault(e);} // ctrl-a
       if (!options.readOnly) {
         if (!anyMod && code == 13) {return;} // enter
-        if (!anyMod && code == 9 && handleTab(e.e.shiftKey)) return e.stop(); // tab
-        if (mod && code == 90) {undo(); return e.stop();} // ctrl-z
-        if (mod && ((e.e.shiftKey && code == 90) || code == 89)) {redo(); return e.stop();} // ctrl-shift-z, ctrl-y
+        if (!anyMod && code == 9 && handleTab(e.shiftKey)) return e_preventDefault(e); // tab
+        if (mod && code == 90) {undo(); return e_preventDefault(e);} // ctrl-z
+        if (mod && ((e.shiftKey && code == 90) || code == 89)) {redo(); return e_preventDefault(e);} // ctrl-shift-z, ctrl-y
       }
+      if (code == 36) { if (options.smartHome) { smartHome(); return e_preventDefault(e); } }
 
       // Key id to use in the movementKeys map. We also pass it to
       // fastPoll in order to 'self learn'. We need this because
@@ -300,51 +424,60 @@
       // its start when it is inverted and a movement key is pressed
       // (and later restore it again), shouldn't be used for
       // non-movement keys.
-      curKeyId = (mod ? "c" : "") + code;
-      if (sel.inverted && movementKeys.hasOwnProperty(curKeyId)) {
+      curKeyId = (mod ? "c" : "") + (e.altKey ? "a" : "") + code;
+      if (sel.inverted && movementKeys[curKeyId] === true) {
         var range = selRange(input);
         if (range) {
           reducedSelection = {anchor: range.start};
           setSelRange(input, range.start, range.start);
         }
       }
+      // Don't save the key as a movementkey unless it had a modifier
+      if (!mod && !e.altKey) curKeyId = null;
       fastPoll(curKeyId);
     }
     function onKeyUp(e) {
+      if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return;
       if (reducedSelection) {
         reducedSelection = null;
         updateInput = true;
       }
-      if (e.e.keyCode == 16) shiftSelecting = null;
+      if (e.keyCode == 16) shiftSelecting = null;
     }
     function onKeyPress(e) {
-      if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e.e))) return;
+      if (options.onKeyEvent && options.onKeyEvent(instance, addStop(e))) return;
       if (options.electricChars && mode.electricChars) {
-        var ch = String.fromCharCode(e.e.charCode == null ? e.e.keyCode : e.e.charCode);
+        var ch = String.fromCharCode(e.charCode == null ? e.keyCode : e.charCode);
         if (mode.electricChars.indexOf(ch) > -1)
           setTimeout(operation(function() {indentLine(sel.to.line, "smart");}), 50);
       }
-      var code = e.e.keyCode;
+      var code = e.keyCode;
       // Re-stop tab and enter. Necessary on some browsers.
-      if (code == 13) {handleEnter(); e.stop();}
-      else if (code == 9 && options.tabMode != "default") e.stop();
+      if (code == 13) {if (!options.readOnly) handleEnter(); e_preventDefault(e);}
+      else if (!e.ctrlKey && !e.altKey && !e.metaKey && code == 9 && options.tabMode != "default") e_preventDefault(e);
       else fastPoll(curKeyId);
     }
 
     function onFocus() {
-      if (!focused && options.onFocus) options.onFocus(instance);
-      focused = true;
+      if (options.readOnly == "nocursor") return;
+      if (!focused) {
+        if (options.onFocus) options.onFocus(instance);
+        focused = true;
+        if (wrapper.className.search(/\bCodeMirror-focused\b/) == -1)
+          wrapper.className += " CodeMirror-focused";
+        if (!leaveInputAlone) prepareInput();
+      }
       slowPoll();
-      if (wrapper.className.search(/\bCodeMirror-focused\b/) == -1)
-        wrapper.className += " CodeMirror-focused";
       restartBlink();
     }
     function onBlur() {
-      if (focused && options.onBlur) options.onBlur(instance);
+      if (focused) {
+        if (options.onBlur) options.onBlur(instance);
+        focused = false;
+        wrapper.className = wrapper.className.replace(" CodeMirror-focused", "");
+      }
       clearInterval(blinker);
-      shiftSelecting = null;
-      focused = false;
-      wrapper.className = wrapper.className.replace(" CodeMirror-focused", "");
+      setTimeout(function() {if (!focused) shiftSelecting = null;}, 150);
     }
 
     // Replace the range from from to to by the strings in newText.
@@ -367,12 +500,18 @@
         var pos = clipPos({line: change.start + change.old.length - 1,
                            ch: editEnd(replaced[replaced.length-1], change.old[change.old.length-1])});
         updateLinesNoUndo({line: change.start, ch: 0}, {line: end - 1, ch: lines[end-1].text.length}, change.old, pos, pos);
+        updateInput = true;
       }
     }
     function undo() {unredoHelper(history.done, history.undone);}
     function redo() {unredoHelper(history.undone, history.done);}
 
     function updateLinesNoUndo(from, to, newText, selFrom, selTo) {
+      var recomputeMaxLength = false, maxLineLength = maxLine.length;
+      for (var i = from.line; i <= to.line; ++i) {
+        if (lines[i].text.length == maxLineLength) {recomputeMaxLength = true; break;}
+      }
+
       var nlines = to.line - from.line, firstLine = lines[from.line], lastLine = lines[to.line];
       // First adjust the line structure, taking some care to leave highlighting intact.
       if (firstLine == lastLine) {
@@ -381,24 +520,46 @@
         else {
           lastLine = firstLine.split(to.ch, newText[newText.length-1]);
           var spliceargs = [from.line + 1, nlines];
-          firstLine.replace(from.ch, firstLine.text.length, newText[0]);
-          for (var i = 1, e = newText.length - 1; i < e; ++i) spliceargs.push(new Line(newText[i]));
+          firstLine.replace(from.ch, null, newText[0]);
+          for (var i = 1, e = newText.length - 1; i < e; ++i)
+            spliceargs.push(Line.inheritMarks(newText[i], firstLine));
           spliceargs.push(lastLine);
           lines.splice.apply(lines, spliceargs);
         }
       }
       else if (newText.length == 1) {
-        firstLine.replace(from.ch, firstLine.text.length, newText[0] + lastLine.text.slice(to.ch));
+        firstLine.replace(from.ch, null, newText[0]);
+        lastLine.replace(null, to.ch, "");
+        firstLine.append(lastLine);
         lines.splice(from.line + 1, nlines);
       }
       else {
         var spliceargs = [from.line + 1, nlines - 1];
-        firstLine.replace(from.ch, firstLine.text.length, newText[0]);
-        lastLine.replace(0, to.ch, newText[newText.length-1]);
-        for (var i = 1, e = newText.length - 1; i < e; ++i) spliceargs.push(new Line(newText[i]));
+        firstLine.replace(from.ch, null, newText[0]);
+        lastLine.replace(null, to.ch, newText[newText.length-1]);
+        for (var i = 1, e = newText.length - 1; i < e; ++i)
+          spliceargs.push(Line.inheritMarks(newText[i], firstLine));
         lines.splice.apply(lines, spliceargs);
       }
 
+
+      for (var i = from.line, e = i + newText.length; i < e; ++i) {
+        var l = lines[i].text;
+        if (l.length > maxLineLength) {
+          maxLine = l; maxLineLength = l.length; maxWidth = null;
+          recomputeMaxLength = false;
+        }
+      }
+      if (recomputeMaxLength) {
+        maxLineLength = 0; maxLine = ""; maxWidth = null;
+        for (var i = 0, e = lines.length; i < e; ++i) {
+          var l = lines[i].text;
+          if (l.length > maxLineLength) {
+            maxLineLength = l.length; maxLine = l;
+          }
+        }
+      }
+
       // Add these lines to the work array, so that they will be
       // highlighted. Adjust work lines if lines were added/removed.
       var newWork = [], lendiff = newText.length - nlines - 1;
@@ -407,12 +568,17 @@
         if (task < from.line) newWork.push(task);
         else if (task > to.line) newWork.push(task + lendiff);
       }
-      if (newText.length) newWork.push(from.line);
+      if (newText.length < 5) {
+        highlightLines(from.line, from.line + newText.length);
+        newWork.push(from.line + newText.length);
+      } else {
+        newWork.push(from.line);
+      }
       work = newWork;
       startWorker(100);
       // Remember that these lines changed, for updating the display
       changes.push({from: from.line, to: to.line + 1, diff: lendiff});
-      textChanged = true;
+      textChanged = {from: from, to: to, text: newText};
 
       // Update the selection
       function updateLine(n) {return n <= Math.min(to.line, to.line + lendiff) ? n : n + lendiff;}
@@ -483,7 +649,10 @@
       function p() {
         startOperation();
         var changed = readInput();
-        if (changed == "moved" && keyId) movementKeys[keyId] = true;
+        if (changed && keyId) {
+          if (changed == "moved" && movementKeys[keyId] == null) movementKeys[keyId] = true;
+          if (changed == "changed") movementKeys[keyId] = false;
+        }
         if (!changed && !missed) {missed = true; poll.set(80, p);}
         else {pollingFast = false; slowPoll();}
         endOperation();
@@ -495,13 +664,12 @@
     // to the data in the editing variable, and updates the editor
     // content or cursor if something changed.
     function readInput() {
+      if (leaveInputAlone || !focused) return;
       var changed = false, text = input.value, sr = selRange(input);
       if (!sr) return false;
       var changed = editing.text != text, rs = reducedSelection;
       var moved = changed || sr.start != editing.start || sr.end != (rs ? editing.start : editing.end);
-      if (reducedSelection && !moved && sel.from.line == 0 && sel.from.ch == 0)
-        reducedSelection = null;
-      else if (!moved) return false;
+      if (!moved && !rs) return false;
       if (changed) {
         shiftSelecting = reducedSelection = null;
         if (options.readOnly) {updateInput = true; return "changed";}
@@ -524,13 +692,10 @@
       // so that you can, for example, press shift-up at the start of
       // your selection and have the right thing happen.
       if (rs) {
-        from = sr.start == rs.anchor ? to : from;
-        to = shiftSelecting ? sel.to : sr.start == rs.anchor ? from : to;
-        if (!posLess(from, to)) {
-          reducedSelection = null;
-          sel.inverted = false;
-          var tmp = from; from = to; to = tmp;
-        }
+        var head = sr.start == rs.anchor ? to : from;
+        var tail = shiftSelecting ? sel.to : sr.start == rs.anchor ? from : to;
+        if (sel.inverted = posLess(head, tail)) { from = head; to = tail; }
+        else { reducedSelection = null; from = tail; to = head; }
       }
 
       // In some cases (cursor on same line as before), we don't have
@@ -550,8 +715,8 @@
         var ch = nl > -1 ? start - nl : start, endline = editing.to - 1, edend = editing.text.length;
         for (;;) {
           c = editing.text.charAt(edend);
+          if (text.charAt(end) != c) {++end; ++edend; break;}
           if (c == "\n") endline--;
-          if (text.charAt(end) != c) {++end; ++edend; break;}
           if (edend <= start || end <= start) break;
           --end; --edend;
         }
@@ -580,22 +745,36 @@
       editing = {text: text, from: from, to: to, start: startch, end: endch};
       setSelRange(input, startch, reducedSelection ? startch : endch);
     }
+    function focusInput() {
+      if (options.readOnly != "nocursor") input.focus();
+    }
 
+    function scrollEditorIntoView() {
+      if (!cursor.getBoundingClientRect) return;
+      var rect = cursor.getBoundingClientRect();
+      var winH = window.innerHeight || Math.max(document.body.offsetHeight, document.documentElement.offsetHeight);
+      if (rect.top < 0 || rect.bottom > winH) cursor.scrollIntoView();
+    }
     function scrollCursorIntoView() {
       var cursor = localCoords(sel.inverted ? sel.from : sel.to);
       return scrollIntoView(cursor.x, cursor.y, cursor.x, cursor.yBot);
     }
     function scrollIntoView(x1, y1, x2, y2) {
-      var pl = paddingLeft(), pt = paddingTop();
+      var pl = paddingLeft(), pt = paddingTop(), lh = lineHeight();
       y1 += pt; y2 += pt; x1 += pl; x2 += pl;
-      var screen = wrapper.clientHeight, screentop = wrapper.scrollTop, scrolled = false, result = true;
-      if (y1 < screentop) {wrapper.scrollTop = Math.max(0, y1 - 10); scrolled = true;}
-      else if (y2 > screentop + screen) {wrapper.scrollTop = y2 + 10 - screen; scrolled = true;}
+      var screen = scroller.clientHeight, screentop = scroller.scrollTop, scrolled = false, result = true;
+      if (y1 < screentop) {scroller.scrollTop = Math.max(0, y1 - 2*lh); scrolled = true;}
+      else if (y2 > screentop + screen) {scroller.scrollTop = y2 + lh - screen; scrolled = true;}
 
-      var screenw = wrapper.clientWidth, screenleft = wrapper.scrollLeft;
-      if (x1 < screenleft) {wrapper.scrollLeft = Math.max(0, x1 - 10); scrolled = true;}
+      var screenw = scroller.clientWidth, screenleft = scroller.scrollLeft;
+      var gutterw = options.fixedGutter ? gutter.clientWidth : 0;
+      if (x1 < screenleft + gutterw) {
+        if (x1 < 50) x1 = 0;
+        scroller.scrollLeft = Math.max(0, x1 - 10 - gutterw);
+        scrolled = true;
+      }
       else if (x2 > screenw + screenleft) {
-        wrapper.scrollLeft = x2 + 10 - screenw;
+        scroller.scrollLeft = x2 + 10 - screenw;
         scrolled = true;
         if (x2 > code.clientWidth) result = false;
       }
@@ -604,15 +783,15 @@
     }
 
     function visibleLines() {
-      var lh = lineHeight(), top = wrapper.scrollTop - paddingTop();
+      var lh = lineHeight(), top = scroller.scrollTop - paddingTop();
       return {from: Math.min(lines.length, Math.max(0, Math.floor(top / lh))),
-              to: Math.min(lines.length, Math.ceil((top + wrapper.clientHeight) / lh))};
+              to: Math.min(lines.length, Math.ceil((top + scroller.clientHeight) / lh))};
     }
     // Uses a set of changes plus the current scroll position to
     // determine which DOM updates have to be made, and makes the
     // updates.
     function updateDisplay(changes) {
-      if (!wrapper.clientWidth) {
+      if (!scroller.clientWidth) {
         showingFrom = showingTo = 0;
         return;
       }
@@ -629,7 +808,7 @@
             intact2.push(range);
           else {
             if (change.from > range.from)
-              intact2.push({from: range.from, to: change.from, domStart: range.domStart})
+              intact2.push({from: range.from, to: change.from, domStart: range.domStart});
             if (change.to < range.to)
               intact2.push({from: change.to + diff, to: range.to + diff,
                             domStart: range.domStart + (change.to - range.from)});
@@ -659,6 +838,7 @@
       if (domPos != domEnd || pos != to) {
         changedLines += Math.abs(to - pos);
         updates.push({from: pos, to: to, domSize: domEnd - domPos, domStart: domPos});
+        if (to - pos != domEnd - domPos) gutterDirty = true;
       }
 
       if (!updates.length) return;
@@ -674,13 +854,23 @@
 
       // Position the mover div to align with the lines it's supposed
       // to be showing (which will cover the visible display)
-      var different = from != showingFrom || to != showingTo || lastHeight != wrapper.clientHeight;
+      var different = from != showingFrom || to != showingTo || lastHeight != scroller.clientHeight;
       showingFrom = from; showingTo = to;
       mover.style.top = (from * lineHeight()) + "px";
       if (different) {
-        lastHeight = wrapper.clientHeight;
+        lastHeight = scroller.clientHeight;
         code.style.height = (lines.length * lineHeight() + 2 * paddingTop()) + "px";
-        updateGutter();
+      }
+      if (different || gutterDirty) updateGutter();
+
+      if (maxWidth == null) maxWidth = stringWidth(maxLine);
+      if (maxWidth > scroller.clientWidth) {
+        lineSpace.style.width = maxWidth + "px";
+        // Needed to prevent odd wrapping/hiding of widgets placed in here.
+        code.style.width = "";
+        code.style.width = scroller.scrollWidth + "px";
+      } else {
+        lineSpace.style.width = code.style.width = "";
       }
 
       // Since this is all rather error prone, it is honoured with the
@@ -712,7 +902,7 @@
       // there .innerHTML on PRE nodes is dumb, and discards
       // whitespace.
       var sfrom = sel.from.line, sto = sel.to.line, off = 0,
-          scratch = badInnerHTML && document.createElement("div");
+          scratch = badInnerHTML && targetDocument.createElement("div");
       for (var i = 0, e = updates.length; i < e; ++i) {
         var rec = updates[i];
         var extra = (rec.to - rec.from) - rec.domSize;
@@ -722,7 +912,7 @@
             lineDiv.removeChild(nodeAfter ? nodeAfter.previousSibling : lineDiv.lastChild);
         else if (extra) {
           for (var j = Math.max(0, extra); j > 0; --j)
-            lineDiv.insertBefore(document.createElement("pre"), nodeAfter);
+            lineDiv.insertBefore(targetDocument.createElement("pre"), nodeAfter);
           for (var j = Math.max(0, -extra); j > 0; --j)
             lineDiv.removeChild(nodeAfter ? nodeAfter.previousSibling : lineDiv.lastChild);
         }
@@ -753,10 +943,10 @@
 
     function updateGutter() {
       if (!options.gutter && !options.lineNumbers) return;
-      var hText = mover.offsetHeight, hEditor = wrapper.clientHeight;
+      var hText = mover.offsetHeight, hEditor = scroller.clientHeight;
       gutter.style.height = (hText - hEditor < 2 ? hEditor : hText) + "px";
       var html = [];
-      for (var i = showingFrom; i < showingTo; ++i) {
+      for (var i = showingFrom; i < Math.max(showingTo, showingFrom + 1); ++i) {
         var marker = lines[i].gutterMarker;
         var text = options.lineNumbers ? i + options.firstLineNumber : null;
         if (marker && marker.text)
@@ -769,37 +959,43 @@
       gutterText.innerHTML = html.join("");
       var minwidth = String(lines.length).length, firstNode = gutterText.firstChild, val = eltText(firstNode), pad = "";
       while (val.length + pad.length < minwidth) pad += "\u00a0";
-      if (pad) firstNode.insertBefore(document.createTextNode(pad), firstNode.firstChild);
+      if (pad) firstNode.insertBefore(targetDocument.createTextNode(pad), firstNode.firstChild);
       gutter.style.display = "";
       lineSpace.style.marginLeft = gutter.offsetWidth + "px";
+      gutterDirty = false;
     }
     function updateCursor() {
-      var head = sel.inverted ? sel.from : sel.to;
-      var x = charX(head.line, head.ch) + "px", y = (head.line - showingFrom) * lineHeight() + "px";
-      inputDiv.style.top = y; inputDiv.style.left = x;
+      var head = sel.inverted ? sel.from : sel.to, lh = lineHeight();
+      var x = charX(head.line, head.ch);
+      var top = head.line * lh - scroller.scrollTop;
+      inputDiv.style.top = Math.max(Math.min(top, scroller.offsetHeight), 0) + "px";
+      inputDiv.style.left = (x - scroller.scrollLeft) + "px";
       if (posEq(sel.from, sel.to)) {
-        cursor.style.top = y; cursor.style.left = x;
+        cursor.style.top = (head.line - showingFrom) * lh + "px";
+        cursor.style.left = x + "px";
         cursor.style.display = "";
       }
       else cursor.style.display = "none";
     }
 
+    function setSelectionUser(from, to) {
+      var sh = shiftSelecting && clipPos(shiftSelecting);
+      if (sh) {
+        if (posLess(sh, from)) from = sh;
+        else if (posLess(to, sh)) to = sh;
+      }
+      setSelection(from, to);
+    }
     // Update the selection. Last two args are only used by
     // updateLines, since they have to be expressed in the line
     // numbers before the update.
     function setSelection(from, to, oldFrom, oldTo) {
       if (posEq(sel.from, from) && posEq(sel.to, to)) return;
-      var sh = shiftSelecting && clipPos(shiftSelecting);
       if (posLess(to, from)) {var tmp = to; to = from; from = tmp;}
-      if (sh) {
-        if (posLess(sh, from)) from = sh;
-        else if (posLess(to, sh)) to = sh;
-      }
 
-      var startEq = posEq(sel.to, to), endEq = posEq(sel.from, from);
       if (posEq(from, to)) sel.inverted = false;
-      else if (startEq && !endEq) sel.inverted = true;
-      else if (endEq && !startEq) sel.inverted = false;
+      else if (posEq(from, sel.to)) sel.inverted = false;
+      else if (posEq(to, sel.from)) sel.inverted = true;
 
       // Some ugly logic used to only mark the lines that actually did
       // see a change in selection as changed, rather than the whole
@@ -829,9 +1025,9 @@
       sel.from = from; sel.to = to;
       selectionChanged = true;
     }
-    function setCursor(line, ch) {
+    function setCursor(line, ch, user) {
       var pos = clipPos({line: line, ch: ch || 0});
-      setSelection(pos, pos);
+      (user ? setSelectionUser : setSelection)(pos, pos);
     }
 
     function clipLine(n) {return Math.max(0, Math.min(n, lines.length-1));}
@@ -845,11 +1041,12 @@
     }
 
     function scrollPage(down) {
-      var linesPerPage = Math.floor(wrapper.clientHeight / lineHeight()), head = sel.inverted ? sel.from : sel.to;
-      setCursor(head.line + (Math.max(linesPerPage - 1, 1) * (down ? 1 : -1)), head.ch);
+      var linesPerPage = Math.floor(scroller.clientHeight / lineHeight()), head = sel.inverted ? sel.from : sel.to;
+      setCursor(head.line + (Math.max(linesPerPage - 1, 1) * (down ? 1 : -1)), head.ch, true);
     }
     function scrollEnd(top) {
-      setCursor(top ? 0 : lines.length - 1);
+      var pos = top ? {line: 0, ch: 0} : {line: lines.length - 1, ch: lines[lines.length-1].text.length};
+      setSelectionUser(pos, pos);
     }
     function selectAll() {
       var endLine = lines.length - 1;
@@ -859,8 +1056,11 @@
       var line = lines[pos.line].text;
       var start = pos.ch, end = pos.ch;
       while (start > 0 && /\w/.test(line.charAt(start - 1))) --start;
-      while (end < line.length - 1 && /\w/.test(line.charAt(end))) ++end;
-      setSelection({line: pos.line, ch: start}, {line: pos.line, ch: end});
+      while (end < line.length && /\w/.test(line.charAt(end))) ++end;
+      setSelectionUser({line: pos.line, ch: start}, {line: pos.line, ch: end});
+    }
+    function selectLine(line) {
+      setSelectionUser({line: line, ch: 0}, {line: line, ch: lines[line].text.length});
     }
     function handleEnter() {
       replaceSelection("\n", "end");
@@ -868,12 +1068,17 @@
         indentLine(sel.from.line, options.enterMode == "keep" ? "prev" : "smart");
     }
     function handleTab(shift) {
+      function indentSelected(mode) {
+        if (posEq(sel.from, sel.to)) return indentLine(sel.from.line, mode);
+        var e = sel.to.line - (sel.to.ch ? 0 : 1);
+        for (var i = sel.from.line; i <= e; ++i) indentLine(i, mode);
+      }
       shiftSelecting = null;
       switch (options.tabMode) {
       case "default":
         return false;
       case "indent":
-        for (var i = sel.from.line, e = sel.to.line; i <= e; ++i) indentLine(i, "smart");
+        indentSelected("smart");
         break;
       case "classic":
         if (posEq(sel.from, sel.to)) {
@@ -882,11 +1087,15 @@
           break;
         }
       case "shift":
-        for (var i = sel.from.line, e = sel.to.line; i <= e; ++i) indentLine(i, shift ? "subtract" : "add");
+        indentSelected(shift ? "subtract" : "add");
         break;
       }
       return true;
     }
+    function smartHome() {
+      var firstNonWS = Math.max(0, lines[sel.from.line].text.search(/\S/));
+      setCursor(sel.from.line, sel.from.ch <= firstNonWS && sel.from.ch ? 0 : firstNonWS, true);
+    }
 
     function indentLine(n, how) {
       if (how == "smart") {
@@ -924,21 +1133,20 @@
       for (var i = 0, l = lines.length; i < l; ++i)
         lines[i].stateAfter = null;
       work = [0];
+      startWorker();
     }
     function gutterChanged() {
       var visible = options.gutter || options.lineNumbers;
       gutter.style.display = visible ? "" : "none";
-      if (visible) updateGutter();
+      if (visible) gutterDirty = true;
       else lineDiv.parentNode.style.marginLeft = 0;
     }
 
     function markText(from, to, className) {
       from = clipPos(from); to = clipPos(to);
-      var accum = [];
+      var set = [];
       function add(line, from, to, className) {
-        var line = lines[line], mark = line.addMark(from, to, className);
-        mark.line = line;
-        accum.push(mark);
+        mark = lines[line].addMark(from, to, className, set);
       }
       if (from.line == to.line) add(from.line, from.ch, to.ch, className);
       else {
@@ -948,30 +1156,51 @@
         add(to.line, 0, to.ch, className);
       }
       changes.push({from: from.line, to: to.line + 1});
-      return function() {
-        var start, end;
-        for (var i = 0; i < accum.length; ++i) {
-          var mark = accum[i], found = indexOf(lines, mark.line);
-          mark.line.removeMark(mark);
-          if (found > -1) {
-            if (start == null) start = found;
-            end = found;
+      return new TextMarker(set);
+    }
+
+    function TextMarker(set) { this.set = set; }
+    TextMarker.prototype.clear = operation(function() {
+      for (var i = 0, e = this.set.length; i < e; ++i) {
+        var mk = this.set[i].marked;
+        for (var j = 0; j < mk.length; ++j) {
+          if (mk[j].set == this.set) mk.splice(j--, 1);
+        }
+      }
+      // We don't know the exact lines that changed. Refreshing is
+      // cheaper than finding them.
+      changes.push({from: 0, to: lines.length});
+    });
+    TextMarker.prototype.find = function() {
+      var from, to;
+      for (var i = 0, e = this.set.length; i < e; ++i) {
+        var line = this.set[i], mk = line.marked;
+        for (var j = 0; j < mk.length; ++j) {
+          var mark = mk[j];
+          if (mark.set == this.set) {
+            if (mark.from != null || mark.to != null) {
+              var found = indexOf(lines, line);
+              if (found > -1) {
+                if (mark.from != null) from = {line: found, ch: mark.from};
+                if (mark.to != null) to = {line: found, ch: mark.to};
+              }
+            }
           }
         }
-        if (start != null) changes.push({from: start, to: end + 1});
-      };
-    }
+      }
+      return {from: from, to: to};
+    };
 
     function addGutterMarker(line, text, className) {
       if (typeof line == "number") line = lines[clipLine(line)];
       line.gutterMarker = {text: text, style: className};
-      updateGutter();
+      gutterDirty = true;
       return line;
     }
     function removeGutterMarker(line) {
       if (typeof line == "number") line = lines[clipLine(line)];
       line.gutterMarker = null;
-      updateGutter();
+      gutterDirty = true;
     }
     function setLineClass(line, className) {
       if (typeof line == "number") {
@@ -982,8 +1211,10 @@
         var no = indexOf(lines, line);
         if (no == -1) return null;
       }
-      line.className = className;
-      changes.push({from: no, to: no + 1});
+      if (line.className != className) {
+        line.className = className;
+        changes.push({from: no, to: no + 1});
+      }
       return line;
     }
 
@@ -1001,35 +1232,44 @@
       return {line: n, text: line.text, markerText: marker && marker.text, markerClass: marker && marker.style};
     }
 
+    function stringWidth(str) {
+      measure.innerHTML = "<pre><span>x</span></pre>";
+      measure.firstChild.firstChild.firstChild.nodeValue = str;
+      return measure.firstChild.firstChild.offsetWidth || 10;
+    }
     // These are used to go from pixel positions to character
-    // positions, taking tabs into account.
+    // positions, taking varying character widths into account.
     function charX(line, pos) {
-      var text = lines[line].text, span = measure.firstChild;
-      if (text.lastIndexOf("\t", pos) == -1) return pos * charWidth();
-      var old = span.firstChild.nodeValue;
-      try {
-        span.firstChild.nodeValue = text.slice(0, pos);
-        return span.offsetWidth;
-      } finally {span.firstChild.nodeValue = old;}
+      if (pos == 0) return 0;
+      measure.innerHTML = "<pre><span>" + lines[line].getHTML(null, null, false, pos) + "</span></pre>";
+      return measure.firstChild.firstChild.offsetWidth;
     }
     function charFromX(line, x) {
-      var text = lines[line].text, cw = charWidth();
       if (x <= 0) return 0;
-      if (text.indexOf("\t") == -1) return Math.min(text.length, Math.round(x / cw));
-      var mspan = measure.firstChild, mtext = mspan.firstChild, old = mtext.nodeValue;
-      try {
-        mtext.nodeValue = text;
-        var from = 0, fromX = 0, to = text.length, toX = mspan.offsetWidth;
-        if (x > toX) return to;
-        for (;;) {
-          if (to - from <= 1) return (toX - x > x - fromX) ? from : to;
-          var middle = Math.ceil((from + to) / 2);
-          mtext.nodeValue = text.slice(0, middle);
-          var curX = mspan.offsetWidth;
-          if (curX > x) {to = middle; toX = curX;}
-          else {from = middle; fromX = curX;}
-        }
-      } finally {mtext.nodeValue = old;}
+      var lineObj = lines[line], text = lineObj.text;
+      function getX(len) {
+        measure.innerHTML = "<pre><span>" + lineObj.getHTML(null, null, false, len) + "</span></pre>";
+        return measure.firstChild.firstChild.offsetWidth;
+      }
+      var from = 0, fromX = 0, to = text.length, toX;
+      // Guess a suitable upper bound for our search.
+      var estimated = Math.min(to, Math.ceil(x / stringWidth("x")));
+      for (;;) {
+        var estX = getX(estimated);
+        if (estX <= x && estimated < to) estimated = Math.min(to, Math.ceil(estimated * 1.2));
+        else {toX = estX; to = estimated; break;}
+      }
+      if (x > toX) return to;
+      // Try to guess a suitable lower bound as well.
+      estimated = Math.floor(to * 0.8); estX = getX(estimated);
+      if (estX < x) {from = estimated; fromX = estX;}
+      // Do a binary search between these bounds.
+      for (;;) {
+        if (to - from <= 1) return (toX - x > x - fromX) ? from : to;
+        var middle = Math.ceil((from + to) / 2), middleX = getX(middle);
+        if (middleX > x) {to = middle; toX = middleX;}
+        else {from = middle; fromX = middleX;}
+      }
     }
 
     function localCoords(pos, inLineWrap) {
@@ -1043,45 +1283,61 @@
 
     function lineHeight() {
       var nlines = lineDiv.childNodes.length;
-      if (nlines) return lineDiv.offsetHeight / nlines;
-      else return measure.firstChild.offsetHeight || 1;
+      if (nlines) return (lineDiv.offsetHeight / nlines) || 1;
+      measure.innerHTML = "<pre>x</pre>";
+      return measure.firstChild.offsetHeight || 1;
     }
-    function charWidth() {return (measure.firstChild.offsetWidth || 320) / 40;}
     function paddingTop() {return lineSpace.offsetTop;}
     function paddingLeft() {return lineSpace.offsetLeft;}
 
     function posFromMouse(e, liberal) {
-      var off = eltOffset(lineSpace),
-          x = e.pageX() - off.left,
-          y = e.pageY() - off.top;
-      if (!liberal && e.target() != lineSpace.parentNode && !(e.target() == wrapper && y > (lines.length * lineHeight())))
-        for (var n = e.target(); n != lineDiv && n != cursor; n = n.parentNode)
-          if (!n || n == wrapper) return null;
-      var line = showingFrom + Math.floor(y / lineHeight());
-      return clipPos({line: line, ch: charFromX(clipLine(line), x)});
+      var offW = eltOffset(scroller, true), x, y;
+      // Fails unpredictably on IE[67] when mouse is dragged around quickly.
+      try { x = e.clientX; y = e.clientY; } catch (e) { return null; }
+      // This is a mess of a heuristic to try and determine whether a
+      // scroll-bar was clicked or not, and to return null if one was
+      // (and !liberal).
+      if (!liberal && (x - offW.left > scroller.clientWidth || y - offW.top > scroller.clientHeight))
+        return null;
+      var offL = eltOffset(lineSpace, true);
+      var line = showingFrom + Math.floor((y - offL.top) / lineHeight());
+      return clipPos({line: line, ch: charFromX(clipLine(line), x - offL.left)});
     }
     function onContextMenu(e) {
       var pos = posFromMouse(e);
       if (!pos || window.opera) return; // Opera is difficult.
       if (posEq(sel.from, sel.to) || posLess(pos, sel.from) || !posLess(pos, sel.to))
-        setCursor(pos.line, pos.ch);
+        operation(setCursor)(pos.line, pos.ch);
 
       var oldCSS = input.style.cssText;
-      input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.pageY() - 1) +
-        "px; left: " + (e.pageX() - 1) + "px; z-index: 1000; background: white; " +
-        "border-width: 0; outline: none; overflow: hidden;";
+      inputDiv.style.position = "absolute";
+      input.style.cssText = "position: fixed; width: 30px; height: 30px; top: " + (e.clientY - 5) +
+        "px; left: " + (e.clientX - 5) + "px; z-index: 1000; background: white; " +
+        "border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";
+      leaveInputAlone = true;
       var val = input.value = getSelection();
-      input.focus();
-      setSelRange(input, 0, val.length);
-      if (gecko) e.stop();
-      leaveInputAlone = true;
-      setTimeout(function() {
-        if (input.value != val) operation(replaceSelection)(input.value, "end");
+      focusInput();
+      setSelRange(input, 0, input.value.length);
+      function rehide() {
+        var newVal = splitLines(input.value).join("\n");
+        if (newVal != val) operation(replaceSelection)(newVal, "end");
+        inputDiv.style.position = "relative";
         input.style.cssText = oldCSS;
         leaveInputAlone = false;
         prepareInput();
         slowPoll();
-      }, 50);
+      }
+
+      if (gecko) {
+        e_stop(e);
+        var mouseup = connect(window, "mouseup", function() {
+          mouseup();
+          setTimeout(rehide, 20);
+        }, true);
+      }
+      else {
+        setTimeout(rehide, 50);
+      }
     }
 
     // Cursor-blinking
@@ -1120,19 +1376,18 @@
           }
         }
       }
-      for (var i = head.line, e = forward ? Math.min(i + 50, lines.length) : Math.max(0, i - 50); i != e; i+=d) {
+      for (var i = head.line, e = forward ? Math.min(i + 100, lines.length) : Math.max(-1, i - 100); i != e; i+=d) {
         var line = lines[i], first = i == head.line;
         var found = scan(line, first && forward ? pos + 1 : 0, first && !forward ? pos : line.text.length);
-        if (found) {
-          var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
-          var one = markText({line: head.line, ch: pos}, {line: head.line, ch: pos+1}, style),
-              two = markText({line: i, ch: found.pos}, {line: i, ch: found.pos + 1}, style);
-          var clear = operation(function(){one(); two();});
-          if (autoclear) setTimeout(clear, 800);
-          else bracketHighlighted = clear;
-          break;
-        }
+        if (found) break;
       }
+      if (!found) found = {pos: null, match: false};
+      var style = found.match ? "CodeMirror-matchingbracket" : "CodeMirror-nonmatchingbracket";
+      var one = markText({line: head.line, ch: pos}, {line: head.line, ch: pos+1}, style),
+          two = found.pos != null && markText({line: i, ch: found.pos}, {line: i, ch: found.pos + 1}, style);
+      var clear = operation(function(){one.clear(); two && two.clear();});
+      if (autoclear) setTimeout(clear, 800);
+      else bracketHighlighted = clear;
     }
 
     // Finds the line to start with when starting a parse. Tries to
@@ -1148,7 +1403,7 @@
         if (line.stateAfter) return search;
         var indented = line.indentation();
         if (minline == null || minindent > indented) {
-          minline = search;
+          minline = search - 1;
           minindent = indented;
         }
       }
@@ -1163,11 +1418,21 @@
         line.highlight(mode, state);
         line.stateAfter = copyState(mode, state);
       }
-      if (!lines[n].stateAfter) work.push(n);
+      changes.push({from: start, to: n});
+      if (n < lines.length && !lines[n].stateAfter) work.push(n);
       return state;
     }
+    function highlightLines(start, end) {
+      var state = getStateBefore(start);
+      for (var i = start; i < end; ++i) {
+        var line = lines[i];
+        line.highlight(mode, state);
+        line.stateAfter = copyState(mode, state);
+      }
+    }
     function highlightWorker() {
       var end = +new Date + options.workTime;
+      var foundWork = work.length;
       while (work.length) {
         if (!lines[showingFrom].stateAfter) var task = showingFrom;
         else var task = work.pop();
@@ -1176,20 +1441,29 @@
         if (state) state = copyState(mode, state);
         else state = startState(mode);
 
+        var unchanged = 0, compare = mode.compareStates, realChange = false;
         for (var i = start, l = lines.length; i < l; ++i) {
           var line = lines[i], hadState = line.stateAfter;
           if (+new Date > end) {
             work.push(i);
             startWorker(options.workDelay);
-            changes.push({from: task, to: i});
+            if (realChange) changes.push({from: task, to: i + 1});
             return;
           }
           var changed = line.highlight(mode, state);
+          if (changed) realChange = true;
           line.stateAfter = copyState(mode, state);
-          if (hadState && !changed && line.text) break;
+          if (compare) {
+            if (hadState && compare(hadState, state)) break;
+          } else {
+            if (changed !== false || !hadState) unchanged = 0;
+            else if (++unchanged > 3) break;
+          }
         }
-        changes.push({from: task, to: i});
+        if (realChange) changes.push({from: task, to: i + 1});
       }
+      if (foundWork && options.onHighlightComplete)
+        options.onHighlightComplete(instance);
     }
     function startWorker(time) {
       if (!work.length) return;
@@ -1207,24 +1481,29 @@
       var reScroll = false;
       if (selectionChanged) reScroll = !scrollCursorIntoView();
       if (changes.length) updateDisplay(changes);
-      else if (selectionChanged) updateCursor();
+      else {
+        if (selectionChanged) updateCursor();
+        if (gutterDirty) updateGutter();
+      }
       if (reScroll) scrollCursorIntoView();
-      if (selectionChanged) restartBlink();
+      if (selectionChanged) {scrollEditorIntoView(); restartBlink();}
 
       // updateInput can be set to a boolean value to force/prevent an
       // update.
-      if (!leaveInputAlone && (updateInput === true || (updateInput !== false && selectionChanged)))
+      if (focused && !leaveInputAlone &&
+          (updateInput === true || (updateInput !== false && selectionChanged)))
         prepareInput();
 
-      if (selectionChanged && options.onCursorActivity)
-        options.onCursorActivity(instance);
-      if (textChanged && options.onChange)
-        options.onChange(instance);
       if (selectionChanged && options.matchBrackets)
         setTimeout(operation(function() {
           if (bracketHighlighted) {bracketHighlighted(); bracketHighlighted = null;}
           matchBrackets(false);
         }), 20);
+      var tc = textChanged; // textChanged can be reset by cursoractivity callback
+      if (selectionChanged && options.onCursorActivity)
+        options.onCursorActivity(instance);
+      if (tc && options.onChange && instance)
+        options.onChange(instance, tc);
     }
     var nestedOperation = 0;
     function operation(f) {
@@ -1259,6 +1538,7 @@
               var newmatch = line.match(query);
               if (newmatch) match = newmatch;
               else break;
+              start++;
             }
           }
           else {
@@ -1338,9 +1618,21 @@
       },
 
       from: function() {if (this.atOccurrence) return copyPos(this.pos.from);},
-      to: function() {if (this.atOccurrence) return copyPos(this.pos.to);}
+      to: function() {if (this.atOccurrence) return copyPos(this.pos.to);},
+
+      replace: function(newText) {
+        var self = this;
+        if (this.atOccurrence)
+          operation(function() {
+            self.pos.to = replaceRange(newText, self.pos.from, self.pos.to);
+          })();
+      }
     };
 
+    for (var ext in extensions)
+      if (extensions.propertyIsEnumerable(ext) &&
+          !instance.propertyIsEnumerable(ext))
+        instance[ext] = extensions[ext];
     return instance;
   } // (end of function CodeMirror)
 
@@ -1348,6 +1640,7 @@
   CodeMirror.defaults = {
     value: "",
     mode: null,
+    theme: "default",
     indentUnit: 2,
     indentWithTabs: false,
     tabMode: "classic",
@@ -1356,17 +1649,21 @@
     onKeyEvent: null,
     lineNumbers: false,
     gutter: false,
+    fixedGutter: false,
     firstLineNumber: 1,
     readOnly: false,
+    smartHome: true,
     onChange: null,
     onCursorActivity: null,
     onGutterClick: null,
+    onHighlightComplete: null,
     onFocus: null, onBlur: null, onScroll: null,
     matchBrackets: false,
     workTime: 100,
     workDelay: 200,
     undoDepth: 40,
-    tabindex: null
+    tabindex: null,
+    document: window.document
   };
 
   // Known modes, by name and by MIME
@@ -1383,15 +1680,15 @@
       spec = mimeModes[spec];
     if (typeof spec == "string")
       var mname = spec, config = {};
-    else
+    else if (spec != null)
       var mname = spec.name, config = spec;
     var mfactory = modes[mname];
     if (!mfactory) {
       if (window.console) console.warn("No mode " + mname + " found, falling back to plain text.");
       return CodeMirror.getMode(options, "text/plain");
     }
-    return mfactory(options, config);
-  }
+    return mfactory(options, config || {});
+  };
   CodeMirror.listModes = function() {
     var list = [];
     for (var m in modes)
@@ -1401,10 +1698,15 @@
   CodeMirror.listMIMEs = function() {
     var list = [];
     for (var m in mimeModes)
-      if (mimeModes.propertyIsEnumerable(m)) list.push(m);
+      if (mimeModes.propertyIsEnumerable(m)) list.push({mime: m, mode: mimeModes[m]});
     return list;
   };
 
+  var extensions = {};
+  CodeMirror.defineExtension = function(name, func) {
+    extensions[name] = func;
+  };
+
   CodeMirror.fromTextArea = function(textarea, options) {
     if (!options) options = {};
     options.value = textarea.value;
@@ -1484,7 +1786,7 @@
       if (ok) {++this.pos; return ch;}
     },
     eatWhile: function(match) {
-      var start = this.start;
+      var start = this.pos;
       while (this.eat(match)){}
       return this.pos > start;
     },
@@ -1517,6 +1819,7 @@
     },
     current: function(){return this.string.slice(this.start, this.pos);}
   };
+  CodeMirror.StringStream = StringStream;
 
   // Line objects. These hold state related to a line, including
   // highlighting info (the styles array).
@@ -1526,10 +1829,23 @@
     this.text = text;
     this.marked = this.gutterMarker = this.className = null;
   }
+  Line.inheritMarks = function(text, orig) {
+    var ln = new Line(text), mk = orig.marked;
+    if (mk) {
+      for (var i = 0; i < mk.length; ++i) {
+        if (mk[i].to == null) {
+          var newmk = ln.marked || (ln.marked = []), mark = mk[i];
+          newmk.push({from: null, to: null, style: mark.style, set: mark.set});
+          mark.set.push(ln);
+        }
+      }
+    }
+    return ln;
+  }
   Line.prototype = {
     // Replace a piece of a line, keeping the styles around it intact.
-    replace: function(from, to, text) {
-      var st = [], mk = this.marked;
+    replace: function(from, to_, text) {
+      var st = [], mk = this.marked, to = to_ == null ? this.text.length : to_;
       copyStyles(0, from, this.styles, st);
       if (text) st.push(text, null);
       copyStyles(to, this.text.length, this.styles, st);
@@ -1538,39 +1854,86 @@
       this.stateAfter = null;
       if (mk) {
         var diff = text.length - (to - from), end = this.text.length;
-        function fix(n) {return n <= Math.min(to, to + diff) ? n : n + diff;}
+        var changeStart = Math.min(from, from + diff);
         for (var i = 0; i < mk.length; ++i) {
           var mark = mk[i], del = false;
-          if (mark.from >= end) del = true;
-          else {mark.from = fix(mark.from); if (mark.to != null) mark.to = fix(mark.to);}
-          if (del || mark.from >= mark.to) {mk.splice(i, 1); i--;}
+          if (mark.from != null && mark.from >= end) del = true;
+          else {
+            if (mark.from != null && mark.from >= from) {
+              mark.from += diff;
+              if (mark.from <= 0) mark.from = from == null ? null : 0;
+            }
+            else if (to_ == null) mark.to = null;
+            if (mark.to != null && mark.to > from) {
+              mark.to += diff;
+              if (mark.to < 0) del = true;
+            }
+          }
+          if (del || (mark.from != null && mark.to != null && mark.from >= mark.to)) mk.splice(i--, 1);
         }
       }
     },
-    // Split a line in two, again keeping styles intact.
+    // Split a part off a line, keeping styles and markers intact.
     split: function(pos, textBefore) {
-      var st = [textBefore, null];
+      var st = [textBefore, null], mk = this.marked;
       copyStyles(pos, this.text.length, this.styles, st);
-      return new Line(textBefore + this.text.slice(pos), st);
+      var taken = new Line(textBefore + this.text.slice(pos), st);
+      if (mk) {
+        for (var i = 0; i < mk.length; ++i) {
+          var mark = mk[i];
+          if (mark.to > pos || mark.to == null) {
+            if (!taken.marked) taken.marked = [];
+            taken.marked.push({
+              from: mark.from < pos || mark.from == null ? null : mark.from - pos + textBefore.length,
+              to: mark.to == null ? null : mark.to - pos + textBefore.length,
+              style: mark.style, set: mark.set
+            });
+            mark.set.push(taken);
+          }
+        }
+      }
+      return taken;
     },
-    addMark: function(from, to, style) {
-      var mk = this.marked, mark = {from: from, to: to, style: style};
+    append: function(line) {
+      if (!line.text.length) return;
+      var mylen = this.text.length, mk = line.marked;
+      this.text += line.text;
+      copyStyles(0, line.text.length, line.styles, this.styles);
+      if (mk && mk.length) {
+        var mymk = this.marked || (this.marked = []);
+        for (var i = 0; i < mymk.length; ++i)
+          if (mymk[i].to == null) mymk[i].to = mylen;
+        outer: for (var i = 0; i < mk.length; ++i) {
+          var mark = mk[i];
+          if (!mark.from) {
+            for (var j = 0; j < mymk.length; ++j) {
+              var mymark = mymk[j];
+              if (mymark.to == mylen && mymark.set == mark.set) {
+                mymark.to = mark.to == null ? null : mark.to + mylen;
+                continue outer;
+              }
+            }
+          }
+          mymk.push(mark);
+          mark.set.push(this);
+          mark.from += mylen;
+          if (mark.to != null) mark.to += mylen;
+        }
+      }
+    },
+    addMark: function(from, to, style, set) {
+      set.push(this);
       if (this.marked == null) this.marked = [];
-      this.marked.push(mark);
-      this.marked.sort(function(a, b){return a.from - b.from;});
-      return mark;
-    },
-    removeMark: function(mark) {
-      var mk = this.marked;
-      if (!mk) return;
-      for (var i = 0; i < mk.length; ++i)
-        if (mk[i] == mark) {mk.splice(i, 1); break;}
+      this.marked.push({from: from, to: to, style: style, set: set});
+      this.marked.sort(function(a, b){return (a.from || 0) - (b.from || 0);});
     },
     // Run the given mode's parser over a line, update the styles
     // array, which contains alternating fragments of text and CSS
     // classes.
     highlight: function(mode, state) {
-      var stream = new StringStream(this.text), st = this.styles, pos = 0, changed = false;
+      var stream = new StringStream(this.text), st = this.styles, pos = 0;
+      var changed = false, curWord = st[0], prevWord;
+      if (this.text == "" && mode.blankLine) mode.blankLine(state);
       while (!stream.eol()) {
         var style = mode.token(stream, state);
         var substr = this.text.slice(stream.start, stream.pos);
@@ -1578,8 +1941,9 @@
         if (pos && st[pos-1] == style)
           st[pos-2] += substr;
         else if (substr) {
-          if (!changed && st[pos] != substr || st[pos+1] != style) changed = true;
+          if (!changed && (st[pos+1] != style || (pos && st[pos-2] != prevWord))) changed = true;
           st[pos++] = substr; st[pos++] = style;
+          prevWord = curWord; curWord = st[pos];
         }
         // Give up when line is ridiculously long
         if (stream.pos > 5000) {
@@ -1588,7 +1952,11 @@
         }
       }
       if (st.length != pos) {st.length = pos; changed = true;}
-      return changed;
+      if (pos && st[pos-2] != prevWord) changed = true;
+      // Short lines with simple highlights return null, and are
+      // counted as changed by the driver because they are likely to
+      // highlight the same way in various contexts.
+      return changed || (st.length < 5 && this.text.length < 10 ? null : false);
     },
     // Fetch the parser token for a given character. Useful for hacks
     // that want to inspect the mode state (say, for completion).
@@ -1607,7 +1975,7 @@
     indentation: function() {return countColumn(this.text);},
     // Produces an HTML fragment for the line, taking selection,
     // marking, and highlighting into account.
-    getHTML: function(sfrom, sto, includePre) {
+    getHTML: function(sfrom, sto, includePre, endAt) {
       var html = [];
       if (includePre)
         html.push(this.className ? '<pre class="' + this.className + '">': "<pre>");
@@ -1618,11 +1986,18 @@
       }
       var st = this.styles, allText = this.text, marked = this.marked;
       if (sfrom == sto) sfrom = null;
+      var len = allText.length;
+      if (endAt != null) len = Math.min(endAt, len);
 
-      if (!allText)
+      if (!allText && endAt == null)
         span(" ", sfrom != null && sto == null ? "CodeMirror-selected" : null);
       else if (!marked && sfrom == null)
-        for (var i = 0, e = st.length; i < e; i+=2) span(st[i], st[i+1]);
+        for (var i = 0, ch = 0; ch < len; i+=2) {
+          var str = st[i], style = st[i+1], l = str.length;
+          if (ch + l > len) str = str.slice(0, len - ch);
+          ch += l;
+          span(str, style && "cm-" + style);
+        }
       else {
         var pos = 0, i = 0, text = "", style, sg = 0;
         var markpos = -1, mark = null;
@@ -1632,9 +2007,9 @@
             mark = (markpos < marked.length) ? marked[markpos] : null;
           }
         }
-        nextMark();        
-        while (pos < allText.length) {
-          var upto = allText.length;
+        nextMark();
+        while (pos < len) {
+          var upto = len;
           var extraStyle = "";
           if (sfrom != null) {
             if (sfrom > pos) upto = sfrom;
@@ -1653,12 +2028,12 @@
           }
           for (;;) {
             var end = pos + text.length;
-            var apliedStyle = style;
-            if (extraStyle) apliedStyle = style ? style + extraStyle : extraStyle;
-            span(end > upto ? text.slice(0, upto - pos) : text, apliedStyle);
+            var appliedStyle = style;
+            if (extraStyle) appliedStyle = style ? style + extraStyle : extraStyle;
+            span(end > upto ? text.slice(0, upto - pos) : text, appliedStyle);
             if (end >= upto) {text = text.slice(upto - pos); pos = upto; break;}
             pos = end;
-            text = st[i++]; style = st[i++];
+            text = st[i++]; style = "cm-" + st[i++];
           }
         }
         if (sfrom != null && sto == null) span(" ", "CodeMirror-selected");
@@ -1716,42 +2091,34 @@
     }
   };
 
-  // Event stopping compatibility wrapper.
-  function stopEvent() {
-    if (this.preventDefault) {this.preventDefault(); this.stopPropagation();}
-    else {this.returnValue = false; this.cancelBubble = true;}
-  }
+  function stopMethod() {e_stop(this);}
   // Ensure an event has a stop method.
   function addStop(event) {
-    if (!event.stop) event.stop = stopEvent;
+    if (!event.stop) event.stop = stopMethod;
     return event;
   }
 
-  // Event wrapper, exposing the few operations we need.
-  function Event(orig) {this.e = orig;}
-  Event.prototype = {
-    stop: function() {stopEvent.call(this.e);},
-    target: function() {return this.e.target || this.e.srcElement;},
-    button: function() {
-      if (this.e.which) return this.e.which;
-      else if (this.e.button & 1) return 1;
-      else if (this.e.button & 2) return 3;
-      else if (this.e.button & 4) return 2;
-    },
-    pageX: function() {
-      if (this.e.pageX != null) return this.e.pageX;
-      else return this.e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
-    },
-    pageY: function() {
-      if (this.e.pageY != null) return this.e.pageY;
-      else return this.e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
-    }
-  };
+  function e_preventDefault(e) {
+    if (e.preventDefault) e.preventDefault();
+    else e.returnValue = false;
+  }
+  function e_stopPropagation(e) {
+    if (e.stopPropagation) e.stopPropagation();
+    else e.cancelBubble = true;
+  }
+  function e_stop(e) {e_preventDefault(e); e_stopPropagation(e);}
+  function e_target(e) {return e.target || e.srcElement;}
+  function e_button(e) {
+    if (e.which) return e.which;
+    else if (e.button & 1) return 1;
+    else if (e.button & 2) return 3;
+    else if (e.button & 4) return 2;
+  }
 
   // Event handler registration. If disconnect is true, it'll return a
   // function that unregisters the handler.
   function connect(node, type, handler, disconnect) {
-    function wrapHandler(event) {handler(new Event(event || window.event));}
+    function wrapHandler(event) {handler(event || window.event);}
     if (typeof node.addEventListener == "function") {
       node.addEventListener(type, wrapHandler, false);
       if (disconnect) return function() {node.removeEventListener(type, wrapHandler, false);};
@@ -1772,7 +2139,18 @@
     pre.innerHTML = " "; return !pre.innerHTML;
   })();
 
+  // Detect drag-and-drop
+  var dragAndDrop = (function() {
+    // IE8 has ondragstart and ondrop properties, but doesn't seem to
+    // actually support ondragstart the way it's supposed to work.
+    if (/MSIE [1-8]\b/.test(navigator.userAgent)) return false;
+    var div = document.createElement('div');
+    return "ondragstart" in div && "ondrop" in div;
+  })();
+
   var gecko = /gecko\/\d{7}/i.test(navigator.userAgent);
+  var ie = /MSIE \d/.test(navigator.userAgent);
+  var safari = /Apple Computer/.test(navigator.vendor);
 
   var lineSep = "\n";
   // Feature-detect whether newlines in textareas are converted to \r\n
@@ -1802,11 +2180,23 @@
     return n;
   }
 
+  function computedStyle(elt) {
+    if (elt.currentStyle) return elt.currentStyle;
+    return window.getComputedStyle(elt, null);
+  }
   // Find the position of an element by following the offsetParent chain.
-  function eltOffset(node) {
-    var x = 0, y = 0, n2 = node;
-    for (var n = node; n; n = n.offsetParent) {x += n.offsetLeft; y += n.offsetTop;}
-    for (var n = node; n != document.body; n = n.parentNode) {x -= n.scrollLeft; y -= n.scrollTop;}
+  // If screen==true, it returns screen (rather than page) coordinates.
+  function eltOffset(node, screen) {
+    var doc = node.ownerDocument.body;
+    var x = 0, y = 0, skipDoc = false;
+    for (var n = node; n; n = n.offsetParent) {
+      x += n.offsetLeft; y += n.offsetTop;
+      if (screen && computedStyle(n).position == "fixed")
+        skipDoc = true;
+    }
+    var e = screen && !skipDoc ? null : doc;
+    for (var n = node.parentNode; n != e; n = n.parentNode)
+      if (n.scrollLeft != null) { x -= n.scrollLeft; y -= n.scrollTop;}
     return {left: x, top: y};
   }
   // Get a node's text content.
@@ -1819,9 +2209,18 @@
   function posLess(a, b) {return a.line < b.line || (a.line == b.line && a.ch < b.ch);}
   function copyPos(x) {return {line: x.line, ch: x.ch};}
 
+  var escapeElement = document.createElement("pre");
   function htmlEscape(str) {
-    return str.replace(/[<&]/g, function(str) {return str == "&" ? "&amp;" : "&lt;";});
+    if (badTextContent) {
+      escapeElement.innerHTML = "";
+      escapeElement.appendChild(document.createTextNode(str));
+    } else {
+      escapeElement.textContent = str;
+    }
+    return escapeElement.innerHTML;
   }
+  var badTextContent = htmlEscape("\t") != "\t";
+  CodeMirror.htmlEscape = htmlEscape;
 
   // Used to position the cursor after an undo/redo by finding the
   // last edited character.
@@ -1842,8 +2241,9 @@
 
   // See if "".split is the broken IE version, if so, provide an
   // alternative way to split lines.
+  var splitLines, selRange, setSelRange;
   if ("\n\nb".split(/\n/).length != 3)
-    var splitLines = function(string) {
+    splitLines = function(string) {
       var pos = 0, nl, result = [];
       while ((nl = string.indexOf("\n", pos)) > -1) {
         result.push(string.slice(pos, string.charAt(nl-1) == "\r" ? nl - 1 : nl));
@@ -1853,23 +2253,40 @@
       return result;
     };
   else
-    var splitLines = function(string){return string.split(/\r?\n/);};
+    splitLines = function(string){return string.split(/\r?\n/);};
+  CodeMirror.splitLines = splitLines;
 
   // Sane model of finding and setting the selection in a textarea
   if (window.getSelection) {
-    var selRange = function(te) {
+    selRange = function(te) {
       try {return {start: te.selectionStart, end: te.selectionEnd};}
       catch(e) {return null;}
     };
-    var setSelRange = function(te, start, end) {
-      try {te.setSelectionRange(start, end);}
-      catch(e) {} // Fails on Firefox when textarea isn't part of the document
-    };
+    if (safari)
+      // On Safari, selection set with setSelectionRange are in a sort
+      // of limbo wrt their anchor. If you press shift-left in them,
+      // the anchor is put at the end, and the selection expanded to
+      // the left. If you press shift-right, the anchor ends up at the
+      // front. This is not what CodeMirror wants, so it does a
+      // spurious modify() call to get out of limbo.
+      setSelRange = function(te, start, end) {
+        if (start == end)
+          te.setSelectionRange(start, end);
+        else {
+          te.setSelectionRange(start, end - 1);
+          window.getSelection().modify("extend", "forward", "character");
+        }
+      };
+    else
+      setSelRange = function(te, start, end) {
+        try {te.setSelectionRange(start, end);}
+        catch(e) {} // Fails on Firefox when textarea isn't part of the document
+      };
   }
   // IE model. Don't ask.
   else {
-    var selRange = function(te) {
-      try {var range = document.selection.createRange();}
+    selRange = function(te) {
+      try {var range = te.ownerDocument.selection.createRange();}
       catch(e) {return null;}
       if (!range || range.parentElement() != te) return null;
       var val = te.value, len = val.length, localRange = te.createTextRange();
@@ -1890,7 +2307,7 @@
       for (var i = val.indexOf("\r"); i > -1 && i < end; i = val.indexOf("\r", i+1), end++) {}
       return {start: start, end: end};
     };
-    var setSelRange = function(te, start, end) {
+    setSelRange = function(te, start, end) {
       var range = te.createTextRange();
       range.collapse(true);
       var endrange = range.duplicate();
--- a/rhodecode/templates/admin/repos/repo_edit_perms.html	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/templates/admin/repos/repo_edit_perms.html	Sat Oct 29 19:26:43 2011 +0200
@@ -1,4 +1,4 @@
-<table id="permissions_manage">
+<table id="permissions_manage" class="noborder">
     <tr>
         <td>${_('none')}</td>
         <td>${_('read')}</td>
--- a/rhodecode/templates/base/base.html	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/templates/base/base.html	Sat Oct 29 19:26:43 2011 +0200
@@ -149,60 +149,6 @@
                             <a href="#">${_('loading...')}</a>
                         </li>
 					</ul>
-					<script type="text/javascript">
-					   YUE.on('repo_switcher','mouseover',function(){
-						      function qfilter(){
-						         var S = YAHOO.util.Selector;
-						         
-						         var q_filter = YUD.get('q_filter_rs');
-						         var F = YAHOO.namespace('q_filter_rs'); 
-						         
-						         YUE.on(q_filter,'click',function(){
-						            q_filter.value = '';
-						         });
-						    
-						         F.filterTimeout = null;
-						         
-						         F.updateFilter  = function() { 
-						            // Reset timeout 
-						            F.filterTimeout = null;
-						            
-						            var obsolete = [];
-						            var nodes = S.query('ul#repo_switcher_list li a.repo_name');
-						            var req = YUD.get('q_filter_rs').value;
-						            for (n in nodes){
-						                YUD.setStyle(nodes[n].parentNode,'display','')
-						            }
-						            if (req){
-						                for (n in nodes){
-						                    if (nodes[n].innerHTML.toLowerCase().indexOf(req) == -1) {
-						                        obsolete.push(nodes[n]); 
-						                    }
-						                }
-						                if(obsolete){
-						                    for (n in obsolete){
-						                        YUD.setStyle(obsolete[n].parentNode,'display','none');
-						                    }
-						                }
-						            }
-						         }
-						         
-						         YUE.on(q_filter,'keyup',function(e){
-						             clearTimeout(F.filterTimeout); 
-						             F.filterTimeout = setTimeout(F.updateFilter,600); 
-						         });
-						}
-						   var loaded = YUD.hasClass('repo_switcher','loaded');
-						   if(!loaded){
-							   YUD.addClass('repo_switcher','loaded');
-							   ypjax("${h.url('repo_switcher')}",'repo_switcher_list',
-								   function(o){qfilter();},
-								   function(o){YUD.removeClass('repo_switcher','loaded');}
-								   ,null);
-						   }
-						   return false;
-					   });
-					</script>	
 				</li>
 				
 	            <li ${is_current('summary')}>
@@ -231,38 +177,15 @@
                 </li>   	
                 
                 <li ${is_current('switch_to')}>
-                   <a title="${_('Switch to')}" href="#">
+                   <a id="branch_tag_switcher" title="${_('Switch to')}" href="#">
                    <span class="icon">
                        <img src="${h.url('/images/icons/arrow_switch.png')}" alt="${_('Switch to')}" />
                    </span>
                    <span>${_('Switch to')}</span>                 
                    </a>    
-                    <ul>
-                        <li>
-                            ${h.link_to('%s (%s)' % (_('branches'),len(c.rhodecode_repo.branches.values()),),h.url('branches_home',repo_name=c.repo_name),class_='branches childs')}
-                            <ul>
-                            %if c.rhodecode_repo.branches.values():
-						        %for cnt,branch in enumerate(c.rhodecode_repo.branches.items()):
-						            <li>${h.link_to('%s - %s' % (branch[0],h.short_id(branch[1])),h.url('files_home',repo_name=c.repo_name,revision=branch[1]))}</li>
-						        %endfor
-						    %else:
-						    	<li>${h.link_to(_('There are no branches yet'),'#')}</li>
-						    %endif
-                            </ul>                        
-                        </li>
-                        <li>
-                            ${h.link_to('%s (%s)' % (_('tags'),len(c.rhodecode_repo.tags.values()),),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')}
-                            <ul>
-                            %if c.rhodecode_repo.tags.values():
-                                %for cnt,tag in enumerate(c.rhodecode_repo.tags.items()):
-                                 <li>${h.link_to('%s - %s' % (tag[0],h.short_id(tag[1])),h.url('files_home',repo_name=c.repo_name,revision=tag[1]))}</li>
-                                %endfor
-                            %else:
-                            	<li>${h.link_to(_('There are no tags yet'),'#')}</li>
-                            %endif
-                            </ul>                        
-                        </li>                        
-                    </ul>
+                    <ul id="switch_to_list" class="switch_to">
+                        <li><a href="#">${_('loading...')}</a></li>
+                    </ul>                     
                 </li>
                 <li ${is_current('files')}>
                    <a title="${_('Files')}" href="${h.url('files_home',repo_name=c.repo_name)}">
@@ -329,8 +252,73 @@
                     <span class="short">${c.repository_forks}</span>
                     </a>
                 </li>                
-                
 	        </ul>
+            <script type="text/javascript">
+               YUE.on('repo_switcher','mouseover',function(){
+                      function qfilter(){
+                         var S = YAHOO.util.Selector;
+                         
+                         var q_filter = YUD.get('q_filter_rs');
+                         var F = YAHOO.namespace('q_filter_rs'); 
+                         
+                         YUE.on(q_filter,'click',function(){
+                            q_filter.value = '';
+                         });
+                    
+                         F.filterTimeout = null;
+                         
+                         F.updateFilter  = function() { 
+                            // Reset timeout 
+                            F.filterTimeout = null;
+                            
+                            var obsolete = [];
+                            var nodes = S.query('ul#repo_switcher_list li a.repo_name');
+                            var req = YUD.get('q_filter_rs').value.toLowerCase();
+                            for (n in nodes){
+                                YUD.setStyle(nodes[n].parentNode,'display','')
+                            }
+                            if (req){
+                                for (n in nodes){
+                                    if (nodes[n].innerHTML.toLowerCase().indexOf(req) == -1) {
+                                        obsolete.push(nodes[n]); 
+                                    }
+                                }
+                                if(obsolete){
+                                    for (n in obsolete){
+                                        YUD.setStyle(obsolete[n].parentNode,'display','none');
+                                    }
+                                }
+                            }
+                         }
+                         
+                         YUE.on(q_filter,'keyup',function(e){
+                             clearTimeout(F.filterTimeout); 
+                             F.filterTimeout = setTimeout(F.updateFilter,600); 
+                         });
+                }
+                   var loaded = YUD.hasClass('repo_switcher','loaded');
+                   if(!loaded){
+                       YUD.addClass('repo_switcher','loaded');
+                       ypjax("${h.url('repo_switcher')}",'repo_switcher_list',
+                           function(o){qfilter();},
+                           function(o){YUD.removeClass('repo_switcher','loaded');}
+                           ,null);
+                   }
+                   return false;
+               });
+
+            YUE.on('branch_tag_switcher','mouseover',function(){
+               var loaded = YUD.hasClass('branch_tag_switcher','loaded');
+               if(!loaded){
+                   YUD.addClass('branch_tag_switcher','loaded');
+                   ypjax("${h.url('branch_tag_switcher',repo_name=c.repo_name)}",'switch_to_list',
+                       function(o){},
+                       function(o){YUD.removeClass('branch_tag_switcher','loaded');}
+                       ,null);
+               }
+               return false;
+            });
+            </script>             
 		%else:
 		    ##ROOT MENU
             <ul id="quick">
@@ -373,5 +361,5 @@
                 </li>
 				%endif
 			</ul>
-		%endif    
+		%endif
 </%def>
--- a/rhodecode/templates/base/root.html	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/templates/base/root.html	Sat Oct 29 19:26:43 2011 +0200
@@ -129,10 +129,16 @@
             		YUD.addClass(menu,'hidden');
             	}
             })
-            
+            YUE.on(window,'scroll',function(){
+                if(YUD.getDocumentScrollTop() > 45){
+                      YUD.addClass('header-inner','hover');
+                }
+                else{
+                    YUD.removeClass('header-inner','hover');
+                }
+            }) 
            })   
             </script>
-        
         </%def>
         <%def name="js_extra()">
         </%def>      
--- a/rhodecode/templates/changeset/changeset_range.html	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/templates/changeset/changeset_range.html	Sat Oct 29 19:26:43 2011 +0200
@@ -37,7 +37,7 @@
 		</div>
 	    <div id="changeset_compare_view_content">
 			<div class="container">
-			<table class="compare_view_commits">
+			<table class="compare_view_commits noborder">
             %for cs in c.cs_ranges:
                 <tr>
                 <td><div class="gravatar"><img alt="gravatar" src="${h.gravatar_url(h.email(cs.author),14)}"/></div></td>
--- a/rhodecode/templates/files/files_add.html	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/templates/files/files_add.html	Sat Oct 29 19:26:43 2011 +0200
@@ -39,36 +39,35 @@
 		  ${h.form(h.url.current(),method='post',id='eform',enctype="multipart/form-data")}
             <h3>${_('Add new file')}</h3>
             <div class="form">
-                    <div class="fields">
-                         <div class="field">
-                            <div class="label">
-                                <label for="location">${_('Location')}</label>
-                            </div>
-                            <div class="input">
-                                <input type="text" value="${c.f_path}" size="30" name="location" id="location">
-                                ${_('use / to separate directories')}
-                            </div>
-                         </div>
-                                      
-                        <div id="filename_container" class="field file">
-                            <div class="label">
-                                <label for="filename">${_('File Name')}:</label>
-                            </div>
-                            <div class="input">
-                                <input type="text" value="" size="30" name="filename" id="filename">
-                                <input type="button" class="ui-button-small" value="upload file" id="upload_file_enable">
-                            </div>
-                        </div>
-                        <div id="upload_file_container" class="field" style="display:none">
-                          <div class="label">
-                              <label for="location">${_('Upload file')}</label>
-                          </div>
-                          <div class="file">
-                              <input type="file"  size="30" name="upload_file" id="upload_file">
-                              <input type="button" class="ui-button-small" value="create file" id="file_enable">                        
-                          </div>
-                        </div>                                                                      
+              <div class="fields">
+                  <div id="filename_container" class="field file">
+                      <div class="label">
+                          <label for="filename">${_('File Name')}:</label>
+                      </div>
+                      <div class="input">
+                          <input type="text" value="" size="30" name="filename" id="filename">
+                          <input type="button" class="ui-button-small" value="upload file" id="upload_file_enable">
+                      </div>
+                  </div>                    
+                  <div id="upload_file_container" class="field" style="display:none">
+                    <div class="label">
+                        <label for="location">${_('Upload file')}</label>
                     </div>
+                    <div class="file">
+                        <input type="file"  size="30" name="upload_file" id="upload_file">
+                        <input type="button" class="ui-button-small" value="create file" id="file_enable">                        
+                    </div>
+                  </div>
+                   <div class="field">
+                      <div class="label">
+                          <label for="location">${_('Location')}</label>
+                      </div>
+                      <div class="input">
+                          <input type="text" value="${c.f_path}" size="30" name="location" id="location">
+                          ${_('use / to separate directories')}
+                      </div>
+                   </div>                                                                    
+              </div>
             </div>            
 			<div id="body" class="codeblock">
 			    <div id="editor_container">    
--- a/rhodecode/templates/search/search_path.html	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/templates/search/search_path.html	Sat Oct 29 19:26:43 2011 +0200
@@ -1,27 +1,26 @@
 ##path search
-<div class="search">
-	%for cnt,sr in enumerate(c.formated_results):
-	    %if h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(sr['repository'],'search results check'):
-		    <div class="search_path">
+
+%for cnt,sr in enumerate(c.formated_results):
+    %if h.HasRepoPermissionAny('repository.write','repository.read','repository.admin')(sr['repository'],'search results check'):
+	    <div class="search_path">
+	        <div class="link">
+	            ${h.link_to(h.literal('%s &raquo; %s' % (sr['repository'],sr['f_path'])),
+	                h.url('files_home',repo_name=sr['repository'],revision='tip',f_path=sr['f_path']))}        
+	        </div>
+	    </div>
+    %else:
+        %if cnt == 0:
+		    <div class="error">
 		        <div class="link">
-		            ${h.link_to(h.literal('%s &raquo; %s' % (sr['repository'],sr['f_path'])),
-		                h.url('files_home',repo_name=sr['repository'],revision='tip',f_path=sr['f_path']))}        
+		            ${_('Permission denied')}        
 		        </div>
-		    </div>
-	    %else:
-	        %if cnt == 0:
-			    <div class="error">
-			        <div class="link">
-			            ${_('Permission denied')}        
-			        </div>
-			    </div>        
-	        %endif
-	        
-	    %endif      
-	%endfor
-	%if c.cur_query and c.formated_results:
-	<div class="pagination-wh pagination-left">
-	    ${c.formated_results.pager('$link_previous ~2~ $link_next')}
-	</div>  
-	%endif
-</div>
\ No newline at end of file
+		    </div>        
+        %endif
+        
+    %endif      
+%endfor
+%if c.cur_query and c.formated_results:
+<div class="pagination-wh pagination-left">
+    ${c.formated_results.pager('$link_previous ~2~ $link_next')}
+</div>  
+%endif
--- a/rhodecode/templates/summary/summary.html	Sat Oct 29 17:03:33 2011 +0200
+++ b/rhodecode/templates/summary/summary.html	Sat Oct 29 19:26:43 2011 +0200
@@ -64,29 +64,22 @@
                   ##FORK
 		          %if c.dbrepo.fork:
 	            	<div style="margin-top:5px;clear:both"">
-	            	<a href="${h.url('summary_home',repo_name=c.dbrepo.fork.repo_name)}">
-	            	<img class="icon" alt="${_('public')}"
-	            	title="${_('Fork of')} ${c.dbrepo.fork.repo_name}" 
-	            	src="${h.url('/images/icons/arrow_divide.png')}"/>
-	            	${_('Fork of')} ${c.dbrepo.fork.repo_name}
+	            	<a href="${h.url('summary_home',repo_name=c.dbrepo.fork.repo_name)}"><img class="icon" alt="${_('public')}" title="${_('Fork of')} ${c.dbrepo.fork.repo_name}" src="${h.url('/images/icons/arrow_divide.png')}"/>
+	            	    ${_('Fork of')} ${c.dbrepo.fork.repo_name}
 	            	</a>
 	            	</div>
 		          %endif
 		          ##REMOTE
 				  %if c.dbrepo.clone_uri:
                     <div style="margin-top:5px;clear:both">
-                    <a href="${h.url(str(h.hide_credentials(c.dbrepo.clone_uri)))}">
-                    <img class="icon" alt="${_('remote clone')}"
-                    title="${_('Clone from')} ${h.hide_credentials(c.dbrepo.clone_uri)}" 
-                    src="${h.url('/images/icons/connect.png')}"/>
-                    ${_('Clone from')} ${h.hide_credentials(c.dbrepo.clone_uri)}
+                    <a href="${h.url(str(h.hide_credentials(c.dbrepo.clone_uri)))}"><img class="icon" alt="${_('remote clone')}" title="${_('Clone from')} ${h.hide_credentials(c.dbrepo.clone_uri)}" src="${h.url('/images/icons/connect.png')}"/>
+                        ${_('Clone from')} ${h.hide_credentials(c.dbrepo.clone_uri)}
                     </a>
                     </div>					
 				  %endif		            		      
 			  </div>
 			 </div>
 			
-			
 			 <div class="field">
 			  <div class="label">
 			      <label>${_('Description')}:</label>
@@ -94,7 +87,6 @@
 			  <div class="input-short desc">${h.urlify_text(c.dbrepo.description)}</div>
 			 </div>
 			
-			
 			 <div class="field">
 			  <div class="label">
 			      <label>${_('Contact')}:</label>
@@ -119,7 +111,6 @@
 			      <span class="tooltip" title="${c.rhodecode_repo.last_change}">
 			      ${h.age(c.rhodecode_repo.last_change)}</span><br/>
 			      ${_('by')} ${h.get_changeset_safe(c.rhodecode_repo,'tip').author} 
-			      
 			  </div>
 			 </div>
 			
@@ -187,123 +178,6 @@
 			 </div>				 			 			 
 	  </div>		 
 	</div>
-  	<script type="text/javascript">
-	  	YUE.onDOMReady(function(e){
-	  	    id = 'clone_url';
-	  	    YUE.on(id,'click',function(e){
-	  	    	if(YUD.hasClass(id,'selected')){
-	  	    		return
-	  	    	}
-	  	    	else{
-	                YUD.addClass(id,'selected');
-	                YUD.get(id).select();	  	    		
-	  	    	}
-
-	  	    })
-	  	})
-  		var data = ${c.trending_languages|n};
-  		var total = 0;
-  		var no_data = true;
-  		for (k in data){
-  		    total += data[k].count;
-  		    no_data = false;
-  		} 
-		var tbl = document.createElement('table');
-		tbl.setAttribute('class','trending_language_tbl');
-		var cnt = 0;
-  		for (k in data){
-  			cnt += 1;
-  			var hide = cnt>2;
-	  		var tr = document.createElement('tr');
-	  		if (hide){
-	  			tr.setAttribute('style','display:none');
-	  			tr.setAttribute('class','stats_hidden');
-	  		}
-	  		var percentage = Math.round((data[k].count/total*100),2);
-			var value = data[k].count;
-	  		var td1 = document.createElement('td');
-	  		td1.width = 150;
-	  		var trending_language_label = document.createElement('div');
-	  		trending_language_label.innerHTML = data[k].desc+" ("+k+")";
-	  		td1.appendChild(trending_language_label);
-
-	  		var td2 = document.createElement('td');
-	  		td2.setAttribute('style','padding-right:14px !important');
-  		    var trending_language = document.createElement('div');
-  		    var nr_files = value+" ${_('files')}";
-  		    
-  		    trending_language.title = k+" "+nr_files;
-  		    
-  		    if (percentage>22){
-  		    	trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"% "+nr_files+ "</b>";	
-  		    }
-  		    else{
-  		    	trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"%</b>";
-  		    }
-  		    
-  		    trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner');
-  		    trending_language.style.width=percentage+"%";
-			td2.appendChild(trending_language);
-			
-			tr.appendChild(td1);
-			tr.appendChild(td2);
-  		    tbl.appendChild(tr);
-  		    if(cnt == 3){
-  		    	var show_more = document.createElement('tr');
-  		    	var td = document.createElement('td');
-  		    	lnk = document.createElement('a');
-  		    	
-  		    	lnk.href='#';
-  		    	lnk.innerHTML = "${_('show more')}";
-  		    	lnk.id='code_stats_show_more';
-  		        td.appendChild(lnk);
-  		        
-  		    	show_more.appendChild(td);
-  		    	show_more.appendChild(document.createElement('td'));
-  		    	tbl.appendChild(show_more);
-  		    }
-  		    
-  		}
-  		if(no_data){
-  			var tr = document.createElement('tr');
-  			var td1 = document.createElement('td');
-  			td1.innerHTML = "${c.no_data_msg}";
-  			tr.appendChild(td1);
-  			tbl.appendChild(tr);
-		}
-  		YUD.get('lang_stats').appendChild(tbl);
-  		YUE.on('code_stats_show_more','click',function(){
-  			l = YUD.getElementsByClassName('stats_hidden')
-  			for (e in l){
-  			    YUD.setStyle(l[e],'display','');
-  			};
-  			YUD.setStyle(YUD.get('code_stats_show_more'),
-  					'display','none');
-  		})
-  	
-             var tmpl_links = {}
-              %for cnt,archive in enumerate(c.rhodecode_repo._get_archives()):
-                tmpl_links['${archive['type']}'] = '${h.link_to(archive['type'],
-                     h.url('files_archive_home',repo_name=c.dbrepo.repo_name,
-                     fname='__CS__'+archive['extension'],subrepos='__SUB__'),class_="archive_icon")}';
-              %endfor
-              
-             YUE.on(['download_options','archive_subrepos'],'change',function(e){
-            	 var sm = YUD.get('download_options');
-                 var new_cs = sm.options[sm.selectedIndex];
-                 
-                 for(k in tmpl_links){
-                	 var s = YUD.get(k+'_link');
-                	 title_tmpl = "${_('Download %s as %s') % ('__CS_NAME__','__CS_EXT__')}";
-                	 s.title = title_tmpl.replace('__CS_NAME__',new_cs.text);
-                	 s.title = s.title.replace('__CS_EXT__',k);
-                	 var url = tmpl_links[k].replace('__CS__',new_cs.value);
-                	 var subrepos = YUD.get('archive_subrepos').checked
-                	 url = url.replace('__SUB__',subrepos);
-                	 s.innerHTML = url 
-                 }
-             });
-  	</script>    				
 </div>
         
 <div class="box box-right"  style="min-height:455px">
@@ -319,7 +193,6 @@
            %if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
                 ${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name),class_="ui-button-small")}
            %endif         
-           
         %else:
             ${_('Loaded in')} ${c.stats_percentage} %
         %endif
@@ -331,333 +204,9 @@
     	<div id="legend_data" style="clear:both;margin-top:10px;">
 	    	<div id="legend_container"></div>
 	    	<div id="legend_choices">
-				<table id="legend_choices_tables" style="font-size:smaller;color:#545454"></table>
+				<table id="legend_choices_tables" class="noborder" style="font-size:smaller;color:#545454"></table>
 	    	</div>
     	</div>
-		<script type="text/javascript">
-		/**
-		 * Plots summary graph
-		 *
-		 * @class SummaryPlot
-		 * @param {from} initial from for detailed graph
-		 * @param {to} initial to for detailed graph
-		 * @param {dataset}
-		 * @param {overview_dataset}
-		 */
-		function SummaryPlot(from,to,dataset,overview_dataset) {
-			var initial_ranges = {
-			    "xaxis":{
-				    "from":from,
-				   	"to":to,
-				},
-			};
-		    var dataset = dataset;
-		    var overview_dataset = [overview_dataset];
-		    var choiceContainer = YUD.get("legend_choices");
-		    var choiceContainerTable = YUD.get("legend_choices_tables");
-		    var plotContainer = YUD.get('commit_history');
-		    var overviewContainer = YUD.get('overview');
-		    
-		    var plot_options = {
-				bars: {show:true,align:'center',lineWidth:4},
-				legend: {show:true, container:"legend_container"},
-				points: {show:true,radius:0,fill:false},
-				yaxis: {tickDecimals:0,},
-				xaxis: {
-					mode: "time", 
-					timeformat: "%d/%m",
-				    min:from,
-				    max:to,	
-				}, 
-				grid: {
-					hoverable: true, 
-				    clickable: true,
-				    autoHighlight:true,
-				    color: "#999"
-				},
-				//selection: {mode: "x"}
-		    };
-		    var overview_options = {
-				legend:{show:false},
-			    bars: {show:true,barWidth: 2,},
-			    shadowSize: 0,
-			    xaxis: {mode: "time", timeformat: "%d/%m/%y",},
-			    yaxis: {ticks: 3, min: 0,tickDecimals:0,},
-			    grid: {color: "#999",},
-			    selection: {mode: "x"}
-			};
-
-			/**
-			*get dummy data needed in few places
-			*/
-		    function getDummyData(label){
-		    	return {"label":label,
-               	 "data":[{"time":0,
-               		 "commits":0,
-	                     "added":0,
-	                     "changed":0,
-	                     "removed":0,
-                    }],
-                    "schema":["commits"],
-                    "color":'#ffffff',
-           		}
-			}
-			
-		    /**
-		     * generate checkboxes accordindly to data
-		     * @param keys
-		     * @returns
-		     */
-		    function generateCheckboxes(data) {
-			    //append checkboxes
-			    var i = 0;
-			    choiceContainerTable.innerHTML = '';
-			    for(var pos in data) {
-			    	
-			    	data[pos].color = i;
-			        i++;
-			        if(data[pos].label != ''){
-				        choiceContainerTable.innerHTML += '<tr><td>'+
-				        '<input type="checkbox" name="' + data[pos].label +'" checked="checked" />'
-				        +data[pos].label+
-				        '</td></tr>';
-			        }
-			    }	
-		    }
-		    
-		    /**
-		     * ToolTip show
-		     */
-		    function showTooltip(x, y, contents) {
-		        var div=document.getElementById('tooltip');
-		        if(!div) {
-		            div = document.createElement('div');
-		            div.id="tooltip";
-		            div.style.position="absolute";
-		            div.style.border='1px solid #fdd';
-		            div.style.padding='2px';
-		            div.style.backgroundColor='#fee';
-		            document.body.appendChild(div);
-		        }
-		        YUD.setStyle(div, 'opacity', 0);
-		        div.innerHTML = contents;
-		        div.style.top=(y + 5) + "px";
-		        div.style.left=(x + 5) + "px";
-
-		        var anim = new YAHOO.util.Anim(div, {opacity: {to: 0.8}}, 0.2);
-		        anim.animate();
-		    }
-		    
-			/**
-			 * This function will detect if selected period has some changesets 
-			   for this user if it does this data is then pushed for displaying
-			   Additionally it will only display users that are selected by the checkbox
-			*/
-		    function getDataAccordingToRanges(ranges) {
-		    	
-		        var data = [];
-		        var new_dataset = {};
-		        var keys = [];
-		        var max_commits = 0;
-				for(var key in dataset){
-					
-		            for(var ds in dataset[key].data){
-			            commit_data = dataset[key].data[ds];
-			            if (commit_data.time >= ranges.xaxis.from && commit_data.time <= ranges.xaxis.to){
-
-			            	if(new_dataset[key] === undefined){
-			            		new_dataset[key] = {data:[],schema:["commits"],label:key};	
-			            	}
-			            	new_dataset[key].data.push(commit_data);
-					    }
-				    }
-		            if (new_dataset[key] !== undefined){
-		            	data.push(new_dataset[key]);	
-		            }
-				}
-
-				if (data.length > 0){
-					return data;	
-				}
-				else{
-					//just return dummy data for graph to plot itself
-					return [getDummyData('')];	
-				}
-		    }
-		    
-			/**
-			* redraw using new checkbox data
-			*/
-		    function plotchoiced(e,args){
-			    var cur_data = args[0];
-			    var cur_ranges = args[1];
-		    	
-				var new_data = [];
-		    	var inputs = choiceContainer.getElementsByTagName("input");
-
-		    	//show only checked labels
-		        for(var i=0; i<inputs.length; i++) {
-		            var checkbox_key = inputs[i].name;
-		            
-	                if(inputs[i].checked){
-						for(var d in cur_data){
-							if(cur_data[d].label == checkbox_key){
-								new_data.push(cur_data[d]);
-							}
-						}			                
-	    	        }
-	                else{
-		                //push dummy data to not hide the label
-						new_data.push(getDummyData(checkbox_key));
-			        }
-		        }
-					        
-		    	var new_options = YAHOO.lang.merge(plot_options, {
-		            xaxis: { 
-		  	      		min: cur_ranges.xaxis.from, 
-		  	      		max: cur_ranges.xaxis.to,
-		  	      		mode:"time",
-		  	      		timeformat: "%d/%m",
-		        	},
-		    	});
-		    	if (!new_data){
-					new_data = [[0,1]];
-				}
-		    	// do the zooming
-		       plot = YAHOO.widget.Flot(plotContainer, new_data, new_options);
-		       
-		       plot.subscribe("plotselected", plotselected);
-	
-		       //resubscribe plothover
-		       plot.subscribe("plothover", plothover);
-		        
-		       // don't fire event on the overview to prevent eternal loop 
-		       overview.setSelection(cur_ranges, true);
-	
-		    }
-		    
-			/**
-		     * plot only selected items from overview
-		     * @param ranges
-		     * @returns
-		     */
-		    function plotselected(ranges,cur_data) {
-			    //updates the data for new plot
-	    		var data = getDataAccordingToRanges(ranges);
-	    		generateCheckboxes(data);
-	    		
-		    	var new_options = YAHOO.lang.merge(plot_options, {
-		            xaxis: { 
-		  	      		min: ranges.xaxis.from, 
-		  	      		max: ranges.xaxis.to,
-		  	      		mode:"time",
-		  	      		timeformat: "%d/%m",
-		        	},
-		    	});
-		    	// do the zooming 
-		        plot = YAHOO.widget.Flot(plotContainer, data, new_options);
-
-		        plot.subscribe("plotselected", plotselected);
-
-		        //resubscribe plothover
-		        plot.subscribe("plothover", plothover);
-		        
-		        // don't fire event on the overview to prevent eternal loop
-		        overview.setSelection(ranges, true);
-
-		        //resubscribe choiced 
-		        YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, ranges]);
-		    }
-		    
-		    var previousPoint = null;
-
-			function plothover(o) {
-		        var pos = o.pos;
-		        var item = o.item;
-		        
-		        //YUD.get("x").innerHTML = pos.x.toFixed(2);
-		        //YUD.get("y").innerHTML = pos.y.toFixed(2);
-		        if (item) {
-		            if (previousPoint != item.datapoint) {
-		                previousPoint = item.datapoint;
-		                
-		                var tooltip = YUD.get("tooltip");
-		                if(tooltip) {
-		                	  tooltip.parentNode.removeChild(tooltip);
-		                }
-		                var x = item.datapoint.x.toFixed(2);
-		                var y = item.datapoint.y.toFixed(2);
-						
-		                if (!item.series.label){
-		                    item.series.label = 'commits';
-		                }
-		                var d = new Date(x*1000);
-		                var fd = d.toDateString()
-		                var nr_commits = parseInt(y);
-		                
-		                var cur_data = dataset[item.series.label].data[item.dataIndex];
-		                var added = cur_data.added;
-		                var changed = cur_data.changed;
-		                var removed = cur_data.removed;
-		                
-		                var nr_commits_suffix = " ${_('commits')} ";
-		                var added_suffix = " ${_('files added')} ";
-		                var changed_suffix = " ${_('files changed')} ";
-		                var removed_suffix = " ${_('files removed')} ";
-
-		                
-		                if(nr_commits == 1){nr_commits_suffix = " ${_('commit')} ";}
-						if(added==1){added_suffix=" ${_('file added')} ";}
-						if(changed==1){changed_suffix=" ${_('file changed')} ";}
-						if(removed==1){removed_suffix=" ${_('file removed')} ";}
-										                
-		                showTooltip(item.pageX, item.pageY, item.series.label + " on " + fd
-								 +'<br/>'+
-		                         nr_commits + nr_commits_suffix+'<br/>'+
-		                         added + added_suffix +'<br/>'+
-		                         changed + changed_suffix + '<br/>'+
-		                         removed + removed_suffix + '<br/>');
-		            }
-		        }
-		        else {
-		        	  var tooltip = YUD.get("tooltip");
-		        	  
-			          if(tooltip) {
-			                tooltip.parentNode.removeChild(tooltip);
-			          }
-		            previousPoint = null;
-		        }
-		    }
-			
-		    /**
-		     * MAIN EXECUTION
-		     */
-			
-			var data = getDataAccordingToRanges(initial_ranges);    
-			generateCheckboxes(data);
-			
-		    //main plot 
-		    var plot = YAHOO.widget.Flot(plotContainer,data,plot_options);
-		    
-			//overview 
-			var overview = YAHOO.widget.Flot(overviewContainer, 
-					overview_dataset, overview_options);
-			
-			//show initial selection on overview 
-			overview.setSelection(initial_ranges);    
-			
-		    plot.subscribe("plotselected", plotselected);
-		    plot.subscribe("plothover", plothover)
-		    
-		    overview.subscribe("plotselected", function (ranges) {
-		        plot.setSelection(ranges);
-		    });		
-
-		    YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, initial_ranges]);
-		}
-			SummaryPlot(${c.ts_min},${c.ts_max},${c.commit_data|n},${c.overview_data|n});		
-		</script>
-
     </div>
 </div>    
 
@@ -669,32 +218,461 @@
         <div id="shortlog_data">
             <%include file='../shortlog/shortlog_data.html'/>
         </div>
-        ##%if c.repo_changesets:
-        ##	${h.link_to(_('show more'),h.url('changelog_home',repo_name=c.repo_name))}
-        ##%endif
+    </div>
+</div>
+
+%if c.readme_data:
+<div class="box" style="background-color: #FAFAFA">    
+    <div class="title">
+        <div class="breadcrumbs"><a href="${h.url('files_home',repo_name=c.repo_name,revision='tip',f_path=c.readme_file)}">${c.readme_file}</a></div>
+    </div>    
+    <div class="readme">
+      <div class="readme_box">
+        ${c.readme_data|n}
+      </div>
     </div>
 </div>
-<div class="box">    
-    <div class="title">
-        <div class="breadcrumbs">${h.link_to(_('Tags'),h.url('tags_home',repo_name=c.repo_name))}</div>
-    </div>    
-    <div class="table">
-        <%include file='../tags/tags_data.html'/>
-        %if c.repo_changesets:
-        	${h.link_to(_('show more'),h.url('tags_home',repo_name=c.repo_name))}
-        %endif
-    </div>
-</div>
-<div class="box">
-    <div class="title">
-        <div class="breadcrumbs">${h.link_to(_('Branches'),h.url('branches_home',repo_name=c.repo_name))}</div>
-    </div>    
-    <div class="table">
-        <%include file='../branches/branches_data.html'/>
-        %if c.repo_changesets:
-        	${h.link_to(_('show more'),h.url('branches_home',repo_name=c.repo_name))}
-        %endif
-    </div>      
-</div> 
+%endif
+
+<script type="text/javascript">
+        YUE.onDOMReady(function(e){
+            id = 'clone_url';
+            YUE.on(id,'click',function(e){
+                if(YUD.hasClass(id,'selected')){
+                    return
+                }
+                else{
+                    YUD.addClass(id,'selected');
+                    YUD.get(id).select();                   
+                }
+
+            })
+        })
+        var data = ${c.trending_languages|n};
+        var total = 0;
+        var no_data = true;
+        for (k in data){
+            total += data[k].count;
+            no_data = false;
+        } 
+        var tbl = document.createElement('table');
+        tbl.setAttribute('class','trending_language_tbl');
+        var cnt = 0;
+        for (k in data){
+            cnt += 1;
+            var hide = cnt>2;
+            var tr = document.createElement('tr');
+            if (hide){
+                tr.setAttribute('style','display:none');
+                tr.setAttribute('class','stats_hidden');
+            }
+            var percentage = Math.round((data[k].count/total*100),2);
+            var value = data[k].count;
+            var td1 = document.createElement('td');
+            td1.width = 150;
+            var trending_language_label = document.createElement('div');
+            trending_language_label.innerHTML = data[k].desc+" ("+k+")";
+            td1.appendChild(trending_language_label);
+
+            var td2 = document.createElement('td');
+            td2.setAttribute('style','padding-right:14px !important');
+            var trending_language = document.createElement('div');
+            var nr_files = value+" ${_('files')}";
+            
+            trending_language.title = k+" "+nr_files;
+            
+            if (percentage>22){
+                trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"% "+nr_files+ "</b>";   
+            }
+            else{
+                trending_language.innerHTML = "<b style='font-size:0.8em'>"+percentage+"%</b>";
+            }
+            
+            trending_language.setAttribute("class", 'trending_language top-right-rounded-corner bottom-right-rounded-corner');
+            trending_language.style.width=percentage+"%";
+            td2.appendChild(trending_language);
+            
+            tr.appendChild(td1);
+            tr.appendChild(td2);
+            tbl.appendChild(tr);
+            if(cnt == 3){
+                var show_more = document.createElement('tr');
+                var td = document.createElement('td');
+                lnk = document.createElement('a');
+                
+                lnk.href='#';
+                lnk.innerHTML = "${_('show more')}";
+                lnk.id='code_stats_show_more';
+                td.appendChild(lnk);
+                
+                show_more.appendChild(td);
+                show_more.appendChild(document.createElement('td'));
+                tbl.appendChild(show_more);
+            }
+            
+        }
+        if(no_data){
+            var tr = document.createElement('tr');
+            var td1 = document.createElement('td');
+            td1.innerHTML = "${c.no_data_msg}";
+            tr.appendChild(td1);
+            tbl.appendChild(tr);
+        }
+        YUD.get('lang_stats').appendChild(tbl);
+        YUE.on('code_stats_show_more','click',function(){
+            l = YUD.getElementsByClassName('stats_hidden')
+            for (e in l){
+                YUD.setStyle(l[e],'display','');
+            };
+            YUD.setStyle(YUD.get('code_stats_show_more'),
+                    'display','none');
+        })
+    
+             var tmpl_links = {}
+              %for cnt,archive in enumerate(c.rhodecode_repo._get_archives()):
+                tmpl_links['${archive['type']}'] = '${h.link_to(archive['type'],
+                     h.url('files_archive_home',repo_name=c.dbrepo.repo_name,
+                     fname='__CS__'+archive['extension'],subrepos='__SUB__'),class_="archive_icon")}';
+              %endfor
+              
+             YUE.on(['download_options','archive_subrepos'],'change',function(e){
+                 var sm = YUD.get('download_options');
+                 var new_cs = sm.options[sm.selectedIndex];
+                 
+                 for(k in tmpl_links){
+                     var s = YUD.get(k+'_link');
+                     title_tmpl = "${_('Download %s as %s') % ('__CS_NAME__','__CS_EXT__')}";
+                     s.title = title_tmpl.replace('__CS_NAME__',new_cs.text);
+                     s.title = s.title.replace('__CS_EXT__',k);
+                     var url = tmpl_links[k].replace('__CS__',new_cs.value);
+                     var subrepos = YUD.get('archive_subrepos').checked
+                     url = url.replace('__SUB__',subrepos);
+                     s.innerHTML = url 
+                 }
+             });
+    </script>   
+<script type="text/javascript">
+        /**
+         * Plots summary graph
+         *
+         * @class SummaryPlot
+         * @param {from} initial from for detailed graph
+         * @param {to} initial to for detailed graph
+         * @param {dataset}
+         * @param {overview_dataset}
+         */
+        function SummaryPlot(from,to,dataset,overview_dataset) {
+            var initial_ranges = {
+                "xaxis":{
+                    "from":from,
+                    "to":to,
+                },
+            };
+            var dataset = dataset;
+            var overview_dataset = [overview_dataset];
+            var choiceContainer = YUD.get("legend_choices");
+            var choiceContainerTable = YUD.get("legend_choices_tables");
+            var plotContainer = YUD.get('commit_history');
+            var overviewContainer = YUD.get('overview');
+            
+            var plot_options = {
+                bars: {show:true,align:'center',lineWidth:4},
+                legend: {show:true, container:"legend_container"},
+                points: {show:true,radius:0,fill:false},
+                yaxis: {tickDecimals:0,},
+                xaxis: {
+                    mode: "time", 
+                    timeformat: "%d/%m",
+                    min:from,
+                    max:to, 
+                }, 
+                grid: {
+                    hoverable: true, 
+                    clickable: true,
+                    autoHighlight:true,
+                    color: "#999"
+                },
+                //selection: {mode: "x"}
+            };
+            var overview_options = {
+                legend:{show:false},
+                bars: {show:true,barWidth: 2,},
+                shadowSize: 0,
+                xaxis: {mode: "time", timeformat: "%d/%m/%y",},
+                yaxis: {ticks: 3, min: 0,tickDecimals:0,},
+                grid: {color: "#999",},
+                selection: {mode: "x"}
+            };
+
+            /**
+            *get dummy data needed in few places
+            */
+            function getDummyData(label){
+                return {"label":label,
+                 "data":[{"time":0,
+                     "commits":0,
+                         "added":0,
+                         "changed":0,
+                         "removed":0,
+                    }],
+                    "schema":["commits"],
+                    "color":'#ffffff',
+                }
+            }
+            
+            /**
+             * generate checkboxes accordindly to data
+             * @param keys
+             * @returns
+             */
+            function generateCheckboxes(data) {
+                //append checkboxes
+                var i = 0;
+                choiceContainerTable.innerHTML = '';
+                for(var pos in data) {
+                    
+                    data[pos].color = i;
+                    i++;
+                    if(data[pos].label != ''){
+                        choiceContainerTable.innerHTML += '<tr><td>'+
+                        '<input type="checkbox" name="' + data[pos].label +'" checked="checked" />'
+                        +data[pos].label+
+                        '</td></tr>';
+                    }
+                }   
+            }
+            
+            /**
+             * ToolTip show
+             */
+            function showTooltip(x, y, contents) {
+                var div=document.getElementById('tooltip');
+                if(!div) {
+                    div = document.createElement('div');
+                    div.id="tooltip";
+                    div.style.position="absolute";
+                    div.style.border='1px solid #fdd';
+                    div.style.padding='2px';
+                    div.style.backgroundColor='#fee';
+                    document.body.appendChild(div);
+                }
+                YUD.setStyle(div, 'opacity', 0);
+                div.innerHTML = contents;
+                div.style.top=(y + 5) + "px";
+                div.style.left=(x + 5) + "px";
+
+                var anim = new YAHOO.util.Anim(div, {opacity: {to: 0.8}}, 0.2);
+                anim.animate();
+            }
+            
+            /**
+             * This function will detect if selected period has some changesets 
+               for this user if it does this data is then pushed for displaying
+               Additionally it will only display users that are selected by the checkbox
+            */
+            function getDataAccordingToRanges(ranges) {
+                
+                var data = [];
+                var new_dataset = {};
+                var keys = [];
+                var max_commits = 0;
+                for(var key in dataset){
+                    
+                    for(var ds in dataset[key].data){
+                        commit_data = dataset[key].data[ds];
+                        if (commit_data.time >= ranges.xaxis.from && commit_data.time <= ranges.xaxis.to){
+
+                            if(new_dataset[key] === undefined){
+                                new_dataset[key] = {data:[],schema:["commits"],label:key};  
+                            }
+                            new_dataset[key].data.push(commit_data);
+                        }
+                    }
+                    if (new_dataset[key] !== undefined){
+                        data.push(new_dataset[key]);    
+                    }
+                }
+
+                if (data.length > 0){
+                    return data;    
+                }
+                else{
+                    //just return dummy data for graph to plot itself
+                    return [getDummyData('')];  
+                }
+            }
+            
+            /**
+            * redraw using new checkbox data
+            */
+            function plotchoiced(e,args){
+                var cur_data = args[0];
+                var cur_ranges = args[1];
+                
+                var new_data = [];
+                var inputs = choiceContainer.getElementsByTagName("input");
+
+                //show only checked labels
+                for(var i=0; i<inputs.length; i++) {
+                    var checkbox_key = inputs[i].name;
+                    
+                    if(inputs[i].checked){
+                        for(var d in cur_data){
+                            if(cur_data[d].label == checkbox_key){
+                                new_data.push(cur_data[d]);
+                            }
+                        }                           
+                    }
+                    else{
+                        //push dummy data to not hide the label
+                        new_data.push(getDummyData(checkbox_key));
+                    }
+                }
+                            
+                var new_options = YAHOO.lang.merge(plot_options, {
+                    xaxis: { 
+                        min: cur_ranges.xaxis.from, 
+                        max: cur_ranges.xaxis.to,
+                        mode:"time",
+                        timeformat: "%d/%m",
+                    },
+                });
+                if (!new_data){
+                    new_data = [[0,1]];
+                }
+                // do the zooming
+               plot = YAHOO.widget.Flot(plotContainer, new_data, new_options);
+               
+               plot.subscribe("plotselected", plotselected);
+    
+               //resubscribe plothover
+               plot.subscribe("plothover", plothover);
+                
+               // don't fire event on the overview to prevent eternal loop 
+               overview.setSelection(cur_ranges, true);
+    
+            }
+            
+            /**
+             * plot only selected items from overview
+             * @param ranges
+             * @returns
+             */
+            function plotselected(ranges,cur_data) {
+                //updates the data for new plot
+                var data = getDataAccordingToRanges(ranges);
+                generateCheckboxes(data);
+                
+                var new_options = YAHOO.lang.merge(plot_options, {
+                    xaxis: { 
+                        min: ranges.xaxis.from, 
+                        max: ranges.xaxis.to,
+                        mode:"time",
+                        timeformat: "%d/%m",
+                    },
+                });
+                // do the zooming 
+                plot = YAHOO.widget.Flot(plotContainer, data, new_options);
+
+                plot.subscribe("plotselected", plotselected);
+
+                //resubscribe plothover
+                plot.subscribe("plothover", plothover);
+                
+                // don't fire event on the overview to prevent eternal loop
+                overview.setSelection(ranges, true);
+
+                //resubscribe choiced 
+                YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, ranges]);
+            }
+            
+            var previousPoint = null;
+
+            function plothover(o) {
+                var pos = o.pos;
+                var item = o.item;
+                
+                //YUD.get("x").innerHTML = pos.x.toFixed(2);
+                //YUD.get("y").innerHTML = pos.y.toFixed(2);
+                if (item) {
+                    if (previousPoint != item.datapoint) {
+                        previousPoint = item.datapoint;
+                        
+                        var tooltip = YUD.get("tooltip");
+                        if(tooltip) {
+                              tooltip.parentNode.removeChild(tooltip);
+                        }
+                        var x = item.datapoint.x.toFixed(2);
+                        var y = item.datapoint.y.toFixed(2);
+                        
+                        if (!item.series.label){
+                            item.series.label = 'commits';
+                        }
+                        var d = new Date(x*1000);
+                        var fd = d.toDateString()
+                        var nr_commits = parseInt(y);
+                        
+                        var cur_data = dataset[item.series.label].data[item.dataIndex];
+                        var added = cur_data.added;
+                        var changed = cur_data.changed;
+                        var removed = cur_data.removed;
+                        
+                        var nr_commits_suffix = " ${_('commits')} ";
+                        var added_suffix = " ${_('files added')} ";
+                        var changed_suffix = " ${_('files changed')} ";
+                        var removed_suffix = " ${_('files removed')} ";
+
+                        
+                        if(nr_commits == 1){nr_commits_suffix = " ${_('commit')} ";}
+                        if(added==1){added_suffix=" ${_('file added')} ";}
+                        if(changed==1){changed_suffix=" ${_('file changed')} ";}
+                        if(removed==1){removed_suffix=" ${_('file removed')} ";}
+                                                        
+                        showTooltip(item.pageX, item.pageY, item.series.label + " on " + fd
+                                 +'<br/>'+
+                                 nr_commits + nr_commits_suffix+'<br/>'+
+                                 added + added_suffix +'<br/>'+
+                                 changed + changed_suffix + '<br/>'+
+                                 removed + removed_suffix + '<br/>');
+                    }
+                }
+                else {
+                      var tooltip = YUD.get("tooltip");
+                      
+                      if(tooltip) {
+                            tooltip.parentNode.removeChild(tooltip);
+                      }
+                    previousPoint = null;
+                }
+            }
+            
+            /**
+             * MAIN EXECUTION
+             */
+            
+            var data = getDataAccordingToRanges(initial_ranges);    
+            generateCheckboxes(data);
+            
+            //main plot 
+            var plot = YAHOO.widget.Flot(plotContainer,data,plot_options);
+            
+            //overview 
+            var overview = YAHOO.widget.Flot(overviewContainer, 
+                    overview_dataset, overview_options);
+            
+            //show initial selection on overview 
+            overview.setSelection(initial_ranges);    
+            
+            plot.subscribe("plotselected", plotselected);
+            plot.subscribe("plothover", plothover)
+            
+            overview.subscribe("plotselected", function (ranges) {
+                plot.setSelection(ranges);
+            });     
+
+            YUE.on(choiceContainer.getElementsByTagName("input"), "click", plotchoiced, [data, initial_ranges]);
+        }
+            SummaryPlot(${c.ts_min},${c.ts_max},${c.commit_data|n},${c.overview_data|n});       
+        </script>
 
 </%def>    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rhodecode/templates/switch_to_list.html	Sat Oct 29 19:26:43 2011 +0200
@@ -0,0 +1,25 @@
+## -*- coding: utf-8 -*-                        
+<li>
+    ${h.link_to('%s (%s)' % (_('branches'),len(c.rhodecode_repo.branches.values()),),h.url('branches_home',repo_name=c.repo_name),class_='branches childs')}
+    <ul>
+    %if c.rhodecode_repo.branches.values():
+        %for cnt,branch in enumerate(c.rhodecode_repo.branches.items()):
+            <li>${h.link_to('%s - %s' % (branch[0],h.short_id(branch[1])),h.url('files_home',repo_name=c.repo_name,revision=branch[1]))}</li>
+        %endfor
+    %else:
+        <li>${h.link_to(_('There are no branches yet'),'#')}</li>
+    %endif
+    </ul>                        
+</li>
+<li>
+    ${h.link_to('%s (%s)' % (_('tags'),len(c.rhodecode_repo.tags.values()),),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')}
+    <ul>
+    %if c.rhodecode_repo.tags.values():
+        %for cnt,tag in enumerate(c.rhodecode_repo.tags.items()):
+         <li>${h.link_to('%s - %s' % (tag[0],h.short_id(tag[1])),h.url('files_home',repo_name=c.repo_name,revision=tag[1]))}</li>
+        %endfor
+    %else:
+        <li>${h.link_to(_('There are no tags yet'),'#')}</li>
+    %endif
+    </ul>                        
+</li>  
\ No newline at end of file
--- a/setup.py	Sat Oct 29 17:03:33 2011 +0200
+++ b/setup.py	Sat Oct 29 19:26:43 2011 +0200
@@ -24,7 +24,9 @@
         "python-dateutil>=1.5.0,<2.0.0",
         "dulwich>=0.8.0,<0.9.0",
         "vcs>=0.2.3.dev",
-        "webob==1.0.8"
+        "webob==1.0.8",
+        "markdown==2.0.3",
+        "docutils==0.8.1",
     ]
 
 dependency_links = [
--- a/test.ini	Sat Oct 29 17:03:33 2011 +0200
+++ b/test.ini	Sat Oct 29 19:26:43 2011 +0200
@@ -88,21 +88,27 @@
 
 beaker.cache.super_short_term.type=memory
 beaker.cache.super_short_term.expire=10
+beaker.cache.super_short_term.key_length = 256
 
 beaker.cache.short_term.type=memory
 beaker.cache.short_term.expire=60
+beaker.cache.short_term.key_length = 256
 
 beaker.cache.long_term.type=memory
 beaker.cache.long_term.expire=36000
+beaker.cache.long_term.key_length = 256
 
 beaker.cache.sql_cache_short.type=memory
 beaker.cache.sql_cache_short.expire=10
+beaker.cache.sql_cache_short.key_length = 256
 
 beaker.cache.sql_cache_med.type=memory
 beaker.cache.sql_cache_med.expire=360
+beaker.cache.sql_cache_med.key_length = 256
 
 beaker.cache.sql_cache_long.type=file
 beaker.cache.sql_cache_long.expire=3600
+beaker.cache.sql_cache_long.key_length = 256
 
 ####################################
 ###       BEAKER SESSION        ####
@@ -143,7 +149,7 @@
 #########################################################
 sqlalchemy.db1.url = sqlite:///%(here)s/test.db
 #sqlalchemy.db1.url = postgresql://postgres:qwe@localhost/rhodecode_tests
-#sqlalchemy.db1.echo = False
+#sqlalchemy.db1.echo = false
 #sqlalchemy.db1.pool_recycle = 3600
 sqlalchemy.convert_unicode = true