<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>app/controllers/application_controller.rb</filename>
    </added>
    <added>
      <filename>app/controllers/password_resets_controller.rb</filename>
    </added>
    <added>
      <filename>app/controllers/user_sessions_controller.rb</filename>
    </added>
    <added>
      <filename>app/models/notifier.rb</filename>
    </added>
    <added>
      <filename>app/models/posts/blog.rb</filename>
    </added>
    <added>
      <filename>app/models/posts/code.rb</filename>
    </added>
    <added>
      <filename>app/models/posts/image.rb</filename>
    </added>
    <added>
      <filename>app/models/posts/link.rb</filename>
    </added>
    <added>
      <filename>app/models/posts/quote.rb</filename>
    </added>
    <added>
      <filename>app/models/posts/video.rb</filename>
    </added>
    <added>
      <filename>app/models/user_session.rb</filename>
    </added>
    <added>
      <filename>app/views/comments/_comment.html.haml</filename>
    </added>
    <added>
      <filename>app/views/comments/_form.html.haml</filename>
    </added>
    <added>
      <filename>app/views/comments/edit.html.haml</filename>
    </added>
    <added>
      <filename>app/views/comments/index.atom.builder</filename>
    </added>
    <added>
      <filename>app/views/comments/new.html.haml</filename>
    </added>
    <added>
      <filename>app/views/layouts/_sidebar.html.haml</filename>
    </added>
    <added>
      <filename>app/views/layouts/application.html.haml</filename>
    </added>
    <added>
      <filename>app/views/notifier/activation_confirmation.erb</filename>
    </added>
    <added>
      <filename>app/views/notifier/activation_instructions.erb</filename>
    </added>
    <added>
      <filename>app/views/notifier/new_comment_alert.erb</filename>
    </added>
    <added>
      <filename>app/views/notifier/password_reset_instructions.erb</filename>
    </added>
    <added>
      <filename>app/views/password_resets/edit.html.haml</filename>
    </added>
    <added>
      <filename>app/views/password_resets/new.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/_form.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/_post.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/_preview.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/edit.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/forms/_blog.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/forms/_code.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/forms/_image.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/forms/_link.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/forms/_quote.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/forms/_video.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/index.atom.builder</filename>
    </added>
    <added>
      <filename>app/views/posts/index.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/new.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/search.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/show.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/types/_blog.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/types/_code.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/types/_image.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/types/_link.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/types/_quote.html.haml</filename>
    </added>
    <added>
      <filename>app/views/posts/types/_video.html.haml</filename>
    </added>
    <added>
      <filename>app/views/user_sessions/new.html.haml</filename>
    </added>
    <added>
      <filename>app/views/users/_form.html.haml</filename>
    </added>
    <added>
      <filename>app/views/users/_user.html.haml</filename>
    </added>
    <added>
      <filename>app/views/users/delete.html.haml</filename>
    </added>
    <added>
      <filename>app/views/users/edit.html.haml</filename>
    </added>
    <added>
      <filename>app/views/users/index.html.haml</filename>
    </added>
    <added>
      <filename>app/views/users/new.html.haml</filename>
    </added>
    <added>
      <filename>app/views/users/show.html.haml</filename>
    </added>
    <added>
      <filename>config/database.yml.example</filename>
    </added>
    <added>
      <filename>config/initializers/backtrace_silencers.rb</filename>
    </added>
    <added>
      <filename>config/initializers/bumble.rb</filename>
    </added>
    <added>
      <filename>config/initializers/haml.rb</filename>
    </added>
    <added>
      <filename>config/initializers/session_store.rb</filename>
    </added>
    <added>
      <filename>config/initializers/will_paginate.rb</filename>
    </added>
    <added>
      <filename>config/locales/en.yml</filename>
    </added>
    <added>
      <filename>config/schedule.rb</filename>
    </added>
    <added>
      <filename>config/sitemap.rb</filename>
    </added>
    <added>
      <filename>config/sphinx.yml</filename>
    </added>
    <added>
      <filename>db/migrate/20090616230112_create_users.rb</filename>
    </added>
    <added>
      <filename>db/migrate/20090617192039_create_posts.rb</filename>
    </added>
    <added>
      <filename>db/migrate/20090617194117_create_comments.rb</filename>
    </added>
    <added>
      <filename>db/migrate/20090719154022_add_url_to_users.rb</filename>
    </added>
    <added>
      <filename>db/migrate/20090723085933_add_delta_to_posts.rb</filename>
    </added>
    <added>
      <filename>db/sphinx/development/post_core.spa</filename>
    </added>
    <added>
      <filename>db/sphinx/development/post_core.spd</filename>
    </added>
    <added>
      <filename>db/sphinx/development/post_core.sph</filename>
    </added>
    <added>
      <filename>db/sphinx/development/post_core.spi</filename>
    </added>
    <added>
      <filename>db/sphinx/development/post_core.spm</filename>
    </added>
    <added>
      <filename>db/sphinx/development/post_core.spp</filename>
    </added>
    <added>
      <filename>db/sphinx/development/post_delta.spa</filename>
    </added>
    <added>
      <filename>db/sphinx/development/post_delta.spd</filename>
    </added>
    <added>
      <filename>db/sphinx/development/post_delta.sph</filename>
    </added>
    <added>
      <filename>db/sphinx/development/post_delta.spi</filename>
    </added>
    <added>
      <filename>db/sphinx/development/post_delta.spm</filename>
    </added>
    <added>
      <filename>db/sphinx/development/post_delta.spp</filename>
    </added>
    <added>
      <filename>lib/tasks/coverage.rake</filename>
    </added>
    <added>
      <filename>log/.gitignore</filename>
    </added>
    <added>
      <filename>public/images/.gitignore</filename>
    </added>
    <added>
      <filename>public/images/close.png</filename>
    </added>
    <added>
      <filename>public/images/email.png</filename>
    </added>
    <added>
      <filename>public/images/feed.png</filename>
    </added>
    <added>
      <filename>public/images/loading.gif</filename>
    </added>
    <added>
      <filename>public/images/preview.png</filename>
    </added>
    <added>
      <filename>public/images/youtube.png</filename>
    </added>
    <added>
      <filename>public/javascripts/iphone.js</filename>
    </added>
    <added>
      <filename>public/javascripts/jquery.hint.js</filename>
    </added>
    <added>
      <filename>public/javascripts/jquery.jgrow.js</filename>
    </added>
    <added>
      <filename>public/javascripts/jquery.livequery.js</filename>
    </added>
    <added>
      <filename>public/stylesheets/iphone.css</filename>
    </added>
    <added>
      <filename>public/stylesheets/print.css</filename>
    </added>
    <added>
      <filename>public/stylesheets/reset.css</filename>
    </added>
    <added>
      <filename>public/stylesheets/sass/application.sass</filename>
    </added>
    <added>
      <filename>public/stylesheets/sass/iphone.sass</filename>
    </added>
    <added>
      <filename>public/stylesheets/sass/print.sass</filename>
    </added>
    <added>
      <filename>public/stylesheets/sass/reset.sass</filename>
    </added>
    <added>
      <filename>test/factories.rb</filename>
    </added>
    <added>
      <filename>test/fixtures/.gitignore</filename>
    </added>
    <added>
      <filename>test/functional/password_resets_controller_test.rb</filename>
    </added>
    <added>
      <filename>test/integration/.gitignore</filename>
    </added>
    <added>
      <filename>test/unit/helpers/application_helper_test.rb</filename>
    </added>
    <added>
      <filename>tmp/.gitignore</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/DEFAULTS</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/LICENSE</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/README</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/Rakefile</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/VERSION</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/generators/resourceful_scaffold/resourceful_scaffold_generator.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/generators/resourceful_scaffold/templates/controller.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/generators/resourceful_scaffold/templates/fixtures.yml</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/generators/resourceful_scaffold/templates/functional_test.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/generators/resourceful_scaffold/templates/helper.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/generators/resourceful_scaffold/templates/migration.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/generators/resourceful_scaffold/templates/model.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/generators/resourceful_scaffold/templates/unit_test.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/generators/resourceful_scaffold/templates/view__form.haml</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/generators/resourceful_scaffold/templates/view_edit.haml</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/generators/resourceful_scaffold/templates/view_index.haml</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/generators/resourceful_scaffold/templates/view_new.haml</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/generators/resourceful_scaffold/templates/view_partial.haml</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/generators/resourceful_scaffold/templates/view_show.haml</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/init.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/lib/resourceful/base.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/lib/resourceful/builder.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/lib/resourceful/default/accessors.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/lib/resourceful/default/actions.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/lib/resourceful/default/callbacks.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/lib/resourceful/default/responses.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/lib/resourceful/default/urls.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/lib/resourceful/maker.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/lib/resourceful/response.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/lib/resourceful/serialize.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/spec/accessors_spec.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/spec/actions_spec.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/spec/base_spec.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/spec/builder_spec.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/spec/callbacks_spec.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/spec/integration_spec.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/spec/maker_spec.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/spec/response_spec.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/spec/responses_spec.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/spec/rspec-rails/LICENSE</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/spec/rspec-rails/redirect_to.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/spec/rspec-rails/render_template.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/spec/serialize_spec.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/spec/spec_helper.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/make_resourceful/spec/urls_spec.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/permalink_fu/README.markdown</filename>
    </added>
    <added>
      <filename>vendor/plugins/permalink_fu/Rakefile</filename>
    </added>
    <added>
      <filename>vendor/plugins/permalink_fu/lib/permalink_fu/rake/tasks.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/permalink_fu/lib/permalink_fu/spec.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/permalink_fu/lib/permalink_fu/spec/matchers.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/permalink_fu/permalink_fu.gemspec</filename>
    </added>
    <added>
      <filename>vendor/plugins/permalink_fu/permalink_fu.gemspec.erb</filename>
    </added>
    <added>
      <filename>vendor/plugins/permalink_fu/rails/tasks/permalink_fu.rake</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/MIT-LICENSE</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/README.md</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/Rakefile</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/init.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/install.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/lib/autotest/discover.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/lib/sitemap_generator.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/lib/sitemap_generator/helper.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/lib/sitemap_generator/link.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/lib/sitemap_generator/link_set.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/lib/sitemap_generator/mapper.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/spec/sitemap_generator_spec.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/spec/spec.opts</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/spec/spec_helper.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/tasks/sitemap_generator_tasks.rake</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/templates/sitemap.rb</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/templates/sitemap_index.builder</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/templates/xml_sitemap.builder</filename>
    </added>
    <added>
      <filename>vendor/plugins/sitemap_generator-plugin/uninstall.rb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -3,7 +3,6 @@ Bumble - A ruby tumblog
 Homepage: http://teabass.com/
 Author: Andrew Nesbitt (http://teabass.com)
 Github: http://github.com/andrew/bumble
-Background: http://www.colourlovers.com/pattern/37703/Gothic_Devine
 
 Copyright (c) 2008 Andrew Nesbitt
 </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -8,3 +8,8 @@ require 'rake/testtask'
 require 'rake/rdoctask'
 
 require 'tasks/rails'
+
+begin
+  require 'thinking_sphinx/tasks'
+rescue LoadError
+end
\ No newline at end of file</diff>
      <filename>Rakefile</filename>
    </modified>
    <modified>
      <diff>@@ -1,39 +1,67 @@
 class CommentsController &lt; ApplicationController
 
-  resources_controller_for :comments
-  nested_in :post do
-    logged_in_scope.find_by_permalink(params[:post_id]) or logged_in_scope.find(params[:post_id])
-  end
-  
-  response_for :show, :index do |format|
-    format.html do
-      redirect_to post_path(resource.post), :status =&gt; :moved_permanently
+  before_filter :require_user, :only =&gt; [:edit, :update, :destroy]
+
+  make_resourceful do
+    actions :all
+    belongs_to :post
+    before :create do
+      current_object.user = current_user
     end
-  end
-  
-  response_for :create do |format|
-    if resource_saved?
+
+    response_for :index do |format|
+      format.html { redirect_to post_path(parent_object, :anchor =&gt; 'comments') }
+      format.atom {}
+      format.js { render current_objects }
+    end
+
+    response_for :show do |format|
+      format.html { redirect_to post_path(parent_object, :anchor =&gt; dom_id(current_object)) }
+    end
+
+    response_for :destroy do |format|
       format.html do
-        redirect_to post_path(resource.post), :status =&gt; :moved_permanently
+        flash[:notice] = 'Record deleted!'
+        redirect_to post_path(parent_object)
       end
-      format.js
-    else
+    end
+
+    response_for :update do |format|
       format.html do
-        render :action =&gt; &quot;new&quot;
+        flash[:notice] = 'Save successful!'
+        redirect_to post_path(parent_object, :anchor =&gt; dom_id(current_object))
       end
-      format.js do
-        # if the jquery validation is working, this should never happen
-        render :text =&gt; &quot;some error message&quot;
+    end
+
+    response_for :create do |format|
+      format.html do
+        flash[:notice] = 'Create successful!'
+        redirect_to post_path(parent_object, :anchor =&gt; dom_id(current_object))
+      end
+      format.js { render current_object }
+    end
+
+    response_for :create_fails do |format|
+      format.html { render :action =&gt; &quot;new&quot; }
+      format.js   { render :text =&gt; current_object.errors.full_messages.join(', ').capitalize, :status =&gt; 403 }
+    end
+
+    response_for :destroy do |format|
+      format.html do
+        flash[:notice] = 'Record deleted!'
+        redirect_to post_path(current_object.post)
       end
+      format.js { render :nothing =&gt; true }
     end
   end
 
   private
 
-  def new_resource
-    returning resource_service.new(params[resource_name]) do |comment|
-      comment.user = current_user if logged_in?
-    end
+  def parent_model
+    current_user ? super : Post.published.all_public
   end
 
-end
+  def parent_object
+    @parent_object ||= parent_model.find_by_permalink_or_id(params[&quot;#{parent_name}_id&quot;])
+  end
+end
\ No newline at end of file</diff>
      <filename>app/controllers/comments_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,45 +1,80 @@
 class PostsController &lt; ApplicationController
+  before_filter :require_user, :except =&gt; [:index, :show, :search]
 
-  resources_controller_for :posts
-  
-  before_filter :login_required, :except =&gt; [:index, :show]
+  make_resourceful do
+    actions :all
 
-  response_for :create do |format|
-    if resource_saved?
+    response_for :index do |format|
+      format.html
+      format.atom
+    end
+
+    response_for :destroy do |format|
       format.html do
-        redirect_to post_path(resource.post), :status =&gt; :moved_permanently
+        flash[:notice] = &quot;Record deleted!&quot;
+        redirect_to posts_path
       end
-      format.js do
-        @posts = find_resources
-        render :partial =&gt; 'posts'
+      format.js { render :nothing =&gt; true }
+    end
+  end
+
+  def create
+    build_object
+    load_object
+    current_object.user = current_user
+    if params[:commit] == &quot;Preview&quot;
+      respond_to do |format|
+        format.html do
+          flash[:notice] = 'Create successful!'
+          redirect_to post_path(current_object)
+        end
+        format.js { render :partial =&gt; 'preview', :locals =&gt; {:post =&gt; current_object} }
       end
     else
-      format.html do
-        render :action =&gt; &quot;new&quot;
-      end
-      format.js do
-        # if the jquery validation is working, this should never happen
-        render :text =&gt; &quot;some error message&quot;
+      if current_object.save
+        respond_to do |format|
+          format.html do
+            flash[:notice] = 'Create successful!'
+            redirect_to post_path(current_object)
+          end
+          format.js { render :partial =&gt; 'post', :locals =&gt; {:post =&gt; current_object} }
+        end
+      else
+        respond_to do |format|
+          format.html { render :action =&gt; &quot;new&quot; }
+          format.js   { render :text =&gt; current_object.errors.full_messages.join(', ').capitalize, :status =&gt; 403 }
+        end
       end
     end
   end
 
+  def search
+    @posts = current_model.search(params[:query], :page =&gt; params[:page]).compact
+  end
+
   private
-  
-  def find_resources
-    klass = params[:klass].blank? ? Post : class_from_params(params[:klass].capitalize)
-    logged_in_scope(klass).paginate :page =&gt; params[:page], :order =&gt; 'created_at DESC'
+
+  def build_object
+    Post.types.each do |t|
+      if params.include?(t.downcase)
+        @current_object = Object.const_get(t).new(params[t.downcase])
+      end
+    end
+    @current_object ||= Blog.new
   end
 
-  def find_resource
-    logged_in_scope.find_by_permalink(params[:id]) or logged_in_scope.find(params[:id])
+  def current_objects
+    @current_object ||= current_model.paginate  :page =&gt; params[:page],
+                                                :order =&gt; 'published_at DESC',
+                                                :per_page =&gt; (iphone? ? 5 : 10),
+                                                :include =&gt; :comments
   end
-  
-  def new_resource
-    klass = (params[:post].nil? or params[:post][:type].nil?) ? Post : class_from_params(params[:post][:type])
-    returning klass.new(params[resource_name]) do |post|
-      post.user = current_user
-    end
+
+  def current_model
+    current_user ? super : Post.published.all_public
   end
 
-end
\ No newline at end of file
+  def current_object
+    @current_object ||= current_model.find_by_permalink_or_id(params[:id])
+  end
+end</diff>
      <filename>app/controllers/posts_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,49 +1,37 @@
 class UsersController &lt; ApplicationController
+  before_filter :require_user, :except =&gt; [:activate]
 
-  resources_controller_for :users
-  
-  before_filter :login_required, :except =&gt; [:new, :create, :activate, :forgot_password, :reset_password]
-
-  def activate
-    self.current_user = params[:activation_code].blank? ? false : User.find_by_activation_code(params[:activation_code])
-    if logged_in? &amp;&amp; !current_user.active?
-      current_user.activate
-      flash[:notice] = &quot;Signup complete!&quot;
-    end
-    redirect_back_or_default('/')
+  make_resourceful do
+    actions :all, :except =&gt; :create
+    member_actions :delete
   end
-  
-  def forgot_password
-    return unless request.post?
-    if @user = User.find_by_email(params[:email])
-      @user.forgot_password
-      @user.save
-      redirect_to '/'
-      flash[:notice] = &quot;A password reset link has been sent to your email address&quot; 
+
+  def create
+    @user = User.new(params[:user])
+    if @user.save_without_session_maintenance
+      @user.deliver_activation_instructions!
+      flash[:notice] = &quot;Your account has been created. Please check your e-mail for your account activation instructions!&quot;
+      redirect_to login_path
     else
-      flash[:notice] = &quot;Could not find a user with that email address&quot; 
+      render :action =&gt; :new
     end
   end
-  
-  def reset_password
-    if !params[:id].blank? and @user = User.find_by_password_reset_code(params[:id])
-      @password_reset_code = params[:id]
-      return if @user unless params[:password]
-      if (params[:password] == params[:password_confirmation])
-        self.current_user = @user #for the next two lines to work
-        current_user.password_confirmation = params[:password_confirmation]
-        current_user.password = params[:password]
-        @user.reset_password
-        flash[:notice] = current_user.save ? &quot;Password changed and we logged you in&quot; : &quot;Password not changed&quot;
-        redirect_back_or_default(root_path)
-      else
-        flash[:notice] = &quot;Password mismatch, go back and click the email link again&quot; 
-        redirect_to '/home'
-      end  
+
+  def activate
+    @user = User.find_using_perishable_token(params[:activation_code], 1.week) || (raise Exception)
+    if @user.activate!
+      @user.deliver_activation_confirmation!
+      flash[:notice] = &quot;Your account has been activated.&quot;
+      UserSession.create(@user)
+      redirect_to root_path
     else
-      flash[:notice] = &quot;No password reset code = no password reset love&quot; 
-      redirect_to '/home'
+      render :action =&gt; :new
     end
   end
 
+  private
+
+  def current_objects
+    @current_object ||= current_model.paginate :page =&gt; params[:page]
+  end
 end</diff>
      <filename>app/controllers/users_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,35 @@
 module ApplicationHelper
+  def render_post(post)
+    render :partial =&gt; &quot;posts/types/#{post.class.to_s.downcase}.html.haml&quot;, :object =&gt; post
+  end
+
+  def format_datetime_ago(time)
+    if time &gt; 5.days.ago
+      formatted = time_ago_in_words(time).capitalize
+      formatted.insert(0, 'Live in ') if time &gt; Time.now
+      formatted.insert(formatted.length, ' ago') if time &lt; Time.now
+    end
+
+    content_tag :abbr, formatted || time.strftime('%d %b %y'), :title =&gt; time.iso8601, :class =&gt; 'published updated'
+  end
 
-  def comment_display_url(comment)
-    # TODO perhaps change this to comment.user.url
-    comment.user_id.blank? ? comment.author_url : user_path(comment.user) 
+  def page_title
+    [DOMAIN, @page_title].compact.reject(&amp;:blank?).join(' | ')
   end
 
-end
\ No newline at end of file
+  def markdown(content)
+    sanitize(super, :tags =&gt; %w(a p pre code b strong em i strike ul ol li blockquote br))
+  end
+
+  def youtube_embed(link, width = 500, height = 300)
+    link.gsub(/http:\/\/(www.)?youtube\.com\/watch\?v=([A-Za-z0-9._%-]*)(\&amp;\S+)?/) do
+      youtube_id = $2
+      content_tag :object, :width =&gt; width, :height =&gt; height, :data =&gt; &quot;http://www.youtube.com/v/#{youtube_id}&quot; do
+        tag(:param, :name =&gt; 'movie', :value =&gt; &quot;http://www.youtube.com/v/#{youtube_id}&quot;) +
+        tag(:param, :name =&gt; 'allowFullScreen', :value =&gt; 'true') +
+        tag(:param, :name =&gt; 'allowscriptaccess', :value =&gt; 'always') +
+        tag(:embed, :src =&gt; &quot;http://www.youtube.com/v/#{youtube_id}&quot;, :type =&gt; 'application/x-shockwave-flash', :allowscriptaccess =&gt; 'always', :allowfullscreen =&gt; 'true', :width =&gt; width, :height =&gt; height)
+      end
+    end
+  end
+end</diff>
      <filename>app/helpers/application_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,22 +1,40 @@
 class Comment &lt; ActiveRecord::Base
 
-  belongs_to :post # TODO , :counter_cache =&gt; true
+  is_paranoid
+
+  belongs_to :post
   belongs_to :user
-  
+
   validates_presence_of :post, :body
   validates_presence_of :author_name, :author_email, :if =&gt; :anonymous?
   validates_format_of :author_email, :with =&gt; /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i, :allow_blank =&gt; :true
 
+  is_gravtastic :with =&gt; :email, :rating =&gt; 'R', :size =&gt; 30
+
+  after_save :set_parent_delta
+  after_create :email_post_author
+
+  def set_parent_delta
+    self.post.update_attributes(:delta =&gt; true)
+  end
+
+  def email_post_author
+    Notifier.deliver_new_comment_alert(self) unless user_id == post.user_id
+  end
+
   def anonymous?
     !user_id?
   end
-  
-  def display_email
+
+  def email
     user_id.blank? ? author_email : user.email
   end
-  
-  def display_name
-    user_id.blank? ? author_name : user.login
+
+  def author
+    user_id.blank? ? author_name : user.to_s
+  end
+
+  def author_url
+    anonymous? ? read_attribute(:author_url) : user.url
   end
-  
 end
\ No newline at end of file</diff>
      <filename>app/models/comment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,25 +1,56 @@
 class Post &lt; ActiveRecord::Base
-  
-  TYPES = %w(Blog Video Quote Image Link Code)
-  
-  has_many :comments
+  is_paranoid
+
+  has_many :comments, :dependent =&gt; :destroy
   belongs_to :user
-  
-  has_permalink :title
-  
-  validates_presence_of :user
-  validates_inclusion_of :type, :in =&gt; TYPES
-    
+
+  has_permalink :title, :unless =&gt; Proc.new { |post| post.read_attribute(:title).blank? }
+
+  validates_presence_of :user, :published_at
+
   def to_param
-    # TODO needs more love
-    title.blank? ? &quot;#{id}&quot; : &quot;#{permalink}&quot;
+    permalink.blank? ? id.to_s : permalink
   end
-  
+
+  def self.types
+    Dir[&quot;#{RAILS_ROOT}/app/models/posts/*.rb&quot;].each { |f| require_dependency f }
+    self.subclasses.collect(&amp;:to_s).sort
+  end
+
+  def self.find_by_permalink_or_id(param)
+    Post.find_by_permalink(param) || Post.find(param)
+  end
+
   cattr_reader :per_page
-  @@per_page = 10
-  
+  @@per_page = 5
+
   named_scope :all_public, :conditions =&gt; {:publicly_viewable =&gt; true}
   named_scope :all_private, :conditions =&gt; {:publicly_viewable =&gt; false}
   named_scope :published, lambda {{:conditions =&gt; [&quot;published_at &lt; :now&quot;, { :now =&gt; Time.now.utc }]}}
 
-end
+  def title
+    read_attribute(:title).blank? ? &quot;Post #{id}&quot; : read_attribute(:title)
+  end
+
+  define_index do
+    # fields
+    indexes :title
+    indexes :link_url
+    indexes :image_url
+    indexes :video_embed
+    indexes :description
+    indexes :quote
+    indexes :permalink
+    indexes :type
+    indexes :via
+
+    indexes comments.body, :as =&gt; :comments_body
+
+    # attributes
+    has :created_at, :updated_at, :published_at, :user_id
+
+    where 'posts.deleted_at IS NULL AND posts.publicly_viewable = 1'
+
+    set_property :delta =&gt; true
+  end
+end
\ No newline at end of file</diff>
      <filename>app/models/post.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,100 +1,35 @@
-require 'digest/sha1'
 class User &lt; ActiveRecord::Base
-  # Virtual attribute for the unencrypted password
-  attr_accessor :password
 
-  validates_presence_of     :login, :email
-  validates_presence_of     :password,                   :if =&gt; :password_required?
-  validates_presence_of     :password_confirmation,      :if =&gt; :password_required?
-  validates_length_of       :password, :within =&gt; 4..40, :if =&gt; :password_required?
-  validates_confirmation_of :password,                   :if =&gt; :password_required?
-  validates_length_of       :login,    :within =&gt; 3..40
-  validates_length_of       :email,    :within =&gt; 3..100
-  validates_uniqueness_of   :login, :email, :case_sensitive =&gt; false
-  before_save :encrypt_password
-  before_create :make_activation_code 
-  # prevents a user from submitting a crafted form that bypasses activation
-  # anything else you want your user to change should be added here.
-  attr_accessible :login, :email, :password, :password_confirmation
+  acts_as_authentic
 
-  # Activates the user in the database.
-  def activate
-    @activated = true
-    self.activated_at = Time.now.utc
-    self.activation_code = nil
-    save(false)
-  end
-
-  def active?
-    # the existence of an activation code means they have not activated yet
-    activation_code.nil?
-  end
-
-  # Authenticates a user by their login name and unencrypted password.  Returns the user or nil.
-  def self.authenticate(login, password)
-    u = find :first, :conditions =&gt; ['login = ? and activated_at IS NOT NULL', login] # need to get the salt
-    u &amp;&amp; u.authenticated?(password) ? u : nil
-  end
-
-  # Encrypts some data with the salt.
-  def self.encrypt(password, salt)
-    Digest::SHA1.hexdigest(&quot;--#{salt}--#{password}--&quot;)
-  end
-
-  # Encrypts the password with the user salt
-  def encrypt(password)
-    self.class.encrypt(password, salt)
-  end
+  is_paranoid
 
-  def authenticated?(password)
-    crypted_password == encrypt(password)
-  end
+  validates_presence_of :first_name
 
-  def remember_token?
-    remember_token_expires_at &amp;&amp; Time.now.utc &lt; remember_token_expires_at 
+  def to_s
+    first_name
   end
 
-  # These create and unset the fields required for remembering users between browser closes
-  def remember_me
-    remember_me_for 2.weeks
+  def name
+    [first_name, last_name].reject(&amp;:blank?).join(' ')
   end
 
-  def remember_me_for(time)
-    remember_me_until time.from_now.utc
+  def activate!
+    self.update_attributes(:activated_at =&gt; Time.now)
   end
 
-  def remember_me_until(time)
-    self.remember_token_expires_at = time
-    self.remember_token            = encrypt(&quot;#{email}--#{remember_token_expires_at}&quot;)
-    save(false)
+  def deliver_password_reset_instructions!
+    reset_perishable_token!
+    Notifier.deliver_password_reset_instructions(self)
   end
 
-  def forget_me
-    self.remember_token_expires_at = nil
-    self.remember_token            = nil
-    save(false)
+  def deliver_activation_instructions!
+    reset_perishable_token!
+    Notifier.deliver_activation_instructions(self)
   end
 
-  # Returns true if the user has just been activated.
-  def recently_activated?
-    @activated
+  def deliver_activation_confirmation!
+    reset_perishable_token!
+    Notifier.deliver_activation_confirmation(self)
   end
-
-  protected
-    # before filter 
-    def encrypt_password
-      return if password.blank?
-      self.salt = Digest::SHA1.hexdigest(&quot;--#{Time.now.to_s}--#{login}--&quot;) if new_record?
-      self.crypted_password = encrypt(password)
-    end
-      
-    def password_required?
-      crypted_password.blank? || !password.blank?
-    end
-    
-    def make_activation_code
-
-      self.activation_code = Digest::SHA1.hexdigest( Time.now.to_s.split(//).sort_by {rand}.join )
-    end
-    
-end
+end
\ No newline at end of file</diff>
      <filename>app/models/user.rb</filename>
    </modified>
    <modified>
      <diff>@@ -44,6 +44,7 @@ module Rails
     def load_initializer
       require &quot;#{RAILS_ROOT}/vendor/rails/railties/lib/initializer&quot;
       Rails::Initializer.run(:install_gem_spec_stubs)
+      Rails::GemDependency.add_frozen_gem_path
     end
   end
 
@@ -67,7 +68,7 @@ module Rails
 
     class &lt;&lt; self
       def rubygems_version
-        Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
+        Gem::RubyGemsVersion rescue nil
       end
 
       def gem_version
@@ -82,14 +83,14 @@ module Rails
 
       def load_rubygems
         require 'rubygems'
-
-        unless rubygems_version &gt;= '0.9.4'
-          $stderr.puts %(Rails requires RubyGems &gt;= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
+        min_version = '1.3.1'
+        unless rubygems_version &gt;= min_version
+          $stderr.puts %Q(Rails requires RubyGems &gt;= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
           exit 1
         end
 
       rescue LoadError
-        $stderr.puts %(Rails requires RubyGems &gt;= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
+        $stderr.puts %Q(Rails requires RubyGems &gt;= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
         exit 1
       end
 </diff>
      <filename>config/boot.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,19 +1,23 @@
-# SQLite version 3.x
-#   gem install sqlite3-ruby (not necessary on OS X Leopard)
 development:
-  adapter: sqlite3
-  database: db/development.sqlite3
-  timeout: 5000
+  adapter: mysql
+  database: bumble_development
+  username: root
+  password:
+  encoding: utf8
 
 # Warning: The database defined as &quot;test&quot; will be erased and
 # re-generated from your development database when you run &quot;rake&quot;.
 # Do not set this db to the same as development or production.
 test:
-  adapter: sqlite3
-  database: db/test.sqlite3
-  timeout: 5000
+  adapter: mysql
+  database: bumble_test
+  username: root
+  password:
+  encoding: utf8
 
 production:
-  adapter: sqlite3
-  database: db/production.sqlite3
-  timeout: 5000
+  adapter: mysql
+  database: bumble_production
+  username: root
+  password: r93npx4h
+  encoding: utf8
\ No newline at end of file</diff>
      <filename>config/database.yml</filename>
    </modified>
    <modified>
      <diff>@@ -1,67 +1,51 @@
 # Be sure to restart your server when you modify this file
 
-# Uncomment below to force Rails into production mode when
-# you don't control web/app server and can't set it the proper way
-# ENV['RAILS_ENV'] ||= 'production'
-
 # Specifies gem version of Rails to use when vendor/rails is not present
-RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
+RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
 
 # Bootstrap the Rails environment, frameworks, and default configuration
 require File.join(File.dirname(__FILE__), 'boot')
 
 Rails::Initializer.run do |config|
+  config.gem 'freelancing-god-thinking-sphinx', :version =&gt; '&gt;=1.1.24', :lib =&gt; 'thinking_sphinx',  :source =&gt; 'http://gems.github.com'
+  config.gem 'mislav-will_paginate',            :version =&gt; '&gt;=2.3.11', :lib =&gt; 'will_paginate',    :source =&gt; 'http://gems.github.com'
+  config.gem 'jchupp-is_paranoid',              :version =&gt; '&gt;=0.8.2',  :lib =&gt; 'is_paranoid',      :source =&gt; 'http://gems.github.com'
+  config.gem 'javan-whenever',                  :version =&gt; '&gt;=0.3.6',  :lib =&gt; false,              :source =&gt; 'http://gems.github.com'
+  config.gem 'gravtastic',                      :version =&gt; '&gt;=2.1.3'
+  config.gem 'authlogic',                       :version =&gt; '&gt;=2.1.1'
+  config.gem 'scrobbler',                       :version =&gt; '&gt;=0.2.3'
+  config.gem 'bluecloth',                       :version =&gt; '&gt;=2.0.5'
+  config.gem 'haml',                            :version =&gt; '&gt;=2.2.2'
+
   # Settings in config/environments/* take precedence over those specified here.
   # Application configuration should go into files in config/initializers
   # -- all .rb files in that directory are automatically loaded.
-  # See Rails::Configuration for more options.
 
-  # Skip frameworks you're not going to use. To use Rails without a database
-  # you must remove the Active Record framework.
-  # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
+  # Add additional load paths for your own custom dirs
+  config.load_paths += %W( #{RAILS_ROOT}/app/models/posts/ )
 
-  # Specify gems that this application depends on. 
-  # They can then be installed with &quot;rake gems:install&quot; on new installations.
+  # Specify gems that this application depends on and have them installed with rake gems:install
   # config.gem &quot;bj&quot;
   # config.gem &quot;hpricot&quot;, :version =&gt; '0.6', :source =&gt; &quot;http://code.whytheluckystiff.net&quot;
+  # config.gem &quot;sqlite3-ruby&quot;, :lib =&gt; &quot;sqlite3&quot;
   # config.gem &quot;aws-s3&quot;, :lib =&gt; &quot;aws/s3&quot;
 
-  # Only load the plugins named here, in the order given. By default, all plugins 
-  # in vendor/plugins are loaded in alphabetical order.
+  # Only load the plugins named here, in the order given (default is alphabetical).
   # :all can be used as a placeholder for all plugins not explicitly named
   # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
 
-  # Add additional load paths for your own custom dirs
-  # config.load_paths += %W( #{RAILS_ROOT}/extras )
+  # Skip frameworks you're not going to use. To use Rails without a database,
+  # you must remove the Active Record framework.
+  # config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
 
-  # Force all environments to use the same logger level
-  # (by default production uses :info, the others :debug)
-  # config.log_level = :debug
+  # Activate observers that should always be running
+  # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
 
-  # Make Time.zone default to the specified zone, and make Active Record store time values
-  # in the database in UTC, and return them converted to the specified local zone.
-  # Run &quot;rake -D time&quot; for a list of tasks for finding time zone names. Uncomment to use default local time.
+  # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
+  # Run &quot;rake -D time&quot; for a list of tasks for finding time zone names.
   config.time_zone = 'UTC'
 
-  # Your secret key for verifying cookie session data integrity.
-  # If you change this key, all old sessions will become invalid!
-  # Make sure the secret is at least 30 characters and all random, 
-  # no regular words or you'll be exposed to dictionary attacks.
-  config.action_controller.session = {
-    :session_key =&gt; '_bumble_session',
-    :secret      =&gt; '9ee0e6548a2e6d03775526d18bbd8b99aff92063b80885df1c77b98cf532573929ebf63535d30186d396a203015361d97fa0bba48065f1280f077aa25aa7a8e4'
-  }
-
-  # Use the database for sessions instead of the cookie-based default,
-  # which shouldn't be used to store highly confidential information
-  # (create the session table with &quot;rake db:sessions:create&quot;)
-  # config.action_controller.session_store = :active_record_store
-
-  # Use SQL instead of Active Record's schema dumper when creating the test database.
-  # This is necessary if your schema can't be completely dumped by the schema dumper,
-  # like if you have constraints or database-specific column types
-  # config.active_record.schema_format = :sql
-
-  # Activate observers that should always be running
-  # config.active_record.observers = :cacher, :garbage_collector
-end
+  # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
+  # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}')]
+  # config.i18n.default_locale = :de
+end
\ No newline at end of file</diff>
      <filename>config/environment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,4 +14,6 @@ config.action_view.debug_rjs                         = true
 config.action_controller.perform_caching             = false
 
 # Don't care if the mailer can't send
-config.action_mailer.raise_delivery_errors = false
\ No newline at end of file
+config.action_mailer.raise_delivery_errors = false
+
+config.action_mailer.default_url_options = { :host =&gt; 'localhost' }
\ No newline at end of file</diff>
      <filename>config/environments/development.rb</filename>
    </modified>
    <modified>
      <diff>@@ -4,19 +4,27 @@
 # Code is not reloaded between requests
 config.cache_classes = true
 
-# Use a different logger for distributed setups
-# config.logger = SyslogLogger.new
-
 # Full error reports are disabled and caching is turned on
 config.action_controller.consider_all_requests_local = false
 config.action_controller.perform_caching             = true
 config.action_view.cache_template_loading            = true
 
+# See everything in the log (default is :info)
+# config.log_level = :debug
+
+# Use a different logger for distributed setups
+# config.logger = SyslogLogger.new
+
 # Use a different cache store in production
 # config.cache_store = :mem_cache_store
 
 # Enable serving of images, stylesheets, and javascripts from an asset server
-# config.action_controller.asset_host                  = &quot;http://assets.example.com&quot;
+# config.action_controller.asset_host = &quot;http://assets.example.com&quot;
 
 # Disable delivery errors, bad email addresses will be ignored
 # config.action_mailer.raise_delivery_errors = false
+
+# Enable threaded mode
+# config.threadsafe!
+
+config.action_mailer.default_url_options = { :host =&gt; 'youdomain.com' }
\ No newline at end of file</diff>
      <filename>config/environments/production.rb</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,7 @@ config.whiny_nils = true
 # Show full error reports and disable caching
 config.action_controller.consider_all_requests_local = true
 config.action_controller.perform_caching             = false
+config.action_view.cache_template_loading            = true
 
 # Disable request forgery protection in test environment
 config.action_controller.allow_forgery_protection    = false
@@ -20,3 +21,13 @@ config.action_controller.allow_forgery_protection    = false
 # The :test delivery method accumulates sent emails in the
 # ActionMailer::Base.deliveries array.
 config.action_mailer.delivery_method = :test
+
+# Use SQL instead of Active Record's schema dumper when creating the test database.
+# This is necessary if your schema can't be completely dumped by the schema dumper,
+# like if you have constraints or database-specific column types
+# config.active_record.schema_format = :sql
+
+config.gem 'thoughtbot-shoulda', :lib =&gt; 'shoulda', :source =&gt; 'http://gems.github.com'
+config.gem 'thoughtbot-factory_girl', :lib =&gt; 'factory_girl', :source =&gt; 'http://gems.github.com'
+
+config.action_mailer.default_url_options = { :host =&gt; 'localhost' }
\ No newline at end of file</diff>
      <filename>config/environments/test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,7 +2,7 @@
 
 # Add new inflection rules using the following format 
 # (all these examples are active by default):
-# Inflector.inflections do |inflect|
+# ActiveSupport::Inflector.inflections do |inflect|
 #   inflect.plural /^(ox)$/i, '\1en'
 #   inflect.singular /^(ox)en/i, '\1'
 #   inflect.irregular 'person', 'people'</diff>
      <filename>config/initializers/inflections.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,11 +1,15 @@
+# Be sure to restart your server when you modify this file.
+
 # These settings change the behavior of Rails 2 apps and will be defaults
 # for Rails 3. You can remove this initializer when Rails 3 is released.
 
-# Include Active Record class name as root for JSON serialized output.
-ActiveRecord::Base.include_root_in_json = true
+if defined?(ActiveRecord)
+  # Include Active Record class name as root for JSON serialized output.
+  ActiveRecord::Base.include_root_in_json = true
 
-# Store the full class name (including module namespace) in STI type column.
-ActiveRecord::Base.store_full_sti_class = true
+  # Store the full class name (including module namespace) in STI type column.
+  ActiveRecord::Base.store_full_sti_class = true
+end
 
 # Use ISO 8601 format for JSON serialized times and dates.
 ActiveSupport.use_standard_json_time_format = true</diff>
      <filename>config/initializers/new_rails_defaults.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,15 +1,14 @@
 ActionController::Routing::Routes.draw do |map|
-  
+  map.resources :posts, :collection =&gt; {:search =&gt; :get}, :has_many =&gt; :comments
+  map.resources :comments
+  map.resources :password_resets
   map.resources :users
-  map.resource :session
-  map.resources :posts, :has_many =&gt; :comments
-  
-  map.activate '/activate/:activation_code', :controller =&gt; 'users', :action =&gt; 'activate', :activation_code =&gt; nil
-  map.signup '/signup', :controller =&gt; 'users', :action =&gt; 'new', :resource_path =&gt; '/users/new'
-  map.login '/login', :controller =&gt; 'sessions', :action =&gt; 'new'
-  map.logout '/logout', :controller =&gt; 'sessions', :action =&gt; 'destroy'
-  
-  map.post_class '/:klass', :controller =&gt; 'posts', :action =&gt; 'index', :resource_path =&gt; '/posts'
-  map.root :controller =&gt; 'posts', :resource_path =&gt; '/posts'
   
+  map.login     '/login',                     :controller =&gt; &quot;user_sessions&quot;, :action =&gt; &quot;new&quot;, :conditions =&gt; {:method =&gt; :get}
+  map.logout    '/logout',                    :controller =&gt; &quot;user_sessions&quot;, :action =&gt; &quot;destroy&quot;
+  map.resource  :user_session, :as =&gt; 'login'
+
+  map.activate  '/activate/:activation_code', :controller =&gt; 'users',         :action =&gt; 'activate'
+
+  map.root      :controller =&gt; &quot;posts&quot;
 end</diff>
      <filename>config/routes.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,7 +9,7 @@
 #
 # It's strongly recommended to check this file into your version control system.
 
-ActiveRecord::Schema.define(:version =&gt; 20080618224722) do
+ActiveRecord::Schema.define(:version =&gt; 20090723085933) do
 
   create_table &quot;comments&quot;, :force =&gt; true do |t|
     t.text     &quot;body&quot;
@@ -18,6 +18,7 @@ ActiveRecord::Schema.define(:version =&gt; 20080618224722) do
     t.string   &quot;author_name&quot;
     t.string   &quot;author_email&quot;
     t.string   &quot;author_url&quot;
+    t.datetime &quot;deleted_at&quot;
     t.datetime &quot;created_at&quot;
     t.datetime &quot;updated_at&quot;
   end
@@ -32,29 +33,35 @@ ActiveRecord::Schema.define(:version =&gt; 20080618224722) do
     t.string   &quot;permalink&quot;
     t.integer  &quot;user_id&quot;
     t.string   &quot;type&quot;
-    t.datetime &quot;created_at&quot;
-    t.datetime &quot;updated_at&quot;
     t.boolean  &quot;publicly_viewable&quot;, :default =&gt; true
     t.datetime &quot;published_at&quot;
+    t.datetime &quot;deleted_at&quot;
+    t.string   &quot;via&quot;
+    t.datetime &quot;created_at&quot;
+    t.datetime &quot;updated_at&quot;
+    t.boolean  &quot;delta&quot;,             :default =&gt; true, :null =&gt; false
   end
 
   create_table &quot;users&quot;, :force =&gt; true do |t|
-    t.string   &quot;login&quot;
-    t.string   &quot;email&quot;
-    t.string   &quot;crypted_password&quot;,          :limit =&gt; 40
-    t.string   &quot;salt&quot;,                      :limit =&gt; 40
+    t.string   &quot;email&quot;,                             :null =&gt; false
+    t.string   &quot;crypted_password&quot;,                  :null =&gt; false
+    t.string   &quot;password_salt&quot;,                     :null =&gt; false
+    t.string   &quot;persistence_token&quot;,                 :null =&gt; false
+    t.integer  &quot;login_count&quot;,        :default =&gt; 0, :null =&gt; false
+    t.integer  &quot;failed_login_count&quot;, :default =&gt; 0, :null =&gt; false
+    t.datetime &quot;last_request_at&quot;
+    t.datetime &quot;current_login_at&quot;
+    t.datetime &quot;last_login_at&quot;
+    t.string   &quot;current_login_ip&quot;
+    t.string   &quot;last_login_ip&quot;
+    t.string   &quot;perishable_token&quot;
+    t.datetime &quot;deleted_at&quot;
+    t.datetime &quot;activated_at&quot;
+    t.string   &quot;first_name&quot;
+    t.string   &quot;last_name&quot;
     t.datetime &quot;created_at&quot;
     t.datetime &quot;updated_at&quot;
-    t.string   &quot;remember_token&quot;
-    t.datetime &quot;remember_token_expires_at&quot;
-    t.string   &quot;activation_code&quot;,           :limit =&gt; 40
-    t.datetime &quot;activated_at&quot;
-    t.boolean  &quot;admin&quot;,                                   :default =&gt; false
-    t.string   &quot;password_reset_code&quot;
-    t.datetime &quot;last_login&quot;
-    t.string   &quot;permalink&quot;
     t.string   &quot;url&quot;
-    t.string   &quot;name&quot;
   end
 
 end</diff>
      <filename>db/schema.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,30 +1,64 @@
-&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
-       &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta content='text/html; charset=utf-8' http-equiv='Content-Type'&gt;
+    &lt;meta content='Andrew Nesbitt' name='author'&gt;
+    &lt;meta content='keywords' name='keywords'&gt;
+    &lt;meta content='description' name='description'&gt;
+    &lt;link href=&quot;http://localhost:3000/posts.atom&quot; rel=&quot;alternate&quot; title=&quot;Atom feed&quot; type=&quot;application/atom+xml&quot; /&gt;
+    &lt;link href=&quot;/stylesheets/application.css?1248336532&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
+    &lt;link href=&quot;/stylesheets/print.css?1248098403&quot; media=&quot;print&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
+    &lt;title&gt;Teabass.com | Page not found (404)&lt;/title&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;div id='header'&gt;
+      &lt;h1&gt;&lt;a href=&quot;/&quot; rel=&quot;home&quot;&gt;Teabass&lt;/a&gt;&lt;/h1&gt;
+    &lt;/div&gt;
+    &lt;div id='content'&gt;
+      &lt;div class='blank'&gt;
+        &lt;h2&gt;Page not found&lt;/h2&gt;
+        &lt;p&gt;The page you were looking for doesn't exist, you may have mistyped the address or the page may have moved.&lt;/p&gt;
+        &lt;p&gt;&lt;a href='/'&gt;Return to the Homepage&lt;/a&gt;&lt;/p&gt;
+      &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div id='sidebar'&gt;
+      &lt;h3&gt;Links&lt;/h3&gt;
+      &lt;ul id='links'&gt;
+        &lt;li class='flickr'&gt;&lt;a href=&quot;http://flic.kr/nez&quot;&gt;Flickr&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='twitter'&gt;&lt;a href=&quot;http://twitter.com/teabass&quot;&gt;Twitter&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='facebook'&gt;&lt;a href=&quot;http://facebook.com/anesbitt&quot;&gt;Facebook&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='youtube'&gt;&lt;a href=&quot;http://youtube.com/teabass&quot;&gt;YouTube&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='lastfm'&gt;&lt;a href=&quot;http://last.fm/user/teabass&quot;&gt;Last.fm&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='myspace'&gt;&lt;a href=&quot;http://myspace.com/andrewonrails&quot;&gt;Myspace&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='work'&gt;&lt;a href=&quot;http://rawnet.com&quot;&gt;Work&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='feed'&gt;&lt;a href=&quot;/posts.atom&quot;&gt;Feed&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='email'&gt;&lt;a href=&quot;mailto:andrewnez@gmail.com&quot;&gt;Email&lt;/a&gt;&lt;/li&gt;
+      &lt;/ul&gt;
+      &lt;h3&gt;About&lt;/h3&gt;
+      &lt;p&gt;
+        Teabass.com is the website of Andrew Nesbitt, a web developer from London.
+      &lt;/p&gt;
+      &lt;p&gt;
+        Expect to find posts and links about technology, the web, ruby, rails, html, css, jquery and random cat pictures.
+      &lt;/p&gt;
+      &lt;h3&gt;Creative Commons&lt;/h3&gt;
+      &lt;p&gt;
+        Except where otherwise noted, content on this site is licensed under a
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;Creative Commons Attribution 3.0 License&lt;/a&gt;
+      &lt;/p&gt;
+      &lt;p&gt;
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;&lt;img alt=&quot;Sa&quot; height=&quot;16&quot; src=&quot;/images/sa.png?1247946541&quot; width=&quot;16&quot; /&gt;&lt;/a&gt;
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;&lt;img alt=&quot;Cc&quot; height=&quot;16&quot; src=&quot;/images/cc.png?1247946558&quot; width=&quot;16&quot; /&gt;&lt;/a&gt;
 
-&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;
-
-&lt;head&gt;
-  &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
-  &lt;title&gt;The page you were looking for doesn't exist (404)&lt;/title&gt;
-	&lt;style type=&quot;text/css&quot;&gt;
-		body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
-		div.dialog {
-			width: 25em;
-			padding: 0 4em;
-			margin: 4em auto 0 auto;
-			border: 1px solid #ccc;
-			border-right-color: #999;
-			border-bottom-color: #999;
-		}
-		h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
-	&lt;/style&gt;
-&lt;/head&gt;
-
-&lt;body&gt;
-  &lt;!-- This file lives in public/404.html --&gt;
-  &lt;div class=&quot;dialog&quot;&gt;
-    &lt;h1&gt;The page you were looking for doesn't exist.&lt;/h1&gt;
-    &lt;p&gt;You may have mistyped the address or the page may have moved.&lt;/p&gt;
-  &lt;/div&gt;
-&lt;/body&gt;
-&lt;/html&gt;
\ No newline at end of file
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;&lt;img alt=&quot;By&quot; height=&quot;16&quot; src=&quot;/images/by.png?1247946564&quot; width=&quot;16&quot; /&gt;&lt;/a&gt;
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;&lt;img alt=&quot;Share&quot; height=&quot;16&quot; src=&quot;/images/share.png?1247949388&quot; width=&quot;16&quot; /&gt;&lt;/a&gt;
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;&lt;img alt=&quot;Remix&quot; height=&quot;16&quot; src=&quot;/images/remix.png?1247949395&quot; width=&quot;16&quot; /&gt;&lt;/a&gt;
+      &lt;/p&gt;
+    &lt;/div&gt;
+    &lt;div id='footer'&gt;
+      &lt;a href=&quot;#header&quot; class=&quot;up&quot; title=&quot;Back to top&quot;&gt;&amp;#x2191;&lt;/a&gt;
+      Powered by
+      &lt;a href=&quot;http://github.com/andrew/bumble&quot;&gt;Bumble&lt;/a&gt;
+    &lt;/div&gt;
+  &lt;/body&gt;
+&lt;/html&gt;</diff>
      <filename>public/404.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,30 +1,64 @@
-&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
-       &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta content='text/html; charset=utf-8' http-equiv='Content-Type'&gt;
+    &lt;meta content='Andrew Nesbitt' name='author'&gt;
+    &lt;meta content='keywords' name='keywords'&gt;
+    &lt;meta content='description' name='description'&gt;
+    &lt;link href=&quot;http://localhost:3000/posts.atom&quot; rel=&quot;alternate&quot; title=&quot;Atom feed&quot; type=&quot;application/atom+xml&quot; /&gt;
+    &lt;link href=&quot;/stylesheets/application.css?1248336532&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
+    &lt;link href=&quot;/stylesheets/print.css?1248098403&quot; media=&quot;print&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
+    &lt;title&gt;Teabass.com | Change rejected (422)&lt;/title&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;div id='header'&gt;
+      &lt;h1&gt;&lt;a href=&quot;/&quot; rel=&quot;home&quot;&gt;Teabass&lt;/a&gt;&lt;/h1&gt;
+    &lt;/div&gt;
+    &lt;div id='content'&gt;
+      &lt;div class='blank'&gt;
+        &lt;h2&gt;Change Rejected&lt;/h2&gt;
+        &lt;p&gt;Maybe you tried to change something you didn't have access to.&lt;/p&gt;
+        &lt;p&gt;&lt;a href='/'&gt;Return to the Homepage&lt;/a&gt;&lt;/p&gt;
+      &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div id='sidebar'&gt;
+      &lt;h3&gt;Links&lt;/h3&gt;
+      &lt;ul id='links'&gt;
+        &lt;li class='flickr'&gt;&lt;a href=&quot;http://flic.kr/nez&quot;&gt;Flickr&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='twitter'&gt;&lt;a href=&quot;http://twitter.com/teabass&quot;&gt;Twitter&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='facebook'&gt;&lt;a href=&quot;http://facebook.com/anesbitt&quot;&gt;Facebook&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='youtube'&gt;&lt;a href=&quot;http://youtube.com/teabass&quot;&gt;YouTube&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='lastfm'&gt;&lt;a href=&quot;http://last.fm/user/teabass&quot;&gt;Last.fm&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='myspace'&gt;&lt;a href=&quot;http://myspace.com/andrewonrails&quot;&gt;Myspace&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='work'&gt;&lt;a href=&quot;http://rawnet.com&quot;&gt;Work&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='feed'&gt;&lt;a href=&quot;/posts.atom&quot;&gt;Feed&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='email'&gt;&lt;a href=&quot;mailto:andrewnez@gmail.com&quot;&gt;Email&lt;/a&gt;&lt;/li&gt;
+      &lt;/ul&gt;
+      &lt;h3&gt;About&lt;/h3&gt;
+      &lt;p&gt;
+        Teabass.com is the website of Andrew Nesbitt, a web developer from London.
+      &lt;/p&gt;
+      &lt;p&gt;
+        Expect to find posts and links about technology, the web, ruby, rails, html, css, jquery and random cat pictures.
+      &lt;/p&gt;
+      &lt;h3&gt;Creative Commons&lt;/h3&gt;
+      &lt;p&gt;
+        Except where otherwise noted, content on this site is licensed under a
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;Creative Commons Attribution 3.0 License&lt;/a&gt;
+      &lt;/p&gt;
+      &lt;p&gt;
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;&lt;img alt=&quot;Sa&quot; height=&quot;16&quot; src=&quot;/images/sa.png?1247946541&quot; width=&quot;16&quot; /&gt;&lt;/a&gt;
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;&lt;img alt=&quot;Cc&quot; height=&quot;16&quot; src=&quot;/images/cc.png?1247946558&quot; width=&quot;16&quot; /&gt;&lt;/a&gt;
 
-&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;
-
-&lt;head&gt;
-  &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
-  &lt;title&gt;The change you wanted was rejected (422)&lt;/title&gt;
-	&lt;style type=&quot;text/css&quot;&gt;
-		body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
-		div.dialog {
-			width: 25em;
-			padding: 0 4em;
-			margin: 4em auto 0 auto;
-			border: 1px solid #ccc;
-			border-right-color: #999;
-			border-bottom-color: #999;
-		}
-		h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
-	&lt;/style&gt;
-&lt;/head&gt;
-
-&lt;body&gt;
-  &lt;!-- This file lives in public/422.html --&gt;
-  &lt;div class=&quot;dialog&quot;&gt;
-    &lt;h1&gt;The change you wanted was rejected.&lt;/h1&gt;
-    &lt;p&gt;Maybe you tried to change something you didn't have access to.&lt;/p&gt;
-  &lt;/div&gt;
-&lt;/body&gt;
-&lt;/html&gt;
\ No newline at end of file
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;&lt;img alt=&quot;By&quot; height=&quot;16&quot; src=&quot;/images/by.png?1247946564&quot; width=&quot;16&quot; /&gt;&lt;/a&gt;
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;&lt;img alt=&quot;Share&quot; height=&quot;16&quot; src=&quot;/images/share.png?1247949388&quot; width=&quot;16&quot; /&gt;&lt;/a&gt;
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;&lt;img alt=&quot;Remix&quot; height=&quot;16&quot; src=&quot;/images/remix.png?1247949395&quot; width=&quot;16&quot; /&gt;&lt;/a&gt;
+      &lt;/p&gt;
+    &lt;/div&gt;
+    &lt;div id='footer'&gt;
+      &lt;a href=&quot;#header&quot; class=&quot;up&quot; title=&quot;Back to top&quot;&gt;&amp;#x2191;&lt;/a&gt;
+      Powered by
+      &lt;a href=&quot;http://github.com/andrew/bumble&quot;&gt;Bumble&lt;/a&gt;
+    &lt;/div&gt;
+  &lt;/body&gt;
+&lt;/html&gt;</diff>
      <filename>public/422.html</filename>
    </modified>
    <modified>
      <diff>@@ -1,30 +1,64 @@
-&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
-       &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+  &lt;head&gt;
+    &lt;meta content='text/html; charset=utf-8' http-equiv='Content-Type'&gt;
+    &lt;meta content='Andrew Nesbitt' name='author'&gt;
+    &lt;meta content='keywords' name='keywords'&gt;
+    &lt;meta content='description' name='description'&gt;
+    &lt;link href=&quot;http://localhost:3000/posts.atom&quot; rel=&quot;alternate&quot; title=&quot;Atom feed&quot; type=&quot;application/atom+xml&quot; /&gt;
+    &lt;link href=&quot;/stylesheets/application.css?1248336532&quot; media=&quot;screen&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
+    &lt;link href=&quot;/stylesheets/print.css?1248098403&quot; media=&quot;print&quot; rel=&quot;stylesheet&quot; type=&quot;text/css&quot; /&gt;
+    &lt;title&gt;Teabass.com | Application Error (500)&lt;/title&gt;
+  &lt;/head&gt;
+  &lt;body&gt;
+    &lt;div id='header'&gt;
+      &lt;h1&gt;&lt;a href=&quot;/&quot; rel=&quot;home&quot;&gt;Teabass&lt;/a&gt;&lt;/h1&gt;
+    &lt;/div&gt;
+    &lt;div id='content'&gt;
+      &lt;div class='blank'&gt;
+        &lt;h2&gt;Application Error&lt;/h2&gt;
+        &lt;p&gt;Something went wrong! We've been notified about this issue and we'll take a look at it shortly.&lt;/p&gt;
+        &lt;p&gt;&lt;a href='/'&gt;Return to the Homepage&lt;/a&gt;&lt;/p&gt;
+      &lt;/div&gt;
+    &lt;/div&gt;
+    &lt;div id='sidebar'&gt;
+      &lt;h3&gt;Links&lt;/h3&gt;
+      &lt;ul id='links'&gt;
+        &lt;li class='flickr'&gt;&lt;a href=&quot;http://flic.kr/nez&quot;&gt;Flickr&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='twitter'&gt;&lt;a href=&quot;http://twitter.com/teabass&quot;&gt;Twitter&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='facebook'&gt;&lt;a href=&quot;http://facebook.com/anesbitt&quot;&gt;Facebook&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='youtube'&gt;&lt;a href=&quot;http://youtube.com/teabass&quot;&gt;YouTube&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='lastfm'&gt;&lt;a href=&quot;http://last.fm/user/teabass&quot;&gt;Last.fm&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='myspace'&gt;&lt;a href=&quot;http://myspace.com/andrewonrails&quot;&gt;Myspace&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='work'&gt;&lt;a href=&quot;http://rawnet.com&quot;&gt;Work&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='feed'&gt;&lt;a href=&quot;/posts.atom&quot;&gt;Feed&lt;/a&gt;&lt;/li&gt;
+        &lt;li class='email'&gt;&lt;a href=&quot;mailto:andrewnez@gmail.com&quot;&gt;Email&lt;/a&gt;&lt;/li&gt;
+      &lt;/ul&gt;
+      &lt;h3&gt;About&lt;/h3&gt;
+      &lt;p&gt;
+        Teabass.com is the website of Andrew Nesbitt, a web developer from London.
+      &lt;/p&gt;
+      &lt;p&gt;
+        Expect to find posts and links about technology, the web, ruby, rails, html, css, jquery and random cat pictures.
+      &lt;/p&gt;
+      &lt;h3&gt;Creative Commons&lt;/h3&gt;
+      &lt;p&gt;
+        Except where otherwise noted, content on this site is licensed under a
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;Creative Commons Attribution 3.0 License&lt;/a&gt;
+      &lt;/p&gt;
+      &lt;p&gt;
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;&lt;img alt=&quot;Sa&quot; height=&quot;16&quot; src=&quot;/images/sa.png?1247946541&quot; width=&quot;16&quot; /&gt;&lt;/a&gt;
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;&lt;img alt=&quot;Cc&quot; height=&quot;16&quot; src=&quot;/images/cc.png?1247946558&quot; width=&quot;16&quot; /&gt;&lt;/a&gt;
 
-&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;&gt;
-
-&lt;head&gt;
-  &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text/html; charset=UTF-8&quot; /&gt;
-  &lt;title&gt;We're sorry, but something went wrong (500)&lt;/title&gt;
-	&lt;style type=&quot;text/css&quot;&gt;
-		body { background-color: #fff; color: #666; text-align: center; font-family: arial, sans-serif; }
-		div.dialog {
-			width: 25em;
-			padding: 0 4em;
-			margin: 4em auto 0 auto;
-			border: 1px solid #ccc;
-			border-right-color: #999;
-			border-bottom-color: #999;
-		}
-		h1 { font-size: 100%; color: #f00; line-height: 1.5em; }
-	&lt;/style&gt;
-&lt;/head&gt;
-
-&lt;body&gt;
-  &lt;!-- This file lives in public/500.html --&gt;
-  &lt;div class=&quot;dialog&quot;&gt;
-    &lt;h1&gt;We're sorry, but something went wrong.&lt;/h1&gt;
-    &lt;p&gt;We've been notified about this issue and we'll take a look at it shortly.&lt;/p&gt;
-  &lt;/div&gt;
-&lt;/body&gt;
-&lt;/html&gt;
\ No newline at end of file
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;&lt;img alt=&quot;By&quot; height=&quot;16&quot; src=&quot;/images/by.png?1247946564&quot; width=&quot;16&quot; /&gt;&lt;/a&gt;
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;&lt;img alt=&quot;Share&quot; height=&quot;16&quot; src=&quot;/images/share.png?1247949388&quot; width=&quot;16&quot; /&gt;&lt;/a&gt;
+        &lt;a href=&quot;http://creativecommons.org/licenses/by-sa/3.0/&quot; rel=&quot;license&quot;&gt;&lt;img alt=&quot;Remix&quot; height=&quot;16&quot; src=&quot;/images/remix.png?1247949395&quot; width=&quot;16&quot; /&gt;&lt;/a&gt;
+      &lt;/p&gt;
+    &lt;/div&gt;
+    &lt;div id='footer'&gt;
+      &lt;a href=&quot;#header&quot; class=&quot;up&quot; title=&quot;Back to top&quot;&gt;&amp;#x2191;&lt;/a&gt;
+      Powered by
+      &lt;a href=&quot;http://github.com/andrew/bumble&quot;&gt;Bumble&lt;/a&gt;
+    &lt;/div&gt;
+  &lt;/body&gt;
+&lt;/html&gt;</diff>
      <filename>public/500.html</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>public/favicon.ico</filename>
    </modified>
    <modified>
      <diff></diff>
      <filename>public/images/image.png</filename>
    </modified>
    <modified>
      <diff>@@ -1,53 +1,161 @@
+jQuery.fn.hintFields = function(){
+  for (var i = 0; i &lt; this.length; i++){
+    if (!$.browser.safari){ $('input:text', this[i]).hint();}
+    $('textarea', this[i]).hint();
+  }
+};
+
 $(document).ready(function(){
-  
-  // tabs for new post form
-  $(&quot;#new-post-tabs &gt; ul&quot;).tabs();
-    
-  // remove validations on tab switch
+  // validator defaults
+  jQuery.validator.setDefaults({
+    errorPlacement: function(error, element){ error.insertBefore(element); },
+    ignoreTitle: true
+  });
+
+  // rails ajax setup
+  jQuery.ajaxSetup({
+    'beforeSend': function(xhr){ xhr.setRequestHeader(&quot;Accept&quot;,&quot;text/javascript&quot;); }
+  });
+
+  // crf protection for ajax requests
+  $(document).ajaxSend(function(event, request, settings) {
+    if (typeof(AUTH_TOKEN) == &quot;undefined&quot;) {return;}
+    // settings.data is a serialized string like &quot;foo=bar&amp;baz=boink&quot; (or null)
+    settings.data = settings.data || &quot;&quot;;
+    settings.data += (settings.data ? &quot;&amp;&quot; : &quot;&quot;) + &quot;authenticity_token=&quot; + encodeURIComponent(AUTH_TOKEN);
+  });
+
+  // ajax delete
+  $('a.delete').livequery('click', function(){
+    var elem = $(this);
+    if (confirm(&quot;Are you sure?&quot;)){
+      $.post($(this).attr('href'), &quot;_method=delete&quot;,function(){
+        elem.closest('div').slideUp();
+      });
+    }
+    return false;
+  }).attr(&quot;rel&quot;, &quot;nofollow&quot;);
+
+  // open external links in a new window
+  $('a[rel=&quot;external&quot;]').click( function(){
+    window.open($(this).attr('href'));
+    return false;
+  });
+
+  // new post form tabs
+  $(&quot;#new_post &gt; ul&quot;).tabs({cookie: {}});
+
+  if ($.cookie(&quot;hide_new_post&quot;) == 'false') {
+    $('#new_post').show();
+    $('a.open').hide();
+  }
+  else {
+    $('#new_post').hide();
+    $('a.open').show();
+  }
+
   $('.ui-tabs-nav').bind('tabsselect', function(event, ui) {
-    $(&quot;label.error&quot;).each(function(){$(this).remove();});
+    $('label.error').remove();
+    $('a.more').show();
+    $('div.more').hide();
+    $('.ui-tabs-nav').hintFields();
   });
+
+  $('a.open').click(function(){
+    $('a.open').fadeOut();
+    $('#new_post').slideDown();
+    $.cookie(&quot;hide_new_post&quot;, 'false');
+    return false;
+  });
+
+  $('a.close').click(function(){
+    $('#new_post').slideUp(function(){
+      $('a.open').fadeIn();
+    });
+    $.cookie(&quot;hide_new_post&quot;, 'true');
+    $('.preview').remove();
+    return false;
+  });
+
+  // extra post options
+  $('#new_post div.more').hide();
+  $('#new_post a.more').click(function(){
+    $('#new_post div.more').slideDown();
+    $(this).hide();
+    return false;
+  });
+
+  // text field hints
+  $('form').hintFields();
   
-  // toggle extra fields display
-  $(&quot;.extra-fields&quot;).hide();
-  $(&quot;.show-extra-fields&quot;).click(function(){
-    $(this).toggleClass('selected')
-    $(&quot;.extra-fields&quot;).toggle();
+  $('a.help').click(function(){
+    $('#formatting').toggle(100);
     return false;
   });
 
+  // expanding textareas
+  $('textarea').jGrow();
+
   // setup validation and ajax post forms
   $(&quot;.new_post&quot;).each(function(){
-    $( this ).validate({
-       submitHandler: function(form) {
-       	$(form).ajaxSubmit( {
-             target: '#posts',
-             clearForm: true
+    $(this).validate({
+      rules: {
+        'video[video_embed]': {
+          required: &quot;#video_link_url:blank&quot;
+        }
+      },
+      submitHandler: function(form){
+        $(form).ajaxSubmit({
+          beforeSubmit: function(){$('.new_post .submit').after('&lt;img src=&quot;/images/loading.gif&quot; class=&quot;loading&quot; /&gt;');},
+          complete: function(){$('.loading').remove();},
+          success: function(data){
+            $('.preview').remove();
+            $('#posts').prepend(data);
+            if ($('.preview').size() == 0){
+              $(form).resetForm();
+            }
+            $(form).hintFields();
+          },
+          error:function(request, textStatus, errorThrown) {
+            var message = (request.status == 401 || request.status == 403) ? 
+              request.responseText : &quot;An unknown error occurred. Support has been contacted.&quot;;
+            alert(message);
+          }
+
         });
       }
     });
   });
 
-	// the ajax comments
-	$(&quot;#new_comment&quot;).submitWithAjax();
-
-});
-
-jQuery.ajaxSetup({ 
-  'beforeSend': function(xhr) {xhr.setRequestHeader(&quot;Accept&quot;,
-    &quot;text/javascript&quot;)} 
-});
+  // setup validation and ajax comments forms
+  $(&quot;.new_comment&quot;).validate({
+    submitHandler: function(form){
+      $(form).ajaxSubmit({
+        beforeSubmit: function(){$('.new_comment input[type=&quot;submit&quot;]').after('&lt;img src=&quot;/images/loading.gif&quot; class=&quot;loading&quot; /&gt;');},
+        complete: function(){$('.loading').remove();},
+        success: function(data) {
+          $('#comments').append(data);
+          $('.blank').remove();
+          $(form).resetForm().hintFields();
+          },
+          error:function(request, textStatus, errorThrown) {
+            var message = (request.status == 401 || request.status == 403) ? 
+              request.responseText : &quot;An unknown error occurred. Support has been contacted.&quot;;
+            alert(message);
+          }
+      });
+    }
+  });
 
-jQuery.validator.setDefaults({
-  errorPlacement: function(error, element) {
-       error.insertBefore(element);
-     }
-});
+  // fade out flash
+  setTimeout(function(){$(&quot;.flash&quot;).fadeOut(1000);},10000);
 
-jQuery.fn.submitWithAjax = function() {
-  this.submit(function() {
-    $.post(this.action, $(this).serialize(), null, &quot;script&quot;);
-    return false;
-  })
-  return this;
-};
\ No newline at end of file
+  // Google analtyics
+  var gaTrackCode = &quot;UA-265870-16&quot;;
+  var gaJsHost = ((&quot;https:&quot; == document.location.protocol) ? &quot;https://ssl.&quot; : &quot;http://www.&quot;);
+  jQuery.getScript(gaJsHost + &quot;google-analytics.com/ga.js&quot;, function(){
+    var pageTracker = _gat._getTracker(gaTrackCode);
+    pageTracker._initData();
+    pageTracker._trackPageview();
+  });
+});
\ No newline at end of file</diff>
      <filename>public/javascripts/application.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,34 +1,36 @@
-(function(){
-/*
- * jQuery 1.2.6 - New Wave Javascript
+/*!
+ * jQuery JavaScript Library v1.3.2
+ * http://jquery.com/
  *
- * Copyright (c) 2008 John Resig (jquery.com)
- * Dual licensed under the MIT (MIT-LICENSE.txt)
- * and GPL (GPL-LICENSE.txt) licenses.
+ * Copyright (c) 2009 John Resig
+ * Dual licensed under the MIT and GPL licenses.
+ * http://docs.jquery.com/License
  *
- * $Date: 2008-05-24 14:22:17 -0400 (Sat, 24 May 2008) $
- * $Rev: 5685 $
+ * Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
+ * Revision: 6246
  */
+(function(){
 
-// Map over jQuery in case of overwrite
-var _jQuery = window.jQuery,
-// Map over the $ in case of overwrite
-	_$ = window.$;
-
-var jQuery = window.jQuery = window.$ = function( selector, context ) {
-	// The jQuery object is actually just the init constructor 'enhanced'
-	return new jQuery.fn.init( selector, context );
-};
-
-// A simple way to check for HTML strings or ID strings
-// (both of which we optimize for)
-var quickExpr = /^[^&lt;]*(&lt;(.|\s)+&gt;)[^&gt;]*$|^#(\w+)$/,
-
-// Is it a simple selector
-	isSimple = /^.[^:#\[\.]*$/,
+var 
+	// Will speed up references to window, and allows munging its name.
+	window = this,
+	// Will speed up references to undefined, and allows munging its name.
+	undefined,
+	// Map over jQuery in case of overwrite
+	_jQuery = window.jQuery,
+	// Map over the $ in case of overwrite
+	_$ = window.$,
+
+	jQuery = window.jQuery = window.$ = function( selector, context ) {
+		// The jQuery object is actually just the init constructor 'enhanced'
+		return new jQuery.fn.init( selector, context );
+	},
 
-// Will speed up references to undefined, and allows munging its name.
-	undefined;
+	// A simple way to check for HTML strings or ID strings
+	// (both of which we optimize for)
+	quickExpr = /^[^&lt;]*(&lt;(.|\s)+&gt;)[^&gt;]*$|^#([\w-]+)$/,
+	// Is it a simple selector
+	isSimple = /^.[^:#\[\.,]*$/;
 
 jQuery.fn = jQuery.prototype = {
 	init: function( selector, context ) {
@@ -39,10 +41,11 @@ jQuery.fn = jQuery.prototype = {
 		if ( selector.nodeType ) {
 			this[0] = selector;
 			this.length = 1;
+			this.context = selector;
 			return this;
 		}
 		// Handle HTML strings
-		if ( typeof selector == &quot;string&quot; ) {
+		if ( typeof selector === &quot;string&quot; ) {
 			// Are we dealing with HTML string or an ID?
 			var match = quickExpr.exec( selector );
 
@@ -57,17 +60,16 @@ jQuery.fn = jQuery.prototype = {
 				else {
 					var elem = document.getElementById( match[3] );
 
-					// Make sure an element was located
-					if ( elem ){
-						// Handle the case where IE and Opera return items
-						// by name instead of ID
-						if ( elem.id != match[3] )
-							return jQuery().find( selector );
+					// Handle the case where IE and Opera return items
+					// by name instead of ID
+					if ( elem &amp;&amp; elem.id != match[3] )
+						return jQuery().find( selector );
 
-						// Otherwise, we inject the element directly into the jQuery object
-						return jQuery( elem );
-					}
-					selector = [];
+					// Otherwise, we inject the element directly into the jQuery object
+					var ret = jQuery( elem || [] );
+					ret.context = document;
+					ret.selector = selector;
+					return ret;
 				}
 
 			// HANDLE: $(expr, [context])
@@ -78,29 +80,37 @@ jQuery.fn = jQuery.prototype = {
 		// HANDLE: $(function)
 		// Shortcut for document ready
 		} else if ( jQuery.isFunction( selector ) )
-			return jQuery( document )[ jQuery.fn.ready ? &quot;ready&quot; : &quot;load&quot; ]( selector );
+			return jQuery( document ).ready( selector );
 
-		return this.setArray(jQuery.makeArray(selector));
+		// Make sure that old selector state is passed along
+		if ( selector.selector &amp;&amp; selector.context ) {
+			this.selector = selector.selector;
+			this.context = selector.context;
+		}
+
+		return this.setArray(jQuery.isArray( selector ) ?
+			selector :
+			jQuery.makeArray(selector));
 	},
 
+	// Start with an empty selector
+	selector: &quot;&quot;,
+
 	// The current version of jQuery being used
-	jquery: &quot;1.2.6&quot;,
+	jquery: &quot;1.3.2&quot;,
 
 	// The number of elements contained in the matched element set
 	size: function() {
 		return this.length;
 	},
 
-	// The number of elements contained in the matched element set
-	length: 0,
-
 	// Get the Nth element in the matched element set OR
 	// Get the whole matched element set as a clean array
 	get: function( num ) {
-		return num == undefined ?
+		return num === undefined ?
 
 			// Return a 'clean' array
-			jQuery.makeArray( this ) :
+			Array.prototype.slice.call( this ) :
 
 			// Return just the object
 			this[ num ];
@@ -108,13 +118,20 @@ jQuery.fn = jQuery.prototype = {
 
 	// Take an array of elements and push it onto the stack
 	// (returning the new matched element set)
-	pushStack: function( elems ) {
+	pushStack: function( elems, name, selector ) {
 		// Build a new jQuery matched element set
 		var ret = jQuery( elems );
 
 		// Add the old object onto the stack (as a reference)
 		ret.prevObject = this;
 
+		ret.context = this.context;
+
+		if ( name === &quot;find&quot; )
+			ret.selector = this.selector + (this.selector ? &quot; &quot; : &quot;&quot;) + selector;
+		else if ( name )
+			ret.selector = this.selector + &quot;.&quot; + name + &quot;(&quot; + selector + &quot;)&quot;;
+
 		// Return the newly-formed element set
 		return ret;
 	},
@@ -141,8 +158,6 @@ jQuery.fn = jQuery.prototype = {
 	// Determine the position of an element within
 	// the matched set of elements
 	index: function( elem ) {
-		var ret = -1;
-
 		// Locate the position of the desired element
 		return jQuery.inArray(
 			// If it receives a jQuery object, the first element is used
@@ -154,7 +169,7 @@ jQuery.fn = jQuery.prototype = {
 		var options = name;
 
 		// Look for the case where we're accessing a style value
-		if ( name.constructor == String )
+		if ( typeof name === &quot;string&quot; )
 			if ( value === undefined )
 				return this[0] &amp;&amp; jQuery[ type || &quot;attr&quot; ]( this[0], name );
 
@@ -184,7 +199,7 @@ jQuery.fn = jQuery.prototype = {
 	},
 
 	text: function( text ) {
-		if ( typeof text != &quot;object&quot; &amp;&amp; text != null )
+		if ( typeof text !== &quot;object&quot; &amp;&amp; text != null )
 			return this.empty().append( (this[0] &amp;&amp; this[0].ownerDocument || document).createTextNode( text ) );
 
 		var ret = &quot;&quot;;
@@ -202,20 +217,22 @@ jQuery.fn = jQuery.prototype = {
 	},
 
 	wrapAll: function( html ) {
-		if ( this[0] )
+		if ( this[0] ) {
 			// The elements to wrap the target around
-			jQuery( html, this[0].ownerDocument )
-				.clone()
-				.insertBefore( this[0] )
-				.map(function(){
-					var elem = this;
+			var wrap = jQuery( html, this[0].ownerDocument ).clone();
 
-					while ( elem.firstChild )
-						elem = elem.firstChild;
+			if ( this[0].parentNode )
+				wrap.insertBefore( this[0] );
 
-					return elem;
-				})
-				.append(this);
+			wrap.map(function(){
+				var elem = this;
+
+				while ( elem.firstChild )
+					elem = elem.firstChild;
+
+				return elem;
+			}).append(this);
+		}
 
 		return this;
 	},
@@ -233,27 +250,27 @@ jQuery.fn = jQuery.prototype = {
 	},
 
 	append: function() {
-		return this.domManip(arguments, true, false, function(elem){
+		return this.domManip(arguments, true, function(elem){
 			if (this.nodeType == 1)
 				this.appendChild( elem );
 		});
 	},
 
 	prepend: function() {
-		return this.domManip(arguments, true, true, function(elem){
+		return this.domManip(arguments, true, function(elem){
 			if (this.nodeType == 1)
 				this.insertBefore( elem, this.firstChild );
 		});
 	},
 
 	before: function() {
-		return this.domManip(arguments, false, false, function(elem){
+		return this.domManip(arguments, false, function(elem){
 			this.parentNode.insertBefore( elem, this );
 		});
 	},
 
 	after: function() {
-		return this.domManip(arguments, false, true, function(elem){
+		return this.domManip(arguments, false, function(elem){
 			this.parentNode.insertBefore( elem, this.nextSibling );
 		});
 	},
@@ -262,20 +279,29 @@ jQuery.fn = jQuery.prototype = {
 		return this.prevObject || jQuery( [] );
 	},
 
-	find: function( selector ) {
-		var elems = jQuery.map(this, function(elem){
-			return jQuery.find( selector, elem );
-		});
+	// For internal use only.
+	// Behaves like an Array's method, not like a jQuery method.
+	push: [].push,
+	sort: [].sort,
+	splice: [].splice,
 
-		return this.pushStack( /[^+&gt;] [^+&gt;]/.test( selector ) || selector.indexOf(&quot;..&quot;) &gt; -1 ?
-			jQuery.unique( elems ) :
-			elems );
+	find: function( selector ) {
+		if ( this.length === 1 ) {
+			var ret = this.pushStack( [], &quot;find&quot;, selector );
+			ret.length = 0;
+			jQuery.find( selector, this[0], ret );
+			return ret;
+		} else {
+			return this.pushStack( jQuery.unique(jQuery.map(this, function(elem){
+				return jQuery.find( selector, elem );
+			})), &quot;find&quot;, selector );
+		}
 	},
 
 	clone: function( events ) {
 		// Do the clone
 		var ret = this.map(function(){
-			if ( jQuery.browser.msie &amp;&amp; !jQuery.isXMLDoc(this) ) {
+			if ( !jQuery.support.noCloneEvent &amp;&amp; !jQuery.isXMLDoc(this) ) {
 				// IE copies events bound via attachEvent when
 				// using cloneNode. Calling detachEvent on the
 				// clone will also remove the events from the orignal
@@ -284,33 +310,37 @@ jQuery.fn = jQuery.prototype = {
 				// attributes in IE that are actually only stored
 				// as properties will not be copied (such as the
 				// the name attribute on an input).
-				var clone = this.cloneNode(true),
-					container = document.createElement(&quot;div&quot;);
-				container.appendChild(clone);
-				return jQuery.clean([container.innerHTML])[0];
+				var html = this.outerHTML;
+				if ( !html ) {
+					var div = this.ownerDocument.createElement(&quot;div&quot;);
+					div.appendChild( this.cloneNode(true) );
+					html = div.innerHTML;
+				}
+
+				return jQuery.clean([html.replace(/ jQuery\d+=&quot;(?:\d+|null)&quot;/g, &quot;&quot;).replace(/^\s*/, &quot;&quot;)])[0];
 			} else
 				return this.cloneNode(true);
 		});
 
-		// Need to set the expando to null on the cloned set if it exists
-		// removeData doesn't work here, IE removes it from the original as well
-		// this is primarily for IE but the data expando shouldn't be copied over in any browser
-		var clone = ret.find(&quot;*&quot;).andSelf().each(function(){
-			if ( this[ expando ] != undefined )
-				this[ expando ] = null;
-		});
-
 		// Copy the events from the original to the clone
-		if ( events === true )
-			this.find(&quot;*&quot;).andSelf().each(function(i){
-				if (this.nodeType == 3)
+		if ( events === true ) {
+			var orig = this.find(&quot;*&quot;).andSelf(), i = 0;
+
+			ret.find(&quot;*&quot;).andSelf().each(function(){
+				if ( this.nodeName !== orig[i].nodeName )
 					return;
-				var events = jQuery.data( this, &quot;events&quot; );
 
-				for ( var type in events )
-					for ( var handler in events[ type ] )
-						jQuery.event.add( clone[ i ], type, events[ type ][ handler ], events[ type ][ handler ].data );
+				var events = jQuery.data( orig[i], &quot;events&quot; );
+
+				for ( var type in events ) {
+					for ( var handler in events[ type ] ) {
+						jQuery.event.add( this, type, events[ type ][ handler ], events[ type ][ handler ].data );
+					}
+				}
+
+				i++;
 			});
+		}
 
 		// Return the cloned set
 		return ret;
@@ -323,14 +353,33 @@ jQuery.fn = jQuery.prototype = {
 				return selector.call( elem, i );
 			}) ||
 
-			jQuery.multiFilter( selector, this ) );
+			jQuery.multiFilter( selector, jQuery.grep(this, function(elem){
+				return elem.nodeType === 1;
+			}) ), &quot;filter&quot;, selector );
+	},
+
+	closest: function( selector ) {
+		var pos = jQuery.expr.match.POS.test( selector ) ? jQuery(selector) : null,
+			closer = 0;
+
+		return this.map(function(){
+			var cur = this;
+			while ( cur &amp;&amp; cur.ownerDocument ) {
+				if ( pos ? pos.index(cur) &gt; -1 : jQuery(cur).is(selector) ) {
+					jQuery.data(cur, &quot;closest&quot;, closer);
+					return cur;
+				}
+				cur = cur.parentNode;
+				closer++;
+			}
+		});
 	},
 
 	not: function( selector ) {
-		if ( selector.constructor == String )
+		if ( typeof selector === &quot;string&quot; )
 			// test special case where just one selector is passed in
 			if ( isSimple.test( selector ) )
-				return this.pushStack( jQuery.multiFilter( selector, this, true ) );
+				return this.pushStack( jQuery.multiFilter( selector, this, true ), &quot;not&quot;, selector );
 			else
 				selector = jQuery.multiFilter( selector, this );
 
@@ -343,7 +392,7 @@ jQuery.fn = jQuery.prototype = {
 	add: function( selector ) {
 		return this.pushStack( jQuery.unique( jQuery.merge(
 			this.get(),
-			typeof selector == 'string' ?
+			typeof selector === &quot;string&quot; ?
 				jQuery( selector ) :
 				jQuery.makeArray( selector )
 		)));
@@ -354,15 +403,17 @@ jQuery.fn = jQuery.prototype = {
 	},
 
 	hasClass: function( selector ) {
-		return this.is( &quot;.&quot; + selector );
+		return !!selector &amp;&amp; this.is( &quot;.&quot; + selector );
 	},
 
 	val: function( value ) {
-		if ( value == undefined ) {
-
-			if ( this.length ) {
-				var elem = this[0];
+		if ( value === undefined ) {			
+			var elem = this[0];
 
+			if ( elem ) {
+				if( jQuery.nodeName( elem, 'option' ) )
+					return (elem.attributes.value || {}).specified ? elem.value : elem.text;
+				
 				// We need to handle select boxes special
 				if ( jQuery.nodeName( elem, &quot;select&quot; ) ) {
 					var index = elem.selectedIndex,
@@ -380,7 +431,7 @@ jQuery.fn = jQuery.prototype = {
 
 						if ( option.selected ) {
 							// Get the specifc value for the option
-							value = jQuery.browser.msie &amp;&amp; !option.attributes.value.specified ? option.text : option.value;
+							value = jQuery(option).val();
 
 							// We don't need an array for one selects
 							if ( one )
@@ -391,25 +442,25 @@ jQuery.fn = jQuery.prototype = {
 						}
 					}
 
-					return values;
+					return values;				
+				}
 
 				// Everything else, we just grab the value
-				} else
-					return (this[0].value || &quot;&quot;).replace(/\r/g, &quot;&quot;);
+				return (elem.value || &quot;&quot;).replace(/\r/g, &quot;&quot;);
 
 			}
 
 			return undefined;
 		}
 
-		if( value.constructor == Number )
+		if ( typeof value === &quot;number&quot; )
 			value += '';
 
 		return this.each(function(){
 			if ( this.nodeType != 1 )
 				return;
 
-			if ( value.constructor == Array &amp;&amp; /radio|checkbox/.test( this.type ) )
+			if ( jQuery.isArray(value) &amp;&amp; /radio|checkbox/.test( this.type ) )
 				this.checked = (jQuery.inArray(this.value, value) &gt;= 0 ||
 					jQuery.inArray(this.name, value) &gt;= 0);
 
@@ -430,9 +481,9 @@ jQuery.fn = jQuery.prototype = {
 	},
 
 	html: function( value ) {
-		return value == undefined ?
+		return value === undefined ?
 			(this[0] ?
-				this[0].innerHTML :
+				this[0].innerHTML.replace(/ jQuery\d+=&quot;(?:\d+|null)&quot;/g, &quot;&quot;) :
 				null) :
 			this.empty().append( value );
 	},
@@ -442,11 +493,12 @@ jQuery.fn = jQuery.prototype = {
 	},
 
 	eq: function( i ) {
-		return this.slice( i, i + 1 );
+		return this.slice( i, +i + 1 );
 	},
 
 	slice: function() {
-		return this.pushStack( Array.prototype.slice.apply( this, arguments ) );
+		return this.pushStack( Array.prototype.slice.apply( this, arguments ),
+			&quot;slice&quot;, Array.prototype.slice.call(arguments).join(&quot;,&quot;) );
 	},
 
 	map: function( callback ) {
@@ -459,69 +511,29 @@ jQuery.fn = jQuery.prototype = {
 		return this.add( this.prevObject );
 	},
 
-	data: function( key, value ){
-		var parts = key.split(&quot;.&quot;);
-		parts[1] = parts[1] ? &quot;.&quot; + parts[1] : &quot;&quot;;
-
-		if ( value === undefined ) {
-			var data = this.triggerHandler(&quot;getData&quot; + parts[1] + &quot;!&quot;, [parts[0]]);
-
-			if ( data === undefined &amp;&amp; this.length )
-				data = jQuery.data( this[0], key );
-
-			return data === undefined &amp;&amp; parts[1] ?
-				this.data( parts[0] ) :
-				data;
-		} else
-			return this.trigger(&quot;setData&quot; + parts[1] + &quot;!&quot;, [parts[0], value]).each(function(){
-				jQuery.data( this, key, value );
-			});
-	},
-
-	removeData: function( key ){
-		return this.each(function(){
-			jQuery.removeData( this, key );
-		});
-	},
-
-	domManip: function( args, table, reverse, callback ) {
-		var clone = this.length &gt; 1, elems;
-
-		return this.each(function(){
-			if ( !elems ) {
-				elems = jQuery.clean( args, this.ownerDocument );
-
-				if ( reverse )
-					elems.reverse();
-			}
-
-			var obj = this;
-
-			if ( table &amp;&amp; jQuery.nodeName( this, &quot;table&quot; ) &amp;&amp; jQuery.nodeName( elems[0], &quot;tr&quot; ) )
-				obj = this.getElementsByTagName(&quot;tbody&quot;)[0] || this.appendChild( this.ownerDocument.createElement(&quot;tbody&quot;) );
-
-			var scripts = jQuery( [] );
-
-			jQuery.each(elems, function(){
-				var elem = clone ?
-					jQuery( this ).clone( true )[0] :
-					this;
-
-				// execute all scripts after the elements have been injected
-				if ( jQuery.nodeName( elem, &quot;script&quot; ) )
-					scripts = scripts.add( elem );
-				else {
-					// Remove any inner scripts for later evaluation
-					if ( elem.nodeType == 1 )
-						scripts = scripts.add( jQuery( &quot;script&quot;, elem ).remove() );
-
-					// Inject the elements into the document
-					callback.call( obj, elem );
-				}
-			});
+	domManip: function( args, table, callback ) {
+		if ( this[0] ) {
+			var fragment = (this[0].ownerDocument || this[0]).createDocumentFragment(),
+				scripts = jQuery.clean( args, (this[0].ownerDocument || this[0]), fragment ),
+				first = fragment.firstChild;
+
+			if ( first )
+				for ( var i = 0, l = this.length; i &lt; l; i++ )
+					callback.call( root(this[i], first), this.length &gt; 1 || i &gt; 0 ?
+							fragment.cloneNode(true) : fragment );
+		
+			if ( scripts )
+				jQuery.each( scripts, evalScript );
+		}
 
-			scripts.each( evalScript );
-		});
+		return this;
+		
+		function root( elem, cur ) {
+			return table &amp;&amp; jQuery.nodeName(elem, &quot;table&quot;) &amp;&amp; jQuery.nodeName(cur, &quot;tr&quot;) ?
+				(elem.getElementsByTagName(&quot;tbody&quot;)[0] ||
+				elem.appendChild(elem.ownerDocument.createElement(&quot;tbody&quot;))) :
+				elem;
+		}
 	}
 };
 
@@ -552,7 +564,7 @@ jQuery.extend = jQuery.fn.extend = function() {
 	var target = arguments[0] || {}, i = 1, length = arguments.length, deep = false, options;
 
 	// Handle a deep copy situation
-	if ( target.constructor == Boolean ) {
+	if ( typeof target === &quot;boolean&quot; ) {
 		deep = target;
 		target = arguments[1] || {};
 		// skip the boolean and the target
@@ -560,7 +572,7 @@ jQuery.extend = jQuery.fn.extend = function() {
 	}
 
 	// Handle case when target is a string or something (possible in deep copy)
-	if ( typeof target != &quot;object&quot; &amp;&amp; typeof target != &quot;function&quot; )
+	if ( typeof target !== &quot;object&quot; &amp;&amp; !jQuery.isFunction(target) )
 		target = {};
 
 	// extend jQuery itself if only one argument is passed
@@ -581,7 +593,7 @@ jQuery.extend = jQuery.fn.extend = function() {
 					continue;
 
 				// Recurse if we're merging object values
-				if ( deep &amp;&amp; copy &amp;&amp; typeof copy == &quot;object&quot; &amp;&amp; !copy.nodeType )
+				if ( deep &amp;&amp; copy &amp;&amp; typeof copy === &quot;object&quot; &amp;&amp; !copy.nodeType )
 					target[ name ] = jQuery.extend( deep, 
 						// Never move original objects, clone them
 						src || ( copy.length != null ? [ ] : { } )
@@ -597,11 +609,11 @@ jQuery.extend = jQuery.fn.extend = function() {
 	return target;
 };
 
-var expando = &quot;jQuery&quot; + now(), uuid = 0, windowData = {},
-	// exclude the following css properties to add px
-	exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
+// exclude the following css properties to add px
+var	exclude = /z-?index|font-?weight|opacity|zoom|line-?height/i,
 	// cache defaultView
-	defaultView = document.defaultView || {};
+	defaultView = document.defaultView || {},
+	toString = Object.prototype.toString;
 
 jQuery.extend({
 	noConflict: function( deep ) {
@@ -613,33 +625,36 @@ jQuery.extend({
 		return jQuery;
 	},
 
-	// See test/unit/core.js for details concerning this function.
-	isFunction: function( fn ) {
-		return !!fn &amp;&amp; typeof fn != &quot;string&quot; &amp;&amp; !fn.nodeName &amp;&amp;
-			fn.constructor != Array &amp;&amp; /^[\s[]?function/.test( fn + &quot;&quot; );
+	// See test/unit/core.js for details concerning isFunction.
+	// Since version 1.3, DOM methods and functions like alert
+	// aren't supported. They return false on IE (#2968).
+	isFunction: function( obj ) {
+		return toString.call(obj) === &quot;[object Function]&quot;;
+	},
+
+	isArray: function( obj ) {
+		return toString.call(obj) === &quot;[object Array]&quot;;
 	},
 
 	// check if an element is in a (or is an) XML document
 	isXMLDoc: function( elem ) {
-		return elem.documentElement &amp;&amp; !elem.body ||
-			elem.tagName &amp;&amp; elem.ownerDocument &amp;&amp; !elem.ownerDocument.body;
+		return elem.nodeType === 9 &amp;&amp; elem.documentElement.nodeName !== &quot;HTML&quot; ||
+			!!elem.ownerDocument &amp;&amp; jQuery.isXMLDoc( elem.ownerDocument );
 	},
 
 	// Evalulates a script in a global context
 	globalEval: function( data ) {
-		data = jQuery.trim( data );
-
-		if ( data ) {
+		if ( data &amp;&amp; /\S/.test(data) ) {
 			// Inspired by code by Andrea Giammarchi
 			// http://webreflection.blogspot.com/2007/08/global-scope-evaluation-and-dom.html
 			var head = document.getElementsByTagName(&quot;head&quot;)[0] || document.documentElement,
 				script = document.createElement(&quot;script&quot;);
 
 			script.type = &quot;text/javascript&quot;;
-			if ( jQuery.browser.msie )
-				script.text = data;
-			else
+			if ( jQuery.support.scriptEval )
 				script.appendChild( document.createTextNode( data ) );
+			else
+				script.text = data;
 
 			// Use insertBefore instead of appendChild  to circumvent an IE6 bug.
 			// This arises when a base node is used (#2709).
@@ -652,80 +667,12 @@ jQuery.extend({
 		return elem.nodeName &amp;&amp; elem.nodeName.toUpperCase() == name.toUpperCase();
 	},
 
-	cache: {},
-
-	data: function( elem, name, data ) {
-		elem = elem == window ?
-			windowData :
-			elem;
-
-		var id = elem[ expando ];
-
-		// Compute a unique ID for the element
-		if ( !id )
-			id = elem[ expando ] = ++uuid;
-
-		// Only generate the data cache if we're
-		// trying to access or manipulate it
-		if ( name &amp;&amp; !jQuery.cache[ id ] )
-			jQuery.cache[ id ] = {};
-
-		// Prevent overriding the named cache with undefined values
-		if ( data !== undefined )
-			jQuery.cache[ id ][ name ] = data;
-
-		// Return the named cache data, or the ID for the element
-		return name ?
-			jQuery.cache[ id ][ name ] :
-			id;
-	},
-
-	removeData: function( elem, name ) {
-		elem = elem == window ?
-			windowData :
-			elem;
-
-		var id = elem[ expando ];
-
-		// If we want to remove a specific section of the element's data
-		if ( name ) {
-			if ( jQuery.cache[ id ] ) {
-				// Remove the section of cache data
-				delete jQuery.cache[ id ][ name ];
-
-				// If we've removed all the data, remove the element's cache
-				name = &quot;&quot;;
-
-				for ( name in jQuery.cache[ id ] )
-					break;
-
-				if ( !name )
-					jQuery.removeData( elem );
-			}
-
-		// Otherwise, we want to remove all of the element's data
-		} else {
-			// Clean up the element expando
-			try {
-				delete elem[ expando ];
-			} catch(e){
-				// IE has trouble directly removing the expando
-				// but it's ok with using removeAttribute
-				if ( elem.removeAttribute )
-					elem.removeAttribute( expando );
-			}
-
-			// Completely remove the data cache
-			delete jQuery.cache[ id ];
-		}
-	},
-
 	// args is for internal usage only
 	each: function( object, callback, args ) {
 		var name, i = 0, length = object.length;
 
 		if ( args ) {
-			if ( length == undefined ) {
+			if ( length === undefined ) {
 				for ( name in object )
 					if ( callback.apply( object[ name ], args ) === false )
 						break;
@@ -736,7 +683,7 @@ jQuery.extend({
 
 		// A special, fast, case for the most common use of each
 		} else {
-			if ( length == undefined ) {
+			if ( length === undefined ) {
 				for ( name in object )
 					if ( callback.call( object[ name ], name, object[ name ] ) === false )
 						break;
@@ -754,7 +701,7 @@ jQuery.extend({
 			value = value.call( elem, i );
 
 		// Handle passing in a number to a CSS property
-		return value &amp;&amp; value.constructor == Number &amp;&amp; type == &quot;curCSS&quot; &amp;&amp; !exclude.test( name ) ?
+		return typeof value === &quot;number&quot; &amp;&amp; type == &quot;curCSS&quot; &amp;&amp; !exclude.test( name ) ?
 			value + &quot;px&quot; :
 			value;
 	},
@@ -771,7 +718,7 @@ jQuery.extend({
 		// internal only, use removeClass(&quot;class&quot;)
 		remove: function( elem, classNames ) {
 			if (elem.nodeType == 1)
-				elem.className = classNames != undefined ?
+				elem.className = classNames !== undefined ?
 					jQuery.grep(elem.className.split(/\s+/), function(className){
 						return !jQuery.className.has( classNames, className );
 					}).join(&quot; &quot;) :
@@ -780,7 +727,7 @@ jQuery.extend({
 
 		// internal only, use hasClass(&quot;class&quot;)
 		has: function( elem, className ) {
-			return jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) &gt; -1;
+			return elem &amp;&amp; jQuery.inArray( className, (elem.className || elem).toString().split(/\s+/) ) &gt; -1;
 		}
 	},
 
@@ -800,26 +747,32 @@ jQuery.extend({
 			elem.style[ name ] = old[ name ];
 	},
 
-	css: function( elem, name, force ) {
+	css: function( elem, name, force, extra ) {
 		if ( name == &quot;width&quot; || name == &quot;height&quot; ) {
 			var val, props = { position: &quot;absolute&quot;, visibility: &quot;hidden&quot;, display:&quot;block&quot; }, which = name == &quot;width&quot; ? [ &quot;Left&quot;, &quot;Right&quot; ] : [ &quot;Top&quot;, &quot;Bottom&quot; ];
 
 			function getWH() {
 				val = name == &quot;width&quot; ? elem.offsetWidth : elem.offsetHeight;
-				var padding = 0, border = 0;
+
+				if ( extra === &quot;border&quot; )
+					return;
+
 				jQuery.each( which, function() {
-					padding += parseFloat(jQuery.curCSS( elem, &quot;padding&quot; + this, true)) || 0;
-					border += parseFloat(jQuery.curCSS( elem, &quot;border&quot; + this + &quot;Width&quot;, true)) || 0;
+					if ( !extra )
+						val -= parseFloat(jQuery.curCSS( elem, &quot;padding&quot; + this, true)) || 0;
+					if ( extra === &quot;margin&quot; )
+						val += parseFloat(jQuery.curCSS( elem, &quot;margin&quot; + this, true)) || 0;
+					else
+						val -= parseFloat(jQuery.curCSS( elem, &quot;border&quot; + this + &quot;Width&quot;, true)) || 0;
 				});
-				val -= Math.round(padding + border);
 			}
 
-			if ( jQuery(elem).is(&quot;:visible&quot;) )
+			if ( elem.offsetWidth !== 0 )
 				getWH();
 			else
 				jQuery.swap( elem, props, getWH );
 
-			return Math.max(0, val);
+			return Math.max(0, Math.round(val));
 		}
 
 		return jQuery.curCSS( elem, name, force );
@@ -828,30 +781,14 @@ jQuery.extend({
 	curCSS: function( elem, name, force ) {
 		var ret, style = elem.style;
 
-		// A helper method for determining if an element's values are broken
-		function color( elem ) {
-			if ( !jQuery.browser.safari )
-				return false;
-
-			// defaultView is cached
-			var ret = defaultView.getComputedStyle( elem, null );
-			return !ret || ret.getPropertyValue(&quot;color&quot;) == &quot;&quot;;
-		}
-
 		// We need to handle opacity special in IE
-		if ( name == &quot;opacity&quot; &amp;&amp; jQuery.browser.msie ) {
+		if ( name == &quot;opacity&quot; &amp;&amp; !jQuery.support.opacity ) {
 			ret = jQuery.attr( style, &quot;opacity&quot; );
 
 			return ret == &quot;&quot; ?
 				&quot;1&quot; :
 				ret;
 		}
-		// Opera sometimes will give the wrong display answer, this fixes it, see #2037
-		if ( jQuery.browser.opera &amp;&amp; name == &quot;display&quot; ) {
-			var save = style.outline;
-			style.outline = &quot;0 solid black&quot;;
-			style.outline = save;
-		}
 
 		// Make sure we're using the right name for getting the float value
 		if ( name.match( /float/i ) )
@@ -870,38 +807,9 @@ jQuery.extend({
 
 			var computedStyle = defaultView.getComputedStyle( elem, null );
 
-			if ( computedStyle &amp;&amp; !color( elem ) )
+			if ( computedStyle )
 				ret = computedStyle.getPropertyValue( name );
 
-			// If the element isn't reporting its values properly in Safari
-			// then some display: none elements are involved
-			else {
-				var swap = [], stack = [], a = elem, i = 0;
-
-				// Locate all of the parent display: none elements
-				for ( ; a &amp;&amp; color(a); a = a.parentNode )
-					stack.unshift(a);
-
-				// Go through and make them visible, but in reverse
-				// (It would be better if we knew the exact display type that they had)
-				for ( ; i &lt; stack.length; i++ )
-					if ( color( stack[ i ] ) ) {
-						swap[ i ] = stack[ i ].style.display;
-						stack[ i ].style.display = &quot;block&quot;;
-					}
-
-				// Since we flip the display style, we have to handle that
-				// one special, otherwise get the value
-				ret = name == &quot;display&quot; &amp;&amp; swap[ stack.length - 1 ] != null ?
-					&quot;none&quot; :
-					( computedStyle &amp;&amp; computedStyle.getPropertyValue( name ) ) || &quot;&quot;;
-
-				// Finally, revert the display styles back
-				for ( i = 0; i &lt; swap.length; i++ )
-					if ( swap[ i ] != null )
-						stack[ i ].style.display = swap[ i ];
-			}
-
 			// We should always get a number back from opacity
 			if ( name == &quot;opacity&quot; &amp;&amp; ret == &quot;&quot; )
 				ret = &quot;1&quot;;
@@ -936,22 +844,32 @@ jQuery.extend({
 		return ret;
 	},
 
-	clean: function( elems, context ) {
-		var ret = [];
+	clean: function( elems, context, fragment ) {
 		context = context || document;
+
 		// !context.createElement fails in IE with an error but returns typeof 'object'
-		if (typeof context.createElement == 'undefined')
+		if ( typeof context.createElement === &quot;undefined&quot; )
 			context = context.ownerDocument || context[0] &amp;&amp; context[0].ownerDocument || document;
 
+		// If a single string is passed in and it's a single tag
+		// just do a createElement and skip the rest
+		if ( !fragment &amp;&amp; elems.length === 1 &amp;&amp; typeof elems[0] === &quot;string&quot; ) {
+			var match = /^&lt;(\w+)\s*\/?&gt;$/.exec(elems[0]);
+			if ( match )
+				return [ context.createElement( match[1] ) ];
+		}
+
+		var ret = [], scripts = [], div = context.createElement(&quot;div&quot;);
+
 		jQuery.each(elems, function(i, elem){
+			if ( typeof elem === &quot;number&quot; )
+				elem += '';
+
 			if ( !elem )
 				return;
 
-			if ( elem.constructor == Number )
-				elem += '';
-
 			// Convert html string into DOM nodes
-			if ( typeof elem == &quot;string&quot; ) {
+			if ( typeof elem === &quot;string&quot; ) {
 				// Fix &quot;XHTML&quot;-style tags in all browsers
 				elem = elem.replace(/(&lt;(\w+)[^&gt;]*?)\/&gt;/g, function(all, front, tag){
 					return tag.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ?
@@ -960,7 +878,7 @@ jQuery.extend({
 				});
 
 				// Trim whitespace, otherwise indexOf won't work as expected
-				var tags = jQuery.trim( elem ).toLowerCase(), div = context.createElement(&quot;div&quot;);
+				var tags = elem.replace(/^\s+/, &quot;&quot;).substring(0, 10).toLowerCase();
 
 				var wrap =
 					// option or optgroup
@@ -984,7 +902,7 @@ jQuery.extend({
 					[ 2, &quot;&lt;table&gt;&lt;tbody&gt;&lt;/tbody&gt;&lt;colgroup&gt;&quot;, &quot;&lt;/colgroup&gt;&lt;/table&gt;&quot; ] ||
 
 					// IE can't serialize &lt;link&gt; and &lt;script&gt; tags normally
-					jQuery.browser.msie &amp;&amp;
+					!jQuery.support.htmlSerialize &amp;&amp;
 					[ 1, &quot;div&lt;div&gt;&quot;, &quot;&lt;/div&gt;&quot; ] ||
 
 					[ 0, &quot;&quot;, &quot;&quot; ];
@@ -997,14 +915,15 @@ jQuery.extend({
 					div = div.lastChild;
 
 				// Remove IE's autoinserted &lt;tbody&gt; from table fragments
-				if ( jQuery.browser.msie ) {
+				if ( !jQuery.support.tbody ) {
 
 					// String was a &lt;table&gt;, *may* have spurious &lt;tbody&gt;
-					var tbody = !tags.indexOf(&quot;&lt;table&quot;) &amp;&amp; tags.indexOf(&quot;&lt;tbody&quot;) &lt; 0 ?
-						div.firstChild &amp;&amp; div.firstChild.childNodes :
+					var hasBody = /&lt;tbody/i.test(elem),
+						tbody = !tags.indexOf(&quot;&lt;table&quot;) &amp;&amp; !hasBody ?
+							div.firstChild &amp;&amp; div.firstChild.childNodes :
 
 						// String was a bare &lt;thead&gt; or &lt;tfoot&gt;
-						wrap[1] == &quot;&lt;table&gt;&quot; &amp;&amp; tags.indexOf(&quot;&lt;tbody&quot;) &lt; 0 ?
+						wrap[1] == &quot;&lt;table&gt;&quot; &amp;&amp; !hasBody ?
 							div.childNodes :
 							[];
 
@@ -1012,26 +931,36 @@ jQuery.extend({
 						if ( jQuery.nodeName( tbody[ j ], &quot;tbody&quot; ) &amp;&amp; !tbody[ j ].childNodes.length )
 							tbody[ j ].parentNode.removeChild( tbody[ j ] );
 
-					// IE completely kills leading whitespace when innerHTML is used
-					if ( /^\s/.test( elem ) )
-						div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
-
-				}
+					}
 
+				// IE completely kills leading whitespace when innerHTML is used
+				if ( !jQuery.support.leadingWhitespace &amp;&amp; /^\s/.test( elem ) )
+					div.insertBefore( context.createTextNode( elem.match(/^\s*/)[0] ), div.firstChild );
+				
 				elem = jQuery.makeArray( div.childNodes );
 			}
 
-			if ( elem.length === 0 &amp;&amp; (!jQuery.nodeName( elem, &quot;form&quot; ) &amp;&amp; !jQuery.nodeName( elem, &quot;select&quot; )) )
-				return;
-
-			if ( elem[0] == undefined || jQuery.nodeName( elem, &quot;form&quot; ) || elem.options )
+			if ( elem.nodeType )
 				ret.push( elem );
-
 			else
 				ret = jQuery.merge( ret, elem );
 
 		});
 
+		if ( fragment ) {
+			for ( var i = 0; ret[i]; i++ ) {
+				if ( jQuery.nodeName( ret[i], &quot;script&quot; ) &amp;&amp; (!ret[i].type || ret[i].type.toLowerCase() === &quot;text/javascript&quot;) ) {
+					scripts.push( ret[i].parentNode ? ret[i].parentNode.removeChild( ret[i] ) : ret[i] );
+				} else {
+					if ( ret[i].nodeType === 1 )
+						ret.splice.apply( ret, [i + 1, 0].concat(jQuery.makeArray(ret[i].getElementsByTagName(&quot;script&quot;))) );
+					fragment.appendChild( ret[i] );
+				}
+			}
+			
+			return scripts;
+		}
+
 		return ret;
 	},
 
@@ -1042,8 +971,7 @@ jQuery.extend({
 
 		var notxml = !jQuery.isXMLDoc( elem ),
 			// Whether we are setting (or getting)
-			set = value !== undefined,
-			msie = jQuery.browser.msie;
+			set = value !== undefined;
 
 		// Try to normalize/fix the name
 		name = notxml &amp;&amp; jQuery.props[ name ] || name;
@@ -1057,7 +985,7 @@ jQuery.extend({
 
 			// Safari mis-reports the default selected property of a hidden option
 			// Accessing the parent's selectedIndex property fixes it
-			if ( name == &quot;selected&quot; &amp;&amp; jQuery.browser.safari )
+			if ( name == &quot;selected&quot; &amp;&amp; elem.parentNode )
 				elem.parentNode.selectedIndex;
 
 			// If applicable, access the attribute via the DOM 0 way
@@ -1074,17 +1002,30 @@ jQuery.extend({
 				if( jQuery.nodeName( elem, &quot;form&quot; ) &amp;&amp; elem.getAttributeNode(name) )
 					return elem.getAttributeNode( name ).nodeValue;
 
+				// elem.tabIndex doesn't always return the correct value when it hasn't been explicitly set
+				// http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/
+				if ( name == &quot;tabIndex&quot; ) {
+					var attributeNode = elem.getAttributeNode( &quot;tabIndex&quot; );
+					return attributeNode &amp;&amp; attributeNode.specified
+						? attributeNode.value
+						: elem.nodeName.match(/(button|input|object|select|textarea)/i)
+							? 0
+							: elem.nodeName.match(/^(a|area)$/i) &amp;&amp; elem.href
+								? 0
+								: undefined;
+				}
+
 				return elem[ name ];
 			}
 
-			if ( msie &amp;&amp; notxml &amp;&amp;  name == &quot;style&quot; )
+			if ( !jQuery.support.style &amp;&amp; notxml &amp;&amp;  name == &quot;style&quot; )
 				return jQuery.attr( elem.style, &quot;cssText&quot;, value );
 
 			if ( set )
 				// convert the value to a string (all browsers do this but IE) see #1070
 				elem.setAttribute( name, &quot;&quot; + value );
 
-			var attr = msie &amp;&amp; notxml &amp;&amp; special
+			var attr = !jQuery.support.hrefNormalized &amp;&amp; notxml &amp;&amp; special
 					// Some attributes require a special call on IE
 					? elem.getAttribute( name, 2 )
 					: elem.getAttribute( name );
@@ -1096,7 +1037,7 @@ jQuery.extend({
 		// elem is actually elem.style ... set the style
 
 		// IE uses filters for opacity
-		if ( msie &amp;&amp; name == &quot;opacity&quot; ) {
+		if ( !jQuery.support.opacity &amp;&amp; name == &quot;opacity&quot; ) {
 			if ( set ) {
 				// IE has trouble with opacity if it does not have layout
 				// Force it by setting the zoom level
@@ -1131,8 +1072,8 @@ jQuery.extend({
 
 		if( array != null ){
 			var i = array.length;
-			//the window, strings and functions also have 'length'
-			if( i == null || array.split || array.setInterval || array.call )
+			// The window, strings (and functions) also have 'length'
+			if( i == null || typeof array === &quot;string&quot; || jQuery.isFunction(array) || array.setInterval )
 				ret[0] = array;
 			else
 				while( i )
@@ -1157,13 +1098,13 @@ jQuery.extend({
 		var i = 0, elem, pos = first.length;
 		// Also, we need to make sure that the correct elements are being returned
 		// (IE returns comment nodes in a '*' query)
-		if ( jQuery.browser.msie ) {
-			while ( elem = second[ i++ ] )
+		if ( !jQuery.support.getAll ) {
+			while ( (elem = second[ i++ ]) != null )
 				if ( elem.nodeType != 8 )
 					first[ pos++ ] = elem;
 
 		} else
-			while ( elem = second[ i++ ] )
+			while ( (elem = second[ i++ ]) != null )
 				first[ pos++ ] = elem;
 
 		return first;
@@ -1218,37 +1159,21 @@ jQuery.extend({
 	}
 });
 
+// Use of jQuery.browser is deprecated.
+// It's included for backwards compatibility and plugins,
+// although they should work to migrate away.
+
 var userAgent = navigator.userAgent.toLowerCase();
 
 // Figure out what browser is being used
 jQuery.browser = {
-	version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [])[1],
+	version: (userAgent.match( /.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/ ) || [0,'0'])[1],
 	safari: /webkit/.test( userAgent ),
 	opera: /opera/.test( userAgent ),
 	msie: /msie/.test( userAgent ) &amp;&amp; !/opera/.test( userAgent ),
 	mozilla: /mozilla/.test( userAgent ) &amp;&amp; !/(compatible|webkit)/.test( userAgent )
 };
 
-var styleFloat = jQuery.browser.msie ?
-	&quot;styleFloat&quot; :
-	&quot;cssFloat&quot;;
-
-jQuery.extend({
-	// Check to see if the W3C box model is being used
-	boxModel: !jQuery.browser.msie || document.compatMode == &quot;CSS1Compat&quot;,
-
-	props: {
-		&quot;for&quot;: &quot;htmlFor&quot;,
-		&quot;class&quot;: &quot;className&quot;,
-		&quot;float&quot;: styleFloat,
-		cssFloat: styleFloat,
-		styleFloat: styleFloat,
-		readonly: &quot;readOnly&quot;,
-		maxlength: &quot;maxLength&quot;,
-		cellspacing: &quot;cellSpacing&quot;
-	}
-});
-
 jQuery.each({
 	parent: function(elem){return elem.parentNode;},
 	parents: function(elem){return jQuery.dir(elem,&quot;parentNode&quot;);},
@@ -1266,7 +1191,7 @@ jQuery.each({
 		if ( selector &amp;&amp; typeof selector == &quot;string&quot; )
 			ret = jQuery.multiFilter( selector, ret );
 
-		return this.pushStack( jQuery.unique( ret ) );
+		return this.pushStack( jQuery.unique( ret ), name, selector );
 	};
 });
 
@@ -1277,13 +1202,16 @@ jQuery.each({
 	insertAfter: &quot;after&quot;,
 	replaceAll: &quot;replaceWith&quot;
 }, function(name, original){
-	jQuery.fn[ name ] = function() {
-		var args = arguments;
+	jQuery.fn[ name ] = function( selector ) {
+		var ret = [], insert = jQuery( selector );
 
-		return this.each(function(){
-			for ( var i = 0, length = args.length; i &lt; length; i++ )
-				jQuery( args[ i ] )[ original ]( this );
-		});
+		for ( var i = 0, l = insert.length; i &lt; l; i++ ) {
+			var elems = (i &gt; 0 ? this.clone(true) : this).get();
+			jQuery.fn[ original ].apply( jQuery(insert[i]), elems );
+			ret = ret.concat( elems );
+		}
+
+		return this.pushStack( ret, name, selector );
 	};
 });
 
@@ -1302,14 +1230,16 @@ jQuery.each({
 		jQuery.className.remove( this, classNames );
 	},
 
-	toggleClass: function( classNames ) {
-		jQuery.className[ jQuery.className.has( this, classNames ) ? &quot;remove&quot; : &quot;add&quot; ]( this, classNames );
+	toggleClass: function( classNames, state ) {
+		if( typeof state !== &quot;boolean&quot; )
+			state = !jQuery.className.has( this, classNames );
+		jQuery.className[ state ? &quot;add&quot; : &quot;remove&quot; ]( this, classNames );
 	},
 
 	remove: function( selector ) {
-		if ( !selector || jQuery.filter( selector, [ this ] ).r.length ) {
+		if ( !selector || jQuery.filter( selector, [ this ] ).length ) {
 			// Prevent memory leaks
-			jQuery( &quot;*&quot;, this ).add(this).each(function(){
+			jQuery( &quot;*&quot;, this ).add([this]).each(function(){
 				jQuery.event.remove(this);
 				jQuery.removeData(this);
 			});
@@ -1320,7 +1250,7 @@ jQuery.each({
 
 	empty: function() {
 		// Remove element nodes and prevent memory leaks
-		jQuery( &quot;&gt;*&quot;, this ).remove();
+		jQuery(this).children().remove();
 
 		// Remove any remaining nodes
 		while ( this.firstChild )
@@ -1332,489 +1262,1172 @@ jQuery.each({
 	};
 });
 
-jQuery.each([ &quot;Height&quot;, &quot;Width&quot; ], function(i, name){
-	var type = name.toLowerCase();
+// Helper function used by the dimensions and offset modules
+function num(elem, prop) {
+	return elem[0] &amp;&amp; parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
+}
+var expando = &quot;jQuery&quot; + now(), uuid = 0, windowData = {};
+
+jQuery.extend({
+	cache: {},
+
+	data: function( elem, name, data ) {
+		elem = elem == window ?
+			windowData :
+			elem;
+
+		var id = elem[ expando ];
+
+		// Compute a unique ID for the element
+		if ( !id )
+			id = elem[ expando ] = ++uuid;
+
+		// Only generate the data cache if we're
+		// trying to access or manipulate it
+		if ( name &amp;&amp; !jQuery.cache[ id ] )
+			jQuery.cache[ id ] = {};
+
+		// Prevent overriding the named cache with undefined values
+		if ( data !== undefined )
+			jQuery.cache[ id ][ name ] = data;
+
+		// Return the named cache data, or the ID for the element
+		return name ?
+			jQuery.cache[ id ][ name ] :
+			id;
+	},
+
+	removeData: function( elem, name ) {
+		elem = elem == window ?
+			windowData :
+			elem;
+
+		var id = elem[ expando ];
+
+		// If we want to remove a specific section of the element's data
+		if ( name ) {
+			if ( jQuery.cache[ id ] ) {
+				// Remove the section of cache data
+				delete jQuery.cache[ id ][ name ];
+
+				// If we've removed all the data, remove the element's cache
+				name = &quot;&quot;;
+
+				for ( name in jQuery.cache[ id ] )
+					break;
+
+				if ( !name )
+					jQuery.removeData( elem );
+			}
+
+		// Otherwise, we want to remove all of the element's data
+		} else {
+			// Clean up the element expando
+			try {
+				delete elem[ expando ];
+			} catch(e){
+				// IE has trouble directly removing the expando
+				// but it's ok with using removeAttribute
+				if ( elem.removeAttribute )
+					elem.removeAttribute( expando );
+			}
+
+			// Completely remove the data cache
+			delete jQuery.cache[ id ];
+		}
+	},
+	queue: function( elem, type, data ) {
+		if ( elem ){
+	
+			type = (type || &quot;fx&quot;) + &quot;queue&quot;;
+	
+			var q = jQuery.data( elem, type );
+	
+			if ( !q || jQuery.isArray(data) )
+				q = jQuery.data( elem, type, jQuery.makeArray(data) );
+			else if( data )
+				q.push( data );
+	
+		}
+		return q;
+	},
+
+	dequeue: function( elem, type ){
+		var queue = jQuery.queue( elem, type ),
+			fn = queue.shift();
+		
+		if( !type || type === &quot;fx&quot; )
+			fn = queue[0];
+			
+		if( fn !== undefined )
+			fn.call(elem);
+	}
+});
+
+jQuery.fn.extend({
+	data: function( key, value ){
+		var parts = key.split(&quot;.&quot;);
+		parts[1] = parts[1] ? &quot;.&quot; + parts[1] : &quot;&quot;;
+
+		if ( value === undefined ) {
+			var data = this.triggerHandler(&quot;getData&quot; + parts[1] + &quot;!&quot;, [parts[0]]);
+
+			if ( data === undefined &amp;&amp; this.length )
+				data = jQuery.data( this[0], key );
+
+			return data === undefined &amp;&amp; parts[1] ?
+				this.data( parts[0] ) :
+				data;
+		} else
+			return this.trigger(&quot;setData&quot; + parts[1] + &quot;!&quot;, [parts[0], value]).each(function(){
+				jQuery.data( this, key, value );
+			});
+	},
+
+	removeData: function( key ){
+		return this.each(function(){
+			jQuery.removeData( this, key );
+		});
+	},
+	queue: function(type, data){
+		if ( typeof type !== &quot;string&quot; ) {
+			data = type;
+			type = &quot;fx&quot;;
+		}
+
+		if ( data === undefined )
+			return jQuery.queue( this[0], type );
+
+		return this.each(function(){
+			var queue = jQuery.queue( this, type, data );
+			
+			 if( type == &quot;fx&quot; &amp;&amp; queue.length == 1 )
+				queue[0].call(this);
+		});
+	},
+	dequeue: function(type){
+		return this.each(function(){
+			jQuery.dequeue( this, type );
+		});
+	}
+});/*!
+ * Sizzle CSS Selector Engine - v0.9.3
+ *  Copyright 2009, The Dojo Foundation
+ *  Released under the MIT, BSD, and GPL Licenses.
+ *  More information: http://sizzlejs.com/
+ */
+(function(){
 
-	jQuery.fn[ type ] = function( size ) {
-		// Get window width or height
-		return this[0] == window ?
-			// Opera reports document.body.client[Width/Height] properly in both quirks and standards
-			jQuery.browser.opera &amp;&amp; document.body[ &quot;client&quot; + name ] ||
+var chunker = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['&quot;][^'&quot;]*['&quot;]|[^[\]'&quot;]+)+\]|\\.|[^ &gt;+~,(\[\\]+)+|[&gt;+~])(\s*,\s*)?/g,
+	done = 0,
+	toString = Object.prototype.toString;
 
-			// Safari reports inner[Width/Height] just fine (Mozilla and Opera include scroll bar widths)
-			jQuery.browser.safari &amp;&amp; window[ &quot;inner&quot; + name ] ||
+var Sizzle = function(selector, context, results, seed) {
+	results = results || [];
+	context = context || document;
 
-			// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
-			document.compatMode == &quot;CSS1Compat&quot; &amp;&amp; document.documentElement[ &quot;client&quot; + name ] || document.body[ &quot;client&quot; + name ] :
+	if ( context.nodeType !== 1 &amp;&amp; context.nodeType !== 9 )
+		return [];
+	
+	if ( !selector || typeof selector !== &quot;string&quot; ) {
+		return results;
+	}
 
-			// Get document width or height
-			this[0] == document ?
-				// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
-				Math.max(
-					Math.max(document.body[&quot;scroll&quot; + name], document.documentElement[&quot;scroll&quot; + name]),
-					Math.max(document.body[&quot;offset&quot; + name], document.documentElement[&quot;offset&quot; + name])
-				) :
+	var parts = [], m, set, checkSet, check, mode, extra, prune = true;
+	
+	// Reset the position of the chunker regexp (start from head)
+	chunker.lastIndex = 0;
+	
+	while ( (m = chunker.exec(selector)) !== null ) {
+		parts.push( m[1] );
+		
+		if ( m[2] ) {
+			extra = RegExp.rightContext;
+			break;
+		}
+	}
 
-				// Get or set width or height on the element
-				size == undefined ?
-					// Get width or height on the element
-					(this.length ? jQuery.css( this[0], type ) : null) :
+	if ( parts.length &gt; 1 &amp;&amp; origPOS.exec( selector ) ) {
+		if ( parts.length === 2 &amp;&amp; Expr.relative[ parts[0] ] ) {
+			set = posProcess( parts[0] + parts[1], context );
+		} else {
+			set = Expr.relative[ parts[0] ] ?
+				[ context ] :
+				Sizzle( parts.shift(), context );
 
-					// Set the width or height on the element (default to pixels if value is unitless)
-					this.css( type, size.constructor == String ? size : size + &quot;px&quot; );
-	};
-});
+			while ( parts.length ) {
+				selector = parts.shift();
 
-// Helper function used by the dimensions and offset modules
-function num(elem, prop) {
-	return elem[0] &amp;&amp; parseInt( jQuery.curCSS(elem[0], prop, true), 10 ) || 0;
-}var chars = jQuery.browser.safari &amp;&amp; parseInt(jQuery.browser.version) &lt; 417 ?
-		&quot;(?:[\\w*_-]|\\\\.)&quot; :
-		&quot;(?:[\\w\u0128-\uFFFF*_-]|\\\\.)&quot;,
-	quickChild = new RegExp(&quot;^&gt;\\s*(&quot; + chars + &quot;+)&quot;),
-	quickID = new RegExp(&quot;^(&quot; + chars + &quot;+)(#)(&quot; + chars + &quot;+)&quot;),
-	quickClass = new RegExp(&quot;^([#.]?)(&quot; + chars + &quot;*)&quot;);
+				if ( Expr.relative[ selector ] )
+					selector += parts.shift();
 
-jQuery.extend({
-	expr: {
-		&quot;&quot;: function(a,i,m){return m[2]==&quot;*&quot;||jQuery.nodeName(a,m[2]);},
-		&quot;#&quot;: function(a,i,m){return a.getAttribute(&quot;id&quot;)==m[2];},
-		&quot;:&quot;: {
-			// Position Checks
-			lt: function(a,i,m){return i&lt;m[3]-0;},
-			gt: function(a,i,m){return i&gt;m[3]-0;},
-			nth: function(a,i,m){return m[3]-0==i;},
-			eq: function(a,i,m){return m[3]-0==i;},
-			first: function(a,i){return i==0;},
-			last: function(a,i,m,r){return i==r.length-1;},
-			even: function(a,i){return i%2==0;},
-			odd: function(a,i){return i%2;},
-
-			// Child Checks
-			&quot;first-child&quot;: function(a){return a.parentNode.getElementsByTagName(&quot;*&quot;)[0]==a;},
-			&quot;last-child&quot;: function(a){return jQuery.nth(a.parentNode.lastChild,1,&quot;previousSibling&quot;)==a;},
-			&quot;only-child&quot;: function(a){return !jQuery.nth(a.parentNode.lastChild,2,&quot;previousSibling&quot;);},
-
-			// Parent Checks
-			parent: function(a){return a.firstChild;},
-			empty: function(a){return !a.firstChild;},
-
-			// Text Check
-			contains: function(a,i,m){return (a.textContent||a.innerText||jQuery(a).text()||&quot;&quot;).indexOf(m[3])&gt;=0;},
-
-			// Visibility
-			visible: function(a){return &quot;hidden&quot;!=a.type&amp;&amp;jQuery.css(a,&quot;display&quot;)!=&quot;none&quot;&amp;&amp;jQuery.css(a,&quot;visibility&quot;)!=&quot;hidden&quot;;},
-			hidden: function(a){return &quot;hidden&quot;==a.type||jQuery.css(a,&quot;display&quot;)==&quot;none&quot;||jQuery.css(a,&quot;visibility&quot;)==&quot;hidden&quot;;},
-
-			// Form attributes
-			enabled: function(a){return !a.disabled;},
-			disabled: function(a){return a.disabled;},
-			checked: function(a){return a.checked;},
-			selected: function(a){return a.selected||jQuery.attr(a,&quot;selected&quot;);},
-
-			// Form elements
-			text: function(a){return &quot;text&quot;==a.type;},
-			radio: function(a){return &quot;radio&quot;==a.type;},
-			checkbox: function(a){return &quot;checkbox&quot;==a.type;},
-			file: function(a){return &quot;file&quot;==a.type;},
-			password: function(a){return &quot;password&quot;==a.type;},
-			submit: function(a){return &quot;submit&quot;==a.type;},
-			image: function(a){return &quot;image&quot;==a.type;},
-			reset: function(a){return &quot;reset&quot;==a.type;},
-			button: function(a){return &quot;button&quot;==a.type||jQuery.nodeName(a,&quot;button&quot;);},
-			input: function(a){return /input|select|textarea|button/i.test(a.nodeName);},
-
-			// :has()
-			has: function(a,i,m){return jQuery.find(m[3],a).length;},
-
-			// :header
-			header: function(a){return /h\d/i.test(a.nodeName);},
-
-			// :animated
-			animated: function(a){return jQuery.grep(jQuery.timers,function(fn){return a==fn.elem;}).length;}
-		}
-	},
-
-	// The regular expressions that power the parsing engine
-	parse: [
-		// Match: [@value='test'], [@foo]
-		/^(\[) *@?([\w-]+) *([!*$^~=]*) *('?&quot;?)(.*?)\4 *\]/,
-
-		// Match: :contains('foo')
-		/^(:)([\w-]+)\(&quot;?'?(.*?(\(.*?\))?[^(]*?)&quot;?'?\)/,
-
-		// Match: :even, :last-child, #id, .class
-		new RegExp(&quot;^([:.#]*)(&quot; + chars + &quot;+)&quot;)
-	],
-
-	multiFilter: function( expr, elems, not ) {
-		var old, cur = [];
-
-		while ( expr &amp;&amp; expr != old ) {
-			old = expr;
-			var f = jQuery.filter( expr, elems, not );
-			expr = f.t.replace(/^\s*,\s*/, &quot;&quot; );
-			cur = not ? elems = f.r : jQuery.merge( cur, f.r );
-		}
-
-		return cur;
-	},
-
-	find: function( t, context ) {
-		// Quickly handle non-string expressions
-		if ( typeof t != &quot;string&quot; )
-			return [ t ];
-
-		// check to make sure context is a DOM element or a document
-		if ( context &amp;&amp; context.nodeType != 1 &amp;&amp; context.nodeType != 9)
-			return [ ];
-
-		// Set the correct context (if none is provided)
-		context = context || document;
+				set = posProcess( selector, set );
+			}
+		}
+	} else {
+		var ret = seed ?
+			{ expr: parts.pop(), set: makeArray(seed) } :
+			Sizzle.find( parts.pop(), parts.length === 1 &amp;&amp; context.parentNode ? context.parentNode : context, isXML(context) );
+		set = Sizzle.filter( ret.expr, ret.set );
+
+		if ( parts.length &gt; 0 ) {
+			checkSet = makeArray(set);
+		} else {
+			prune = false;
+		}
 
-		// Initialize the search
-		var ret = [context], done = [], last, nodeName;
+		while ( parts.length ) {
+			var cur = parts.pop(), pop = cur;
 
-		// Continue while a selector expression exists, and while
-		// we're no longer looping upon ourselves
-		while ( t &amp;&amp; last != t ) {
-			var r = [];
-			last = t;
+			if ( !Expr.relative[ cur ] ) {
+				cur = &quot;&quot;;
+			} else {
+				pop = parts.pop();
+			}
+
+			if ( pop == null ) {
+				pop = context;
+			}
 
-			t = jQuery.trim(t);
+			Expr.relative[ cur ]( checkSet, pop, isXML(context) );
+		}
+	}
 
-			var foundToken = false,
+	if ( !checkSet ) {
+		checkSet = set;
+	}
 
-			// An attempt at speeding up child selectors that
-			// point to a specific element tag
-				re = quickChild,
+	if ( !checkSet ) {
+		throw &quot;Syntax error, unrecognized expression: &quot; + (cur || selector);
+	}
 
-				m = re.exec(t);
+	if ( toString.call(checkSet) === &quot;[object Array]&quot; ) {
+		if ( !prune ) {
+			results.push.apply( results, checkSet );
+		} else if ( context.nodeType === 1 ) {
+			for ( var i = 0; checkSet[i] != null; i++ ) {
+				if ( checkSet[i] &amp;&amp; (checkSet[i] === true || checkSet[i].nodeType === 1 &amp;&amp; contains(context, checkSet[i])) ) {
+					results.push( set[i] );
+				}
+			}
+		} else {
+			for ( var i = 0; checkSet[i] != null; i++ ) {
+				if ( checkSet[i] &amp;&amp; checkSet[i].nodeType === 1 ) {
+					results.push( set[i] );
+				}
+			}
+		}
+	} else {
+		makeArray( checkSet, results );
+	}
 
-			if ( m ) {
-				nodeName = m[1].toUpperCase();
+	if ( extra ) {
+		Sizzle( extra, context, results, seed );
 
-				// Perform our own iteration and filter
-				for ( var i = 0; ret[i]; i++ )
-					for ( var c = ret[i].firstChild; c; c = c.nextSibling )
-						if ( c.nodeType == 1 &amp;&amp; (nodeName == &quot;*&quot; || c.nodeName.toUpperCase() == nodeName) )
-							r.push( c );
+		if ( sortOrder ) {
+			hasDuplicate = false;
+			results.sort(sortOrder);
 
-				ret = r;
-				t = t.replace( re, &quot;&quot; );
-				if ( t.indexOf(&quot; &quot;) == 0 ) continue;
-				foundToken = true;
-			} else {
-				re = /^([&gt;+~])\s*(\w*)/i;
+			if ( hasDuplicate ) {
+				for ( var i = 1; i &lt; results.length; i++ ) {
+					if ( results[i] === results[i-1] ) {
+						results.splice(i--, 1);
+					}
+				}
+			}
+		}
+	}
 
-				if ( (m = re.exec(t)) != null ) {
-					r = [];
+	return results;
+};
 
-					var merge = {};
-					nodeName = m[2].toUpperCase();
-					m = m[1];
+Sizzle.matches = function(expr, set){
+	return Sizzle(expr, null, null, set);
+};
 
-					for ( var j = 0, rl = ret.length; j &lt; rl; j++ ) {
-						var n = m == &quot;~&quot; || m == &quot;+&quot; ? ret[j].nextSibling : ret[j].firstChild;
-						for ( ; n; n = n.nextSibling )
-							if ( n.nodeType == 1 ) {
-								var id = jQuery.data(n);
+Sizzle.find = function(expr, context, isXML){
+	var set, match;
 
-								if ( m == &quot;~&quot; &amp;&amp; merge[id] ) break;
+	if ( !expr ) {
+		return [];
+	}
 
-								if (!nodeName || n.nodeName.toUpperCase() == nodeName ) {
-									if ( m == &quot;~&quot; ) merge[id] = true;
-									r.push( n );
-								}
+	for ( var i = 0, l = Expr.order.length; i &lt; l; i++ ) {
+		var type = Expr.order[i], match;
+		
+		if ( (match = Expr.match[ type ].exec( expr )) ) {
+			var left = RegExp.leftContext;
+
+			if ( left.substr( left.length - 1 ) !== &quot;\\&quot; ) {
+				match[1] = (match[1] || &quot;&quot;).replace(/\\/g, &quot;&quot;);
+				set = Expr.find[ type ]( match, context, isXML );
+				if ( set != null ) {
+					expr = expr.replace( Expr.match[ type ], &quot;&quot; );
+					break;
+				}
+			}
+		}
+	}
+
+	if ( !set ) {
+		set = context.getElementsByTagName(&quot;*&quot;);
+	}
+
+	return {set: set, expr: expr};
+};
+
+Sizzle.filter = function(expr, set, inplace, not){
+	var old = expr, result = [], curLoop = set, match, anyFound,
+		isXMLFilter = set &amp;&amp; set[0] &amp;&amp; isXML(set[0]);
 
-								if ( m == &quot;+&quot; ) break;
+	while ( expr &amp;&amp; set.length ) {
+		for ( var type in Expr.filter ) {
+			if ( (match = Expr.match[ type ].exec( expr )) != null ) {
+				var filter = Expr.filter[ type ], found, item;
+				anyFound = false;
+
+				if ( curLoop == result ) {
+					result = [];
+				}
+
+				if ( Expr.preFilter[ type ] ) {
+					match = Expr.preFilter[ type ]( match, curLoop, inplace, result, not, isXMLFilter );
+
+					if ( !match ) {
+						anyFound = found = true;
+					} else if ( match === true ) {
+						continue;
+					}
+				}
+
+				if ( match ) {
+					for ( var i = 0; (item = curLoop[i]) != null; i++ ) {
+						if ( item ) {
+							found = filter( item, match, i, curLoop );
+							var pass = not ^ !!found;
+
+							if ( inplace &amp;&amp; found != null ) {
+								if ( pass ) {
+									anyFound = true;
+								} else {
+									curLoop[i] = false;
+								}
+							} else if ( pass ) {
+								result.push( item );
+								anyFound = true;
 							}
+						}
+					}
+				}
+
+				if ( found !== undefined ) {
+					if ( !inplace ) {
+						curLoop = result;
 					}
 
-					ret = r;
+					expr = expr.replace( Expr.match[ type ], &quot;&quot; );
 
-					// And remove the token
-					t = jQuery.trim( t.replace( re, &quot;&quot; ) );
-					foundToken = true;
+					if ( !anyFound ) {
+						return [];
+					}
+
+					break;
 				}
 			}
+		}
 
-			// See if there's still an expression, and that we haven't already
-			// matched a token
-			if ( t &amp;&amp; !foundToken ) {
-				// Handle multiple expressions
-				if ( !t.indexOf(&quot;,&quot;) ) {
-					// Clean the result set
-					if ( context == ret[0] ) ret.shift();
+		// Improper expression
+		if ( expr == old ) {
+			if ( anyFound == null ) {
+				throw &quot;Syntax error, unrecognized expression: &quot; + expr;
+			} else {
+				break;
+			}
+		}
 
-					// Merge the result sets
-					done = jQuery.merge( done, ret );
+		old = expr;
+	}
 
-					// Reset the context
-					r = ret = [context];
+	return curLoop;
+};
 
-					// Touch up the selector string
-					t = &quot; &quot; + t.substr(1,t.length);
+var Expr = Sizzle.selectors = {
+	order: [ &quot;ID&quot;, &quot;NAME&quot;, &quot;TAG&quot; ],
+	match: {
+		ID: /#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
+		CLASS: /\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,
+		NAME: /\[name=['&quot;]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['&quot;]*\]/,
+		ATTR: /\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['&quot;]*)(.*?)\3|)\s*\]/,
+		TAG: /^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,
+		CHILD: /:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,
+		POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,
+		PSEUDO: /:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['&quot;]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/
+	},
+	attrMap: {
+		&quot;class&quot;: &quot;className&quot;,
+		&quot;for&quot;: &quot;htmlFor&quot;
+	},
+	attrHandle: {
+		href: function(elem){
+			return elem.getAttribute(&quot;href&quot;);
+		}
+	},
+	relative: {
+		&quot;+&quot;: function(checkSet, part, isXML){
+			var isPartStr = typeof part === &quot;string&quot;,
+				isTag = isPartStr &amp;&amp; !/\W/.test(part),
+				isPartStrNotTag = isPartStr &amp;&amp; !isTag;
+
+			if ( isTag &amp;&amp; !isXML ) {
+				part = part.toUpperCase();
+			}
 
-				} else {
-					// Optimize for the case nodeName#idName
-					var re2 = quickID;
-					var m = re2.exec(t);
+			for ( var i = 0, l = checkSet.length, elem; i &lt; l; i++ ) {
+				if ( (elem = checkSet[i]) ) {
+					while ( (elem = elem.previousSibling) &amp;&amp; elem.nodeType !== 1 ) {}
 
-					// Re-organize the results, so that they're consistent
-					if ( m ) {
-						m = [ 0, m[2], m[3], m[1] ];
+					checkSet[i] = isPartStrNotTag || elem &amp;&amp; elem.nodeName === part ?
+						elem || false :
+						elem === part;
+				}
+			}
 
-					} else {
-						// Otherwise, do a traditional filter check for
-						// ID, class, and element selectors
-						re2 = quickClass;
-						m = re2.exec(t);
+			if ( isPartStrNotTag ) {
+				Sizzle.filter( part, checkSet, true );
+			}
+		},
+		&quot;&gt;&quot;: function(checkSet, part, isXML){
+			var isPartStr = typeof part === &quot;string&quot;;
+
+			if ( isPartStr &amp;&amp; !/\W/.test(part) ) {
+				part = isXML ? part : part.toUpperCase();
+
+				for ( var i = 0, l = checkSet.length; i &lt; l; i++ ) {
+					var elem = checkSet[i];
+					if ( elem ) {
+						var parent = elem.parentNode;
+						checkSet[i] = parent.nodeName === part ? parent : false;
 					}
+				}
+			} else {
+				for ( var i = 0, l = checkSet.length; i &lt; l; i++ ) {
+					var elem = checkSet[i];
+					if ( elem ) {
+						checkSet[i] = isPartStr ?
+							elem.parentNode :
+							elem.parentNode === part;
+					}
+				}
 
-					m[2] = m[2].replace(/\\/g, &quot;&quot;);
+				if ( isPartStr ) {
+					Sizzle.filter( part, checkSet, true );
+				}
+			}
+		},
+		&quot;&quot;: function(checkSet, part, isXML){
+			var doneName = done++, checkFn = dirCheck;
 
-					var elem = ret[ret.length-1];
+			if ( !part.match(/\W/) ) {
+				var nodeCheck = part = isXML ? part : part.toUpperCase();
+				checkFn = dirNodeCheck;
+			}
 
-					// Try to do a global search by ID, where we can
-					if ( m[1] == &quot;#&quot; &amp;&amp; elem &amp;&amp; elem.getElementById &amp;&amp; !jQuery.isXMLDoc(elem) ) {
-						// Optimization for HTML document case
-						var oid = elem.getElementById(m[2]);
+			checkFn(&quot;parentNode&quot;, part, doneName, checkSet, nodeCheck, isXML);
+		},
+		&quot;~&quot;: function(checkSet, part, isXML){
+			var doneName = done++, checkFn = dirCheck;
 
-						// Do a quick check for the existence of the actual ID attribute
-						// to avoid selecting by the name attribute in IE
-						// also check to insure id is a string to avoid selecting an element with the name of 'id' inside a form
-						if ( (jQuery.browser.msie||jQuery.browser.opera) &amp;&amp; oid &amp;&amp; typeof oid.id == &quot;string&quot; &amp;&amp; oid.id != m[2] )
-							oid = jQuery('[@id=&quot;'+m[2]+'&quot;]', elem)[0];
+			if ( typeof part === &quot;string&quot; &amp;&amp; !part.match(/\W/) ) {
+				var nodeCheck = part = isXML ? part : part.toUpperCase();
+				checkFn = dirNodeCheck;
+			}
 
-						// Do a quick check for node name (where applicable) so
-						// that div#foo searches will be really fast
-						ret = r = oid &amp;&amp; (!m[3] || jQuery.nodeName(oid, m[3])) ? [oid] : [];
-					} else {
-						// We need to find all descendant elements
-						for ( var i = 0; ret[i]; i++ ) {
-							// Grab the tag name being searched for
-							var tag = m[1] == &quot;#&quot; &amp;&amp; m[3] ? m[3] : m[1] != &quot;&quot; || m[0] == &quot;&quot; ? &quot;*&quot; : m[2];
+			checkFn(&quot;previousSibling&quot;, part, doneName, checkSet, nodeCheck, isXML);
+		}
+	},
+	find: {
+		ID: function(match, context, isXML){
+			if ( typeof context.getElementById !== &quot;undefined&quot; &amp;&amp; !isXML ) {
+				var m = context.getElementById(match[1]);
+				return m ? [m] : [];
+			}
+		},
+		NAME: function(match, context, isXML){
+			if ( typeof context.getElementsByName !== &quot;undefined&quot; ) {
+				var ret = [], results = context.getElementsByName(match[1]);
 
-							// Handle IE7 being really dumb about &lt;object&gt;s
-							if ( tag == &quot;*&quot; &amp;&amp; ret[i].nodeName.toLowerCase() == &quot;object&quot; )
-								tag = &quot;param&quot;;
+				for ( var i = 0, l = results.length; i &lt; l; i++ ) {
+					if ( results[i].getAttribute(&quot;name&quot;) === match[1] ) {
+						ret.push( results[i] );
+					}
+				}
 
-							r = jQuery.merge( r, ret[i].getElementsByTagName( tag ));
-						}
+				return ret.length === 0 ? null : ret;
+			}
+		},
+		TAG: function(match, context){
+			return context.getElementsByTagName(match[1]);
+		}
+	},
+	preFilter: {
+		CLASS: function(match, curLoop, inplace, result, not, isXML){
+			match = &quot; &quot; + match[1].replace(/\\/g, &quot;&quot;) + &quot; &quot;;
 
-						// It's faster to filter by class and be done with it
-						if ( m[1] == &quot;.&quot; )
-							r = jQuery.classFilter( r, m[2] );
+			if ( isXML ) {
+				return match;
+			}
 
-						// Same with ID filtering
-						if ( m[1] == &quot;#&quot; ) {
-							var tmp = [];
+			for ( var i = 0, elem; (elem = curLoop[i]) != null; i++ ) {
+				if ( elem ) {
+					if ( not ^ (elem.className &amp;&amp; (&quot; &quot; + elem.className + &quot; &quot;).indexOf(match) &gt;= 0) ) {
+						if ( !inplace )
+							result.push( elem );
+					} else if ( inplace ) {
+						curLoop[i] = false;
+					}
+				}
+			}
 
-							// Try to find the element with the ID
-							for ( var i = 0; r[i]; i++ )
-								if ( r[i].getAttribute(&quot;id&quot;) == m[2] ) {
-									tmp = [ r[i] ];
-									break;
-								}
+			return false;
+		},
+		ID: function(match){
+			return match[1].replace(/\\/g, &quot;&quot;);
+		},
+		TAG: function(match, curLoop){
+			for ( var i = 0; curLoop[i] === false; i++ ){}
+			return curLoop[i] &amp;&amp; isXML(curLoop[i]) ? match[1] : match[1].toUpperCase();
+		},
+		CHILD: function(match){
+			if ( match[1] == &quot;nth&quot; ) {
+				// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
+				var test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
+					match[2] == &quot;even&quot; &amp;&amp; &quot;2n&quot; || match[2] == &quot;odd&quot; &amp;&amp; &quot;2n+1&quot; ||
+					!/\D/.test( match[2] ) &amp;&amp; &quot;0n+&quot; + match[2] || match[2]);
+
+				// calculate the numbers (first)n+(last) including if they are negative
+				match[2] = (test[1] + (test[2] || 1)) - 0;
+				match[3] = test[3] - 0;
+			}
 
-							r = tmp;
-						}
+			// TODO: Move to normal caching system
+			match[0] = done++;
 
-						ret = r;
-					}
+			return match;
+		},
+		ATTR: function(match, curLoop, inplace, result, not, isXML){
+			var name = match[1].replace(/\\/g, &quot;&quot;);
+			
+			if ( !isXML &amp;&amp; Expr.attrMap[name] ) {
+				match[1] = Expr.attrMap[name];
+			}
+
+			if ( match[2] === &quot;~=&quot; ) {
+				match[4] = &quot; &quot; + match[4] + &quot; &quot;;
+			}
 
-					t = t.replace( re2, &quot;&quot; );
+			return match;
+		},
+		PSEUDO: function(match, curLoop, inplace, result, not){
+			if ( match[1] === &quot;not&quot; ) {
+				// If we're dealing with a complex expression, or a simple one
+				if ( match[3].match(chunker).length &gt; 1 || /^\w/.test(match[3]) ) {
+					match[3] = Sizzle(match[3], null, null, curLoop);
+				} else {
+					var ret = Sizzle.filter(match[3], curLoop, inplace, true ^ not);
+					if ( !inplace ) {
+						result.push.apply( result, ret );
+					}
+					return false;
+				}
+			} else if ( Expr.match.POS.test( match[0] ) || Expr.match.CHILD.test( match[0] ) ) {
+				return true;
+			}
+			
+			return match;
+		},
+		POS: function(match){
+			match.unshift( true );
+			return match;
+		}
+	},
+	filters: {
+		enabled: function(elem){
+			return elem.disabled === false &amp;&amp; elem.type !== &quot;hidden&quot;;
+		},
+		disabled: function(elem){
+			return elem.disabled === true;
+		},
+		checked: function(elem){
+			return elem.checked === true;
+		},
+		selected: function(elem){
+			// Accessing this property makes selected-by-default
+			// options in Safari work properly
+			elem.parentNode.selectedIndex;
+			return elem.selected === true;
+		},
+		parent: function(elem){
+			return !!elem.firstChild;
+		},
+		empty: function(elem){
+			return !elem.firstChild;
+		},
+		has: function(elem, i, match){
+			return !!Sizzle( match[3], elem ).length;
+		},
+		header: function(elem){
+			return /h\d/i.test( elem.nodeName );
+		},
+		text: function(elem){
+			return &quot;text&quot; === elem.type;
+		},
+		radio: function(elem){
+			return &quot;radio&quot; === elem.type;
+		},
+		checkbox: function(elem){
+			return &quot;checkbox&quot; === elem.type;
+		},
+		file: function(elem){
+			return &quot;file&quot; === elem.type;
+		},
+		password: function(elem){
+			return &quot;password&quot; === elem.type;
+		},
+		submit: function(elem){
+			return &quot;submit&quot; === elem.type;
+		},
+		image: function(elem){
+			return &quot;image&quot; === elem.type;
+		},
+		reset: function(elem){
+			return &quot;reset&quot; === elem.type;
+		},
+		button: function(elem){
+			return &quot;button&quot; === elem.type || elem.nodeName.toUpperCase() === &quot;BUTTON&quot;;
+		},
+		input: function(elem){
+			return /input|select|textarea|button/i.test(elem.nodeName);
+		}
+	},
+	setFilters: {
+		first: function(elem, i){
+			return i === 0;
+		},
+		last: function(elem, i, match, array){
+			return i === array.length - 1;
+		},
+		even: function(elem, i){
+			return i % 2 === 0;
+		},
+		odd: function(elem, i){
+			return i % 2 === 1;
+		},
+		lt: function(elem, i, match){
+			return i &lt; match[3] - 0;
+		},
+		gt: function(elem, i, match){
+			return i &gt; match[3] - 0;
+		},
+		nth: function(elem, i, match){
+			return match[3] - 0 == i;
+		},
+		eq: function(elem, i, match){
+			return match[3] - 0 == i;
+		}
+	},
+	filter: {
+		PSEUDO: function(elem, match, i, array){
+			var name = match[1], filter = Expr.filters[ name ];
+
+			if ( filter ) {
+				return filter( elem, i, match, array );
+			} else if ( name === &quot;contains&quot; ) {
+				return (elem.textContent || elem.innerText || &quot;&quot;).indexOf(match[3]) &gt;= 0;
+			} else if ( name === &quot;not&quot; ) {
+				var not = match[3];
+
+				for ( var i = 0, l = not.length; i &lt; l; i++ ) {
+					if ( not[i] === elem ) {
+						return false;
+					}
 				}
 
+				return true;
 			}
+		},
+		CHILD: function(elem, match){
+			var type = match[1], node = elem;
+			switch (type) {
+				case 'only':
+				case 'first':
+					while (node = node.previousSibling)  {
+						if ( node.nodeType === 1 ) return false;
+					}
+					if ( type == 'first') return true;
+					node = elem;
+				case 'last':
+					while (node = node.nextSibling)  {
+						if ( node.nodeType === 1 ) return false;
+					}
+					return true;
+				case 'nth':
+					var first = match[2], last = match[3];
 
-			// If a selector string still exists
-			if ( t ) {
-				// Attempt to filter it
-				var val = jQuery.filter(t,r);
-				ret = r = val.r;
-				t = jQuery.trim(val.t);
+					if ( first == 1 &amp;&amp; last == 0 ) {
+						return true;
+					}
+					
+					var doneName = match[0],
+						parent = elem.parentNode;
+	
+					if ( parent &amp;&amp; (parent.sizcache !== doneName || !elem.nodeIndex) ) {
+						var count = 0;
+						for ( node = parent.firstChild; node; node = node.nextSibling ) {
+							if ( node.nodeType === 1 ) {
+								node.nodeIndex = ++count;
+							}
+						} 
+						parent.sizcache = doneName;
+					}
+					
+					var diff = elem.nodeIndex - last;
+					if ( first == 0 ) {
+						return diff == 0;
+					} else {
+						return ( diff % first == 0 &amp;&amp; diff / first &gt;= 0 );
+					}
+			}
+		},
+		ID: function(elem, match){
+			return elem.nodeType === 1 &amp;&amp; elem.getAttribute(&quot;id&quot;) === match;
+		},
+		TAG: function(elem, match){
+			return (match === &quot;*&quot; &amp;&amp; elem.nodeType === 1) || elem.nodeName === match;
+		},
+		CLASS: function(elem, match){
+			return (&quot; &quot; + (elem.className || elem.getAttribute(&quot;class&quot;)) + &quot; &quot;)
+				.indexOf( match ) &gt; -1;
+		},
+		ATTR: function(elem, match){
+			var name = match[1],
+				result = Expr.attrHandle[ name ] ?
+					Expr.attrHandle[ name ]( elem ) :
+					elem[ name ] != null ?
+						elem[ name ] :
+						elem.getAttribute( name ),
+				value = result + &quot;&quot;,
+				type = match[2],
+				check = match[4];
+
+			return result == null ?
+				type === &quot;!=&quot; :
+				type === &quot;=&quot; ?
+				value === check :
+				type === &quot;*=&quot; ?
+				value.indexOf(check) &gt;= 0 :
+				type === &quot;~=&quot; ?
+				(&quot; &quot; + value + &quot; &quot;).indexOf(check) &gt;= 0 :
+				!check ?
+				value &amp;&amp; result !== false :
+				type === &quot;!=&quot; ?
+				value != check :
+				type === &quot;^=&quot; ?
+				value.indexOf(check) === 0 :
+				type === &quot;$=&quot; ?
+				value.substr(value.length - check.length) === check :
+				type === &quot;|=&quot; ?
+				value === check || value.substr(0, check.length + 1) === check + &quot;-&quot; :
+				false;
+		},
+		POS: function(elem, match, i, array){
+			var name = match[2], filter = Expr.setFilters[ name ];
+
+			if ( filter ) {
+				return filter( elem, i, match, array );
 			}
 		}
+	}
+};
 
-		// An error occurred with the selector;
-		// just return an empty set instead
-		if ( t )
-			ret = [];
+var origPOS = Expr.match.POS;
 
-		// Remove the root context
-		if ( ret &amp;&amp; context == ret[0] )
-			ret.shift();
+for ( var type in Expr.match ) {
+	Expr.match[ type ] = RegExp( Expr.match[ type ].source + /(?![^\[]*\])(?![^\(]*\))/.source );
+}
 
-		// And combine the results
-		done = jQuery.merge( done, ret );
+var makeArray = function(array, results) {
+	array = Array.prototype.slice.call( array );
 
-		return done;
-	},
+	if ( results ) {
+		results.push.apply( results, array );
+		return results;
+	}
+	
+	return array;
+};
+
+// Perform a simple check to determine if the browser is capable of
+// converting a NodeList to an array using builtin methods.
+try {
+	Array.prototype.slice.call( document.documentElement.childNodes );
+
+// Provide a fallback method if it does not work
+} catch(e){
+	makeArray = function(array, results) {
+		var ret = results || [];
 
-	classFilter: function(r,m,not){
-		m = &quot; &quot; + m + &quot; &quot;;
-		var tmp = [];
-		for ( var i = 0; r[i]; i++ ) {
-			var pass = (&quot; &quot; + r[i].className + &quot; &quot;).indexOf( m ) &gt;= 0;
-			if ( !not &amp;&amp; pass || not &amp;&amp; !pass )
-				tmp.push( r[i] );
+		if ( toString.call(array) === &quot;[object Array]&quot; ) {
+			Array.prototype.push.apply( ret, array );
+		} else {
+			if ( typeof array.length === &quot;number&quot; ) {
+				for ( var i = 0, l = array.length; i &lt; l; i++ ) {
+					ret.push( array[i] );
+				}
+			} else {
+				for ( var i = 0; array[i]; i++ ) {
+					ret.push( array[i] );
+				}
+			}
 		}
-		return tmp;
-	},
 
-	filter: function(t,r,not) {
-		var last;
+		return ret;
+	};
+}
+
+var sortOrder;
+
+if ( document.documentElement.compareDocumentPosition ) {
+	sortOrder = function( a, b ) {
+		var ret = a.compareDocumentPosition(b) &amp; 4 ? -1 : a === b ? 0 : 1;
+		if ( ret === 0 ) {
+			hasDuplicate = true;
+		}
+		return ret;
+	};
+} else if ( &quot;sourceIndex&quot; in document.documentElement ) {
+	sortOrder = function( a, b ) {
+		var ret = a.sourceIndex - b.sourceIndex;
+		if ( ret === 0 ) {
+			hasDuplicate = true;
+		}
+		return ret;
+	};
+} else if ( document.createRange ) {
+	sortOrder = function( a, b ) {
+		var aRange = a.ownerDocument.createRange(), bRange = b.ownerDocument.createRange();
+		aRange.selectNode(a);
+		aRange.collapse(true);
+		bRange.selectNode(b);
+		bRange.collapse(true);
+		var ret = aRange.compareBoundaryPoints(Range.START_TO_END, bRange);
+		if ( ret === 0 ) {
+			hasDuplicate = true;
+		}
+		return ret;
+	};
+}
+
+// Check to see if the browser returns elements by name when
+// querying by getElementById (and provide a workaround)
+(function(){
+	// We're going to inject a fake input element with a specified name
+	var form = document.createElement(&quot;form&quot;),
+		id = &quot;script&quot; + (new Date).getTime();
+	form.innerHTML = &quot;&lt;input name='&quot; + id + &quot;'/&gt;&quot;;
+
+	// Inject it into the root element, check its status, and remove it quickly
+	var root = document.documentElement;
+	root.insertBefore( form, root.firstChild );
+
+	// The workaround has to do additional checks after a getElementById
+	// Which slows things down for other browsers (hence the branching)
+	if ( !!document.getElementById( id ) ) {
+		Expr.find.ID = function(match, context, isXML){
+			if ( typeof context.getElementById !== &quot;undefined&quot; &amp;&amp; !isXML ) {
+				var m = context.getElementById(match[1]);
+				return m ? m.id === match[1] || typeof m.getAttributeNode !== &quot;undefined&quot; &amp;&amp; m.getAttributeNode(&quot;id&quot;).nodeValue === match[1] ? [m] : undefined : [];
+			}
+		};
 
-		// Look for common filter expressions
-		while ( t &amp;&amp; t != last ) {
-			last = t;
+		Expr.filter.ID = function(elem, match){
+			var node = typeof elem.getAttributeNode !== &quot;undefined&quot; &amp;&amp; elem.getAttributeNode(&quot;id&quot;);
+			return elem.nodeType === 1 &amp;&amp; node &amp;&amp; node.nodeValue === match;
+		};
+	}
 
-			var p = jQuery.parse, m;
+	root.removeChild( form );
+})();
 
-			for ( var i = 0; p[i]; i++ ) {
-				m = p[i].exec( t );
+(function(){
+	// Check to see if the browser returns only elements
+	// when doing getElementsByTagName(&quot;*&quot;)
 
-				if ( m ) {
-					// Remove what we just matched
-					t = t.substring( m[0].length );
+	// Create a fake element
+	var div = document.createElement(&quot;div&quot;);
+	div.appendChild( document.createComment(&quot;&quot;) );
 
-					m[2] = m[2].replace(/\\/g, &quot;&quot;);
-					break;
+	// Make sure no comments are found
+	if ( div.getElementsByTagName(&quot;*&quot;).length &gt; 0 ) {
+		Expr.find.TAG = function(match, context){
+			var results = context.getElementsByTagName(match[1]);
+
+			// Filter out possible comments
+			if ( match[1] === &quot;*&quot; ) {
+				var tmp = [];
+
+				for ( var i = 0; results[i]; i++ ) {
+					if ( results[i].nodeType === 1 ) {
+						tmp.push( results[i] );
+					}
 				}
+
+				results = tmp;
 			}
 
-			if ( !m )
-				break;
+			return results;
+		};
+	}
 
-			// :not() is a special case that can be optimized by
-			// keeping it out of the expression list
-			if ( m[1] == &quot;:&quot; &amp;&amp; m[2] == &quot;not&quot; )
-				// optimize if only one selector found (most common case)
-				r = isSimple.test( m[3] ) ?
-					jQuery.filter(m[3], r, true).r :
-					jQuery( r ).not( m[3] );
-
-			// We can get a big speed boost by filtering by class here
-			else if ( m[1] == &quot;.&quot; )
-				r = jQuery.classFilter(r, m[2], not);
-
-			else if ( m[1] == &quot;[&quot; ) {
-				var tmp = [], type = m[3];
-
-				for ( var i = 0, rl = r.length; i &lt; rl; i++ ) {
-					var a = r[i], z = a[ jQuery.props[m[2]] || m[2] ];
-
-					if ( z == null || /href|src|selected/.test(m[2]) )
-						z = jQuery.attr(a,m[2]) || '';
-
-					if ( (type == &quot;&quot; &amp;&amp; !!z ||
-						 type == &quot;=&quot; &amp;&amp; z == m[5] ||
-						 type == &quot;!=&quot; &amp;&amp; z != m[5] ||
-						 type == &quot;^=&quot; &amp;&amp; z &amp;&amp; !z.indexOf(m[5]) ||
-						 type == &quot;$=&quot; &amp;&amp; z.substr(z.length - m[5].length) == m[5] ||
-						 (type == &quot;*=&quot; || type == &quot;~=&quot;) &amp;&amp; z.indexOf(m[5]) &gt;= 0) ^ not )
-							tmp.push( a );
-				}
+	// Check to see if an attribute returns normalized href attributes
+	div.innerHTML = &quot;&lt;a href='#'&gt;&lt;/a&gt;&quot;;
+	if ( div.firstChild &amp;&amp; typeof div.firstChild.getAttribute !== &quot;undefined&quot; &amp;&amp;
+			div.firstChild.getAttribute(&quot;href&quot;) !== &quot;#&quot; ) {
+		Expr.attrHandle.href = function(elem){
+			return elem.getAttribute(&quot;href&quot;, 2);
+		};
+	}
+})();
+
+if ( document.querySelectorAll ) (function(){
+	var oldSizzle = Sizzle, div = document.createElement(&quot;div&quot;);
+	div.innerHTML = &quot;&lt;p class='TEST'&gt;&lt;/p&gt;&quot;;
 
-				r = tmp;
+	// Safari can't handle uppercase or unicode characters when
+	// in quirks mode.
+	if ( div.querySelectorAll &amp;&amp; div.querySelectorAll(&quot;.TEST&quot;).length === 0 ) {
+		return;
+	}
+	
+	Sizzle = function(query, context, extra, seed){
+		context = context || document;
 
-			// We can get a speed boost by handling nth-child here
-			} else if ( m[1] == &quot;:&quot; &amp;&amp; m[2] == &quot;nth-child&quot; ) {
-				var merge = {}, tmp = [],
-					// parse equations like 'even', 'odd', '5', '2n', '3n+2', '4n-1', '-n+6'
-					test = /(-?)(\d*)n((?:\+|-)?\d*)/.exec(
-						m[3] == &quot;even&quot; &amp;&amp; &quot;2n&quot; || m[3] == &quot;odd&quot; &amp;&amp; &quot;2n+1&quot; ||
-						!/\D/.test(m[3]) &amp;&amp; &quot;0n+&quot; + m[3] || m[3]),
-					// calculate the numbers (first)n+(last) including if they are negative
-					first = (test[1] + (test[2] || 1)) - 0, last = test[3] - 0;
+		// Only use querySelectorAll on non-XML documents
+		// (ID selectors don't work in non-HTML documents)
+		if ( !seed &amp;&amp; context.nodeType === 9 &amp;&amp; !isXML(context) ) {
+			try {
+				return makeArray( context.querySelectorAll(query), extra );
+			} catch(e){}
+		}
+		
+		return oldSizzle(query, context, extra, seed);
+	};
 
-				// loop through all the elements left in the jQuery object
-				for ( var i = 0, rl = r.length; i &lt; rl; i++ ) {
-					var node = r[i], parentNode = node.parentNode, id = jQuery.data(parentNode);
+	Sizzle.find = oldSizzle.find;
+	Sizzle.filter = oldSizzle.filter;
+	Sizzle.selectors = oldSizzle.selectors;
+	Sizzle.matches = oldSizzle.matches;
+})();
 
-					if ( !merge[id] ) {
-						var c = 1;
+if ( document.getElementsByClassName &amp;&amp; document.documentElement.getElementsByClassName ) (function(){
+	var div = document.createElement(&quot;div&quot;);
+	div.innerHTML = &quot;&lt;div class='test e'&gt;&lt;/div&gt;&lt;div class='test'&gt;&lt;/div&gt;&quot;;
 
-						for ( var n = parentNode.firstChild; n; n = n.nextSibling )
-							if ( n.nodeType == 1 )
-								n.nodeIndex = c++;
+	// Opera can't find a second classname (in 9.6)
+	if ( div.getElementsByClassName(&quot;e&quot;).length === 0 )
+		return;
 
-						merge[id] = true;
-					}
+	// Safari caches class attributes, doesn't catch changes (in 3.2)
+	div.lastChild.className = &quot;e&quot;;
 
-					var add = false;
+	if ( div.getElementsByClassName(&quot;e&quot;).length === 1 )
+		return;
 
-					if ( first == 0 ) {
-						if ( node.nodeIndex == last )
-							add = true;
-					} else if ( (node.nodeIndex - last) % first == 0 &amp;&amp; (node.nodeIndex - last) / first &gt;= 0 )
-						add = true;
+	Expr.order.splice(1, 0, &quot;CLASS&quot;);
+	Expr.find.CLASS = function(match, context, isXML) {
+		if ( typeof context.getElementsByClassName !== &quot;undefined&quot; &amp;&amp; !isXML ) {
+			return context.getElementsByClassName(match[1]);
+		}
+	};
+})();
+
+function dirNodeCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+	var sibDir = dir == &quot;previousSibling&quot; &amp;&amp; !isXML;
+	for ( var i = 0, l = checkSet.length; i &lt; l; i++ ) {
+		var elem = checkSet[i];
+		if ( elem ) {
+			if ( sibDir &amp;&amp; elem.nodeType === 1 ){
+				elem.sizcache = doneName;
+				elem.sizset = i;
+			}
+			elem = elem[dir];
+			var match = false;
 
-					if ( add ^ not )
-						tmp.push( node );
+			while ( elem ) {
+				if ( elem.sizcache === doneName ) {
+					match = checkSet[elem.sizset];
+					break;
 				}
 
-				r = tmp;
-
-			// Otherwise, find the expression to execute
-			} else {
-				var fn = jQuery.expr[ m[1] ];
-				if ( typeof fn == &quot;object&quot; )
-					fn = fn[ m[2] ];
+				if ( elem.nodeType === 1 &amp;&amp; !isXML ){
+					elem.sizcache = doneName;
+					elem.sizset = i;
+				}
 
-				if ( typeof fn == &quot;string&quot; )
-					fn = eval(&quot;false||function(a,i){return &quot; + fn + &quot;;}&quot;);
+				if ( elem.nodeName === cur ) {
+					match = elem;
+					break;
+				}
 
-				// Execute it against the current filter
-				r = jQuery.grep( r, function(elem, i){
-					return fn(elem, i, m, r);
-				}, not );
+				elem = elem[dir];
 			}
+
+			checkSet[i] = match;
 		}
+	}
+}
 
-		// Return an array of filtered elements (r)
-		// and the modified expression string (t)
-		return { r: r, t: t };
-	},
+function dirCheck( dir, cur, doneName, checkSet, nodeCheck, isXML ) {
+	var sibDir = dir == &quot;previousSibling&quot; &amp;&amp; !isXML;
+	for ( var i = 0, l = checkSet.length; i &lt; l; i++ ) {
+		var elem = checkSet[i];
+		if ( elem ) {
+			if ( sibDir &amp;&amp; elem.nodeType === 1 ) {
+				elem.sizcache = doneName;
+				elem.sizset = i;
+			}
+			elem = elem[dir];
+			var match = false;
+
+			while ( elem ) {
+				if ( elem.sizcache === doneName ) {
+					match = checkSet[elem.sizset];
+					break;
+				}
 
-	dir: function( elem, dir ){
-		var matched = [],
-			cur = elem[dir];
-		while ( cur &amp;&amp; cur != document ) {
-			if ( cur.nodeType == 1 )
-				matched.push( cur );
-			cur = cur[dir];
+				if ( elem.nodeType === 1 ) {
+					if ( !isXML ) {
+						elem.sizcache = doneName;
+						elem.sizset = i;
+					}
+					if ( typeof cur !== &quot;string&quot; ) {
+						if ( elem === cur ) {
+							match = true;
+							break;
+						}
+
+					} else if ( Sizzle.filter( cur, [elem] ).length &gt; 0 ) {
+						match = elem;
+						break;
+					}
+				}
+
+				elem = elem[dir];
+			}
+
+			checkSet[i] = match;
 		}
-		return matched;
-	},
+	}
+}
 
-	nth: function(cur,result,dir,elem){
-		result = result || 1;
-		var num = 0;
+var contains = document.compareDocumentPosition ?  function(a, b){
+	return a.compareDocumentPosition(b) &amp; 16;
+} : function(a, b){
+	return a !== b &amp;&amp; (a.contains ? a.contains(b) : true);
+};
 
-		for ( ; cur; cur = cur[dir] )
-			if ( cur.nodeType == 1 &amp;&amp; ++num == result )
-				break;
+var isXML = function(elem){
+	return elem.nodeType === 9 &amp;&amp; elem.documentElement.nodeName !== &quot;HTML&quot; ||
+		!!elem.ownerDocument &amp;&amp; isXML( elem.ownerDocument );
+};
 
-		return cur;
-	},
+var posProcess = function(selector, context){
+	var tmpSet = [], later = &quot;&quot;, match,
+		root = context.nodeType ? [context] : context;
 
-	sibling: function( n, elem ) {
-		var r = [];
+	// Position selectors must be done after the filter
+	// And so must :not(positional) so we move all PSEUDOs to the end
+	while ( (match = Expr.match.PSEUDO.exec( selector )) ) {
+		later += match[0];
+		selector = selector.replace( Expr.match.PSEUDO, &quot;&quot; );
+	}
 
-		for ( ; n; n = n.nextSibling ) {
-			if ( n.nodeType == 1 &amp;&amp; n != elem )
-				r.push( n );
-		}
+	selector = Expr.relative[selector] ? selector + &quot;*&quot; : selector;
 
-		return r;
+	for ( var i = 0, l = root.length; i &lt; l; i++ ) {
+		Sizzle( selector, root[i], tmpSet );
 	}
-});
+
+	return Sizzle.filter( later, tmpSet );
+};
+
+// EXPOSE
+jQuery.find = Sizzle;
+jQuery.filter = Sizzle.filter;
+jQuery.expr = Sizzle.selectors;
+jQuery.expr[&quot;:&quot;] = jQuery.expr.filters;
+
+Sizzle.selectors.filters.hidden = function(elem){
+	return elem.offsetWidth === 0 || elem.offsetHeight === 0;
+};
+
+Sizzle.selectors.filters.visible = function(elem){
+	return elem.offsetWidth &gt; 0 || elem.offsetHeight &gt; 0;
+};
+
+Sizzle.selectors.filters.animated = function(elem){
+	return jQuery.grep(jQuery.timers, function(fn){
+		return elem === fn.elem;
+	}).length;
+};
+
+jQuery.multiFilter = function( expr, elems, not ) {
+	if ( not ) {
+		expr = &quot;:not(&quot; + expr + &quot;)&quot;;
+	}
+
+	return Sizzle.matches(expr, elems);
+};
+
+jQuery.dir = function( elem, dir ){
+	var matched = [], cur = elem[dir];
+	while ( cur &amp;&amp; cur != document ) {
+		if ( cur.nodeType == 1 )
+			matched.push( cur );
+		cur = cur[dir];
+	}
+	return matched;
+};
+
+jQuery.nth = function(cur, result, dir, elem){
+	result = result || 1;
+	var num = 0;
+
+	for ( ; cur; cur = cur[dir] )
+		if ( cur.nodeType == 1 &amp;&amp; ++num == result )
+			break;
+
+	return cur;
+};
+
+jQuery.sibling = function(n, elem){
+	var r = [];
+
+	for ( ; n; n = n.nextSibling ) {
+		if ( n.nodeType == 1 &amp;&amp; n != elem )
+			r.push( n );
+	}
+
+	return r;
+};
+
+return;
+
+window.Sizzle = Sizzle;
+
+})();
 /*
  * A number of helper functions used for managing events.
- * Many of the ideas behind this code orignated from
+ * Many of the ideas behind this code originated from
  * Dean Edwards' addEvent library.
  */
 jQuery.event = {
@@ -1827,7 +2440,7 @@ jQuery.event = {
 
 		// For whatever reason, IE has trouble passing the window object
 		// around, causing it to be cloned in the process
-		if ( jQuery.browser.msie &amp;&amp; elem.setInterval )
+		if ( elem.setInterval &amp;&amp; elem != window )
 			elem = window;
 
 		// Make sure that the function being executed has a unique ID
@@ -1835,15 +2448,12 @@ jQuery.event = {
 			handler.guid = this.guid++;
 
 		// if data is passed, bind to handler
-		if( data != undefined ) {
+		if ( data !== undefined ) {
 			// Create temporary function pointer to original handler
 			var fn = handler;
 
 			// Create unique handler function, wrapped around original handler
-			handler = this.proxy( fn, function() {
-				// Pass arguments and context to original handler
-				return fn.apply(this, arguments);
-			});
+			handler = this.proxy( fn );
 
 			// Store data in unique handler
 			handler.data = data;
@@ -1854,8 +2464,9 @@ jQuery.event = {
 			handle = jQuery.data(elem, &quot;handle&quot;) || jQuery.data(elem, &quot;handle&quot;, function(){
 				// Handle the second event of a trigger and when
 				// an event is called after a page has unloaded
-				if ( typeof jQuery != &quot;undefined&quot; &amp;&amp; !jQuery.event.triggered )
-					return jQuery.event.handle.apply(arguments.callee.elem, arguments);
+				return typeof jQuery !== &quot;undefined&quot; &amp;&amp; !jQuery.event.triggered ?
+					jQuery.event.handle.apply(arguments.callee.elem, arguments) :
+					undefined;
 			});
 		// Add elem as a property of the handle function
 		// This is to prevent a memory leak with non-native
@@ -1866,12 +2477,15 @@ jQuery.event = {
 		// jQuery(...).bind(&quot;mouseover mouseout&quot;, fn);
 		jQuery.each(types.split(/\s+/), function(index, type) {
 			// Namespaced event handlers
-			var parts = type.split(&quot;.&quot;);
-			type = parts[0];
-			handler.type = parts[1];
+			var namespaces = type.split(&quot;.&quot;);
+			type = namespaces.shift();
+			handler.type = namespaces.slice().sort().join(&quot;.&quot;);
 
 			// Get the current list of functions bound to this event
 			var handlers = events[type];
+			
+			if ( jQuery.event.specialAll[type] )
+				jQuery.event.specialAll[type].setup.call(elem, data, namespaces);
 
 			// Init the event handler queue
 			if (!handlers) {
@@ -1880,7 +2494,7 @@ jQuery.event = {
 				// Check for a special event handler
 				// Only use addEventListener/attachEvent if the special
 				// events handler returns false
-				if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem) === false ) {
+				if ( !jQuery.event.special[type] || jQuery.event.special[type].setup.call(elem, data, namespaces) === false ) {
 					// Bind the global event handler to the element
 					if (elem.addEventListener)
 						elem.addEventListener(type, handle, false);
@@ -1913,7 +2527,7 @@ jQuery.event = {
 
 		if ( events ) {
 			// Unbind all events for the element
-			if ( types == undefined || (typeof types == &quot;string&quot; &amp;&amp; types.charAt(0) == &quot;.&quot;) )
+			if ( types === undefined || (typeof types === &quot;string&quot; &amp;&amp; types.charAt(0) == &quot;.&quot;) )
 				for ( var type in events )
 					this.remove( elem, type + (types || &quot;&quot;) );
 			else {
@@ -1927,8 +2541,9 @@ jQuery.event = {
 				// jQuery(...).unbind(&quot;mouseover mouseout&quot;, fn);
 				jQuery.each(types.split(/\s+/), function(index, type){
 					// Namespaced event handlers
-					var parts = type.split(&quot;.&quot;);
-					type = parts[0];
+					var namespaces = type.split(&quot;.&quot;);
+					type = namespaces.shift();
+					var namespace = RegExp(&quot;(^|\\.)&quot; + namespaces.slice().sort().join(&quot;.*\\.&quot;) + &quot;(\\.|$)&quot;);
 
 					if ( events[type] ) {
 						// remove the given handler for the given type
@@ -1937,15 +2552,18 @@ jQuery.event = {
 
 						// remove all handlers for the given type
 						else
-							for ( handler in events[type] )
+							for ( var handle in events[type] )
 								// Handle the removal of namespaced events
-								if ( !parts[1] || events[type][handler].type == parts[1] )
-									delete events[type][handler];
+								if ( namespace.test(events[type][handle].type) )
+									delete events[type][handle];
+									
+						if ( jQuery.event.specialAll[type] )
+							jQuery.event.specialAll[type].teardown.call(elem, namespaces);
 
 						// remove generic event handler if no more handlers exist
 						for ( ret in events[type] ) break;
 						if ( !ret ) {
-							if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem) === false ) {
+							if ( !jQuery.event.special[type] || jQuery.event.special[type].teardown.call(elem, namespaces) === false ) {
 								if (elem.removeEventListener)
 									elem.removeEventListener(type, jQuery.data(elem, &quot;handle&quot;), false);
 								else if (elem.detachEvent)
@@ -1969,97 +2587,96 @@ jQuery.event = {
 		}
 	},
 
-	trigger: function(type, data, elem, donative, extra) {
-		// Clone the incoming data, if any
-		data = jQuery.makeArray(data);
+	// bubbling is internal
+	trigger: function( event, data, elem, bubbling ) {
+		// Event object or event type
+		var type = event.type || event;
+
+		if( !bubbling ){
+			event = typeof event === &quot;object&quot; ?
+				// jQuery.Event object
+				event[expando] ? event :
+				// Object literal
+				jQuery.extend( jQuery.Event(type), event ) :
+				// Just the event type (string)
+				jQuery.Event(type);
+
+			if ( type.indexOf(&quot;!&quot;) &gt;= 0 ) {
+				event.type = type = type.slice(0, -1);
+				event.exclusive = true;
+			}
 
-		if ( type.indexOf(&quot;!&quot;) &gt;= 0 ) {
-			type = type.slice(0, -1);
-			var exclusive = true;
-		}
+			// Handle a global trigger
+			if ( !elem ) {
+				// Don't bubble custom events when global (to avoid too much overhead)
+				event.stopPropagation();
+				// Only trigger if we've ever bound an event for it
+				if ( this.global[type] )
+					jQuery.each( jQuery.cache, function(){
+						if ( this.events &amp;&amp; this.events[type] )
+							jQuery.event.trigger( event, data, this.handle.elem );
+					});
+			}
 
-		// Handle a global trigger
-		if ( !elem ) {
-			// Only trigger if we've ever bound an event for it
-			if ( this.global[type] )
-				jQuery(&quot;*&quot;).add([window, document]).trigger(type, data);
+			// Handle triggering a single element
 
-		// Handle triggering a single element
-		} else {
 			// don't do events on text and comment nodes
-			if ( elem.nodeType == 3 || elem.nodeType == 8 )
+			if ( !elem || elem.nodeType == 3 || elem.nodeType == 8 )
 				return undefined;
+			
+			// Clean up in case it is reused
+			event.result = undefined;
+			event.target = elem;
+			
+			// Clone the incoming data, if any
+			data = jQuery.makeArray(data);
+			data.unshift( event );
+		}
 
-			var val, ret, fn = jQuery.isFunction( elem[ type ] || null ),
-				// Check to see if we need to provide a fake event, or not
-				event = !data[0] || !data[0].preventDefault;
-
-			// Pass along a fake event
-			if ( event ) {
-				data.unshift({
-					type: type,
-					target: elem,
-					preventDefault: function(){},
-					stopPropagation: function(){},
-					timeStamp: now()
-				});
-				data[0][expando] = true; // no need to fix fake event
-			}
-
-			// Enforce the right trigger type
-			data[0].type = type;
-			if ( exclusive )
-				data[0].exclusive = true;
-
-			// Trigger the event, it is assumed that &quot;handle&quot; is a function
-			var handle = jQuery.data(elem, &quot;handle&quot;);
-			if ( handle )
-				val = handle.apply( elem, data );
+		event.currentTarget = elem;
 
-			// Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
-			if ( (!fn || (jQuery.nodeName(elem, 'a') &amp;&amp; type == &quot;click&quot;)) &amp;&amp; elem[&quot;on&quot;+type] &amp;&amp; elem[&quot;on&quot;+type].apply( elem, data ) === false )
-				val = false;
+		// Trigger the event, it is assumed that &quot;handle&quot; is a function
+		var handle = jQuery.data(elem, &quot;handle&quot;);
+		if ( handle )
+			handle.apply( elem, data );
 
-			// Extra functions don't get the custom event object
-			if ( event )
-				data.shift();
+		// Handle triggering native .onfoo handlers (and on links since we don't call .click() for links)
+		if ( (!elem[type] || (jQuery.nodeName(elem, 'a') &amp;&amp; type == &quot;click&quot;)) &amp;&amp; elem[&quot;on&quot;+type] &amp;&amp; elem[&quot;on&quot;+type].apply( elem, data ) === false )
+			event.result = false;
 
-			// Handle triggering of extra function
-			if ( extra &amp;&amp; jQuery.isFunction( extra ) ) {
-				// call the extra function and tack the current return value on the end for possible inspection
-				ret = extra.apply( elem, val == null ? data : data.concat( val ) );
-				// if anything is returned, give it precedence and have it overwrite the previous value
-				if (ret !== undefined)
-					val = ret;
-			}
+		// Trigger the native events (except for clicks on links)
+		if ( !bubbling &amp;&amp; elem[type] &amp;&amp; !event.isDefaultPrevented() &amp;&amp; !(jQuery.nodeName(elem, 'a') &amp;&amp; type == &quot;click&quot;) ) {
+			this.triggered = true;
+			try {
+				elem[ type ]();
+			// prevent IE from throwing an error for some hidden elements
+			} catch (e) {}
+		}
 
-			// Trigger the native events (except for clicks on links)
-			if ( fn &amp;&amp; donative !== false &amp;&amp; val !== false &amp;&amp; !(jQuery.nodeName(elem, 'a') &amp;&amp; type == &quot;click&quot;) ) {
-				this.triggered = true;
-				try {
-					elem[ type ]();
-				// prevent IE from throwing an error for some hidden elements
-				} catch (e) {}
-			}
+		this.triggered = false;
 
-			this.triggered = false;
+		if ( !event.isPropagationStopped() ) {
+			var parent = elem.parentNode || elem.ownerDocument;
+			if ( parent )
+				jQuery.event.trigger(event, data, parent, true);
 		}
-
-		return val;
 	},
 
 	handle: function(event) {
 		// returned undefined or false
-		var val, ret, namespace, all, handlers;
+		var all, handlers;
 
 		event = arguments[0] = jQuery.event.fix( event || window.event );
-
+		event.currentTarget = this;
+		
 		// Namespaced event handlers
-		namespace = event.type.split(&quot;.&quot;);
-		event.type = namespace[0];
-		namespace = namespace[1];
+		var namespaces = event.type.split(&quot;.&quot;);
+		event.type = namespaces.shift();
+
 		// Cache this now, all = true means, any handler
-		all = !namespace &amp;&amp; !event.exclusive;
+		all = !namespaces.length &amp;&amp; !event.exclusive;
+		
+		var namespace = RegExp(&quot;(^|\\.)&quot; + namespaces.slice().sort().join(&quot;.*\\.&quot;) + &quot;(\\.|$)&quot;);
 
 		handlers = ( jQuery.data(this, &quot;events&quot;) || {} )[event.type];
 
@@ -2067,61 +2684,44 @@ jQuery.event = {
 			var handler = handlers[j];
 
 			// Filter the functions by class
-			if ( all || handler.type == namespace ) {
+			if ( all || namespace.test(handler.type) ) {
 				// Pass in a reference to the handler function itself
 				// So that we can later remove it
 				event.handler = handler;
 				event.data = handler.data;
 
-				ret = handler.apply( this, arguments );
+				var ret = handler.apply(this, arguments);
 
-				if ( val !== false )
-					val = ret;
-
-				if ( ret === false ) {
-					event.preventDefault();
-					event.stopPropagation();
+				if( ret !== undefined ){
+					event.result = ret;
+					if ( ret === false ) {
+						event.preventDefault();
+						event.stopPropagation();
+					}
 				}
+
+				if( event.isImmediatePropagationStopped() )
+					break;
+
 			}
 		}
-
-		return val;
 	},
 
+	props: &quot;altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which&quot;.split(&quot; &quot;),
+
 	fix: function(event) {
-		if ( event[expando] == true )
+		if ( event[expando] )
 			return event;
 
 		// store a copy of the original event object
 		// and &quot;clone&quot; to set read-only properties
 		var originalEvent = event;
-		event = { originalEvent: originalEvent };
-		var props = &quot;altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target timeStamp toElement type view wheelDelta which&quot;.split(&quot; &quot;);
-		for ( var i=props.length; i; i-- )
-			event[ props[i] ] = originalEvent[ props[i] ];
-
-		// Mark it as fixed
-		event[expando] = true;
-
-		// add preventDefault and stopPropagation since
-		// they will not work on the clone
-		event.preventDefault = function() {
-			// if preventDefault exists run it on the original event
-			if (originalEvent.preventDefault)
-				originalEvent.preventDefault();
-			// otherwise set the returnValue property of the original event to false (IE)
-			originalEvent.returnValue = false;
-		};
-		event.stopPropagation = function() {
-			// if stopPropagation exists run it on the original event
-			if (originalEvent.stopPropagation)
-				originalEvent.stopPropagation();
-			// otherwise set the cancelBubble property of the original event to true (IE)
-			originalEvent.cancelBubble = true;
-		};
+		event = jQuery.Event( originalEvent );
 
-		// Fix timeStamp
-		event.timeStamp = event.timeStamp || now();
+		for ( var i = this.props.length, prop; i; ){
+			prop = this.props[ --i ];
+			event[ prop ] = originalEvent[ prop ];
+		}
 
 		// Fix target property, if necessary
 		if ( !event.target )
@@ -2159,6 +2759,7 @@ jQuery.event = {
 	},
 
 	proxy: function( fn, proxy ){
+		proxy = proxy || function(){ return fn.apply(this, arguments); };
 		// Set the guid of unique handler to the same of original handler, so it can be removed
 		proxy.guid = fn.guid = fn.guid || proxy.guid || this.guid++;
 		// So proxy can be declared as an argument
@@ -2167,60 +2768,128 @@ jQuery.event = {
 
 	special: {
 		ready: {
-			setup: function() {
-				// Make sure the ready event is setup
-				bindReady();
-				return;
-			},
-
-			teardown: function() { return; }
-		},
-
-		mouseenter: {
-			setup: function() {
-				if ( jQuery.browser.msie ) return false;
-				jQuery(this).bind(&quot;mouseover&quot;, jQuery.event.special.mouseenter.handler);
-				return true;
+			// Make sure the ready event is setup
+			setup: bindReady,
+			teardown: function() {}
+		}
+	},
+	
+	specialAll: {
+		live: {
+			setup: function( selector, namespaces ){
+				jQuery.event.add( this, namespaces[0], liveHandler );
 			},
+			teardown:  function( namespaces ){
+				if ( namespaces.length ) {
+					var remove = 0, name = RegExp(&quot;(^|\\.)&quot; + namespaces[0] + &quot;(\\.|$)&quot;);
+					
+					jQuery.each( (jQuery.data(this, &quot;events&quot;).live || {}), function(){
+						if ( name.test(this.type) )
+							remove++;
+					});
+					
+					if ( remove &lt; 1 )
+						jQuery.event.remove( this, namespaces[0], liveHandler );
+				}
+			}
+		}
+	}
+};
 
-			teardown: function() {
-				if ( jQuery.browser.msie ) return false;
-				jQuery(this).unbind(&quot;mouseover&quot;, jQuery.event.special.mouseenter.handler);
-				return true;
-			},
+jQuery.Event = function( src ){
+	// Allow instantiation without the 'new' keyword
+	if( !this.preventDefault )
+		return new jQuery.Event(src);
+	
+	// Event object
+	if( src &amp;&amp; src.type ){
+		this.originalEvent = src;
+		this.type = src.type;
+	// Event type
+	}else
+		this.type = src;
+
+	// timeStamp is buggy for some events on Firefox(#3843)
+	// So we won't rely on the native value
+	this.timeStamp = now();
+	
+	// Mark it as fixed
+	this[expando] = true;
+};
 
-			handler: function(event) {
-				// If we actually just moused on to a sub-element, ignore it
-				if ( withinElement(event, this) ) return true;
-				// Execute the right handlers by setting the event type to mouseenter
-				event.type = &quot;mouseenter&quot;;
-				return jQuery.event.handle.apply(this, arguments);
-			}
-		},
+function returnFalse(){
+	return false;
+}
+function returnTrue(){
+	return true;
+}
 
-		mouseleave: {
-			setup: function() {
-				if ( jQuery.browser.msie ) return false;
-				jQuery(this).bind(&quot;mouseout&quot;, jQuery.event.special.mouseleave.handler);
-				return true;
-			},
+// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding
+// http://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html
+jQuery.Event.prototype = {
+	preventDefault: function() {
+		this.isDefaultPrevented = returnTrue;
 
-			teardown: function() {
-				if ( jQuery.browser.msie ) return false;
-				jQuery(this).unbind(&quot;mouseout&quot;, jQuery.event.special.mouseleave.handler);
-				return true;
-			},
+		var e = this.originalEvent;
+		if( !e )
+			return;
+		// if preventDefault exists run it on the original event
+		if (e.preventDefault)
+			e.preventDefault();
+		// otherwise set the returnValue property of the original event to false (IE)
+		e.returnValue = false;
+	},
+	stopPropagation: function() {
+		this.isPropagationStopped = returnTrue;
 
-			handler: function(event) {
-				// If we actually just moused on to a sub-element, ignore it
-				if ( withinElement(event, this) ) return true;
-				// Execute the right handlers by setting the event type to mouseleave
-				event.type = &quot;mouseleave&quot;;
-				return jQuery.event.handle.apply(this, arguments);
-			}
-		}
+		var e = this.originalEvent;
+		if( !e )
+			return;
+		// if stopPropagation exists run it on the original event
+		if (e.stopPropagation)
+			e.stopPropagation();
+		// otherwise set the cancelBubble property of the original event to true (IE)
+		e.cancelBubble = true;
+	},
+	stopImmediatePropagation:function(){
+		this.isImmediatePropagationStopped = returnTrue;
+		this.stopPropagation();
+	},
+	isDefaultPrevented: returnFalse,
+	isPropagationStopped: returnFalse,
+	isImmediatePropagationStopped: returnFalse
+};
+// Checks if an event happened on an element within another element
+// Used in jQuery.event.special.mouseenter and mouseleave handlers
+var withinElement = function(event) {
+	// Check if mouse(over|out) are still within the same parent element
+	var parent = event.relatedTarget;
+	// Traverse up the tree
+	while ( parent &amp;&amp; parent != this )
+		try { parent = parent.parentNode; }
+		catch(e) { parent = this; }
+	
+	if( parent != this ){
+		// set the correct event type
+		event.type = event.data;
+		// handle event if we actually just moused on to a non sub-element
+		jQuery.event.handle.apply( this, arguments );
 	}
 };
+	
+jQuery.each({ 
+	mouseover: 'mouseenter', 
+	mouseout: 'mouseleave'
+}, function( orig, fix ){
+	jQuery.event.special[ fix ] = {
+		setup: function(){
+			jQuery.event.add( this, orig, withinElement, fix );
+		},
+		teardown: function(){
+			jQuery.event.remove( this, orig, withinElement );
+		}
+	};			   
+});
 
 jQuery.fn.extend({
 	bind: function( type, data, fn ) {
@@ -2245,14 +2914,20 @@ jQuery.fn.extend({
 		});
 	},
 
-	trigger: function( type, data, fn ) {
+	trigger: function( type, data ) {
 		return this.each(function(){
-			jQuery.event.trigger( type, data, this, true, fn );
+			jQuery.event.trigger( type, data, this );
 		});
 	},
 
-	triggerHandler: function( type, data, fn ) {
-		return this[0] &amp;&amp; jQuery.event.trigger( type, data, this[0], false, fn );
+	triggerHandler: function( type, data ) {
+		if( this[0] ){
+			var event = jQuery.Event(type);
+			event.preventDefault();
+			event.stopPropagation();
+			jQuery.event.trigger( event, data, this[0] );
+			return event.result;
+		}		
 	},
 
 	toggle: function( fn ) {
@@ -2276,7 +2951,7 @@ jQuery.fn.extend({
 	},
 
 	hover: function(fnOver, fnOut) {
-		return this.bind('mouseenter', fnOver).bind('mouseleave', fnOut);
+		return this.mouseenter(fnOver).mouseleave(fnOut);
 	},
 
 	ready: function(fn) {
@@ -2291,12 +2966,55 @@ jQuery.fn.extend({
 		// Otherwise, remember the function for later
 		else
 			// Add the function to the wait list
-			jQuery.readyList.push( function() { return fn.call(this, jQuery); } );
+			jQuery.readyList.push( fn );
 
 		return this;
+	},
+	
+	live: function( type, fn ){
+		var proxy = jQuery.event.proxy( fn );
+		proxy.guid += this.selector + type;
+
+		jQuery(document).bind( liveConvert(type, this.selector), this.selector, proxy );
+
+		return this;
+	},
+	
+	die: function( type, fn ){
+		jQuery(document).unbind( liveConvert(type, this.selector), fn ? { guid: fn.guid + this.selector + type } : null );
+		return this;
 	}
 });
 
+function liveHandler( event ){
+	var check = RegExp(&quot;(^|\\.)&quot; + event.type + &quot;(\\.|$)&quot;),
+		stop = true,
+		elems = [];
+
+	jQuery.each(jQuery.data(this, &quot;events&quot;).live || [], function(i, fn){
+		if ( check.test(fn.type) ) {
+			var elem = jQuery(event.target).closest(fn.data)[0];
+			if ( elem )
+				elems.push({ elem: elem, fn: fn });
+		}
+	});
+
+	elems.sort(function(a,b) {
+		return jQuery.data(a.elem, &quot;closest&quot;) - jQuery.data(b.elem, &quot;closest&quot;);
+	});
+	
+	jQuery.each(elems, function(){
+		if ( this.fn.call(this.elem, event, this.fn.data) === false )
+			return (stop = false);
+	});
+
+	return stop;
+}
+
+function liveConvert(type, selector){
+	return [&quot;live&quot;, type, selector.replace(/\./g, &quot;`&quot;).replace(/ /g, &quot;|&quot;)].join(&quot;.&quot;);
+}
+
 jQuery.extend({
 	isReady: false,
 	readyList: [],
@@ -2311,7 +3029,7 @@ jQuery.extend({
 			if ( jQuery.readyList ) {
 				// Execute all of them
 				jQuery.each( jQuery.readyList, function(){
-					this.call( document );
+					this.call( document, jQuery );
 				});
 
 				// Reset the list of functions
@@ -2330,53 +3048,39 @@ function bindReady(){
 	if ( readyBound ) return;
 	readyBound = true;
 
-	// Mozilla, Opera (see further below for it) and webkit nightlies currently support this event
-	if ( document.addEventListener &amp;&amp; !jQuery.browser.opera)
+	// Mozilla, Opera and webkit nightlies currently support this event
+	if ( document.addEventListener ) {
 		// Use the handy event callback
-		document.addEventListener( &quot;DOMContentLoaded&quot;, jQuery.ready, false );
-
-	// If IE is used and is not in a frame
-	// Continually check to see if the document is ready
-	if ( jQuery.browser.msie &amp;&amp; window == top ) (function(){
-		if (jQuery.isReady) return;
-		try {
-			// If IE is used, use the trick by Diego Perini
-			// http://javascript.nwbox.com/IEContentLoaded/
-			document.documentElement.doScroll(&quot;left&quot;);
-		} catch( error ) {
-			setTimeout( arguments.callee, 0 );
-			return;
-		}
-		// and execute any waiting functions
-		jQuery.ready();
-	})();
-
-	if ( jQuery.browser.opera )
-		document.addEventListener( &quot;DOMContentLoaded&quot;, function () {
-			if (jQuery.isReady) return;
-			for (var i = 0; i &lt; document.styleSheets.length; i++)
-				if (document.styleSheets[i].disabled) {
-					setTimeout( arguments.callee, 0 );
-					return;
-				}
-			// and execute any waiting functions
+		document.addEventListener( &quot;DOMContentLoaded&quot;, function(){
+			document.removeEventListener( &quot;DOMContentLoaded&quot;, arguments.callee, false );
 			jQuery.ready();
-		}, false);
-
-	if ( jQuery.browser.safari ) {
-		var numStyles;
-		(function(){
-			if (jQuery.isReady) return;
-			if ( document.readyState != &quot;loaded&quot; &amp;&amp; document.readyState != &quot;complete&quot; ) {
-				setTimeout( arguments.callee, 0 );
-				return;
+		}, false );
+
+	// If IE event model is used
+	} else if ( document.attachEvent ) {
+		// ensure firing before onload,
+		// maybe late but safe also for iframes
+		document.attachEvent(&quot;onreadystatechange&quot;, function(){
+			if ( document.readyState === &quot;complete&quot; ) {
+				document.detachEvent( &quot;onreadystatechange&quot;, arguments.callee );
+				jQuery.ready();
 			}
-			if ( numStyles === undefined )
-				numStyles = jQuery(&quot;style, link[rel=stylesheet]&quot;).length;
-			if ( document.styleSheets.length != numStyles ) {
+		});
+
+		// If IE and not an iframe
+		// continually check to see if the document is ready
+		if ( document.documentElement.doScroll &amp;&amp; window == window.top ) (function(){
+			if ( jQuery.isReady ) return;
+
+			try {
+				// If IE is used, use the trick by Diego Perini
+				// http://javascript.nwbox.com/IEContentLoaded/
+				document.documentElement.doScroll(&quot;left&quot;);
+			} catch( error ) {
 				setTimeout( arguments.callee, 0 );
 				return;
 			}
+
 			// and execute any waiting functions
 			jQuery.ready();
 		})();
@@ -2387,8 +3091,8 @@ function bindReady(){
 }
 
 jQuery.each( (&quot;blur,focus,load,resize,scroll,unload,click,dblclick,&quot; +
-	&quot;mousedown,mouseup,mousemove,mouseover,mouseout,change,select,&quot; +
-	&quot;submit,keydown,keypress,keyup,error&quot;).split(&quot;,&quot;), function(i, name){
+	&quot;mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,&quot; +
+	&quot;change,select,submit,keydown,keypress,keyup,error&quot;).split(&quot;,&quot;), function(i, name){
 
 	// Handle event binding
 	jQuery.fn[name] = function(fn){
@@ -2396,29 +3100,133 @@ jQuery.each( (&quot;blur,focus,load,resize,scroll,unload,click,dblclick,&quot; +
 	};
 });
 
-// Checks if an event happened on an element within another element
-// Used in jQuery.event.special.mouseenter and mouseleave handlers
-var withinElement = function(event, elem) {
-	// Check if mouse(over|out) are still within the same parent element
-	var parent = event.relatedTarget;
-	// Traverse up the tree
-	while ( parent &amp;&amp; parent != elem ) try { parent = parent.parentNode; } catch(error) { parent = elem; }
-	// Return true if we actually just moused on to a sub-element
-	return parent == elem;
-};
-
 // Prevent memory leaks in IE
 // And prevent errors on refresh with events like mouseover in other browsers
 // Window isn't included so as not to unbind existing unload events
-jQuery(window).bind(&quot;unload&quot;, function() {
-	jQuery(&quot;*&quot;).add(document).unbind();
-});
+jQuery( window ).bind( 'unload', function(){ 
+	for ( var id in jQuery.cache )
+		// Skip the window
+		if ( id != 1 &amp;&amp; jQuery.cache[ id ].handle )
+			jQuery.event.remove( jQuery.cache[ id ].handle.elem );
+}); 
+(function(){
+
+	jQuery.support = {};
+
+	var root = document.documentElement,
+		script = document.createElement(&quot;script&quot;),
+		div = document.createElement(&quot;div&quot;),
+		id = &quot;script&quot; + (new Date).getTime();
+
+	div.style.display = &quot;none&quot;;
+	div.innerHTML = '   &lt;link/&gt;&lt;table&gt;&lt;/table&gt;&lt;a href=&quot;/a&quot; style=&quot;color:red;float:left;opacity:.5;&quot;&gt;a&lt;/a&gt;&lt;select&gt;&lt;option&gt;text&lt;/option&gt;&lt;/select&gt;&lt;object&gt;&lt;param/&gt;&lt;/object&gt;';
+
+	var all = div.getElementsByTagName(&quot;*&quot;),
+		a = div.getElementsByTagName(&quot;a&quot;)[0];
+
+	// Can't get basic test support
+	if ( !all || !all.length || !a ) {
+		return;
+	}
+
+	jQuery.support = {
+		// IE strips leading whitespace when .innerHTML is used
+		leadingWhitespace: div.firstChild.nodeType == 3,
+		
+		// Make sure that tbody elements aren't automatically inserted
+		// IE will insert them into empty tables
+		tbody: !div.getElementsByTagName(&quot;tbody&quot;).length,
+		
+		// Make sure that you can get all elements in an &lt;object&gt; element
+		// IE 7 always returns no results
+		objectAll: !!div.getElementsByTagName(&quot;object&quot;)[0]
+			.getElementsByTagName(&quot;*&quot;).length,
+		
+		// Make sure that link elements get serialized correctly by innerHTML
+		// This requires a wrapper element in IE
+		htmlSerialize: !!div.getElementsByTagName(&quot;link&quot;).length,
+		
+		// Get the style information from getAttribute
+		// (IE uses .cssText insted)
+		style: /red/.test( a.getAttribute(&quot;style&quot;) ),
+		
+		// Make sure that URLs aren't manipulated
+		// (IE normalizes it by default)
+		hrefNormalized: a.getAttribute(&quot;href&quot;) === &quot;/a&quot;,
+		
+		// Make sure that element opacity exists
+		// (IE uses filter instead)
+		opacity: a.style.opacity === &quot;0.5&quot;,
+		
+		// Verify style float existence
+		// (IE uses styleFloat instead of cssFloat)
+		cssFloat: !!a.style.cssFloat,
+
+		// Will be defined later
+		scriptEval: false,
+		noCloneEvent: true,
+		boxModel: null
+	};
+	
+	script.type = &quot;text/javascript&quot;;
+	try {
+		script.appendChild( document.createTextNode( &quot;window.&quot; + id + &quot;=1;&quot; ) );
+	} catch(e){}
+
+	root.insertBefore( script, root.firstChild );
+	
+	// Make sure that the execution of code works by injecting a script
+	// tag with appendChild/createTextNode
+	// (IE doesn't support this, fails, and uses .text instead)
+	if ( window[ id ] ) {
+		jQuery.support.scriptEval = true;
+		delete window[ id ];
+	}
+
+	root.removeChild( script );
+
+	if ( div.attachEvent &amp;&amp; div.fireEvent ) {
+		div.attachEvent(&quot;onclick&quot;, function(){
+			// Cloning a node shouldn't copy over any
+			// bound event handlers (IE does this)
+			jQuery.support.noCloneEvent = false;
+			div.detachEvent(&quot;onclick&quot;, arguments.callee);
+		});
+		div.cloneNode(true).fireEvent(&quot;onclick&quot;);
+	}
+
+	// Figure out if the W3C box model works as expected
+	// document.body must exist before we can do this
+	jQuery(function(){
+		var div = document.createElement(&quot;div&quot;);
+		div.style.width = div.style.paddingLeft = &quot;1px&quot;;
+
+		document.body.appendChild( div );
+		jQuery.boxModel = jQuery.support.boxModel = div.offsetWidth === 2;
+		document.body.removeChild( div ).style.display = 'none';
+	});
+})();
+
+var styleFloat = jQuery.support.cssFloat ? &quot;cssFloat&quot; : &quot;styleFloat&quot;;
+
+jQuery.props = {
+	&quot;for&quot;: &quot;htmlFor&quot;,
+	&quot;class&quot;: &quot;className&quot;,
+	&quot;float&quot;: styleFloat,
+	cssFloat: styleFloat,
+	styleFloat: styleFloat,
+	readonly: &quot;readOnly&quot;,
+	maxlength: &quot;maxLength&quot;,
+	cellspacing: &quot;cellSpacing&quot;,
+	rowspan: &quot;rowSpan&quot;,
+	tabindex: &quot;tabIndex&quot;
+};
 jQuery.fn.extend({
 	// Keep a copy of the old load
 	_load: jQuery.fn.load,
 
 	load: function( url, params, callback ) {
-		if ( typeof url != 'string' )
+		if ( typeof url !== &quot;string&quot; )
 			return this._load( url );
 
 		var off = url.indexOf(&quot; &quot;);
@@ -2427,8 +3235,6 @@ jQuery.fn.extend({
 			url = url.slice(0, off);
 		}
 
-		callback = callback || function(){};
-
 		// Default to a GET request
 		var type = &quot;GET&quot;;
 
@@ -2441,7 +3247,7 @@ jQuery.fn.extend({
 				params = null;
 
 			// Otherwise, build a param string
-			} else {
+			} else if( typeof params === &quot;object&quot; ) {
 				params = jQuery.param( params );
 				type = &quot;POST&quot;;
 			}
@@ -2471,7 +3277,8 @@ jQuery.fn.extend({
 						// If not, just inject the full result
 						res.responseText );
 
-				self.each( callback, [res.responseText, status, res] );
+				if( callback )
+					self.each( callback, [res.responseText, status, res] );
 			}
 		});
 		return this;
@@ -2482,18 +3289,17 @@ jQuery.fn.extend({
 	},
 	serializeArray: function() {
 		return this.map(function(){
-			return jQuery.nodeName(this, &quot;form&quot;) ?
-				jQuery.makeArray(this.elements) : this;
+			return this.elements ? jQuery.makeArray(this.elements) : this;
 		})
 		.filter(function(){
 			return this.name &amp;&amp; !this.disabled &amp;&amp;
 				(this.checked || /select|textarea/i.test(this.nodeName) ||
-					/text|hidden|password/i.test(this.type));
+					/text|hidden|password|search/i.test(this.type));
 		})
 		.map(function(i, elem){
 			var val = jQuery(this).val();
 			return val == null ? null :
-				val.constructor == Array ?
+				jQuery.isArray(val) ?
 					jQuery.map( val, function(val, i){
 						return {name: elem.name, value: val};
 					}) :
@@ -2512,6 +3318,7 @@ jQuery.each( &quot;ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend&quot;.sp
 var jsc = now();
 
 jQuery.extend({
+  
 	get: function( url, data, callback, type ) {
 		// shift arguments if data argument was ommited
 		if ( jQuery.isFunction( data ) ) {
@@ -2559,13 +3366,21 @@ jQuery.extend({
 		url: location.href,
 		global: true,
 		type: &quot;GET&quot;,
-		timeout: 0,
 		contentType: &quot;application/x-www-form-urlencoded&quot;,
 		processData: true,
 		async: true,
+		/*
+		timeout: 0,
 		data: null,
 		username: null,
 		password: null,
+		*/
+		// Create the request object; Microsoft failed to properly
+		// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
+		// This function can be overriden by calling jQuery.ajaxSetup
+		xhr:function(){
+			return window.ActiveXObject ? new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;) : new XMLHttpRequest();
+		},
 		accepts: {
 			xml: &quot;application/xml, text/xml&quot;,
 			html: &quot;text/html&quot;,
@@ -2588,7 +3403,7 @@ jQuery.extend({
 			type = s.type.toUpperCase();
 
 		// convert data if not already a string
-		if ( s.data &amp;&amp; s.processData &amp;&amp; typeof s.data != &quot;string&quot; )
+		if ( s.data &amp;&amp; s.processData &amp;&amp; typeof s.data !== &quot;string&quot; )
 			s.data = jQuery.param(s.data);
 
 		// Handle JSONP Parameter Callbacks
@@ -2651,12 +3466,13 @@ jQuery.extend({
 			jQuery.event.trigger( &quot;ajaxStart&quot; );
 
 		// Matches an absolute URL, and saves the domain
-		var remote = /^(?:\w+:)?\/\/([^\/?#]+)/;
+		var parts = /^(\w+:)?\/\/([^\/?#]+)/.exec( s.url );
 
 		// If we're requesting a remote document
 		// and trying to load JSON or Script with a GET
-		if ( s.dataType == &quot;script&quot; &amp;&amp; type == &quot;GET&quot;
-				&amp;&amp; remote.test(s.url) &amp;&amp; remote.exec(s.url)[1] != location.host ){
+		if ( s.dataType == &quot;script&quot; &amp;&amp; type == &quot;GET&quot; &amp;&amp; parts
+			&amp;&amp; ( parts[1] &amp;&amp; parts[1] != location.protocol || parts[2] != location.host )){
+
 			var head = document.getElementsByTagName(&quot;head&quot;)[0];
 			var script = document.createElement(&quot;script&quot;);
 			script.src = s.url;
@@ -2674,6 +3490,9 @@ jQuery.extend({
 						done = true;
 						success();
 						complete();
+
+						// Handle memory leak in IE
+						script.onload = script.onreadystatechange = null;
 						head.removeChild( script );
 					}
 				};
@@ -2687,9 +3506,8 @@ jQuery.extend({
 
 		var requestDone = false;
 
-		// Create the request object; Microsoft failed to properly
-		// implement the XMLHttpRequest in IE7, so we use the ActiveXObject when it is available
-		var xhr = window.ActiveXObject ? new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;) : new XMLHttpRequest();
+		// Create the request object
+		var xhr = s.xhr();
 
 		// Open the socket
 		// Passing null username, generates a login popup on Opera (#2865)
@@ -2718,10 +3536,11 @@ jQuery.extend({
 				s.accepts._default );
 		} catch(e){}
 
-		// Allow custom headers/mimetypes
+		// Allow custom headers/mimetypes and early abort
 		if ( s.beforeSend &amp;&amp; s.beforeSend(xhr, s) === false ) {
-			// cleanup active request counter
-			s.global &amp;&amp; jQuery.active--;
+			// Handle the global AJAX counter
+			if ( s.global &amp;&amp; ! --jQuery.active )
+				jQuery.event.trigger( &quot;ajaxStop&quot; );
 			// close opended socket
 			xhr.abort();
 			return false;
@@ -2732,8 +3551,18 @@ jQuery.extend({
 
 		// Wait for a response to come back
 		var onreadystatechange = function(isTimeout){
+			// The request was aborted, clear the interval and decrement jQuery.active
+			if (xhr.readyState == 0) {
+				if (ival) {
+					// clear poll interval
+					clearInterval(ival);
+					ival = null;
+					// Handle the global AJAX counter
+					if ( s.global &amp;&amp; ! --jQuery.active )
+						jQuery.event.trigger( &quot;ajaxStop&quot; );
+				}
 			// The transfer is complete and the data is available, or the request timed out
-			if ( !requestDone &amp;&amp; xhr &amp;&amp; (xhr.readyState == 4 || isTimeout == &quot;timeout&quot;) ) {
+			} else if ( !requestDone &amp;&amp; xhr &amp;&amp; (xhr.readyState == 4 || isTimeout == &quot;timeout&quot;) ) {
 				requestDone = true;
 
 				// clear poll interval
@@ -2742,16 +3571,16 @@ jQuery.extend({
 					ival = null;
 				}
 
-				status = isTimeout == &quot;timeout&quot; &amp;&amp; &quot;timeout&quot; ||
-					!jQuery.httpSuccess( xhr ) &amp;&amp; &quot;error&quot; ||
-					s.ifModified &amp;&amp; jQuery.httpNotModified( xhr, s.url ) &amp;&amp; &quot;notmodified&quot; ||
+				status = isTimeout == &quot;timeout&quot; ? &quot;timeout&quot; :
+					!jQuery.httpSuccess( xhr ) ? &quot;error&quot; :
+					s.ifModified &amp;&amp; jQuery.httpNotModified( xhr, s.url ) ? &quot;notmodified&quot; :
 					&quot;success&quot;;
 
 				if ( status == &quot;success&quot; ) {
 					// Watch for, and catch, XML document parse errors
 					try {
 						// process the data (runs the xml through httpData regardless of callback)
-						data = jQuery.httpData( xhr, s.dataType, s.dataFilter );
+						data = jQuery.httpData( xhr, s.dataType, s );
 					} catch(e) {
 						status = &quot;parsererror&quot;;
 					}
@@ -2777,6 +3606,9 @@ jQuery.extend({
 				// Fire the complete handlers
 				complete();
 
+				if ( isTimeout )
+					xhr.abort();
+
 				// Stop memory leaks
 				if ( s.async )
 					xhr = null;
@@ -2791,13 +3623,8 @@ jQuery.extend({
 			if ( s.timeout &gt; 0 )
 				setTimeout(function(){
 					// Check to see if the request is still happening
-					if ( xhr ) {
-						// Cancel the request
-						xhr.abort();
-
-						if( !requestDone )
-							onreadystatechange( &quot;timeout&quot; );
-					}
+					if ( xhr &amp;&amp; !requestDone )
+						onreadystatechange( &quot;timeout&quot; );
 				}, s.timeout);
 		}
 
@@ -2857,8 +3684,7 @@ jQuery.extend({
 		try {
 			// IE error sometimes returns 1223 when it should be 204 so treat it as success, see #1450
 			return !xhr.status &amp;&amp; location.protocol == &quot;file:&quot; ||
-				( xhr.status &gt;= 200 &amp;&amp; xhr.status &lt; 300 ) || xhr.status == 304 || xhr.status == 1223 ||
-				jQuery.browser.safari &amp;&amp; xhr.status == undefined;
+				( xhr.status &gt;= 200 &amp;&amp; xhr.status &lt; 300 ) || xhr.status == 304 || xhr.status == 1223;
 		} catch(e){}
 		return false;
 	},
@@ -2869,13 +3695,12 @@ jQuery.extend({
 			var xhrRes = xhr.getResponseHeader(&quot;Last-Modified&quot;);
 
 			// Firefox always returns 200. check Last-Modified date
-			return xhr.status == 304 || xhrRes == jQuery.lastModified[url] ||
-				jQuery.browser.safari &amp;&amp; xhr.status == undefined;
+			return xhr.status == 304 || xhrRes == jQuery.lastModified[url];
 		} catch(e){}
 		return false;
 	},
 
-	httpData: function( xhr, type, filter ) {
+	httpData: function( xhr, type, s ) {
 		var ct = xhr.getResponseHeader(&quot;content-type&quot;),
 			xml = type == &quot;xml&quot; || !type &amp;&amp; ct &amp;&amp; ct.indexOf(&quot;xml&quot;) &gt;= 0,
 			data = xml ? xhr.responseXML : xhr.responseText;
@@ -2884,31 +3709,40 @@ jQuery.extend({
 			throw &quot;parsererror&quot;;
 			
 		// Allow a pre-filtering function to sanitize the response
-		if( filter )
-			data = filter( data, type );
+		// s != null is checked to keep backwards compatibility
+		if( s &amp;&amp; s.dataFilter )
+			data = s.dataFilter( data, type );
 
-		// If the type is &quot;script&quot;, eval it in global context
-		if ( type == &quot;script&quot; )
-			jQuery.globalEval( data );
+		// The filter can actually parse the response
+		if( typeof data === &quot;string&quot; ){
 
-		// Get the JavaScript object, if JSON is used.
-		if ( type == &quot;json&quot; )
-			data = eval(&quot;(&quot; + data + &quot;)&quot;);
+			// If the type is &quot;script&quot;, eval it in global context
+			if ( type == &quot;script&quot; )
+				jQuery.globalEval( data );
 
+			// Get the JavaScript object, if JSON is used.
+			if ( type == &quot;json&quot; )
+				data = window[&quot;eval&quot;](&quot;(&quot; + data + &quot;)&quot;);
+		}
+		
 		return data;
 	},
 
 	// Serialize an array of form elements or a set of
 	// key/values into a query string
 	param: function( a ) {
-		var s = [];
+		var s = [ ];
+
+		function add( key, value ){
+			s[ s.length ] = encodeURIComponent(key) + '=' + encodeURIComponent(value);
+		};
 
 		// If an array was passed in, assume that it is an array
 		// of form elements
-		if ( a.constructor == Array || a.jquery )
+		if ( jQuery.isArray(a) || a.jquery )
 			// Serialize the form elements
 			jQuery.each( a, function(){
-				s.push( encodeURIComponent(this.name) + &quot;=&quot; + encodeURIComponent( this.value ) );
+				add( this.name, this.value );
 			});
 
 		// Otherwise, assume that it's an object of key/value pairs
@@ -2916,83 +3750,112 @@ jQuery.extend({
 			// Serialize the key/values
 			for ( var j in a )
 				// If the value is an array then the key names need to be repeated
-				if ( a[j] &amp;&amp; a[j].constructor == Array )
+				if ( jQuery.isArray(a[j]) )
 					jQuery.each( a[j], function(){
-						s.push( encodeURIComponent(j) + &quot;=&quot; + encodeURIComponent( this ) );
+						add( j, this );
 					});
 				else
-					s.push( encodeURIComponent(j) + &quot;=&quot; + encodeURIComponent( jQuery.isFunction(a[j]) ? a[j]() : a[j] ) );
+					add( j, jQuery.isFunction(a[j]) ? a[j]() : a[j] );
 
 		// Return the resulting serialization
 		return s.join(&quot;&amp;&quot;).replace(/%20/g, &quot;+&quot;);
 	}
 
 });
+var elemdisplay = {},
+	timerId,
+	fxAttrs = [
+		// height animations
+		[ &quot;height&quot;, &quot;marginTop&quot;, &quot;marginBottom&quot;, &quot;paddingTop&quot;, &quot;paddingBottom&quot; ],
+		// width animations
+		[ &quot;width&quot;, &quot;marginLeft&quot;, &quot;marginRight&quot;, &quot;paddingLeft&quot;, &quot;paddingRight&quot; ],
+		// opacity animations
+		[ &quot;opacity&quot; ]
+	];
+
+function genFx( type, num ){
+	var obj = {};
+	jQuery.each( fxAttrs.concat.apply([], fxAttrs.slice(0,num)), function(){
+		obj[ this ] = type;
+	});
+	return obj;
+}
+
 jQuery.fn.extend({
 	show: function(speed,callback){
-		return speed ?
-			this.animate({
-				height: &quot;show&quot;, width: &quot;show&quot;, opacity: &quot;show&quot;
-			}, speed, callback) :
-
-			this.filter(&quot;:hidden&quot;).each(function(){
-				this.style.display = this.oldblock || &quot;&quot;;
-				if ( jQuery.css(this,&quot;display&quot;) == &quot;none&quot; ) {
-					var elem = jQuery(&quot;&lt;&quot; + this.tagName + &quot; /&gt;&quot;).appendTo(&quot;body&quot;);
-					this.style.display = elem.css(&quot;display&quot;);
-					// handle an edge condition where css is - div { display:none; } or similar
-					if (this.style.display == &quot;none&quot;)
-						this.style.display = &quot;block&quot;;
-					elem.remove();
+		if ( speed ) {
+			return this.animate( genFx(&quot;show&quot;, 3), speed, callback);
+		} else {
+			for ( var i = 0, l = this.length; i &lt; l; i++ ){
+				var old = jQuery.data(this[i], &quot;olddisplay&quot;);
+				
+				this[i].style.display = old || &quot;&quot;;
+				
+				if ( jQuery.css(this[i], &quot;display&quot;) === &quot;none&quot; ) {
+					var tagName = this[i].tagName, display;
+					
+					if ( elemdisplay[ tagName ] ) {
+						display = elemdisplay[ tagName ];
+					} else {
+						var elem = jQuery(&quot;&lt;&quot; + tagName + &quot; /&gt;&quot;).appendTo(&quot;body&quot;);
+						
+						display = elem.css(&quot;display&quot;);
+						if ( display === &quot;none&quot; )
+							display = &quot;block&quot;;
+						
+						elem.remove();
+						
+						elemdisplay[ tagName ] = display;
+					}
+					
+					jQuery.data(this[i], &quot;olddisplay&quot;, display);
 				}
-			}).end();
+			}
+
+			// Set the display of the elements in a second loop
+			// to avoid the constant reflow
+			for ( var i = 0, l = this.length; i &lt; l; i++ ){
+				this[i].style.display = jQuery.data(this[i], &quot;olddisplay&quot;) || &quot;&quot;;
+			}
+			
+			return this;
+		}
 	},
 
 	hide: function(speed,callback){
-		return speed ?
-			this.animate({
-				height: &quot;hide&quot;, width: &quot;hide&quot;, opacity: &quot;hide&quot;
-			}, speed, callback) :
+		if ( speed ) {
+			return this.animate( genFx(&quot;hide&quot;, 3), speed, callback);
+		} else {
+			for ( var i = 0, l = this.length; i &lt; l; i++ ){
+				var old = jQuery.data(this[i], &quot;olddisplay&quot;);
+				if ( !old &amp;&amp; old !== &quot;none&quot; )
+					jQuery.data(this[i], &quot;olddisplay&quot;, jQuery.css(this[i], &quot;display&quot;));
+			}
+
+			// Set the display of the elements in a second loop
+			// to avoid the constant reflow
+			for ( var i = 0, l = this.length; i &lt; l; i++ ){
+				this[i].style.display = &quot;none&quot;;
+			}
 
-			this.filter(&quot;:visible&quot;).each(function(){
-				this.oldblock = this.oldblock || jQuery.css(this,&quot;display&quot;);
-				this.style.display = &quot;none&quot;;
-			}).end();
+			return this;
+		}
 	},
 
 	// Save the old toggle function
 	_toggle: jQuery.fn.toggle,
 
 	toggle: function( fn, fn2 ){
+		var bool = typeof fn === &quot;boolean&quot;;
+
 		return jQuery.isFunction(fn) &amp;&amp; jQuery.isFunction(fn2) ?
 			this._toggle.apply( this, arguments ) :
-			fn ?
-				this.animate({
-					height: &quot;toggle&quot;, width: &quot;toggle&quot;, opacity: &quot;toggle&quot;
-				}, fn, fn2) :
+			fn == null || bool ?
 				this.each(function(){
-					jQuery(this)[ jQuery(this).is(&quot;:hidden&quot;) ? &quot;show&quot; : &quot;hide&quot; ]();
-				});
-	},
-
-	slideDown: function(speed,callback){
-		return this.animate({height: &quot;show&quot;}, speed, callback);
-	},
-
-	slideUp: function(speed,callback){
-		return this.animate({height: &quot;hide&quot;}, speed, callback);
-	},
-
-	slideToggle: function(speed, callback){
-		return this.animate({height: &quot;toggle&quot;}, speed, callback);
-	},
-
-	fadeIn: function(speed, callback){
-		return this.animate({opacity: &quot;show&quot;}, speed, callback);
-	},
-
-	fadeOut: function(speed, callback){
-		return this.animate({opacity: &quot;hide&quot;}, speed, callback);
+					var state = bool ? fn : jQuery(this).is(&quot;:hidden&quot;);
+					jQuery(this)[ state ? &quot;show&quot; : &quot;hide&quot; ]();
+				}) :
+				this.animate(genFx(&quot;toggle&quot;, 3), fn, fn2);
 	},
 
 	fadeTo: function(speed,to,callback){
@@ -3003,17 +3866,16 @@ jQuery.fn.extend({
 		var optall = jQuery.speed(speed, easing, callback);
 
 		return this[ optall.queue === false ? &quot;each&quot; : &quot;queue&quot; ](function(){
-			if ( this.nodeType != 1)
-				return false;
-
+		
 			var opt = jQuery.extend({}, optall), p,
-				hidden = jQuery(this).is(&quot;:hidden&quot;), self = this;
-
+				hidden = this.nodeType == 1 &amp;&amp; jQuery(this).is(&quot;:hidden&quot;),
+				self = this;
+	
 			for ( p in prop ) {
 				if ( prop[p] == &quot;hide&quot; &amp;&amp; hidden || prop[p] == &quot;show&quot; &amp;&amp; !hidden )
 					return opt.complete.call(this);
 
-				if ( p == &quot;height&quot; || p == &quot;width&quot; ) {
+				if ( ( p == &quot;height&quot; || p == &quot;width&quot; ) &amp;&amp; this.style ) {
 					// Store display property
 					opt.display = jQuery.css(this, &quot;display&quot;);
 
@@ -3062,27 +3924,6 @@ jQuery.fn.extend({
 		});
 	},
 
-	queue: function(type, fn){
-		if ( jQuery.isFunction(type) || ( type &amp;&amp; type.constructor == Array )) {
-			fn = type;
-			type = &quot;fx&quot;;
-		}
-
-		if ( !type || (typeof type == &quot;string&quot; &amp;&amp; !fn) )
-			return queue( this[0], type );
-
-		return this.each(function(){
-			if ( fn.constructor == Array )
-				queue(this, type, fn);
-			else {
-				queue(this, type).push( fn );
-
-				if ( queue(this, type).length == 1 )
-					fn.call(this);
-			}
-		});
-	},
-
 	stop: function(clearQueue, gotoEnd){
 		var timers = jQuery.timers;
 
@@ -3109,46 +3950,31 @@ jQuery.fn.extend({
 
 });
 
-var queue = function( elem, type, array ) {
-	if ( elem ){
-
-		type = type || &quot;fx&quot;;
-
-		var q = jQuery.data( elem, type + &quot;queue&quot; );
-
-		if ( !q || array )
-			q = jQuery.data( elem, type + &quot;queue&quot;, jQuery.makeArray(array) );
-
-	}
-	return q;
-};
-
-jQuery.fn.dequeue = function(type){
-	type = type || &quot;fx&quot;;
-
-	return this.each(function(){
-		var q = queue(this, type);
-
-		q.shift();
-
-		if ( q.length )
-			q[0].call( this );
-	});
-};
+// Generate shortcuts for custom animations
+jQuery.each({
+	slideDown: genFx(&quot;show&quot;, 1),
+	slideUp: genFx(&quot;hide&quot;, 1),
+	slideToggle: genFx(&quot;toggle&quot;, 1),
+	fadeIn: { opacity: &quot;show&quot; },
+	fadeOut: { opacity: &quot;hide&quot; }
+}, function( name, props ){
+	jQuery.fn[ name ] = function( speed, callback ){
+		return this.animate( props, speed, callback );
+	};
+});
 
 jQuery.extend({
 
 	speed: function(speed, easing, fn) {
-		var opt = speed &amp;&amp; speed.constructor == Object ? speed : {
+		var opt = typeof speed === &quot;object&quot; ? speed : {
 			complete: fn || !fn &amp;&amp; easing ||
 				jQuery.isFunction( speed ) &amp;&amp; speed,
 			duration: speed,
-			easing: fn &amp;&amp; easing || easing &amp;&amp; easing.constructor != Function &amp;&amp; easing
+			easing: fn &amp;&amp; easing || easing &amp;&amp; !jQuery.isFunction(easing) &amp;&amp; easing
 		};
 
-		opt.duration = (opt.duration &amp;&amp; opt.duration.constructor == Number ?
-			opt.duration :
-			jQuery.fx.speeds[opt.duration]) || jQuery.fx.speeds.def;
+		opt.duration = jQuery.fx.off ? 0 : typeof opt.duration === &quot;number&quot; ? opt.duration :
+			jQuery.fx.speeds[opt.duration] || jQuery.fx.speeds._default;
 
 		// Queueing
 		opt.old = opt.complete;
@@ -3172,7 +3998,6 @@ jQuery.extend({
 	},
 
 	timers: [],
-	timerId: null,
 
 	fx: function( elem, options, prop ){
 		this.options = options;
@@ -3195,13 +4020,13 @@ jQuery.fx.prototype = {
 		(jQuery.fx.step[this.prop] || jQuery.fx.step._default)( this );
 
 		// Set display property to block for height/width animations
-		if ( this.prop == &quot;height&quot; || this.prop == &quot;width&quot; )
+		if ( ( this.prop == &quot;height&quot; || this.prop == &quot;width&quot; ) &amp;&amp; this.elem.style )
 			this.elem.style.display = &quot;block&quot;;
 	},
 
 	// Get the current size
 	cur: function(force){
-		if ( this.elem[this.prop] != null &amp;&amp; this.elem.style[this.prop] == null )
+		if ( this.elem[this.prop] != null &amp;&amp; (!this.elem.style || this.elem.style[this.prop] == null) )
 			return this.elem[ this.prop ];
 
 		var r = parseFloat(jQuery.css(this.elem, this.prop, force));
@@ -3216,7 +4041,6 @@ jQuery.fx.prototype = {
 		this.unit = unit || this.unit || &quot;px&quot;;
 		this.now = this.start;
 		this.pos = this.state = 0;
-		this.update();
 
 		var self = this;
 		function t(gotoEnd){
@@ -3225,10 +4049,8 @@ jQuery.fx.prototype = {
 
 		t.elem = this.elem;
 
-		jQuery.timers.push(t);
-
-		if ( jQuery.timerId == null ) {
-			jQuery.timerId = setInterval(function(){
+		if ( t() &amp;&amp; jQuery.timers.push(t) &amp;&amp; !timerId ) {
+			timerId = setInterval(function(){
 				var timers = jQuery.timers;
 
 				for ( var i = 0; i &lt; timers.length; i++ )
@@ -3236,8 +4058,8 @@ jQuery.fx.prototype = {
 						timers.splice(i--, 1);
 
 				if ( !timers.length ) {
-					clearInterval( jQuery.timerId );
-					jQuery.timerId = null;
+					clearInterval( timerId );
+					timerId = undefined;
 				}
 			}, 13);
 		}
@@ -3250,12 +4072,9 @@ jQuery.fx.prototype = {
 		this.options.show = true;
 
 		// Begin the animation
-		this.custom(0, this.cur());
-
 		// Make sure that we start at a small width/height to avoid any
 		// flash of content
-		if ( this.prop == &quot;width&quot; || this.prop == &quot;height&quot; )
-			this.elem.style[this.prop] = &quot;1px&quot;;
+		this.custom(this.prop == &quot;width&quot; || this.prop == &quot;height&quot; ? 1 : 0, this.cur());
 
 		// Start by showing the element
 		jQuery(this.elem).show();
@@ -3275,7 +4094,7 @@ jQuery.fx.prototype = {
 	step: function(gotoEnd){
 		var t = now();
 
-		if ( gotoEnd || t &gt; this.options.duration + this.startTime ) {
+		if ( gotoEnd || t &gt;= this.options.duration + this.startTime ) {
 			this.now = this.end;
 			this.pos = this.state = 1;
 			this.update();
@@ -3300,17 +4119,16 @@ jQuery.fx.prototype = {
 
 				// Hide the element if the &quot;hide&quot; operation was done
 				if ( this.options.hide )
-					this.elem.style.display = &quot;none&quot;;
+					jQuery(this.elem).hide();
 
 				// Reset the properties, if the item has been hidden or shown
 				if ( this.options.hide || this.options.show )
 					for ( var p in this.options.curAnim )
 						jQuery.attr(this.elem.style, p, this.options.orig[p]);
-			}
-
-			if ( done )
+					
 				// Execute the complete function
 				this.options.complete.call( this.elem );
+			}
 
 			return false;
 		} else {
@@ -3335,124 +4153,106 @@ jQuery.extend( jQuery.fx, {
 		slow: 600,
  		fast: 200,
  		// Default speed
- 		def: 400
+ 		_default: 400
 	},
 	step: {
-		scrollLeft: function(fx){
-			fx.elem.scrollLeft = fx.now;
-		},
-
-		scrollTop: function(fx){
-			fx.elem.scrollTop = fx.now;
-		},
 
 		opacity: function(fx){
 			jQuery.attr(fx.elem.style, &quot;opacity&quot;, fx.now);
 		},
 
 		_default: function(fx){
-			fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+			if ( fx.elem.style &amp;&amp; fx.elem.style[ fx.prop ] != null )
+				fx.elem.style[ fx.prop ] = fx.now + fx.unit;
+			else
+				fx.elem[ fx.prop ] = fx.now;
 		}
 	}
 });
-// The Offset Method
-// Originally By Brandon Aaron, part of the Dimension Plugin
-// http://jquery.com/plugins/project/dimensions
-jQuery.fn.offset = function() {
-	var left = 0, top = 0, elem = this[0], results;
-
-	if ( elem ) with ( jQuery.browser ) {
-		var parent       = elem.parentNode,
-		    offsetChild  = elem,
-		    offsetParent = elem.offsetParent,
-		    doc          = elem.ownerDocument,
-		    safari2      = safari &amp;&amp; parseInt(version) &lt; 522 &amp;&amp; !/adobeair/i.test(userAgent),
-		    css          = jQuery.curCSS,
-		    fixed        = css(elem, &quot;position&quot;) == &quot;fixed&quot;;
-
-		// Use getBoundingClientRect if available
-		if ( elem.getBoundingClientRect ) {
-			var box = elem.getBoundingClientRect();
-
-			// Add the document scroll offsets
-			add(box.left + Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
-				box.top  + Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop));
-
-			// IE adds the HTML element's border, by default it is medium which is 2px
-			// IE 6 and 7 quirks mode the border width is overwritable by the following css html { border: 0; }
-			// IE 7 standards mode, the border is always 2px
-			// This border/offset is typically represented by the clientLeft and clientTop properties
-			// However, in IE6 and 7 quirks mode the clientLeft and clientTop properties are not updated when overwriting it via CSS
-			// Therefore this method will be off by 2px in IE while in quirksmode
-			add( -doc.documentElement.clientLeft, -doc.documentElement.clientTop );
-
-		// Otherwise loop through the offsetParents and parentNodes
-		} else {
-
-			// Initial element offsets
-			add( elem.offsetLeft, elem.offsetTop );
-
-			// Get parent offsets
-			while ( offsetParent ) {
-				// Add offsetParent offsets
-				add( offsetParent.offsetLeft, offsetParent.offsetTop );
+if ( document.documentElement[&quot;getBoundingClientRect&quot;] )
+	jQuery.fn.offset = function() {
+		if ( !this[0] ) return { top: 0, left: 0 };
+		if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
+		var box  = this[0].getBoundingClientRect(), doc = this[0].ownerDocument, body = doc.body, docElem = doc.documentElement,
+			clientTop = docElem.clientTop || body.clientTop || 0, clientLeft = docElem.clientLeft || body.clientLeft || 0,
+			top  = box.top  + (self.pageYOffset || jQuery.boxModel &amp;&amp; docElem.scrollTop  || body.scrollTop ) - clientTop,
+			left = box.left + (self.pageXOffset || jQuery.boxModel &amp;&amp; docElem.scrollLeft || body.scrollLeft) - clientLeft;
+		return { top: top, left: left };
+	};
+else 
+	jQuery.fn.offset = function() {
+		if ( !this[0] ) return { top: 0, left: 0 };
+		if ( this[0] === this[0].ownerDocument.body ) return jQuery.offset.bodyOffset( this[0] );
+		jQuery.offset.initialized || jQuery.offset.initialize();
+
+		var elem = this[0], offsetParent = elem.offsetParent, prevOffsetParent = elem,
+			doc = elem.ownerDocument, computedStyle, docElem = doc.documentElement,
+			body = doc.body, defaultView = doc.defaultView,
+			prevComputedStyle = defaultView.getComputedStyle(elem, null),
+			top = elem.offsetTop, left = elem.offsetLeft;
+
+		while ( (elem = elem.parentNode) &amp;&amp; elem !== body &amp;&amp; elem !== docElem ) {
+			computedStyle = defaultView.getComputedStyle(elem, null);
+			top -= elem.scrollTop, left -= elem.scrollLeft;
+			if ( elem === offsetParent ) {
+				top += elem.offsetTop, left += elem.offsetLeft;
+				if ( jQuery.offset.doesNotAddBorder &amp;&amp; !(jQuery.offset.doesAddBorderForTableAndCells &amp;&amp; /^t(able|d|h)$/i.test(elem.tagName)) )
+					top  += parseInt( computedStyle.borderTopWidth,  10) || 0,
+					left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
+				prevOffsetParent = offsetParent, offsetParent = elem.offsetParent;
+			}
+			if ( jQuery.offset.subtractsBorderForOverflowNotVisible &amp;&amp; computedStyle.overflow !== &quot;visible&quot; )
+				top  += parseInt( computedStyle.borderTopWidth,  10) || 0,
+				left += parseInt( computedStyle.borderLeftWidth, 10) || 0;
+			prevComputedStyle = computedStyle;
+		}
 
-				// Mozilla and Safari &gt; 2 does not include the border on offset parents
-				// However Mozilla adds the border for table or table cells
-				if ( mozilla &amp;&amp; !/^t(able|d|h)$/i.test(offsetParent.tagName) || safari &amp;&amp; !safari2 )
-					border( offsetParent );
+		if ( prevComputedStyle.position === &quot;relative&quot; || prevComputedStyle.position === &quot;static&quot; )
+			top  += body.offsetTop,
+			left += body.offsetLeft;
 
-				// Add the document scroll offsets if position is fixed on any offsetParent
-				if ( !fixed &amp;&amp; css(offsetParent, &quot;position&quot;) == &quot;fixed&quot; )
-					fixed = true;
+		if ( prevComputedStyle.position === &quot;fixed&quot; )
+			top  += Math.max(docElem.scrollTop, body.scrollTop),
+			left += Math.max(docElem.scrollLeft, body.scrollLeft);
 
-				// Set offsetChild to previous offsetParent unless it is the body element
-				offsetChild  = /^body$/i.test(offsetParent.tagName) ? offsetChild : offsetParent;
-				// Get next offsetParent
-				offsetParent = offsetParent.offsetParent;
-			}
+		return { top: top, left: left };
+	};
 
-			// Get parent scroll offsets
-			while ( parent &amp;&amp; parent.tagName &amp;&amp; !/^body|html$/i.test(parent.tagName) ) {
-				// Remove parent scroll UNLESS that parent is inline or a table to work around Opera inline/table scrollLeft/Top bug
-				if ( !/^inline|table.*$/i.test(css(parent, &quot;display&quot;)) )
-					// Subtract parent scroll offsets
-					add( -parent.scrollLeft, -parent.scrollTop );
+jQuery.offset = {
+	initialize: function() {
+		if ( this.initialized ) return;
+		var body = document.body, container = document.createElement('div'), innerDiv, checkDiv, table, td, rules, prop, bodyMarginTop = body.style.marginTop,
+			html = '&lt;div style=&quot;position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;table style=&quot;position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;&gt;&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;';
 
-				// Mozilla does not add the border for a parent that has overflow != visible
-				if ( mozilla &amp;&amp; css(parent, &quot;overflow&quot;) != &quot;visible&quot; )
-					border( parent );
+		rules = { position: 'absolute', top: 0, left: 0, margin: 0, border: 0, width: '1px', height: '1px', visibility: 'hidden' };
+		for ( prop in rules ) container.style[prop] = rules[prop];
 
-				// Get next parent
-				parent = parent.parentNode;
-			}
+		container.innerHTML = html;
+		body.insertBefore(container, body.firstChild);
+		innerDiv = container.firstChild, checkDiv = innerDiv.firstChild, td = innerDiv.nextSibling.firstChild.firstChild;
 
-			// Safari &lt;= 2 doubles body offsets with a fixed position element/offsetParent or absolutely positioned offsetChild
-			// Mozilla doubles body offsets with a non-absolutely positioned offsetChild
-			if ( (safari2 &amp;&amp; (fixed || css(offsetChild, &quot;position&quot;) == &quot;absolute&quot;)) ||
-				(mozilla &amp;&amp; css(offsetChild, &quot;position&quot;) != &quot;absolute&quot;) )
-					add( -doc.body.offsetLeft, -doc.body.offsetTop );
+		this.doesNotAddBorder = (checkDiv.offsetTop !== 5);
+		this.doesAddBorderForTableAndCells = (td.offsetTop === 5);
 
-			// Add the document scroll offsets if position is fixed
-			if ( fixed )
-				add(Math.max(doc.documentElement.scrollLeft, doc.body.scrollLeft),
-					Math.max(doc.documentElement.scrollTop,  doc.body.scrollTop));
-		}
+		innerDiv.style.overflow = 'hidden', innerDiv.style.position = 'relative';
+		this.subtractsBorderForOverflowNotVisible = (checkDiv.offsetTop === -5);
 
-		// Return an object with top and left properties
-		results = { top: top, left: left };
-	}
+		body.style.marginTop = '1px';
+		this.doesNotIncludeMarginInBodyOffset = (body.offsetTop === 0);
+		body.style.marginTop = bodyMarginTop;
 
-	function border(elem) {
-		add( jQuery.curCSS(elem, &quot;borderLeftWidth&quot;, true), jQuery.curCSS(elem, &quot;borderTopWidth&quot;, true) );
-	}
+		body.removeChild(container);
+		this.initialized = true;
+	},
 
-	function add(l, t) {
-		left += parseInt(l, 10) || 0;
-		top += parseInt(t, 10) || 0;
+	bodyOffset: function(body) {
+		jQuery.offset.initialized || jQuery.offset.initialize();
+		var top = body.offsetTop, left = body.offsetLeft;
+		if ( jQuery.offset.doesNotIncludeMarginInBodyOffset )
+			top  += parseInt( jQuery.curCSS(body, 'marginTop',  true), 10 ) || 0,
+			left += parseInt( jQuery.curCSS(body, 'marginLeft', true), 10 ) || 0;
+		return { top: top, left: left };
 	}
-
-	return results;
 };
 
 
@@ -3471,11 +4271,11 @@ jQuery.fn.extend({
 			// Subtract element margins
 			// note: when an element has margin: auto the offsetLeft and marginLeft 
 			// are the same in Safari causing offset.left to incorrectly be 0
-			offset.top  -= num( this, 'marginTop' );
+			offset.top  -= num( this, 'marginTop'  );
 			offset.left -= num( this, 'marginLeft' );
 
 			// Add offsetParent borders
-			parentOffset.top  += num( offsetParent, 'borderTopWidth' );
+			parentOffset.top  += num( offsetParent, 'borderTopWidth'  );
 			parentOffset.left += num( offsetParent, 'borderLeftWidth' );
 
 			// Subtract the two offsets
@@ -3489,7 +4289,7 @@ jQuery.fn.extend({
 	},
 
 	offsetParent: function() {
-		var offsetParent = this[0].offsetParent;
+		var offsetParent = this[0].offsetParent || document.body;
 		while ( offsetParent &amp;&amp; (!/^body|html$/i.test(offsetParent.tagName) &amp;&amp; jQuery.css(offsetParent, 'position') == 'static') )
 			offsetParent = offsetParent.offsetParent;
 		return jQuery(offsetParent);
@@ -3502,9 +4302,9 @@ jQuery.each( ['Left', 'Top'], function(i, name) {
 	var method = 'scroll' + name;
 	
 	jQuery.fn[ method ] = function(val) {
-		if (!this[0]) return;
+		if (!this[0]) return null;
 
-		return val != undefined ?
+		return val !== undefined ?
 
 			// Set the scroll offset
 			this.each(function() {
@@ -3528,22 +4328,49 @@ jQuery.each( ['Left', 'Top'], function(i, name) {
 jQuery.each([ &quot;Height&quot;, &quot;Width&quot; ], function(i, name){
 
 	var tl = i ? &quot;Left&quot;  : &quot;Top&quot;,  // top or left
-		br = i ? &quot;Right&quot; : &quot;Bottom&quot;; // bottom or right
+		br = i ? &quot;Right&quot; : &quot;Bottom&quot;, // bottom or right
+		lower = name.toLowerCase();
 
 	// innerHeight and innerWidth
 	jQuery.fn[&quot;inner&quot; + name] = function(){
-		return this[ name.toLowerCase() ]() +
-			num(this, &quot;padding&quot; + tl) +
-			num(this, &quot;padding&quot; + br);
+		return this[0] ?
+			jQuery.css( this[0], lower, false, &quot;padding&quot; ) :
+			null;
 	};
 
 	// outerHeight and outerWidth
 	jQuery.fn[&quot;outer&quot; + name] = function(margin) {
-		return this[&quot;inner&quot; + name]() +
-			num(this, &quot;border&quot; + tl + &quot;Width&quot;) +
-			num(this, &quot;border&quot; + br + &quot;Width&quot;) +
-			(margin ?
-				num(this, &quot;margin&quot; + tl) + num(this, &quot;margin&quot; + br) : 0);
+		return this[0] ?
+			jQuery.css( this[0], lower, false, margin ? &quot;margin&quot; : &quot;border&quot; ) :
+			null;
 	};
+	
+	var type = name.toLowerCase();
+
+	jQuery.fn[ type ] = function( size ) {
+		// Get window width or height
+		return this[0] == window ?
+			// Everyone else use document.documentElement or document.body depending on Quirks vs Standards mode
+			document.compatMode == &quot;CSS1Compat&quot; &amp;&amp; document.documentElement[ &quot;client&quot; + name ] ||
+			document.body[ &quot;client&quot; + name ] :
 
-});})();
+			// Get document width or height
+			this[0] == document ?
+				// Either scroll[Width/Height] or offset[Width/Height], whichever is greater
+				Math.max(
+					document.documentElement[&quot;client&quot; + name],
+					document.body[&quot;scroll&quot; + name], document.documentElement[&quot;scroll&quot; + name],
+					document.body[&quot;offset&quot; + name], document.documentElement[&quot;offset&quot; + name]
+				) :
+
+				// Get or set width or height on the element
+				size === undefined ?
+					// Get width or height on the element
+					(this.length ? jQuery.css( this[0], type ) : null) :
+
+					// Set the width or height on the element (default to pixels if value is unitless)
+					this.css( type, typeof size === &quot;string&quot; ? size : size + &quot;px&quot; );
+	};
+
+});
+})();</diff>
      <filename>public/javascripts/jquery.js</filename>
    </modified>
    <modified>
      <diff>@@ -1,43 +1,52 @@
 /*
- * jQuery validation plug-in 1.3
+ * jQuery validation plug-in 1.5.5
  *
  * http://bassistance.de/jquery-plugins/jquery-plugin-validation/
  * http://docs.jquery.com/Plugins/Validation
  *
  * Copyright (c) 2006 - 2008 J&#246;rn Zaefferer
  *
- * $Id: jquery.validate.js 5565 2008-05-12 11:15:24Z joern.zaefferer $
+ * $Id: jquery.validate.js 6403 2009-06-17 14:27:16Z joern.zaefferer $
  *
  * Dual licensed under the MIT and GPL licenses:
  *   http://www.opensource.org/licenses/mit-license.php
  *   http://www.gnu.org/licenses/gpl.html
  */
 
-jQuery.extend(jQuery.fn, {
+(function($) {
+
+$.extend($.fn, {
 	// http://docs.jquery.com/Plugins/Validation/validate
 	validate: function( options ) {
-		
+
 		// if nothing is selected, return nothing; can't chain anyway
 		if (!this.length) {
 			options &amp;&amp; options.debug &amp;&amp; window.console &amp;&amp; console.warn( &quot;nothing selected, can't validate, returning nothing&quot; );
 			return;
 		}
-		
+
 		// check if a validator for this form was already created
-		var validator = jQuery.data(this[0], 'validator');
+		var validator = $.data(this[0], 'validator');
 		if ( validator ) {
 			return validator;
 		}
 		
-		validator = new jQuery.validator( options, this[0] );
-		jQuery.data(this[0], 'validator', validator); 
+		validator = new $.validator( options, this[0] );
+		$.data(this[0], 'validator', validator); 
 		
 		if ( validator.settings.onsubmit ) {
 		
 			// allow suppresing validation by adding a cancel class to the submit button
-			this.find(&quot;.cancel:submit&quot;).click(function() {
+			this.find(&quot;input, button&quot;).filter(&quot;.cancel&quot;).click(function() {
 				validator.cancelSubmit = true;
 			});
+			
+			// when a submitHandler is used, capture the submitting button
+			if (validator.settings.submitHandler) {
+				this.find(&quot;input, button&quot;).filter(&quot;:submit&quot;).click(function() {
+					validator.submitButton = this;
+				});
+			}
 		
 			// validate the form on submit
 			this.submit( function( event ) {
@@ -47,7 +56,15 @@ jQuery.extend(jQuery.fn, {
 					
 				function handle() {
 					if ( validator.settings.submitHandler ) {
+						if (validator.submitButton) {
+							// insert a hidden input as a replacement for the missing submit button
+							var hidden = $(&quot;&lt;input type='hidden'/&gt;&quot;).attr(&quot;name&quot;, validator.submitButton.name).val(validator.submitButton.value).appendTo(validator.currentForm);
+						}
 						validator.settings.submitHandler.call( validator, validator.currentForm );
+						if (validator.submitButton) {
+							// and clean up afterwards; thanks to no-block-scope, hidden can be referenced
+							hidden.remove();
+						}
 						return false;
 					}
 					return true;
@@ -75,13 +92,13 @@ jQuery.extend(jQuery.fn, {
 	},
 	// http://docs.jquery.com/Plugins/Validation/valid
 	valid: function() {
-        if ( jQuery(this[0]).is('form')) {
+        if ( $(this[0]).is('form')) {
             return this.validate().form();
         } else {
-            var valid = false;
-            var validator = jQuery(this[0].form).validate();
+            var valid = true;
+            var validator = $(this[0].form).validate();
             this.each(function() {
-				valid |= validator.element(this);
+				valid &amp;= validator.element(this);
             });
             return valid;
         }
@@ -90,9 +107,9 @@ jQuery.extend(jQuery.fn, {
 	removeAttrs: function(attributes) {
 		var result = {},
 			$element = this;
-		$.each(attributes.split(/\s/), function() {
-			result[this] = $element.attr(this);
-			$element.removeAttr(this);
+		$.each(attributes.split(/\s/), function(index, value) {
+			result[value] = $element.attr(value);
+			$element.removeAttr(value);
 		});
 		return result;
 	},
@@ -101,12 +118,15 @@ jQuery.extend(jQuery.fn, {
 		var element = this[0];
 		
 		if (command) {
-			var staticRules = jQuery.data(element.form, 'validator').settings.rules;
-			var existingRules = jQuery.validator.staticRules(element);
+			var settings = $.data(element.form, 'validator').settings;
+			var staticRules = settings.rules;
+			var existingRules = $.validator.staticRules(element);
 			switch(command) {
 			case &quot;add&quot;:
-				$.extend(existingRules, jQuery.validator.normalizeRule(argument));
+				$.extend(existingRules, $.validator.normalizeRule(argument));
 				staticRules[element.name] = existingRules;
+				if (argument.messages)
+					settings.messages[element.name] = $.extend( settings.messages[element.name], argument.messages );
 				break;
 			case &quot;remove&quot;:
 				if (!argument) {
@@ -122,13 +142,13 @@ jQuery.extend(jQuery.fn, {
 			}
 		}
 		
-		var data = jQuery.validator.normalizeRules(
-		jQuery.extend(
+		var data = $.validator.normalizeRules(
+		$.extend(
 			{},
-			jQuery.validator.metadataRules(element),
-			jQuery.validator.classRules(element),
-			jQuery.validator.attributeRules(element),
-			jQuery.validator.staticRules(element)
+			$.validator.metadataRules(element),
+			$.validator.classRules(element),
+			$.validator.attributeRules(element),
+			$.validator.staticRules(element)
 		), element);
 		
 		// make sure required is at front
@@ -139,69 +159,66 @@ jQuery.extend(jQuery.fn, {
 		}
 		
 		return data;
-	},
-	// destructive add
-	push: function( t ) {
-		return this.setArray( this.add(t).get() );
 	}
 });
 
 // Custom selectors
-jQuery.extend(jQuery.expr[&quot;:&quot;], {
+$.extend($.expr[&quot;:&quot;], {
 	// http://docs.jquery.com/Plugins/Validation/blank
-	blank: function(a) {return !jQuery.trim(a.value);},
+	blank: function(a) {return !$.trim(a.value);},
 	// http://docs.jquery.com/Plugins/Validation/filled
-	filled: function(a) {return !!jQuery.trim(a.value);},
+	filled: function(a) {return !!$.trim(a.value);},
 	// http://docs.jquery.com/Plugins/Validation/unchecked
 	unchecked: function(a) {return !a.checked;}
 });
 
+// constructor for validator
+$.validator = function( options, form ) {
+	this.settings = $.extend( {}, $.validator.defaults, options );
+	this.currentForm = form;
+	this.init();
+};
 
-jQuery.format = function(source, params) {
+$.validator.format = function(source, params) {
 	if ( arguments.length == 1 ) 
 		return function() {
-			var args = jQuery.makeArray(arguments);
+			var args = $.makeArray(arguments);
 			args.unshift(source);
-			return jQuery.format.apply( this, args );
+			return $.validator.format.apply( this, args );
 		};
 	if ( arguments.length &gt; 2 &amp;&amp; params.constructor != Array  ) {
-		params = jQuery.makeArray(arguments).slice(1);
+		params = $.makeArray(arguments).slice(1);
 	}
 	if ( params.constructor != Array ) {
 		params = [ params ];
 	}
-	jQuery.each(params, function(i, n) {
+	$.each(params, function(i, n) {
 		source = source.replace(new RegExp(&quot;\\{&quot; + i + &quot;\\}&quot;, &quot;g&quot;), n);
 	});
 	return source;
 };
 
-// constructor for validator
-jQuery.validator = function( options, form ) {
-	this.settings = jQuery.extend( {}, jQuery.validator.defaults, options );
-	this.currentForm = form;
-	this.init();
-};
-
-jQuery.extend(jQuery.validator, {
-
+$.extend($.validator, {
+	
 	defaults: {
 		messages: {},
 		groups: {},
 		rules: {},
 		errorClass: &quot;error&quot;,
+		validClass: &quot;valid&quot;,
 		errorElement: &quot;label&quot;,
 		focusInvalid: true,
-		errorContainer: jQuery( [] ),
-		errorLabelContainer: jQuery( [] ),
+		errorContainer: $( [] ),
+		errorLabelContainer: $( [] ),
 		onsubmit: true,
 		ignore: [],
+		ignoreTitle: false,
 		onfocusin: function(element) {
 			this.lastActive = element;
 				
 			// hide error label and remove error class on focus if enabled
 			if ( this.settings.focusCleanup &amp;&amp; !this.blockFocusCleanup ) {
-				this.settings.unhighlight &amp;&amp; this.settings.unhighlight.call( this, element, this.settings.errorClass );
+				this.settings.unhighlight &amp;&amp; this.settings.unhighlight.call( this, element, this.settings.errorClass, this.settings.validClass );
 				this.errorsFor(element).hide();
 			}
 		},
@@ -219,17 +236,17 @@ jQuery.extend(jQuery.validator, {
 			if ( element.name in this.submitted )
 				this.element(element);
 		},
-		highlight: function( element, errorClass ) {
-			jQuery( element ).addClass( errorClass );
+		highlight: function( element, errorClass, validClass ) {
+			$(element).addClass(errorClass).removeClass(validClass);
 		},
-		unhighlight: function( element, errorClass ) {
-			jQuery( element ).removeClass( errorClass );
+		unhighlight: function( element, errorClass, validClass ) {
+			$(element).removeClass(errorClass).addClass(validClass);
 		}
 	},
 
 	// http://docs.jquery.com/Plugins/Validation/Validator/setDefaults
 	setDefaults: function(settings) {
-		jQuery.extend( jQuery.validator.defaults, settings );
+		$.extend( $.validator.defaults, settings );
 	},
 
 	messages: {
@@ -243,21 +260,15 @@ jQuery.extend(jQuery.validator, {
 		number: &quot;Please enter a valid number.&quot;,
 		numberDE: &quot;Bitte geben Sie eine Nummer ein.&quot;,
 		digits: &quot;Please enter only digits&quot;,
-		creditcard: &quot;Please enter a valid credit card.&quot;,
+		creditcard: &quot;Please enter a valid credit card number.&quot;,
 		equalTo: &quot;Please enter the same value again.&quot;,
 		accept: &quot;Please enter a value with a valid extension.&quot;,
-		maxlength: jQuery.format(&quot;Please enter no more than {0} characters.&quot;),
-		maxLength: jQuery.format(&quot;Please enter no more than {0} characters.&quot;),
-		minlength: jQuery.format(&quot;Please enter at least {0} characters.&quot;),
-		minLength: jQuery.format(&quot;Please enter at least {0} characters.&quot;),
-		rangelength: jQuery.format(&quot;Please enter a value between {0} and {1} characters long.&quot;),
-		rangeLength: jQuery.format(&quot;Please enter a value between {0} and {1} characters long.&quot;),
-		rangeValue: jQuery.format(&quot;Please enter a value between {0} and {1}.&quot;),
-		range: jQuery.format(&quot;Please enter a value between {0} and {1}.&quot;),
-		maxValue: jQuery.format(&quot;Please enter a value less than or equal to {0}.&quot;),
-		max: jQuery.format(&quot;Please enter a value less than or equal to {0}.&quot;),
-		minValue: jQuery.format(&quot;Please enter a value greater than or equal to {0}.&quot;),
-		min: jQuery.format(&quot;Please enter a value greater than or equal to {0}.&quot;)
+		maxlength: $.validator.format(&quot;Please enter no more than {0} characters.&quot;),
+		minlength: $.validator.format(&quot;Please enter at least {0} characters.&quot;),
+		rangelength: $.validator.format(&quot;Please enter a value between {0} and {1} characters long.&quot;),
+		range: $.validator.format(&quot;Please enter a value between {0} and {1}.&quot;),
+		max: $.validator.format(&quot;Please enter a value less than or equal to {0}.&quot;),
+		min: $.validator.format(&quot;Please enter a value greater than or equal to {0}.&quot;)
 	},
 	
 	autoCreateRanges: false,
@@ -265,9 +276,9 @@ jQuery.extend(jQuery.validator, {
 	prototype: {
 		
 		init: function() {
-			this.labelContainer = jQuery(this.settings.errorLabelContainer);
-			this.errorContext = this.labelContainer.length &amp;&amp; this.labelContainer || jQuery(this.currentForm);
-			this.containers = jQuery(this.settings.errorContainer).add( this.settings.errorLabelContainer );
+			this.labelContainer = $(this.settings.errorLabelContainer);
+			this.errorContext = this.labelContainer.length &amp;&amp; this.labelContainer || $(this.currentForm);
+			this.containers = $(this.settings.errorContainer).add( this.settings.errorLabelContainer );
 			this.submitted = {};
 			this.valueCache = {};
 			this.pendingRequest = 0;
@@ -276,39 +287,42 @@ jQuery.extend(jQuery.validator, {
 			this.reset();
 			
 			var groups = (this.groups = {});
-			jQuery.each(this.settings.groups, function(key, value) {
-				jQuery.each(value.split(/\s/), function(index, name) {
+			$.each(this.settings.groups, function(key, value) {
+				$.each(value.split(/\s/), function(index, name) {
 					groups[name] = key;
 				});
 			});
 			var rules = this.settings.rules;
-			jQuery.each(rules, function(key, value) {
-				rules[key] = jQuery.validator.normalizeRule(value);
+			$.each(rules, function(key, value) {
+				rules[key] = $.validator.normalizeRule(value);
 			});
 			
 			function delegate(event) {
-				var validator = jQuery.data(this[0].form, &quot;validator&quot;);
+				var validator = $.data(this[0].form, &quot;validator&quot;);
 				validator.settings[&quot;on&quot; + event.type] &amp;&amp; validator.settings[&quot;on&quot; + event.type].call(validator, this[0] );
 			}
-			jQuery(this.currentForm)
+			$(this.currentForm)
 				.delegate(&quot;focusin focusout keyup&quot;, &quot;:text, :password, :file, select, textarea&quot;, delegate)
 				.delegate(&quot;click&quot;, &quot;:radio, :checkbox&quot;, delegate);
+
+			if (this.settings.invalidHandler)
+				$(this.currentForm).bind(&quot;invalid-form.validate&quot;, this.settings.invalidHandler);
 		},
 
 		// http://docs.jquery.com/Plugins/Validation/Validator/form
 		form: function() {
 			this.checkForm();
-			jQuery.extend(this.submitted, this.errorMap);
-			this.invalid = jQuery.extend({}, this.errorMap);
+			$.extend(this.submitted, this.errorMap);
+			this.invalid = $.extend({}, this.errorMap);
 			if (!this.valid())
-				jQuery(this.currentForm).triggerHandler(&quot;invalid-form.validate&quot;, [this]);
+				$(this.currentForm).triggerHandler(&quot;invalid-form&quot;, [this]);
 			this.showErrors();
 			return this.valid();
 		},
 		
 		checkForm: function() {
 			this.prepareForm();
-			for ( var i = 0, elements = this.elements(); elements[i]; i++ ) {
+			for ( var i = 0, elements = (this.currentElements = this.elements()); elements[i]; i++ ) {
 				this.check( elements[i] );
 			}
 			return this.valid(); 
@@ -319,6 +333,7 @@ jQuery.extend(jQuery.validator, {
 			element = this.clean( element );
 			this.lastElement = element;
 			this.prepareElement( element );
+			this.currentElements = $(element);
 			var result = this.check( element );
 			if ( result ) {
 				delete this.invalid[element.name];
@@ -327,7 +342,7 @@ jQuery.extend(jQuery.validator, {
 			}
 			if ( !this.numberOfInvalids() ) {
 				// Hide error containers on last error
-				this.toHide.push( this.containers );
+				this.toHide = this.toHide.add( this.containers );
 			}
 			this.showErrors();
 			return result;
@@ -337,7 +352,7 @@ jQuery.extend(jQuery.validator, {
 		showErrors: function(errors) {
 			if(errors) {
 				// add items to error list and map
-				jQuery.extend( this.errorMap, errors );
+				$.extend( this.errorMap, errors );
 				this.errorList = [];
 				for ( var name in errors ) {
 					this.errorList.push({
@@ -346,7 +361,7 @@ jQuery.extend(jQuery.validator, {
 					});
 				}
 				// remove items from success list
-				this.successList = jQuery.grep( this.successList, function(element) {
+				this.successList = $.grep( this.successList, function(element) {
 					return !(element.name in errors);
 				});
 			}
@@ -357,8 +372,9 @@ jQuery.extend(jQuery.validator, {
 		
 		// http://docs.jquery.com/Plugins/Validation/Validator/resetForm
 		resetForm: function() {
-			if ( jQuery.fn.resetForm )
-				jQuery( this.currentForm ).resetForm();
+			if ( $.fn.resetForm )
+				$( this.currentForm ).resetForm();
+			this.submitted = {};
 			this.prepareForm();
 			this.hideErrors();
 			this.elements().removeClass( this.settings.errorClass );
@@ -390,14 +406,16 @@ jQuery.extend(jQuery.validator, {
 		focusInvalid: function() {
 			if( this.settings.focusInvalid ) {
 				try {
-					jQuery(this.findLastActive() || this.errorList.length &amp;&amp; this.errorList[0].element || []).filter(&quot;:visible&quot;).focus();
-				} catch(e) { /* ignore IE throwing errors when focusing hidden elements */ }
+					$(this.findLastActive() || this.errorList.length &amp;&amp; this.errorList[0].element || []).filter(&quot;:visible&quot;).focus();
+				} catch(e) {
+					// ignore IE throwing errors when focusing hidden elements
+				}
 			}
 		},
 		
 		findLastActive: function() {
 			var lastActive = this.lastActive;
-			return lastActive &amp;&amp; jQuery.grep(this.errorList, function(n) {
+			return lastActive &amp;&amp; $.grep(this.errorList, function(n) {
 				return n.element.name == lastActive.name;
 			}).length == 1 &amp;&amp; lastActive;
 		},
@@ -407,10 +425,10 @@ jQuery.extend(jQuery.validator, {
 				rulesCache = {};
 			
 			// select all valid inputs inside the form (no submit or reset buttons)
-			// workaround with jQuery([]).add until http://dev.jquery.com/ticket/2114 is solved
-			return jQuery([]).add(this.currentForm.elements)
-			.filter(&quot;input, select, textarea&quot;)
-			.not(&quot;:submit, :reset, [disabled]&quot;)
+			// workaround $Query([]).add until http://dev.jquery.com/ticket/2114 is solved
+			return $([]).add(this.currentForm.elements)
+			.filter(&quot;:input&quot;)
+			.not(&quot;:submit, :reset, :image, [disabled]&quot;)
 			.not( this.settings.ignore )
 			.filter(function() {
 				!this.name &amp;&amp; validator.settings.debug &amp;&amp; window.console &amp;&amp; console.error( &quot;%o has no name assigned&quot;, this);
@@ -425,25 +443,26 @@ jQuery.extend(jQuery.validator, {
 		},
 		
 		clean: function( selector ) {
-			return jQuery( selector )[0];
+			return $( selector )[0];
 		},
 		
 		errors: function() {
-			return jQuery( this.settings.errorElement + &quot;.&quot; + this.settings.errorClass, this.errorContext );
+			return $( this.settings.errorElement + &quot;.&quot; + this.settings.errorClass, this.errorContext );
 		},
 		
 		reset: function() {
 			this.successList = [];
 			this.errorList = [];
 			this.errorMap = {};
-			this.toShow = jQuery( [] );
-			this.toHide = jQuery( [] );
+			this.toShow = $([]);
+			this.toHide = $([]);
 			this.formSubmitted = false;
+			this.currentElements = $([]);
 		},
 		
 		prepareForm: function() {
 			this.reset();
-			this.toHide = this.errors().push( this.containers );
+			this.toHide = this.errors().add( this.containers );
 		},
 		
 		prepareElement: function( element ) {
@@ -464,7 +483,7 @@ jQuery.extend(jQuery.validator, {
 			for( method in rules ) {
 				var rule = { method: method, parameters: rules[method] };
 				try {
-					var result = jQuery.validator.methods[method].call( this, jQuery.trim(element.value), element, rule.parameters );
+					var result = $.validator.methods[method].call( this, element.value.replace(/\r/g, &quot;&quot;), element, rule.parameters );
 					
 					// if a method indicates that the field is optional and therefore valid,
 					// don't mark it as valid when there are no other rules
@@ -496,6 +515,19 @@ jQuery.extend(jQuery.validator, {
 			return true;
 		},
 		
+		// return the custom message for the given element and validation method
+		// specified in the element's &quot;messages&quot; metadata
+		customMetaMessage: function(element, method) {
+			if (!$.metadata)
+				return;
+			
+			var meta = this.settings.meta
+				? $(element).metadata()[this.settings.meta]
+				: $(element).metadata();
+			
+			return meta &amp;&amp; meta.messages &amp;&amp; meta.messages[method];
+		},
+		
 		// return the custom message for the given element name and validation method
 		customMessage: function( name, method ) {
 			var m = this.settings.messages[name];
@@ -516,9 +548,10 @@ jQuery.extend(jQuery.validator, {
 		defaultMessage: function( element, method) {
 			return this.findDefined(
 				this.customMessage( element.name, method ),
+				this.customMetaMessage( element, method ),
 				// title is never undefined, so handle empty string as undefined
-				element.title || undefined,
-				jQuery.validator.messages[method],
+				!this.settings.ignoreTitle &amp;&amp; element.title || undefined,
+				$.validator.messages[method],
 				&quot;&lt;strong&gt;Warning: No message defined for &quot; + element.name + &quot;&lt;/strong&gt;&quot;
 			);
 		},
@@ -537,18 +570,18 @@ jQuery.extend(jQuery.validator, {
 		
 		addWrapper: function(toToggle) {
 			if ( this.settings.wrapper )
-				toToggle.push( toToggle.parents( this.settings.wrapper ) );
+				toToggle = toToggle.add( toToggle.parent( this.settings.wrapper ) );
 			return toToggle;
 		},
 		
 		defaultShowErrors: function() {
 			for ( var i = 0; this.errorList[i]; i++ ) {
 				var error = this.errorList[i];
-				this.settings.highlight &amp;&amp; this.settings.highlight.call( this, error.element, this.settings.errorClass );
+				this.settings.highlight &amp;&amp; this.settings.highlight.call( this, error.element, this.settings.errorClass, this.settings.validClass );
 				this.showLabel( error.element, error.message );
 			}
 			if( this.errorList.length ) {
-				this.toShow.push( this.containers );
+				this.toShow = this.toShow.add( this.containers );
 			}
 			if (this.settings.success) {
 				for ( var i = 0; this.successList[i]; i++ ) {
@@ -557,7 +590,7 @@ jQuery.extend(jQuery.validator, {
 			}
 			if (this.settings.unhighlight) {
 				for ( var i = 0, elements = this.validElements(); elements[i]; i++ ) {
-					this.settings.unhighlight.call( this, elements[i], this.settings.errorClass );
+					this.settings.unhighlight.call( this, elements[i], this.settings.errorClass, this.settings.validClass );
 				}
 			}
 			this.toHide = this.toHide.not( this.toShow );
@@ -566,11 +599,11 @@ jQuery.extend(jQuery.validator, {
 		},
 		
 		validElements: function() {
-			return this.elements().not(this.invalidElements());
+			return this.currentElements.not(this.invalidElements());
 		},
 		
 		invalidElements: function() {
-			return jQuery(this.errorList).map(function() {
+			return $(this.errorList).map(function() {
 				return this.element;
 			});
 		},
@@ -585,18 +618,18 @@ jQuery.extend(jQuery.validator, {
 				label.attr(&quot;generated&quot;) &amp;&amp; label.html(message);
 			} else {
 				// create label
-				label = jQuery(&quot;&lt;&quot; + this.settings.errorElement + &quot;/&gt;&quot;)
+				label = $(&quot;&lt;&quot; + this.settings.errorElement + &quot;/&gt;&quot;)
 					.attr({&quot;for&quot;:  this.idOrName(element), generated: true})
 					.addClass(this.settings.errorClass)
 					.html(message || &quot;&quot;);
 				if ( this.settings.wrapper ) {
 					// make sure the element is visible, even in IE
 					// actually showing the wrapped element is handled elsewhere
-					label = label.hide().show().wrap(&quot;&lt;&quot; + this.settings.wrapper + &quot;&gt;&quot;).parent();
+					label = label.hide().show().wrap(&quot;&lt;&quot; + this.settings.wrapper + &quot;/&gt;&quot;).parent();
 				}
 				if ( !this.labelContainer.append(label).length )
 					this.settings.errorPlacement
-						? this.settings.errorPlacement(label, jQuery(element) )
+						? this.settings.errorPlacement(label, $(element) )
 						: label.insertAfter(element);
 			}
 			if ( !message &amp;&amp; this.settings.success ) {
@@ -605,11 +638,11 @@ jQuery.extend(jQuery.validator, {
 					? label.addClass( this.settings.success )
 					: this.settings.success( label );
 			}
-			this.toShow.push(label);
+			this.toShow = this.toShow.add(label);
 		},
 		
 		errorsFor: function(element) {
-			return this.errors().filter(&quot;[@for='&quot; + this.idOrName(element) + &quot;']&quot;);
+			return this.errors().filter(&quot;[for='&quot; + this.idOrName(element) + &quot;']&quot;);
 		},
 		
 		idOrName: function(element) {
@@ -623,7 +656,7 @@ jQuery.extend(jQuery.validator, {
 		findByName: function( name ) {
 			// select by name and filter by form for performance over form.find(&quot;[name=...]&quot;)
 			var form = this.currentForm;
-			return jQuery(document.getElementsByName(name)).map(function(index, element) {
+			return $(document.getElementsByName(name)).map(function(index, element) {
 				return element.form == form &amp;&amp; element.name == name &amp;&amp; element  || null;
 			});
 		},
@@ -631,7 +664,7 @@ jQuery.extend(jQuery.validator, {
 		getLength: function(value, element) {
 			switch( element.nodeName.toLowerCase() ) {
 			case 'select':
-				return jQuery(&quot;option:selected&quot;, element).length;
+				return $(&quot;option:selected&quot;, element).length;
 			case 'input':
 				if( this.checkable( element) )
 					return this.findByName(element.name).filter(':checked').length;
@@ -650,7 +683,7 @@ jQuery.extend(jQuery.validator, {
 				return param;
 			},
 			&quot;string&quot;: function(param, element) {
-				return !!jQuery(param, element.form).length;
+				return !!$(param, element.form).length;
 			},
 			&quot;function&quot;: function(param, element) {
 				return param(element);
@@ -658,7 +691,7 @@ jQuery.extend(jQuery.validator, {
 		},
 		
 		optional: function(element) {
-			return !jQuery.validator.methods.required.call(this, jQuery.trim(element.value), element) &amp;&amp; &quot;dependency-mismatch&quot;;
+			return !$.validator.methods.required.call(this, $.trim(element.value), element) &amp;&amp; &quot;dependency-mismatch&quot;;
 		},
 		
 		startRequest: function(element) {
@@ -670,17 +703,19 @@ jQuery.extend(jQuery.validator, {
 		
 		stopRequest: function(element, valid) {
 			this.pendingRequest--;
-			// sometimes synchronization fails, make pendingRequest is never &lt; 0
+			// sometimes synchronization fails, make sure pendingRequest is never &lt; 0
 			if (this.pendingRequest &lt; 0)
 				this.pendingRequest = 0;
 			delete this.pending[element.name];
 			if ( valid &amp;&amp; this.pendingRequest == 0 &amp;&amp; this.formSubmitted &amp;&amp; this.form() ) {
-				jQuery(this.currentForm).submit();
+				$(this.currentForm).submit();
+			} else if (!valid &amp;&amp; this.pendingRequest == 0 &amp;&amp; this.formSubmitted) {
+				$(this.currentForm).triggerHandler(&quot;invalid-form&quot;, [this]);
 			}
 		},
 		
 		previousValue: function(element) {
-			return jQuery.data(element, &quot;previousValue&quot;) || jQuery.data(element, &quot;previousValue&quot;, previous = {
+			return $.data(element, &quot;previousValue&quot;) || $.data(element, &quot;previousValue&quot;, previous = {
 				old: null,
 				valid: true,
 				message: this.defaultMessage( element, &quot;remote&quot; )
@@ -705,15 +740,15 @@ jQuery.extend(jQuery.validator, {
 	addClassRules: function(className, rules) {
 		className.constructor == String ?
 			this.classRuleSettings[className] = rules :
-			jQuery.extend(this.classRuleSettings, className);
+			$.extend(this.classRuleSettings, className);
 	},
 	
 	classRules: function(element) {
 		var rules = {};
-		var classes = jQuery(element).attr('class');
-		classes &amp;&amp; jQuery.each(classes.split(' '), function() {
-			if (this in jQuery.validator.classRuleSettings) {
-				jQuery.extend(rules, jQuery.validator.classRuleSettings[this]);
+		var classes = $(element).attr('class');
+		classes &amp;&amp; $.each(classes.split(' '), function() {
+			if (this in $.validator.classRuleSettings) {
+				$.extend(rules, $.validator.classRuleSettings[this]);
 			}
 		});
 		return rules;
@@ -721,12 +756,11 @@ jQuery.extend(jQuery.validator, {
 	
 	attributeRules: function(element) {
 		var rules = {};
-		var $element = jQuery(element);
+		var $element = $(element);
 		
-		for (method in jQuery.validator.methods) {
+		for (method in $.validator.methods) {
 			var value = $element.attr(method);
-			// allow 0 but neither undefined nor empty string
-			if (value !== undefined &amp;&amp; value !== '') {
+			if (value) {
 				rules[method] = value;
 			}
 		}
@@ -734,47 +768,30 @@ jQuery.extend(jQuery.validator, {
 		// maxlength may be returned as -1, 2147483647 (IE) and 524288 (safari) for text inputs
 		if (rules.maxlength &amp;&amp; /-1|2147483647|524288/.test(rules.maxlength)) {
 			delete rules.maxlength;
-			// deprecated
-			delete rules.maxLength;
 		}
 		
 		return rules;
 	},
 	
 	metadataRules: function(element) {
-		if (!jQuery.metadata) return {};
+		if (!$.metadata) return {};
 		
-		var meta = jQuery.data(element.form, 'validator').settings.meta;
+		var meta = $.data(element.form, 'validator').settings.meta;
 		return meta ?
-			jQuery(element).metadata()[meta] :
-			jQuery(element).metadata();
+			$(element).metadata()[meta] :
+			$(element).metadata();
 	},
 	
 	staticRules: function(element) {
 		var rules = {};
-		var validator = jQuery.data(element.form, 'validator');
+		var validator = $.data(element.form, 'validator');
 		if (validator.settings.rules) {
-			rules = jQuery.validator.normalizeRule(validator.settings.rules[element.name]) || {};
+			rules = $.validator.normalizeRule(validator.settings.rules[element.name]) || {};
 		}
 		return rules;
 	},
 	
 	normalizeRules: function(rules, element) {
-		// convert deprecated rules
-		jQuery.each({
-			minLength: 'minlength',
-			maxLength: 'maxlength',
-			rangeLength: 'rangelength',
-			minValue: 'min',
-			maxValue: 'max',
-			rangeValue: 'range'
-		}, function(dep, curr) {
-			if (rules[dep]) {
-				rules[curr] = rules[dep];
-				delete rules[dep];
-			}
-		});
-		
 		// handle dependency check
 		$.each(rules, function(prop, val) {
 			// ignore rule when param is explicitly false, eg. required:false
@@ -786,7 +803,7 @@ jQuery.extend(jQuery.validator, {
 				var keepRule = true;
 				switch (typeof val.depends) {
 					case &quot;string&quot;:
-						keepRule = !!jQuery(val.depends, element.form).length;
+						keepRule = !!$(val.depends, element.form).length;
 						break;
 					case &quot;function&quot;:
 						keepRule = val.depends.call(element, element);
@@ -801,23 +818,23 @@ jQuery.extend(jQuery.validator, {
 		});
 		
 		// evaluate parameters
-		jQuery.each(rules, function(rule, parameter) {
-			rules[rule] = jQuery.isFunction(parameter) ? parameter(element) : parameter;
+		$.each(rules, function(rule, parameter) {
+			rules[rule] = $.isFunction(parameter) ? parameter(element) : parameter;
 		});
 		
 		// clean number parameters
-		jQuery.each(['minlength', 'maxlength', 'min', 'max'], function() {
+		$.each(['minlength', 'maxlength', 'min', 'max'], function() {
 			if (rules[this]) {
 				rules[this] = Number(rules[this]);
 			}
 		});
-		jQuery.each(['rangelength', 'range'], function() {
+		$.each(['rangelength', 'range'], function() {
 			if (rules[this]) {
 				rules[this] = [Number(rules[this][0]), Number(rules[this][1])];
 			}
 		});
 		
-		if (jQuery.validator.autoCreateRanges) {
+		if ($.validator.autoCreateRanges) {
 			// auto-create ranges
 			if (rules.min &amp;&amp; rules.max) {
 				rules.range = [rules.min, rules.max];
@@ -831,6 +848,11 @@ jQuery.extend(jQuery.validator, {
 			}
 		}
 		
+		// To support custom messages in metadata ignore rule methods titled &quot;messages&quot;
+		if (rules.messages) {
+			delete rules.messages
+		}
+		
 		return rules;
 	},
 	
@@ -838,7 +860,7 @@ jQuery.extend(jQuery.validator, {
 	normalizeRule: function(data) {
 		if( typeof data == &quot;string&quot; ) {
 			var transformed = {};
-			jQuery.each(data.split(/\s/), function() {
+			$.each(data.split(/\s/), function() {
 				transformed[this] = true;
 			});
 			data = transformed;
@@ -848,10 +870,10 @@ jQuery.extend(jQuery.validator, {
 	
 	// http://docs.jquery.com/Plugins/Validation/Validator/addMethod
 	addMethod: function(name, method, message) {
-		jQuery.validator.methods[name] = method;
-		jQuery.validator.messages[name] = message;
+		$.validator.methods[name] = method;
+		$.validator.messages[name] = message || $.validator.messages[name];
 		if (method.length &lt; 3) {
-			jQuery.validator.addClassRules(name, jQuery.validator.normalizeRule(name));
+			$.validator.addClassRules(name, $.validator.normalizeRule(name));
 		}
 	},
 
@@ -864,13 +886,13 @@ jQuery.extend(jQuery.validator, {
 				return &quot;dependency-mismatch&quot;;
 			switch( element.nodeName.toLowerCase() ) {
 			case 'select':
-				var options = jQuery(&quot;option:selected&quot;, element);
-				return options.length &gt; 0 &amp;&amp; ( element.type == &quot;select-multiple&quot; || (jQuery.browser.msie &amp;&amp; !(options[0].attributes['value'].specified) ? options[0].text : options[0].value).length &gt; 0);
+				var options = $(&quot;option:selected&quot;, element);
+				return options.length &gt; 0 &amp;&amp; ( element.type == &quot;select-multiple&quot; || ($.browser.msie &amp;&amp; !(options[0].attributes['value'].specified) ? options[0].text : options[0].value).length &gt; 0);
 			case 'input':
 				if ( this.checkable(element) )
 					return this.getLength(value, element) &gt; 0;
 			default:
-				return value.length &gt; 0;
+				return $.trim(value).length &gt; 0;
 			}
 		},
 		
@@ -885,34 +907,37 @@ jQuery.extend(jQuery.validator, {
 				this.settings.messages[element.name] = {};
 			this.settings.messages[element.name].remote = typeof previous.message == &quot;function&quot; ? previous.message(value) : previous.message;
 			
+			param = typeof param == &quot;string&quot; &amp;&amp; {url:param} || param; 
+			
 			if ( previous.old !== value ) {
 				previous.old = value;
 				var validator = this;
 				this.startRequest(element);
 				var data = {};
 				data[element.name] = value;
-				jQuery.ajax({
+				$.ajax($.extend(true, {
 					url: param,
 					mode: &quot;abort&quot;,
 					port: &quot;validate&quot; + element.name,
 					dataType: &quot;json&quot;,
 					data: data,
 					success: function(response) {
-						if ( !response ) {
-							var errors = {};
-							errors[element.name] =  response || validator.defaultMessage( element, &quot;remote&quot; );
-							validator.showErrors(errors);
-						} else {
+						var valid = response === true;
+						if ( valid ) {
 							var submitted = validator.formSubmitted;
 							validator.prepareElement(element);
 							validator.formSubmitted = submitted;
 							validator.successList.push(element);
 							validator.showErrors();
+						} else {
+							var errors = {};
+							errors[element.name] = previous.message = response || validator.defaultMessage( element, &quot;remote&quot; );
+							validator.showErrors(errors);
 						}
-						previous.valid = response;
-						validator.stopRequest(element, response);
+						previous.valid = valid;
+						validator.stopRequest(element, valid);
 					}
-				});
+				}, param));
 				return &quot;pending&quot;;
 			} else if( this.pending[element.name] ) {
 				return &quot;pending&quot;;
@@ -922,75 +947,45 @@ jQuery.extend(jQuery.validator, {
 
 		// http://docs.jquery.com/Plugins/Validation/Methods/minlength
 		minlength: function(value, element, param) {
-			return this.optional(element) || this.getLength(value, element) &gt;= param;
+			return this.optional(element) || this.getLength($.trim(value), element) &gt;= param;
 		},
 		
-		// deprecated, to be removed in 1.3
-		minLength: function(value, element, param) {
-			return jQuery.validator.methods.minlength.apply(this, arguments);
-		},
-	
 		// http://docs.jquery.com/Plugins/Validation/Methods/maxlength
 		maxlength: function(value, element, param) {
-			return this.optional(element) || this.getLength(value, element) &lt;= param;
-		},
-		
-		// deprecated, to be removed in 1.3
-		maxLength: function(value, element, param) {
-			return jQuery.validator.methods.maxlength.apply(this, arguments);
+			return this.optional(element) || this.getLength($.trim(value), element) &lt;= param;
 		},
 		
 		// http://docs.jquery.com/Plugins/Validation/Methods/rangelength
 		rangelength: function(value, element, param) {
-			var length = this.getLength(value, element);
+			var length = this.getLength($.trim(value), element);
 			return this.optional(element) || ( length &gt;= param[0] &amp;&amp; length &lt;= param[1] );
 		},
 		
-		// deprecated, to be removed in 1.3
-		rangeLength: function(value, element, param) {
-			return jQuery.validator.methods.rangelength.apply(this, arguments);
-		},
-	
 		// http://docs.jquery.com/Plugins/Validation/Methods/min
 		min: function( value, element, param ) {
 			return this.optional(element) || value &gt;= param;
 		},
 		
-		// deprecated, to be removed in 1.3
-		minValue: function() {
-			return jQuery.validator.methods.min.apply(this, arguments);
-		},
-		
 		// http://docs.jquery.com/Plugins/Validation/Methods/max
 		max: function( value, element, param ) {
 			return this.optional(element) || value &lt;= param;
 		},
 		
-		// deprecated, to be removed in 1.3
-		maxValue: function() {
-			return jQuery.validator.methods.max.apply(this, arguments);
-		},
-		
 		// http://docs.jquery.com/Plugins/Validation/Methods/range
 		range: function( value, element, param ) {
 			return this.optional(element) || ( value &gt;= param[0] &amp;&amp; value &lt;= param[1] );
 		},
 		
-		// deprecated, to be removed in 1.3
-		rangeValue: function() {
-			return jQuery.validator.methods.range.apply(this, arguments);
-		},
-		
 		// http://docs.jquery.com/Plugins/Validation/Methods/email
 		email: function(value, element) {
 			// contributed by Scott Gonzalez: http://projects.scottsplayground.com/email_address_validation/
-			return this.optional(element) || /^((([a-z]|\d|[!#\$%&amp;'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&amp;'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(element.value);
+			return this.optional(element) || /^((([a-z]|\d|[!#\$%&amp;'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&amp;'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?$/i.test(value);
 		},
 	
 		// http://docs.jquery.com/Plugins/Validation/Methods/url
 		url: function(value, element) {
 			// contributed by Scott Gonzalez: http://projects.scottsplayground.com/iri/
-			return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&amp;'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&amp;'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&amp;'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&amp;'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&amp;'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(element.value);
+			return this.optional(element) || /^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&amp;'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&amp;'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&amp;'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&amp;'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&amp;'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(value);
 		},
         
 		// http://docs.jquery.com/Plugins/Validation/Methods/date
@@ -1053,19 +1048,24 @@ jQuery.extend(jQuery.validator, {
 		
 		// http://docs.jquery.com/Plugins/Validation/Methods/accept
 		accept: function(value, element, param) {
-			param = typeof param == &quot;string&quot; ? param : &quot;png|jpe?g|gif&quot;;
+			param = typeof param == &quot;string&quot; ? param.replace(/,/g, '|') : &quot;png|jpe?g|gif&quot;;
 			return this.optional(element) || value.match(new RegExp(&quot;.(&quot; + param + &quot;)$&quot;, &quot;i&quot;)); 
 		},
 		
 		// http://docs.jquery.com/Plugins/Validation/Methods/equalTo
 		equalTo: function(value, element, param) {
-			return value == jQuery(param).val();
+			return value == $(param).val();
 		}
 		
 	}
 	
 });
 
+// deprecated, use $.validator.format instead
+$.format = $.validator.format;
+
+})(jQuery);
+
 // ajax mode: abort
 // usage: $.ajax({ mode: &quot;abort&quot;[, port: &quot;uniqueport&quot;]});
 // if mode:&quot;abort&quot; is used, the previous request on that port (port can be undefined) is aborted via XMLHttpRequest.abort() 
@@ -1074,7 +1074,7 @@ jQuery.extend(jQuery.validator, {
 	var pendingRequests = {};
 	$.ajax = function(settings) {
 		// create settings for compatibility with ajaxSetup
-		settings = jQuery.extend(settings, jQuery.extend({}, jQuery.ajaxSettings, settings));
+		settings = $.extend(settings, $.extend({}, $.ajaxSettings, settings));
 		var port = settings.port;
 		if (settings.mode == &quot;abort&quot;) {
 			if ( pendingRequests[port] ) {
@@ -1090,7 +1090,7 @@ jQuery.extend(jQuery.validator, {
 // IE has native support, in other browsers, use event caputuring (neither bubbles)
 
 // provides delegate(type: String, delegate: Selector, handler: Callback) plugin for easier event delegation
-// handler is only called when $(event.target).is(delegate), in the scope of the jQuery-object for event.target 
+// handler is only called when $(event.target).is(delegate), in the scope of the jquery-object for event.target 
 
 // provides triggerEvent(type: String, target: Element) to trigger delegated events
 ;(function($) {
@@ -1125,7 +1125,7 @@ jQuery.extend(jQuery.validator, {
 			});
 		},
 		triggerEvent: function(type, target) {
-			return this.triggerHandler(type, [jQuery.event.fix({ type: type, target: target })]);
+			return this.triggerHandler(type, [$.event.fix({ type: type, target: target })]);
 		}
 	})
 })(jQuery);</diff>
      <filename>public/javascripts/jquery.validate.js</filename>
    </modified>
    <modified>
      <diff>@@ -3,3 +3,5 @@
 # To ban all spiders from the entire site uncomment the next two lines:
 # User-Agent: *
 # Disallow: /
+
+Sitemap: http://yourdomain.com/sitemap_index.xml.gz
\ No newline at end of file</diff>
      <filename>public/robots.txt</filename>
    </modified>
    <modified>
      <diff>@@ -1,57 +1 @@
-body {margin:0; padding:0; background:url('../images/background.png'); font-family:'Myriad Pro';}
-
-pre {background-color: #eee;padding: 10px;font-size: 11px; overflow: auto;}
-blockquote{font-style: italic; font-family:serif;}
-
-.left{float:left;}
-.right{float:right;}
-
-a { color: #1FA9FF; }
-
-h2{margin-top:0;}
-
-.fieldWithErrors {padding: 2px;background-color: red;display: table;}
-#errorExplanation {width: 400px;border: 2px solid red;padding: 7px;padding-bottom: 12px;margin-bottom: 20px;background-color: #f0f0f0;}
-#errorExplanation h2 {text-align: left;font-weight: bold;padding: 5px 5px 5px 15px;font-size: 12px;margin: -7px;background-color: #c00;color: #fff;}
-#errorExplanation p {color: #333;margin-bottom: 0;padding: 5px;}
-#errorExplanation ul li {font-size: 12px;list-style: square;}
-
-.pagination .disabled{display:none;}
-.ui-tabs-hide{display:none;}
-
-#header{position:absolute;}
-
-#main{width:660px; background:#fff; color:#000; margin:30px auto; padding:10px 20px;
-  -moz-border-radius: 5px;
-  -webkit-border-radius: 5px;
-  }
-.post{padding:10px 0 20px 0; }
-.post img{max-width:100%;}
-
-#new-post-tabs ul{margin:0; padding:0;}
-#new-post-tabs li{float:left; list-style:none;}
-#new-post-tabs a{display:block; padding:5px; text-decoration:none;}
-#new-post-tabs .ui-tabs-selected a{background:#eee;}
-#new-post-tabs div{clear:both; background:#eee; padding:10px;}
-#new-post-tabs textarea, #new-post-tabs input[type='text']{width:100%; margin:0; clear:both;}
-
-label.error{float:right; color:red;}
-
-#type_list{margin:0; padding:0;}
-#type_list li{float:right; list-style:none;}
-#title{float:left; margin:0; font-size:2.6em; color:#ccc;}
-#title a{color:#222; text-decoration:none; padding:0 2px;}
-
-.clear{clear:both;}
-
-.show-extra-fields{}
-.show-extra-fields.selected{background:red;}
-.extra-fields p{margin-top:0;}
-.form_submit{margin:0;}
-
-.code h2{margin-bottom:0;}
-.code .via{font-size:0.75em; margin:0; color:#aaa;}
-.code .via a{color:#888;}
-
-#footer{font-size:0.8em; color:#222;}
-#footer a{color:#aaa;}
\ No newline at end of file
+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{margin:0;padding:0;border:0;outline:0;font-size:100%;vertical-align:baseline;background:transparent}body{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}*:focus{outline:0}ins{text-decoration:none}del{text-decoration:line-through}table{border-collapse:collapse;border-spacing:0}html,body{height:100%;background:#fff;font:12px Arial, &quot;MS Trebuchet&quot;, sans-serif;-webkit-text-size-adjust:none}body{width:800px;margin:0 auto}a{color:#aaa}.ui-tabs-hide{display:none}textarea{height:70px}input,textarea{font:inherit}.blur{color:#aaa}.clearfix{display:inline-block}.clearfix:after{content:&quot;.&quot;;display:block;height:0;clear:both;visibility:hidden}pre{overflow:auto;background:#f5f5f5;border:1px solid #efefef;width:auto;padding:5px}label.error{position:absolute;margin-left:450px;width:auto;display:block;z-index:5000;background:#000;color:#fff;font-family:tahoma;font-size:0.8em;box-shadow:1px 1px 6px #000;-moz-box-shadow:1px 1px 6px #000;-webkit-box-shadow:1px 1px 6px #000;padding:4px 10px 4px 10px;border-radius:6px;-moz-border-radius:6px;-webkit-border-radius:6px;opacity:0.8}.meta{margin-top:5px;color:#aaa;font-size:0.95em}.meta a{color:#888;text-decoration:none}.meta a:hover{text-decoration:underline}h2{margin-bottom:7px;color:#111;font-weight:bold;font-size:1.2em}h2 a{color:inherit;text-decoration:none}h2 a:hover{color:#000 !important;text-decoration:underline}h2 a:visited{color:#111}.loading{margin:0 0 -3px 3px}#formatting{margin:10px 5px 10px 0;background:#f5f5f5;border:1px dashed #efefef;padding:5px 10px;display:none}#formatting span{display:block;float:left;width:200px;padding:0 0 5px}#formatting span pre{border:none;overflow:visible;padding:0}#formatting .more{clear:both;font-size:11px;padding-top:5px}#header{height:90px;padding:40px 0 0}#header h1 a{display:block;color:#000;font-size:3.0em;text-decoration:none}.field{margin-bottom:5px}.field input[type='text'],.field input[type='search'],.field input[type='password'],.field textarea{width:98%;margin:0;padding:2px 2px;border:1px solid #aaa;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px}#content{width:500px;float:left}#content ul,#content ol{margin:5px 0 0;padding:0 0 0 35px}#content ul li,#content ol li{list-style-type:disc;padding:0px 0px 5px}#content ol li{list-style-type:decimal}#content p{margin-bottom:10px;line-height:1.35em;text-align:justify}#content .flash{position:absolute;margin:-35px 0 10px;background:#F7FCDF;border:1px solid #EFFA9E;padding:5px;border-radius:2px;-moz-border-radius:2px;-webkit-border-radius:2px}#content .flash#error{background:#F3C0C1;border:1px solid #E5A7A9}#content #search{width:100%;margin-bottom:15px;border-bottom:1px solid #efefef}#content #search h2{display:inline}#content #search .meta{float:right;margin-bottom:5px}#content .open{position:absolute;top:0px;display:block;z-index:5000;background:#efefef;color:#000;font-family:tahoma;font-size:0.8em;box-shadow:0px 0px 2px #000;-moz-box-shadow:0px 0px 2px #000;-webkit-box-shadow:0px 0px 2px #000;padding:2px 10px 4px 10px;border-radius:6px;-moz-border-radius-bottomleft:6px;-webkit-border-bottom-left-radius:6px;-moz-border-radius-bottomright:6px;-webkit-border-bottom-right-radius:6px;text-decoration:none;margin-left:730px}#content form a.more{float:right;margin:0 5px 0 0}#content #new_post{display:none;width:100%;-webkit-box-shadow:0px 2px 5px #ccc;-moz-box-shadow:0px 2px 5px #ccc;box-shadow:0px 2px 5px #ccc;margin:0 0 30px;padding:0 0 5px}#content #new_post .close{background:url('../images/close.png') no-repeat;display:block;width:30px;height:30px;text-indent:-999px;position:absolute;margin:-10px 0 0 490px}#content #new_post ul{padding:0;height:25px}#content #new_post ul li{list-style:none;float:left;padding:2px 5px;margin:0 2px 0 0}#content #new_post ul li.ui-tabs-selected{background:#eee}#content #new_post .new_post{padding:0 10px}#content .new_comment{margin-top:15px}#content .new_comment .help{float:right;margin-right:5px}#content .post{margin:0 0 25px}#content .post .description{margin-top:5px}#content .post blockquote{margin-bottom:10px;font-style:italic}#content .post blockquote:before{content:'&#8220;'}#content .post blockquote:after{content:'&#8221;'}#content .post img,#content .post object,#content .post embed{width:100% !important}#content .post object,#content .post embed{height:340px !important}#content .post pre{overflow:auto;background:#f5f5f5;border:1px solid #efefef;padding:5px;font-size:0.95em}#content .post .meta .via{float:right}#content .post.preview{background:url('../images/preview.png')}.comment{border-top:1px solid #efefef;margin:10px 0;padding:10px 0 0 50px;overflow:hidden}.comment p,.comment pre{margin-bottom:10px;line-height:1.35em}.comment p{text-align:justify}.comment .photo{float:left;margin:3px 5px 0 -50px}input.youtube{background:url('../images/youtube.png') no-repeat 99.5% 50%}input.image{background:url('../images/image.png') no-repeat 99.5% 50%}.pagination{clear:both;padding:8px 0}.pagination .prev_page{float:left}.pagination .next_page{float:right}.pagination a,.pagination span{background:#ddd;color:#000;font-family:tahoma;font-size:0.9em;padding:7px 20px;border-radius:2px;-moz-border-radius:2px;-webkit-border-radius:2px;text-decoration:none}.pagination a:hover,.pagination a:active,.pagination span:hover,.pagination span:active{background:#ccc}.pagination a.disabled,.pagination span.disabled{display:none}#sidebar{margin-left:60px;width:240px;float:left}#sidebar #search_form .field{display:inline}#sidebar #search_form .field input{width:70%}#sidebar h3{border-bottom:1px solid #efefef;padding:0 0 2px;margin:20px 0 8px;font-size:13px;clear:both}#sidebar h3:first-child{margin-top:0}#sidebar p{text-align:justify;margin-bottom:12px}#sidebar #links{padding:5px 0 0}#sidebar #links li{background-repeat:no-repeat;margin:0px 0px 8px 15px;height:16px}#sidebar #links li a{display:inline-block;padding:0 0 5px 25px;color:#666}#sidebar #links li.flickr{background-image:url('../images/flickr.png')}#sidebar #links li.facebook{background-image:url('../images/facebook.png')}#sidebar #links li.lastfm{background-image:url('../images/lastfm.png')}#sidebar #links li.myspace{background-image:url('../images/myspace.png')}#sidebar #links li.twitter{background-image:url('../images/twitter.png')}#sidebar #links li.youtube{background-image:url('../images/youtube.png')}#sidebar #links li.work{background-image:url('../images/work.png')}#sidebar #links li.feed{background-image:url('../images/feed.png')}#sidebar #links li.email{background-image:url('../images/email.png')}#sidebar .album{position:relative;height:72px;margin-bottom:12px}#sidebar .album a{display:block;height:72px;padding-left:90px;float:left;position:relative;background:url('../images/cd.png') no-repeat;z-index:1;text-decoration:none;color:#000}#sidebar .album a strong{display:block}#sidebar .album a em{font-size:0.9em}#sidebar .album img{position:absolute;left:10px;top:2px;z-index:0}#footer{clear:both;color:#999;font-size:0.9em;text-align:right;padding:10px 0;margin-bottom:10px}#footer a{color:inherit}#footer .up{float:left;text-decoration:none;display:block}</diff>
      <filename>public/stylesheets/application.css</filename>
    </modified>
    <modified>
      <diff>@@ -1,3 +1,4 @@
 #!/usr/bin/env ruby
 require File.dirname(__FILE__) + '/../config/boot'
-require 'commands/about'
+$LOAD_PATH.unshift &quot;#{RAILTIES_PATH}/builtin/rails_info&quot;
+require 'commands/about'
\ No newline at end of file</diff>
      <filename>script/about</filename>
    </modified>
    <modified>
      <diff>@@ -1,45 +1,177 @@
-require 'test_helper'
+require File.dirname(__FILE__) + '/../test_helper'
 
 class CommentsControllerTest &lt; ActionController::TestCase
-  def test_should_get_index
-    get :index
-    assert_response :success
-    assert_not_nil assigns(:comments)
-  end
 
-  def test_should_get_new
-    get :new
-    assert_response :success
+  def setup
+    @comment = Factory.create(:comment)
   end
+  
+  should_route :get,    &quot;posts/1/comments&quot;,         :post_id =&gt; '1', :controller =&gt; :comments, :action =&gt; :index
+  should_route :get,    &quot;posts/1/comments/new&quot;,     :post_id =&gt; '1', :action =&gt; :new
+  should_route :post,   &quot;posts/1/comments&quot;,         :post_id =&gt; '1', :action =&gt; :create
+  should_route :get,    &quot;posts/1/comments/1&quot;,       :post_id =&gt; '1', :action =&gt; :show,    :id =&gt; '1'
+  should_route :get,    &quot;posts/1/comments/1/edit&quot;,  :post_id =&gt; '1', :action =&gt; :edit,    :id =&gt; '1'
+  should_route :put,    &quot;posts/1/comments/1&quot;,       :post_id =&gt; '1', :action =&gt; :update,  :id =&gt; '1'
+  should_route :delete, &quot;posts/1/comments/1&quot;,       :post_id =&gt; '1', :action =&gt; :destroy, :id =&gt; '1'
 
-  def test_should_create_comment
-    assert_difference('Comment.count') do
-      post :create, :comment =&gt; { }
+  context &quot;logged in&quot; do
+    setup do
+      activate_authlogic
+      UserSession.create(Factory.create(:user))
     end
 
-    assert_redirected_to comment_path(assigns(:comment))
-  end
+    context &quot;on GET to :show for first record&quot; do
+      setup do
+       get :show, :id =&gt; @comment.id, :post_id =&gt; @comment.post.id
+      end
 
-  def test_should_show_comment
-    get :show, :id =&gt; comments(:one).id
-    assert_response :success
-  end
+      should_redirect_to('the comments post') { post_url(@comment.post.to_param, :anchor =&gt; dom_id(@comment))}
+      should_not_set_the_flash
+    end
 
-  def test_should_get_edit
-    get :edit, :id =&gt; comments(:one).id
-    assert_response :success
-  end
+    context &quot;on GET to :new&quot; do
+      setup do
+        get :new, :post_id =&gt; @comment.post.id
+      end
+
+      should_assign_to :comment
+      should_respond_with :success
+      should_render_template :new
+      should_not_set_the_flash
+    end
+
+    context &quot;on GET to :index&quot; do
+      setup do
+       get :index, :post_id =&gt; @comment.post.to_param
+      end
+
+      should_redirect_to('the comments post') { post_url(@comment.post.to_param, :anchor =&gt; 'comments')}
+      should_not_set_the_flash
+    end
+
+    context &quot;on POST to :create&quot; do
+      setup do
+        @old_count = Comment.count
+        post :create, :comment =&gt; Factory.attributes_for(:comment), :post_id =&gt; @comment.post.id
+      end
+
+      should &quot;create a new comment&quot; do
+        assert_equal @old_count + 1, Comment.count
+      end
+
+      should_assign_to :comment
+      should_set_the_flash_to 'Create successful!'
+      should_redirect_to('the comments post') { post_url(@comment.post.to_param, :anchor =&gt; dom_id(assigns(:comment)))}
+    end
+
+    context &quot;on GET to :edit for first record&quot; do
+      setup do
+       get :edit, :id =&gt; @comment.id, :post_id =&gt; @comment.post.id
+      end
+
+      should_assign_to :comment
+      should_respond_with :success
+      should_render_template :edit
+      should_not_set_the_flash
+    end
+
+    context &quot;on PUT to :update&quot; do
+      setup do
+        put :update, :id =&gt; @comment.id, :post_id =&gt; @comment.post.id, :comment =&gt; {}
+      end
+
+      should_assign_to :comment
+      should_set_the_flash_to 'Save successful!'
+      should_redirect_to('the comments post') { post_url(@comment.post.to_param, :anchor =&gt; dom_id(@comment))}
+    end
+
+    context &quot;on DELETE to :destroy&quot; do
+      setup do
+        @old_count = Comment.count
+        delete :destroy, :id =&gt; @comment.id, :post_id =&gt; @comment.post.id
+      end
 
-  def test_should_update_comment
-    put :update, :id =&gt; comments(:one).id, :comment =&gt; { }
-    assert_redirected_to comment_path(assigns(:comment))
+      should &quot;destroy comment&quot; do
+        assert_equal @old_count - 1, Comment.count
+      end
+
+      should_set_the_flash_to 'Record deleted!'
+      should_redirect_to('the comments post') { post_url(@comment.post.to_param)}
+    end
   end
+  
+  context &quot;not logged in&quot; do
+    context &quot;on GET to :show for first record&quot; do
+      setup do
+       get :show, :id =&gt; @comment.id, :post_id =&gt; @comment.post.id
+      end
+
+      should_redirect_to('the comments post') { post_url(@comment.post.to_param, :anchor =&gt; dom_id(@comment))}
+      should_not_set_the_flash
+    end
+
+    context &quot;on GET to :new&quot; do
+      setup do
+        get :new, :post_id =&gt; @comment.post.id
+      end
 
-  def test_should_destroy_comment
-    assert_difference('Comment.count', -1) do
-      delete :destroy, :id =&gt; comments(:one).id
+      should_assign_to :comment
+      should_respond_with :success
+      should_render_template :new
+      should_not_set_the_flash
     end
 
-    assert_redirected_to comments_path
+    context &quot;on GET to :index&quot; do
+      setup do
+       get :index, :post_id =&gt; @comment.post.id
+      end
+
+      should_redirect_to('the comments post') { post_url(@comment.post.to_param, :anchor =&gt; 'comments')}
+      should_not_set_the_flash
+    end
+
+    context &quot;on POST to :create&quot; do
+      setup do
+        @old_count = Comment.count
+        post :create, :comment =&gt; Factory.attributes_for(:comment, :author_name =&gt; 'David', :author_email =&gt; 'dave@example.com'), :post_id =&gt; @comment.post.id
+      end
+
+      should &quot;create a new comment&quot; do
+        assert_equal @old_count + 1, Comment.count
+      end
+
+      should_assign_to :comment
+      should_set_the_flash_to 'Create successful!'
+      should_redirect_to('the comments post') { post_url(@comment.post.to_param, :anchor =&gt; dom_id(assigns(:comment)))}
+    end
+
+    context &quot;on GET to :edit for first record&quot; do
+      setup do
+       get :edit, :id =&gt; @comment.id, :post_id =&gt; @comment.post.id
+      end
+
+      should_be_denied_access
+    end
+
+    context &quot;on PUT to :update&quot; do
+      setup do
+        put :update, :id =&gt; @comment.id, :post_id =&gt; @comment.post.id, :comment =&gt; {}
+      end
+
+      should_be_denied_access
+    end
+
+    context &quot;on DELETE to :destroy&quot; do
+      setup do
+        @old_count = Comment.count
+        delete :destroy, :id =&gt; @comment.id, :post_id =&gt; @comment.post.id
+      end
+
+      should &quot;not destroy comment&quot; do
+        assert_equal @old_count, Comment.count
+      end
+
+      should_be_denied_access
+    end
   end
 end</diff>
      <filename>test/functional/comments_controller_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,45 +1,181 @@
-require 'test_helper'
+require File.dirname(__FILE__) + '/../test_helper'
 
 class PostsControllerTest &lt; ActionController::TestCase
-  def test_should_get_index
-    get :index
-    assert_response :success
-    assert_not_nil assigns(:posts)
-  end
 
-  def test_should_get_new
-    get :new
-    assert_response :success
+  def setup
+    @post = Factory.create(:blog)
   end
+  
+  should_route :get,    &quot;/posts&quot;,              :controller =&gt; :posts, :action =&gt; :index
+  should_route :get,    &quot;/posts/new&quot;,          :action =&gt; :new
+  should_route :post,   &quot;/posts&quot;,              :action =&gt; :create
+  should_route :get,    &quot;/posts/1&quot;,       :action =&gt; :show,    :id =&gt; '1'
+  should_route :get,    &quot;/posts/1/edit&quot;,  :action =&gt; :edit,    :id =&gt; '1'
+  should_route :put,    &quot;/posts/1&quot;,       :action =&gt; :update,  :id =&gt; '1'
+  should_route :delete, &quot;/posts/1&quot;,       :action =&gt; :destroy, :id =&gt; '1'
+
+  context &quot;not logged in&quot; do
+    
+    context &quot;on GET to :show for first record&quot; do
+      setup do
+       get :show, :id =&gt; @post.id
+      end
 
-  def test_should_create_post
-    assert_difference('Post.count') do
-      post :create, :post =&gt; { }
+      should_assign_to :post
+      should_respond_with :success
+      should_render_template :show
+      should_not_set_the_flash
     end
 
-    assert_redirected_to post_path(assigns(:post))
-  end
+    context &quot;on GET to :new&quot; do
+      setup do
+        get :new
+      end
 
-  def test_should_show_post
-    get :show, :id =&gt; posts(:one).id
-    assert_response :success
-  end
+      should_be_denied_access
+    end
 
-  def test_should_get_edit
-    get :edit, :id =&gt; posts(:one).id
-    assert_response :success
-  end
+    context &quot;on GET to :index&quot; do
+      setup do
+        get :index
+      end
+
+      should_assign_to :posts
+      should_respond_with :success
+      should_render_template :index
+      should_not_set_the_flash
+    end
+
+    context &quot;on POST to :create&quot; do
+      setup do
+        @old_count = Post.count
+        post :create, :post =&gt; Factory.attributes_for(:blog, :title =&gt; 'Testing')
+      end
+
+      should &quot;not create a new post&quot; do
+        assert_equal @old_count, Post.count
+      end
+
+      should_be_denied_access
+    end
+
+    context &quot;on GET to :edit for first record&quot; do
+      setup do
+       get :edit, :id =&gt; @post.id
+      end
+
+      should_be_denied_access
+    end
+
+    context &quot;on PUT to :update&quot; do
+      setup do
+        put :update, :id =&gt; @post.id, :post =&gt; Factory.attributes_for(:blog, :title =&gt; 'Testing')
+      end
 
-  def test_should_update_post
-    put :update, :id =&gt; posts(:one).id, :post =&gt; { }
-    assert_redirected_to post_path(assigns(:post))
+      should_be_denied_access
+    end
+
+    context &quot;on DELETE to :destroy&quot; do
+      setup do
+        @old_count = Post.count
+        delete :destroy, :id =&gt; @post.id
+      end
+
+      should &quot;not destroy post&quot; do
+        assert_equal @old_count, Post.count
+      end
+
+      should_be_denied_access
+    end
   end
 
-  def test_should_destroy_post
-    assert_difference('Post.count', -1) do
-      delete :destroy, :id =&gt; posts(:one).id
+  context &quot;logged in&quot; do
+    setup do
+      activate_authlogic
+      UserSession.create(Factory.create(:user))
     end
 
-    assert_redirected_to posts_path
+    context &quot;on GET to :show for first record&quot; do
+      setup do
+       get :show, :id =&gt; @post.id
+      end
+
+      should_assign_to :post
+      should_respond_with :success
+      should_render_template :show
+      should_not_set_the_flash
+    end
+
+    context &quot;on GET to :new&quot; do
+      setup do
+        get :new
+      end
+
+      should_assign_to :post
+      should_respond_with :success
+      should_render_template :new
+      should_not_set_the_flash
+    end
+
+    context &quot;on GET to :index&quot; do
+      setup do
+        get :index
+      end
+
+      should_assign_to :posts
+      should_respond_with :success
+      should_render_template :index
+      should_not_set_the_flash
+    end
+
+    context &quot;on POST to :create&quot; do
+      setup do
+        @old_count = Post.count
+        post :create, :blog =&gt; Factory.attributes_for(:blog, :title =&gt; 'Testing')
+      end
+
+      should &quot;create a new post&quot; do
+        assert_equal @old_count + 1, Post.count
+      end
+
+      should_assign_to :post
+      should_set_the_flash_to 'Create successful!'
+      should_redirect_to('the created post') { post_url('testing')}
+    end
+
+    context &quot;on GET to :edit for first record&quot; do
+      setup do
+       get :edit, :id =&gt; @post.id
+      end
+
+      should_assign_to :post
+      should_respond_with :success
+      should_render_template :edit
+      should_not_set_the_flash
+    end
+
+    context &quot;on PUT to :update&quot; do
+      setup do
+        put :update, :id =&gt; @post.id, :post =&gt; {}
+      end
+
+      should_assign_to :post
+      should_set_the_flash_to 'Save successful!'
+      should_redirect_to('the updated post') { post_url(@post)}
+    end
+
+    context &quot;on DELETE to :destroy&quot; do
+      setup do
+        @old_count = Post.count
+        delete :destroy, :id =&gt; @post.id
+      end
+
+      should &quot;destroy post&quot; do
+        assert_equal @old_count - 1, Post.count
+      end
+
+      should_set_the_flash_to 'Record deleted!'
+      should_redirect_to('list of posts') { posts_url }
+    end
   end
 end</diff>
      <filename>test/functional/posts_controller_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,9 @@
 ENV[&quot;RAILS_ENV&quot;] = &quot;test&quot;
 require File.expand_path(File.dirname(__FILE__) + &quot;/../config/environment&quot;)
 require 'test_help'
+require &quot;authlogic/test_case&quot;
 
-class Test::Unit::TestCase
+class ActiveSupport::TestCase
   # Transactional fixtures accelerate your tests by wrapping each test method
   # in a transaction that's rolled back on completion.  This ensures that the
   # test database remains unchanged so your fixtures don't have to be reloaded
@@ -35,4 +36,78 @@ class Test::Unit::TestCase
   fixtures :all
 
   # Add more helper methods to be used by all tests here...
+  def self.should_have_timestamps
+    should_have_db_columns :created_at, :updated_at, :type =&gt; :datetime
+  end
+
+  def self.should_accept_nested_attributes_for(*attr_names)
+    klass = self.name.gsub(/Test$/, '').constantize
+
+    context &quot;#{klass}&quot; do
+      attr_names.each do |association_name|
+        should &quot;accept nested attrs for #{association_name}&quot; do
+          meth = &quot;#{association_name}_attributes=&quot;
+          assert  ([meth,meth.to_sym].any?{ |m| klass.instance_methods.include?(m) }),
+                  &quot;#{klass} does not accept nested attributes for #{association_name}&quot;
+        end
+      end
+    end
+  end
+
+  def self.should_have_attached_file(attachment)
+    klass = self.name.gsub(/Test$/, '').constantize
+
+    context &quot;To support a paperclip attachment named #{attachment}, #{klass}&quot; do
+      should_have_db_column(&quot;#{attachment}_file_name&quot;,    :type =&gt; :string)
+      should_have_db_column(&quot;#{attachment}_content_type&quot;, :type =&gt; :string)
+      should_have_db_column(&quot;#{attachment}_file_size&quot;,    :type =&gt; :integer)
+    end
+
+    should &quot;have a paperclip attachment named ##{attachment}&quot; do
+      assert klass.new.respond_to?(attachment.to_sym), &quot;@#{klass.name.underscore} doesn't have a paperclip field named #{attachment}&quot;
+      assert_equal Paperclip::Attachment, klass.new.send(attachment.to_sym).class
+    end
+  end
+
+  def self.should_be_paranoid
+    klass = model_class
+    should_have_db_column :deleted_at
+
+    should &quot;be paranoid (it will not be deleted from the database)&quot; do
+      # Removed so that it tests the model has declared is_paranoid
+      # assert klass.is_paranoid
+      assert klass.included_modules.include?(IsParanoid::InstanceMethods)
+    end
+
+    should &quot;not have a value for deleted_at&quot; do
+      assert object = klass.find(:first)
+      assert_nil object.deleted_at
+    end
+
+    context &quot;when destroyed&quot; do
+      setup do
+        assert object = klass.find(:first), &quot;This context requires there to be an existing #{klass}&quot;
+        @deleted_id = object.id
+        object.destroy
+      end
+
+      should &quot;not be found&quot; do
+        assert_raise(ActiveRecord::RecordNotFound) { klass.find(@deleted_id) }
+      end
+
+      should &quot;still exist in the database&quot; do
+        deleted_object = klass.find_with_destroyed(@deleted_id)
+        assert_not_nil deleted_object.deleted_at
+      end
+    end
+  end
+
+  def self.should_be_denied_access(message = 'You must be logged in to do that!')
+    should_set_the_flash_to message
+    should_redirect_to('the login page') { login_url}
+  end
+
+  def dom_id(object)
+    &quot;#{object.class.to_s.downcase}_#{object.id}&quot;
+  end
 end</diff>
      <filename>test/test_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,18 @@
-require 'test_helper'
+require File.expand_path(File.dirname(__FILE__) + &quot;/../test_helper.rb&quot;)
 
 class CommentTest &lt; ActiveSupport::TestCase
-  # Replace this with your real tests.
-  def test_truth
-    assert true
+
+  should_have_db_columns :body, :type =&gt; :text
+  should_have_db_column  :user_id, :post_id, :type =&gt; :integer
+  should_have_timestamps
+
+  context &quot;a comment&quot; do
+    setup do
+      @comment = Factory.create(:comment)
+    end
+
+    should_be_paranoid
+    should_validate_presence_of :body
+    should_belong_to :user
   end
-end
+end
\ No newline at end of file</diff>
      <filename>test/unit/comment_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,8 +1,18 @@
-require 'test_helper'
+require File.expand_path(File.dirname(__FILE__) + &quot;/../test_helper.rb&quot;)
 
 class PostTest &lt; ActiveSupport::TestCase
-  # Replace this with your real tests.
-  def test_truth
-    assert true
+
+  should_have_db_columns :title, :permalink, :type =&gt; :string
+  should_have_db_column  :user_id, :type =&gt; :integer
+  should_have_timestamps
+
+  context &quot;a post&quot; do
+    setup do
+      @post = Factory.create(:post)
+    end
+
+    should_be_paranoid
+    should_validate_presence_of :user
+    should_belong_to :user
   end
-end
+end
\ No newline at end of file</diff>
      <filename>test/unit/post_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,109 +1,37 @@
-require File.dirname(__FILE__) + '/../test_helper'
+require File.expand_path(File.dirname(__FILE__) + &quot;/../test_helper.rb&quot;)
 
-class UserTest &lt; Test::Unit::TestCase
-  # Be sure to include AuthenticatedTestHelper in test/test_helper.rb instead.
-  # Then, you can remove it from this and the functional test.
-  include AuthenticatedTestHelper
-  fixtures :users
+class UserTest &lt; ActiveSupport::TestCase
+  should_have_db_column :email, :crypted_password, :password_salt, :persistence_token, :type =&gt; :string, :null =&gt; false
+  should_have_db_column :current_login_ip, :last_login_ip, :first_name, :last_name, :type =&gt; :string
+  should_have_db_column :perishable_token, :type =&gt; :string
 
-  def test_should_create_user
-    assert_difference 'User.count' do
-      user = create_user
-      assert !user.new_record?, &quot;#{user.errors.full_messages.to_sentence}&quot;
-    end
-  end
+  should_have_db_columns :login_count, :failed_login_count, :type =&gt; :integer, :default =&gt; 0
 
-  def test_should_initialize_activation_code_upon_creation
-    user = create_user
-    user.reload
-    assert_not_nil user.activation_code
-  end
+  should_have_db_columns :last_request_at, :current_login_at, :last_login_at, :activated_at, :type =&gt; :datetime
+  should_have_timestamps
 
-  def test_should_require_login
-    assert_no_difference 'User.count' do
-      u = create_user(:login =&gt; nil)
-      assert u.errors.on(:login)
+  context &quot;a user&quot; do
+    setup do
+      @user = Factory.create(:user)
     end
-  end
 
-  def test_should_require_password
-    assert_no_difference 'User.count' do
-      u = create_user(:password =&gt; nil)
-      assert u.errors.on(:password)
-    end
-  end
+    should_be_paranoid
+    should_validate_presence_of :first_name
 
-  def test_should_require_password_confirmation
-    assert_no_difference 'User.count' do
-      u = create_user(:password_confirmation =&gt; nil)
-      assert u.errors.on(:password_confirmation)
+    should &quot;update activated_at when activated&quot; do
+      @user.activate!
+      assert @user.activated_at
     end
   end
-
-  def test_should_require_email
-    assert_no_difference 'User.count' do
-      u = create_user(:email =&gt; nil)
-      assert u.errors.on(:email)
+  
+  context &quot;a new user&quot; do
+    setup do
+      @user = Factory.create(:user)
     end
-  end
-
-  def test_should_reset_password
-    users(:quentin).update_attributes(:password =&gt; 'new password', :password_confirmation =&gt; 'new password')
-    assert_equal users(:quentin), User.authenticate('quentin', 'new password')
-  end
 
-  def test_should_not_rehash_password
-    users(:quentin).update_attributes(:login =&gt; 'quentin2')
-    assert_equal users(:quentin), User.authenticate('quentin2', 'test')
-  end
-
-  def test_should_authenticate_user
-    assert_equal users(:quentin), User.authenticate('quentin', 'test')
-  end
-
-  def test_should_set_remember_token
-    users(:quentin).remember_me
-    assert_not_nil users(:quentin).remember_token
-    assert_not_nil users(:quentin).remember_token_expires_at
-  end
-
-  def test_should_unset_remember_token
-    users(:quentin).remember_me
-    assert_not_nil users(:quentin).remember_token
-    users(:quentin).forget_me
-    assert_nil users(:quentin).remember_token
-  end
-
-  def test_should_remember_me_for_one_week
-    before = 1.week.from_now.utc
-    users(:quentin).remember_me_for 1.week
-    after = 1.week.from_now.utc
-    assert_not_nil users(:quentin).remember_token
-    assert_not_nil users(:quentin).remember_token_expires_at
-    assert users(:quentin).remember_token_expires_at.between?(before, after)
-  end
-
-  def test_should_remember_me_until_one_week
-    time = 1.week.from_now.utc
-    users(:quentin).remember_me_until time
-    assert_not_nil users(:quentin).remember_token
-    assert_not_nil users(:quentin).remember_token_expires_at
-    assert_equal users(:quentin).remember_token_expires_at, time
-  end
-
-  def test_should_remember_me_default_two_weeks
-    before = 2.weeks.from_now.utc
-    users(:quentin).remember_me
-    after = 2.weeks.from_now.utc
-    assert_not_nil users(:quentin).remember_token
-    assert_not_nil users(:quentin).remember_token_expires_at
-    assert users(:quentin).remember_token_expires_at.between?(before, after)
-  end
-
-protected
-  def create_user(options = {})
-    record = User.new({ :login =&gt; 'quire', :email =&gt; 'quire@example.com', :password =&gt; 'quire', :password_confirmation =&gt; 'quire' }.merge(options))
-    record.save
-    record
+    should &quot;not be activated&quot; do
+      assert_equal @user.activated_at, nil
+    end
   end
-end
+  
+end
\ No newline at end of file</diff>
      <filename>test/unit/user_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,32 +1,33 @@
 begin
-  require 'iconv'
-rescue Object
-  puts &quot;no iconv, you might want to look into it.&quot;
+  require &quot;active_support&quot;
+rescue LoadError
+  require &quot;rubygems&quot;
+  require &quot;active_support&quot;
 end
 
-require 'digest/sha1'
 module PermalinkFu
-  class &lt;&lt; self
-    attr_accessor :translation_to
-    attr_accessor :translation_from
-    
-    def escape(str)
-      s = ((translation_to &amp;&amp; translation_from) ? Iconv.iconv(translation_to, translation_from, str) : str).to_s
-      s.gsub!(/\W+/, ' ') # all non-word chars to spaces
-      s.strip!            # ohh la la
-      s.downcase!         #
-      s.gsub!(/\ +/, '-') # spaces to dashes, preferred separator char everywhere
-      s
+
+  def self.escape(str)
+    if defined?(ActiveSupport::Multibyte::Chars)
+      s = str.mb_chars.normalize(:kd)
+    else
+      begin
+        s = ActiveSupport::Multibyte::Handlers::UTF8Handler.normalize(str.to_s, :kd)
+      rescue ActiveSupport::Multibyte::Handlers::EncodingError
+        require 'iconv'
+        s = Iconv.iconv('ascii//translit//IGNORE', 'utf-8', str).first.to_s
+      end
     end
+
+    s.gsub!(/[^\w -]+/n, '')  # strip unwanted characters
+    s.strip! # ohh la la
+    s.downcase!
+    s.gsub!(/[ -]+/, '-')  # separate by single dashes
+    s
   end
   
   def self.included(base)
     base.extend ClassMethods
-    class &lt;&lt; base
-      cattr_accessor :permalink_options
-      cattr_accessor :permalink_attributes
-      cattr_accessor :permalink_field
-    end
   end
   
   module ClassMethods
@@ -42,52 +43,96 @@ module PermalinkFu
     #     has_permalink [:category, :title]
     #   
     #     # stores permalink form of #title to the #category_permalink attribute
-    #     has_permalink [:category, :title], :category_permalink
+    #     has_permalink [:category, :title], :as =&gt; :category_permalink
     #
     #     # add a scope
     #     has_permalink :title, :scope =&gt; :blog_id
     #
     #     # add a scope and specify the permalink field name
-    #     has_permalink :title, :slug, :scope =&gt; :blog_id
+    #     has_permalink :title, :as =&gt; :slug, :scope =&gt; :blog_id
     #   end
     #
-    def has_permalink(attr_names = [], permalink_field = nil, options = {})
-      if permalink_field.is_a?(Hash)
-        options = permalink_field
-        permalink_field = nil
+    def has_permalink(*args)
+      options = args.extract_options!
+      attr_names = args.first || :to_s
+      write_inheritable_attribute(:permalink_attributes,  Array(attr_names))
+      write_inheritable_attribute(:permalink_field,       (options.delete(:as) || 'permalink').to_s)
+      write_inheritable_attribute(:permalink_options,     options)
+
+      %w{permalink_attributes permalink_field permalink_options}.each do |v|
+        class_inheritable_reader(v.to_sym)
       end
-      self.permalink_attributes = Array(attr_names)
-      self.permalink_field      = (permalink_field || 'permalink').to_s
-      self.permalink_options    = options
+
       before_validation :create_unique_permalink
       evaluate_attribute_method permalink_field, &quot;def #{self.permalink_field}=(new_value);write_attribute(:#{self.permalink_field}, PermalinkFu.escape(new_value));end&quot;, &quot;#{self.permalink_field}=&quot;
+      extend  PermalinkFinders
+
+      case options[:param]
+      when false
+        # nothing
+      when :permalink
+        include ToParam
+      else
+        include ToParamWithID
+      end
+    end
+  end
+  
+  module ToParam
+    def to_param
+      send(self.class.read_inheritable_attribute(:permalink_field))
+    end
+  end
+  
+  module ToParamWithID
+    def to_param
+      permalink = send(self.class.read_inheritable_attribute(:permalink_field))
+      return super if new_record? || permalink.blank?
+      &quot;#{id}-#{permalink}&quot;
+    end
+  end
+  
+  module PermalinkFinders
+    def find_by_permalink(value)
+      find(:first, :conditions =&gt; { permalink_field =&gt; value  })
+    end
+    
+    def find_by_permalink!(value)
+      find_by_permalink(value) ||
+      raise(ActiveRecord::RecordNotFound, &quot;Couldn't find #{name} with permalink #{value.inspect}&quot;)
     end
   end
   
 protected
   def create_unique_permalink
     return unless should_create_permalink?
-    if send(self.class.permalink_field).to_s.empty?
-      send(&quot;#{self.class.permalink_field}=&quot;, create_permalink_for(self.class.permalink_attributes))
+    if send(self.class.read_inheritable_attribute(:permalink_field)).to_s.empty?
+      send(&quot;#{self.class.read_inheritable_attribute(:permalink_field)}=&quot;, create_permalink_for(self.class.read_inheritable_attribute(:permalink_attributes)))
     end
-    limit   = self.class.columns_hash[self.class.permalink_field].limit
-    base    = send(&quot;#{self.class.permalink_field}=&quot;, send(self.class.permalink_field)[0..limit - 1])
+    
+    limit   = self.class.columns_hash[self.class.read_inheritable_attribute(:permalink_field)].limit
+    base    = send(&quot;#{self.class.read_inheritable_attribute(:permalink_field)}=&quot;, 
+                   send(self.class.read_inheritable_attribute(:permalink_field))[0..limit - 1])
+    
+    return unless self.class.read_inheritable_attribute(:permalink_options)[:param]
+
     counter = 1
     # oh how i wish i could use a hash for conditions
-    conditions = [&quot;#{self.class.permalink_field} = ?&quot;, base]
+    conditions = [&quot;#{self.class.read_inheritable_attribute(:permalink_field)} = ?&quot;, base]
     unless new_record?
       conditions.first &lt;&lt; &quot; and id != ?&quot;
       conditions       &lt;&lt; id
     end
-    if self.class.permalink_options[:scope]
-      conditions.first &lt;&lt; &quot; and #{self.class.permalink_options[:scope]} = ?&quot;
-      conditions       &lt;&lt; send(self.class.permalink_options[:scope])
+    if self.class.read_inheritable_attribute(:permalink_options)[:scope]
+      conditions.first &lt;&lt; &quot; and #{self.class.read_inheritable_attribute(:permalink_options)[:scope]} = ?&quot;
+      conditions       &lt;&lt; send(self.class.read_inheritable_attribute(:permalink_options)[:scope])
     end
     while self.class.exists?(conditions)
       suffix = &quot;-#{counter += 1}&quot;
       conditions[1] = &quot;#{base[0..limit-suffix.size-1]}#{suffix}&quot;
-      send(&quot;#{self.class.permalink_field}=&quot;, conditions[1])
+      send(&quot;#{self.class.read_inheritable_attribute(:permalink_field)}=&quot;, conditions[1])
     end
+    send(&quot;#{self.class.read_inheritable_attribute(:permalink_field)}&quot;)
   end
 
   def create_permalink_for(attr_names)
@@ -96,10 +141,10 @@ protected
 
 private
   def should_create_permalink?
-    if self.class.permalink_options[:if]
-      evaluate_method(self.class.permalink_options[:if])
-    elsif self.class.permalink_options[:unless]
-      !evaluate_method(self.class.permalink_options[:unless])
+    if self.class.read_inheritable_attribute(:permalink_options)[:if]
+      evaluate_method(self.class.read_inheritable_attribute(:permalink_options)[:if])
+    elsif self.class.read_inheritable_attribute(:permalink_options)[:unless]
+      !evaluate_method(self.class.read_inheritable_attribute(:permalink_options)[:unless])
     else
       true
     end
@@ -116,8 +161,3 @@ private
     end
   end
 end
-
-if Object.const_defined?(:Iconv)
-  PermalinkFu.translation_to   = 'ascii//translit//IGNORE'
-  PermalinkFu.translation_from = 'utf-8'
-end
\ No newline at end of file</diff>
      <filename>vendor/plugins/permalink_fu/lib/permalink_fu.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,12 +1,18 @@
 require 'test/unit'
 require File.join(File.dirname(__FILE__), '../lib/permalink_fu')
+require 'active_support/core_ext/class'
 
 class FauxColumn &lt; Struct.new(:limit)
 end
 
+module ActiveRecord
+  class ActiveRecordError &lt; StandardError; end
+  class RecordNotFound &lt; ActiveRecordError; end
+end
+
 class BaseModel
   def self.columns_hash
-    @columns_hash ||= {'permalink' =&gt; FauxColumn.new(100)}
+    @columns_hash ||= {'permalink' =&gt; FauxColumn.new(100), 'slug' =&gt; FauxColumn.new(100)}
   end
 
   include PermalinkFu
@@ -16,9 +22,7 @@ class BaseModel
   attr_reader   :permalink
   attr_accessor :foo
 
-  class &lt;&lt; self
-    attr_accessor :validation
-  end
+  cattr_accessor :validation
   
   def self.generated_methods
     @generated_methods ||= []
@@ -58,6 +62,10 @@ class BaseModel
   def self.before_validation(method)
     self.validation = method
   end
+  
+  def self.find(*args)
+    nil
+  end
 
   def validate
     send self.class.validation
@@ -68,6 +76,10 @@ class BaseModel
     @id.nil?
   end
   
+  def to_param
+    @id
+  end
+  
   def write_attribute(key, value)
     instance_variable_set &quot;@#{key}&quot;, value
   end
@@ -86,6 +98,19 @@ class MockModel &lt; BaseModel
   has_permalink :title
 end
 
+class MockModelUnique &lt; BaseModel
+  def self.exists?(conditions)
+    if conditions[1] == 'foo'   || conditions[1] == 'bar' || 
+      (conditions[1] == 'bar-2' &amp;&amp; conditions[2] != 2)
+      true
+    else
+      false
+    end
+  end
+
+  has_permalink :title, :param =&gt; :permalink
+end
+
 class ScopedModel &lt; BaseModel
   def self.exists?(conditions)
     if conditions[1] == 'foo' &amp;&amp; conditions[2] != 5
@@ -95,7 +120,20 @@ class ScopedModel &lt; BaseModel
     end
   end
 
-  has_permalink :title, :scope =&gt; :foo
+  has_permalink :title, :scope =&gt; :foo, :param =&gt; :permalink
+end
+
+class AsModel &lt; BaseModel
+  attr_reader   :slug
+  has_permalink :title, :as =&gt; :slug
+end
+
+class OverrideParamModel &lt; BaseModel
+  has_permalink :title, :param =&gt; :permalink
+end
+
+class NoParamModel &lt; BaseModel
+  has_permalink :title, :param =&gt; false
 end
 
 class IfProcConditionModel &lt; BaseModel
@@ -130,12 +168,44 @@ class MockModelExtra &lt; BaseModel
   has_permalink [:title, :extra]
 end
 
+class ToSModel &lt; BaseModel
+  has_permalink
+
+  def to_s
+    @title.to_s
+  end
+end
+
+class OptionsWithoutAttrsModel &lt; BaseModel
+  has_permalink :param =&gt; false
+
+  def to_s
+    @title.to_s
+  end
+end
+
+class ParentModel &lt; BaseModel
+  has_permalink :title
+end
+
+class ChildModel &lt; ParentModel
+end
+
+class ChildModelOverriding &lt; ParentModel
+  has_permalink
+
+  def to_s
+    'overriding'
+  end
+end
+
 class PermalinkFuTest &lt; Test::Unit::TestCase
   @@samples = {
-    'This IS a Tripped out title!!.!1  (well/ not really)' =&gt; 'this-is-a-tripped-out-title-1-well-not-really',
+    'This IS a Tripped out title!!.!1  (well/ not really)' =&gt; 'this-is-a-tripped-out-title1-well-not-really',
     '////// meph1sto r0x ! \\\\\\' =&gt; 'meph1sto-r0x',
-    '&#257;&#269;&#275;&#291;&#299;&#311;&#316;&#326;&#363;' =&gt; 'acegiklnu',
-    '&#20013;&#25991;&#28204;&#35430; chinese text' =&gt; 'chinese-text'
+    '&#257;&#269;&#275;&#291;&#299;&#311;&#316;&#326;&#363;&#246;' =&gt; 'acegiklnuo',
+    '&#20013;&#25991;&#28204;&#35430; chinese text' =&gt; 'chinese-text',
+    &quot;use what you\222ve got&quot; =&gt; 'use-what-youve-got'
   }
 
   @@extra = { 'some-)()()-ExtRa!/// .data==?&gt;    to \/\/test' =&gt; 'some-extra-data-to-test' }
@@ -164,10 +234,19 @@ class PermalinkFuTest &lt; Test::Unit::TestCase
     end
   end
   
-  def test_should_create_unique_permalink
+  def test_should_create_unique_permalink_only_when_param_equals_permalink
     @m = MockModel.new
     @m.permalink = 'foo'
     @m.validate
+    assert_equal 'foo', @m.permalink
+    
+    @m.permalink = 'bar'
+    @m.validate
+    assert_equal 'bar', @m.permalink
+    
+    @m = MockModelUnique.new
+    @m.permalink = 'foo'
+    @m.validate
     assert_equal 'foo-2', @m.permalink
     
     @m.permalink = 'bar'
@@ -176,7 +255,7 @@ class PermalinkFuTest &lt; Test::Unit::TestCase
   end
   
   def test_should_not_check_itself_for_unique_permalink
-    @m = MockModel.new
+    @m = MockModelUnique.new
     @m.id = 2
     @m.permalink = 'bar-2'
     @m.validate
@@ -206,13 +285,29 @@ class PermalinkFuTest &lt; Test::Unit::TestCase
   end
   
   def test_should_limit_unique_permalink
-    @old = MockModel.columns_hash['permalink'].limit
-    MockModel.columns_hash['permalink'].limit = 3
-    @m   = MockModel.new
+    @old = MockModelUnique.columns_hash['permalink'].limit
+    MockModelUnique.columns_hash['permalink'].limit = 3
+    @m   = MockModelUnique.new
     @m.title = 'foo'
     assert_equal 'f-2', @m.validate
   ensure
-    MockModel.columns_hash['permalink'].limit = @old
+    MockModelUnique.columns_hash['permalink'].limit = @old
+  end
+  
+  def test_should_use_custom_field
+    @m = AsModel.new
+    @m.title = 'stick this in &quot;slug&quot;'
+    @m.validate
+    assert_nil @m.permalink
+    assert_not_nil @m.slug
+  end
+  
+  def test_find_by_permalink
+    assert_nil AsModel.find_by_permalink(&quot;permalink&quot;)
+  end
+  
+  def test_find_by_permalink!
+    assert_raises(ActiveRecord::RecordNotFound) { AsModel.find_by_permalink!(&quot;permalink&quot;) }
   end
   
   def test_should_abide_by_if_proc_condition
@@ -256,4 +351,55 @@ class PermalinkFuTest &lt; Test::Unit::TestCase
     @m.validate
     assert_not_nil @m.permalink
   end
+  
+  def test_should_optionally_override_to_param
+    @m = OverrideParamModel.new
+    @m.permalink = 'My Param'
+    @m.validate
+    assert_equal 'my-param', @m.to_param
+    
+    @m = NoParamModel.new
+    @m.permalink = 'My Param'
+    @m.validate
+    assert_not_equal 'my-param', @m.to_param
+  end
+  
+  def test_should_override_to_param_by_default
+    @m = MockModel.new
+    @m.permalink = 'My Param'
+    @m.id = 1
+    @m.validate
+    assert_equal '1-my-param', @m.to_param
+    
+    @m = MockModel.new
+    @m.permalink = ''
+    @m.id = 1
+    @m.validate
+    assert_equal 1, @m.to_param
+  end
+
+  def test_should_rely_on_to_s_if_no_attr_given
+    @m = ToSModel.new
+    @m.title = 'Will rely on to_s'
+    @m.validate
+    assert_equal 'will-rely-on-to_s', @m.permalink
+    
+    @m = OptionsWithoutAttrsModel.new
+    @m.title = 'Will rely on to_s'
+    @m.validate
+    assert_equal 'will-rely-on-to_s', @m.permalink
+  end
+
+  def test_should_work_with_sti
+    @m = ChildModel.new
+    @m.title = 'This is a child'
+    @m.validate
+    assert_equal 'this-is-a-child', @m.permalink
+    
+    @m = ChildModelOverriding.new
+    @m.title = 'This is a child'
+    @m.validate
+    assert_equal 'overriding', @m.permalink
+  end
+
 end</diff>
      <filename>vendor/plugins/permalink_fu/test/permalink_fu_test.rb</filename>
    </modified>
  </modified>
  <removed type="array">
    <removed>
      <filename>TODO</filename>
    </removed>
    <removed>
      <filename>app/controllers/application.rb</filename>
    </removed>
    <removed>
      <filename>app/controllers/sessions_controller.rb</filename>
    </removed>
    <removed>
      <filename>app/models/blog.rb</filename>
    </removed>
    <removed>
      <filename>app/models/code.rb</filename>
    </removed>
    <removed>
      <filename>app/models/image.rb</filename>
    </removed>
    <removed>
      <filename>app/models/link.rb</filename>
    </removed>
    <removed>
      <filename>app/models/quote.rb</filename>
    </removed>
    <removed>
      <filename>app/models/user_mailer.rb</filename>
    </removed>
    <removed>
      <filename>app/models/user_observer.rb</filename>
    </removed>
    <removed>
      <filename>app/models/video.rb</filename>
    </removed>
    <removed>
      <filename>app/views/blogs/_blog.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/blogs/_form.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/codes/_code.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/codes/_form.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/comments/_comment.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/comments/_form.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/comments/create.js.erb</filename>
    </removed>
    <removed>
      <filename>app/views/comments/edit.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/comments/new.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/images/_form.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/images/_image.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/layouts/application.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/links/_form.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/links/_link.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/posts/_form.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/posts/_posts.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/posts/edit.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/posts/index.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/posts/new.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/posts/show.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/quotes/_form.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/quotes/_quote.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/sessions/new.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/user_mailer/activation.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/user_mailer/signup_notification.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/users/_form.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/users/new.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/users/show.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/videos/_form.html.erb</filename>
    </removed>
    <removed>
      <filename>app/views/videos/_video.html.erb</filename>
    </removed>
    <removed>
      <filename>db/migrate/20080616210130_create_posts.rb</filename>
    </removed>
    <removed>
      <filename>db/migrate/20080616210330_create_comments.rb</filename>
    </removed>
    <removed>
      <filename>db/migrate/20080618215418_create_users.rb</filename>
    </removed>
    <removed>
      <filename>db/migrate/20080618224722_add_details_to_posts.rb</filename>
    </removed>
    <removed>
      <filename>lib/authenticated_system.rb</filename>
    </removed>
    <removed>
      <filename>lib/authenticated_test_helper.rb</filename>
    </removed>
    <removed>
      <filename>public/dispatch.cgi</filename>
    </removed>
    <removed>
      <filename>public/dispatch.fcgi</filename>
    </removed>
    <removed>
      <filename>public/dispatch.rb</filename>
    </removed>
    <removed>
      <filename>public/images/background.png</filename>
    </removed>
    <removed>
      <filename>public/images/blog.png</filename>
    </removed>
    <removed>
      <filename>public/images/code.png</filename>
    </removed>
    <removed>
      <filename>public/images/link.png</filename>
    </removed>
    <removed>
      <filename>public/images/quote.png</filename>
    </removed>
    <removed>
      <filename>public/images/video.png</filename>
    </removed>
    <removed>
      <filename>script/performance/request</filename>
    </removed>
    <removed>
      <filename>script/process/inspector</filename>
    </removed>
    <removed>
      <filename>script/process/reaper</filename>
    </removed>
    <removed>
      <filename>script/process/spawner</filename>
    </removed>
    <removed>
      <filename>test/fixtures/comments.yml</filename>
    </removed>
    <removed>
      <filename>test/fixtures/posts.yml</filename>
    </removed>
    <removed>
      <filename>test/fixtures/users.yml</filename>
    </removed>
    <removed>
      <filename>test/functional/sessions_controller_test.rb</filename>
    </removed>
    <removed>
      <filename>test/functional/users_controller_test.rb</filename>
    </removed>
    <removed>
      <filename>test/unit/user_mailer_test.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/exception_notification/README</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/exception_notification/init.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/exception_notification/lib/exception_notifiable.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/exception_notification/lib/exception_notifier.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/exception_notification/lib/exception_notifier_helper.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/exception_notification/test/exception_notifier_helper_test.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/exception_notification/test/test_helper.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/exception_notification/views/exception_notifier/_backtrace.rhtml</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/exception_notification/views/exception_notifier/_environment.rhtml</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/exception_notification/views/exception_notifier/_inspect_model.rhtml</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/exception_notification/views/exception_notifier/_request.rhtml</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/exception_notification/views/exception_notifier/_session.rhtml</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/exception_notification/views/exception_notifier/_title.rhtml</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/exception_notification/views/exception_notifier/exception_notification.rhtml</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/gravatar/MIT-LICENSE</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/gravatar/README</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/gravatar/Rakefile</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/gravatar/about.yml</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/gravatar/init.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/gravatar/lib/gravatar.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/gravatar/spec/gravatar_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/permalink_fu/README</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/.gitignore</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/CHANGELOG</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/MIT-LICENSE</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/README.rdoc</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/Rakefile</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/SPECDOC</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/TODO</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/garlic_example.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/init.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/lib/ardes/resources_controller.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/lib/ardes/resources_controller/actions.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/lib/ardes/resources_controller/helper.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/lib/ardes/resources_controller/named_route_helper.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/lib/ardes/resources_controller/singleton_actions.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/lib/ardes/resources_controller/specification.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/app.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/accounts_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/addresses_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/admin_forums_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/comments_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/forum_posts_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/forums_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/infos_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/interests_controller_via_forum_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/interests_controller_via_user_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/owners_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/tags_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/tags_controller_via_account_info_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/tags_controller_via_forum_post_comment_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/tags_controller_via_forum_post_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/tags_controller_via_forum_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/tags_controller_via_user_address_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/controllers/users_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/spec_helper.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/specs/action_view_helper_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/specs/load_enclosing_resources_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/specs/resources_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/resources_controller/spec/specs/route_enclosing_names_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/.gitignore</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/CHANGELOG</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/MIT-LICENSE</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/README.rdoc</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/Rakefile</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/SPECDOC</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/garlic_example.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/init.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/lib/ardes/response_for.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/spec/app.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/spec/controllers/back_to_foo_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/spec/controllers/foo_bail_out_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/spec/controllers/foo_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/spec/controllers/inerited_controllers_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/spec/controllers/inline_xml_foo_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/spec/controllers/xml_foo_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/spec/controllers/xml_only_foo_controller_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/spec/spec_helper.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/response_for/spec/specs/action_responses_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/README</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/Rakefile</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/USAGE</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/authenticated_generator.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/activation.html.erb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/authenticated_system.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/authenticated_test_helper.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/controller.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/fixtures.yml</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/functional_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/functional_test.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/helper.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/login.html.erb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/mailer.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/mailer_test.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/migration.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/model.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/model_controller.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/model_functional_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/model_functional_test.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/model_helper.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/observer.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/signup.html.erb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/signup_notification.html.erb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/unit_spec.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/generators/authenticated/templates/unit_test.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/install.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/restful-authentication/lib/restful_authentication/rails_commands.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/.gitignore</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/.manifest</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/CHANGELOG</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/LICENSE</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/README.rdoc</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/Rakefile</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/examples/apple-circle.gif</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/examples/index.haml</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/examples/index.html</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/examples/pagination.css</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/examples/pagination.sass</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/init.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/lib/will_paginate.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/lib/will_paginate/array.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/lib/will_paginate/collection.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/lib/will_paginate/core_ext.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/lib/will_paginate/finder.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/lib/will_paginate/named_scope.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/lib/will_paginate/named_scope_patch.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/lib/will_paginate/version.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/boot.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/collection_test.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/console</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/database.yml</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/finder_test.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/fixtures/admin.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/fixtures/developer.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/fixtures/developers_projects.yml</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/fixtures/project.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/fixtures/projects.yml</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/fixtures/replies.yml</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/fixtures/reply.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/fixtures/schema.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/fixtures/topic.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/fixtures/topics.yml</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/fixtures/user.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/fixtures/users.yml</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/helper.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/lib/activerecord_test_case.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/lib/activerecord_test_connector.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/lib/load_fixtures.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/lib/view_test_process.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/tasks.rake</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/test/view_test.rb</filename>
    </removed>
    <removed>
      <filename>vendor/plugins/will_paginate/will_paginate.gemspec</filename>
    </removed>
  </removed>
  <parents type="array">
    <parent>
      <id>0696892c2e3df2badfdca89619d1f2841a992035</id>
    </parent>
  </parents>
  <author>
    <name>Andrew Nesbitt</name>
    <email>andrewnez@gmail.com</email>
  </author>
  <url>http://github.com/andrew/bumble/commit/dfa33946070394f35b492d4e519615a5e8d40cc6</url>
  <id>dfa33946070394f35b492d4e519615a5e8d40cc6</id>
  <committed-date>2009-08-09T15:47:53-07:00</committed-date>
  <authored-date>2009-08-09T15:47:53-07:00</authored-date>
  <message>Complete rewrite</message>
  <tree>79c1bc59d9ec870308adcbaa3d536a92c81a48fa</tree>
  <committer>
    <name>Andrew Nesbitt</name>
    <email>andrewnez@gmail.com</email>
  </committer>
</commit>
